[SCSI] qla2xxx: Correct setting of 'current' and 'supported' speeds during FDMI registration.

Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>

authored by

Andrew Vasquez and committed by
James Bottomley
5881569b c76f2c01

+28 -9
+8
drivers/scsi/qla2xxx/qla_def.h
··· 1711 1711 #define FDMI_PORT_OS_DEVICE_NAME 5 1712 1712 #define FDMI_PORT_HOST_NAME 6 1713 1713 1714 + #define FDMI_PORT_SPEED_1GB 0x1 1715 + #define FDMI_PORT_SPEED_2GB 0x2 1716 + #define FDMI_PORT_SPEED_10GB 0x4 1717 + #define FDMI_PORT_SPEED_4GB 0x8 1718 + #define FDMI_PORT_SPEED_8GB 0x10 1719 + #define FDMI_PORT_SPEED_16GB 0x20 1720 + #define FDMI_PORT_SPEED_UNKNOWN 0x8000 1721 + 1714 1722 struct ct_fdmi_port_attr { 1715 1723 uint16_t type; 1716 1724 uint16_t len;
+20 -9
drivers/scsi/qla2xxx/qla_gs.c
··· 1528 1528 eiter->type = __constant_cpu_to_be16(FDMI_PORT_SUPPORT_SPEED); 1529 1529 eiter->len = __constant_cpu_to_be16(4 + 4); 1530 1530 if (IS_QLA24XX(ha) || IS_QLA54XX(ha)) 1531 - eiter->a.sup_speed = __constant_cpu_to_be32(4); 1531 + eiter->a.sup_speed = __constant_cpu_to_be32( 1532 + FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB| 1533 + FDMI_PORT_SPEED_4GB); 1532 1534 else if (IS_QLA23XX(ha)) 1533 - eiter->a.sup_speed = __constant_cpu_to_be32(2); 1535 + eiter->a.sup_speed =__constant_cpu_to_be32( 1536 + FDMI_PORT_SPEED_1GB|FDMI_PORT_SPEED_2GB); 1534 1537 else 1535 - eiter->a.sup_speed = __constant_cpu_to_be32(1); 1538 + eiter->a.sup_speed = __constant_cpu_to_be32( 1539 + FDMI_PORT_SPEED_1GB); 1536 1540 size += 4 + 4; 1537 1541 1538 1542 DEBUG13(printk("%s(%ld): SUPPORTED_SPEED=%x.\n", __func__, ha->host_no, ··· 1547 1543 eiter->type = __constant_cpu_to_be16(FDMI_PORT_CURRENT_SPEED); 1548 1544 eiter->len = __constant_cpu_to_be16(4 + 4); 1549 1545 switch (ha->link_data_rate) { 1550 - case 0: 1551 - eiter->a.cur_speed = __constant_cpu_to_be32(1); 1546 + case PORT_SPEED_1GB: 1547 + eiter->a.cur_speed = 1548 + __constant_cpu_to_be32(FDMI_PORT_SPEED_1GB); 1552 1549 break; 1553 - case 1: 1554 - eiter->a.cur_speed = __constant_cpu_to_be32(2); 1550 + case PORT_SPEED_2GB: 1551 + eiter->a.cur_speed = 1552 + __constant_cpu_to_be32(FDMI_PORT_SPEED_2GB); 1555 1553 break; 1556 - case 3: 1557 - eiter->a.cur_speed = __constant_cpu_to_be32(4); 1554 + case PORT_SPEED_4GB: 1555 + eiter->a.cur_speed = 1556 + __constant_cpu_to_be32(FDMI_PORT_SPEED_4GB); 1557 + break; 1558 + default: 1559 + eiter->a.cur_speed = 1560 + __constant_cpu_to_be32(FDMI_PORT_SPEED_UNKNOWN); 1558 1561 break; 1559 1562 } 1560 1563 size += 4 + 4;