summaryrefslogtreecommitdiff
path: root/drivers/scsi/libsas
diff options
context:
space:
mode:
authorJames Bottomley <James.Bottomley@steeleye.com>2006-09-06 17:36:13 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-09-07 12:41:16 -0500
commit88edf74610bd894b93438f389688bc8b4a2d3414 (patch)
tree5f22ad465f07a8eda5576185db2e24ac7797d68a /drivers/scsi/libsas
parentb4620233d6a3510564c561a5a2a365a1d8a34b68 (diff)
downloadlinux-3.10-88edf74610bd894b93438f389688bc8b4a2d3414.tar.gz
linux-3.10-88edf74610bd894b93438f389688bc8b4a2d3414.tar.bz2
linux-3.10-88edf74610bd894b93438f389688bc8b4a2d3414.zip
[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/libsas')
-rw-r--r--drivers/scsi/libsas/sas_expander.c27
-rw-r--r--drivers/scsi/libsas/sas_internal.h2
2 files changed, 8 insertions, 21 deletions
diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c
index b653a263f76..02e796ee027 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,
phy->phy->maximum_linkrate_hw = SAS_LINK_RATE_3_0_GBPS;
phy->phy->minimum_linkrate = SAS_LINK_RATE_1_5_GBPS;
phy->phy->maximum_linkrate = SAS_LINK_RATE_3_0_GBPS;
- switch (phy->linkrate) {
- case PHY_LINKRATE_1_5:
- phy->phy->negotiated_linkrate = SAS_LINK_RATE_1_5_GBPS;
- break;
- case PHY_LINKRATE_3:
- phy->phy->negotiated_linkrate = SAS_LINK_RATE_3_0_GBPS;
- break;
- case PHY_LINKRATE_6:
- phy->phy->negotiated_linkrate = SAS_LINK_RATE_6_0_GBPS;
- break;
- default:
- phy->phy->negotiated_linkrate = SAS_LINK_RATE_UNKNOWN;
- break;
- }
+ phy->phy->negotiated_linkrate = phy->linkrate;
if (!rediscover)
sas_phy_add(phy->phy);
@@ -450,7 +437,7 @@ static void sas_ex_disable_phy(struct domain_device *dev, int phy_id)
struct ex_phy *phy = &ex->ex_phy[phy_id];
sas_smp_phy_control(dev, phy_id, PHY_FUNC_DISABLE);
- phy->linkrate = PHY_DISABLED;
+ phy->linkrate = SAS_PHY_DISABLED;
}
static 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)
int res = 0;
/* Phy state */
- if (ex_phy->linkrate == PHY_SPINUP_HOLD) {
+ if (ex_phy->linkrate == SAS_SATA_SPINUP_HOLD) {
if (!sas_smp_phy_control(dev, phy_id, PHY_FUNC_LINK_RESET))
res = sas_ex_phy_discover(dev, phy_id);
if (res)
@@ -773,7 +760,7 @@ static int sas_ex_discover_dev(struct domain_device *dev, int phy_id)
sas_configure_routing(dev, ex_phy->attached_sas_addr);
}
return 0;
- } else if (ex_phy->linkrate == PHY_LINKRATE_UNKNOWN)
+ } else if (ex_phy->linkrate == SAS_LINK_RATE_UNKNOWN)
return 0;
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)
continue;
switch (ex_phy->linkrate) {
- case PHY_DISABLED:
- case PHY_RESET_PROBLEM:
- case PHY_PORT_SELECTOR:
+ case SAS_PHY_DISABLED:
+ case SAS_PHY_RESET_PROBLEM:
+ case SAS_SATA_PORT_SELECTOR:
continue;
default:
res = sas_ex_discover_dev(dev, i);
diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h
index 89c39768084..0d69ede4b94 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);
int sas_show_class(enum sas_class class, char *buf);
int sas_show_proto(enum sas_proto proto, char *buf);
-int sas_show_linkrate(enum sas_phy_linkrate linkrate, char *buf);
+int sas_show_linkrate(enum sas_linkrate linkrate, char *buf);
int sas_show_oob_mode(enum sas_oob_mode oob_mode, char *buf);
int sas_register_phys(struct sas_ha_struct *sas_ha);