[BACK]Return to fd.c CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / sys / arch / acorn32 / mainbus

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /src/sys/arch/acorn32/mainbus/fd.c between version 1.37 and 1.37.10.2

version 1.37, 2008/01/08 06:29:39 version 1.37.10.2, 2009/05/04 08:10:26
Line 15 
Line 15 
  * 2. Redistributions in binary form must reproduce the above copyright   * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the   *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.   *    documentation and/or other materials provided with the distribution.
  * 3. All advertising materials mentioning features or use of this software  
  *    must display the following acknowledgement:  
  *        This product includes software developed by the NetBSD  
  *        Foundation, Inc. and its contributors.  
  * 4. Neither the name of The NetBSD Foundation nor the names of its  
  *    contributors may be used to endorse or promote products derived  
  *    from this software without specific prior written permission.  
  *   *
  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS   * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED   * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
Line 181  struct fdc_softc {
Line 174  struct fdc_softc {
 };  };
   
 /* controller driver configuration */  /* controller driver configuration */
 int fdcprobe __P((struct device *, struct cfdata *, void *));  int fdcprobe(struct device *, struct cfdata *, void *);
 int fdprint __P((void *, const char *));  int fdprint(void *, const char *);
 void fdcattach __P((struct device *, struct device *, void *));  void fdcattach(struct device *, struct device *, void *);
   
 CFATTACH_DECL(fdc, sizeof(struct fdc_softc),  CFATTACH_DECL(fdc, sizeof(struct fdc_softc),
     fdcprobe, fdcattach, NULL, NULL);      fdcprobe, fdcattach, NULL, NULL);
Line 256  struct fd_softc {
Line 249  struct fd_softc {
 };  };
   
 /* floppy driver configuration */  /* floppy driver configuration */
 int fdprobe __P((struct device *, struct cfdata *, void *));  int fdprobe(struct device *, struct cfdata *, void *);
 void fdattach __P((struct device *, struct device *, void *));  void fdattach(struct device *, struct device *, void *);
   
 extern char floppy_read_fiq[], floppy_read_fiq_end[];  extern char floppy_read_fiq[], floppy_read_fiq_end[];
 extern char floppy_write_fiq[], floppy_write_fiq_end[];  extern char floppy_write_fiq[], floppy_write_fiq_end[];
Line 283  const struct cdevsw fd_cdevsw = {
Line 276  const struct cdevsw fd_cdevsw = {
         nostop, notty, nopoll, nommap, nokqfilter, D_DISK          nostop, notty, nopoll, nommap, nokqfilter, D_DISK
 };  };
   
 void fdgetdisklabel __P((struct fd_softc *));  void fdgetdisklabel(struct fd_softc *);
 int fd_get_parms __P((struct fd_softc *));  int fd_get_parms(struct fd_softc *);
 void fdstart __P((struct fd_softc *));  void fdstart(struct fd_softc *);
   
 struct dkdriver fddkdriver = { fdstrategy };  struct dkdriver fddkdriver = { fdstrategy };
   
 struct fd_type *fd_nvtotype __P((char *, int, int));  struct fd_type *fd_nvtotype(char *, int, int);
 void fd_set_motor __P((struct fdc_softc *fdc, int reset));  void fd_set_motor(struct fdc_softc *fdc, int reset);
 void fd_motor_off __P((void *arg));  void fd_motor_off(void *arg);
 void fd_motor_on __P((void *arg));  void fd_motor_on(void *arg);
 int fdcresult __P((struct fdc_softc *fdc));  int fdcresult(struct fdc_softc *fdc);
 int out_fdc __P((bus_space_tag_t iot, bus_space_handle_t ioh, u_char x));  int out_fdc(bus_space_tag_t iot, bus_space_handle_t ioh, u_char x);
 void fdcstart __P((struct fdc_softc *fdc));  void fdcstart(struct fdc_softc *fdc);
 void fdcstatus __P((struct device *dv, int n, const char *s));  void fdcstatus(struct device *dv, int n, const char *s);
 void fdctimeout __P((void *arg));  void fdctimeout(void *arg);
 void fdcpseudointr __P((void *arg));  void fdcpseudointr(void *arg);
 int fdcintr __P((void *));  int fdcintr(void *);
 void fdcretry __P((struct fdc_softc *fdc));  void fdcretry(struct fdc_softc *fdc);
 void fdfinish __P((struct fd_softc *fd, struct buf *bp));  void fdfinish(struct fd_softc *fd, struct buf *bp);
 inline struct fd_type *fd_dev_to_type __P((struct fd_softc *, dev_t));  inline struct fd_type *fd_dev_to_type(struct fd_softc *, dev_t);
 int fdformat __P((dev_t, struct ne7_fd_formb *, struct lwp *));  int fdformat(dev_t, struct ne7_fd_formb *, struct lwp *);
   
 int  int
 fdcprobe(parent, cf, aux)  fdcprobe(struct device *parent, struct cfdata *cf, void *aux)
         struct device *parent;  
         struct cfdata *cf;  
         void *aux;  
 {  {
         struct pioc_attach_args *pa = aux;          struct pioc_attach_args *pa = aux;
         bus_space_tag_t iot;          bus_space_tag_t iot;
Line 361  struct fdc_attach_args {
Line 351  struct fdc_attach_args {
  * avoid printing `fdN not configured' messages.   * avoid printing `fdN not configured' messages.
  */   */
 int  int
 fdprint(aux, fdc)  fdprint(void *aux, const char *fdc)
         void *aux;  
         const char *fdc;  
 {  {
         register struct fdc_attach_args *fa = aux;          register struct fdc_attach_args *fa = aux;
   
Line 373  fdprint(aux, fdc)
Line 361  fdprint(aux, fdc)
 }  }
   
 void  void
 fdcattach(parent, self, aux)  fdcattach(struct device *parent, struct device *self, void *aux)
         struct device *parent, *self;  
         void *aux;  
 {  {
         struct fdc_softc *fdc = (void *)self;          struct fdc_softc *fdc = (void *)self;
         bus_space_tag_t iot;          bus_space_tag_t iot;
Line 431  fdcattach(parent, self, aux)
Line 417  fdcattach(parent, self, aux)
 }  }
   
 int  int
 fdprobe(parent, cf, aux)  fdprobe(struct device *parent, struct cfdata *cf, void *aux)
         struct device *parent;  
         struct cfdata *cf;  
         void *aux;  
 {  {
         struct fdc_softc *fdc = (void *)parent;          struct fdc_softc *fdc = (void *)parent;
         struct fdc_attach_args *fa = aux;          struct fdc_attach_args *fa = aux;
Line 489  fdprobe(parent, cf, aux)
Line 472  fdprobe(parent, cf, aux)
  * Controller is working, and drive responded.  Attach it.   * Controller is working, and drive responded.  Attach it.
  */   */
 void  void
 fdattach(parent, self, aux)  fdattach(struct device *parent, struct device *self, void *aux)
         struct device *parent, *self;  
         void *aux;  
 {  {
         struct fdc_softc *fdc = (void *)parent;          struct fdc_softc *fdc = (void *)parent;
         struct fd_softc *fd = (void *)self;          struct fd_softc *fd = (void *)self;
Line 531  fdattach(parent, self, aux)
Line 512  fdattach(parent, self, aux)
  * none/unknown/unusable.   * none/unknown/unusable.
  */   */
 struct fd_type *  struct fd_type *
 fd_nvtotype(fdc, nvraminfo, drive)  fd_nvtotype(char *fdc, int nvraminfo, int drive)
         char *fdc;  
         int nvraminfo, drive;  
 {  {
         int type;          int type;
   
Line 555  fd_nvtotype(fdc, nvraminfo, drive)
Line 534  fd_nvtotype(fdc, nvraminfo, drive)
 }  }
   
 inline struct fd_type *  inline struct fd_type *
 fd_dev_to_type(fd, dev)  fd_dev_to_type(struct fd_softc *fd, dev_t dev)
         struct fd_softc *fd;  
         dev_t dev;  
 {  {
         int type = FDTYPE(dev);          int type = FDTYPE(dev);
   
Line 567  fd_dev_to_type(fd, dev)
Line 544  fd_dev_to_type(fd, dev)
 }  }
   
 void  void
 fdstrategy(bp)  fdstrategy(struct buf *bp)
         register struct buf *bp;        /* IO operation to perform */  
 {  {
         struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(bp->b_dev)];          struct fd_softc *fd = device_lookup_private(&fd_cd,FDUNIT(bp->b_dev));
         int sz;          int sz;
         int s;          int s;
   
Line 613  fdstrategy(bp)
Line 589  fdstrategy(bp)
   
         /* Queue transfer on drive, activate drive and controller if idle. */          /* Queue transfer on drive, activate drive and controller if idle. */
         s = splbio();          s = splbio();
         BUFQ_PUT(fd->sc_q, bp);          bufq_put(fd->sc_q, bp);
         callout_stop(&fd->sc_motoroff_ch);              /* a good idea */          callout_stop(&fd->sc_motoroff_ch);              /* a good idea */
         if (fd->sc_active == 0)          if (fd->sc_active == 0)
                 fdstart(fd);                  fdstart(fd);
Line 636  done:
Line 612  done:
 }  }
   
 void  void
 fdstart(fd)  fdstart(struct fd_softc *fd)
         struct fd_softc *fd;  
 {  {
         struct fdc_softc *fdc = (void *) device_parent(&fd->sc_dev);          struct fdc_softc *fdc = (void *) device_parent(&fd->sc_dev);
         int active = fdc->sc_drives.tqh_first != 0;          int active = fdc->sc_drives.tqh_first != 0;
Line 652  fdstart(fd)
Line 627  fdstart(fd)
 }  }
   
 void  void
 fdfinish(fd, bp)  fdfinish(struct fd_softc *fd, struct buf *bp)
         struct fd_softc *fd;  
         struct buf *bp;  
 {  {
         struct fdc_softc *fdc = (void *) device_parent(&fd->sc_dev);          struct fdc_softc *fdc = (void *) device_parent(&fd->sc_dev);
   
Line 664  fdfinish(fd, bp)
Line 637  fdfinish(fd, bp)
          * another drive is waiting to be serviced, since there is a long motor           * another drive is waiting to be serviced, since there is a long motor
          * startup delay whenever we switch.           * startup delay whenever we switch.
          */           */
         (void)BUFQ_GET(fd->sc_q);          (void)bufq_get(fd->sc_q);
         if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {          if (fd->sc_drivechain.tqe_next && ++fd->sc_ops >= 8) {
                 fd->sc_ops = 0;                  fd->sc_ops = 0;
                 TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);                  TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
                 if (BUFQ_PEEK(fd->sc_q) != NULL)                  if (bufq_peek(fd->sc_q) != NULL)
                         TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);                          TAILQ_INSERT_TAIL(&fdc->sc_drives, fd, sc_drivechain);
                 else                  else
                         fd->sc_active = 0;                          fd->sc_active = 0;
Line 683  fdfinish(fd, bp)
Line 656  fdfinish(fd, bp)
 }  }
   
 int  int
 fdread(dev, uio, flags)  fdread(dev_t dev, struct uio *uio, int flags)
         dev_t dev;  
         struct uio *uio;  
         int flags;  
 {  {
   
         return (physio(fdstrategy, NULL, dev, B_READ, minphys, uio));          return (physio(fdstrategy, NULL, dev, B_READ, minphys, uio));
 }  }
   
 int  int
 fdwrite(dev, uio, flags)  fdwrite(dev_t dev, struct uio *uio, int flags)
         dev_t dev;  
         struct uio *uio;  
         int flags;  
 {  {
   
         return (physio(fdstrategy, NULL, dev, B_WRITE, minphys, uio));          return (physio(fdstrategy, NULL, dev, B_WRITE, minphys, uio));
 }  }
   
 void  void
 fd_set_motor(fdc, reset)  fd_set_motor(struct fdc_softc *fdc, int reset)
         struct fdc_softc *fdc;  
         int reset;  
 {  {
         struct fd_softc *fd;          struct fd_softc *fd;
         u_char status;          u_char status;
Line 724  fd_set_motor(fdc, reset)
Line 689  fd_set_motor(fdc, reset)
 }  }
   
 void  void
 fd_motor_off(arg)  fd_motor_off(void *arg)
         void *arg;  
 {  {
         struct fd_softc *fd = arg;          struct fd_softc *fd = arg;
         int s;          int s;
Line 737  fd_motor_off(arg)
Line 701  fd_motor_off(arg)
 }  }
   
 void  void
 fd_motor_on(arg)  fd_motor_on(void *arg)
         void *arg;  
 {  {
         struct fd_softc *fd = arg;          struct fd_softc *fd = arg;
         struct fdc_softc *fdc = (void *) device_parent(&fd->sc_dev);          struct fdc_softc *fdc = (void *) device_parent(&fd->sc_dev);
Line 752  fd_motor_on(arg)
Line 715  fd_motor_on(arg)
 }  }
   
 int  int
 fdcresult(fdc)  fdcresult(struct fdc_softc *fdc)
         struct fdc_softc *fdc;  
 {  {
         bus_space_tag_t iot = fdc->sc_iot;          bus_space_tag_t iot = fdc->sc_iot;
         bus_space_handle_t ioh = fdc->sc_ioh;          bus_space_handle_t ioh = fdc->sc_ioh;
Line 781  fdcresult(fdc)
Line 743  fdcresult(fdc)
 }  }
   
 int  int
 out_fdc(iot, ioh, x)  out_fdc(bus_space_tag_t iot, bus_space_handle_t ioh, u_char x)
         bus_space_tag_t iot;  
         bus_space_handle_t ioh;  
         u_char x;  
 {  {
         int i = 100000;          int i = 100000;
   
Line 799  out_fdc(iot, ioh, x)
Line 758  out_fdc(iot, ioh, x)
 }  }
   
 int  int
 fdopen(dev, flags, mode, l)  fdopen(dev_t dev, int flags, int mode, struct lwp *l)
         dev_t dev;  
         int flags;  
         int mode;  
         struct lwp *l;  
 {  {
         int unit;  
         struct fd_softc *fd;          struct fd_softc *fd;
         struct fd_type *type;          struct fd_type *type;
   
         unit = FDUNIT(dev);          fd = device_lookup_private(&fd_cd, FDUNIT(dev));
         if (unit >= fd_cd.cd_ndevs)          if (fd == NULL)
                 return ENXIO;  
         fd = fd_cd.cd_devs[unit];  
         if (fd == 0)  
                 return ENXIO;                  return ENXIO;
         type = fd_dev_to_type(fd, dev);          type = fd_dev_to_type(fd, dev);
         if (type == NULL)          if (type == NULL)
Line 832  fdopen(dev, flags, mode, l)
Line 783  fdopen(dev, flags, mode, l)
 }  }
   
 int  int
 fdclose(dev, flags, mode, l)  fdclose(dev_t dev, int flags, int mode, struct lwp *l)
         dev_t dev;  
         int flags;  
         int mode;  
         struct lwp *l;  
 {  {
         struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];          struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
   
         fd->sc_flags &= ~FD_OPEN;          fd->sc_flags &= ~FD_OPEN;
         fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);          fd->sc_opts &= ~(FDOPT_NORETRY|FDOPT_SILENT);
Line 846  fdclose(dev, flags, mode, l)
Line 793  fdclose(dev, flags, mode, l)
 }  }
   
 void  void
 fdcstart(fdc)  fdcstart(struct fdc_softc *fdc)
         struct fdc_softc *fdc;  
 {  {
   
 #ifdef DIAGNOSTIC  #ifdef DIAGNOSTIC
Line 861  fdcstart(fdc)
Line 807  fdcstart(fdc)
         (void) fdcintr(fdc);          (void) fdcintr(fdc);
 }  }
   
 void  static void
 fdcstatus(dv, n, s)  fdcpstatus(int n, struct fdc_softc *fdc)
         struct device *dv;  
         int n;  
         const char *s;  
 {  {
         struct fdc_softc *fdc = (void *) device_parent(dv);  
         char bits[64];          char bits[64];
   
         if (n == 0) {  
                 out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);  
                 (void) fdcresult(fdc);  
                 n = 2;  
         }  
   
         printf("%s: %s", dv->dv_xname, s);  
   
         switch (n) {          switch (n) {
         case 0:          case 0:
                 printf("\n");                  printf("\n");
                 break;                  break;
         case 2:          case 2:
                 printf(" (st0 %s cyl %d)\n",                  snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
                     bitmask_snprintf(fdc->sc_status[0], NE7_ST0BITS,                  printf(" (st0 %s cyl %d)\n", bits, fdc->sc_status[1]);
                     bits, sizeof(bits)), fdc->sc_status[1]);  
                 break;                  break;
         case 7:          case 7:
                 printf(" (st0 %s", bitmask_snprintf(fdc->sc_status[0],                  snprintb(bits, sizeof(bits), NE7_ST0BITS, fdc->sc_status[0]);
                     NE7_ST0BITS, bits, sizeof(bits)));                  printf(" (st0 %s", bits);
                 printf(" st1 %s", bitmask_snprintf(fdc->sc_status[1],                  snprintb(bits, sizeof(bits), NE7_ST1BITS, fdc->sc_status[1]);
                     NE7_ST1BITS, bits, sizeof(bits)));                  printf(" st1 %s", bits);
                 printf(" st2 %s", bitmask_snprintf(fdc->sc_status[2],                  snprintb(bits, sizeof(bits), NE7_ST2BITS, fdc->sc_status[2]);
                     NE7_ST2BITS, bits, sizeof(bits)));                  printf(" st2 %s", bits);
                 printf(" cyl %d head %d sec %d)\n",                  printf(" cyl %d head %d sec %d)\n",
                     fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);                      fdc->sc_status[3], fdc->sc_status[4], fdc->sc_status[5]);
                 break;                  break;
Line 906  fdcstatus(dv, n, s)
Line 839  fdcstatus(dv, n, s)
 }  }
   
 void  void
 fdctimeout(arg)  fdcstatus(struct device *dv, int n, const char *s)
         void *arg;  {
           struct fdc_softc *fdc = (void *) device_parent(dv);
   
           if (n == 0) {
                   out_fdc(fdc->sc_iot, fdc->sc_ioh, NE7CMD_SENSEI);
                   (void) fdcresult(fdc);
                   n = 2;
           }
   
           printf("%s: %s", dv->dv_xname, s);
           fdcpstatus(n, fdc);
   }
   
   void
   fdctimeout(void *arg)
 {  {
         struct fdc_softc *fdc = arg;          struct fdc_softc *fdc = arg;
         struct fd_softc *fd = fdc->sc_drives.tqh_first;          struct fd_softc *fd = fdc->sc_drives.tqh_first;
Line 919  fdctimeout(arg)
Line 866  fdctimeout(arg)
 #endif  #endif
         fdcstatus(&fd->sc_dev, 0, "timeout");          fdcstatus(&fd->sc_dev, 0, "timeout");
   
         if (BUFQ_PEEK(fd->sc_q) != NULL)          if (bufq_peek(fd->sc_q) != NULL)
                 fdc->sc_state++;                  fdc->sc_state++;
         else          else
                 fdc->sc_state = DEVIDLE;                  fdc->sc_state = DEVIDLE;
Line 929  fdctimeout(arg)
Line 876  fdctimeout(arg)
 }  }
   
 void  void
 fdcpseudointr(arg)  fdcpseudointr(void *arg)
         void *arg;  
 {  {
         int s;          int s;
   
Line 941  fdcpseudointr(arg)
Line 887  fdcpseudointr(arg)
 }  }
   
 int  int
 fdcintr(arg)  fdcintr(void *arg)
         void *arg;  
 {  {
         struct fdc_softc *fdc = arg;          struct fdc_softc *fdc = arg;
 #define st0     fdc->sc_status[0]  #define st0     fdc->sc_status[0]
Line 964  loop:
Line 909  loop:
         }          }
   
         /* Is there a transfer to this drive?  If not, deactivate drive. */          /* Is there a transfer to this drive?  If not, deactivate drive. */
         bp = BUFQ_PEEK(fd->sc_q);          bp = bufq_peek(fd->sc_q);
         if (bp == NULL) {          if (bp == NULL) {
                 fd->sc_ops = 0;                  fd->sc_ops = 0;
                 TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);                  TAILQ_REMOVE(&fdc->sc_drives, fd, sc_drivechain);
Line 1260  loop:
Line 1205  loop:
 }  }
   
 void  void
 fdcretry(fdc)  fdcretry(struct fdc_softc *fdc)
         struct fdc_softc *fdc;  
 {  {
         char bits[64];  
         struct fd_softc *fd;          struct fd_softc *fd;
         struct buf *bp;          struct buf *bp;
   
         fd = fdc->sc_drives.tqh_first;          fd = fdc->sc_drives.tqh_first;
         bp = BUFQ_PEEK(fd->sc_q);          bp = bufq_peek(fd->sc_q);
   
         if (fd->sc_opts & FDOPT_NORETRY)          if (fd->sc_opts & FDOPT_NORETRY)
             goto fail;              goto fail;
Line 1294  fdcretry(fdc)
Line 1237  fdcretry(fdc)
                         diskerr(bp, "fd", "hard error", LOG_PRINTF,                          diskerr(bp, "fd", "hard error", LOG_PRINTF,
                                 fd->sc_skip / FDC_BSIZE,                                  fd->sc_skip / FDC_BSIZE,
                                 (struct disklabel *)NULL);                                  (struct disklabel *)NULL);
                           fdcpstatus(7, fdc);
                         printf(" (st0 %s",  
                                bitmask_snprintf(fdc->sc_status[0],  
                                                 NE7_ST0BITS, bits,  
                                                 sizeof(bits)));  
                         printf(" st1 %s",  
                                bitmask_snprintf(fdc->sc_status[1],  
                                                 NE7_ST1BITS, bits,  
                                                 sizeof(bits)));  
                         printf(" st2 %s",  
                                bitmask_snprintf(fdc->sc_status[2],  
                                                 NE7_ST2BITS, bits,  
                                                 sizeof(bits)));  
                         printf(" cyl %d head %d sec %d)\n",  
                                fdc->sc_status[3],  
                                fdc->sc_status[4],  
                                fdc->sc_status[5]);  
                 }                  }
   
                 bp->b_error = EIO;                  bp->b_error = EIO;
Line 1320  fdcretry(fdc)
Line 1247  fdcretry(fdc)
 }  }
   
 int  int
 fdioctl(dev, cmd, addr, flag, l)  fdioctl(dev_t dev, u_long cmd, void *addr, int flag, struct lwp *l)
         dev_t dev;  
         u_long cmd;  
         void *addr;  
         int flag;  
         struct lwp *l;  
 {  {
         struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];          struct fd_softc *fd = device_lookup_private(&fd_cd, FDUNIT(dev));
         struct fdformat_parms *form_parms;          struct fdformat_parms *form_parms;
         struct fdformat_cmd *form_cmd;          struct fdformat_cmd *form_cmd;
         struct ne7_fd_formb *fd_formb;          struct ne7_fd_formb *fd_formb;
Line 1502  fdioctl(dev, cmd, addr, flag, l)
Line 1424  fdioctl(dev, cmd, addr, flag, l)
 }  }
   
 int  int
 fdformat(dev, finfo, l)  fdformat(dev_t dev, struct ne7_fd_formb *finfo, struct lwp *l)
         dev_t dev;  
         struct ne7_fd_formb *finfo;  
         struct lwp *l;  
 {  {
         int rv = 0;          int rv = 0;
         struct fd_softc *fd = fd_cd.cd_devs[FDUNIT(dev)];          struct fd_softc *fd = device_lookup_private(&fd_cd,FDUNIT(dev));
         struct fd_type *type = fd->sc_type;          struct fd_type *type = fd->sc_type;
         struct buf *bp;          struct buf *bp;
   
Line 1564  fdformat(dev, finfo, l)
Line 1483  fdformat(dev, finfo, l)
   
 #include <dev/md.h>  #include <dev/md.h>
   
 int load_memory_disc_from_floppy __P((struct md_conf *md, dev_t dev));  int load_memory_disc_from_floppy(struct md_conf *md, dev_t dev);
   
 int  int
 load_memory_disc_from_floppy(md, dev)  load_memory_disc_from_floppy(struct md_conf *md, dev_t dev)
         struct md_conf *md;  
         dev_t dev;  
 {  {
         struct buf *bp;          struct buf *bp;
         int loop;          int loop;
Line 1604  load_memory_disc_from_floppy(md, dev)
Line 1521  load_memory_disc_from_floppy(md, dev)
   
         bp->b_dev = dev;          bp->b_dev = dev;
   
         s = spl0();          s = splbio();
   
         if (fdopen(bp->b_dev, 0, 0, curlwp) != 0) {          if (fdopen(bp->b_dev, 0, 0, curlwp) != 0) {
                 brelse(bp, 0);                  brelse(bp, 0);

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.37.10.2

CVSweb <webmaster@jp.NetBSD.org>