diff options
Diffstat (limited to 'drivers/scsi/esas2r')
-rw-r--r-- | drivers/scsi/esas2r/esas2r.h | 5 | ||||
-rw-r--r-- | drivers/scsi/esas2r/esas2r_ioctl.c | 22 | ||||
-rw-r--r-- | drivers/scsi/esas2r/esas2r_main.c | 64 |
3 files changed, 17 insertions, 74 deletions
diff --git a/drivers/scsi/esas2r/esas2r.h b/drivers/scsi/esas2r/esas2r.h index 3fd305d6b67..b6030e3edd0 100644 --- a/drivers/scsi/esas2r/esas2r.h +++ b/drivers/scsi/esas2r/esas2r.h @@ -972,11 +972,6 @@ u8 handle_hba_ioctl(struct esas2r_adapter *a, struct atto_ioctl *ioctl_hba); int esas2r_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd); int esas2r_show_info(struct seq_file *m, struct Scsi_Host *sh); -int esas2r_slave_alloc(struct scsi_device *dev); -int esas2r_slave_configure(struct scsi_device *dev); -void esas2r_slave_destroy(struct scsi_device *dev); -int esas2r_change_queue_depth(struct scsi_device *dev, int depth, int reason); -int esas2r_change_queue_type(struct scsi_device *dev, int type); long esas2r_proc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg); /* SCSI error handler (eh) functions */ diff --git a/drivers/scsi/esas2r/esas2r_ioctl.c b/drivers/scsi/esas2r/esas2r_ioctl.c index d89a0277a8e..baf913047b4 100644 --- a/drivers/scsi/esas2r/esas2r_ioctl.c +++ b/drivers/scsi/esas2r/esas2r_ioctl.c @@ -117,9 +117,8 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi) rq = esas2r_alloc_request(a); if (rq == NULL) { - up(&a->fm_api_semaphore); fi->status = FI_STAT_BUSY; - return; + goto free_sem; } if (fi == &a->firmware.header) { @@ -135,7 +134,7 @@ static void do_fm_api(struct esas2r_adapter *a, struct esas2r_flash_img *fi) if (a->firmware.header_buff == NULL) { esas2r_debug("failed to allocate header buffer!"); fi->status = FI_STAT_BUSY; - return; + goto free_req; } memcpy(a->firmware.header_buff, fi, @@ -171,9 +170,10 @@ all_done: a->firmware.header_buff, (dma_addr_t)a->firmware.header_buff_phys); } - - up(&a->fm_api_semaphore); +free_req: esas2r_free_request(a, (struct esas2r_request *)rq); +free_sem: + up(&a->fm_api_semaphore); return; } @@ -1420,9 +1420,10 @@ int esas2r_ioctl_handler(void *hostdata, int cmd, void __user *arg) rq = esas2r_alloc_request(a); if (rq == NULL) { - up(&a->nvram_semaphore); - ioctl->data.prw.code = 0; - break; + kfree(ioctl); + esas2r_log(ESAS2R_LOG_WARN, + "could not allocate an internal request"); + return -ENOMEM; } code = esas2r_write_params(a, rq, @@ -1523,9 +1524,12 @@ ioctl_done: case -EINVAL: ioctl->header.return_code = IOCTL_INVALID_PARAM; break; + + default: + ioctl->header.return_code = IOCTL_GENERAL_ERROR; + break; } - ioctl->header.return_code = IOCTL_GENERAL_ERROR; } /* Always copy the buffer back, if only to pick up the status */ diff --git a/drivers/scsi/esas2r/esas2r_main.c b/drivers/scsi/esas2r/esas2r_main.c index 6504a195c87..593ff8a63c7 100644 --- a/drivers/scsi/esas2r/esas2r_main.c +++ b/drivers/scsi/esas2r/esas2r_main.c @@ -254,12 +254,10 @@ static struct scsi_host_template driver_template = { .use_clustering = ENABLE_CLUSTERING, .emulated = 0, .proc_name = ESAS2R_DRVR_NAME, - .slave_configure = esas2r_slave_configure, - .slave_alloc = esas2r_slave_alloc, - .slave_destroy = esas2r_slave_destroy, - .change_queue_depth = esas2r_change_queue_depth, - .change_queue_type = esas2r_change_queue_type, + .change_queue_depth = scsi_change_queue_depth, + .change_queue_type = scsi_change_queue_type, .max_sectors = 0xFFFF, + .use_blk_tags = 1, }; int sgl_page_size = 512; @@ -1057,7 +1055,7 @@ int esas2r_eh_abort(struct scsi_cmnd *cmd) cmd->scsi_done(cmd); - return 0; + return SUCCESS; } spin_lock_irqsave(&a->queue_lock, flags); @@ -1259,60 +1257,6 @@ int esas2r_target_reset(struct scsi_cmnd *cmd) return esas2r_dev_targ_reset(cmd, true); } -int esas2r_change_queue_depth(struct scsi_device *dev, int depth, int reason) -{ - esas2r_log(ESAS2R_LOG_INFO, "change_queue_depth %p, %d", dev, depth); - - scsi_adjust_queue_depth(dev, scsi_get_tag_type(dev), depth); - - return dev->queue_depth; -} - -int esas2r_change_queue_type(struct scsi_device *dev, int type) -{ - esas2r_log(ESAS2R_LOG_INFO, "change_queue_type %p, %d", dev, type); - - if (dev->tagged_supported) { - scsi_set_tag_type(dev, type); - - if (type) - scsi_activate_tcq(dev, dev->queue_depth); - else - scsi_deactivate_tcq(dev, dev->queue_depth); - } else { - type = 0; - } - - return type; -} - -int esas2r_slave_alloc(struct scsi_device *dev) -{ - return 0; -} - -int esas2r_slave_configure(struct scsi_device *dev) -{ - esas2r_log_dev(ESAS2R_LOG_INFO, &(dev->sdev_gendev), - "esas2r_slave_configure()"); - - if (dev->tagged_supported) { - scsi_set_tag_type(dev, MSG_SIMPLE_TAG); - scsi_activate_tcq(dev, cmd_per_lun); - } else { - scsi_set_tag_type(dev, 0); - scsi_deactivate_tcq(dev, cmd_per_lun); - } - - return 0; -} - -void esas2r_slave_destroy(struct scsi_device *dev) -{ - esas2r_log_dev(ESAS2R_LOG_INFO, &(dev->sdev_gendev), - "esas2r_slave_destroy()"); -} - void esas2r_log_request_failure(struct esas2r_adapter *a, struct esas2r_request *rq) { |