aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_gs.c
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2007-08-13 13:13:18 -0400
committerJames Bottomley <jejb@mulgrave.localdomain>2007-08-15 14:03:20 -0400
commita3cbdfad15dee42eb2d17d28fd36447082278dc9 (patch)
tree04c34158a6549adadd11a07bc1ca3087605830d5 /drivers/scsi/qla2xxx/qla_gs.c
parent02d638b4b72af9ee617831066d6245c882da1ee0 (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/qla2xxx/qla_gs.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_gs.c28
1 files changed, 19 insertions, 9 deletions
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. */