forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-05-13 9d77db3c730780c8ef5ccd4b66403ff5675cfe4e
kernel/drivers/scsi/bnx2i/bnx2i_iscsi.c
....@@ -228,7 +228,7 @@
228228 /**
229229 * bnx2i_bind_conn_to_iscsi_cid - bind conn structure to 'iscsi_cid'
230230 * @hba: pointer to adapter instance
231
- * @conn: pointer to iscsi connection
231
+ * @bnx2i_conn: pointer to iscsi connection
232232 * @iscsi_cid: iscsi context ID, range 0 - (MAX_CONN - 1)
233233 *
234234 * update iscsi cid table entry with connection pointer. This enables
....@@ -463,7 +463,6 @@
463463 * bnx2i_destroy_cmd_pool - destroys iscsi command pool and release BD table
464464 * @hba: adapter instance pointer
465465 * @session: iscsi session pointer
466
- * @cmd: iscsi command structure
467466 */
468467 static void bnx2i_destroy_cmd_pool(struct bnx2i_hba *hba,
469468 struct iscsi_session *session)
....@@ -577,13 +576,12 @@
577576 hba->dummy_buffer, hba->dummy_buf_dma);
578577 hba->dummy_buffer = NULL;
579578 }
580
- return;
579
+ return;
581580 }
582581
583582 /**
584583 * 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
587585 *
588586 * This notifies iscsid that there is a error, so it can initiate
589587 * recovery.
....@@ -1277,7 +1275,8 @@
12771275
12781276 /**
12791277 * 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
12811280 * @qdepth: scsi queue depth to support
12821281 * @initial_cmdsn: initial iscsi CMDSN to be used for this session
12831282 *
....@@ -1423,17 +1422,23 @@
14231422 * Forcefully terminate all in progress connection recovery at the
14241423 * earliest, either in bind(), send_pdu(LOGIN), or conn_start()
14251424 */
1426
- if (bnx2i_adapter_ready(hba))
1427
- return -EIO;
1425
+ if (bnx2i_adapter_ready(hba)) {
1426
+ ret_code = -EIO;
1427
+ goto put_ep;
1428
+ }
14281429
14291430 bnx2i_ep = ep->dd_data;
14301431 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)) {
14321433 /* Peer disconnect via' FIN or RST */
1433
- return -EINVAL;
1434
+ ret_code = -EINVAL;
1435
+ goto put_ep;
1436
+ }
14341437
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
+ }
14371442
14381443 if (bnx2i_ep->hba != hba) {
14391444 /* Error - TCP connection does not belong to this device
....@@ -1444,7 +1449,8 @@
14441449 iscsi_conn_printk(KERN_ALERT, cls_conn->dd_data,
14451450 "belong to hba (%s)\n",
14461451 hba->netdev->name);
1447
- return -EEXIST;
1452
+ ret_code = -EEXIST;
1453
+ goto put_ep;
14481454 }
14491455 bnx2i_ep->conn = bnx2i_conn;
14501456 bnx2i_conn->ep = bnx2i_ep;
....@@ -1461,6 +1467,8 @@
14611467 bnx2i_put_rq_buf(bnx2i_conn, 0);
14621468
14631469 bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE);
1470
+put_ep:
1471
+ iscsi_put_endpoint(ep);
14641472 return ret_code;
14651473 }
14661474
....@@ -1971,7 +1979,7 @@
19711979
19721980 /**
19731981 * bnx2i_ep_tcp_conn_active - check EP state transition
1974
- * @ep: endpoint pointer
1982
+ * @bnx2i_ep: endpoint pointer
19751983 *
19761984 * check if underlying TCP connection is active
19771985 */
....@@ -2014,9 +2022,9 @@
20142022 }
20152023
20162024
2017
-/*
2025
+/**
20182026 * 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
20202028 *
20212029 * executes TCP connection teardown process
20222030 */
....@@ -2171,8 +2179,8 @@
21712179
21722180 /**
21732181 * 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
21762184 */
21772185 static int bnx2i_nl_set_path(struct Scsi_Host *shost, struct iscsi_path *params)
21782186 {
....@@ -2263,7 +2271,6 @@
22632271 .max_sectors = 127,
22642272 .cmd_per_lun = 128,
22652273 .this_id = -1,
2266
- .use_clustering = ENABLE_CLUSTERING,
22672274 .sg_tablesize = ISCSI_MAX_BDS_PER_CMD,
22682275 .shost_attrs = bnx2i_dev_attributes,
22692276 .track_queue_depth = 1,
....@@ -2280,6 +2287,7 @@
22802287 .destroy_session = bnx2i_session_destroy,
22812288 .create_conn = bnx2i_conn_create,
22822289 .bind_conn = bnx2i_conn_bind,
2290
+ .unbind_conn = iscsi_conn_unbind,
22832291 .destroy_conn = bnx2i_conn_destroy,
22842292 .attr_is_visible = bnx2i_attr_is_visible,
22852293 .set_param = iscsi_set_param,