aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/aic94xx/aic94xx_hwi.c2
-rw-r--r--drivers/scsi/aic94xx/aic94xx_init.c12
-rw-r--r--drivers/scsi/aic94xx/aic94xx_scb.c26
-rw-r--r--drivers/scsi/libsas/sas_expander.c27
-rw-r--r--drivers/scsi/libsas/sas_internal.h2
-rw-r--r--include/scsi/libsas.h14
-rw-r--r--include/scsi/sas.h14
-rw-r--r--include/scsi/scsi_transport_sas.h26
8 files changed, 54 insertions, 69 deletions
diff --git a/drivers/scsi/aic94xx/aic94xx_hwi.c b/drivers/scsi/aic94xx/aic94xx_hwi.c
index 075cea85b56b..a24201351108 100644
--- a/drivers/scsi/aic94xx/aic94xx_hwi.c
+++ b/drivers/scsi/aic94xx/aic94xx_hwi.c
@@ -96,7 +96,7 @@ static int asd_init_phy(struct asd_phy *phy)
96 sas_phy->type = PHY_TYPE_PHYSICAL; 96 sas_phy->type = PHY_TYPE_PHYSICAL;
97 sas_phy->role = PHY_ROLE_INITIATOR; 97 sas_phy->role = PHY_ROLE_INITIATOR;
98 sas_phy->oob_mode = OOB_NOT_CONNECTED; 98 sas_phy->oob_mode = OOB_NOT_CONNECTED;
99 sas_phy->linkrate = PHY_LINKRATE_NONE; 99 sas_phy->linkrate = SAS_LINK_RATE_UNKNOWN;
100 100
101 phy->id_frm_tok = asd_alloc_coherent(asd_ha, 101 phy->id_frm_tok = asd_alloc_coherent(asd_ha,
102 sizeof(*phy->identify_frame), 102 sizeof(*phy->identify_frame),
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c
index 69aa70887530..302b54fddf3c 100644
--- a/drivers/scsi/aic94xx/aic94xx_init.c
+++ b/drivers/scsi/aic94xx/aic94xx_init.c
@@ -240,10 +240,14 @@ static int __devinit asd_common_setup(struct asd_ha_struct *asd_ha)
240 /* All phys are enabled, by default. */ 240 /* All phys are enabled, by default. */
241 asd_ha->hw_prof.enabled_phys = 0xFF; 241 asd_ha->hw_prof.enabled_phys = 0xFF;
242 for (i = 0; i < ASD_MAX_PHYS; i++) { 242 for (i = 0; i < ASD_MAX_PHYS; i++) {
243 asd_ha->hw_prof.phy_desc[i].max_sas_lrate = PHY_LINKRATE_3; 243 asd_ha->hw_prof.phy_desc[i].max_sas_lrate =
244 asd_ha->hw_prof.phy_desc[i].min_sas_lrate = PHY_LINKRATE_1_5; 244 SAS_LINK_RATE_3_0_GBPS;
245 asd_ha->hw_prof.phy_desc[i].max_sata_lrate= PHY_LINKRATE_1_5; 245 asd_ha->hw_prof.phy_desc[i].min_sas_lrate =
246 asd_ha->hw_prof.phy_desc[i].min_sata_lrate= PHY_LINKRATE_1_5; 246 SAS_LINK_RATE_1_5_GBPS;
247 asd_ha->hw_prof.phy_desc[i].max_sata_lrate =
248 SAS_LINK_RATE_1_5_GBPS;
249 asd_ha->hw_prof.phy_desc[i].min_sata_lrate =
250 SAS_LINK_RATE_1_5_GBPS;
247 } 251 }
248 252
249 return 0; 253 return 0;
diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c
index fc1b7438a913..ef8ca08b545f 100644
--- a/drivers/scsi/aic94xx/aic94xx_scb.c
+++ b/drivers/scsi/aic94xx/aic94xx_scb.c
@@ -55,15 +55,15 @@ static inline void get_lrate_mode(struct asd_phy *phy, u8 oob_mode)
55 switch (oob_mode & 7) { 55 switch (oob_mode & 7) {
56 case PHY_SPEED_60: 56 case PHY_SPEED_60:
57 /* FIXME: sas transport class doesn't have this */ 57 /* FIXME: sas transport class doesn't have this */
58 phy->sas_phy.linkrate = PHY_LINKRATE_6; 58 phy->sas_phy.linkrate = SAS_LINK_RATE_6_0_GBPS;
59 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS; 59 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS;
60 break; 60 break;
61 case PHY_SPEED_30: 61 case PHY_SPEED_30:
62 phy->sas_phy.linkrate = PHY_LINKRATE_3; 62 phy->sas_phy.linkrate = SAS_LINK_RATE_3_0_GBPS;
63 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS; 63 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS;
64 break; 64 break;
65 case PHY_SPEED_15: 65 case PHY_SPEED_15:
66 phy->sas_phy.linkrate = PHY_LINKRATE_1_5; 66 phy->sas_phy.linkrate = SAS_LINK_RATE_1_5_GBPS;
67 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS; 67 phy->sas_phy.phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS;
68 break; 68 break;
69 } 69 }
@@ -540,39 +540,39 @@ static inline void set_speed_mask(u8 *speed_mask, struct asd_phy_desc *pd)
540 | SATA_SPEED_30_DIS | SATA_SPEED_15_DIS; 540 | SATA_SPEED_30_DIS | SATA_SPEED_15_DIS;
541 541
542 switch (pd->max_sas_lrate) { 542 switch (pd->max_sas_lrate) {
543 case PHY_LINKRATE_6: 543 case SAS_LINK_RATE_6_0_GBPS:
544 *speed_mask &= ~SAS_SPEED_60_DIS; 544 *speed_mask &= ~SAS_SPEED_60_DIS;
545 default: 545 default:
546 case PHY_LINKRATE_3: 546 case SAS_LINK_RATE_3_0_GBPS:
547 *speed_mask &= ~SAS_SPEED_30_DIS; 547 *speed_mask &= ~SAS_SPEED_30_DIS;
548 case PHY_LINKRATE_1_5: 548 case SAS_LINK_RATE_1_5_GBPS:
549 *speed_mask &= ~SAS_SPEED_15_DIS; 549 *speed_mask &= ~SAS_SPEED_15_DIS;
550 } 550 }
551 551
552 switch (pd->min_sas_lrate) { 552 switch (pd->min_sas_lrate) {
553 case PHY_LINKRATE_6: 553 case SAS_LINK_RATE_6_0_GBPS:
554 *speed_mask |= SAS_SPEED_30_DIS; 554 *speed_mask |= SAS_SPEED_30_DIS;
555 case PHY_LINKRATE_3: 555 case SAS_LINK_RATE_3_0_GBPS:
556 *speed_mask |= SAS_SPEED_15_DIS; 556 *speed_mask |= SAS_SPEED_15_DIS;
557 default: 557 default:
558 case PHY_LINKRATE_1_5: 558 case SAS_LINK_RATE_1_5_GBPS:
559 /* nothing to do */ 559 /* nothing to do */
560 ; 560 ;
561 } 561 }
562 562
563 switch (pd->max_sata_lrate) { 563 switch (pd->max_sata_lrate) {
564 case PHY_LINKRATE_3: 564 case SAS_LINK_RATE_3_0_GBPS:
565 *speed_mask &= ~SATA_SPEED_30_DIS; 565 *speed_mask &= ~SATA_SPEED_30_DIS;
566 default: 566 default:
567 case PHY_LINKRATE_1_5: 567 case SAS_LINK_RATE_1_5_GBPS:
568 *speed_mask &= ~SATA_SPEED_15_DIS; 568 *speed_mask &= ~SATA_SPEED_15_DIS;
569 } 569 }
570 570
571 switch (pd->min_sata_lrate) { 571 switch (pd->min_sata_lrate) {
572 case PHY_LINKRATE_3: 572 case SAS_LINK_RATE_3_0_GBPS:
573 *speed_mask |= SATA_SPEED_15_DIS; 573 *speed_mask |= SATA_SPEED_15_DIS;
574 default: 574 default:
575 case PHY_LINKRATE_1_5: 575 case SAS_LINK_RATE_1_5_GBPS:
576 /* nothing to do */ 576 /* nothing to do */
577 ; 577 ;
578 } 578 }
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index b653a263f76a..02e796ee027e 100644
--- a/drivers/scsi/libsas/sas_expander.c
+++ b/drivers/scsi/libsas/sas_expander.c
@@ -191,20 +191,7 @@ static void sas_set_ex_phy(struct domain_device *dev, int phy_id,
191 phy->phy->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS; 191 phy->phy->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS;
192 phy->phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS; 192 phy->phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS;
193 phy->phy->maximum_linkrate = SAS_LINK_RATE_3_0_GBPS; 193 phy->phy->maximum_linkrate = SAS_LINK_RATE_3_0_GBPS;
194 switch (phy->linkrate) { 194 phy->phy->negotiated_linkrate = phy->linkrate;
195 case PHY_LINKRATE_1_5:
196 phy->phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS;
197 break;
198 case PHY_LINKRATE_3:
199 phy->phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS;
200 break;
201 case PHY_LINKRATE_6:
202 phy->phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS;
203 break;
204 default:
205 phy->phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN;
206 break;
207 }
208 195
209 if (!rediscover) 196 if (!rediscover)
210 sas_phy_add(phy->phy); 197 sas_phy_add(phy->phy);
@@ -450,7 +437,7 @@ static void sas_ex_disable_phy(struct domain_device *dev, int phy_id)
450 struct ex_phy *phy = &ex->ex_phy[phy_id]; 437 struct ex_phy *phy = &ex->ex_phy[phy_id];
451 438
452 sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE); 439 sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE);
453 phy->linkrate = PHY_DISABLED; 440 phy->linkrate = SAS_PHY_DISABLED;
454} 441}
455 442
456static void sas_ex_disable_port(struct domain_device *dev, u8 *sas_addr) 443static void sas_ex_disable_port(struct domain_device *dev, u8 *sas_addr)
@@ -743,7 +730,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
743 int res = 0; 730 int res = 0;
744 731
745 /* Phy state */ 732 /* Phy state */
746 if (ex_phy->linkrate == PHY_SPINUP_HOLD) { 733 if (ex_phy->linkrate == SAS_SATA_SPINUP_HOLD) {
747 if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET)) 734 if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET))
748 res = sas_ex_phy_discover(dev, phy_id); 735 res = sas_ex_phy_discover(dev, phy_id);
749 if (res) 736 if (res)
@@ -773,7 +760,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
773 sas_configure_routing(dev, ex_phy->attached_sas_addr); 760 sas_configure_routing(dev, ex_phy->attached_sas_addr);
774 } 761 }
775 return 0; 762 return 0;
776 } else if (ex_phy->linkrate == PHY_LINKRATE_UNKNOWN) 763 } else if (ex_phy->linkrate == SAS_LINK_RATE_UNKNOWN)
777 return 0; 764 return 0;
778 765
779 if (ex_phy->attached_dev_type != SAS_END_DEV && 766 if (ex_phy->attached_dev_type != SAS_END_DEV &&
@@ -922,9 +909,9 @@ static int sas_ex_discover_devices(struct domain_device *dev, int single)
922 continue; 909 continue;
923 910
924 switch (ex_phy->linkrate) { 911 switch (ex_phy->linkrate) {
925 case PHY_DISABLED: 912 case SAS_PHY_DISABLED:
926 case PHY_RESET_PROBLEM: 913 case SAS_PHY_RESET_PROBLEM:
927 case PHY_PORT_SELECTOR: 914 case SAS_SATA_PORT_SELECTOR:
928 continue; 915 continue;
929 default: 916 default:
930 res = sas_ex_discover_dev(dev, i); 917 res = sas_ex_discover_dev(dev, i);
diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h
index 89c397680846..0d69ede4b944 100644
--- a/drivers/scsi/libsas/sas_internal.h
+++ b/drivers/scsi/libsas/sas_internal.h
@@ -43,7 +43,7 @@ void sas_scsi_recover_host(struct Scsi_Host *shost);
43 43
44int sas_show_class(enum sas_class class, char *buf); 44int sas_show_class(enum sas_class class, char *buf);
45int sas_show_proto(enum sas_proto proto, char *buf); 45int sas_show_proto(enum sas_proto proto, char *buf);
46int sas_show_linkrate(enum sas_phy_linkrate linkrate, char *buf); 46int sas_show_linkrate(enum sas_linkrate linkrate, char *buf);
47int sas_show_oob_mode(enum sas_oob_mode oob_mode, char *buf); 47int sas_show_oob_mode(enum sas_oob_mode oob_mode, char *buf);
48 48
49int sas_register_phys(struct sas_ha_struct *sas_ha); 49int sas_register_phys(struct sas_ha_struct *sas_ha);
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h
index 72acdabe7f80..8d91313dd888 100644
--- a/include/scsi/libsas.h
+++ b/include/scsi/libsas.h
@@ -114,7 +114,7 @@ struct ex_phy {
114 enum ex_phy_state phy_state; 114 enum ex_phy_state phy_state;
115 115
116 enum sas_dev_type attached_dev_type; 116 enum sas_dev_type attached_dev_type;
117 enum sas_phy_linkrate linkrate; 117 enum sas_linkrate linkrate;
118 118
119 u8 attached_sata_host:1; 119 u8 attached_sata_host:1;
120 u8 attached_sata_dev:1; 120 u8 attached_sata_dev:1;
@@ -170,9 +170,9 @@ struct sata_device {
170struct domain_device { 170struct domain_device {
171 enum sas_dev_type dev_type; 171 enum sas_dev_type dev_type;
172 172
173 enum sas_phy_linkrate linkrate; 173 enum sas_linkrate linkrate;
174 enum sas_phy_linkrate min_linkrate; 174 enum sas_linkrate min_linkrate;
175 enum sas_phy_linkrate max_linkrate; 175 enum sas_linkrate max_linkrate;
176 176
177 int pathways; 177 int pathways;
178 178
@@ -220,7 +220,7 @@ struct asd_sas_port {
220 struct domain_device *port_dev; 220 struct domain_device *port_dev;
221 spinlock_t dev_list_lock; 221 spinlock_t dev_list_lock;
222 struct list_head dev_list; 222 struct list_head dev_list;
223 enum sas_phy_linkrate linkrate; 223 enum sas_linkrate linkrate;
224 224
225 struct sas_phy *phy; 225 struct sas_phy *phy;
226 struct work_struct work; 226 struct work_struct work;
@@ -276,7 +276,7 @@ struct asd_sas_phy {
276 enum sas_phy_type type; 276 enum sas_phy_type type;
277 enum sas_phy_role role; 277 enum sas_phy_role role;
278 enum sas_oob_mode oob_mode; 278 enum sas_oob_mode oob_mode;
279 enum sas_phy_linkrate linkrate; 279 enum sas_linkrate linkrate;
280 280
281 u8 *sas_addr; /* must be set */ 281 u8 *sas_addr; /* must be set */
282 u8 attached_sas_addr[SAS_ADDR_SIZE]; /* class:RO, driver: R/W */ 282 u8 attached_sas_addr[SAS_ADDR_SIZE]; /* class:RO, driver: R/W */
@@ -368,7 +368,7 @@ void sas_hash_addr(u8 *hashed, const u8 *sas_addr);
368static inline void sas_phy_disconnected(struct asd_sas_phy *phy) 368static inline void sas_phy_disconnected(struct asd_sas_phy *phy)
369{ 369{
370 phy->oob_mode = OOB_NOT_CONNECTED; 370 phy->oob_mode = OOB_NOT_CONNECTED;
371 phy->linkrate = PHY_LINKRATE_NONE; 371 phy->linkrate = SAS_LINK_RATE_UNKNOWN;
372} 372}
373 373
374/* ---------- Tasks ---------- */ 374/* ---------- Tasks ---------- */
diff --git a/include/scsi/sas.h b/include/scsi/sas.h
index 752853a113dc..9c8a5b91ae64 100644
--- a/include/scsi/sas.h
+++ b/include/scsi/sas.h
@@ -102,20 +102,6 @@ enum sas_dev_type {
102 SATA_PM_PORT= 8, 102 SATA_PM_PORT= 8,
103}; 103};
104 104
105enum sas_phy_linkrate {
106 PHY_LINKRATE_NONE = 0,
107 PHY_LINKRATE_UNKNOWN = 0,
108 PHY_DISABLED,
109 PHY_RESET_PROBLEM,
110 PHY_SPINUP_HOLD,
111 PHY_PORT_SELECTOR,
112 PHY_LINKRATE_1_5 = 0x08,
113 PHY_LINKRATE_G1 = PHY_LINKRATE_1_5,
114 PHY_LINKRATE_3 = 0x09,
115 PHY_LINKRATE_G2 = PHY_LINKRATE_3,
116 PHY_LINKRATE_6 = 0x0A,
117};
118
119/* Partly from IDENTIFY address frame. */ 105/* Partly from IDENTIFY address frame. */
120enum sas_proto { 106enum sas_proto {
121 SATA_PROTO = 1, 107 SATA_PROTO = 1,
diff --git a/include/scsi/scsi_transport_sas.h b/include/scsi/scsi_transport_sas.h
index eeb2200de855..87de518960c1 100644
--- a/include/scsi/scsi_transport_sas.h
+++ b/include/scsi/scsi_transport_sas.h
@@ -24,15 +24,23 @@ enum sas_protocol {
24}; 24};
25 25
26enum sas_linkrate { 26enum sas_linkrate {
27 SAS_LINK_RATE_UNKNOWN, 27 /* These Values are defined in the SAS standard */
28 SAS_PHY_DISABLED, 28 SAS_LINK_RATE_UNKNOWN = 0,
29 SAS_LINK_RATE_FAILED, 29 SAS_PHY_DISABLED = 1,
30 SAS_SATA_SPINUP_HOLD, 30 SAS_PHY_RESET_PROBLEM = 2,
31 SAS_SATA_PORT_SELECTOR, 31 SAS_SATA_SPINUP_HOLD = 3,
32 SAS_LINK_RATE_1_5_GBPS, 32 SAS_SATA_PORT_SELECTOR = 4,
33 SAS_LINK_RATE_3_0_GBPS, 33 SAS_PHY_RESET_IN_PROGRESS = 5,
34 SAS_LINK_RATE_6_0_GBPS, 34 SAS_LINK_RATE_1_5_GBPS = 8,
35 SAS_LINK_VIRTUAL, 35 SAS_LINK_RATE_G1 = SAS_LINK_RATE_1_5_GBPS,
36 SAS_LINK_RATE_3_0_GBPS = 9,
37 SAS_LINK_RATE_G2 = SAS_LINK_RATE_3_0_GBPS,
38 SAS_LINK_RATE_6_0_GBPS = 10,
39 /* These are virtual to the transport class and may never
40 * be signalled normally since the standard defined field
41 * is only 4 bits */
42 SAS_LINK_RATE_FAILED = 0x10,
43 SAS_PHY_VIRTUAL = 0x11,
36}; 44};
37 45
38struct sas_identify { 46struct sas_identify {