From a1a113b0a1ea437daf099b44f8a39e93a02a3f47 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 21 Apr 2011 18:44:45 -0700 Subject: 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 --- drivers/scsi/isci/remote_device.h | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'drivers/scsi/isci/remote_device.h') diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h index 9d8fcbf72ded..39821601022b 100644 --- a/drivers/scsi/isci/remote_device.h +++ b/drivers/scsi/isci/remote_device.h @@ -99,11 +99,6 @@ struct scic_sds_remote_device { */ enum sas_linkrate connection_rate; - /** - * This field contains the allowed target protocols for this remote device. - */ - struct smp_discover_response_protocols target_protocols; - /** * This field contains the device SAS address. */ @@ -264,23 +259,6 @@ enum sci_status scic_remote_device_reset_complete( enum sas_linkrate scic_remote_device_get_connection_rate( struct scic_sds_remote_device *remote_device); -/** - * scic_remote_device_get_protocols() - This method will indicate which - * protocols are supported by this remote device. - * @remote_device: This parameter specifies the device for which to return the - * protocol. - * @protocols: This parameter specifies the output values, from the remote - * device object, which indicate the protocols supported by the supplied - * remote_device. - * - * The type of protocols supported by this device. The values are returned as - * part of a bit mask in order to allow for multi-protocol support. - */ -void scic_remote_device_get_protocols( - struct scic_sds_remote_device *remote_device, - struct smp_discover_response_protocols *protocols); - - #if !defined(DISABLE_ATAPI) /** * scic_remote_device_is_atapi() - @@ -477,6 +455,18 @@ static inline struct scic_sds_remote_device *rnc_to_dev(struct scic_sds_remote_n return sci_dev; } +static inline struct domain_device *sci_dev_to_domain(struct scic_sds_remote_device *sci_dev) +{ + struct isci_remote_device *idev = container_of(sci_dev, typeof(*idev), sci); + + return idev->domain_dev; +} + +static inline bool dev_is_expander(struct domain_device *dev) +{ + return dev->dev_type == EDGE_DEV || dev->dev_type == FANOUT_DEV; +} + typedef enum sci_status (*scic_sds_remote_device_request_handler_t)( struct scic_sds_remote_device *device, struct scic_sds_request *request); -- cgit v1.2.1