Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 286355
b: refs/heads/master
c: 7e62984
h: refs/heads/master
i:
  286353: 1ffc851
  286351: 1135d66
v: v3
  • Loading branch information
Bartek Nowakowski authored and James Bottomley committed Jan 16, 2012
1 parent d5031f1 commit 7944a60
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d4ec1cf61fb081a9dde0c0e0b2d0201f4005f937
refs/heads/master: 7e629841b8f8f7bc84d74de994d748b0a3282225
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/isci/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ static u32 sci_port_get_phys(struct isci_port *iport)
* value is returned if the specified port is not valid. When this value is
* returned, no data is copied to the properties output parameter.
*/
static enum sci_status sci_port_get_properties(struct isci_port *iport,
enum sci_status sci_port_get_properties(struct isci_port *iport,
struct sci_port_properties *prop)
{
if (!iport || iport->logical_port_index == SCIC_SDS_DUMMY_PORT)
Expand Down
4 changes: 4 additions & 0 deletions trunk/drivers/scsi/isci/port.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,10 @@ bool sci_port_link_detected(
struct isci_port *iport,
struct isci_phy *iphy);

enum sci_status sci_port_get_properties(
struct isci_port *iport,
struct sci_port_properties *prop);

enum sci_status sci_port_link_up(struct isci_port *iport,
struct isci_phy *iphy);
enum sci_status sci_port_link_down(struct isci_port *iport,
Expand Down
10 changes: 7 additions & 3 deletions trunk/drivers/scsi/isci/remote_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <scsi/sas.h>
#include <linux/bitops.h>
#include "isci.h"
#include "port.h"
#include "remote_device.h"
Expand Down Expand Up @@ -1101,6 +1102,7 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
struct isci_remote_device *idev)
{
enum sci_status status;
struct sci_port_properties properties;
struct domain_device *dev = idev->domain_dev;

sci_remote_device_construct(iport, idev);
Expand All @@ -1110,6 +1112,11 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,
* entries will be needed to store the remote node.
*/
idev->is_direct_attached = true;

sci_port_get_properties(iport, &properties);
/* Get accurate port width from port's phy mask for a DA device. */
idev->device_port_width = hweight32(properties.phy_mask);

status = sci_controller_allocate_remote_node_context(iport->owning_controller,
idev,
&idev->rnc.remote_node_index);
Expand All @@ -1125,9 +1132,6 @@ static enum sci_status sci_remote_device_da_construct(struct isci_port *iport,

idev->connection_rate = sci_port_get_max_allowed_speed(iport);

/* / @todo Should I assign the port width by reading all of the phys on the port? */
idev->device_port_width = 1;

return SCI_SUCCESS;
}

Expand Down

0 comments on commit 7944a60

Please sign in to comment.