Lines Matching refs:ep
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()
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()
272 struct bnx2i_endpoint *ep = bnx2i_conn->ep; in bnx2i_ring_sq_dbell() local
274 atomic_inc(&ep->num_active_cmds); in bnx2i_ring_sq_dbell()
276 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { in bnx2i_ring_sq_dbell()
277 sq_db = (struct bnx2i_5771x_sq_rq_db *) ep->qp.sq_pgtbl_virt; in bnx2i_ring_sq_dbell()
278 sq_db->prod_idx = ep->qp.sq_prod_idx; in bnx2i_ring_sq_dbell()
281 writew(count, ep->qp.ctx_base + CNIC_SEND_DOORBELL); in bnx2i_ring_sq_dbell()
300 if (bnx2i_conn->ep->qp.sq_prod_qe == in bnx2i_ring_dbell_update_sq_params()
301 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
302 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
303 bnx2i_conn->ep->qp.sq_first_qe; in bnx2i_ring_dbell_update_sq_params()
305 bnx2i_conn->ep->qp.sq_prod_qe++; in bnx2i_ring_dbell_update_sq_params()
307 if ((bnx2i_conn->ep->qp.sq_prod_qe + count) <= in bnx2i_ring_dbell_update_sq_params()
308 bnx2i_conn->ep->qp.sq_last_qe) in bnx2i_ring_dbell_update_sq_params()
309 bnx2i_conn->ep->qp.sq_prod_qe += count; in bnx2i_ring_dbell_update_sq_params()
311 tmp_cnt = bnx2i_conn->ep->qp.sq_last_qe - in bnx2i_ring_dbell_update_sq_params()
312 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_ring_dbell_update_sq_params()
313 bnx2i_conn->ep->qp.sq_prod_qe = in bnx2i_ring_dbell_update_sq_params()
314 &bnx2i_conn->ep->qp.sq_first_qe[count - in bnx2i_ring_dbell_update_sq_params()
318 bnx2i_conn->ep->qp.sq_prod_idx += count; in bnx2i_ring_dbell_update_sq_params()
320 bnx2i_ring_sq_dbell(bnx2i_conn, bnx2i_conn->ep->qp.sq_prod_idx); in bnx2i_ring_dbell_update_sq_params()
343 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_login()
402 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_tmf()
473 text_wqe = (struct bnx2i_text_request *) bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_text()
519 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_scsicmd()
543 struct bnx2i_endpoint *ep = bnx2i_conn->ep; in bnx2i_send_iscsi_nopout() local
550 nopout_wqe = (struct bnx2i_nop_out_request *)ep->qp.sq_prod_qe; in bnx2i_send_iscsi_nopout()
558 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { in bnx2i_send_iscsi_nopout()
613 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_logout()
632 bnx2i_conn->ep->state = EP_STATE_LOGOUT_SENT; in bnx2i_send_iscsi_logout()
660 if (test_bit(BNX2I_NX2_DEV_57710, &bnx2i_conn->ep->hba->cnic_dev_type)) in bnx2i_update_iscsi_conn()
661 update_wqe->context_id = bnx2i_conn->ep->ep_cid; in bnx2i_update_iscsi_conn()
663 update_wqe->context_id = (bnx2i_conn->ep->ep_cid >> 7); in bnx2i_update_iscsi_conn()
703 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) data; in bnx2i_ep_ofld_timer() local
705 if (ep->state == EP_STATE_OFLD_START) { in bnx2i_ep_ofld_timer()
707 ep->state = EP_STATE_OFLD_FAILED; in bnx2i_ep_ofld_timer()
708 } else if (ep->state == EP_STATE_DISCONN_START) { in bnx2i_ep_ofld_timer()
710 ep->state = EP_STATE_DISCONN_TIMEDOUT; in bnx2i_ep_ofld_timer()
711 } else if (ep->state == EP_STATE_CLEANUP_START) { in bnx2i_ep_ofld_timer()
713 ep->state = EP_STATE_CLEANUP_FAILED; in bnx2i_ep_ofld_timer()
716 wake_up_interruptible(&ep->ofld_wait); in bnx2i_ep_ofld_timer()
747 (struct bnx2i_cleanup_request *)cmd->conn->ep->qp.sq_prod_qe; in bnx2i_send_cmd_cleanup_req()
766 int bnx2i_send_conn_destroy(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_send_conn_destroy() argument
778 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) in bnx2i_send_conn_destroy()
779 conn_cleanup.context_id = ep->ep_cid; in bnx2i_send_conn_destroy()
781 conn_cleanup.context_id = (ep->ep_cid >> 7); in bnx2i_send_conn_destroy()
783 conn_cleanup.reserved0 = (u16)ep->ep_iscsi_cid; in bnx2i_send_conn_destroy()
801 struct bnx2i_endpoint *ep) in bnx2i_570x_send_conn_ofld_req() argument
815 ofld_req1.iscsi_conn_id = (u16) ep->ep_iscsi_cid; in bnx2i_570x_send_conn_ofld_req()
817 dma_addr = ep->qp.sq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
821 dma_addr = ep->qp.cq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
829 dma_addr = ep->qp.rq_pgtbl_phys; in bnx2i_570x_send_conn_ofld_req()
833 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
838 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in bnx2i_570x_send_conn_ofld_req()
861 struct bnx2i_endpoint *ep) in bnx2i_5771x_send_conn_ofld_req() argument
876 ofld_req1.iscsi_conn_id = (u16) ep->ep_iscsi_cid; in bnx2i_5771x_send_conn_ofld_req()
878 dma_addr = ep->qp.sq_pgtbl_phys + ISCSI_SQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
882 dma_addr = ep->qp.cq_pgtbl_phys + ISCSI_CQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
890 dma_addr = ep->qp.rq_pgtbl_phys + ISCSI_RQ_DB_SIZE; in bnx2i_5771x_send_conn_ofld_req()
894 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
898 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
907 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in bnx2i_5771x_send_conn_ofld_req()
929 int bnx2i_send_conn_ofld_req(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_send_conn_ofld_req() argument
934 rc = bnx2i_5771x_send_conn_ofld_req(hba, ep); in bnx2i_send_conn_ofld_req()
936 rc = bnx2i_570x_send_conn_ofld_req(hba, ep); in bnx2i_send_conn_ofld_req()
950 static void setup_qp_page_tables(struct bnx2i_endpoint *ep) in setup_qp_page_tables() argument
957 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) in setup_qp_page_tables()
963 memset(ep->qp.sq_pgtbl_virt, 0, ep->qp.sq_pgtbl_size); in setup_qp_page_tables()
964 num_pages = ep->qp.sq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
965 page = ep->qp.sq_phys; in setup_qp_page_tables()
968 ptbl = (u32 *)((u8 *)ep->qp.sq_pgtbl_virt + ISCSI_SQ_DB_SIZE); in setup_qp_page_tables()
970 ptbl = (u32 *) ep->qp.sq_pgtbl_virt; in setup_qp_page_tables()
991 memset(ep->qp.rq_pgtbl_virt, 0, ep->qp.rq_pgtbl_size); in setup_qp_page_tables()
992 num_pages = ep->qp.rq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
993 page = ep->qp.rq_phys; in setup_qp_page_tables()
996 ptbl = (u32 *)((u8 *)ep->qp.rq_pgtbl_virt + ISCSI_RQ_DB_SIZE); in setup_qp_page_tables()
998 ptbl = (u32 *) ep->qp.rq_pgtbl_virt; in setup_qp_page_tables()
1019 memset(ep->qp.cq_pgtbl_virt, 0, ep->qp.cq_pgtbl_size); in setup_qp_page_tables()
1020 num_pages = ep->qp.cq_mem_size / CNIC_PAGE_SIZE; in setup_qp_page_tables()
1021 page = ep->qp.cq_phys; in setup_qp_page_tables()
1024 ptbl = (u32 *)((u8 *)ep->qp.cq_pgtbl_virt + ISCSI_CQ_DB_SIZE); in setup_qp_page_tables()
1026 ptbl = (u32 *) ep->qp.cq_pgtbl_virt; in setup_qp_page_tables()
1058 int bnx2i_alloc_qp_resc(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_alloc_qp_resc() argument
1062 ep->hba = hba; in bnx2i_alloc_qp_resc()
1063 ep->conn = NULL; in bnx2i_alloc_qp_resc()
1064 ep->ep_cid = ep->ep_iscsi_cid = ep->ep_pg_cid = 0; in bnx2i_alloc_qp_resc()
1067 ep->qp.sq_mem_size = hba->max_sqes * BNX2I_SQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1068 ep->qp.sq_mem_size = in bnx2i_alloc_qp_resc()
1069 (ep->qp.sq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1070 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1071 (ep->qp.sq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1072 ep->qp.sq_pgtbl_size = in bnx2i_alloc_qp_resc()
1073 (ep->qp.sq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1075 ep->qp.sq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1076 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_alloc_qp_resc()
1077 &ep->qp.sq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1078 if (!ep->qp.sq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1080 ep->qp.sq_pgtbl_size); in bnx2i_alloc_qp_resc()
1085 ep->qp.sq_virt = in bnx2i_alloc_qp_resc()
1086 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_alloc_qp_resc()
1087 &ep->qp.sq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1088 if (!ep->qp.sq_virt) { in bnx2i_alloc_qp_resc()
1090 ep->qp.sq_mem_size); in bnx2i_alloc_qp_resc()
1094 memset(ep->qp.sq_virt, 0x00, ep->qp.sq_mem_size); in bnx2i_alloc_qp_resc()
1095 ep->qp.sq_first_qe = ep->qp.sq_virt; in bnx2i_alloc_qp_resc()
1096 ep->qp.sq_prod_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1097 ep->qp.sq_cons_qe = ep->qp.sq_first_qe; in bnx2i_alloc_qp_resc()
1098 ep->qp.sq_last_qe = &ep->qp.sq_first_qe[hba->max_sqes - 1]; in bnx2i_alloc_qp_resc()
1099 ep->qp.sq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1100 ep->qp.sq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1101 ep->qp.sqe_left = hba->max_sqes; in bnx2i_alloc_qp_resc()
1104 ep->qp.cq_mem_size = hba->max_cqes * BNX2I_CQE_SIZE; in bnx2i_alloc_qp_resc()
1105 ep->qp.cq_mem_size = in bnx2i_alloc_qp_resc()
1106 (ep->qp.cq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1107 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1108 (ep->qp.cq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1109 ep->qp.cq_pgtbl_size = in bnx2i_alloc_qp_resc()
1110 (ep->qp.cq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1112 ep->qp.cq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1113 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_alloc_qp_resc()
1114 &ep->qp.cq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1115 if (!ep->qp.cq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1117 ep->qp.cq_pgtbl_size); in bnx2i_alloc_qp_resc()
1122 ep->qp.cq_virt = in bnx2i_alloc_qp_resc()
1123 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_alloc_qp_resc()
1124 &ep->qp.cq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1125 if (!ep->qp.cq_virt) { in bnx2i_alloc_qp_resc()
1127 ep->qp.cq_mem_size); in bnx2i_alloc_qp_resc()
1130 memset(ep->qp.cq_virt, 0x00, ep->qp.cq_mem_size); in bnx2i_alloc_qp_resc()
1132 ep->qp.cq_first_qe = ep->qp.cq_virt; in bnx2i_alloc_qp_resc()
1133 ep->qp.cq_prod_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1134 ep->qp.cq_cons_qe = ep->qp.cq_first_qe; in bnx2i_alloc_qp_resc()
1135 ep->qp.cq_last_qe = &ep->qp.cq_first_qe[hba->max_cqes - 1]; in bnx2i_alloc_qp_resc()
1136 ep->qp.cq_prod_idx = 0; in bnx2i_alloc_qp_resc()
1137 ep->qp.cq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1138 ep->qp.cqe_left = hba->max_cqes; in bnx2i_alloc_qp_resc()
1139 ep->qp.cqe_exp_seq_sn = ISCSI_INITIAL_SN; in bnx2i_alloc_qp_resc()
1140 ep->qp.cqe_size = hba->max_cqes; in bnx2i_alloc_qp_resc()
1143 cq_db = (struct bnx2i_5771x_cq_db *) ep->qp.cq_pgtbl_virt; in bnx2i_alloc_qp_resc()
1147 ep->qp.rq_mem_size = hba->max_rqes * BNX2I_RQ_WQE_SIZE; in bnx2i_alloc_qp_resc()
1148 ep->qp.rq_mem_size = in bnx2i_alloc_qp_resc()
1149 (ep->qp.rq_mem_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1150 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1151 (ep->qp.rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2i_alloc_qp_resc()
1152 ep->qp.rq_pgtbl_size = in bnx2i_alloc_qp_resc()
1153 (ep->qp.rq_pgtbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2i_alloc_qp_resc()
1155 ep->qp.rq_pgtbl_virt = in bnx2i_alloc_qp_resc()
1156 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_alloc_qp_resc()
1157 &ep->qp.rq_pgtbl_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1158 if (!ep->qp.rq_pgtbl_virt) { in bnx2i_alloc_qp_resc()
1160 ep->qp.rq_pgtbl_size); in bnx2i_alloc_qp_resc()
1165 ep->qp.rq_virt = in bnx2i_alloc_qp_resc()
1166 dma_alloc_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_alloc_qp_resc()
1167 &ep->qp.rq_phys, GFP_KERNEL); in bnx2i_alloc_qp_resc()
1168 if (!ep->qp.rq_virt) { in bnx2i_alloc_qp_resc()
1170 ep->qp.rq_mem_size); in bnx2i_alloc_qp_resc()
1174 ep->qp.rq_first_qe = ep->qp.rq_virt; in bnx2i_alloc_qp_resc()
1175 ep->qp.rq_prod_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1176 ep->qp.rq_cons_qe = ep->qp.rq_first_qe; in bnx2i_alloc_qp_resc()
1177 ep->qp.rq_last_qe = &ep->qp.rq_first_qe[hba->max_rqes - 1]; in bnx2i_alloc_qp_resc()
1178 ep->qp.rq_prod_idx = 0x8000; in bnx2i_alloc_qp_resc()
1179 ep->qp.rq_cons_idx = 0; in bnx2i_alloc_qp_resc()
1180 ep->qp.rqe_left = hba->max_rqes; in bnx2i_alloc_qp_resc()
1182 setup_qp_page_tables(ep); in bnx2i_alloc_qp_resc()
1187 bnx2i_free_qp_resc(hba, ep); in bnx2i_alloc_qp_resc()
1200 void bnx2i_free_qp_resc(struct bnx2i_hba *hba, struct bnx2i_endpoint *ep) in bnx2i_free_qp_resc() argument
1202 if (ep->qp.ctx_base) { in bnx2i_free_qp_resc()
1203 iounmap(ep->qp.ctx_base); in bnx2i_free_qp_resc()
1204 ep->qp.ctx_base = NULL; in bnx2i_free_qp_resc()
1207 if (ep->qp.sq_pgtbl_virt) { in bnx2i_free_qp_resc()
1208 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_pgtbl_size, in bnx2i_free_qp_resc()
1209 ep->qp.sq_pgtbl_virt, ep->qp.sq_pgtbl_phys); in bnx2i_free_qp_resc()
1210 ep->qp.sq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1211 ep->qp.sq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1213 if (ep->qp.sq_virt) { in bnx2i_free_qp_resc()
1214 dma_free_coherent(&hba->pcidev->dev, ep->qp.sq_mem_size, in bnx2i_free_qp_resc()
1215 ep->qp.sq_virt, ep->qp.sq_phys); in bnx2i_free_qp_resc()
1216 ep->qp.sq_virt = NULL; in bnx2i_free_qp_resc()
1217 ep->qp.sq_phys = 0; in bnx2i_free_qp_resc()
1221 if (ep->qp.rq_pgtbl_virt) { in bnx2i_free_qp_resc()
1222 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_pgtbl_size, in bnx2i_free_qp_resc()
1223 ep->qp.rq_pgtbl_virt, ep->qp.rq_pgtbl_phys); in bnx2i_free_qp_resc()
1224 ep->qp.rq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1225 ep->qp.rq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1227 if (ep->qp.rq_virt) { in bnx2i_free_qp_resc()
1228 dma_free_coherent(&hba->pcidev->dev, ep->qp.rq_mem_size, in bnx2i_free_qp_resc()
1229 ep->qp.rq_virt, ep->qp.rq_phys); in bnx2i_free_qp_resc()
1230 ep->qp.rq_virt = NULL; in bnx2i_free_qp_resc()
1231 ep->qp.rq_phys = 0; in bnx2i_free_qp_resc()
1235 if (ep->qp.cq_pgtbl_virt) { in bnx2i_free_qp_resc()
1236 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_pgtbl_size, in bnx2i_free_qp_resc()
1237 ep->qp.cq_pgtbl_virt, ep->qp.cq_pgtbl_phys); in bnx2i_free_qp_resc()
1238 ep->qp.cq_pgtbl_virt = NULL; in bnx2i_free_qp_resc()
1239 ep->qp.cq_pgtbl_phys = 0; in bnx2i_free_qp_resc()
1241 if (ep->qp.cq_virt) { in bnx2i_free_qp_resc()
1242 dma_free_coherent(&hba->pcidev->dev, ep->qp.cq_mem_size, in bnx2i_free_qp_resc()
1243 ep->qp.cq_virt, ep->qp.cq_phys); in bnx2i_free_qp_resc()
1244 ep->qp.cq_virt = NULL; in bnx2i_free_qp_resc()
1245 ep->qp.cq_phys = 0; in bnx2i_free_qp_resc()
1650 bnx2i_conn->ep->state = EP_STATE_LOGOUT_RESP_RCVD; in bnx2i_process_logout_resp()
1986 if (bnx2i_conn->ep == NULL) in bnx2i_process_new_cqes()
1989 qp = &bnx2i_conn->ep->qp; in bnx2i_process_new_cqes()
2069 if (!atomic_read(&bnx2i_conn->ep->num_active_cmds)) in bnx2i_process_new_cqes()
2075 atomic_dec(&bnx2i_conn->ep->num_active_cmds); in bnx2i_process_new_cqes()
2121 if (!bnx2i_conn->ep) { in bnx2i_fastpath_notification()
2127 nxt_idx = bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, in bnx2i_fastpath_notification()
2130 bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE_FP); in bnx2i_fastpath_notification()
2154 if (!conn->ep) { in bnx2i_process_update_conn_cmpl()
2161 conn->ep->state = EP_STATE_ULP_UPDATE_FAILED; in bnx2i_process_update_conn_cmpl()
2163 conn->ep->state = EP_STATE_ULP_UPDATE_COMPL; in bnx2i_process_update_conn_cmpl()
2165 wake_up_interruptible(&conn->ep->ofld_wait); in bnx2i_process_update_conn_cmpl()
2392 bnx2i_conn, bnx2i_conn->ep->ep_iscsi_cid, in bnx2i_process_iscsi_error()
2393 bnx2i_conn->ep->ep_cid); in bnx2i_process_iscsi_error()
2415 struct bnx2i_endpoint *ep; in bnx2i_process_conn_destroy_cmpl() local
2417 ep = bnx2i_find_ep_in_destroy_list(hba, conn_destroy->iscsi_conn_id); in bnx2i_process_conn_destroy_cmpl()
2418 if (!ep) { in bnx2i_process_conn_destroy_cmpl()
2424 if (hba != ep->hba) { in bnx2i_process_conn_destroy_cmpl()
2431 ep->state = EP_STATE_CLEANUP_FAILED; in bnx2i_process_conn_destroy_cmpl()
2433 ep->state = EP_STATE_CLEANUP_CMPL; in bnx2i_process_conn_destroy_cmpl()
2434 wake_up_interruptible(&ep->ofld_wait); in bnx2i_process_conn_destroy_cmpl()
2450 struct bnx2i_endpoint *ep; in bnx2i_process_ofld_cmpl() local
2453 ep = bnx2i_find_ep_in_ofld_list(hba, ofld_kcqe->iscsi_conn_id); in bnx2i_process_ofld_cmpl()
2454 if (!ep) { in bnx2i_process_ofld_cmpl()
2459 if (hba != ep->hba) { in bnx2i_process_ofld_cmpl()
2465 ep->state = EP_STATE_OFLD_FAILED; in bnx2i_process_ofld_cmpl()
2478 ep->state = EP_STATE_OFLD_FAILED_CID_BUSY; in bnx2i_process_ofld_cmpl()
2484 ep->state = EP_STATE_OFLD_COMPL; in bnx2i_process_ofld_cmpl()
2486 cid_num = bnx2i_get_cid_num(ep); in bnx2i_process_ofld_cmpl()
2487 ep->ep_cid = cid_addr; in bnx2i_process_ofld_cmpl()
2488 ep->qp.ctx_base = NULL; in bnx2i_process_ofld_cmpl()
2490 wake_up_interruptible(&ep->ofld_wait); in bnx2i_process_ofld_cmpl()
2596 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_connect_cmpl() local
2598 if (test_bit(ADAPTER_STATE_GOING_DOWN, &ep->hba->adapter_state)) in bnx2i_cm_connect_cmpl()
2599 ep->state = EP_STATE_CONNECT_FAILED; in bnx2i_cm_connect_cmpl()
2601 ep->state = EP_STATE_CONNECT_COMPL; in bnx2i_cm_connect_cmpl()
2603 ep->state = EP_STATE_CONNECT_FAILED; in bnx2i_cm_connect_cmpl()
2605 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_connect_cmpl()
2618 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_close_cmpl() local
2620 ep->state = EP_STATE_DISCONN_COMPL; in bnx2i_cm_close_cmpl()
2621 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_close_cmpl()
2634 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_abort_cmpl() local
2636 ep->state = EP_STATE_DISCONN_COMPL; in bnx2i_cm_abort_cmpl()
2637 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_abort_cmpl()
2651 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_remote_close() local
2653 ep->state = EP_STATE_TCP_FIN_RCVD; in bnx2i_cm_remote_close()
2654 if (ep->conn) in bnx2i_cm_remote_close()
2655 bnx2i_recovery_que_add_conn(ep->hba, ep->conn); in bnx2i_cm_remote_close()
2668 struct bnx2i_endpoint *ep = (struct bnx2i_endpoint *) cm_sk->context; in bnx2i_cm_remote_abort() local
2669 u32 old_state = ep->state; in bnx2i_cm_remote_abort()
2671 ep->state = EP_STATE_TCP_RST_RCVD; in bnx2i_cm_remote_abort()
2673 wake_up_interruptible(&ep->ofld_wait); in bnx2i_cm_remote_abort()
2675 if (ep->conn) in bnx2i_cm_remote_abort()
2676 bnx2i_recovery_que_add_conn(ep->hba, ep->conn); in bnx2i_cm_remote_abort()
2729 int bnx2i_map_ep_dbell_regs(struct bnx2i_endpoint *ep) in bnx2i_map_ep_dbell_regs() argument
2738 cid_num = bnx2i_get_cid_num(ep); in bnx2i_map_ep_dbell_regs()
2740 if (test_bit(BNX2I_NX2_DEV_57710, &ep->hba->cnic_dev_type)) { in bnx2i_map_ep_dbell_regs()
2741 reg_base = pci_resource_start(ep->hba->pcidev, in bnx2i_map_ep_dbell_regs()
2744 ep->qp.ctx_base = ioremap_nocache(reg_base + reg_off, 4); in bnx2i_map_ep_dbell_regs()
2748 if ((test_bit(BNX2I_NX2_DEV_5709, &ep->hba->cnic_dev_type)) && in bnx2i_map_ep_dbell_regs()
2749 (ep->hba->mail_queue_access == BNX2I_MQ_BIN_MODE)) { in bnx2i_map_ep_dbell_regs()
2750 config2 = REG_RD(ep->hba, BNX2_MQ_CONFIG2); in bnx2i_map_ep_dbell_regs()
2763 ep->qp.ctx_base = ioremap_nocache(ep->hba->reg_base + reg_off, in bnx2i_map_ep_dbell_regs()
2765 if (!ep->qp.ctx_base) in bnx2i_map_ep_dbell_regs()
2769 bnx2i_arm_cq_event_coalescing(ep, CNIC_ARM_CQE); in bnx2i_map_ep_dbell_regs()