aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic94xx
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2006-09-06 18:36:13 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-09-07 13:41:16 -0400
commit88edf74610bd894b93438f389688bc8b4a2d3414 (patch)
tree5f22ad465f07a8eda5576185db2e24ac7797d68a /drivers/scsi/aic94xx
parentb4620233d6a3510564c561a5a2a365a1d8a34b68 (diff)
[SCSI] SAS: consolidate linkspeed definitions
At the moment we have two separate linkspeed enumerations covering roughly the same values. This patch consolidates on a single one enum sas_linkspeed in scsi_transport_sas.h and uses it everywhere in the aic94xx driver. Eventually I'll get around to removing the duplicated fields in asd_sas_phy and sas_phy ... Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aic94xx')
-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
3 files changed, 22 insertions, 18 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 }