Diff for /src/sys/dev/disk/ata/ata-all.c between versions 1.8 and 1.9

version 1.8, 2003/11/09 02:22:34 version 1.9, 2003/11/30 20:14:18
Line 61 Line 61
 #include "ata-raid.h"  #include "ata-raid.h"
 #include "atapi-all.h"  #include "atapi-all.h"
   
   union ata_request {
           struct ad_request       ad;
           struct atapi_request    atapi;
   };
   
 /* device structures */  /* device structures */
 static  d_ioctl_t       ataioctl;  static  d_ioctl_t       ataioctl;
 static struct cdevsw ata_cdevsw = {    static struct cdevsw ata_cdevsw = {  
Line 97  static int ata_enclosure_status(struct a Line 102  static int ata_enclosure_status(struct a
 /* sysctl vars */  /* sysctl vars */
 SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters");  SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters");
   
   int ata_mpipe_size = 4;
   TUNABLE_INT("hw.ata.mpipe_size", &ata_mpipe_size);
   SYSCTL_INT(_hw_ata, OID_AUTO, mpipe_size, CTLFLAG_RW, &ata_mpipe_size, 0,
              "ATA global I/O pipeline max size");
   
   
 /* global vars */  /* global vars */
 devclass_t ata_devclass;  devclass_t ata_devclass;
   
Line 155  ata_probe(device_t dev) Line 166  ata_probe(device_t dev)
     ch->device[SLAVE].mode = ATA_PIO;      ch->device[SLAVE].mode = ATA_PIO;
     TAILQ_INIT(&ch->ata_queue);      TAILQ_INIT(&ch->ata_queue);
     TAILQ_INIT(&ch->atapi_queue);      TAILQ_INIT(&ch->atapi_queue);
   
       mpipe_init(&ch->req_mpipe, M_ATA, sizeof(union ata_request), 4, ata_mpipe_size);
       mpipe_init(&ch->dma_mpipe, M_DEVBUF, PAGE_SIZE, 4, ata_mpipe_size);
   
     return 0;      return 0;
           
 failure:  failure:
Line 286  ata_detach(device_t dev) Line 301  ata_detach(device_t dev)
     ch->r_altio = NULL;      ch->r_altio = NULL;
     ch->r_bmio = NULL;      ch->r_bmio = NULL;
     ch->r_irq = NULL;      ch->r_irq = NULL;
       mpipe_done(&ch->req_mpipe);
       mpipe_done(&ch->dma_mpipe);
   
     ATA_UNLOCK_CH(ch);      ATA_UNLOCK_CH(ch);
     return 0;      return 0;
 }  }
Line 435  ataioctl(dev_t dev, u_long cmd, caddr_t Line 453  ataioctl(dev_t dev, u_long cmd, caddr_t
                                  ATA_ATAPI_MASTER : ATA_ATAPI_SLAVE)))                                   ATA_ATAPI_MASTER : ATA_ATAPI_SLAVE)))
                 return ENODEV;                  return ENODEV;
   
            if (!(buf = malloc(iocmd->u.atapi.count, M_ATA, M_NOWAIT)))            if (!(buf = malloc(iocmd->u.atapi.count, M_ATA, M_WAITOK)))
                 return ENOMEM;                  return ENOMEM;
   
             if (iocmd->u.atapi.flags & ATAPI_CMD_WRITE) {              if (iocmd->u.atapi.flags & ATAPI_CMD_WRITE) {
Line 473  ata_getparam(struct ata_device *atadev, Line 491  ata_getparam(struct ata_device *atadev,
     struct ata_params *ata_parm;      struct ata_params *ata_parm;
     int retry = 0;      int retry = 0;
   
    if (!(ata_parm = malloc(sizeof(struct ata_params), M_ATA, M_NOWAIT))) {    if (!(ata_parm = malloc(sizeof(struct ata_params), M_ATA, M_WAITOK))) {
         ata_prtdev(atadev, "malloc for identify data failed\n");          ata_prtdev(atadev, "malloc for identify data failed\n");
         return -1;          return -1;
     }      }
Line 1400  ata_prtdev(struct ata_device *atadev, co Line 1418  ata_prtdev(struct ata_device *atadev, co
 void  void
 ata_set_name(struct ata_device *atadev, char *name, int lun)  ata_set_name(struct ata_device *atadev, char *name, int lun)
 {  {
    atadev->name = malloc(strlen(name) + 4, M_ATA, M_NOWAIT);    atadev->name = malloc(strlen(name) + 4, M_ATA, M_WAITOK);
     if (atadev->name)      if (atadev->name)
         sprintf(atadev->name, "%s%d", name, lun);          sprintf(atadev->name, "%s%d", name, lun);
 }  }
Line 1559  ata_init(void) Line 1577  ata_init(void)
     /* register boot attach to be run when interrupts are enabled */      /* register boot attach to be run when interrupts are enabled */
     if (!(ata_delayed_attach = (struct intr_config_hook *)      if (!(ata_delayed_attach = (struct intr_config_hook *)
                                malloc(sizeof(struct intr_config_hook),                                 malloc(sizeof(struct intr_config_hook),
                                      M_TEMP, M_NOWAIT | M_ZERO))) {                                      M_TEMP, M_WAITOK | M_ZERO))) {
         printf("ata: malloc of delayed attach hook failed\n");          printf("ata: malloc of delayed attach hook failed\n");
         return;          return;
     }      }

Removed from v.1.8  
changed lines
  Added in v.1.9