aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci
diff options
context:
space:
mode:
authorJames Bottomley <JBottomley@Parallels.com>2013-05-07 17:44:06 -0400
committerJames Bottomley <JBottomley@Parallels.com>2013-05-10 10:47:52 -0400
commitaa9f8328fc51460e15da129caf622b6560fa8c99 (patch)
tree3ca4c2a29e94538acff4aae04214d5645eaeac02 /drivers/scsi/isci
parenta6cb3d012b983b350ae3892cff2e692665df0e1e (diff)
[SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type
These enums have been separate since the dawn of SAS, mainly because the latter is a procotol only enum and the former includes additional state for libsas. The dichotomy causes endless confusion about which one you should use where and leads to pointless warnings like this: drivers/scsi/mvsas/mv_sas.c: In function 'mvs_update_phyinfo': drivers/scsi/mvsas/mv_sas.c:1162:34: warning: comparison between 'enum sas_device_type' and 'enum sas_dev_type' [-Wenum-compare] Fix by eliminating one of them. The one kept is effectively the sas.h one, but call it sas_device_type and make sure the enums are all properly namespaced with the SAS_ prefix. Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r--drivers/scsi/isci/remote_device.c4
-rw-r--r--drivers/scsi/isci/remote_device.h2
-rw-r--r--drivers/scsi/isci/request.c6
-rw-r--r--drivers/scsi/isci/task.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index c3aa6c5457b9..96a26f454673 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -1085,7 +1085,7 @@ static void sci_remote_device_ready_state_enter(struct sci_base_state_machine *s
1085 struct isci_host *ihost = idev->owning_port->owning_controller; 1085 struct isci_host *ihost = idev->owning_port->owning_controller;
1086 struct domain_device *dev = idev->domain_dev; 1086 struct domain_device *dev = idev->domain_dev;
1087 1087
1088 if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_SATA)) { 1088 if (dev->dev_type == SAS_SATA_DEV || (dev->tproto & SAS_PROTOCOL_SATA)) {
1089 sci_change_state(&idev->sm, SCI_STP_DEV_IDLE); 1089 sci_change_state(&idev->sm, SCI_STP_DEV_IDLE);
1090 } else if (dev_is_expander(dev)) { 1090 } else if (dev_is_expander(dev)) {
1091 sci_change_state(&idev->sm, SCI_SMP_DEV_IDLE); 1091 sci_change_state(&idev->sm, SCI_SMP_DEV_IDLE);
@@ -1098,7 +1098,7 @@ static void sci_remote_device_ready_state_exit(struct sci_base_state_machine *sm
1098 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm); 1098 struct isci_remote_device *idev = container_of(sm, typeof(*idev), sm);
1099 struct domain_device *dev = idev->domain_dev; 1099 struct domain_device *dev = idev->domain_dev;
1100 1100
1101 if (dev->dev_type == SAS_END_DEV) { 1101 if (dev->dev_type == SAS_END_DEVICE) {
1102 struct isci_host *ihost = idev->owning_port->owning_controller; 1102 struct isci_host *ihost = idev->owning_port->owning_controller;
1103 1103
1104 isci_remote_device_not_ready(ihost, idev, 1104 isci_remote_device_not_ready(ihost, idev,
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h
index 7674caae1d88..47a013fffae7 100644
--- a/drivers/scsi/isci/remote_device.h
+++ b/drivers/scsi/isci/remote_device.h
@@ -297,7 +297,7 @@ static inline struct isci_remote_device *rnc_to_dev(struct sci_remote_node_conte
297 297
298static inline bool dev_is_expander(struct domain_device *dev) 298static inline bool dev_is_expander(struct domain_device *dev)
299{ 299{
300 return dev->dev_type == EDGE_DEV || dev->dev_type == FANOUT_DEV; 300 return dev->dev_type == SAS_EDGE_EXPANDER_DEVICE || dev->dev_type == SAS_FANOUT_EXPANDER_DEVICE;
301} 301}
302 302
303static inline void sci_remote_device_decrement_request_count(struct isci_remote_device *idev) 303static inline void sci_remote_device_decrement_request_count(struct isci_remote_device *idev)
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
index 9594ab62702b..e3e3bcbd5a9f 100644
--- a/drivers/scsi/isci/request.c
+++ b/drivers/scsi/isci/request.c
@@ -2978,7 +2978,7 @@ static void sci_request_started_state_enter(struct sci_base_state_machine *sm)
2978 /* all unaccelerated request types (non ssp or ncq) handled with 2978 /* all unaccelerated request types (non ssp or ncq) handled with
2979 * substates 2979 * substates
2980 */ 2980 */
2981 if (!task && dev->dev_type == SAS_END_DEV) { 2981 if (!task && dev->dev_type == SAS_END_DEVICE) {
2982 state = SCI_REQ_TASK_WAIT_TC_COMP; 2982 state = SCI_REQ_TASK_WAIT_TC_COMP;
2983 } else if (task && task->task_proto == SAS_PROTOCOL_SMP) { 2983 } else if (task && task->task_proto == SAS_PROTOCOL_SMP) {
2984 state = SCI_REQ_SMP_WAIT_RESP; 2984 state = SCI_REQ_SMP_WAIT_RESP;
@@ -3101,7 +3101,7 @@ sci_io_request_construct(struct isci_host *ihost,
3101 if (idev->rnc.remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX) 3101 if (idev->rnc.remote_node_index == SCIC_SDS_REMOTE_NODE_CONTEXT_INVALID_INDEX)
3102 return SCI_FAILURE_INVALID_REMOTE_DEVICE; 3102 return SCI_FAILURE_INVALID_REMOTE_DEVICE;
3103 3103
3104 if (dev->dev_type == SAS_END_DEV) 3104 if (dev->dev_type == SAS_END_DEVICE)
3105 /* pass */; 3105 /* pass */;
3106 else if (dev_is_sata(dev)) 3106 else if (dev_is_sata(dev))
3107 memset(&ireq->stp.cmd, 0, sizeof(ireq->stp.cmd)); 3107 memset(&ireq->stp.cmd, 0, sizeof(ireq->stp.cmd));
@@ -3125,7 +3125,7 @@ enum sci_status sci_task_request_construct(struct isci_host *ihost,
3125 /* Build the common part of the request */ 3125 /* Build the common part of the request */
3126 sci_general_request_construct(ihost, idev, ireq); 3126 sci_general_request_construct(ihost, idev, ireq);
3127 3127
3128 if (dev->dev_type == SAS_END_DEV || dev_is_sata(dev)) { 3128 if (dev->dev_type == SAS_END_DEVICE || dev_is_sata(dev)) {
3129 set_bit(IREQ_TMF, &ireq->flags); 3129 set_bit(IREQ_TMF, &ireq->flags);
3130 memset(ireq->tc, 0, sizeof(struct scu_task_context)); 3130 memset(ireq->tc, 0, sizeof(struct scu_task_context));
3131 3131
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c
index b6f19a1db780..9bb020ac089c 100644
--- a/drivers/scsi/isci/task.c
+++ b/drivers/scsi/isci/task.c
@@ -250,7 +250,7 @@ static struct isci_request *isci_task_request_build(struct isci_host *ihost,
250 } 250 }
251 251
252 /* XXX convert to get this from task->tproto like other drivers */ 252 /* XXX convert to get this from task->tproto like other drivers */
253 if (dev->dev_type == SAS_END_DEV) { 253 if (dev->dev_type == SAS_END_DEVICE) {
254 isci_tmf->proto = SAS_PROTOCOL_SSP; 254 isci_tmf->proto = SAS_PROTOCOL_SSP;
255 status = sci_task_request_construct_ssp(ireq); 255 status = sci_task_request_construct_ssp(ireq);
256 if (status != SCI_SUCCESS) 256 if (status != SCI_SUCCESS)