diff options
Diffstat (limited to 'drivers/scsi/megaraid.c')
| -rw-r--r-- | drivers/scsi/megaraid.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c index 38976f94453e..9476a0d2c72d 100644 --- a/drivers/scsi/megaraid.c +++ b/drivers/scsi/megaraid.c @@ -372,11 +372,11 @@ mega_runpendq(adapter_t *adapter) * * The command queuing entry point for the mid-layer. */ -static int megaraid_queue_lck(struct scsi_cmnd *scmd) +static enum scsi_qc_status megaraid_queue_lck(struct scsi_cmnd *scmd) { adapter_t *adapter; scb_t *scb; - int busy=0; + enum scsi_qc_status busy = 0; unsigned long flags; adapter = (adapter_t *)scmd->device->host->hostdata; @@ -518,7 +518,8 @@ mega_get_ldrv_num(adapter_t *adapter, struct scsi_cmnd *cmd, int channel) * boot settings. */ static scb_t * -mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) +mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, + enum scsi_qc_status *busy) { mega_passthru *pthru; scb_t *scb; @@ -640,7 +641,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) } if(!(scb = mega_allocate_scb(adapter, cmd))) { - *busy = 1; + *busy = SCSI_MLQUEUE_HOST_BUSY; return NULL; } @@ -688,7 +689,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) /* Allocate a SCB and initialize passthru */ if(!(scb = mega_allocate_scb(adapter, cmd))) { - *busy = 1; + *busy = SCSI_MLQUEUE_HOST_BUSY; return NULL; } pthru = scb->pthru; @@ -730,7 +731,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) /* Allocate a SCB and initialize mailbox */ if(!(scb = mega_allocate_scb(adapter, cmd))) { - *busy = 1; + *busy = SCSI_MLQUEUE_HOST_BUSY; return NULL; } mbox = (mbox_t *)scb->raw_mbox; @@ -855,8 +856,8 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) return scb; #if MEGA_HAVE_CLUSTERING - case RESERVE: - case RELEASE: + case RESERVE_6: + case RELEASE_6: /* * Do we support clustering and is the support enabled @@ -870,12 +871,12 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) /* Allocate a SCB and initialize mailbox */ if(!(scb = mega_allocate_scb(adapter, cmd))) { - *busy = 1; + *busy = SCSI_MLQUEUE_HOST_BUSY; return NULL; } scb->raw_mbox[0] = MEGA_CLUSTER_CMD; - scb->raw_mbox[2] = ( *cmd->cmnd == RESERVE ) ? + scb->raw_mbox[2] = *cmd->cmnd == RESERVE_6 ? MEGA_RESERVE_LD : MEGA_RELEASE_LD; scb->raw_mbox[3] = ldrv_num; @@ -898,7 +899,7 @@ mega_build_cmd(adapter_t *adapter, struct scsi_cmnd *cmd, int *busy) else { /* Allocate a SCB and initialize passthru */ if(!(scb = mega_allocate_scb(adapter, cmd))) { - *busy = 1; + *busy = SCSI_MLQUEUE_HOST_BUSY; return NULL; } @@ -1618,8 +1619,8 @@ mega_cmd_done(adapter_t *adapter, u8 completed[], int nstatus, int status) * failed or the input parameter is invalid */ if( status == 1 && - (cmd->cmnd[0] == RESERVE || - cmd->cmnd[0] == RELEASE) ) { + (cmd->cmnd[0] == RESERVE_6 || + cmd->cmnd[0] == RELEASE_6) ) { cmd->result |= (DID_ERROR << 16) | SAM_STAT_RESERVATION_CONFLICT; @@ -2780,7 +2781,7 @@ static inline void mega_create_proc_entry(int index, struct proc_dir_entry *pare * Return the disk geometry for a particular disk */ static int -megaraid_biosparam(struct scsi_device *sdev, struct block_device *bdev, +megaraid_biosparam(struct scsi_device *sdev, struct gendisk *disk, sector_t capacity, int geom[]) { adapter_t *adapter; @@ -2813,7 +2814,7 @@ megaraid_biosparam(struct scsi_device *sdev, struct block_device *bdev, geom[2] = cylinders; } else { - if (scsi_partsize(bdev, capacity, geom)) + if (scsi_partsize(disk, capacity, geom)) return 0; dev_info(&adapter->dev->dev, @@ -4253,8 +4254,7 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) goto out_host_put; } - adapter->scb_list = kmalloc_array(MAX_COMMANDS, sizeof(scb_t), - GFP_KERNEL); + adapter->scb_list = kmalloc_objs(scb_t, MAX_COMMANDS); if (!adapter->scb_list) { dev_warn(&pdev->dev, "out of RAM\n"); goto out_free_cmd_buffer; @@ -4551,7 +4551,7 @@ megaraid_shutdown(struct pci_dev *pdev) __megaraid_shutdown(adapter); } -static struct pci_device_id megaraid_pci_tbl[] = { +static const struct pci_device_id megaraid_pci_tbl[] = { {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, {PCI_VENDOR_ID_AMI, PCI_DEVICE_ID_AMI_MEGARAID2, |
