• Home
  • Raw
  • Download

Lines Matching refs:tgt

172 					struct bnx2fc_rport *tgt)  in bnx2fc_send_session_ofld_req()  argument
183 struct fc_rport_priv *rdata = tgt->rdata; in bnx2fc_send_session_ofld_req()
184 struct fc_rport *rport = tgt->rport; in bnx2fc_send_session_ofld_req()
198 conn_id = (u16)tgt->fcoe_conn_id; in bnx2fc_send_session_ofld_req()
202 ofld_req1.sq_addr_lo = (u32) tgt->sq_dma; in bnx2fc_send_session_ofld_req()
203 ofld_req1.sq_addr_hi = (u32)((u64) tgt->sq_dma >> 32); in bnx2fc_send_session_ofld_req()
205 ofld_req1.rq_pbl_addr_lo = (u32) tgt->rq_pbl_dma; in bnx2fc_send_session_ofld_req()
206 ofld_req1.rq_pbl_addr_hi = (u32)((u64) tgt->rq_pbl_dma >> 32); in bnx2fc_send_session_ofld_req()
208 ofld_req1.rq_first_pbe_addr_lo = (u32) tgt->rq_dma; in bnx2fc_send_session_ofld_req()
210 (u32)((u64) tgt->rq_dma >> 32); in bnx2fc_send_session_ofld_req()
223 ofld_req2.cq_addr_lo = (u32) tgt->cq_dma; in bnx2fc_send_session_ofld_req()
224 ofld_req2.cq_addr_hi = (u32)((u64)tgt->cq_dma >> 32); in bnx2fc_send_session_ofld_req()
226 ofld_req2.xferq_addr_lo = (u32) tgt->xferq_dma; in bnx2fc_send_session_ofld_req()
227 ofld_req2.xferq_addr_hi = (u32)((u64)tgt->xferq_dma >> 32); in bnx2fc_send_session_ofld_req()
229 ofld_req2.conn_db_addr_lo = (u32)tgt->conn_db_dma; in bnx2fc_send_session_ofld_req()
230 ofld_req2.conn_db_addr_hi = (u32)((u64)tgt->conn_db_dma >> 32); in bnx2fc_send_session_ofld_req()
254 tgt->sid = port_id; in bnx2fc_send_session_ofld_req()
273 ofld_req3.confq_first_pbe_addr_lo = tgt->confq_dma; in bnx2fc_send_session_ofld_req()
274 ofld_req3.confq_first_pbe_addr_hi = (u32)((u64) tgt->confq_dma >> 32); in bnx2fc_send_session_ofld_req()
293 if (tgt->dev_type == TYPE_TAPE) { in bnx2fc_send_session_ofld_req()
332 ofld_req4.lcq_addr_lo = (u32) tgt->lcq_dma; in bnx2fc_send_session_ofld_req()
333 ofld_req4.lcq_addr_hi = (u32)((u64) tgt->lcq_dma >> 32); in bnx2fc_send_session_ofld_req()
335 ofld_req4.confq_pbl_base_addr_lo = (u32) tgt->confq_pbl_dma; in bnx2fc_send_session_ofld_req()
337 (u32)((u64) tgt->confq_pbl_dma >> 32); in bnx2fc_send_session_ofld_req()
357 struct bnx2fc_rport *tgt) in bnx2fc_send_session_enable_req() argument
365 struct fc_rport *rport = tgt->rport; in bnx2fc_send_session_enable_req()
383 memcpy(tgt->src_addr, port->data_src_addr, ETH_ALEN); in bnx2fc_send_session_enable_req()
393 if (port_id != tgt->sid) { in bnx2fc_send_session_enable_req()
395 "sid = 0x%x\n", port_id, tgt->sid); in bnx2fc_send_session_enable_req()
396 port_id = tgt->sid; in bnx2fc_send_session_enable_req()
410 enbl_req.context_id = tgt->context_id; in bnx2fc_send_session_enable_req()
411 enbl_req.conn_id = tgt->fcoe_conn_id; in bnx2fc_send_session_enable_req()
427 struct bnx2fc_rport *tgt) in bnx2fc_send_session_disable_req() argument
434 struct fc_rport *rport = tgt->rport; in bnx2fc_send_session_disable_req()
445 disable_req.src_mac_addr_lo[0] = tgt->src_addr[5]; in bnx2fc_send_session_disable_req()
446 disable_req.src_mac_addr_lo[1] = tgt->src_addr[4]; in bnx2fc_send_session_disable_req()
447 disable_req.src_mac_addr_mid[0] = tgt->src_addr[3]; in bnx2fc_send_session_disable_req()
448 disable_req.src_mac_addr_mid[1] = tgt->src_addr[2]; in bnx2fc_send_session_disable_req()
449 disable_req.src_mac_addr_hi[0] = tgt->src_addr[1]; in bnx2fc_send_session_disable_req()
450 disable_req.src_mac_addr_hi[1] = tgt->src_addr[0]; in bnx2fc_send_session_disable_req()
459 port_id = tgt->sid; in bnx2fc_send_session_disable_req()
469 disable_req.context_id = tgt->context_id; in bnx2fc_send_session_disable_req()
470 disable_req.conn_id = tgt->fcoe_conn_id; in bnx2fc_send_session_disable_req()
492 struct bnx2fc_rport *tgt) in bnx2fc_send_session_destroy_req() argument
504 destroy_req.context_id = tgt->context_id; in bnx2fc_send_session_destroy_req()
505 destroy_req.conn_id = tgt->fcoe_conn_id; in bnx2fc_send_session_destroy_req()
548 void bnx2fc_process_l2_frame_compl(struct bnx2fc_rport *tgt, in bnx2fc_process_l2_frame_compl() argument
552 struct fcoe_port *port = tgt->port; in bnx2fc_process_l2_frame_compl()
566 BNX2FC_TGT_DBG(tgt, "Unable to allocate unsol_work\n"); in bnx2fc_process_l2_frame_compl()
570 BNX2FC_TGT_DBG(tgt, "l2_frame_compl l2_oxid = 0x%x, frame_len = %d\n", in bnx2fc_process_l2_frame_compl()
626 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()
643 BNX2FC_TGT_DBG(tgt, "Entered UNSOL COMPLETION wqe = 0x%x\n", wqe); in bnx2fc_process_unsol_compl()
651 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
652 rq_data = (unsigned char *)bnx2fc_get_next_rqe(tgt, num_rq); in bnx2fc_process_unsol_compl()
653 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
662 BNX2FC_TGT_DBG(tgt, "Memory alloc failure\n"); in bnx2fc_process_unsol_compl()
667 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
669 bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
670 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
676 bnx2fc_process_l2_frame_compl(tgt, buf, frame_len, in bnx2fc_process_unsol_compl()
681 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
682 bnx2fc_return_rqe(tgt, num_rq); in bnx2fc_process_unsol_compl()
683 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
691 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
694 bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
696 BNX2FC_TGT_DBG(tgt, "Unsol Error Frame OX_ID = 0x%x\n", xid); in bnx2fc_process_unsol_compl()
697 BNX2FC_TGT_DBG(tgt, "err_warn_bitmap = %08x:%08x\n", in bnx2fc_process_unsol_compl()
700 BNX2FC_TGT_DBG(tgt, "buf_offsets - tx = 0x%x, rx = 0x%x\n", in bnx2fc_process_unsol_compl()
704 BNX2FC_TGT_DBG(tgt, "xid(0x%x) out of FW range\n", in bnx2fc_process_unsol_compl()
748 BNX2FC_TGT_DBG(tgt, "err = 0x%x\n", err_warn); in bnx2fc_process_unsol_compl()
749 if (tgt->dev_type != TYPE_TAPE) in bnx2fc_process_unsol_compl()
758 BNX2FC_TGT_DBG(tgt, "REC TOV popped for xid - 0x%x\n", in bnx2fc_process_unsol_compl()
764 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
766 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
795 bnx2fc_return_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
796 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
804 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
807 bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
809 BNX2FC_TGT_DBG(tgt, "Unsol Warning Frame OX_ID = 0x%x\n", xid); in bnx2fc_process_unsol_compl()
810 BNX2FC_TGT_DBG(tgt, "err_warn_bitmap = %08x:%08x", in bnx2fc_process_unsol_compl()
813 BNX2FC_TGT_DBG(tgt, "buf_offsets - tx = 0x%x, rx = 0x%x", in bnx2fc_process_unsol_compl()
817 BNX2FC_TGT_DBG(tgt, "xid(0x%x) out of FW range\n", xid); in bnx2fc_process_unsol_compl()
830 BNX2FC_TGT_DBG(tgt, "warn = 0x%x\n", err_warn); in bnx2fc_process_unsol_compl()
848 BNX2FC_TGT_DBG(tgt, "Unsolicited warning\n"); in bnx2fc_process_unsol_compl()
850 bnx2fc_return_rqe(tgt, 1); in bnx2fc_process_unsol_compl()
851 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_unsol_compl()
860 void bnx2fc_process_cq_compl(struct bnx2fc_rport *tgt, u16 wqe, in bnx2fc_process_cq_compl() argument
864 struct fcoe_port *port = tgt->port; in bnx2fc_process_cq_compl()
873 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
880 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
897 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
955 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_process_cq_compl()
958 void bnx2fc_arm_cq(struct bnx2fc_rport *tgt) in bnx2fc_arm_cq() argument
960 struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; in bnx2fc_arm_cq()
964 rx_db->doorbell_cq_cons = tgt->cq_cons_idx | (tgt->cq_curr_toggle_bit << in bnx2fc_arm_cq()
967 writel(cpu_to_le32(msg), tgt->ctx_base); in bnx2fc_arm_cq()
971 static struct bnx2fc_work *bnx2fc_alloc_work(struct bnx2fc_rport *tgt, u16 wqe, in bnx2fc_alloc_work() argument
981 work->tgt = tgt; in bnx2fc_alloc_work()
992 static bool bnx2fc_pending_work(struct bnx2fc_rport *tgt, unsigned int wqe) in bnx2fc_pending_work() argument
999 struct fcoe_port *port = tgt->port; in bnx2fc_pending_work()
1029 rq_data = bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_pending_work()
1034 bnx2fc_get_next_rqe(tgt, 1); in bnx2fc_pending_work()
1042 bnx2fc_return_rqe(tgt, 1); in bnx2fc_pending_work()
1049 work = bnx2fc_alloc_work(tgt, wqe, rq_data_buff, in bnx2fc_pending_work()
1059 bnx2fc_process_cq_compl(tgt, wqe, in bnx2fc_pending_work()
1065 int bnx2fc_process_new_cqes(struct bnx2fc_rport *tgt) in bnx2fc_process_new_cqes() argument
1079 spin_lock_bh(&tgt->cq_lock); in bnx2fc_process_new_cqes()
1081 if (!tgt->cq) { in bnx2fc_process_new_cqes()
1083 spin_unlock_bh(&tgt->cq_lock); in bnx2fc_process_new_cqes()
1086 cq = tgt->cq; in bnx2fc_process_new_cqes()
1087 cq_cons = tgt->cq_cons_idx; in bnx2fc_process_new_cqes()
1091 (tgt->cq_curr_toggle_bit << in bnx2fc_process_new_cqes()
1097 bnx2fc_process_unsol_compl(tgt, wqe); in bnx2fc_process_new_cqes()
1099 if (bnx2fc_pending_work(tgt, wqe)) in bnx2fc_process_new_cqes()
1103 tgt->cq_cons_idx++; in bnx2fc_process_new_cqes()
1106 if (tgt->cq_cons_idx == BNX2FC_CQ_WQES_MAX) { in bnx2fc_process_new_cqes()
1107 tgt->cq_cons_idx = 0; in bnx2fc_process_new_cqes()
1109 tgt->cq_curr_toggle_bit = in bnx2fc_process_new_cqes()
1110 1 - tgt->cq_curr_toggle_bit; in bnx2fc_process_new_cqes()
1115 if (tgt->ctx_base) in bnx2fc_process_new_cqes()
1116 bnx2fc_arm_cq(tgt); in bnx2fc_process_new_cqes()
1117 atomic_add(num_free_sqes, &tgt->free_sqes); in bnx2fc_process_new_cqes()
1119 spin_unlock_bh(&tgt->cq_lock); in bnx2fc_process_new_cqes()
1135 struct bnx2fc_rport *tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_fastpath_notification() local
1137 if (!tgt) { in bnx2fc_fastpath_notification()
1142 bnx2fc_process_new_cqes(tgt); in bnx2fc_fastpath_notification()
1157 struct bnx2fc_rport *tgt; in bnx2fc_process_ofld_cmpl() local
1164 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_ofld_cmpl()
1165 if (!tgt) { in bnx2fc_process_ofld_cmpl()
1169 BNX2FC_TGT_DBG(tgt, "Entered ofld compl - context_id = 0x%x\n", in bnx2fc_process_ofld_cmpl()
1171 interface = tgt->port->priv; in bnx2fc_process_ofld_cmpl()
1180 tgt->context_id = context_id; in bnx2fc_process_ofld_cmpl()
1186 set_bit(BNX2FC_FLAG_CTX_ALLOC_FAILURE, &tgt->flags); in bnx2fc_process_ofld_cmpl()
1190 set_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_process_ofld_cmpl()
1193 set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_process_ofld_cmpl()
1194 wake_up_interruptible(&tgt->ofld_wait); in bnx2fc_process_ofld_cmpl()
1209 struct bnx2fc_rport *tgt; in bnx2fc_process_enable_conn_cmpl() local
1216 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_enable_conn_cmpl()
1217 if (!tgt) { in bnx2fc_process_enable_conn_cmpl()
1222 BNX2FC_TGT_DBG(tgt, "Enable compl - context_id = 0x%x\n", in bnx2fc_process_enable_conn_cmpl()
1229 if (tgt->context_id != context_id) { in bnx2fc_process_enable_conn_cmpl()
1233 interface = tgt->port->priv; in bnx2fc_process_enable_conn_cmpl()
1240 set_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_process_enable_conn_cmpl()
1243 set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_process_enable_conn_cmpl()
1244 wake_up_interruptible(&tgt->ofld_wait); in bnx2fc_process_enable_conn_cmpl()
1251 struct bnx2fc_rport *tgt; in bnx2fc_process_conn_disable_cmpl() local
1255 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_conn_disable_cmpl()
1256 if (!tgt) { in bnx2fc_process_conn_disable_cmpl()
1261 BNX2FC_TGT_DBG(tgt, PFX "disable_cmpl: conn_id %d\n", conn_id); in bnx2fc_process_conn_disable_cmpl()
1266 set_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1267 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1268 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_process_conn_disable_cmpl()
1271 BNX2FC_TGT_DBG(tgt, "disable successful\n"); in bnx2fc_process_conn_disable_cmpl()
1272 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1273 clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1274 set_bit(BNX2FC_FLAG_DISABLED, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1275 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_process_conn_disable_cmpl()
1276 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_process_conn_disable_cmpl()
1283 struct bnx2fc_rport *tgt; in bnx2fc_process_conn_destroy_cmpl() local
1287 tgt = hba->tgt_ofld_list[conn_id]; in bnx2fc_process_conn_destroy_cmpl()
1288 if (!tgt) { in bnx2fc_process_conn_destroy_cmpl()
1293 BNX2FC_TGT_DBG(tgt, "destroy_cmpl: conn_id %d\n", conn_id); in bnx2fc_process_conn_destroy_cmpl()
1301 BNX2FC_TGT_DBG(tgt, "upload successful\n"); in bnx2fc_process_conn_destroy_cmpl()
1302 clear_bit(BNX2FC_FLAG_DISABLED, &tgt->flags); in bnx2fc_process_conn_destroy_cmpl()
1303 set_bit(BNX2FC_FLAG_DESTROYED, &tgt->flags); in bnx2fc_process_conn_destroy_cmpl()
1304 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_process_conn_destroy_cmpl()
1305 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_process_conn_destroy_cmpl()
1414 void bnx2fc_add_2_sq(struct bnx2fc_rport *tgt, u16 xid) in bnx2fc_add_2_sq() argument
1418 sqe = &tgt->sq[tgt->sq_prod_idx]; in bnx2fc_add_2_sq()
1422 sqe->wqe |= tgt->sq_curr_toggle_bit << FCOE_SQE_TOGGLE_BIT_SHIFT; in bnx2fc_add_2_sq()
1425 if (++tgt->sq_prod_idx == BNX2FC_SQ_WQES_MAX) { in bnx2fc_add_2_sq()
1426 tgt->sq_prod_idx = 0; in bnx2fc_add_2_sq()
1427 tgt->sq_curr_toggle_bit = 1 - tgt->sq_curr_toggle_bit; in bnx2fc_add_2_sq()
1431 void bnx2fc_ring_doorbell(struct bnx2fc_rport *tgt) in bnx2fc_ring_doorbell() argument
1433 struct b577xx_doorbell_set_prod *sq_db = &tgt->sq_db; in bnx2fc_ring_doorbell()
1437 sq_db->prod = tgt->sq_prod_idx | in bnx2fc_ring_doorbell()
1438 (tgt->sq_curr_toggle_bit << 15); in bnx2fc_ring_doorbell()
1440 writel(cpu_to_le32(msg), tgt->ctx_base); in bnx2fc_ring_doorbell()
1444 int bnx2fc_map_doorbell(struct bnx2fc_rport *tgt) in bnx2fc_map_doorbell() argument
1446 u32 context_id = tgt->context_id; in bnx2fc_map_doorbell()
1447 struct fcoe_port *port = tgt->port; in bnx2fc_map_doorbell()
1456 tgt->ctx_base = ioremap(reg_base + reg_off, 4); in bnx2fc_map_doorbell()
1457 if (!tgt->ctx_base) in bnx2fc_map_doorbell()
1462 char *bnx2fc_get_next_rqe(struct bnx2fc_rport *tgt, u8 num_items) in bnx2fc_get_next_rqe() argument
1464 char *buf = (char *)tgt->rq + (tgt->rq_cons_idx * BNX2FC_RQ_BUF_SZ); in bnx2fc_get_next_rqe()
1466 if (tgt->rq_cons_idx + num_items > BNX2FC_RQ_WQES_MAX) in bnx2fc_get_next_rqe()
1469 tgt->rq_cons_idx += num_items; in bnx2fc_get_next_rqe()
1471 if (tgt->rq_cons_idx >= BNX2FC_RQ_WQES_MAX) in bnx2fc_get_next_rqe()
1472 tgt->rq_cons_idx -= BNX2FC_RQ_WQES_MAX; in bnx2fc_get_next_rqe()
1477 void bnx2fc_return_rqe(struct bnx2fc_rport *tgt, u8 num_items) in bnx2fc_return_rqe() argument
1480 u32 next_prod_idx = tgt->rq_prod_idx + num_items; in bnx2fc_return_rqe()
1485 tgt->rq_prod_idx = next_prod_idx; in bnx2fc_return_rqe()
1486 tgt->conn_db->rq_prod = tgt->rq_prod_idx; in bnx2fc_return_rqe()
1495 struct bnx2fc_rport *tgt = seq_clnp_req->tgt; in bnx2fc_init_seq_cleanup_task() local
1501 u32 context_id = tgt->context_id; in bnx2fc_init_seq_cleanup_task()
1574 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_init_cleanup_task() local
1575 u32 context_id = tgt->context_id; in bnx2fc_init_cleanup_task()
1585 if (tgt->dev_type == TYPE_TAPE) in bnx2fc_init_cleanup_task()
1611 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_init_mp_task() local
1650 if (tgt->dev_type == TYPE_TAPE) in bnx2fc_init_mp_task()
1672 context_id = tgt->context_id; in bnx2fc_init_mp_task()
1709 struct bnx2fc_rport *tgt = io_req->tgt; in bnx2fc_init_task() local
1712 int dev_type = tgt->dev_type; in bnx2fc_init_task()
1797 context_id = tgt->context_id; in bnx2fc_init_task()