aboutsummaryrefslogtreecommitdiffstats
path: root/include
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 /include
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 'include')
-rw-r--r--include/scsi/libsas.h4
-rw-r--r--include/scsi/sas.h22
-rw-r--r--include/scsi/sas_ata.h4
-rw-r--r--include/scsi/scsi_transport_sas.h7
4 files changed, 16 insertions, 21 deletions
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index ef937b56f9b5..e2c1e66d58ae 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -118,7 +118,7 @@ struct ex_phy {
118 118
119 enum ex_phy_state phy_state; 119 enum ex_phy_state phy_state;
120 120
121 enum sas_dev_type attached_dev_type; 121 enum sas_device_type attached_dev_type;
122 enum sas_linkrate linkrate; 122 enum sas_linkrate linkrate;
123 123
124 u8 attached_sata_host:1; 124 u8 attached_sata_host:1;
@@ -195,7 +195,7 @@ enum {
195 195
196struct domain_device { 196struct domain_device {
197 spinlock_t done_lock; 197 spinlock_t done_lock;
198 enum sas_dev_type dev_type; 198 enum sas_device_type dev_type;
199 199
200 enum sas_linkrate linkrate; 200 enum sas_linkrate linkrate;
201 enum sas_linkrate min_linkrate; 201 enum sas_linkrate min_linkrate;
diff --git a/include/scsi/sas.h b/include/scsi/sas.h
index be3eb0bf1ac0..0d2607d12387 100644
--- a/include/scsi/sas.h
+++ b/include/scsi/sas.h
@@ -90,16 +90,18 @@ enum sas_oob_mode {
90}; 90};
91 91
92/* See sas_discover.c if you plan on changing these */ 92/* See sas_discover.c if you plan on changing these */
93enum sas_dev_type { 93enum sas_device_type {
94 NO_DEVICE = 0, /* protocol */ 94 /* these are SAS protocol defined (attached device type field) */
95 SAS_END_DEV = 1, /* protocol */ 95 SAS_PHY_UNUSED = 0,
96 EDGE_DEV = 2, /* protocol */ 96 SAS_END_DEVICE = 1,
97 FANOUT_DEV = 3, /* protocol */ 97 SAS_EDGE_EXPANDER_DEVICE = 2,
98 SAS_HA = 4, 98 SAS_FANOUT_EXPANDER_DEVICE = 3,
99 SATA_DEV = 5, 99 /* these are internal to libsas */
100 SATA_PM = 7, 100 SAS_HA = 4,
101 SATA_PM_PORT= 8, 101 SAS_SATA_DEV = 5,
102 SATA_PENDING = 9, 102 SAS_SATA_PM = 7,
103 SAS_SATA_PM_PORT = 8,
104 SAS_SATA_PENDING = 9,
103}; 105};
104 106
105enum sas_protocol { 107enum sas_protocol {
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h
index ff71a5654684..00f41aeeecf5 100644
--- a/include/scsi/sas_ata.h
+++ b/include/scsi/sas_ata.h
@@ -32,8 +32,8 @@
32 32
33static inline int dev_is_sata(struct domain_device *dev) 33static inline int dev_is_sata(struct domain_device *dev)
34{ 34{
35 return dev->dev_type == SATA_DEV || dev->dev_type == SATA_PM || 35 return dev->dev_type == SAS_SATA_DEV || dev->dev_type == SAS_SATA_PM ||
36 dev->dev_type == SATA_PM_PORT || dev->dev_type == SATA_PENDING; 36 dev->dev_type == SAS_SATA_PM_PORT || dev->dev_type == SAS_SATA_PENDING;
37} 37}
38 38
39int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy); 39int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy);
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index 9b8e08879cfc..0bd71e2702e3 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -10,13 +10,6 @@ struct scsi_transport_template;
10struct sas_rphy; 10struct sas_rphy;
11struct request; 11struct request;
12 12
13enum sas_device_type {
14 SAS_PHY_UNUSED = 0,
15 SAS_END_DEVICE = 1,
16 SAS_EDGE_EXPANDER_DEVICE = 2,
17 SAS_FANOUT_EXPANDER_DEVICE = 3,
18};
19
20static inline int sas_protocol_ata(enum sas_protocol proto) 13static inline int sas_protocol_ata(enum sas_protocol proto)
21{ 14{
22 return ((proto & SAS_PROTOCOL_SATA) || 15 return ((proto & SAS_PROTOCOL_SATA) ||