home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / unix / bsd / 8690 < prev    next >
Encoding:
Text File  |  1992-11-10  |  5.1 KB  |  160 lines

  1. Newsgroups: comp.unix.bsd
  2. Path: sparky!uunet!ferkel.ucsb.edu!taco!gatech!swrinde!sdd.hp.com!elroy.jpl.nasa.gov!decwrl!decwrl!pa.dec.com!vixie
  3. From: vixie@pa.dec.com (Paul A Vixie)
  4. Subject: Re: MicroVax II, Reno & Emulex
  5. In-Reply-To: love@stacken.kth.se's message of Tue, 10 Nov 1992 13:45:25 GMT
  6. Message-ID: <VIXIE.92Nov10105037@cognition.pa.dec.com>
  7. Sender: news@PA.dec.com (News)
  8. Organization: DEC Network Software Lab
  9. References: <1992Nov10.134525.6346@kth.se>
  10. Date: 10 Nov 92 10:50:37
  11. Lines: 147
  12.  
  13. The UDA50 software interface is not as well-defined as the manual would
  14. like you to believe.  Every UDA50-lookalike is a little bit different,
  15. and to make it work on your Emulex you will probably need to hack.  That
  16. said, here are mine, which work on a KDA50 (QBUS version).  It has patches
  17. from the net, from Chris Torek, and from personal experience.  Runs on Reno.
  18. You will have the best luck with this if you gen your kernel with
  19. "options QBA", which you are probably already doing since you have a GPX.
  20.  
  21. *** uda.c.orig    Sat Jul 11 18:59:45 1992
  22. --- uda.c    Sun Jul 12 01:58:51 1992
  23. ***************
  24. *** 211,215 ****
  25.   struct    disklabel udalabel[NRA];
  26.   
  27. ! u_short    udastd[] = { 0772150, 0772550, 0777550, 0 };
  28.   struct    uba_driver udadriver =
  29.    { udaprobe, udaslave, udaattach, udadgo, udastd, "ra", udadinfo, "uda",
  30. --- 211,215 ----
  31.   struct    disklabel udalabel[NRA];
  32.   
  33. ! u_short    udastd[] = { 0772150, 0760334, 0772550, 0777550, 0 };
  34.   struct    uba_driver udadriver =
  35.    { udaprobe, udaslave, udaattach, udadgo, udastd, "ra", udadinfo, "uda",
  36. ***************
  37. *** 336,344 ****
  38.        * this manual myself.
  39.        */
  40. - #if defined(QBA) && !defined(GENERIC)
  41. -     s = spl6();
  42. - #endif
  43.       tries = 0;
  44.   again:
  45.       udaddr->udaip = 0;        /* start initialisation */
  46.       timeout = todr() + 1000;    /* timeout in 10 seconds */
  47. --- 336,345 ----
  48.        * this manual myself.
  49.        */
  50.       tries = 0;
  51.   again:
  52. + #if defined(QBA) && !defined(GENERIC)
  53. +     sc->sc_ipl = 0;            /* magic cookie */
  54. +     s = splx(0x17);            /* BR3 */
  55. + #endif
  56.       udaddr->udaip = 0;        /* start initialisation */
  57.       timeout = todr() + 1000;    /* timeout in 10 seconds */
  58. ***************
  59. *** 346,362 ****
  60.           if (todr() > timeout)
  61.               goto bad;
  62.       udaddr->udasa = UDA_ERR | (NCMDL2 << 11) | (NRSPL2 << 8) | UDA_IE |
  63.           (sc->sc_ivec >> 2);
  64. !     while ((udaddr->udasa & UDA_STEP2) == 0)
  65. !         if (todr() > timeout)
  66.               goto bad;
  67.   
  68.       /* should have interrupted by now */
  69.   #ifdef QBA
  70.   #ifndef GENERIC
  71. !     sc->sc_ipl = br = qbgetpri();
  72.   #else
  73. !     sc->sc_ipl = br = 0x15;
  74.   #endif
  75.   #endif
  76.       return (sizeof (struct udadevice));
  77. --- 347,393 ----
  78.           if (todr() > timeout)
  79.               goto bad;
  80. +     /* if we get here, we should conclude an MSCP ctlr is present*/
  81. +     /* program the vector, enable interrupts, and initialize */
  82.       udaddr->udasa = UDA_ERR | (NCMDL2 << 11) | (NRSPL2 << 8) | UDA_IE |
  83.           (sc->sc_ivec >> 2);
  84. !     while ((udaddr->udasa & UDA_STEP2) == 0) {
  85. !         if (todr() > timeout) {
  86. ! #if defined(QBA) && !defined(GENERIC)
  87. !     /* The ctlr is there, but failed to acknowledge that we
  88. !      * enabled interrupts.  Perhaps the ctlr is a KDA-50. Before a
  89. !      * KDA-50 sets this bit it requests an interrupt, and doesn't
  90. !      * set the bit until the CPU acks the interrupt.  But we are
  91. !      * running with the CPU at spl6() so that qbgetpri() will work,
  92. !      * which means the interrupt isn't granted and the ctlr appears dead.
  93. !      * Gross hack: drop the CPU priority and see if the ctlr responds
  94. !      * quickly. If so, give up on qbgetpri().
  95. !      *
  96. !      * (comment and idea from usenet; code below by paul vixie (25may92)
  97. !      */
  98. !             int pri;
  99. !             for (pri = 0x17;  pri >= 0x14;  pri--) {
  100. !                 splx(pri - 1);
  101. !                 if (udaddr->udasa & UDA_STEP2) {
  102. !                     sc->sc_ipl = br = pri;
  103. !                     break;
  104. !                 }
  105. !             }
  106. ! #else /*QBA && !GENERIC*/
  107.               goto bad;
  108. + #endif /*QBA && !GENERIC*/
  109. +         } /* if timeout */
  110. +     } /* while !STEP2 */
  111.   
  112.       /* should have interrupted by now */
  113.   #ifdef QBA
  114. +     if (!sc->sc_ipl) {
  115.   #ifndef GENERIC
  116. !         sc->sc_ipl = br = qbgetpri();
  117.   #else
  118. !         sc->sc_ipl = br = 0x15;
  119.   #endif
  120. +     }
  121.   #endif
  122.       return (sizeof (struct udadevice));
  123. ***************
  124. *** 2298,2301 ****
  125. --- 2329,2334 ----
  126.       register struct disklabel *lp;
  127.   {
  128. +     register int part;
  129.       lp->d_nsectors = ra->ra_geom.rg_nsectors;
  130.       lp->d_ntracks = ra->ra_geom.rg_ntracks;
  131. ***************
  132. *** 2303,2309 ****
  133.       lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks;
  134.       bcopy("ra??", lp->d_typename, sizeof("ra??"));
  135. !     lp->d_npartitions = 1;
  136. !     lp->d_partitions[0].p_offset = 0;
  137. !     lp->d_partitions[0].p_size = lp->d_secperunit;
  138.   }
  139.   #endif /* NUDA > 0 */
  140. --- 2336,2346 ----
  141.       lp->d_secpercyl = lp->d_nsectors * lp->d_ntracks;
  142.       bcopy("ra??", lp->d_typename, sizeof("ra??"));
  143. !     for (part = 0;  part < RAWPART;  part++) {
  144. !         lp->d_partitions[part].p_offset = 0;
  145. !         lp->d_partitions[part].p_size = 0;
  146. !     }
  147. !     lp->d_partitions[part].p_offset = 0;
  148. !     lp->d_partitions[part].p_size = lp->d_secperunit;
  149. !     lp->d_npartitions = part+1;
  150.   }
  151.   #endif /* NUDA > 0 */
  152. --
  153. Paul Vixie, DEC Network Systems Lab    
  154. Palo Alto, California, USA             "Don't be a rebel, or a conformist;
  155. <vixie@pa.dec.com> decwrl!vixie        they're the same thing, anyway.  Find
  156. <paul@vix.com>     vixie!paul        your own path, and stay on it."  -me
  157.