Lines Matching refs:tgt

171 					struct bnx2fc_rport *tgt)  in bnx2fc_send_session_ofld_req()  argument
182 struct fc_rport_priv *rdata = tgt->rdata; in bnx2fc_send_session_ofld_req()
183 struct fc_rport *rport = tgt->rport; in bnx2fc_send_session_ofld_req()
197 conn_id = (u16)tgt->fcoe_conn_id; in bnx2fc_send_session_ofld_req()
201 ofld_req1.sq_addr_lo = (u32) tgt->sq_dma; in bnx2fc_send_session_ofld_req()
202 ofld_req1.sq_addr_hi = (u32)((u64) tgt->sq_dma >> 32); in bnx2fc_send_session_ofld_req()
204 ofld_req1.rq_pbl_addr_lo = (u32) tgt->rq_pbl_dma; in bnx2fc_send_session_ofld_req()
205 ofld_req1.rq_pbl_addr_hi = (u32)((u64) tgt->rq_pbl_dma >> 32); in bnx2fc_send_session_ofld_req()
207 ofld_req1.rq_first_pbe_addr_lo = (u32) tgt->rq_dma; in bnx2fc_send_session_ofld_req()
209 (u32)((u64) tgt->rq_dma >> 32); in bnx2fc_send_session_ofld_req()
222 ofld_req2.cq_addr_lo = (u32) tgt->cq_dma; in bnx2fc_send_session_ofld_req()
223 ofld_req2.cq_addr_hi = (u32)((u64)tgt->cq_dma >> 32); in bnx2fc_send_session_ofld_req()
225 ofld_req2.xferq_addr_lo = (u32) tgt->xferq_dma; in bnx2fc_send_session_ofld_req()
226 ofld_req2.xferq_addr_hi = (u32)((u64)tgt->xferq_dma >> 32); in bnx2fc_send_session_ofld_req()
228 ofld_req2.conn_db_addr_lo = (u32)tgt->conn_db_dma; in bnx2fc_send_session_ofld_req()
229 ofld_req2.conn_db_addr_hi = (u32)((u64)tgt->conn_db_dma >> 32); in bnx2fc_send_session_ofld_req()
253 tgt->sid = port_id; in bnx2fc_send_session_ofld_req()
272 ofld_req3.confq_first_pbe_addr_lo = tgt->confq_dma; in bnx2fc_send_session_ofld_req()
273 ofld_req3.confq_first_pbe_addr_hi = (u32)((u64) tgt->confq_dma >> 32); in bnx2fc_send_session_ofld_req()
292 if (tgt->dev_type == TYPE_TAPE) { in bnx2fc_send_session_ofld_req()
331 ofld_req4.lcq_addr_lo = (u32) tgt->lcq_dma; in bnx2fc_send_session_ofld_req()
332 ofld_req4.lcq_addr_hi = (u32)((u64) tgt->lcq_dma >> 32); in bnx2fc_send_session_ofld_req()
334 ofld_req4.confq_pbl_base_addr_lo = (u32) tgt->confq_pbl_dma; in bnx2fc_send_session_ofld_req()
336 (u32)((u64) tgt->confq_pbl_dma >> 32); in bnx2fc_send_session_ofld_req()
356 struct bnx2fc_rport *tgt) in bnx2fc_send_session_enable_req() argument
364 struct fc_rport *rport = tgt->rport; in bnx2fc_send_session_enable_req()
382 memcpy(tgt->src_addr, port->data_src_addr, ETH_ALEN); in bnx2fc_send_session_enable_req()
392 if (port_id != tgt->sid) { in bnx2fc_send_session_enable_req()
394 "sid = 0x%x\n", port_id, tgt->sid); in bnx2fc_send_session_enable_req()
395 port_id = tgt->sid; in bnx2fc_send_session_enable_req()
409 enbl_req.context_id = tgt->context_id; in bnx2fc_send_session_enable_req()
410 enbl_req.conn_id = tgt->fcoe_conn_id; in bnx2fc_send_session_enable_req()
426 struct bnx2fc_rport *tgt) in bnx2fc_send_session_disable_req() argument
433 struct fc_rport *rport = tgt->rport; in bnx2fc_send_session_disable_req()
444 disable_req.src_mac_addr_lo[0] = tgt->src_addr[5]; in bnx2fc_send_session_disable_req()
445 disable_req.src_mac_addr_lo[1] = tgt->src_addr[4]; in bnx2fc_send_session_disable_req()
446 disable_req.src_mac_addr_mid[0] = tgt->src_addr[3]; in bnx2fc_send_session_disable_req()
447 disable_req.src_mac_addr_mid[1] = tgt->src_addr[2]; in bnx2fc_send_session_disable_req()
448 disable_req.src_mac_addr_hi[0] = tgt->src_addr[1]; in bnx2fc_send_session_disable_req()
449 disable_req.src_mac_addr_hi[1] = tgt->src_addr[0]; in bnx2fc_send_session_disable_req()
458 port_id = tgt->sid; in bnx2fc_send_session_disable_req()
468 disable_req.context_id = tgt->context_id; in bnx2fc_send_session_disable_req()
469 disable_req.conn_id = tgt->fcoe_conn_id; in bnx2fc_send_session_disable_req()
491 struct bnx2fc_rport *tgt) in bnx2fc_send_session_destroy_req() argument
503 destroy_req.context_id = tgt->context_id; in bnx2fc_send_session_destroy_req()
504 destroy_req.conn_id = tgt->fcoe_conn_id; in bnx2fc_send_session_destroy_req()
547 void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt, in bnx2fc_process_l2_frame_compl() argument
551 struct fcoe_port *port = tgt->port; in bnx2fc_process_l2_frame_compl()
565 BNX2FC_TGT_DBG(tgt, "Unable to allocate unsol_work\n"); in bnx2fc_process_l2_frame_compl()
569 BNX2FC_TGT_DBG(tgt, "l2_frame_compl l2_oxid = 0x%x, frame_len = %d\n", in bnx2fc_process_l2_frame_compl()
625 static void bnx2fc_process_unsol_compl(struct bnx2fc_rport *tgt, u16 wqe) in bnx2fc_process_unsol_compl() argument
636 struct bnx2fc_interface *interface = tgt->port->priv; in bnx2fc_process_unsol_compl()
644 BNX2FC_TGT_DBG(tgt, "Entered UNSOL COMPLETION wqe = 0x%x\n", wqe); in bnx2fc_process_unsol_compl()
652 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
653 rq_data = (unsigned char *)bnx2fc_get_next_rqe(tgt, num_rq); in bnx2fc_process_unsol_compl()
654 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
663 BNX2FC_TGT_DBG(tgt, "Memory alloc failure\n"); in bnx2fc_process_unsol_compl()
668 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
670 bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
671 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
677 bnx2fc_process_l2_frame_compl(tgt, buf, frame_len, in bnx2fc_process_unsol_compl()
682 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
683 bnx2fc_return_rqe(tgt, num_rq); in bnx2fc_process_unsol_compl()
684 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
692 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
695 bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
697 BNX2FC_TGT_DBG(tgt, "Unsol Error Frame OX_ID = 0x%x\n", xid); in bnx2fc_process_unsol_compl()
698 BNX2FC_TGT_DBG(tgt, "err_warn_bitmap = %08x:%08x\n", in bnx2fc_process_unsol_compl()
701 BNX2FC_TGT_DBG(tgt, "buf_offsets - tx = 0x%x, rx = 0x%x\n", in bnx2fc_process_unsol_compl()
706 BNX2FC_TGT_DBG(tgt, "xid(0x%x) out of FW range\n", in bnx2fc_process_unsol_compl()
755 BNX2FC_TGT_DBG(tgt, "err = 0x%x\n", err_warn); in bnx2fc_process_unsol_compl()
756 if (tgt->dev_type != TYPE_TAPE) in bnx2fc_process_unsol_compl()
765 BNX2FC_TGT_DBG(tgt, "REC TOV popped for xid - 0x%x\n", in bnx2fc_process_unsol_compl()
771 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
773 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
802 bnx2fc_return_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
803 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
811 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
814 bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
816 BNX2FC_TGT_DBG(tgt, "Unsol Warning Frame OX_ID = 0x%x\n", xid); in bnx2fc_process_unsol_compl()
817 BNX2FC_TGT_DBG(tgt, "err_warn_bitmap = %08x:%08x", in bnx2fc_process_unsol_compl()
820 BNX2FC_TGT_DBG(tgt, "buf_offsets - tx = 0x%x, rx = 0x%x", in bnx2fc_process_unsol_compl()
824 BNX2FC_TGT_DBG(tgt, "xid(0x%x) out of FW range\n", xid); in bnx2fc_process_unsol_compl()
837 BNX2FC_TGT_DBG(tgt, "warn = 0x%x\n", err_warn); in bnx2fc_process_unsol_compl()
860 BNX2FC_TGT_DBG(tgt, "Unsolicited warning\n"); in bnx2fc_process_unsol_compl()
862 bnx2fc_return_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
863 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
872 void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe) in bnx2fc_process_cq_compl() argument
876 struct fcoe_port *port = tgt->port; in bnx2fc_process_cq_compl()
886 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
890 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
906 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
922 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
980 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
983 void bnx2fc_arm_cq(struct bnx2fc_rport *tgt) in bnx2fc_arm_cq() argument
985 struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; in bnx2fc_arm_cq()
989 rx_db->doorbell_cq_cons = tgt->cq_cons_idx | (tgt->cq_curr_toggle_bit << in bnx2fc_arm_cq()
992 writel(cpu_to_le32(msg), tgt->ctx_base); in bnx2fc_arm_cq()
997 struct bnx2fc_work *bnx2fc_alloc_work(struct bnx2fc_rport *tgt, u16 wqe) in bnx2fc_alloc_work() argument
1005 work->tgt = tgt; in bnx2fc_alloc_work()
1010 int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt) in bnx2fc_process_new_cqes() argument
1024 spin_lock_bh(&tgt->cq_lock); in bnx2fc_process_new_cqes()
1026 if (!tgt->cq) { in bnx2fc_process_new_cqes()
1028 spin_unlock_bh(&tgt->cq_lock); in bnx2fc_process_new_cqes()
1031 cq = tgt->cq; in bnx2fc_process_new_cqes()
1032 cq_cons = tgt->cq_cons_idx; in bnx2fc_process_new_cqes()
1036 (tgt->cq_curr_toggle_bit << in bnx2fc_process_new_cqes()
1042 bnx2fc_process_unsol_compl(tgt, wqe); in bnx2fc_process_new_cqes()
1054 work = bnx2fc_alloc_work(tgt, wqe); in bnx2fc_process_new_cqes()
1065 bnx2fc_process_cq_compl(tgt, wqe); in bnx2fc_process_new_cqes()
1069 tgt->cq_cons_idx++; in bnx2fc_process_new_cqes()
1072 if (tgt->cq_cons_idx == BNX2FC_CQ_WQES_MAX) { in bnx2fc_process_new_cqes()
1073 tgt->cq_cons_idx = 0; in bnx2fc_process_new_cqes()
1075 tgt->cq_curr_toggle_bit = in bnx2fc_process_new_cqes()
1076 1 - tgt->cq_curr_toggle_bit; in bnx2fc_process_new_cqes()
1081 if (tgt->ctx_base) in bnx2fc_process_new_cqes()
1082 bnx2fc_arm_cq(tgt); in bnx2fc_process_new_cqes()
1083 atomic_add(num_free_sqes, &tgt->free_sqes); in bnx2fc_process_new_cqes()
1085 spin_unlock_bh(&tgt->cq_lock); in bnx2fc_process_new_cqes()
1101 struct bnx2fc_rport *tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_fastpath_notification() local
1103 if (!tgt) { in bnx2fc_fastpath_notification()
1108 bnx2fc_process_new_cqes(tgt); in bnx2fc_fastpath_notification()
1123 struct bnx2fc_rport *tgt; in bnx2fc_process_ofld_cmpl() local
1131 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_ofld_cmpl()
1132 if (!tgt) { in bnx2fc_process_ofld_cmpl()
1136 BNX2FC_TGT_DBG(tgt, "Entered ofld compl - context_id = 0x%x\n", in bnx2fc_process_ofld_cmpl()
1138 port = tgt->port; in bnx2fc_process_ofld_cmpl()
1139 interface = tgt->port->priv; in bnx2fc_process_ofld_cmpl()
1148 tgt->context_id = context_id; in bnx2fc_process_ofld_cmpl()
1154 set_bit(BNX2FC_FLAG_CTX_ALLOC_FAILURE, &tgt->flags); in bnx2fc_process_ofld_cmpl()
1158 set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_process_ofld_cmpl()
1161 set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_process_ofld_cmpl()
1162 wake_up_interruptible(&tgt->ofld_wait); in bnx2fc_process_ofld_cmpl()
1177 struct bnx2fc_rport *tgt; in bnx2fc_process_enable_conn_cmpl() local
1184 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_enable_conn_cmpl()
1185 if (!tgt) { in bnx2fc_process_enable_conn_cmpl()
1190 BNX2FC_TGT_DBG(tgt, "Enable compl - context_id = 0x%x\n", in bnx2fc_process_enable_conn_cmpl()
1197 if (tgt->context_id != context_id) { in bnx2fc_process_enable_conn_cmpl()
1201 interface = tgt->port->priv; in bnx2fc_process_enable_conn_cmpl()
1208 set_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_process_enable_conn_cmpl()
1211 set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_process_enable_conn_cmpl()
1212 wake_up_interruptible(&tgt->ofld_wait); in bnx2fc_process_enable_conn_cmpl()
1219 struct bnx2fc_rport *tgt; in bnx2fc_process_conn_disable_cmpl() local
1223 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_conn_disable_cmpl()
1224 if (!tgt) { in bnx2fc_process_conn_disable_cmpl()
1229 BNX2FC_TGT_DBG(tgt, PFX "disable_cmpl: conn_id %d\n", conn_id); in bnx2fc_process_conn_disable_cmpl()
1234 set_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1235 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1236 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_process_conn_disable_cmpl()
1239 BNX2FC_TGT_DBG(tgt, "disable successful\n"); in bnx2fc_process_conn_disable_cmpl()
1240 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1241 clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1242 set_bit(BNX2FC_FLAG_DISABLED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1243 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1244 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_process_conn_disable_cmpl()
1251 struct bnx2fc_rport *tgt; in bnx2fc_process_conn_destroy_cmpl() local
1255 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_conn_destroy_cmpl()
1256 if (!tgt) { in bnx2fc_process_conn_destroy_cmpl()
1261 BNX2FC_TGT_DBG(tgt, "destroy_cmpl: conn_id %d\n", conn_id); in bnx2fc_process_conn_destroy_cmpl()
1269 BNX2FC_TGT_DBG(tgt, "upload successful\n"); in bnx2fc_process_conn_destroy_cmpl()
1270 clear_bit(BNX2FC_FLAG_DISABLED, &tgt->flags); in bnx2fc_process_conn_destroy_cmpl()
1271 set_bit(BNX2FC_FLAG_DESTROYED, &tgt->flags); in bnx2fc_process_conn_destroy_cmpl()
1272 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_process_conn_destroy_cmpl()
1273 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_process_conn_destroy_cmpl()
1383 void bnx2fc_add_2_sq(struct bnx2fc_rport *tgt, u16 xid) in bnx2fc_add_2_sq() argument
1387 sqe = &tgt->sq[tgt->sq_prod_idx]; in bnx2fc_add_2_sq()
1391 sqe->wqe |= tgt->sq_curr_toggle_bit << FCOE_SQE_TOGGLE_BIT_SHIFT; in bnx2fc_add_2_sq()
1394 if (++tgt->sq_prod_idx == BNX2FC_SQ_WQES_MAX) { in bnx2fc_add_2_sq()
1395 tgt->sq_prod_idx = 0; in bnx2fc_add_2_sq()
1396 tgt->sq_curr_toggle_bit = 1 - tgt->sq_curr_toggle_bit; in bnx2fc_add_2_sq()
1400 void bnx2fc_ring_doorbell(struct bnx2fc_rport *tgt) in bnx2fc_ring_doorbell() argument
1402 struct b577xx_doorbell_set_prod *sq_db = &tgt->sq_db; in bnx2fc_ring_doorbell()
1406 sq_db->prod = tgt->sq_prod_idx | in bnx2fc_ring_doorbell()
1407 (tgt->sq_curr_toggle_bit << 15); in bnx2fc_ring_doorbell()
1409 writel(cpu_to_le32(msg), tgt->ctx_base); in bnx2fc_ring_doorbell()
1414 int bnx2fc_map_doorbell(struct bnx2fc_rport *tgt) in bnx2fc_map_doorbell() argument
1416 u32 context_id = tgt->context_id; in bnx2fc_map_doorbell()
1417 struct fcoe_port *port = tgt->port; in bnx2fc_map_doorbell()
1426 tgt->ctx_base = ioremap_nocache(reg_base + reg_off, 4); in bnx2fc_map_doorbell()
1427 if (!tgt->ctx_base) in bnx2fc_map_doorbell()
1432 char *bnx2fc_get_next_rqe(struct bnx2fc_rport *tgt, u8 num_items) in bnx2fc_get_next_rqe() argument
1434 char *buf = (char *)tgt->rq + (tgt->rq_cons_idx * BNX2FC_RQ_BUF_SZ); in bnx2fc_get_next_rqe()
1436 if (tgt->rq_cons_idx + num_items > BNX2FC_RQ_WQES_MAX) in bnx2fc_get_next_rqe()
1439 tgt->rq_cons_idx += num_items; in bnx2fc_get_next_rqe()
1441 if (tgt->rq_cons_idx >= BNX2FC_RQ_WQES_MAX) in bnx2fc_get_next_rqe()
1442 tgt->rq_cons_idx -= BNX2FC_RQ_WQES_MAX; in bnx2fc_get_next_rqe()
1447 void bnx2fc_return_rqe(struct bnx2fc_rport *tgt, u8 num_items) in bnx2fc_return_rqe() argument
1450 u32 next_prod_idx = tgt->rq_prod_idx + num_items; in bnx2fc_return_rqe()
1455 tgt->rq_prod_idx = next_prod_idx; in bnx2fc_return_rqe()
1456 tgt->conn_db->rq_prod = tgt->rq_prod_idx; in bnx2fc_return_rqe()
1465 struct bnx2fc_rport *tgt = seq_clnp_req->tgt; in bnx2fc_init_seq_cleanup_task() local
1466 struct bnx2fc_interface *interface = tgt->port->priv; in bnx2fc_init_seq_cleanup_task()
1474 u32 context_id = tgt->context_id; in bnx2fc_init_seq_cleanup_task()
1554 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_init_cleanup_task() local
1555 u32 context_id = tgt->context_id; in bnx2fc_init_cleanup_task()
1565 if (tgt->dev_type == TYPE_TAPE) in bnx2fc_init_cleanup_task()
1591 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_init_mp_task() local
1630 if (tgt->dev_type == TYPE_TAPE) in bnx2fc_init_mp_task()
1652 context_id = tgt->context_id; in bnx2fc_init_mp_task()
1689 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_init_task() local
1692 int dev_type = tgt->dev_type; in bnx2fc_init_task()
1777 context_id = tgt->context_id; in bnx2fc_init_task()