Commit 55732a46 authored by Murthy Bhat's avatar Murthy Bhat Committed by Martin K. Petersen

scsi: smartpqi: Update SAS initiator_port_protocols and target_port_protocols

Export valid sas initiator_port_protocols and target_port_protocols to
sysfs. Needed for lsscsi to show correct values.

Link: https://lore.kernel.org/r/161549384532.25025.1469409935400845385.stgit@brunhildaReviewed-by: default avatarScott Benesh <scott.benesh@microchip.com>
Reviewed-by: default avatarMike McGowen <mike.mcgowen@microchip.com>
Reviewed-by: default avatarScott Teel <scott.teel@microchip.com>
Reviewed-by: default avatarKevin Barnett <kevin.barnett@microchip.com>
Reviewed-by: default avatarMartin Wilck <mwilck@suse.com>
Signed-off-by: default avatarMurthy Bhat <Murthy.Bhat@microchip.com>
Signed-off-by: default avatarDon Brace <don.brace@microchip.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent ec504b23
...@@ -65,8 +65,8 @@ static int pqi_sas_port_add_phy(struct pqi_sas_phy *pqi_sas_phy) ...@@ -65,8 +65,8 @@ static int pqi_sas_port_add_phy(struct pqi_sas_phy *pqi_sas_phy)
memset(identify, 0, sizeof(*identify)); memset(identify, 0, sizeof(*identify));
identify->sas_address = pqi_sas_port->sas_address; identify->sas_address = pqi_sas_port->sas_address;
identify->device_type = SAS_END_DEVICE; identify->device_type = SAS_END_DEVICE;
identify->initiator_port_protocols = SAS_PROTOCOL_STP; identify->initiator_port_protocols = SAS_PROTOCOL_ALL;
identify->target_port_protocols = SAS_PROTOCOL_STP; identify->target_port_protocols = SAS_PROTOCOL_ALL;
phy->minimum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; phy->minimum_linkrate_hw = SAS_LINK_RATE_UNKNOWN;
phy->maximum_linkrate_hw = SAS_LINK_RATE_UNKNOWN; phy->maximum_linkrate_hw = SAS_LINK_RATE_UNKNOWN;
phy->minimum_linkrate = SAS_LINK_RATE_UNKNOWN; phy->minimum_linkrate = SAS_LINK_RATE_UNKNOWN;
...@@ -94,13 +94,23 @@ static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port, ...@@ -94,13 +94,23 @@ static int pqi_sas_port_add_rphy(struct pqi_sas_port *pqi_sas_port,
identify->sas_address = pqi_sas_port->sas_address; identify->sas_address = pqi_sas_port->sas_address;
identify->phy_identifier = pqi_sas_port->device->phy_id; identify->phy_identifier = pqi_sas_port->device->phy_id;
if (pqi_sas_port->device && identify->initiator_port_protocols = SAS_PROTOCOL_ALL;
pqi_sas_port->device->is_expander_smp_device) { identify->target_port_protocols = SAS_PROTOCOL_STP;
identify->initiator_port_protocols = SAS_PROTOCOL_SMP;
identify->target_port_protocols = SAS_PROTOCOL_SMP; if (pqi_sas_port->device) {
} else { switch (pqi_sas_port->device->device_type) {
identify->initiator_port_protocols = SAS_PROTOCOL_STP; case SA_DEVICE_TYPE_SAS:
identify->target_port_protocols = SAS_PROTOCOL_STP; case SA_DEVICE_TYPE_SES:
case SA_DEVICE_TYPE_NVME:
identify->target_port_protocols = SAS_PROTOCOL_SSP;
break;
case SA_DEVICE_TYPE_EXPANDER_SMP:
identify->target_port_protocols = SAS_PROTOCOL_SMP;
break;
case SA_DEVICE_TYPE_SATA:
default:
break;
}
} }
return sas_rphy_add(rphy); return sas_rphy_add(rphy);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment