aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/isci
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2011-04-26 12:41:52 -0400
committerDan Williams <dan.j.williams@intel.com>2011-07-03 07:00:38 -0400
commita3d568f0dfbb6bc786df04ad13e0b401f80e614c (patch)
tree690eef9305ba277b63b6df5961d1a0b1331b3e6a /drivers/scsi/isci
parent00d680ef84570bc7aea023772d27e85b0052004c (diff)
isci: remove usage of sci_sas_address in scic_sds_remote_device
The sas address can be retrieved from the domain device and then converted to the always little-endian format in the remote node context. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/scsi/isci')
-rw-r--r--drivers/scsi/isci/remote_device.c3
-rw-r--r--drivers/scsi/isci/remote_device.h5
-rw-r--r--drivers/scsi/isci/remote_node_context.c8
3 files changed, 5 insertions, 11 deletions
diff --git a/drivers/scsi/isci/remote_device.c b/drivers/scsi/isci/remote_device.c
index 5ba3b5dca4d5..1e9e2227820a 100644
--- a/drivers/scsi/isci/remote_device.c
+++ b/drivers/scsi/isci/remote_device.c
@@ -1501,8 +1501,6 @@ static enum sci_status scic_remote_device_da_construct(struct scic_sds_port *sci
1501 1501
1502 sci_dev->rnc.remote_node_index = remote_node_index; 1502 sci_dev->rnc.remote_node_index = remote_node_index;
1503 1503
1504 scic_sds_port_get_attached_sas_address(sci_port, &sci_dev->device_address);
1505
1506 if (dev->dev_type == SAS_END_DEV) 1504 if (dev->dev_type == SAS_END_DEV)
1507 sci_dev->has_ready_substate_machine = false; 1505 sci_dev->has_ready_substate_machine = false;
1508 else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) { 1506 else if (dev->dev_type == SATA_DEV || (dev->tproto & SAS_PROTOCOL_STP)) {
@@ -1553,7 +1551,6 @@ static enum sci_status scic_remote_device_ea_construct(struct scic_sds_port *sci
1553 enum sci_status status; 1551 enum sci_status status;
1554 1552
1555 scic_remote_device_construct(sci_port, sci_dev); 1553 scic_remote_device_construct(sci_port, sci_dev);
1556 memcpy(&sci_dev->device_address, dev->sas_addr, SAS_ADDR_SIZE);
1557 1554
1558 status = scic_sds_controller_allocate_remote_node_context( 1555 status = scic_sds_controller_allocate_remote_node_context(
1559 scic, sci_dev, &sci_dev->rnc.remote_node_index); 1556 scic, sci_dev, &sci_dev->rnc.remote_node_index);
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h
index 39821601022b..f0612d46fe2b 100644
--- a/drivers/scsi/isci/remote_device.h
+++ b/drivers/scsi/isci/remote_device.h
@@ -100,11 +100,6 @@ struct scic_sds_remote_device {
100 enum sas_linkrate connection_rate; 100 enum sas_linkrate connection_rate;
101 101
102 /** 102 /**
103 * This field contains the device SAS address.
104 */
105 struct sci_sas_address device_address;
106
107 /**
108 * This filed is assinged the value of true if the device is directly 103 * This filed is assinged the value of true if the device is directly
109 * attached to the port. 104 * attached to the port.
110 */ 105 */
diff --git a/drivers/scsi/isci/remote_node_context.c b/drivers/scsi/isci/remote_node_context.c
index 59f878f11f33..e83657d554b7 100644
--- a/drivers/scsi/isci/remote_node_context.c
+++ b/drivers/scsi/isci/remote_node_context.c
@@ -110,6 +110,7 @@ static void scic_sds_remote_node_context_construct_buffer(
110 struct domain_device *dev = sci_dev_to_domain(sci_dev); 110 struct domain_device *dev = sci_dev_to_domain(sci_dev);
111 union scu_remote_node_context *rnc; 111 union scu_remote_node_context *rnc;
112 struct scic_sds_controller *scic; 112 struct scic_sds_controller *scic;
113 __le64 sas_addr;
113 114
114 scic = scic_sds_remote_device_get_controller(sci_dev); 115 scic = scic_sds_remote_device_get_controller(sci_dev);
115 116
@@ -124,9 +125,10 @@ static void scic_sds_remote_node_context_construct_buffer(
124 rnc->ssp.logical_port_index = 125 rnc->ssp.logical_port_index =
125 scic_sds_remote_device_get_port_index(sci_dev); 126 scic_sds_remote_device_get_port_index(sci_dev);
126 127
127 /* address is always big endian, destination is always little */ 128 /* sas address is __be64, context ram format is __le64 */
128 rnc->ssp.remote_sas_address_hi = swab32(sci_dev->device_address.high); 129 sas_addr = cpu_to_le64(SAS_ADDR(dev->sas_addr));
129 rnc->ssp.remote_sas_address_lo = swab32(sci_dev->device_address.low); 130 rnc->ssp.remote_sas_address_hi = upper_32_bits(sas_addr);
131 rnc->ssp.remote_sas_address_lo = lower_32_bits(sas_addr);
130 132
131 rnc->ssp.nexus_loss_timer_enable = true; 133 rnc->ssp.nexus_loss_timer_enable = true;
132 rnc->ssp.check_bit = false; 134 rnc->ssp.check_bit = false;