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@brunhilda Reviewed-by: Scott Benesh <scott.benesh@microchip.com> Reviewed-by: Mike McGowen <mike.mcgowen@microchip.com> Reviewed-by: Scott Teel <scott.teel@microchip.com> Reviewed-by: Kevin Barnett <kevin.barnett@microchip.com> Reviewed-by: Martin Wilck <mwilck@suse.com> Signed-off-by: Murthy Bhat <Murthy.Bhat@microchip.com> Signed-off-by: Don Brace <don.brace@microchip.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
parent
ec504b23df
commit
55732a46d6
|
@ -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,
|
||||||
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);
|
||||||
|
|
Loading…
Reference in New Issue