[SCSI] qla2xxx: Add iIDMA support.

iIDMA (Intelligent Interleaved Direct Memory Access) allows for
the HBA hardware to send FC frames at the rate at which they can
be received by a target device. By taking advantage of the
higher link rate, the HBA can maximize bandwidth utilization in a
heterogeneous multi-speed SAN.

Within a fabric topology, port speed detection is done via a Name
Server command (GFPN_ID) followed by a Fabric Management command
(GPSC). In an FCAL/N2N topology, port speed is based on the HBA
link-rate.

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 d8b45213 ee0ca6ba

+401 -12
+3 -3
drivers/scsi/qla2xxx/qla_attr.c
··· 691 691 uint32_t speed = 0; 692 692 693 693 switch (ha->link_data_rate) { 694 - case LDR_1GB: 694 + case PORT_SPEED_1GB: 695 695 speed = 1; 696 696 break; 697 - case LDR_2GB: 697 + case PORT_SPEED_2GB: 698 698 speed = 2; 699 699 break; 700 - case LDR_4GB: 700 + case PORT_SPEED_4GB: 701 701 speed = 4; 702 702 break; 703 703 }
+34 -5
drivers/scsi/qla2xxx/qla_def.h
··· 608 608 */ 609 609 #define MBC_SERDES_PARAMS 0x10 /* Serdes Tx Parameters. */ 610 610 #define MBC_GET_IOCB_STATUS 0x12 /* Get IOCB status command. */ 611 + #define MBC_PORT_PARAMS 0x1A /* Port iDMA Parameters. */ 611 612 #define MBC_GET_TIMEOUT_PARAMS 0x22 /* Get FW timeouts. */ 612 613 #define MBC_TRACE_CONTROL 0x27 /* Trace control command. */ 613 614 #define MBC_GEN_SYSTEM_ERROR 0x2a /* Generate System Error. */ ··· 1498 1497 port_id_t d_id; 1499 1498 uint8_t node_name[WWN_SIZE]; 1500 1499 uint8_t port_name[WWN_SIZE]; 1500 + uint8_t fabric_port_name[WWN_SIZE]; 1501 + uint16_t fp_speeds; 1502 + uint16_t fp_speed; 1501 1503 } sw_info_t; 1502 1504 1503 1505 /* ··· 1527 1523 port_id_t d_id; 1528 1524 uint16_t loop_id; 1529 1525 uint16_t old_loop_id; 1526 + 1527 + uint8_t fabric_port_name[WWN_SIZE]; 1528 + uint16_t fp_speed; 1530 1529 1531 1530 fc_port_type_t port_type; 1532 1531 ··· 1641 1634 #define RSNN_NN_CMD 0x239 1642 1635 #define RSNN_NN_REQ_SIZE (16 + 8 + 1 + 255) 1643 1636 #define RSNN_NN_RSP_SIZE 16 1637 + 1638 + #define GFPN_ID_CMD 0x11C 1639 + #define GFPN_ID_REQ_SIZE (16 + 4) 1640 + #define GFPN_ID_RSP_SIZE (16 + 8) 1641 + 1642 + #define GPSC_CMD 0x127 1643 + #define GPSC_REQ_SIZE (16 + 8) 1644 + #define GPSC_RSP_SIZE (16 + 2 + 2) 1645 + 1644 1646 1645 1647 /* 1646 1648 * HBA attribute types. ··· 1764 1748 uint8_t reserved[3]; 1765 1749 1766 1750 union { 1767 - /* GA_NXT, GPN_ID, GNN_ID, GFT_ID */ 1751 + /* GA_NXT, GPN_ID, GNN_ID, GFT_ID, GFPN_ID */ 1768 1752 struct { 1769 1753 uint8_t reserved; 1770 1754 uint8_t port_id[3]; ··· 1839 1823 struct { 1840 1824 uint8_t port_name[8]; 1841 1825 } dpa; 1826 + 1827 + struct { 1828 + uint8_t port_name[8]; 1829 + } gpsc; 1842 1830 } req; 1843 1831 }; 1844 1832 ··· 1906 1886 uint8_t port_name[8]; 1907 1887 struct ct_fdmi_hba_attributes attrs; 1908 1888 } ghat; 1889 + 1890 + struct { 1891 + uint8_t port_name[8]; 1892 + } gfpn_id; 1893 + 1894 + struct { 1895 + uint16_t speeds; 1896 + uint16_t speed; 1897 + } gpsc; 1909 1898 } rsp; 1910 1899 }; 1911 1900 ··· 2211 2182 uint16_t max_public_loop_ids; 2212 2183 uint16_t min_external_loopid; /* First external loop Id */ 2213 2184 2185 + #define PORT_SPEED_UNKNOWN 0xFFFF 2186 + #define PORT_SPEED_1GB 0x00 2187 + #define PORT_SPEED_2GB 0x01 2188 + #define PORT_SPEED_4GB 0x03 2214 2189 uint16_t link_data_rate; /* F/W operating speed */ 2215 - #define LDR_1GB 0 2216 - #define LDR_2GB 1 2217 - #define LDR_4GB 3 2218 - #define LDR_UNKNOWN 0xFFFF 2219 2190 2220 2191 uint8_t current_topology; 2221 2192 uint8_t prev_topology;
+8
drivers/scsi/qla2xxx/qla_gbl.h
··· 208 208 extern int 209 209 qla2x00_read_sfp(scsi_qla_host_t *, dma_addr_t, uint16_t, uint16_t, uint16_t); 210 210 211 + extern int 212 + qla2x00_get_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t *, uint16_t *); 213 + 214 + extern int 215 + qla2x00_set_idma_speed(scsi_qla_host_t *, uint16_t, uint16_t, uint16_t *); 216 + 211 217 /* 212 218 * Global Function Prototypes in qla_isr.c source file. 213 219 */ ··· 285 279 extern void *qla2x00_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t); 286 280 extern void *qla24xx_prep_ms_fdmi_iocb(scsi_qla_host_t *, uint32_t, uint32_t); 287 281 extern int qla2x00_fdmi_register(scsi_qla_host_t *); 282 + extern int qla2x00_gfpn_id(scsi_qla_host_t *, sw_info_t *); 283 + extern int qla2x00_gpsc(scsi_qla_host_t *, sw_info_t *); 288 284 289 285 /* 290 286 * Global Function Prototypes in qla_attr.c source file.
+186 -1
drivers/scsi/qla2xxx/qla_gs.c
··· 687 687 return (rval); 688 688 } 689 689 690 - 691 690 /** 692 691 * qla2x00_prep_sns_cmd() - Prepare common SNS command request fields for query. 693 692 * @ha: HA context ··· 1645 1646 rval = qla2x00_fdmi_rpa(ha); 1646 1647 1647 1648 return rval; 1649 + } 1650 + 1651 + /** 1652 + * qla2x00_gfpn_id() - SNS Get Fabric Port Name (GFPN_ID) query. 1653 + * @ha: HA context 1654 + * @list: switch info entries to populate 1655 + * 1656 + * Returns 0 on success. 1657 + */ 1658 + int 1659 + qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list) 1660 + { 1661 + int rval; 1662 + uint16_t i; 1663 + 1664 + ms_iocb_entry_t *ms_pkt; 1665 + struct ct_sns_req *ct_req; 1666 + struct ct_sns_rsp *ct_rsp; 1667 + 1668 + if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) 1669 + return QLA_FUNCTION_FAILED; 1670 + 1671 + for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 1672 + /* Issue GFPN_ID */ 1673 + memset(list[i].fabric_port_name, 0, WWN_SIZE); 1674 + 1675 + /* Prepare common MS IOCB */ 1676 + ms_pkt = qla2x00_prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, 1677 + GFPN_ID_RSP_SIZE); 1678 + 1679 + /* Prepare CT request */ 1680 + ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GFPN_ID_CMD, 1681 + GFPN_ID_RSP_SIZE); 1682 + ct_rsp = &ha->ct_sns->p.rsp; 1683 + 1684 + /* Prepare CT arguments -- port_id */ 1685 + ct_req->req.port_id.port_id[0] = list[i].d_id.b.domain; 1686 + ct_req->req.port_id.port_id[1] = list[i].d_id.b.area; 1687 + ct_req->req.port_id.port_id[2] = list[i].d_id.b.al_pa; 1688 + 1689 + /* Execute MS IOCB */ 1690 + rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma, 1691 + sizeof(ms_iocb_entry_t)); 1692 + if (rval != QLA_SUCCESS) { 1693 + /*EMPTY*/ 1694 + DEBUG2_3(printk("scsi(%ld): GFPN_ID issue IOCB " 1695 + "failed (%d).\n", ha->host_no, rval)); 1696 + } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, 1697 + "GFPN_ID") != QLA_SUCCESS) { 1698 + rval = QLA_FUNCTION_FAILED; 1699 + } else { 1700 + /* Save fabric portname */ 1701 + memcpy(list[i].fabric_port_name, 1702 + ct_rsp->rsp.gfpn_id.port_name, WWN_SIZE); 1703 + } 1704 + 1705 + /* Last device exit. */ 1706 + if (list[i].d_id.b.rsvd_1 != 0) 1707 + break; 1708 + } 1709 + 1710 + return (rval); 1711 + } 1712 + 1713 + static inline void * 1714 + qla24xx_prep_ms_fm_iocb(scsi_qla_host_t *ha, uint32_t req_size, 1715 + uint32_t rsp_size) 1716 + { 1717 + struct ct_entry_24xx *ct_pkt; 1718 + 1719 + ct_pkt = (struct ct_entry_24xx *)ha->ms_iocb; 1720 + memset(ct_pkt, 0, sizeof(struct ct_entry_24xx)); 1721 + 1722 + ct_pkt->entry_type = CT_IOCB_TYPE; 1723 + ct_pkt->entry_count = 1; 1724 + ct_pkt->nport_handle = cpu_to_le16(ha->mgmt_svr_loop_id); 1725 + ct_pkt->timeout = __constant_cpu_to_le16(59); 1726 + ct_pkt->cmd_dsd_count = __constant_cpu_to_le16(1); 1727 + ct_pkt->rsp_dsd_count = __constant_cpu_to_le16(1); 1728 + ct_pkt->rsp_byte_count = cpu_to_le32(rsp_size); 1729 + ct_pkt->cmd_byte_count = cpu_to_le32(req_size); 1730 + 1731 + ct_pkt->dseg_0_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma)); 1732 + ct_pkt->dseg_0_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma)); 1733 + ct_pkt->dseg_0_len = ct_pkt->cmd_byte_count; 1734 + 1735 + ct_pkt->dseg_1_address[0] = cpu_to_le32(LSD(ha->ct_sns_dma)); 1736 + ct_pkt->dseg_1_address[1] = cpu_to_le32(MSD(ha->ct_sns_dma)); 1737 + ct_pkt->dseg_1_len = ct_pkt->rsp_byte_count; 1738 + 1739 + return ct_pkt; 1740 + } 1741 + 1742 + 1743 + static inline struct ct_sns_req * 1744 + qla24xx_prep_ct_fm_req(struct ct_sns_req *ct_req, uint16_t cmd, 1745 + uint16_t rsp_size) 1746 + { 1747 + memset(ct_req, 0, sizeof(struct ct_sns_pkt)); 1748 + 1749 + ct_req->header.revision = 0x01; 1750 + ct_req->header.gs_type = 0xFA; 1751 + ct_req->header.gs_subtype = 0x01; 1752 + ct_req->command = cpu_to_be16(cmd); 1753 + ct_req->max_rsp_size = cpu_to_be16((rsp_size - 16) / 4); 1754 + 1755 + return ct_req; 1756 + } 1757 + 1758 + /** 1759 + * qla2x00_gpsc() - FCS Get Port Speed Capabilities (GPSC) query. 1760 + * @ha: HA context 1761 + * @list: switch info entries to populate 1762 + * 1763 + * Returns 0 on success. 1764 + */ 1765 + int 1766 + qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) 1767 + { 1768 + int rval; 1769 + uint16_t i; 1770 + 1771 + ms_iocb_entry_t *ms_pkt; 1772 + struct ct_sns_req *ct_req; 1773 + struct ct_sns_rsp *ct_rsp; 1774 + 1775 + if (!IS_QLA24XX(ha) && !IS_QLA54XX(ha)) 1776 + return QLA_FUNCTION_FAILED; 1777 + 1778 + rval = qla2x00_mgmt_svr_login(ha); 1779 + if (rval) 1780 + return rval; 1781 + 1782 + for (i = 0; i < MAX_FIBRE_DEVICES; i++) { 1783 + /* Issue GFPN_ID */ 1784 + list[i].fp_speeds = list[i].fp_speed = 0; 1785 + 1786 + /* Prepare common MS IOCB */ 1787 + ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE, 1788 + GPSC_RSP_SIZE); 1789 + 1790 + /* Prepare CT request */ 1791 + ct_req = qla24xx_prep_ct_fm_req(&ha->ct_sns->p.req, 1792 + GPSC_CMD, GPSC_RSP_SIZE); 1793 + ct_rsp = &ha->ct_sns->p.rsp; 1794 + 1795 + /* Prepare CT arguments -- port_name */ 1796 + memcpy(ct_req->req.gpsc.port_name, list[i].fabric_port_name, 1797 + WWN_SIZE); 1798 + 1799 + /* Execute MS IOCB */ 1800 + rval = qla2x00_issue_iocb(ha, ha->ms_iocb, ha->ms_iocb_dma, 1801 + sizeof(ms_iocb_entry_t)); 1802 + if (rval != QLA_SUCCESS) { 1803 + /*EMPTY*/ 1804 + DEBUG2_3(printk("scsi(%ld): GPSC issue IOCB " 1805 + "failed (%d).\n", ha->host_no, rval)); 1806 + } else if (qla2x00_chk_ms_status(ha, ms_pkt, ct_rsp, 1807 + "GPSC") != QLA_SUCCESS) { 1808 + rval = QLA_FUNCTION_FAILED; 1809 + } else { 1810 + /* Save portname */ 1811 + list[i].fp_speeds = ct_rsp->rsp.gpsc.speeds; 1812 + list[i].fp_speed = ct_rsp->rsp.gpsc.speed; 1813 + 1814 + DEBUG2_3(printk("scsi(%ld): GPSC ext entry - " 1815 + "fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x " 1816 + "speed=%04x.\n", ha->host_no, 1817 + list[i].fabric_port_name[0], 1818 + list[i].fabric_port_name[1], 1819 + list[i].fabric_port_name[2], 1820 + list[i].fabric_port_name[3], 1821 + list[i].fabric_port_name[4], 1822 + list[i].fabric_port_name[5], 1823 + list[i].fabric_port_name[6], 1824 + list[i].fabric_port_name[7], 1825 + be16_to_cpu(list[i].fp_speeds), 1826 + be16_to_cpu(list[i].fp_speed))); 1827 + } 1828 + 1829 + /* Last device exit. */ 1830 + if (list[i].d_id.b.rsvd_1 != 0) 1831 + break; 1832 + } 1833 + 1834 + return (rval); 1648 1835 }
+81
drivers/scsi/qla2xxx/qla_init.c
··· 2074 2074 new_fcport->flags &= ~FCF_FABRIC_DEVICE; 2075 2075 } 2076 2076 2077 + /* Base iIDMA settings on HBA port speed. */ 2078 + switch (ha->link_data_rate) { 2079 + case PORT_SPEED_1GB: 2080 + fcport->fp_speed = cpu_to_be16(BIT_15); 2081 + break; 2082 + case PORT_SPEED_2GB: 2083 + fcport->fp_speed = cpu_to_be16(BIT_14); 2084 + break; 2085 + case PORT_SPEED_4GB: 2086 + fcport->fp_speed = cpu_to_be16(BIT_13); 2087 + break; 2088 + } 2089 + 2077 2090 qla2x00_update_fcport(ha, fcport); 2078 2091 2079 2092 found_devs++; ··· 2122 2109 } 2123 2110 } 2124 2111 2112 + static void 2113 + qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) 2114 + { 2115 + #define LS_UNKNOWN 2 2116 + static char *link_speeds[5] = { "1", "2", "?", "4" }; 2117 + int rval; 2118 + uint16_t port_speed, mb[6]; 2119 + 2120 + if (!IS_QLA24XX(ha)) 2121 + return; 2122 + 2123 + switch (be16_to_cpu(fcport->fp_speed)) { 2124 + case BIT_15: 2125 + port_speed = PORT_SPEED_1GB; 2126 + break; 2127 + case BIT_14: 2128 + port_speed = PORT_SPEED_2GB; 2129 + break; 2130 + case BIT_13: 2131 + port_speed = PORT_SPEED_4GB; 2132 + break; 2133 + default: 2134 + DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- " 2135 + "unsupported FM port operating speed (%04x).\n", 2136 + ha->host_no, fcport->port_name[0], fcport->port_name[1], 2137 + fcport->port_name[2], fcport->port_name[3], 2138 + fcport->port_name[4], fcport->port_name[5], 2139 + fcport->port_name[6], fcport->port_name[7], 2140 + be16_to_cpu(fcport->fp_speed))); 2141 + port_speed = PORT_SPEED_UNKNOWN; 2142 + break; 2143 + } 2144 + if (port_speed == PORT_SPEED_UNKNOWN) 2145 + return; 2146 + 2147 + rval = qla2x00_set_idma_speed(ha, fcport->loop_id, port_speed, mb); 2148 + if (rval != QLA_SUCCESS) { 2149 + DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA " 2150 + "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", 2151 + ha->host_no, fcport->port_name[0], fcport->port_name[1], 2152 + fcport->port_name[2], fcport->port_name[3], 2153 + fcport->port_name[4], fcport->port_name[5], 2154 + fcport->port_name[6], fcport->port_name[7], rval, 2155 + port_speed, mb[0], mb[1])); 2156 + } else { 2157 + DEBUG2(qla_printk(KERN_INFO, ha, 2158 + "iIDMA adjusted to %s GB/s on " 2159 + "%02x%02x%02x%02x%02x%02x%02x%02x.\n", 2160 + link_speeds[port_speed], fcport->port_name[0], 2161 + fcport->port_name[1], fcport->port_name[2], 2162 + fcport->port_name[3], fcport->port_name[4], 2163 + fcport->port_name[5], fcport->port_name[6], 2164 + fcport->port_name[7])); 2165 + } 2166 + } 2167 + 2125 2168 /* 2126 2169 * qla2x00_update_fcport 2127 2170 * Updates device on list. ··· 2203 2134 atomic_set(&fcport->port_down_timer, ha->port_down_retry_count * 2204 2135 PORT_RETRY_TIME); 2205 2136 fcport->flags &= ~FCF_LOGIN_NEEDED; 2137 + 2138 + qla2x00_iidma_fcport(ha, fcport); 2206 2139 2207 2140 atomic_set(&fcport->state, FCS_ONLINE); 2208 2141 ··· 2487 2416 } else if (qla2x00_gnn_id(ha, swl) != QLA_SUCCESS) { 2488 2417 kfree(swl); 2489 2418 swl = NULL; 2419 + } else if (qla2x00_gfpn_id(ha, swl) == QLA_SUCCESS) { 2420 + qla2x00_gpsc(ha, swl); 2490 2421 } 2491 2422 } 2492 2423 swl_idx = 0; ··· 2523 2450 swl[swl_idx].node_name, WWN_SIZE); 2524 2451 memcpy(new_fcport->port_name, 2525 2452 swl[swl_idx].port_name, WWN_SIZE); 2453 + memcpy(new_fcport->fabric_port_name, 2454 + swl[swl_idx].fabric_port_name, WWN_SIZE); 2455 + new_fcport->fp_speed = swl[swl_idx].fp_speed; 2526 2456 2527 2457 if (swl[swl_idx].d_id.b.rsvd_1 != 0) { 2528 2458 last_dev = 1; ··· 2582 2506 continue; 2583 2507 2584 2508 found++; 2509 + 2510 + /* Update port state. */ 2511 + memcpy(fcport->fabric_port_name, 2512 + new_fcport->fabric_port_name, WWN_SIZE); 2513 + fcport->fp_speed = new_fcport->fp_speed; 2585 2514 2586 2515 /* 2587 2516 * If address the same and state FCS_ONLINE, nothing
+2 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 400 400 case MBA_LOOP_UP: /* Loop Up Event */ 401 401 if (IS_QLA2100(ha) || IS_QLA2200(ha)) { 402 402 link_speed = link_speeds[0]; 403 - ha->link_data_rate = LDR_1GB; 403 + ha->link_data_rate = PORT_SPEED_1GB; 404 404 } else { 405 405 link_speed = link_speeds[LS_UNKNOWN]; 406 406 if (mb[1] < 5) ··· 429 429 } 430 430 431 431 ha->flags.management_server_logged_in = 0; 432 - ha->link_data_rate = LDR_UNKNOWN; 432 + ha->link_data_rate = PORT_SPEED_UNKNOWN; 433 433 if (ql2xfdmienable) 434 434 set_bit(REGISTER_FDMI_NEEDED, &ha->dpc_flags); 435 435 break;
+86
drivers/scsi/qla2xxx/qla_mbx.c
··· 2540 2540 2541 2541 return rval; 2542 2542 } 2543 + 2544 + int 2545 + qla2x00_get_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id, 2546 + uint16_t *port_speed, uint16_t *mb) 2547 + { 2548 + int rval; 2549 + mbx_cmd_t mc; 2550 + mbx_cmd_t *mcp = &mc; 2551 + 2552 + if (!IS_QLA24XX(ha)) 2553 + return QLA_FUNCTION_FAILED; 2554 + 2555 + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 2556 + 2557 + mcp->mb[0] = MBC_PORT_PARAMS; 2558 + mcp->mb[1] = loop_id; 2559 + mcp->mb[2] = mcp->mb[3] = mcp->mb[4] = mcp->mb[5] = 0; 2560 + mcp->out_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; 2561 + mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_1|MBX_0; 2562 + mcp->tov = 30; 2563 + mcp->flags = 0; 2564 + rval = qla2x00_mailbox_command(ha, mcp); 2565 + 2566 + /* Return mailbox statuses. */ 2567 + if (mb != NULL) { 2568 + mb[0] = mcp->mb[0]; 2569 + mb[1] = mcp->mb[1]; 2570 + mb[3] = mcp->mb[3]; 2571 + mb[4] = mcp->mb[4]; 2572 + mb[5] = mcp->mb[5]; 2573 + } 2574 + 2575 + if (rval != QLA_SUCCESS) { 2576 + DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__, 2577 + ha->host_no, rval)); 2578 + } else { 2579 + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); 2580 + if (port_speed) 2581 + *port_speed = mcp->mb[3]; 2582 + } 2583 + 2584 + return rval; 2585 + } 2586 + 2587 + int 2588 + qla2x00_set_idma_speed(scsi_qla_host_t *ha, uint16_t loop_id, 2589 + uint16_t port_speed, uint16_t *mb) 2590 + { 2591 + int rval; 2592 + mbx_cmd_t mc; 2593 + mbx_cmd_t *mcp = &mc; 2594 + 2595 + if (!IS_QLA24XX(ha)) 2596 + return QLA_FUNCTION_FAILED; 2597 + 2598 + DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no)); 2599 + 2600 + mcp->mb[0] = MBC_PORT_PARAMS; 2601 + mcp->mb[1] = loop_id; 2602 + mcp->mb[2] = BIT_0; 2603 + mcp->mb[3] = port_speed & (BIT_2|BIT_1|BIT_0); 2604 + mcp->mb[4] = mcp->mb[5] = 0; 2605 + mcp->out_mb = MBX_5|MBX_4|MBX_3|MBX_2|MBX_1|MBX_0; 2606 + mcp->in_mb = MBX_5|MBX_4|MBX_3|MBX_1|MBX_0; 2607 + mcp->tov = 30; 2608 + mcp->flags = 0; 2609 + rval = qla2x00_mailbox_command(ha, mcp); 2610 + 2611 + /* Return mailbox statuses. */ 2612 + if (mb != NULL) { 2613 + mb[0] = mcp->mb[0]; 2614 + mb[1] = mcp->mb[1]; 2615 + mb[3] = mcp->mb[3]; 2616 + mb[4] = mcp->mb[4]; 2617 + mb[5] = mcp->mb[5]; 2618 + } 2619 + 2620 + if (rval != QLA_SUCCESS) { 2621 + DEBUG2_3_11(printk("%s(%ld): failed=%x.\n", __func__, 2622 + ha->host_no, rval)); 2623 + } else { 2624 + DEBUG11(printk("%s(%ld): done.\n", __func__, ha->host_no)); 2625 + } 2626 + 2627 + return rval; 2628 + }
+1 -1
drivers/scsi/qla2xxx/qla_os.c
··· 1385 1385 ha->prev_topology = 0; 1386 1386 ha->init_cb_size = sizeof(init_cb_t); 1387 1387 ha->mgmt_svr_loop_id = MANAGEMENT_SERVER; 1388 - ha->link_data_rate = LDR_UNKNOWN; 1388 + ha->link_data_rate = PORT_SPEED_UNKNOWN; 1389 1389 ha->optrom_size = OPTROM_SIZE_2300; 1390 1390 1391 1391 /* Assign ISP specific operations. */