Lines Matching refs:bnx2i_ep
384 struct bnx2i_endpoint *bnx2i_ep; in bnx2i_alloc_ep() local
387 ep = iscsi_create_endpoint(sizeof(*bnx2i_ep)); in bnx2i_alloc_ep()
393 bnx2i_ep = ep->dd_data; in bnx2i_alloc_ep()
394 bnx2i_ep->cls_ep = ep; in bnx2i_alloc_ep()
395 INIT_LIST_HEAD(&bnx2i_ep->link); in bnx2i_alloc_ep()
396 bnx2i_ep->state = EP_STATE_IDLE; in bnx2i_alloc_ep()
397 bnx2i_ep->ep_iscsi_cid = (u16) -1; in bnx2i_alloc_ep()
398 bnx2i_ep->hba = hba; in bnx2i_alloc_ep()
399 bnx2i_ep->hba_age = hba->age; in bnx2i_alloc_ep()
403 bnx2i_ep->ec_shift += 1; in bnx2i_alloc_ep()
406 init_waitqueue_head(&bnx2i_ep->ofld_wait); in bnx2i_alloc_ep()
417 struct bnx2i_endpoint *bnx2i_ep = ep->dd_data; in bnx2i_free_ep() local
421 bnx2i_ep->state = EP_STATE_IDLE; in bnx2i_free_ep()
422 bnx2i_ep->hba->ofld_conns_active--; in bnx2i_free_ep()
424 if (bnx2i_ep->ep_iscsi_cid != (u16) -1) in bnx2i_free_ep()
425 bnx2i_free_iscsi_cid(bnx2i_ep->hba, bnx2i_ep->ep_iscsi_cid); in bnx2i_free_ep()
427 if (bnx2i_ep->conn) { in bnx2i_free_ep()
428 bnx2i_ep->conn->ep = NULL; in bnx2i_free_ep()
429 bnx2i_ep->conn = NULL; in bnx2i_free_ep()
432 bnx2i_ep->hba = NULL; in bnx2i_free_ep()
1291 struct bnx2i_endpoint *bnx2i_ep; in bnx2i_session_create() local
1298 bnx2i_ep = ep->dd_data; in bnx2i_session_create()
1299 shost = bnx2i_ep->hba->shost; in bnx2i_session_create()
1412 struct bnx2i_endpoint *bnx2i_ep; in bnx2i_conn_bind() local
1428 bnx2i_ep = ep->dd_data; in bnx2i_conn_bind()
1429 if ((bnx2i_ep->state == EP_STATE_TCP_FIN_RCVD) || in bnx2i_conn_bind()
1430 (bnx2i_ep->state == EP_STATE_TCP_RST_RCVD)) { in bnx2i_conn_bind()
1441 if (bnx2i_ep->hba != hba) { in bnx2i_conn_bind()
1446 bnx2i_ep, bnx2i_ep->hba->netdev->name); in bnx2i_conn_bind()
1453 bnx2i_ep->conn = bnx2i_conn; in bnx2i_conn_bind()
1454 bnx2i_conn->ep = bnx2i_ep; in bnx2i_conn_bind()
1455 bnx2i_conn->iscsi_conn_cid = bnx2i_ep->ep_iscsi_cid; in bnx2i_conn_bind()
1456 bnx2i_conn->fw_cid = bnx2i_ep->ep_cid; in bnx2i_conn_bind()
1459 bnx2i_ep->ep_iscsi_cid); in bnx2i_conn_bind()
1464 if (test_bit(BNX2I_NX2_DEV_57710, &bnx2i_ep->hba->cnic_dev_type)) in bnx2i_conn_bind()
1530 struct bnx2i_endpoint *bnx2i_ep = ep->dd_data; in bnx2i_ep_get_param() local
1531 struct bnx2i_hba *hba = bnx2i_ep->hba; in bnx2i_ep_get_param()
1540 if (bnx2i_ep->cm_sk) in bnx2i_ep_get_param()
1541 len = sprintf(buf, "%hu\n", bnx2i_ep->cm_sk->dst_port); in bnx2i_ep_get_param()
1546 if (bnx2i_ep->cm_sk) in bnx2i_ep_get_param()
1547 len = sprintf(buf, "%pI4\n", &bnx2i_ep->cm_sk->dst_ip); in bnx2i_ep_get_param()
1581 struct bnx2i_endpoint *bnx2i_ep; in bnx2i_host_get_param() local
1584 bnx2i_ep = list_first_entry(active_list, in bnx2i_host_get_param()
1587 csk = bnx2i_ep->cm_sk; in bnx2i_host_get_param()
1783 struct bnx2i_endpoint *bnx2i_ep; in bnx2i_ep_connect() local
1816 bnx2i_ep = ep->dd_data; in bnx2i_ep_connect()
1818 atomic_set(&bnx2i_ep->num_active_cmds, 0); in bnx2i_ep_connect()
1827 bnx2i_ep->hba_age = hba->age; in bnx2i_ep_connect()
1829 rc = bnx2i_alloc_qp_resc(hba, bnx2i_ep); in bnx2i_ep_connect()
1837 bnx2i_ep->ep_iscsi_cid = (u16)iscsi_cid; in bnx2i_ep_connect()
1838 bnx2i_ep->state = EP_STATE_OFLD_START; in bnx2i_ep_connect()
1839 bnx2i_ep_ofld_list_add(hba, bnx2i_ep); in bnx2i_ep_connect()
1841 timer_setup(&bnx2i_ep->ofld_timer, bnx2i_ep_ofld_timer, 0); in bnx2i_ep_connect()
1842 bnx2i_ep->ofld_timer.expires = 2 * HZ + jiffies; in bnx2i_ep_connect()
1843 add_timer(&bnx2i_ep->ofld_timer); in bnx2i_ep_connect()
1845 if (bnx2i_send_conn_ofld_req(hba, bnx2i_ep)) { in bnx2i_ep_connect()
1846 if (bnx2i_ep->state == EP_STATE_OFLD_FAILED_CID_BUSY) { in bnx2i_ep_connect()
1848 hba->netdev->name, bnx2i_ep->ep_iscsi_cid); in bnx2i_ep_connect()
1854 bnx2i_ep_ofld_list_del(hba, bnx2i_ep); in bnx2i_ep_connect()
1859 wait_event_interruptible(bnx2i_ep->ofld_wait, in bnx2i_ep_connect()
1860 bnx2i_ep->state != EP_STATE_OFLD_START); in bnx2i_ep_connect()
1864 del_timer_sync(&bnx2i_ep->ofld_timer); in bnx2i_ep_connect()
1866 bnx2i_ep_ofld_list_del(hba, bnx2i_ep); in bnx2i_ep_connect()
1868 if (bnx2i_ep->state != EP_STATE_OFLD_COMPL) { in bnx2i_ep_connect()
1869 if (bnx2i_ep->state == EP_STATE_OFLD_FAILED_CID_BUSY) { in bnx2i_ep_connect()
1871 hba->netdev->name, bnx2i_ep->ep_iscsi_cid); in bnx2i_ep_connect()
1878 rc = cnic->cm_create(cnic, CNIC_ULP_ISCSI, bnx2i_ep->ep_cid, in bnx2i_ep_connect()
1879 iscsi_cid, &bnx2i_ep->cm_sk, bnx2i_ep); in bnx2i_ep_connect()
1886 bnx2i_ep->cm_sk->rcv_buf = 256 * 1024; in bnx2i_ep_connect()
1887 bnx2i_ep->cm_sk->snd_buf = 256 * 1024; in bnx2i_ep_connect()
1888 clear_bit(SK_TCP_TIMESTAMP, &bnx2i_ep->cm_sk->tcp_flags); in bnx2i_ep_connect()
1901 bnx2i_ep->timestamp = jiffies; in bnx2i_ep_connect()
1902 bnx2i_ep->state = EP_STATE_CONNECT_START; in bnx2i_ep_connect()
1907 rc = cnic->cm_connect(bnx2i_ep->cm_sk, &saddr); in bnx2i_ep_connect()
1911 bnx2i_ep_active_list_add(hba, bnx2i_ep); in bnx2i_ep_connect()
1913 rc = bnx2i_map_ep_dbell_regs(bnx2i_ep); in bnx2i_ep_connect()
1921 bnx2i_ep_active_list_del(hba, bnx2i_ep); in bnx2i_ep_connect()
1923 if (bnx2i_tear_down_conn(hba, bnx2i_ep)) { in bnx2i_ep_connect()
1928 bnx2i_free_qp_resc(hba, bnx2i_ep); in bnx2i_ep_connect()
1947 struct bnx2i_endpoint *bnx2i_ep; in bnx2i_ep_poll() local
1950 bnx2i_ep = ep->dd_data; in bnx2i_ep_poll()
1951 if ((bnx2i_ep->state == EP_STATE_IDLE) || in bnx2i_ep_poll()
1952 (bnx2i_ep->state == EP_STATE_CONNECT_FAILED) || in bnx2i_ep_poll()
1953 (bnx2i_ep->state == EP_STATE_OFLD_FAILED)) in bnx2i_ep_poll()
1955 if (bnx2i_ep->state == EP_STATE_CONNECT_COMPL) in bnx2i_ep_poll()
1958 rc = wait_event_interruptible_timeout(bnx2i_ep->ofld_wait, in bnx2i_ep_poll()
1959 ((bnx2i_ep->state == in bnx2i_ep_poll()
1961 (bnx2i_ep->state == in bnx2i_ep_poll()
1963 (bnx2i_ep->state == in bnx2i_ep_poll()
1966 if (bnx2i_ep->state == EP_STATE_OFLD_FAILED) in bnx2i_ep_poll()
1984 static int bnx2i_ep_tcp_conn_active(struct bnx2i_endpoint *bnx2i_ep) in bnx2i_ep_tcp_conn_active() argument
1989 if (test_bit(BNX2I_NX2_DEV_57710, &bnx2i_ep->hba->cnic_dev_type)) in bnx2i_ep_tcp_conn_active()
1992 switch (bnx2i_ep->state) { in bnx2i_ep_tcp_conn_active()
2029 int bnx2i_hw_ep_disconnect(struct bnx2i_endpoint *bnx2i_ep) in bnx2i_hw_ep_disconnect() argument
2031 struct bnx2i_hba *hba = bnx2i_ep->hba; in bnx2i_hw_ep_disconnect()
2046 if (bnx2i_ep->state == EP_STATE_IDLE || in bnx2i_hw_ep_disconnect()
2047 bnx2i_ep->state == EP_STATE_DISCONN_TIMEDOUT) in bnx2i_hw_ep_disconnect()
2050 if (!bnx2i_ep_tcp_conn_active(bnx2i_ep)) in bnx2i_hw_ep_disconnect()
2053 if (bnx2i_ep->conn) { in bnx2i_hw_ep_disconnect()
2054 conn = bnx2i_ep->conn->cls_conn->dd_data; in bnx2i_hw_ep_disconnect()
2058 timer_setup(&bnx2i_ep->ofld_timer, bnx2i_ep_ofld_timer, 0); in bnx2i_hw_ep_disconnect()
2059 bnx2i_ep->ofld_timer.expires = hba->conn_teardown_tmo + jiffies; in bnx2i_hw_ep_disconnect()
2060 add_timer(&bnx2i_ep->ofld_timer); in bnx2i_hw_ep_disconnect()
2067 if (bnx2i_ep->state != EP_STATE_TCP_FIN_RCVD) { in bnx2i_hw_ep_disconnect()
2069 if (bnx2i_ep->state == EP_STATE_LOGOUT_SENT) { in bnx2i_hw_ep_disconnect()
2074 bnx2i_ep->hba->netdev->name); in bnx2i_hw_ep_disconnect()
2075 } else if (bnx2i_ep->state == in bnx2i_hw_ep_disconnect()
2085 bnx2i_ep->state = EP_STATE_DISCONN_START; in bnx2i_hw_ep_disconnect()
2088 close_ret = cnic->cm_close(bnx2i_ep->cm_sk); in bnx2i_hw_ep_disconnect()
2090 close_ret = cnic->cm_abort(bnx2i_ep->cm_sk); in bnx2i_hw_ep_disconnect()
2094 bnx2i_ep->hba->netdev->name, close, close_ret); in bnx2i_hw_ep_disconnect()
2097 wait_event_interruptible(bnx2i_ep->ofld_wait, in bnx2i_hw_ep_disconnect()
2098 ((bnx2i_ep->state != EP_STATE_DISCONN_START) in bnx2i_hw_ep_disconnect()
2099 && (bnx2i_ep->state != EP_STATE_TCP_FIN_RCVD))); in bnx2i_hw_ep_disconnect()
2103 del_timer_sync(&bnx2i_ep->ofld_timer); in bnx2i_hw_ep_disconnect()
2106 bnx2i_ep_active_list_del(hba, bnx2i_ep); in bnx2i_hw_ep_disconnect()
2107 if (bnx2i_tear_down_conn(hba, bnx2i_ep)) in bnx2i_hw_ep_disconnect()
2110 bnx2i_ep->state = EP_STATE_IDLE; in bnx2i_hw_ep_disconnect()
2123 struct bnx2i_endpoint *bnx2i_ep; in bnx2i_ep_disconnect() local
2127 bnx2i_ep = ep->dd_data; in bnx2i_ep_disconnect()
2133 while ((bnx2i_ep->state == EP_STATE_CONNECT_START) && in bnx2i_ep_disconnect()
2134 !time_after(jiffies, bnx2i_ep->timestamp + (12 * HZ))) in bnx2i_ep_disconnect()
2137 if (bnx2i_ep->conn) in bnx2i_ep_disconnect()
2138 bnx2i_conn = bnx2i_ep->conn; in bnx2i_ep_disconnect()
2139 hba = bnx2i_ep->hba; in bnx2i_ep_disconnect()
2143 if (bnx2i_ep->state == EP_STATE_DISCONN_TIMEDOUT) in bnx2i_ep_disconnect()
2146 if (bnx2i_ep->state == EP_STATE_IDLE) in bnx2i_ep_disconnect()
2150 (bnx2i_ep->hba_age != hba->age)) { in bnx2i_ep_disconnect()
2151 bnx2i_ep_active_list_del(hba, bnx2i_ep); in bnx2i_ep_disconnect()
2156 if (bnx2i_hw_ep_disconnect(bnx2i_ep)) { in bnx2i_ep_disconnect()
2161 bnx2i_free_qp_resc(hba, bnx2i_ep); in bnx2i_ep_disconnect()