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

version 1.7, 2003/08/07 21:16:51 version 1.8, 2003/11/30 20:14:18
Line 115  ad_attach(struct ata_device *atadev) Line 115  ad_attach(struct ata_device *atadev)
     struct ad_softc *adp;      struct ad_softc *adp;
     dev_t dev;      dev_t dev;
   
    if (!(adp = malloc(sizeof(struct ad_softc), M_AD, M_NOWAIT | M_ZERO))) {    if (!(adp = malloc(sizeof(struct ad_softc), M_AD, M_WAITOK | M_ZERO))) {
         ata_prtdev(atadev, "failed to allocate driver storage\n");          ata_prtdev(atadev, "failed to allocate driver storage\n");
         return;          return;
     }      }
   
       KKASSERT(atadev->channel->req_mpipe.max_count != 0);
   
     adp->device = atadev;      adp->device = atadev;
 #ifdef ATA_STATIC_ID  #ifdef ATA_STATIC_ID
     adp->lun = (device_get_unit(atadev->channel->dev)<<1)+ATA_DEV(atadev->unit);      adp->lun = (device_get_unit(atadev->channel->dev)<<1)+ATA_DEV(atadev->unit);
Line 397  ad_start(struct ata_device *atadev) Line 400  ad_start(struct ata_device *atadev)
             return;              return;
     }      }
   
    if (!(request = malloc(sizeof(struct ad_request), M_AD, M_NOWAIT|M_ZERO))) {    /*
        ata_prtdev(atadev, "out of memory in start\n");     * Allocate a request.  The allocation can only fail if the pipeline
      * is full, in which case the request will be picked up later when
      * ad_start() is called after another request completes.
      */
     request = mpipe_alloc(&atadev->channel->req_mpipe, M_NOWAIT|M_ZERO);
     if (request == NULL) {
         ata_prtdev(atadev, "pipeline full allocating request in ad_start\n");
         return;          return;
     }      }
   
Line 412  ad_start(struct ata_device *atadev) Line 421  ad_start(struct ata_device *atadev)
     if (bp->b_flags & B_READ)       if (bp->b_flags & B_READ) 
         request->flags |= ADR_F_READ;          request->flags |= ADR_F_READ;
     if (adp->device->mode >= ATA_DMA) {      if (adp->device->mode >= ATA_DMA) {
        if (!(request->dmatab = ata_dmaalloc(atadev->channel, atadev->unit)))        request->dmatab = ata_dmaalloc(atadev->channel, atadev->unit, M_NOWAIT);
            adp->device->mode = ATA_PIO;        if (request->dmatab == NULL) {
             mpipe_free(&atadev->channel->req_mpipe, request);
             ata_prtdev(atadev, "pipeline full allocated dmabuf in ad_start\n");
             /* do not revert to PIO, wait for ad_start after I/O completion */
             return;
         }
     }      }
   
     /* insert in tag array */      /* insert in tag array */
Line 804  ad_free(struct ad_request *request) Line 818  ad_free(struct ad_request *request)
     int s = splbio();      int s = splbio();
   
     if (request->dmatab)      if (request->dmatab)
        free(request->dmatab, M_DEVBUF);        ata_dmafree(request->softc->device->channel, request->dmatab);
     request->softc->tags[request->tag] = NULL;      request->softc->tags[request->tag] = NULL;
    free(request, M_AD);    mpipe_free(&request->softc->device->channel->req_mpipe, request);
     splx(s);      splx(s);
 }  }
   

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