Lines Matching full:ep
25 * bnx2i_get_cid_num - get cid from ep
26 * @ep: endpoint pointer
30 static u32 bnx2i_get_cid_num(struct bnx2i_endpoint *ep) in bnx2i_get_cid_num() argument
34 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) in bnx2i_get_cid_num()
35 cid = ep->ep_cid; in bnx2i_get_cid_num()
37 cid = GET_CID_NUM(ep->ep_cid); in bnx2i_get_cid_num()
131 * @ep: endpoint (transport identifier) structure
138 int bnx2i_arm_cq_event_coalescing(struct bnx2i_endpoint *ep, u8 action) in bnx2i_arm_cq_event_coalescing() argument
146 if (!test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) in bnx2i_arm_cq_event_coalescing()
153 cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; in bnx2i_arm_cq_event_coalescing()
160 num_active_cmds = atomic_read(&ep->num_active_cmds); in bnx2i_arm_cq_event_coalescing()
164 next_index = num_active_cmds >> ep->ec_shift; in bnx2i_arm_cq_event_coalescing()
170 cq_index = ep->qp.cqe_exp_seq_sn + next_index - 1; in bnx2i_arm_cq_event_coalescing()
171 if (cq_index > ep->qp.cqe_size * 2) in bnx2i_arm_cq_event_coalescing()
172 cq_index -= ep->qp.cqe_size * 2; in bnx2i_arm_cq_event_coalescing()
195 if (!bnx2i_conn->ep->qp.rqe_left) in bnx2i_get_rq_buf()
198 bnx2i_conn->ep->qp.rqe_left--; in bnx2i_get_rq_buf()
199 memcpy(ptr, (u8 *) bnx2i_conn->ep->qp.rq_cons_qe, len); in bnx2i_get_rq_buf()
200 if (bnx2i_conn->ep->qp.rq_cons_qe == bnx2i_conn->ep->qp.rq_last_qe) { in bnx2i_get_rq_buf()
201 bnx2i_conn->ep->qp.rq_cons_qe = bnx2i_conn->ep->qp.rq_first_qe; in bnx2i_get_rq_buf()
202 bnx2i_conn->ep->qp.rq_cons_idx = 0; in bnx2i_get_rq_buf()
204 bnx2i_conn->ep->qp.rq_cons_qe++; in bnx2i_get_rq_buf()
205 bnx2i_conn->ep->qp.rq_cons_idx++; in bnx2i_get_rq_buf()
220 writel(cpu_to_le32(msg), conn->ep->qp.ctx_base); in bnx2i_ring_577xx_doorbell()
234 u16 hi_bit = (bnx2i_conn->ep->qp.rq_prod_idx & 0x8000); in bnx2i_put_rq_buf()
235 struct bnx2i_endpoint *ep = bnx2i_conn->ep; in bnx2i_put_rq_buf() local
237 ep->qp.rqe_left += count; in bnx2i_put_rq_buf()
238 ep->qp.rq_prod_idx &= 0x7FFF; in bnx2i_put_rq_buf()
239 ep->qp.rq_prod_idx += count; in bnx2i_put_rq_buf()
241 if (ep->qp.rq_prod_idx > bnx2i_conn->hba->max_rqes) { in bnx2i_put_rq_buf()
242 ep->qp.rq_prod_idx %= bnx2i_conn->hba->max_rqes; in bnx2i_put_rq_buf()
244 ep->qp.rq_prod_idx |= 0x8000; in bnx2i_put_rq_buf()
246 ep->qp.rq_prod_idx |= hi_bit; in bnx2i_put_rq_buf()
248 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { in bnx2i_put_rq_buf()
249 rq_db = (struct bnx2i_5771x_sq_rq_db *) ep->qp.rq_pgtbl_virt; in bnx2i_put_rq_buf()
250 rq_db->prod_idx = ep->qp.rq_prod_idx; in bnx2i_put_rq_buf()
253 writew(ep->qp.rq_prod_idx, in bnx2i_put_rq_buf()
254 ep->qp.ctx_base + CNIC_RECV_DOORBELL); in bnx2i_put_rq_buf()
271 struct bnx2i_endpoint *ep = bnx2i_conn->ep; in bnx2i_ring_sq_dbell() local
273 atomic_inc(&ep->num_active_cmds); in bnx2i_ring_sq_dbell()
275 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { in bnx2i_ring_sq_dbell()
276 sq_db = (struct bnx2i_5771x_sq_rq_db *) ep->qp.sq_pgtbl_virt; in bnx2i_ring_sq_dbell()
277 sq_db->prod_idx = ep->qp.sq_prod_idx; in bnx2i_ring_sq_dbell()
280 writew(count, ep->qp.ctx_base + CNIC_SEND_DOORBELL); in bnx2i_ring_sq_dbell()
297 if (bnx2i_conn->ep->qp.sq_prod_qe == in bnx2i_ring_dbell_update_sq_params()
298 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
299 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
300 bnx2i_conn->ep->qp.sq_first_qe; in bnx2i_ring_dbell_update_sq_params()
302 bnx2i_conn->ep->qp.sq_prod_qe++; in bnx2i_ring_dbell_update_sq_params()
304 if ((bnx2i_conn->ep->qp.sq_prod_qe + count) <= in bnx2i_ring_dbell_update_sq_params()
305 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
306 bnx2i_conn->ep->qp.sq_prod_qe += count; in bnx2i_ring_dbell_update_sq_params()
308 tmp_cnt = bnx2i_conn->ep->qp.sq_last_qe - in bnx2i_ring_dbell_update_sq_params()
309 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_ring_dbell_update_sq_params()
310 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
311 &bnx2i_conn->ep->qp.sq_first_qe[count - in bnx2i_ring_dbell_update_sq_params()
315 bnx2i_conn->ep->qp.sq_prod_idx += count; in bnx2i_ring_dbell_update_sq_params()
317 bnx2i_ring_sq_dbell(bnx2i_conn, bnx2i_conn->ep->qp.sq_prod_idx); in bnx2i_ring_dbell_update_sq_params()
338 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_login()
395 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_tmf()
464 text_wqe = (struct bnx2i_text_request *) bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_text()
510 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_scsicmd()
534 struct bnx2i_endpoint *ep = bnx2i_conn->ep; in bnx2i_send_iscsi_nopout() local
539 nopout_wqe = (struct bnx2i_nop_out_request *)ep->qp.sq_prod_qe; in bnx2i_send_iscsi_nopout()
548 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) in bnx2i_send_iscsi_nopout()
597 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_logout()
616 bnx2i_conn->ep->state = EP_STATE_LOGOUT_SENT; in bnx2i_send_iscsi_logout()
644 if (test_bit(BNX2I_NX2_DEV_57710, &bnx2i_conn->ep->hba->cnic_dev_type)) in bnx2i_update_iscsi_conn()
645 update_wqe->context_id = bnx2i_conn->ep->ep_cid; in bnx2i_update_iscsi_conn()
647 update_wqe->context_id = (bnx2i_conn->ep->ep_cid >> 7); in bnx2i_update_iscsi_conn()
688 struct bnx2i_endpoint *ep = from_timer(ep, t, ofld_timer); in bnx2i_ep_ofld_timer() local
690 if (ep->state == EP_STATE_OFLD_START) { in bnx2i_ep_ofld_timer()
692 ep->state = EP_STATE_OFLD_FAILED; in bnx2i_ep_ofld_timer()
693 } else if (ep->state == EP_STATE_DISCONN_START) { in bnx2i_ep_ofld_timer()
695 ep->state = EP_STATE_DISCONN_TIMEDOUT; in bnx2i_ep_ofld_timer()
696 } else if (ep->state == EP_STATE_CLEANUP_START) { in bnx2i_ep_ofld_timer()
698 ep->state = EP_STATE_CLEANUP_FAILED; in bnx2i_ep_ofld_timer()
701 wake_up_interruptible(&ep->ofld_wait); in bnx2i_ep_ofld_timer()
732 (struct bnx2i_cleanup_request *)cmd->conn->ep->qp.sq_prod_qe; in bnx2i_send_cmd_cleanup_req()
746 * @ep: endpoint (transport identifier) structure
751 int bnx2i_send_conn_destroy(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_send_conn_destroy() argument
763 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) in bnx2i_send_conn_destroy()
764 conn_cleanup.context_id = ep->ep_cid; in bnx2i_send_conn_destroy()
766 conn_cleanup.context_id = (ep->ep_cid >> 7); in bnx2i_send_conn_destroy()
768 conn_cleanup.reserved0 = (u16)ep->ep_iscsi_cid; in bnx2i_send_conn_destroy()
781 * @ep: endpoint (transport identifier) structure
786 struct bnx2i_endpoint *ep) in bnx2i_570x_send_conn_ofld_req() argument
800 ofld_req1.iscsi_conn_id = (u16) ep->ep_iscsi_cid; in bnx2i_570x_send_conn_ofld_req()
802 dma_addr = ep->qp.sq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
806 dma_addr = ep->qp.cq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
814 dma_addr = ep->qp.rq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
818 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
823 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
841 * @ep: endpoint (transport identifier) structure
846 struct bnx2i_endpoint *ep) in bnx2i_5771x_send_conn_ofld_req() argument
861 ofld_req1.iscsi_conn_id = (u16) ep->ep_iscsi_cid; in bnx2i_5771x_send_conn_ofld_req()
863 dma_addr = ep->qp.sq_pgtbl_phys + ISCSI_SQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
867 dma_addr = ep->qp.cq_pgtbl_phys + ISCSI_CQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
875 dma_addr = ep->qp.rq_pgtbl_phys + ISCSI_RQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
879 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
883 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
892 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
910 * @ep: endpoint (transport identifier) structure
914 int bnx2i_send_conn_ofld_req(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_send_conn_ofld_req() argument
919 rc = bnx2i_5771x_send_conn_ofld_req(hba, ep); in bnx2i_send_conn_ofld_req()
921 rc = bnx2i_570x_send_conn_ofld_req(hba, ep); in bnx2i_send_conn_ofld_req()
929 * @ep: endpoint (transport identifier) structure
935 static void setup_qp_page_tables(struct bnx2i_endpoint *ep) in setup_qp_page_tables() argument
942 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) in setup_qp_page_tables()
948 memset(ep->qp.sq_pgtbl_virt, 0, ep->qp.sq_pgtbl_size); in setup_qp_page_tables()
949 num_pages = ep->qp.sq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
950 page = ep->qp.sq_phys; in setup_qp_page_tables()
953 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in setup_qp_page_tables()
955 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in setup_qp_page_tables()
976 memset(ep->qp.rq_pgtbl_virt, 0, ep->qp.rq_pgtbl_size); in setup_qp_page_tables()
977 num_pages = ep->qp.rq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
978 page = ep->qp.rq_phys; in setup_qp_page_tables()
981 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in setup_qp_page_tables()
983 ptbl = (u32 *) ep->qp.rq_pgtbl_virt; in setup_qp_page_tables()
1004 memset(ep->qp.cq_pgtbl_virt, 0, ep->qp.cq_pgtbl_size); in setup_qp_page_tables()
1005 num_pages = ep->qp.cq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
1006 page = ep->qp.cq_phys; in setup_qp_page_tables()
1009 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in setup_qp_page_tables()
1011 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in setup_qp_page_tables()
1036 * @ep: endpoint (transport identifier) structure
1039 * memory for SQ/RQ/CQ and page tables. EP structure elements such
1043 int bnx2i_alloc_qp_resc(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_alloc_qp_resc() argument
1047 ep->hba = hba; in bnx2i_alloc_qp_resc()
1048 ep->conn = NULL; in bnx2i_alloc_qp_resc()
1049 ep->ep_cid = ep->ep_iscsi_cid = ep->ep_pg_cid = 0; in bnx2i_alloc_qp_resc()
1052 ep->qp.sq_mem_size = hba->max_sqes * BNX2I_SQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1053 ep->qp.sq_mem_size = in bnx2i_alloc_qp_resc()
1054 (ep->qp.sq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1055 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1056 (ep->qp.sq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1057 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1058 (ep->qp.sq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1060 ep->qp.sq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1061 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_alloc_qp_resc()
1062 &ep->qp.sq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1063 if (!ep->qp.sq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1065 ep->qp.sq_pgtbl_size); in bnx2i_alloc_qp_resc()
1070 ep->qp.sq_virt = in bnx2i_alloc_qp_resc()
1071 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_alloc_qp_resc()
1072 &ep->qp.sq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1073 if (!ep->qp.sq_virt) { in bnx2i_alloc_qp_resc()
1075 ep->qp.sq_mem_size); in bnx2i_alloc_qp_resc()
1079 ep->qp.sq_first_qe = ep->qp.sq_virt; in bnx2i_alloc_qp_resc()
1080 ep->qp.sq_prod_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1081 ep->qp.sq_cons_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1082 ep->qp.sq_last_qe = &ep->qp.sq_first_qe[hba->max_sqes - 1]; in bnx2i_alloc_qp_resc()
1083 ep->qp.sq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1084 ep->qp.sq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1085 ep->qp.sqe_left = hba->max_sqes; in bnx2i_alloc_qp_resc()
1088 ep->qp.cq_mem_size = hba->max_cqes * BNX2I_CQE_SIZE; in bnx2i_alloc_qp_resc()
1089 ep->qp.cq_mem_size = in bnx2i_alloc_qp_resc()
1090 (ep->qp.cq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1091 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1092 (ep->qp.cq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1093 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1094 (ep->qp.cq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1096 ep->qp.cq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1097 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_alloc_qp_resc()
1098 &ep->qp.cq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1099 if (!ep->qp.cq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1101 ep->qp.cq_pgtbl_size); in bnx2i_alloc_qp_resc()
1106 ep->qp.cq_virt = in bnx2i_alloc_qp_resc()
1107 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_alloc_qp_resc()
1108 &ep->qp.cq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1109 if (!ep->qp.cq_virt) { in bnx2i_alloc_qp_resc()
1111 ep->qp.cq_mem_size); in bnx2i_alloc_qp_resc()
1115 ep->qp.cq_first_qe = ep->qp.cq_virt; in bnx2i_alloc_qp_resc()
1116 ep->qp.cq_prod_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1117 ep->qp.cq_cons_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1118 ep->qp.cq_last_qe = &ep->qp.cq_first_qe[hba->max_cqes - 1]; in bnx2i_alloc_qp_resc()
1119 ep->qp.cq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1120 ep->qp.cq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1121 ep->qp.cqe_left = hba->max_cqes; in bnx2i_alloc_qp_resc()
1122 ep->qp.cqe_exp_seq_sn = ISCSI_INITIAL_SN; in bnx2i_alloc_qp_resc()
1123 ep->qp.cqe_size = hba->max_cqes; in bnx2i_alloc_qp_resc()
1126 cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; in bnx2i_alloc_qp_resc()
1130 ep->qp.rq_mem_size = hba->max_rqes * BNX2I_RQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1131 ep->qp.rq_mem_size = in bnx2i_alloc_qp_resc()
1132 (ep->qp.rq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1133 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1134 (ep->qp.rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1135 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1136 (ep->qp.rq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1138 ep->qp.rq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1139 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_alloc_qp_resc()
1140 &ep->qp.rq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1141 if (!ep->qp.rq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1143 ep->qp.rq_pgtbl_size); in bnx2i_alloc_qp_resc()
1148 ep->qp.rq_virt = in bnx2i_alloc_qp_resc()
1149 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_alloc_qp_resc()
1150 &ep->qp.rq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1151 if (!ep->qp.rq_virt) { in bnx2i_alloc_qp_resc()
1153 ep->qp.rq_mem_size); in bnx2i_alloc_qp_resc()
1157 ep->qp.rq_first_qe = ep->qp.rq_virt; in bnx2i_alloc_qp_resc()
1158 ep->qp.rq_prod_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1159 ep->qp.rq_cons_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1160 ep->qp.rq_last_qe = &ep->qp.rq_first_qe[hba->max_rqes - 1]; in bnx2i_alloc_qp_resc()
1161 ep->qp.rq_prod_idx = 0x8000; in bnx2i_alloc_qp_resc()
1162 ep->qp.rq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1163 ep->qp.rqe_left = hba->max_rqes; in bnx2i_alloc_qp_resc()
1165 setup_qp_page_tables(ep); in bnx2i_alloc_qp_resc()
1170 bnx2i_free_qp_resc(hba, ep); in bnx2i_alloc_qp_resc()
1179 * @ep: endpoint (transport identifier) structure
1183 void bnx2i_free_qp_resc(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_free_qp_resc() argument
1185 if (ep->qp.ctx_base) { in bnx2i_free_qp_resc()
1186 iounmap(ep->qp.ctx_base); in bnx2i_free_qp_resc()
1187 ep->qp.ctx_base = NULL; in bnx2i_free_qp_resc()
1190 if (ep->qp.sq_pgtbl_virt) { in bnx2i_free_qp_resc()
1191 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_free_qp_resc()
1192 ep->qp.sq_pgtbl_virt, ep->qp.sq_pgtbl_phys); in bnx2i_free_qp_resc()
1193 ep->qp.sq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1194 ep->qp.sq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1196 if (ep->qp.sq_virt) { in bnx2i_free_qp_resc()
1197 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_free_qp_resc()
1198 ep->qp.sq_virt, ep->qp.sq_phys); in bnx2i_free_qp_resc()
1199 ep->qp.sq_virt = NULL; in bnx2i_free_qp_resc()
1200 ep->qp.sq_phys = 0; in bnx2i_free_qp_resc()
1204 if (ep->qp.rq_pgtbl_virt) { in bnx2i_free_qp_resc()
1205 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_free_qp_resc()
1206 ep->qp.rq_pgtbl_virt, ep->qp.rq_pgtbl_phys); in bnx2i_free_qp_resc()
1207 ep->qp.rq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1208 ep->qp.rq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1210 if (ep->qp.rq_virt) { in bnx2i_free_qp_resc()
1211 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_free_qp_resc()
1212 ep->qp.rq_virt, ep->qp.rq_phys); in bnx2i_free_qp_resc()
1213 ep->qp.rq_virt = NULL; in bnx2i_free_qp_resc()
1214 ep->qp.rq_phys = 0; in bnx2i_free_qp_resc()
1218 if (ep->qp.cq_pgtbl_virt) { in bnx2i_free_qp_resc()
1219 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_free_qp_resc()
1220 ep->qp.cq_pgtbl_virt, ep->qp.cq_pgtbl_phys); in bnx2i_free_qp_resc()
1221 ep->qp.cq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1222 ep->qp.cq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1224 if (ep->qp.cq_virt) { in bnx2i_free_qp_resc()
1225 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_free_qp_resc()
1226 ep->qp.cq_virt, ep->qp.cq_phys); in bnx2i_free_qp_resc()
1227 ep->qp.cq_virt = NULL; in bnx2i_free_qp_resc()
1228 ep->qp.cq_phys = 0; in bnx2i_free_qp_resc()
1633 bnx2i_conn->ep->state = EP_STATE_LOGOUT_RESP_RCVD; in bnx2i_process_logout_resp()
1965 if (bnx2i_conn->ep == NULL) in bnx2i_process_new_cqes()
1968 qp = &bnx2i_conn->ep->qp; in bnx2i_process_new_cqes()
2048 if (!atomic_read(&bnx2i_conn->ep->num_active_cmds)) in bnx2i_process_new_cqes()
2054 atomic_dec(&bnx2i_conn->ep->num_active_cmds); in bnx2i_process_new_cqes()
2100 if (!bnx2i_conn->ep) { in bnx2i_fastpath_notification()
2101 printk(KERN_ALERT "cid #%x - ep not bound\n", iscsi_cid); in bnx2i_fastpath_notification()
2106 nxt_idx = bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, in bnx2i_fastpath_notification()
2109 bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE_FP); in bnx2i_fastpath_notification()
2133 if (!conn->ep) { in bnx2i_process_update_conn_cmpl()
2134 printk(KERN_ALERT "cid %x does not have ep bound\n", iscsi_cid); in bnx2i_process_update_conn_cmpl()
2140 conn->ep->state = EP_STATE_ULP_UPDATE_FAILED; in bnx2i_process_update_conn_cmpl()
2142 conn->ep->state = EP_STATE_ULP_UPDATE_COMPL; in bnx2i_process_update_conn_cmpl()
2144 wake_up_interruptible(&conn->ep->ofld_wait); in bnx2i_process_update_conn_cmpl()
2368 bnx2i_conn, bnx2i_conn->ep->ep_iscsi_cid, in bnx2i_process_iscsi_error()
2369 bnx2i_conn->ep->ep_cid); in bnx2i_process_iscsi_error()
2391 struct bnx2i_endpoint *ep; in bnx2i_process_conn_destroy_cmpl() local
2393 ep = bnx2i_find_ep_in_destroy_list(hba, conn_destroy->iscsi_conn_id); in bnx2i_process_conn_destroy_cmpl()
2394 if (!ep) { in bnx2i_process_conn_destroy_cmpl()
2400 if (hba != ep->hba) { in bnx2i_process_conn_destroy_cmpl()
2407 ep->state = EP_STATE_CLEANUP_FAILED; in bnx2i_process_conn_destroy_cmpl()
2409 ep->state = EP_STATE_CLEANUP_CMPL; in bnx2i_process_conn_destroy_cmpl()
2410 wake_up_interruptible(&ep->ofld_wait); in bnx2i_process_conn_destroy_cmpl()
2426 struct bnx2i_endpoint *ep; in bnx2i_process_ofld_cmpl() local
2428 ep = bnx2i_find_ep_in_ofld_list(hba, ofld_kcqe->iscsi_conn_id); in bnx2i_process_ofld_cmpl()
2429 if (!ep) { in bnx2i_process_ofld_cmpl()
2434 if (hba != ep->hba) { in bnx2i_process_ofld_cmpl()
2440 ep->state = EP_STATE_OFLD_FAILED; in bnx2i_process_ofld_cmpl()
2453 ep->state = EP_STATE_OFLD_FAILED_CID_BUSY; in bnx2i_process_ofld_cmpl()
2459 ep->state = EP_STATE_OFLD_COMPL; in bnx2i_process_ofld_cmpl()
2461 ep->ep_cid = cid_addr; in bnx2i_process_ofld_cmpl()
2462 ep->qp.ctx_base = NULL; in bnx2i_process_ofld_cmpl()
2464 wake_up_interruptible(&ep->ofld_wait); in bnx2i_process_ofld_cmpl()
2571 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_connect_cmpl() local
2573 if (test_bit(ADAPTER_STATE_GOING_DOWN, &ep->hba->adapter_state)) in bnx2i_cm_connect_cmpl()
2574 ep->state = EP_STATE_CONNECT_FAILED; in bnx2i_cm_connect_cmpl()
2576 ep->state = EP_STATE_CONNECT_COMPL; in bnx2i_cm_connect_cmpl()
2578 ep->state = EP_STATE_CONNECT_FAILED; in bnx2i_cm_connect_cmpl()
2580 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_connect_cmpl()
2593 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_close_cmpl() local
2595 ep->state = EP_STATE_DISCONN_COMPL; in bnx2i_cm_close_cmpl()
2596 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_close_cmpl()
2609 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_abort_cmpl() local
2611 ep->state = EP_STATE_DISCONN_COMPL; in bnx2i_cm_abort_cmpl()
2612 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_abort_cmpl()
2625 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_remote_close() local
2627 ep->state = EP_STATE_TCP_FIN_RCVD; in bnx2i_cm_remote_close()
2628 if (ep->conn) in bnx2i_cm_remote_close()
2629 bnx2i_recovery_que_add_conn(ep->hba, ep->conn); in bnx2i_cm_remote_close()
2641 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_remote_abort() local
2642 u32 old_state = ep->state; in bnx2i_cm_remote_abort()
2644 ep->state = EP_STATE_TCP_RST_RCVD; in bnx2i_cm_remote_abort()
2646 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_remote_abort()
2648 if (ep->conn) in bnx2i_cm_remote_abort()
2649 bnx2i_recovery_que_add_conn(ep->hba, ep->conn); in bnx2i_cm_remote_abort()
2695 * @ep: bnx2i endpoint
2701 int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) in bnx2i_map_ep_dbell_regs() argument
2710 cid_num = bnx2i_get_cid_num(ep); in bnx2i_map_ep_dbell_regs()
2712 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { in bnx2i_map_ep_dbell_regs()
2713 reg_base = pci_resource_start(ep->hba->pcidev, in bnx2i_map_ep_dbell_regs()
2716 ep->qp.ctx_base = ioremap(reg_base + reg_off, 4); in bnx2i_map_ep_dbell_regs()
2717 if (!ep->qp.ctx_base) in bnx2i_map_ep_dbell_regs()
2722 if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) && in bnx2i_map_ep_dbell_regs()
2723 (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) { in bnx2i_map_ep_dbell_regs()
2724 config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2); in bnx2i_map_ep_dbell_regs()
2737 ep->qp.ctx_base = ioremap(ep->hba->reg_base + reg_off, in bnx2i_map_ep_dbell_regs()
2739 if (!ep->qp.ctx_base) in bnx2i_map_ep_dbell_regs()
2743 bnx2i_arm_cq_event_coalescing(ep, CNIC_ARM_CQE); in bnx2i_map_ep_dbell_regs()