aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/isci/port.c2
-rw-r--r--drivers/scsi/isci/port.h4
-rw-r--r--drivers/scsi/isci/remote_device.c10
3 files changed, 12 insertions, 4 deletions
diff --git a/drivers/scsi/isci/port.c b/drivers/scsi/isci/port.c
index 4cb071d825bb..49e8a72d1c5b 100644
--- a/drivers/scsi/isci/port.c
+++ b/drivers/scsi/isci/port.c
@@ -114,7 +114,7 @@ static u32 sci_port_get_phys(struct isci_port *iport)
114 * value is returned if the specified port is not valid. When this value is 114 * value is returned if the specified port is not valid. When this value is
115 * returned, no data is copied to the properties output parameter. 115 * returned, no data is copied to the properties output parameter.
116 */ 116 */
117static enum sci_status sci_port_get_properties(struct isci_port *iport, 117enum sci_status sci_port_get_properties(struct isci_port *iport,
118 struct sci_port_properties *prop) 118 struct sci_port_properties *prop)
119{ 119{
120 if (!iport || iport->logical_port_index == SCIC_SDS_DUMMY_PORT) 120 if (!iport || iport->logical_port_index == SCIC_SDS_DUMMY_PORT)
diff --git a/drivers/scsi/isci/port.h b/drivers/scsi/isci/port.h
index cb5ffbc38603..b3a7f12803f5 100644
--- a/drivers/scsi/isci/port.h
+++ b/drivers/scsi/isci/port.h
@@ -250,6 +250,10 @@ bool sci_port_link_detected(
250 struct isci_port *iport, 250 struct isci_port *iport,
251 struct isci_phy *iphy); 251 struct isci_phy *iphy);
252 252
253enum sci_status sci_port_get_properties(
254 struct isci_port *iport,
255 struct sci_port_properties *prop);
256
253enum sci_status sci_port_link_up(struct isci_port *iport, 257enum sci_status sci_port_link_up(struct isci_port *iport,
254 struct isci_phy *iphy); 258 struct isci_phy *iphy);
255enum sci_status sci_port_link_down(struct isci_port *iport, 259enum sci_status sci_port_link_down(struct isci_port *iport,
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index b207cd3b15a0..dd74b6ceeb82 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -53,6 +53,7 @@
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 */ 54 */
55#include <scsi/sas.h> 55#include <scsi/sas.h>
56#include <linux/bitops.h>
56#include "isci.h" 57#include "isci.h"
57#include "port.h" 58#include "port.h"
58#include "remote_device.h" 59#include "remote_device.h"
@@ -1101,6 +1102,7 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
1101 struct isci_remote_device *idev) 1102 struct isci_remote_device *idev)
1102{ 1103{
1103 enum sci_status status; 1104 enum sci_status status;
1105 struct sci_port_properties properties;
1104 struct domain_device *dev = idev->domain_dev; 1106 struct domain_device *dev = idev->domain_dev;
1105 1107
1106 sci_remote_device_construct(iport, idev); 1108 sci_remote_device_construct(iport, idev);
@@ -1110,6 +1112,11 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
1110 * entries will be needed to store the remote node. 1112 * entries will be needed to store the remote node.
1111 */ 1113 */
1112 idev->is_direct_attached = true; 1114 idev->is_direct_attached = true;
1115
1116 sci_port_get_properties(iport, &properties);
1117 /* Get accurate port width from port's phy mask for a DA device. */
1118 idev->device_port_width = hweight32(properties.phy_mask);
1119
1113 status = sci_controller_allocate_remote_node_context(iport->owning_controller, 1120 status = sci_controller_allocate_remote_node_context(iport->owning_controller,
1114 idev, 1121 idev,
1115 &idev->rnc.remote_node_index); 1122 &idev->rnc.remote_node_index);
@@ -1125,9 +1132,6 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
1125 1132
1126 idev->connection_rate = sci_port_get_max_allowed_speed(iport); 1133 idev->connection_rate = sci_port_get_max_allowed_speed(iport);
1127 1134
1128 /* / @todo Should I assign the port width by reading all of the phys on the port? */
1129 idev->device_port_width = 1;
1130
1131 return SCI_SUCCESS; 1135 return SCI_SUCCESS;
1132} 1136}
1133 1137