858
864
mutex_init(&hba->net_dev_lock);
859
865
init_waitqueue_head(&hba->eh_wait);
860
866
if (test_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type)) {
861
hba->hba_shutdown_tmo = 20 * HZ;
867
hba->hba_shutdown_tmo = 30 * HZ;
862
868
hba->conn_teardown_tmo = 20 * HZ;
863
869
hba->conn_ctx_destroy_tmo = 6 * HZ;
864
870
} else { /* 5706/5708/5709 */
1092
1098
case ISCSI_OP_SCSI_TMFUNC:
1093
1099
rc = bnx2i_send_iscsi_tmf(bnx2i_conn, task);
1102
rc = bnx2i_send_iscsi_text(bnx2i_conn, task);
1096
1105
iscsi_conn_printk(KERN_ALERT, bnx2i_conn->cls_conn->dd_data,
1097
1106
"send_gen: unsupported op 0x%x\n",
1458
* bnx2i_conn_get_param - return iscsi connection parameter to caller
1459
* @cls_conn: pointer to iscsi cls conn
1470
* bnx2i_ep_get_param - return iscsi ep parameter to caller
1471
* @ep: pointer to iscsi endpoint
1460
1472
* @param: parameter type identifier
1461
1473
* @buf: buffer pointer
1463
* returns iSCSI connection parameters
1475
* returns iSCSI ep parameters
1465
static int bnx2i_conn_get_param(struct iscsi_cls_conn *cls_conn,
1466
enum iscsi_param param, char *buf)
1477
static int bnx2i_ep_get_param(struct iscsi_endpoint *ep,
1478
enum iscsi_param param, char *buf)
1468
struct iscsi_conn *conn = cls_conn->dd_data;
1469
struct bnx2i_conn *bnx2i_conn = conn->dd_data;
1480
struct bnx2i_endpoint *bnx2i_ep = ep->dd_data;
1481
struct bnx2i_hba *hba = bnx2i_ep->hba;
1482
int len = -ENOTCONN;
1472
if (!(bnx2i_conn && bnx2i_conn->ep && bnx2i_conn->ep->hba))
1475
1487
switch (param) {
1476
1488
case ISCSI_PARAM_CONN_PORT:
1477
mutex_lock(&bnx2i_conn->ep->hba->net_dev_lock);
1478
if (bnx2i_conn->ep->cm_sk)
1479
len = sprintf(buf, "%hu\n",
1480
bnx2i_conn->ep->cm_sk->dst_port);
1481
mutex_unlock(&bnx2i_conn->ep->hba->net_dev_lock);
1489
mutex_lock(&hba->net_dev_lock);
1490
if (bnx2i_ep->cm_sk)
1491
len = sprintf(buf, "%hu\n", bnx2i_ep->cm_sk->dst_port);
1492
mutex_unlock(&hba->net_dev_lock);
1483
1494
case ISCSI_PARAM_CONN_ADDRESS:
1484
mutex_lock(&bnx2i_conn->ep->hba->net_dev_lock);
1485
if (bnx2i_conn->ep->cm_sk)
1486
len = sprintf(buf, "%pI4\n",
1487
&bnx2i_conn->ep->cm_sk->dst_ip);
1488
mutex_unlock(&bnx2i_conn->ep->hba->net_dev_lock);
1495
mutex_lock(&hba->net_dev_lock);
1496
if (bnx2i_ep->cm_sk)
1497
len = sprintf(buf, "%pI4\n", &bnx2i_ep->cm_sk->dst_ip);
1498
mutex_unlock(&hba->net_dev_lock);
1491
return iscsi_conn_get_param(cls_conn, param, buf);
1935
1945
cnic_dev_10g = 1;
1937
1947
switch (bnx2i_ep->state) {
1938
case EP_STATE_CONNECT_FAILED:
1939
1948
case EP_STATE_CLEANUP_FAILED:
1940
1949
case EP_STATE_OFLD_FAILED:
1941
1950
case EP_STATE_DISCONN_TIMEDOUT:
1944
1953
case EP_STATE_CONNECT_START:
1954
case EP_STATE_CONNECT_FAILED:
1945
1955
case EP_STATE_CONNECT_COMPL:
1946
1956
case EP_STATE_ULP_UPDATE_START:
1947
1957
case EP_STATE_ULP_UPDATE_COMPL:
2200
2211
.bind_conn = bnx2i_conn_bind,
2201
2212
.destroy_conn = bnx2i_conn_destroy,
2202
2213
.set_param = iscsi_set_param,
2203
.get_conn_param = bnx2i_conn_get_param,
2214
.get_conn_param = iscsi_conn_get_param,
2204
2215
.get_session_param = iscsi_session_get_param,
2205
2216
.get_host_param = bnx2i_host_get_param,
2206
2217
.start_conn = bnx2i_conn_start,
2209
2220
.xmit_task = bnx2i_task_xmit,
2210
2221
.get_stats = bnx2i_conn_get_stats,
2211
2222
/* TCP connect - disconnect - option-2 interface calls */
2223
.get_ep_param = bnx2i_ep_get_param,
2212
2224
.ep_connect = bnx2i_ep_connect,
2213
2225
.ep_poll = bnx2i_ep_poll,
2214
2226
.ep_disconnect = bnx2i_ep_disconnect,