diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 84 |
1 files changed, 83 insertions, 1 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 859649160caa..d5d26273c04e 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -2074,6 +2074,19 @@ qla2x00_configure_local_loop(scsi_qla_host_t *ha) | |||
2074 | new_fcport->flags &= ~FCF_FABRIC_DEVICE; | 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 | qla2x00_update_fcport(ha, fcport); | 2090 | qla2x00_update_fcport(ha, fcport); |
2078 | 2091 | ||
2079 | found_devs++; | 2092 | found_devs++; |
@@ -2109,6 +2122,62 @@ qla2x00_probe_for_all_luns(scsi_qla_host_t *ha) | |||
2109 | } | 2122 | } |
2110 | } | 2123 | } |
2111 | 2124 | ||
2125 | static void | ||
2126 | qla2x00_iidma_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | ||
2127 | { | ||
2128 | #define LS_UNKNOWN 2 | ||
2129 | static char *link_speeds[5] = { "1", "2", "?", "4" }; | ||
2130 | int rval; | ||
2131 | uint16_t port_speed, mb[6]; | ||
2132 | |||
2133 | if (!IS_QLA24XX(ha)) | ||
2134 | return; | ||
2135 | |||
2136 | switch (be16_to_cpu(fcport->fp_speed)) { | ||
2137 | case BIT_15: | ||
2138 | port_speed = PORT_SPEED_1GB; | ||
2139 | break; | ||
2140 | case BIT_14: | ||
2141 | port_speed = PORT_SPEED_2GB; | ||
2142 | break; | ||
2143 | case BIT_13: | ||
2144 | port_speed = PORT_SPEED_4GB; | ||
2145 | break; | ||
2146 | default: | ||
2147 | DEBUG2(printk("scsi(%ld): %02x%02x%02x%02x%02x%02x%02x%02x -- " | ||
2148 | "unsupported FM port operating speed (%04x).\n", | ||
2149 | ha->host_no, fcport->port_name[0], fcport->port_name[1], | ||
2150 | fcport->port_name[2], fcport->port_name[3], | ||
2151 | fcport->port_name[4], fcport->port_name[5], | ||
2152 | fcport->port_name[6], fcport->port_name[7], | ||
2153 | be16_to_cpu(fcport->fp_speed))); | ||
2154 | port_speed = PORT_SPEED_UNKNOWN; | ||
2155 | break; | ||
2156 | } | ||
2157 | if (port_speed == PORT_SPEED_UNKNOWN) | ||
2158 | return; | ||
2159 | |||
2160 | rval = qla2x00_set_idma_speed(ha, fcport->loop_id, port_speed, mb); | ||
2161 | if (rval != QLA_SUCCESS) { | ||
2162 | DEBUG2(printk("scsi(%ld): Unable to adjust iIDMA " | ||
2163 | "%02x%02x%02x%02x%02x%02x%02x%02x -- %04x %x %04x %04x.\n", | ||
2164 | ha->host_no, fcport->port_name[0], fcport->port_name[1], | ||
2165 | fcport->port_name[2], fcport->port_name[3], | ||
2166 | fcport->port_name[4], fcport->port_name[5], | ||
2167 | fcport->port_name[6], fcport->port_name[7], rval, | ||
2168 | port_speed, mb[0], mb[1])); | ||
2169 | } else { | ||
2170 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
2171 | "iIDMA adjusted to %s GB/s on " | ||
2172 | "%02x%02x%02x%02x%02x%02x%02x%02x.\n", | ||
2173 | link_speeds[port_speed], fcport->port_name[0], | ||
2174 | fcport->port_name[1], fcport->port_name[2], | ||
2175 | fcport->port_name[3], fcport->port_name[4], | ||
2176 | fcport->port_name[5], fcport->port_name[6], | ||
2177 | fcport->port_name[7])); | ||
2178 | } | ||
2179 | } | ||
2180 | |||
2112 | /* | 2181 | /* |
2113 | * qla2x00_update_fcport | 2182 | * qla2x00_update_fcport |
2114 | * Updates device on list. | 2183 | * Updates device on list. |
@@ -2135,6 +2204,8 @@ qla2x00_update_fcport(scsi_qla_host_t *ha, fc_port_t *fcport) | |||
2135 | PORT_RETRY_TIME); | 2204 | PORT_RETRY_TIME); |
2136 | fcport->flags &= ~FCF_LOGIN_NEEDED; | 2205 | fcport->flags &= ~FCF_LOGIN_NEEDED; |
2137 | 2206 | ||
2207 | qla2x00_iidma_fcport(ha, fcport); | ||
2208 | |||
2138 | atomic_set(&fcport->state, FCS_ONLINE); | 2209 | atomic_set(&fcport->state, FCS_ONLINE); |
2139 | 2210 | ||
2140 | if (ha->flags.init_done) | 2211 | if (ha->flags.init_done) |
@@ -2209,7 +2280,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha) | |||
2209 | loop_id = NPH_F_PORT; | 2280 | loop_id = NPH_F_PORT; |
2210 | else | 2281 | else |
2211 | loop_id = SNS_FL_PORT; | 2282 | loop_id = SNS_FL_PORT; |
2212 | rval = qla2x00_get_port_name(ha, loop_id, NULL, 0); | 2283 | rval = qla2x00_get_port_name(ha, loop_id, ha->fabric_node_name, 1); |
2213 | if (rval != QLA_SUCCESS) { | 2284 | if (rval != QLA_SUCCESS) { |
2214 | DEBUG2(printk("scsi(%ld): MBC_GET_PORT_NAME Failed, No FL " | 2285 | DEBUG2(printk("scsi(%ld): MBC_GET_PORT_NAME Failed, No FL " |
2215 | "Port\n", ha->host_no)); | 2286 | "Port\n", ha->host_no)); |
@@ -2217,6 +2288,7 @@ qla2x00_configure_fabric(scsi_qla_host_t *ha) | |||
2217 | ha->device_flags &= ~SWITCH_FOUND; | 2288 | ha->device_flags &= ~SWITCH_FOUND; |
2218 | return (QLA_SUCCESS); | 2289 | return (QLA_SUCCESS); |
2219 | } | 2290 | } |
2291 | ha->device_flags |= SWITCH_FOUND; | ||
2220 | 2292 | ||
2221 | /* Mark devices that need re-synchronization. */ | 2293 | /* Mark devices that need re-synchronization. */ |
2222 | rval2 = qla2x00_device_resync(ha); | 2294 | rval2 = qla2x00_device_resync(ha); |
@@ -2416,6 +2488,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) | |||
2416 | } else if (qla2x00_gnn_id(ha, swl) != QLA_SUCCESS) { | 2488 | } else if (qla2x00_gnn_id(ha, swl) != QLA_SUCCESS) { |
2417 | kfree(swl); | 2489 | kfree(swl); |
2418 | swl = NULL; | 2490 | swl = NULL; |
2491 | } else if (qla2x00_gfpn_id(ha, swl) == QLA_SUCCESS) { | ||
2492 | qla2x00_gpsc(ha, swl); | ||
2419 | } | 2493 | } |
2420 | } | 2494 | } |
2421 | swl_idx = 0; | 2495 | swl_idx = 0; |
@@ -2450,6 +2524,9 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) | |||
2450 | swl[swl_idx].node_name, WWN_SIZE); | 2524 | swl[swl_idx].node_name, WWN_SIZE); |
2451 | memcpy(new_fcport->port_name, | 2525 | memcpy(new_fcport->port_name, |
2452 | swl[swl_idx].port_name, WWN_SIZE); | 2526 | swl[swl_idx].port_name, WWN_SIZE); |
2527 | memcpy(new_fcport->fabric_port_name, | ||
2528 | swl[swl_idx].fabric_port_name, WWN_SIZE); | ||
2529 | new_fcport->fp_speed = swl[swl_idx].fp_speed; | ||
2453 | 2530 | ||
2454 | if (swl[swl_idx].d_id.b.rsvd_1 != 0) { | 2531 | if (swl[swl_idx].d_id.b.rsvd_1 != 0) { |
2455 | last_dev = 1; | 2532 | last_dev = 1; |
@@ -2507,6 +2584,11 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports) | |||
2507 | 2584 | ||
2508 | found++; | 2585 | found++; |
2509 | 2586 | ||
2587 | /* Update port state. */ | ||
2588 | memcpy(fcport->fabric_port_name, | ||
2589 | new_fcport->fabric_port_name, WWN_SIZE); | ||
2590 | fcport->fp_speed = new_fcport->fp_speed; | ||
2591 | |||
2510 | /* | 2592 | /* |
2511 | * If address the same and state FCS_ONLINE, nothing | 2593 | * If address the same and state FCS_ONLINE, nothing |
2512 | * changed. | 2594 | * changed. |