isci: advertise linkrate
authorDan Williams <dan.j.williams@intel.com>
Fri, 18 Feb 2011 17:25:13 +0000 (09:25 -0800)
committerDan Williams <dan.j.williams@intel.com>
Sun, 3 Jul 2011 10:55:27 +0000 (03:55 -0700)
Inform libsas of the linkrate of direct attached links.

Reported-by: Haavard Skinnemoen <hskinnemoen@gmail.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
drivers/scsi/isci/core/scic_phy.h
drivers/scsi/isci/core/scic_sds_phy.c
drivers/scsi/isci/port.c

index 13f8a304fdefb44016ee4c97a33c7dad8a0e2b12..bf0d3be58eda610ddd6f381bb487988b8da197a4 100644 (file)
@@ -72,6 +72,9 @@
 struct scic_sds_phy;
 struct scic_sds_port;
 
+
+enum sas_linkrate sci_phy_linkrate(struct scic_sds_phy *sci_phy);
+
 /**
  * struct scic_phy_properties - This structure defines the properties common to
  *    all phys that can be retrieved.
index d9213e215beb796252d78dd77b2bbd002794c017..743e5a6b7409c7f507d9a79380bca548510ac700 100644 (file)
 /* Maximum arbitration wait time in micro-seconds */
 #define SCIC_SDS_PHY_MAX_ARBITRATION_WAIT_TIME  (700)
 
+enum sas_linkrate sci_phy_linkrate(struct scic_sds_phy *sci_phy)
+{
+       return sci_phy->max_negotiated_speed;
+}
+
 /*
  * *****************************************************************************
  * * SCIC SDS PHY Internal Methods
index 2343f655642830e93cb328ae16ccf0e15934ec20..446da20521c982aa1d411334bac3ef2e01a55e29 100644 (file)
@@ -263,6 +263,8 @@ void isci_port_link_up(
                success = false;
        }
 
+       isci_phy->sas_phy.phy->negotiated_linkrate = sci_phy_linkrate(phy);
+
        spin_unlock_irqrestore(&isci_phy->sas_phy.frame_rcvd_lock, flags);
 
        /* Notify libsas that we have an address frame, if indeed