| .. | .. |
|---|
| 228 | 228 | /** |
|---|
| 229 | 229 | * bnx2i_bind_conn_to_iscsi_cid - bind conn structure to 'iscsi_cid' |
|---|
| 230 | 230 | * @hba: pointer to adapter instance |
|---|
| 231 | | - * @conn: pointer to iscsi connection |
|---|
| 231 | + * @bnx2i_conn: pointer to iscsi connection |
|---|
| 232 | 232 | * @iscsi_cid: iscsi context ID, range 0 - (MAX_CONN - 1) |
|---|
| 233 | 233 | * |
|---|
| 234 | 234 | * update iscsi cid table entry with connection pointer. This enables |
|---|
| .. | .. |
|---|
| 463 | 463 | * bnx2i_destroy_cmd_pool - destroys iscsi command pool and release BD table |
|---|
| 464 | 464 | * @hba: adapter instance pointer |
|---|
| 465 | 465 | * @session: iscsi session pointer |
|---|
| 466 | | - * @cmd: iscsi command structure |
|---|
| 467 | 466 | */ |
|---|
| 468 | 467 | static void bnx2i_destroy_cmd_pool(struct bnx2i_hba *hba, |
|---|
| 469 | 468 | struct iscsi_session *session) |
|---|
| .. | .. |
|---|
| 577 | 576 | hba->dummy_buffer, hba->dummy_buf_dma); |
|---|
| 578 | 577 | hba->dummy_buffer = NULL; |
|---|
| 579 | 578 | } |
|---|
| 580 | | - return; |
|---|
| 579 | + return; |
|---|
| 581 | 580 | } |
|---|
| 582 | 581 | |
|---|
| 583 | 582 | /** |
|---|
| 584 | 583 | * bnx2i_drop_session - notifies iscsid of connection error. |
|---|
| 585 | | - * @hba: adapter instance pointer |
|---|
| 586 | | - * @session: iscsi session pointer |
|---|
| 584 | + * @cls_session: iscsi cls session pointer |
|---|
| 587 | 585 | * |
|---|
| 588 | 586 | * This notifies iscsid that there is a error, so it can initiate |
|---|
| 589 | 587 | * recovery. |
|---|
| .. | .. |
|---|
| 1277 | 1275 | |
|---|
| 1278 | 1276 | /** |
|---|
| 1279 | 1277 | * bnx2i_session_create - create a new iscsi session |
|---|
| 1280 | | - * @cmds_max: max commands supported |
|---|
| 1278 | + * @ep: pointer to iscsi endpoint |
|---|
| 1279 | + * @cmds_max: user specified maximum commands |
|---|
| 1281 | 1280 | * @qdepth: scsi queue depth to support |
|---|
| 1282 | 1281 | * @initial_cmdsn: initial iscsi CMDSN to be used for this session |
|---|
| 1283 | 1282 | * |
|---|
| .. | .. |
|---|
| 1423 | 1422 | * Forcefully terminate all in progress connection recovery at the |
|---|
| 1424 | 1423 | * earliest, either in bind(), send_pdu(LOGIN), or conn_start() |
|---|
| 1425 | 1424 | */ |
|---|
| 1426 | | - if (bnx2i_adapter_ready(hba)) |
|---|
| 1427 | | - return -EIO; |
|---|
| 1425 | + if (bnx2i_adapter_ready(hba)) { |
|---|
| 1426 | + ret_code = -EIO; |
|---|
| 1427 | + goto put_ep; |
|---|
| 1428 | + } |
|---|
| 1428 | 1429 | |
|---|
| 1429 | 1430 | bnx2i_ep = ep->dd_data; |
|---|
| 1430 | 1431 | if ((bnx2i_ep->state == EP_STATE_TCP_FIN_RCVD) || |
|---|
| 1431 | | - (bnx2i_ep->state == EP_STATE_TCP_RST_RCVD)) |
|---|
| 1432 | + (bnx2i_ep->state == EP_STATE_TCP_RST_RCVD)) { |
|---|
| 1432 | 1433 | /* Peer disconnect via' FIN or RST */ |
|---|
| 1433 | | - return -EINVAL; |
|---|
| 1434 | + ret_code = -EINVAL; |
|---|
| 1435 | + goto put_ep; |
|---|
| 1436 | + } |
|---|
| 1434 | 1437 | |
|---|
| 1435 | | - if (iscsi_conn_bind(cls_session, cls_conn, is_leading)) |
|---|
| 1436 | | - return -EINVAL; |
|---|
| 1438 | + if (iscsi_conn_bind(cls_session, cls_conn, is_leading)) { |
|---|
| 1439 | + ret_code = -EINVAL; |
|---|
| 1440 | + goto put_ep; |
|---|
| 1441 | + } |
|---|
| 1437 | 1442 | |
|---|
| 1438 | 1443 | if (bnx2i_ep->hba != hba) { |
|---|
| 1439 | 1444 | /* Error - TCP connection does not belong to this device |
|---|
| .. | .. |
|---|
| 1444 | 1449 | iscsi_conn_printk(KERN_ALERT, cls_conn->dd_data, |
|---|
| 1445 | 1450 | "belong to hba (%s)\n", |
|---|
| 1446 | 1451 | hba->netdev->name); |
|---|
| 1447 | | - return -EEXIST; |
|---|
| 1452 | + ret_code = -EEXIST; |
|---|
| 1453 | + goto put_ep; |
|---|
| 1448 | 1454 | } |
|---|
| 1449 | 1455 | bnx2i_ep->conn = bnx2i_conn; |
|---|
| 1450 | 1456 | bnx2i_conn->ep = bnx2i_ep; |
|---|
| .. | .. |
|---|
| 1461 | 1467 | bnx2i_put_rq_buf(bnx2i_conn, 0); |
|---|
| 1462 | 1468 | |
|---|
| 1463 | 1469 | bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE); |
|---|
| 1470 | +put_ep: |
|---|
| 1471 | + iscsi_put_endpoint(ep); |
|---|
| 1464 | 1472 | return ret_code; |
|---|
| 1465 | 1473 | } |
|---|
| 1466 | 1474 | |
|---|
| .. | .. |
|---|
| 1971 | 1979 | |
|---|
| 1972 | 1980 | /** |
|---|
| 1973 | 1981 | * bnx2i_ep_tcp_conn_active - check EP state transition |
|---|
| 1974 | | - * @ep: endpoint pointer |
|---|
| 1982 | + * @bnx2i_ep: endpoint pointer |
|---|
| 1975 | 1983 | * |
|---|
| 1976 | 1984 | * check if underlying TCP connection is active |
|---|
| 1977 | 1985 | */ |
|---|
| .. | .. |
|---|
| 2014 | 2022 | } |
|---|
| 2015 | 2023 | |
|---|
| 2016 | 2024 | |
|---|
| 2017 | | -/* |
|---|
| 2025 | +/** |
|---|
| 2018 | 2026 | * bnx2i_hw_ep_disconnect - executes TCP connection teardown process in the hw |
|---|
| 2019 | | - * @ep: TCP connection (bnx2i endpoint) handle |
|---|
| 2027 | + * @bnx2i_ep: TCP connection (bnx2i endpoint) handle |
|---|
| 2020 | 2028 | * |
|---|
| 2021 | 2029 | * executes TCP connection teardown process |
|---|
| 2022 | 2030 | */ |
|---|
| .. | .. |
|---|
| 2171 | 2179 | |
|---|
| 2172 | 2180 | /** |
|---|
| 2173 | 2181 | * bnx2i_nl_set_path - ISCSI_UEVENT_PATH_UPDATE user message handler |
|---|
| 2174 | | - * @buf: pointer to buffer containing iscsi path message |
|---|
| 2175 | | - * |
|---|
| 2182 | + * @shost: scsi host pointer |
|---|
| 2183 | + * @params: pointer to buffer containing iscsi path message |
|---|
| 2176 | 2184 | */ |
|---|
| 2177 | 2185 | static int bnx2i_nl_set_path(struct Scsi_Host *shost, struct iscsi_path *params) |
|---|
| 2178 | 2186 | { |
|---|
| .. | .. |
|---|
| 2263 | 2271 | .max_sectors = 127, |
|---|
| 2264 | 2272 | .cmd_per_lun = 128, |
|---|
| 2265 | 2273 | .this_id = -1, |
|---|
| 2266 | | - .use_clustering = ENABLE_CLUSTERING, |
|---|
| 2267 | 2274 | .sg_tablesize = ISCSI_MAX_BDS_PER_CMD, |
|---|
| 2268 | 2275 | .shost_attrs = bnx2i_dev_attributes, |
|---|
| 2269 | 2276 | .track_queue_depth = 1, |
|---|
| .. | .. |
|---|
| 2280 | 2287 | .destroy_session = bnx2i_session_destroy, |
|---|
| 2281 | 2288 | .create_conn = bnx2i_conn_create, |
|---|
| 2282 | 2289 | .bind_conn = bnx2i_conn_bind, |
|---|
| 2290 | + .unbind_conn = iscsi_conn_unbind, |
|---|
| 2283 | 2291 | .destroy_conn = bnx2i_conn_destroy, |
|---|
| 2284 | 2292 | .attr_is_visible = bnx2i_attr_is_visible, |
|---|
| 2285 | 2293 | .set_param = iscsi_set_param, |
|---|