diff options
Diffstat (limited to 'drivers/message')
-rw-r--r-- | drivers/message/fusion/mptfc.c | 14 | ||||
-rw-r--r-- | drivers/message/fusion/mptsas.c | 22 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.c | 74 | ||||
-rw-r--r-- | drivers/message/fusion/mptscsih.h | 6 | ||||
-rw-r--r-- | drivers/message/fusion/mptspi.c | 19 |
5 files changed, 38 insertions, 97 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index ee61b70aa677..8f587c0efd9d 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c @@ -96,7 +96,7 @@ static u8 mptfcTaskCtx = MPT_MAX_PROTOCOL_DRIVERS; static u8 mptfcInternalCtx = MPT_MAX_PROTOCOL_DRIVERS; static int mptfc_target_alloc(struct scsi_target *starget); -static int mptfc_slave_alloc(struct scsi_device *sdev); +static int mptfc_sdev_init(struct scsi_device *sdev); static int mptfc_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt); static void mptfc_target_destroy(struct scsi_target *starget); static void mptfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout); @@ -113,10 +113,10 @@ static const struct scsi_host_template mptfc_driver_template = { .info = mptscsih_info, .queuecommand = mptfc_qcmd, .target_alloc = mptfc_target_alloc, - .slave_alloc = mptfc_slave_alloc, - .slave_configure = mptscsih_slave_configure, + .sdev_init = mptfc_sdev_init, + .sdev_configure = mptscsih_sdev_configure, .target_destroy = mptfc_target_destroy, - .slave_destroy = mptscsih_slave_destroy, + .sdev_destroy = mptscsih_sdev_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_timed_out = fc_eh_timed_out, .eh_abort_handler = mptfc_abort, @@ -503,7 +503,7 @@ mptfc_register_dev(MPT_ADAPTER *ioc, int channel, FCDevicePage0_t *pg0) /* * if already mapped, remap here. If not mapped, * target_alloc will allocate vtarget and map, - * slave_alloc will fill in vdevice from vtarget. + * sdev_init will fill in vdevice from vtarget. */ if (ri->starget) { vtarget = ri->starget->hostdata; @@ -631,7 +631,7 @@ mptfc_dump_lun_info(MPT_ADAPTER *ioc, struct fc_rport *rport, struct scsi_device * Init memory once per LUN. */ static int -mptfc_slave_alloc(struct scsi_device *sdev) +mptfc_sdev_init(struct scsi_device *sdev) { MPT_SCSI_HOST *hd; VirtTarget *vtarget; @@ -651,7 +651,7 @@ mptfc_slave_alloc(struct scsi_device *sdev) vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); if (!vdevice) { - printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", + printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); return -ENOMEM; } diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c index d0549a4daf76..185c08eab4ca 100644 --- a/drivers/message/fusion/mptsas.c +++ b/drivers/message/fusion/mptsas.c @@ -1710,7 +1710,7 @@ mptsas_firmware_event_work(struct work_struct *work) static int -mptsas_slave_configure(struct scsi_device *sdev) +mptsas_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) { struct Scsi_Host *host = sdev->host; MPT_SCSI_HOST *hd = shost_priv(host); @@ -1736,7 +1736,7 @@ mptsas_slave_configure(struct scsi_device *sdev) mptsas_add_device_component_starget(ioc, scsi_target(sdev)); out: - return mptscsih_slave_configure(sdev); + return mptscsih_sdev_configure(sdev, lim); } static int @@ -1867,7 +1867,7 @@ mptsas_target_destroy(struct scsi_target *starget) static int -mptsas_slave_alloc(struct scsi_device *sdev) +mptsas_sdev_init(struct scsi_device *sdev) { struct Scsi_Host *host = sdev->host; MPT_SCSI_HOST *hd = shost_priv(host); @@ -1880,7 +1880,7 @@ mptsas_slave_alloc(struct scsi_device *sdev) vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); if (!vdevice) { - printk(MYIOC_s_ERR_FMT "slave_alloc kzalloc(%zd) FAILED!\n", + printk(MYIOC_s_ERR_FMT "sdev_init kzalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); return -ENOMEM; } @@ -2005,10 +2005,10 @@ static const struct scsi_host_template mptsas_driver_template = { .info = mptscsih_info, .queuecommand = mptsas_qcmd, .target_alloc = mptsas_target_alloc, - .slave_alloc = mptsas_slave_alloc, - .slave_configure = mptsas_slave_configure, + .sdev_init = mptsas_sdev_init, + .sdev_configure = mptsas_sdev_configure, .target_destroy = mptsas_target_destroy, - .slave_destroy = mptscsih_slave_destroy, + .sdev_destroy = mptscsih_sdev_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_timed_out = mptsas_eh_timed_out, .eh_abort_handler = mptscsih_abort, @@ -2834,10 +2834,10 @@ struct rep_manu_reply{ u8 sas_format:1; u8 reserved1:7; u8 reserved2[3]; - u8 vendor_id[SAS_EXPANDER_VENDOR_ID_LEN]; - u8 product_id[SAS_EXPANDER_PRODUCT_ID_LEN]; - u8 product_rev[SAS_EXPANDER_PRODUCT_REV_LEN]; - u8 component_vendor_id[SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN]; + u8 vendor_id[SAS_EXPANDER_VENDOR_ID_LEN] __nonstring; + u8 product_id[SAS_EXPANDER_PRODUCT_ID_LEN] __nonstring; + u8 product_rev[SAS_EXPANDER_PRODUCT_REV_LEN] __nonstring; + u8 component_vendor_id[SAS_EXPANDER_COMPONENT_VENDOR_ID_LEN] __nonstring; u16 component_id; u8 component_revision_id; u8 reserved3; diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c index 6c3f25cc33ff..3a64dc7a7e27 100644 --- a/drivers/message/fusion/mptscsih.c +++ b/drivers/message/fusion/mptscsih.c @@ -1071,7 +1071,7 @@ EXPORT_SYMBOL(mptscsih_flush_running_cmds); * * Returns: None. * - * Called from slave_destroy. + * Called from sdev_destroy. */ static void mptscsih_search_running_cmds(MPT_SCSI_HOST *hd, VirtDevice *vdevice) @@ -1843,65 +1843,6 @@ mptscsih_dev_reset(struct scsi_cmnd * SCpnt) return FAILED; } -/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ -/** - * mptscsih_target_reset - Perform a SCSI TARGET_RESET! - * @SCpnt: Pointer to scsi_cmnd structure, IO which reset is due to - * - * (linux scsi_host_template.eh_target_reset_handler routine) - * - * Returns SUCCESS or FAILED. - **/ -int -mptscsih_target_reset(struct scsi_cmnd * SCpnt) -{ - MPT_SCSI_HOST *hd; - int retval; - VirtDevice *vdevice; - MPT_ADAPTER *ioc; - - /* If we can't locate our host adapter structure, return FAILED status. - */ - if ((hd = shost_priv(SCpnt->device->host)) == NULL){ - printk(KERN_ERR MYNAM ": target reset: " - "Can't locate host! (sc=%p)\n", SCpnt); - return FAILED; - } - - ioc = hd->ioc; - printk(MYIOC_s_INFO_FMT "attempting target reset! (sc=%p)\n", - ioc->name, SCpnt); - scsi_print_command(SCpnt); - - vdevice = SCpnt->device->hostdata; - if (!vdevice || !vdevice->vtarget) { - retval = 0; - goto out; - } - - /* Target reset to hidden raid component is not supported - */ - if (vdevice->vtarget->tflags & MPT_TARGET_FLAGS_RAID_COMPONENT) { - retval = FAILED; - goto out; - } - - retval = mptscsih_IssueTaskMgmt(hd, - MPI_SCSITASKMGMT_TASKTYPE_TARGET_RESET, - vdevice->vtarget->channel, - vdevice->vtarget->id, 0, 0, - mptscsih_get_tm_timeout(ioc)); - - out: - printk (MYIOC_s_INFO_FMT "target reset: %s (sc=%p)\n", - ioc->name, ((retval == 0) ? "SUCCESS" : "FAILED" ), SCpnt); - - if (retval == 0) - return SUCCESS; - else - return FAILED; -} - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /** @@ -2331,7 +2272,7 @@ EXPORT_SYMBOL(mptscsih_raid_id_to_num); * Called if no device present or device being unloaded */ void -mptscsih_slave_destroy(struct scsi_device *sdev) +mptscsih_sdev_destroy(struct scsi_device *sdev) { struct Scsi_Host *host = sdev->host; MPT_SCSI_HOST *hd = shost_priv(host); @@ -2399,7 +2340,7 @@ mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth) * Return non-zero if fails. */ int -mptscsih_slave_configure(struct scsi_device *sdev) +mptscsih_sdev_configure(struct scsi_device *sdev, struct queue_limits *lim) { struct Scsi_Host *sh = sdev->host; VirtTarget *vtarget; @@ -2915,14 +2856,14 @@ mptscsih_do_cmd(MPT_SCSI_HOST *hd, INTERNAL_CMD *io) timeout = 10; break; - case RESERVE: + case RESERVE_6: cmdLen = 6; dir = MPI_SCSIIO_CONTROL_READ; CDB[0] = cmd; timeout = 10; break; - case RELEASE: + case RELEASE_6: cmdLen = 6; dir = MPI_SCSIIO_CONTROL_READ; CDB[0] = cmd; @@ -3302,11 +3243,10 @@ EXPORT_SYMBOL(mptscsih_resume); EXPORT_SYMBOL(mptscsih_show_info); EXPORT_SYMBOL(mptscsih_info); EXPORT_SYMBOL(mptscsih_qcmd); -EXPORT_SYMBOL(mptscsih_slave_destroy); -EXPORT_SYMBOL(mptscsih_slave_configure); +EXPORT_SYMBOL(mptscsih_sdev_destroy); +EXPORT_SYMBOL(mptscsih_sdev_configure); EXPORT_SYMBOL(mptscsih_abort); EXPORT_SYMBOL(mptscsih_dev_reset); -EXPORT_SYMBOL(mptscsih_target_reset); EXPORT_SYMBOL(mptscsih_bus_reset); EXPORT_SYMBOL(mptscsih_host_reset); EXPORT_SYMBOL(mptscsih_bios_param); diff --git a/drivers/message/fusion/mptscsih.h b/drivers/message/fusion/mptscsih.h index e3d92c392673..8c2bb2331fc1 100644 --- a/drivers/message/fusion/mptscsih.h +++ b/drivers/message/fusion/mptscsih.h @@ -116,11 +116,11 @@ extern const char * mptscsih_info(struct Scsi_Host *SChost); extern int mptscsih_qcmd(struct scsi_cmnd *SCpnt); extern int mptscsih_IssueTaskMgmt(MPT_SCSI_HOST *hd, u8 type, u8 channel, u8 id, u64 lun, int ctx2abort, ulong timeout); -extern void mptscsih_slave_destroy(struct scsi_device *device); -extern int mptscsih_slave_configure(struct scsi_device *device); +extern void mptscsih_sdev_destroy(struct scsi_device *device); +extern int mptscsih_sdev_configure(struct scsi_device *device, + struct queue_limits *lim); extern int mptscsih_abort(struct scsi_cmnd * SCpnt); extern int mptscsih_dev_reset(struct scsi_cmnd * SCpnt); -extern int mptscsih_target_reset(struct scsi_cmnd * SCpnt); extern int mptscsih_bus_reset(struct scsi_cmnd * SCpnt); extern int mptscsih_host_reset(struct scsi_cmnd *SCpnt); extern int mptscsih_bios_param(struct scsi_device * sdev, struct block_device *bdev, sector_t capacity, int geom[]); diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 4184d0c70ac3..a3901fbfac4f 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -713,7 +713,7 @@ static void mptspi_dv_device(struct _MPT_SCSI_HOST *hd, mptspi_read_parameters(sdev->sdev_target); } -static int mptspi_slave_alloc(struct scsi_device *sdev) +static int mptspi_sdev_init(struct scsi_device *sdev) { MPT_SCSI_HOST *hd = shost_priv(sdev->host); VirtTarget *vtarget; @@ -727,7 +727,7 @@ static int mptspi_slave_alloc(struct scsi_device *sdev) vdevice = kzalloc(sizeof(VirtDevice), GFP_KERNEL); if (!vdevice) { - printk(MYIOC_s_ERR_FMT "slave_alloc kmalloc(%zd) FAILED!\n", + printk(MYIOC_s_ERR_FMT "sdev_init kmalloc(%zd) FAILED!\n", ioc->name, sizeof(VirtDevice)); return -ENOMEM; } @@ -746,7 +746,8 @@ static int mptspi_slave_alloc(struct scsi_device *sdev) return 0; } -static int mptspi_slave_configure(struct scsi_device *sdev) +static int mptspi_sdev_configure(struct scsi_device *sdev, + struct queue_limits *lim) { struct _MPT_SCSI_HOST *hd = shost_priv(sdev->host); VirtTarget *vtarget = scsi_target(sdev)->hostdata; @@ -754,7 +755,7 @@ static int mptspi_slave_configure(struct scsi_device *sdev) mptspi_initTarget(hd, vtarget, sdev); - ret = mptscsih_slave_configure(sdev); + ret = mptscsih_sdev_configure(sdev, lim); if (ret) return ret; @@ -799,7 +800,7 @@ mptspi_qcmd(struct Scsi_Host *shost, struct scsi_cmnd *SCpnt) return mptscsih_qcmd(SCpnt); } -static void mptspi_slave_destroy(struct scsi_device *sdev) +static void mptspi_sdev_destroy(struct scsi_device *sdev) { struct scsi_target *starget = scsi_target(sdev); VirtTarget *vtarget = starget->hostdata; @@ -817,7 +818,7 @@ static void mptspi_slave_destroy(struct scsi_device *sdev) mptspi_write_spi_device_pg1(starget, &pg1); } - mptscsih_slave_destroy(sdev); + mptscsih_sdev_destroy(sdev); } static const struct scsi_host_template mptspi_driver_template = { @@ -828,10 +829,10 @@ static const struct scsi_host_template mptspi_driver_template = { .info = mptscsih_info, .queuecommand = mptspi_qcmd, .target_alloc = mptspi_target_alloc, - .slave_alloc = mptspi_slave_alloc, - .slave_configure = mptspi_slave_configure, + .sdev_init = mptspi_sdev_init, + .sdev_configure = mptspi_sdev_configure, .target_destroy = mptspi_target_destroy, - .slave_destroy = mptspi_slave_destroy, + .sdev_destroy = mptspi_sdev_destroy, .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, .eh_device_reset_handler = mptscsih_dev_reset, |