[PATCH 11/25] qla2xxx: Show correct port speed capabilities for RDP command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch correctly displays Port speed capabiltiy and
current speed for RDP command.

Signed-off-by: Himanshu Madhani <hmadhani@xxxxxxxxxxx>
---
 drivers/scsi/qla2xxx/qla_os.c | 41 +++++++++++++++++++++++++++++++++++------
 1 file changed, 35 insertions(+), 6 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 4be99f13be42..dbbe20c7fbaf 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -5762,13 +5762,39 @@ qla25xx_rdp_port_speed_capability(struct qla_hw_data *ha)
 	if (IS_CNA_CAPABLE(ha))
 		return RDP_PORT_SPEED_10GB;
 
-	if (IS_QLA27XX(ha)) {
-		if (FW_ABILITY_MAX_SPEED(ha) == FW_ABILITY_MAX_SPEED_32G)
-			return RDP_PORT_SPEED_32GB|RDP_PORT_SPEED_16GB|
-			       RDP_PORT_SPEED_8GB;
+	if (IS_QLA27XX(ha) || IS_QLA28XX(ha)) {
+		unsigned int speeds = 0;
 
-		return RDP_PORT_SPEED_16GB|RDP_PORT_SPEED_8GB|
-		       RDP_PORT_SPEED_4GB;
+		if (ha->max_supported_speed == 2) {
+			if (ha->min_supported_speed <= 6)
+				speeds |= RDP_PORT_SPEED_64GB;
+		}
+
+		if (ha->max_supported_speed == 2 ||
+		    ha->max_supported_speed == 1) {
+			if (ha->min_supported_speed <= 5)
+				speeds |= RDP_PORT_SPEED_32GB;
+		}
+
+		if (ha->max_supported_speed == 2 ||
+		    ha->max_supported_speed == 1 ||
+		    ha->max_supported_speed == 0) {
+			if (ha->min_supported_speed <= 4)
+				speeds |= RDP_PORT_SPEED_16GB;
+		}
+
+		if (ha->max_supported_speed == 1 ||
+		    ha->max_supported_speed == 0) {
+			if (ha->min_supported_speed <= 3)
+				speeds |= RDP_PORT_SPEED_8GB;
+		}
+
+		if (ha->max_supported_speed == 0) {
+			if (ha->min_supported_speed <= 2)
+				speeds |= RDP_PORT_SPEED_4GB;
+		}
+
+		return speeds;
 	}
 
 	if (IS_QLA2031(ha))
@@ -5814,6 +5840,9 @@ qla25xx_rdp_port_speed_currently(struct qla_hw_data *ha)
 	case PORT_SPEED_32GB:
 		return RDP_PORT_SPEED_32GB;
 
+	case PORT_SPEED_64GB:
+		return RDP_PORT_SPEED_64GB;
+
 	default:
 		return RDP_PORT_SPEED_UNKNOWN;
 	}
-- 
2.12.0




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux