Lines Matching refs:bnx2i_conn

193 void bnx2i_get_rq_buf(struct bnx2i_conn *bnx2i_conn, char *ptr, int len)  in bnx2i_get_rq_buf()  argument
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()
210 static void bnx2i_ring_577xx_doorbell(struct bnx2i_conn *conn) in bnx2i_ring_577xx_doorbell()
231 void bnx2i_put_rq_buf(struct bnx2i_conn *bnx2i_conn, int count) in bnx2i_put_rq_buf() argument
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()
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()
268 static void bnx2i_ring_sq_dbell(struct bnx2i_conn *bnx2i_conn, int count) in bnx2i_ring_sq_dbell() argument
271 struct bnx2i_endpoint *ep = bnx2i_conn->ep; in bnx2i_ring_sq_dbell()
278 bnx2i_ring_577xx_doorbell(bnx2i_conn); in bnx2i_ring_sq_dbell()
291 static void bnx2i_ring_dbell_update_sq_params(struct bnx2i_conn *bnx2i_conn, in bnx2i_ring_dbell_update_sq_params() argument
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()
329 int bnx2i_send_iscsi_login(struct bnx2i_conn *bnx2i_conn, in bnx2i_send_iscsi_login() argument
338 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_login()
356 login_wqe->resp_bd_list_addr_lo = (u32) bnx2i_conn->gen_pdu.resp_bd_dma; in bnx2i_send_iscsi_login()
358 (u32) ((u64) bnx2i_conn->gen_pdu.resp_bd_dma >> 32); in bnx2i_send_iscsi_login()
361 (bnx2i_conn->gen_pdu.resp_buf_size << in bnx2i_send_iscsi_login()
364 login_wqe->bd_list_addr_lo = (u32) bnx2i_conn->gen_pdu.req_bd_dma; in bnx2i_send_iscsi_login()
366 (u32) ((u64) bnx2i_conn->gen_pdu.req_bd_dma >> 32); in bnx2i_send_iscsi_login()
370 bnx2i_ring_dbell_update_sq_params(bnx2i_conn, 1); in bnx2i_send_iscsi_login()
382 int bnx2i_send_iscsi_tmf(struct bnx2i_conn *bnx2i_conn, in bnx2i_send_iscsi_tmf() argument
385 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_send_iscsi_tmf()
395 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_tmf()
438 tmfabort_wqe->bd_list_addr_lo = (u32) bnx2i_conn->hba->mp_bd_dma; in bnx2i_send_iscsi_tmf()
440 ((u64) bnx2i_conn->hba->mp_bd_dma >> 32); in bnx2i_send_iscsi_tmf()
444 bnx2i_ring_dbell_update_sq_params(bnx2i_conn, 1); in bnx2i_send_iscsi_tmf()
456 int bnx2i_send_iscsi_text(struct bnx2i_conn *bnx2i_conn, in bnx2i_send_iscsi_text() argument
464 text_wqe = (struct bnx2i_text_request *) bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_text()
477 text_wqe->resp_bd_list_addr_lo = (u32) bnx2i_conn->gen_pdu.resp_bd_dma; in bnx2i_send_iscsi_text()
479 (u32) ((u64) bnx2i_conn->gen_pdu.resp_bd_dma >> 32); in bnx2i_send_iscsi_text()
482 (bnx2i_conn->gen_pdu.resp_buf_size << in bnx2i_send_iscsi_text()
485 text_wqe->bd_list_addr_lo = (u32) bnx2i_conn->gen_pdu.req_bd_dma; in bnx2i_send_iscsi_text()
487 (u32) ((u64) bnx2i_conn->gen_pdu.req_bd_dma >> 32); in bnx2i_send_iscsi_text()
491 bnx2i_ring_dbell_update_sq_params(bnx2i_conn, 1); in bnx2i_send_iscsi_text()
504 int bnx2i_send_iscsi_scsicmd(struct bnx2i_conn *bnx2i_conn, in bnx2i_send_iscsi_scsicmd() argument
510 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_scsicmd()
514 bnx2i_ring_dbell_update_sq_params(bnx2i_conn, 1); in bnx2i_send_iscsi_scsicmd()
530 int bnx2i_send_iscsi_nopout(struct bnx2i_conn *bnx2i_conn, in bnx2i_send_iscsi_nopout() argument
534 struct bnx2i_endpoint *ep = bnx2i_conn->ep; in bnx2i_send_iscsi_nopout()
568 bnx2i_conn->hba->mp_bd_dma; in bnx2i_send_iscsi_nopout()
570 (u32) ((u64) bnx2i_conn->hba->mp_bd_dma >> 32); in bnx2i_send_iscsi_nopout()
575 bnx2i_ring_dbell_update_sq_params(bnx2i_conn, 1); in bnx2i_send_iscsi_nopout()
588 int bnx2i_send_iscsi_logout(struct bnx2i_conn *bnx2i_conn, in bnx2i_send_iscsi_logout() argument
597 bnx2i_conn->ep->qp.sq_prod_qe; in bnx2i_send_iscsi_logout()
610 logout_wqe->bd_list_addr_lo = (u32) bnx2i_conn->hba->mp_bd_dma; in bnx2i_send_iscsi_logout()
612 ((u64) bnx2i_conn->hba->mp_bd_dma >> 32); in bnx2i_send_iscsi_logout()
616 bnx2i_conn->ep->state = EP_STATE_LOGOUT_SENT; in bnx2i_send_iscsi_logout()
618 bnx2i_ring_dbell_update_sq_params(bnx2i_conn, 1); in bnx2i_send_iscsi_logout()
631 struct bnx2i_conn *bnx2i_conn = conn->dd_data; in bnx2i_update_iscsi_conn() local
632 struct bnx2i_hba *hba = bnx2i_conn->hba; in bnx2i_update_iscsi_conn()
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()
1337 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_scsi_cmd_resp() argument
1340 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_scsi_cmd_resp()
1341 struct bnx2i_hba *hba = bnx2i_conn->hba; in bnx2i_process_scsi_cmd_resp()
1434 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_login_resp() argument
1437 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_login_resp()
1451 resp_hdr = (struct iscsi_login_rsp *) &bnx2i_conn->gen_pdu.resp_hdr; in bnx2i_process_login_resp()
1469 bnx2i_conn->gen_pdu.resp_wr_ptr = in bnx2i_process_login_resp()
1470 bnx2i_conn->gen_pdu.resp_buf + pld_len; in bnx2i_process_login_resp()
1479 bnx2i_conn->gen_pdu.resp_wr_ptr[0] = 0; in bnx2i_process_login_resp()
1480 bnx2i_conn->gen_pdu.resp_wr_ptr++; in bnx2i_process_login_resp()
1485 bnx2i_conn->gen_pdu.resp_buf, in bnx2i_process_login_resp()
1486 bnx2i_conn->gen_pdu.resp_wr_ptr - bnx2i_conn->gen_pdu.resp_buf); in bnx2i_process_login_resp()
1502 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_text_resp() argument
1505 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_text_resp()
1518 resp_hdr = (struct iscsi_text_rsp *)&bnx2i_conn->gen_pdu.resp_hdr; in bnx2i_process_text_resp()
1531 bnx2i_conn->gen_pdu.resp_wr_ptr = bnx2i_conn->gen_pdu.resp_buf + in bnx2i_process_text_resp()
1540 bnx2i_conn->gen_pdu.resp_wr_ptr[0] = 0; in bnx2i_process_text_resp()
1541 bnx2i_conn->gen_pdu.resp_wr_ptr++; in bnx2i_process_text_resp()
1545 bnx2i_conn->gen_pdu.resp_buf, in bnx2i_process_text_resp()
1546 bnx2i_conn->gen_pdu.resp_wr_ptr - in bnx2i_process_text_resp()
1547 bnx2i_conn->gen_pdu.resp_buf); in bnx2i_process_text_resp()
1563 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_tmf_resp() argument
1566 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_tmf_resp()
1578 resp_hdr = (struct iscsi_tm_rsp *) &bnx2i_conn->gen_pdu.resp_hdr; in bnx2i_process_tmf_resp()
1602 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_logout_resp() argument
1605 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_logout_resp()
1617 resp_hdr = (struct iscsi_logout_rsp *) &bnx2i_conn->gen_pdu.resp_hdr; in bnx2i_process_logout_resp()
1633 bnx2i_conn->ep->state = EP_STATE_LOGOUT_RESP_RCVD; in bnx2i_process_logout_resp()
1648 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_nopin_local_cmpl() argument
1651 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_nopin_local_cmpl()
1672 static void bnx2i_unsol_pdu_adjust_rq(struct bnx2i_conn *bnx2i_conn) in bnx2i_unsol_pdu_adjust_rq() argument
1675 bnx2i_get_rq_buf(bnx2i_conn, dummy_rq_data, 1); in bnx2i_unsol_pdu_adjust_rq()
1676 bnx2i_put_rq_buf(bnx2i_conn, 1); in bnx2i_unsol_pdu_adjust_rq()
1689 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_nopin_mesg() argument
1692 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_nopin_mesg()
1701 hdr = (struct iscsi_nopin *)&bnx2i_conn->gen_pdu.resp_hdr; in bnx2i_process_nopin_mesg()
1709 bnx2i_unsol_pdu_adjust_rq(bnx2i_conn); in bnx2i_process_nopin_mesg()
1741 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_async_mesg() argument
1748 bnx2i_unsol_pdu_adjust_rq(bnx2i_conn); in bnx2i_process_async_mesg()
1754 iscsi_conn_printk(KERN_ALERT, bnx2i_conn->cls_conn->dd_data, in bnx2i_process_async_mesg()
1760 resp_hdr = (struct iscsi_async *) &bnx2i_conn->gen_pdu.resp_hdr; in bnx2i_process_async_mesg()
1776 __iscsi_complete_pdu(bnx2i_conn->cls_conn->dd_data, in bnx2i_process_async_mesg()
1791 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_reject_mesg() argument
1794 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_reject_mesg()
1800 bnx2i_get_rq_buf(bnx2i_conn, conn->data, reject->data_length); in bnx2i_process_reject_mesg()
1801 bnx2i_put_rq_buf(bnx2i_conn, 1); in bnx2i_process_reject_mesg()
1803 bnx2i_unsol_pdu_adjust_rq(bnx2i_conn); in bnx2i_process_reject_mesg()
1806 hdr = (struct iscsi_reject *) &bnx2i_conn->gen_pdu.resp_hdr; in bnx2i_process_reject_mesg()
1828 struct bnx2i_conn *bnx2i_conn, in bnx2i_process_cmd_cleanup_resp() argument
1832 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_cmd_cleanup_resp()
1843 complete(&bnx2i_conn->cmd_cleanup_cmpl); in bnx2i_process_cmd_cleanup_resp()
1870 work->bnx2i_conn, in bnx2i_percpu_io_thread()
1872 atomic_dec(&work->bnx2i_conn->work_cnt); in bnx2i_percpu_io_thread()
1901 struct bnx2i_conn *bnx2i_conn, in bnx2i_queue_scsi_cmd_resp() argument
1911 task = iscsi_itt_to_task(bnx2i_conn->cls_conn->dd_data, in bnx2i_queue_scsi_cmd_resp()
1932 bnx2i_work->bnx2i_conn = bnx2i_conn; in bnx2i_queue_scsi_cmd_resp()
1935 atomic_inc(&bnx2i_conn->work_cnt); in bnx2i_queue_scsi_cmd_resp()
1943 bnx2i_process_scsi_cmd_resp(session, bnx2i_conn, (struct cqe *)cqe); in bnx2i_queue_scsi_cmd_resp()
1955 static int bnx2i_process_new_cqes(struct bnx2i_conn *bnx2i_conn) in bnx2i_process_new_cqes() argument
1957 struct iscsi_conn *conn = bnx2i_conn->cls_conn->dd_data; in bnx2i_process_new_cqes()
1959 struct bnx2i_hba *hba = bnx2i_conn->hba; in bnx2i_process_new_cqes()
1965 if (bnx2i_conn->ep == NULL) in bnx2i_process_new_cqes()
1968 qp = &bnx2i_conn->ep->qp; in bnx2i_process_new_cqes()
1987 bnx2i_unsol_pdu_adjust_rq(bnx2i_conn); in bnx2i_process_new_cqes()
1999 bnx2i_queue_scsi_cmd_resp(session, bnx2i_conn, nopin); in bnx2i_process_new_cqes()
2002 bnx2i_process_login_resp(session, bnx2i_conn, in bnx2i_process_new_cqes()
2006 bnx2i_process_tmf_resp(session, bnx2i_conn, in bnx2i_process_new_cqes()
2010 bnx2i_process_text_resp(session, bnx2i_conn, in bnx2i_process_new_cqes()
2014 bnx2i_process_logout_resp(session, bnx2i_conn, in bnx2i_process_new_cqes()
2018 if (bnx2i_process_nopin_mesg(session, bnx2i_conn, in bnx2i_process_new_cqes()
2023 bnx2i_process_nopin_local_cmpl(session, bnx2i_conn, in bnx2i_process_new_cqes()
2027 bnx2i_process_async_mesg(session, bnx2i_conn, in bnx2i_process_new_cqes()
2032 bnx2i_process_reject_mesg(session, bnx2i_conn, in bnx2i_process_new_cqes()
2036 bnx2i_process_cmd_cleanup_resp(session, bnx2i_conn, 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()
2089 struct bnx2i_conn *bnx2i_conn; in bnx2i_fastpath_notification() local
2094 bnx2i_conn = bnx2i_get_conn_from_id(hba, iscsi_cid); in bnx2i_fastpath_notification()
2096 if (!bnx2i_conn) { in bnx2i_fastpath_notification()
2100 if (!bnx2i_conn->ep) { in bnx2i_fastpath_notification()
2105 bnx2i_process_new_cqes(bnx2i_conn); in bnx2i_fastpath_notification()
2106 nxt_idx = bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, in bnx2i_fastpath_notification()
2108 if (nxt_idx && nxt_idx == bnx2i_process_new_cqes(bnx2i_conn)) in bnx2i_fastpath_notification()
2109 bnx2i_arm_cq_event_coalescing(bnx2i_conn->ep, CNIC_ARM_CQE_FP); in bnx2i_fastpath_notification()
2123 struct bnx2i_conn *conn; in bnx2i_process_update_conn_cmpl()
2156 struct bnx2i_conn *bnx2i_conn) in bnx2i_recovery_que_add_conn() argument
2158 iscsi_conn_failure(bnx2i_conn->cls_conn->dd_data, in bnx2i_recovery_que_add_conn()
2174 struct bnx2i_conn *bnx2i_conn; in bnx2i_process_tcp_error() local
2178 bnx2i_conn = bnx2i_get_conn_from_id(hba, iscsi_cid); in bnx2i_process_tcp_error()
2180 if (!bnx2i_conn) { in bnx2i_process_tcp_error()
2187 bnx2i_recovery_que_add_conn(bnx2i_conn->hba, bnx2i_conn); in bnx2i_process_tcp_error()
2207 struct bnx2i_conn *bnx2i_conn; in bnx2i_process_iscsi_error() local
2215 bnx2i_conn = bnx2i_get_conn_from_id(hba, iscsi_cid); in bnx2i_process_iscsi_error()
2216 if (!bnx2i_conn) { in bnx2i_process_iscsi_error()
2359 bnx2i_conn->cls_conn->dd_data, in bnx2i_process_iscsi_error()
2364 bnx2i_conn->cls_conn->dd_data, in bnx2i_process_iscsi_error()
2367 bnx2i_conn->hba->shost->host_no, in bnx2i_process_iscsi_error()
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()
2370 bnx2i_recovery_que_add_conn(bnx2i_conn->hba, bnx2i_conn); in bnx2i_process_iscsi_error()
2373 (void *) &bnx2i_conn->violation_notified)) in bnx2i_process_iscsi_error()
2375 bnx2i_conn->cls_conn->dd_data, in bnx2i_process_iscsi_error()