aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c45
1 files changed, 11 insertions, 34 deletions
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
2130qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) 2120qla2x00_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],