diff options
author | Dan Williams <dan.j.williams@intel.com> | 2011-04-21 18:44:45 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2011-07-03 04:00:38 -0700 |
commit | a1a113b0a1ea437daf099b44f8a39e93a02a3f47 (patch) | |
tree | c9576cfc8c12447d0932accee0e3b59d175c08d9 /drivers/scsi/isci/request.c | |
parent | b87ee3075b090e1dd0bdf40b295142b606d55e64 (diff) |
isci: kill smp_discover_response_protocols in favor of domain_device.dev_type
This is step 1 of removing the contortions to:
1/ unparse expander phy data into a smp discover frame
2/ open-code-parse the smp discover fram into a domain_device.dev_type equivalent
libsas has already spent cycles determining the dev_type, so now that
scic_sds_remote_device is unified with isci_remote_device we can
directly reference dev_type.
This might also change multi-level expander detection as we previously only
looked at dev_type == EDGE_DEV and we did not consider the FANOUT_DEV case.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci/request.c')
-rw-r--r-- | drivers/scsi/isci/request.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index ff5c05a1954..281a556f5ee 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c @@ -175,7 +175,6 @@ static enum sci_status isci_io_request_build( struct isci_request *request, struct isci_remote_device *isci_device) { - struct smp_discover_response_protocols dev_protocols; enum sci_status status = SCI_SUCCESS; struct sas_task *task = isci_request_access_task(request); struct scic_sds_remote_device *sci_device = &isci_device->sci; @@ -228,15 +227,19 @@ static enum sci_status isci_io_request_build( sci_object_set_association(request->sci_request_handle, request); - /* Determine protocol and call the appropriate basic constructor */ - scic_remote_device_get_protocols(sci_device, &dev_protocols); - if (dev_protocols.u.bits.attached_ssp_target) + switch (task->task_proto) { + case SAS_PROTOCOL_SMP: + status = isci_smp_request_build(request); + break; + case SAS_PROTOCOL_SSP: status = isci_request_ssp_request_construct(request); - else if (dev_protocols.u.bits.attached_stp_target) + break; + case SAS_PROTOCOL_SATA: + case SAS_PROTOCOL_STP: + case SAS_PROTOCOL_SATA | SAS_PROTOCOL_STP: status = isci_request_stp_request_construct(request); - else if (dev_protocols.u.bits.attached_smp_target) - status = isci_smp_request_build(request); - else { + break; + default: dev_warn(&isci_host->pdev->dev, "%s: unknown protocol\n", __func__); return SCI_FAILURE; |