diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2007-08-13 13:13:18 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.localdomain> | 2007-08-15 14:03:20 -0400 |
commit | a3cbdfad15dee42eb2d17d28fd36447082278dc9 (patch) | |
tree | 04c34158a6549adadd11a07bc1ca3087605830d5 /drivers/scsi | |
parent | 02d638b4b72af9ee617831066d6245c882da1ee0 (diff) |
[SCSI] qla2xxx: Correct 8GB iIDMA support.
Original implementation manipulated the FC_GS values for
port-speed. Transition the codes to use the driver's own
internal representations as this makes for a reduction in
duplicate 'conversion' codes throughout the driver.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gs.c | 28 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 45 |
3 files changed, 30 insertions, 44 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 27ae3a532a55..c1964866a423 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -1502,7 +1502,6 @@ typedef struct { | |||
1502 | uint8_t node_name[WWN_SIZE]; | 1502 | uint8_t node_name[WWN_SIZE]; |
1503 | uint8_t port_name[WWN_SIZE]; | 1503 | uint8_t port_name[WWN_SIZE]; |
1504 | uint8_t fabric_port_name[WWN_SIZE]; | 1504 | uint8_t fabric_port_name[WWN_SIZE]; |
1505 | uint16_t fp_speeds; | ||
1506 | uint16_t fp_speed; | 1505 | uint16_t fp_speed; |
1507 | } sw_info_t; | 1506 | } sw_info_t; |
1508 | 1507 | ||
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c index b06cbb8580d3..a7e23583f899 100644 --- a/drivers/scsi/qla2xxx/qla_gs.c +++ b/drivers/scsi/qla2xxx/qla_gs.c | |||
@@ -295,6 +295,8 @@ qla2x00_gid_pt(scsi_qla_host_t *ha, sw_info_t *list) | |||
295 | list[i].d_id.b.domain = gid_data->port_id[0]; | 295 | list[i].d_id.b.domain = gid_data->port_id[0]; |
296 | list[i].d_id.b.area = gid_data->port_id[1]; | 296 | list[i].d_id.b.area = gid_data->port_id[1]; |
297 | list[i].d_id.b.al_pa = gid_data->port_id[2]; | 297 | list[i].d_id.b.al_pa = gid_data->port_id[2]; |
298 | memset(list[i].fabric_port_name, 0, WWN_SIZE); | ||
299 | list[i].fp_speed = PORT_SPEED_UNKNOWN; | ||
298 | 300 | ||
299 | /* Last one exit. */ | 301 | /* Last one exit. */ |
300 | if (gid_data->control_byte & BIT_7) { | 302 | if (gid_data->control_byte & BIT_7) { |
@@ -1707,8 +1709,6 @@ qla2x00_gfpn_id(scsi_qla_host_t *ha, sw_info_t *list) | |||
1707 | 1709 | ||
1708 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { | 1710 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { |
1709 | /* Issue GFPN_ID */ | 1711 | /* Issue GFPN_ID */ |
1710 | memset(list[i].fabric_port_name, 0, WWN_SIZE); | ||
1711 | |||
1712 | /* Prepare common MS IOCB */ | 1712 | /* Prepare common MS IOCB */ |
1713 | ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, | 1713 | ms_pkt = ha->isp_ops->prep_ms_iocb(ha, GFPN_ID_REQ_SIZE, |
1714 | GFPN_ID_RSP_SIZE); | 1714 | GFPN_ID_RSP_SIZE); |
@@ -1821,8 +1821,6 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) | |||
1821 | 1821 | ||
1822 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { | 1822 | for (i = 0; i < MAX_FIBRE_DEVICES; i++) { |
1823 | /* Issue GFPN_ID */ | 1823 | /* Issue GFPN_ID */ |
1824 | list[i].fp_speeds = list[i].fp_speed = 0; | ||
1825 | |||
1826 | /* Prepare common MS IOCB */ | 1824 | /* Prepare common MS IOCB */ |
1827 | ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE, | 1825 | ms_pkt = qla24xx_prep_ms_fm_iocb(ha, GPSC_REQ_SIZE, |
1828 | GPSC_RSP_SIZE); | 1826 | GPSC_RSP_SIZE); |
@@ -1858,9 +1856,21 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) | |||
1858 | } | 1856 | } |
1859 | rval = QLA_FUNCTION_FAILED; | 1857 | rval = QLA_FUNCTION_FAILED; |
1860 | } else { | 1858 | } else { |
1861 | /* Save portname */ | 1859 | /* Save port-speed */ |
1862 | list[i].fp_speeds = ct_rsp->rsp.gpsc.speeds; | 1860 | switch (be16_to_cpu(ct_rsp->rsp.gpsc.speed)) { |
1863 | list[i].fp_speed = ct_rsp->rsp.gpsc.speed; | 1861 | case BIT_15: |
1862 | list[i].fp_speed = PORT_SPEED_1GB; | ||
1863 | break; | ||
1864 | case BIT_14: | ||
1865 | list[i].fp_speed = PORT_SPEED_2GB; | ||
1866 | break; | ||
1867 | case BIT_13: | ||
1868 | list[i].fp_speed = PORT_SPEED_4GB; | ||
1869 | break; | ||
1870 | case BIT_11: | ||
1871 | list[i].fp_speed = PORT_SPEED_8GB; | ||
1872 | break; | ||
1873 | } | ||
1864 | 1874 | ||
1865 | DEBUG2_3(printk("scsi(%ld): GPSC ext entry - " | 1875 | DEBUG2_3(printk("scsi(%ld): GPSC ext entry - " |
1866 | "fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x " | 1876 | "fpn %02x%02x%02x%02x%02x%02x%02x%02x speeds=%04x " |
@@ -1873,8 +1883,8 @@ qla2x00_gpsc(scsi_qla_host_t *ha, sw_info_t *list) | |||
1873 | list[i].fabric_port_name[5], | 1883 | list[i].fabric_port_name[5], |
1874 | list[i].fabric_port_name[6], | 1884 | list[i].fabric_port_name[6], |
1875 | list[i].fabric_port_name[7], | 1885 | list[i].fabric_port_name[7], |
1876 | be16_to_cpu(list[i].fp_speeds), | 1886 | be16_to_cpu(ct_rsp->rsp.gpsc.speeds), |
1877 | be16_to_cpu(list[i].fp_speed))); | 1887 | be16_to_cpu(ct_rsp->rsp.gpsc.speed))); |
1878 | } | 1888 | } |
1879 | 1889 | ||
1880 | /* Last device exit. */ | 1890 | /* Last device exit. */ |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 8da0586e9dfd..1a058ec9bd0c 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -2079,17 +2079,7 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha) | |||
2079 | } | 2079 | } |
2080 | 2080 | ||
2081 | /* Base iIDMA settings on HBA port speed. */ | 2081 | /* Base iIDMA settings on HBA port speed. */ |
2082 | switch (ha->link_data_rate) { | 2082 | fcport->fp_speed = ha->link_data_rate; |
2083 | case PORT_SPEED_1GB: | ||
2084 | fcport->fp_speed = cpu_to_be16(BIT_15); | ||
2085 | break; | ||
2086 | case PORT_SPEED_2GB: | ||
2087 | fcport->fp_speed = cpu_to_be16(BIT_14); | ||
2088 | break; | ||
2089 | case PORT_SPEED_4GB: | ||
2090 | fcport->fp_speed = cpu_to_be16(BIT_13); | ||
2091 | break; | ||
2092 | } | ||
2093 | 2083 | ||
2094 | qla2x00_update_fcport(ha, fcport); | 2084 | qla2x00_update_fcport(ha, fcport); |
2095 | 2085 | ||
@@ -2130,38 +2120,25 @@ static void | |||
2130 | qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | 2120 | qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) |
2131 | { | 2121 | { |
2132 | #define LS_UNKNOWN 2 | 2122 | #define LS_UNKNOWN 2 |
2133 | static char *link_speeds[5] = { "1", "2", "?", "4" }; | 2123 | static char *link_speeds[5] = { "1", "2", "?", "4", "8" }; |
2134 | int rval; | 2124 | int rval; |
2135 | uint16_t port_speed, mb[6]; | 2125 | uint16_t mb[6]; |
2136 | 2126 | ||
2137 | if (!IS_IIDMA_CAPABLE(ha)) | 2127 | if (!IS_IIDMA_CAPABLE(ha)) |
2138 | return; | 2128 | return; |
2139 | 2129 | ||
2140 | switch (be16_to_cpu(fcport->fp_speed)) { | 2130 | if (fcport->fp_speed == PORT_SPEED_UNKNOWN) { |
2141 | case BIT_15: | ||
2142 | port_speed = PORT_SPEED_1GB; | ||
2143 | break; | ||
2144 | case BIT_14: | ||
2145 | port_speed = PORT_SPEED_2GB; | ||
2146 | break; | ||
2147 | case BIT_13: | ||
2148 | port_speed = PORT_SPEED_4GB; | ||
2149 | break; | ||
2150 | default: | ||
2151 | DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- " | 2131 | DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- " |
2152 | "unsupported FM port operating speed (%04x).\n", | 2132 | "unsupported FM port operating speed.\n", |
2153 | ha->host_no, fcport->port_name[0], fcport->port_name[1], | 2133 | ha->host_no, fcport->port_name[0], fcport->port_name[1], |
2154 | fcport->port_name[2], fcport->port_name[3], | 2134 | fcport->port_name[2], fcport->port_name[3], |
2155 | fcport->port_name[4], fcport->port_name[5], | 2135 | fcport->port_name[4], fcport->port_name[5], |
2156 | fcport->port_name[6], fcport->port_name[7], | 2136 | fcport->port_name[6], fcport->port_name[7])); |
2157 | be16_to_cpu(fcport->fp_speed))); | ||
2158 | port_speed = PORT_SPEED_UNKNOWN; | ||
2159 | break; | ||
2160 | } | ||
2161 | if (port_speed == PORT_SPEED_UNKNOWN) | ||
2162 | return; | 2137 | return; |
2138 | } | ||
2163 | 2139 | ||
2164 | rval = qla2x00_set_idma_speed(ha, fcport->loop_id, port_speed, mb); | 2140 | rval = qla2x00_set_idma_speed(ha, fcport->loop_id, fcport->fp_speed, |
2141 | mb); | ||
2165 | if (rval != QLA_SUCCESS) { | 2142 | if (rval != QLA_SUCCESS) { |
2166 | DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA " | 2143 | DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA " |
2167 | "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", | 2144 | "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", |
@@ -2169,12 +2146,12 @@ qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2169 | fcport->port_name[2], fcport->port_name[3], | 2146 | fcport->port_name[2], fcport->port_name[3], |
2170 | fcport->port_name[4], fcport->port_name[5], | 2147 | fcport->port_name[4], fcport->port_name[5], |
2171 | fcport->port_name[6], fcport->port_name[7], rval, | 2148 | fcport->port_name[6], fcport->port_name[7], rval, |
2172 | port_speed, mb[0], mb[1])); | 2149 | fcport->fp_speed, mb[0], mb[1])); |
2173 | } else { | 2150 | } else { |
2174 | DEBUG2(qla_printk(KERN_INFO, ha, | 2151 | DEBUG2(qla_printk(KERN_INFO, ha, |
2175 | "iIDMA adjusted to %s GB/s on " | 2152 | "iIDMA adjusted to %s GB/s on " |
2176 | "%02x%02x%02x%02x%02x%02x%02x%02x.\n", | 2153 | "%02x%02x%02x%02x%02x%02x%02x%02x.\n", |
2177 | link_speeds[port_speed], fcport->port_name[0], | 2154 | link_speeds[fcport->fp_speed], fcport->port_name[0], |
2178 | fcport->port_name[1], fcport->port_name[2], | 2155 | fcport->port_name[1], fcport->port_name[2], |
2179 | fcport->port_name[3], fcport->port_name[4], | 2156 | fcport->port_name[3], fcport->port_name[4], |
2180 | fcport->port_name[5], fcport->port_name[6], | 2157 | fcport->port_name[5], fcport->port_name[6], |