Lines Matching defs:bnx2i_ep

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