Lines Matching refs:tgt
19 static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
23 struct bnx2fc_rport *tgt);
25 struct bnx2fc_rport *tgt);
27 struct bnx2fc_rport *tgt);
33 struct bnx2fc_rport *tgt = from_timer(tgt, t, upld_timer); in bnx2fc_upld_timer() local
35 BNX2FC_TGT_DBG(tgt, "upld_timer - Upload compl not received!!\n"); in bnx2fc_upld_timer()
37 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_upld_timer()
38 clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_upld_timer()
39 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_upld_timer()
40 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_upld_timer()
46 struct bnx2fc_rport *tgt = from_timer(tgt, t, ofld_timer); in bnx2fc_ofld_timer() local
48 BNX2FC_TGT_DBG(tgt, "entered bnx2fc_ofld_timer\n"); in bnx2fc_ofld_timer()
60 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_ofld_timer()
61 clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_ofld_timer()
62 set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_ofld_timer()
63 wake_up_interruptible(&tgt->ofld_wait); in bnx2fc_ofld_timer()
66 static void bnx2fc_ofld_wait(struct bnx2fc_rport *tgt) in bnx2fc_ofld_wait() argument
68 timer_setup(&tgt->ofld_timer, bnx2fc_ofld_timer, 0); in bnx2fc_ofld_wait()
69 mod_timer(&tgt->ofld_timer, jiffies + BNX2FC_FW_TIMEOUT); in bnx2fc_ofld_wait()
71 wait_event_interruptible(tgt->ofld_wait, in bnx2fc_ofld_wait()
74 &tgt->flags))); in bnx2fc_ofld_wait()
77 del_timer_sync(&tgt->ofld_timer); in bnx2fc_ofld_wait()
81 struct bnx2fc_rport *tgt, in bnx2fc_offload_session() argument
92 rval = bnx2fc_init_tgt(tgt, port, rdata); in bnx2fc_offload_session()
100 rval = bnx2fc_alloc_session_resc(hba, tgt); in bnx2fc_offload_session()
112 clear_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_offload_session()
113 rval = bnx2fc_send_session_ofld_req(port, tgt); in bnx2fc_offload_session()
123 bnx2fc_ofld_wait(tgt); in bnx2fc_offload_session()
125 if (!(test_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags))) { in bnx2fc_offload_session()
127 &tgt->flags)) { in bnx2fc_offload_session()
128 BNX2FC_TGT_DBG(tgt, "ctx_alloc_failure, " in bnx2fc_offload_session()
137 if (bnx2fc_map_doorbell(tgt)) { in bnx2fc_offload_session()
141 clear_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_offload_session()
142 rval = bnx2fc_send_session_enable_req(port, tgt); in bnx2fc_offload_session()
147 bnx2fc_ofld_wait(tgt); in bnx2fc_offload_session()
148 if (!(test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags))) in bnx2fc_offload_session()
154 BNX2FC_TGT_DBG(tgt, "bnx2fc_offload_session - offload error\n"); in bnx2fc_offload_session()
155 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_offload_session()
157 bnx2fc_free_session_resc(hba, tgt); in bnx2fc_offload_session()
159 if (tgt->fcoe_conn_id != -1) in bnx2fc_offload_session()
160 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id); in bnx2fc_offload_session()
164 void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt) in bnx2fc_flush_active_ios() argument
170 BNX2FC_TGT_DBG(tgt, "Entered flush_active_ios - %d\n", in bnx2fc_flush_active_ios()
171 tgt->num_active_ios.counter); in bnx2fc_flush_active_ios()
173 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
174 tgt->flush_in_prog = 1; in bnx2fc_flush_active_ios()
176 list_for_each_entry_safe(io_req, tmp, &tgt->active_cmd_queue, link) { in bnx2fc_flush_active_ios()
198 if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags)) in bnx2fc_flush_active_ios()
206 list_for_each_entry_safe(io_req, tmp, &tgt->active_tm_queue, link) { in bnx2fc_flush_active_ios()
215 list_for_each_entry_safe(io_req, tmp, &tgt->els_queue, link) { in bnx2fc_flush_active_ios()
232 if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags)) in bnx2fc_flush_active_ios()
240 list_for_each_entry_safe(io_req, tmp, &tgt->io_retire_queue, link) { in bnx2fc_flush_active_ios()
261 BNX2FC_TGT_DBG(tgt, "IOs flushed = %d\n", i); in bnx2fc_flush_active_ios()
263 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
265 while ((tgt->num_active_ios.counter != 0) && (i++ < BNX2FC_WAIT_CNT)) in bnx2fc_flush_active_ios()
267 if (tgt->num_active_ios.counter != 0) in bnx2fc_flush_active_ios()
270 tgt->rdata->ids.port_id, tgt->num_active_ios.counter); in bnx2fc_flush_active_ios()
271 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
272 tgt->flush_in_prog = 0; in bnx2fc_flush_active_ios()
273 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
276 static void bnx2fc_upld_wait(struct bnx2fc_rport *tgt) in bnx2fc_upld_wait() argument
278 timer_setup(&tgt->upld_timer, bnx2fc_upld_timer, 0); in bnx2fc_upld_wait()
279 mod_timer(&tgt->upld_timer, jiffies + BNX2FC_FW_TIMEOUT); in bnx2fc_upld_wait()
280 wait_event_interruptible(tgt->upld_wait, in bnx2fc_upld_wait()
283 &tgt->flags))); in bnx2fc_upld_wait()
286 del_timer_sync(&tgt->upld_timer); in bnx2fc_upld_wait()
290 struct bnx2fc_rport *tgt) in bnx2fc_upload_session() argument
295 BNX2FC_TGT_DBG(tgt, "upload_session: active_ios = %d\n", in bnx2fc_upload_session()
296 tgt->num_active_ios.counter); in bnx2fc_upload_session()
302 clear_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_upload_session()
303 bnx2fc_send_session_disable_req(port, tgt); in bnx2fc_upload_session()
309 BNX2FC_TGT_DBG(tgt, "waiting for disable compl\n"); in bnx2fc_upload_session()
310 bnx2fc_upld_wait(tgt); in bnx2fc_upload_session()
316 BNX2FC_TGT_DBG(tgt, "flush/upload - disable wait flags = 0x%lx\n", in bnx2fc_upload_session()
317 tgt->flags); in bnx2fc_upload_session()
318 bnx2fc_flush_active_ios(tgt); in bnx2fc_upload_session()
321 if (test_bit(BNX2FC_FLAG_DISABLED, &tgt->flags)) { in bnx2fc_upload_session()
322 BNX2FC_TGT_DBG(tgt, "send destroy req\n"); in bnx2fc_upload_session()
323 clear_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_upload_session()
324 bnx2fc_send_session_destroy_req(hba, tgt); in bnx2fc_upload_session()
327 bnx2fc_upld_wait(tgt); in bnx2fc_upload_session()
329 if (!(test_bit(BNX2FC_FLAG_DESTROYED, &tgt->flags))) in bnx2fc_upload_session()
332 BNX2FC_TGT_DBG(tgt, "destroy wait complete flags = 0x%lx\n", in bnx2fc_upload_session()
333 tgt->flags); in bnx2fc_upload_session()
335 } else if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags)) { in bnx2fc_upload_session()
344 bnx2fc_free_session_resc(hba, tgt); in bnx2fc_upload_session()
345 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id); in bnx2fc_upload_session()
348 static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, in bnx2fc_init_tgt() argument
356 struct b577xx_doorbell_set_prod *sq_db = &tgt->sq_db; in bnx2fc_init_tgt()
357 struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; in bnx2fc_init_tgt()
359 tgt->rport = rport; in bnx2fc_init_tgt()
360 tgt->rdata = rdata; in bnx2fc_init_tgt()
361 tgt->port = port; in bnx2fc_init_tgt()
364 BNX2FC_TGT_DBG(tgt, "exceeded max sessions. logoff this tgt\n"); in bnx2fc_init_tgt()
365 tgt->fcoe_conn_id = -1; in bnx2fc_init_tgt()
369 tgt->fcoe_conn_id = bnx2fc_alloc_conn_id(hba, tgt); in bnx2fc_init_tgt()
370 if (tgt->fcoe_conn_id == -1) in bnx2fc_init_tgt()
373 BNX2FC_TGT_DBG(tgt, "init_tgt - conn_id = 0x%x\n", tgt->fcoe_conn_id); in bnx2fc_init_tgt()
375 tgt->max_sqes = BNX2FC_SQ_WQES_MAX; in bnx2fc_init_tgt()
376 tgt->max_rqes = BNX2FC_RQ_WQES_MAX; in bnx2fc_init_tgt()
377 tgt->max_cqes = BNX2FC_CQ_WQES_MAX; in bnx2fc_init_tgt()
378 atomic_set(&tgt->free_sqes, BNX2FC_SQ_WQES_MAX); in bnx2fc_init_tgt()
381 tgt->sq_curr_toggle_bit = 1; in bnx2fc_init_tgt()
382 tgt->cq_curr_toggle_bit = 1; in bnx2fc_init_tgt()
383 tgt->sq_prod_idx = 0; in bnx2fc_init_tgt()
384 tgt->cq_cons_idx = 0; in bnx2fc_init_tgt()
385 tgt->rq_prod_idx = 0x8000; in bnx2fc_init_tgt()
386 tgt->rq_cons_idx = 0; in bnx2fc_init_tgt()
387 atomic_set(&tgt->num_active_ios, 0); in bnx2fc_init_tgt()
388 tgt->retry_delay_timestamp = 0; in bnx2fc_init_tgt()
393 tgt->dev_type = TYPE_TAPE; in bnx2fc_init_tgt()
394 tgt->io_timeout = 0; /* use default ULP timeout */ in bnx2fc_init_tgt()
396 tgt->dev_type = TYPE_DISK; in bnx2fc_init_tgt()
397 tgt->io_timeout = BNX2FC_IO_TIMEOUT; in bnx2fc_init_tgt()
412 spin_lock_init(&tgt->tgt_lock); in bnx2fc_init_tgt()
413 spin_lock_init(&tgt->cq_lock); in bnx2fc_init_tgt()
416 INIT_LIST_HEAD(&tgt->active_cmd_queue); in bnx2fc_init_tgt()
419 INIT_LIST_HEAD(&tgt->io_retire_queue); in bnx2fc_init_tgt()
421 INIT_LIST_HEAD(&tgt->els_queue); in bnx2fc_init_tgt()
424 INIT_LIST_HEAD(&tgt->active_tm_queue); in bnx2fc_init_tgt()
426 init_waitqueue_head(&tgt->ofld_wait); in bnx2fc_init_tgt()
427 init_waitqueue_head(&tgt->upld_wait); in bnx2fc_init_tgt()
446 struct bnx2fc_rport *tgt; in bnx2fc_rport_event_handler() local
487 tgt = (struct bnx2fc_rport *)&rp[1]; in bnx2fc_rport_event_handler()
490 if (test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags)) { in bnx2fc_rport_event_handler()
491 BNX2FC_TGT_DBG(tgt, "already offloaded\n"); in bnx2fc_rport_event_handler()
500 bnx2fc_offload_session(port, tgt, rdata); in bnx2fc_rport_event_handler()
502 BNX2FC_TGT_DBG(tgt, "OFFLOAD num_ofld_sess = %d\n", in bnx2fc_rport_event_handler()
505 if (test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags)) { in bnx2fc_rport_event_handler()
507 BNX2FC_TGT_DBG(tgt, "sess offloaded\n"); in bnx2fc_rport_event_handler()
511 set_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags); in bnx2fc_rport_event_handler()
518 BNX2FC_TGT_DBG(tgt, "Port is being logged off as " in bnx2fc_rport_event_handler()
541 tgt = (struct bnx2fc_rport *)&rp[1]; in bnx2fc_rport_event_handler()
543 if (!(test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags))) { in bnx2fc_rport_event_handler()
547 clear_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags); in bnx2fc_rport_event_handler()
549 bnx2fc_upload_session(port, tgt); in bnx2fc_rport_event_handler()
551 BNX2FC_TGT_DBG(tgt, "UPLOAD num_ofld_sess = %d\n", in bnx2fc_rport_event_handler()
581 struct bnx2fc_rport *tgt; in bnx2fc_tgt_lookup() local
586 tgt = hba->tgt_ofld_list[i]; in bnx2fc_tgt_lookup()
587 if ((tgt) && (tgt->port == port)) { in bnx2fc_tgt_lookup()
588 rdata = tgt->rdata; in bnx2fc_tgt_lookup()
591 BNX2FC_TGT_DBG(tgt, "rport " in bnx2fc_tgt_lookup()
593 return tgt; in bnx2fc_tgt_lookup()
595 BNX2FC_TGT_DBG(tgt, "rport 0x%x " in bnx2fc_tgt_lookup()
614 struct bnx2fc_rport *tgt) in bnx2fc_alloc_conn_id() argument
643 hba->tgt_ofld_list[conn_id] = tgt; in bnx2fc_alloc_conn_id()
644 tgt->fcoe_conn_id = conn_id; in bnx2fc_alloc_conn_id()
661 struct bnx2fc_rport *tgt) in bnx2fc_alloc_session_resc() argument
668 tgt->sq_mem_size = tgt->max_sqes * BNX2FC_SQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
669 tgt->sq_mem_size = (tgt->sq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
672 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_alloc_session_resc()
673 &tgt->sq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
674 if (!tgt->sq) { in bnx2fc_alloc_session_resc()
676 tgt->sq_mem_size); in bnx2fc_alloc_session_resc()
681 tgt->cq_mem_size = tgt->max_cqes * BNX2FC_CQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
682 tgt->cq_mem_size = (tgt->cq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
685 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_alloc_session_resc()
686 &tgt->cq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
687 if (!tgt->cq) { in bnx2fc_alloc_session_resc()
689 tgt->cq_mem_size); in bnx2fc_alloc_session_resc()
694 tgt->rq_mem_size = tgt->max_rqes * BNX2FC_RQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
695 tgt->rq_mem_size = (tgt->rq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
698 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_alloc_session_resc()
699 &tgt->rq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
700 if (!tgt->rq) { in bnx2fc_alloc_session_resc()
702 tgt->rq_mem_size); in bnx2fc_alloc_session_resc()
706 tgt->rq_pbl_size = (tgt->rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2fc_alloc_session_resc()
707 tgt->rq_pbl_size = (tgt->rq_pbl_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
710 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_alloc_session_resc()
711 &tgt->rq_pbl_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
712 if (!tgt->rq_pbl) { in bnx2fc_alloc_session_resc()
714 tgt->rq_pbl_size); in bnx2fc_alloc_session_resc()
718 num_pages = tgt->rq_mem_size / CNIC_PAGE_SIZE; in bnx2fc_alloc_session_resc()
719 page = tgt->rq_dma; in bnx2fc_alloc_session_resc()
720 pbl = (u32 *)tgt->rq_pbl; in bnx2fc_alloc_session_resc()
731 tgt->xferq_mem_size = tgt->max_sqes * BNX2FC_XFERQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
732 tgt->xferq_mem_size = (tgt->xferq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
735 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
736 tgt->xferq_mem_size, &tgt->xferq_dma, in bnx2fc_alloc_session_resc()
738 if (!tgt->xferq) { in bnx2fc_alloc_session_resc()
740 tgt->xferq_mem_size); in bnx2fc_alloc_session_resc()
745 tgt->confq_mem_size = tgt->max_sqes * BNX2FC_CONFQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
746 tgt->confq_mem_size = (tgt->confq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
749 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
750 tgt->confq_mem_size, &tgt->confq_dma, in bnx2fc_alloc_session_resc()
752 if (!tgt->confq) { in bnx2fc_alloc_session_resc()
754 tgt->confq_mem_size); in bnx2fc_alloc_session_resc()
758 tgt->confq_pbl_size = in bnx2fc_alloc_session_resc()
759 (tgt->confq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2fc_alloc_session_resc()
760 tgt->confq_pbl_size = in bnx2fc_alloc_session_resc()
761 (tgt->confq_pbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2fc_alloc_session_resc()
763 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
764 tgt->confq_pbl_size, in bnx2fc_alloc_session_resc()
765 &tgt->confq_pbl_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
766 if (!tgt->confq_pbl) { in bnx2fc_alloc_session_resc()
768 tgt->confq_pbl_size); in bnx2fc_alloc_session_resc()
772 num_pages = tgt->confq_mem_size / CNIC_PAGE_SIZE; in bnx2fc_alloc_session_resc()
773 page = tgt->confq_dma; in bnx2fc_alloc_session_resc()
774 pbl = (u32 *)tgt->confq_pbl; in bnx2fc_alloc_session_resc()
785 tgt->conn_db_mem_size = sizeof(struct fcoe_conn_db); in bnx2fc_alloc_session_resc()
787 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
788 tgt->conn_db_mem_size, in bnx2fc_alloc_session_resc()
789 &tgt->conn_db_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
790 if (!tgt->conn_db) { in bnx2fc_alloc_session_resc()
792 tgt->conn_db_mem_size); in bnx2fc_alloc_session_resc()
798 tgt->lcq_mem_size = (tgt->max_sqes + 8) * BNX2FC_SQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
799 tgt->lcq_mem_size = (tgt->lcq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
802 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_alloc_session_resc()
803 &tgt->lcq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
805 if (!tgt->lcq) { in bnx2fc_alloc_session_resc()
807 tgt->lcq_mem_size); in bnx2fc_alloc_session_resc()
811 tgt->conn_db->rq_prod = 0x8000; in bnx2fc_alloc_session_resc()
828 struct bnx2fc_rport *tgt) in bnx2fc_free_session_resc() argument
832 BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n"); in bnx2fc_free_session_resc()
834 ctx_base_ptr = tgt->ctx_base; in bnx2fc_free_session_resc()
835 tgt->ctx_base = NULL; in bnx2fc_free_session_resc()
838 if (tgt->lcq) { in bnx2fc_free_session_resc()
839 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_free_session_resc()
840 tgt->lcq, tgt->lcq_dma); in bnx2fc_free_session_resc()
841 tgt->lcq = NULL; in bnx2fc_free_session_resc()
844 if (tgt->conn_db) { in bnx2fc_free_session_resc()
845 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size, in bnx2fc_free_session_resc()
846 tgt->conn_db, tgt->conn_db_dma); in bnx2fc_free_session_resc()
847 tgt->conn_db = NULL; in bnx2fc_free_session_resc()
850 if (tgt->confq_pbl) { in bnx2fc_free_session_resc()
851 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size, in bnx2fc_free_session_resc()
852 tgt->confq_pbl, tgt->confq_pbl_dma); in bnx2fc_free_session_resc()
853 tgt->confq_pbl = NULL; in bnx2fc_free_session_resc()
855 if (tgt->confq) { in bnx2fc_free_session_resc()
856 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size, in bnx2fc_free_session_resc()
857 tgt->confq, tgt->confq_dma); in bnx2fc_free_session_resc()
858 tgt->confq = NULL; in bnx2fc_free_session_resc()
861 if (tgt->xferq) { in bnx2fc_free_session_resc()
862 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, in bnx2fc_free_session_resc()
863 tgt->xferq, tgt->xferq_dma); in bnx2fc_free_session_resc()
864 tgt->xferq = NULL; in bnx2fc_free_session_resc()
867 if (tgt->rq_pbl) { in bnx2fc_free_session_resc()
868 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_free_session_resc()
869 tgt->rq_pbl, tgt->rq_pbl_dma); in bnx2fc_free_session_resc()
870 tgt->rq_pbl = NULL; in bnx2fc_free_session_resc()
872 if (tgt->rq) { in bnx2fc_free_session_resc()
873 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_free_session_resc()
874 tgt->rq, tgt->rq_dma); in bnx2fc_free_session_resc()
875 tgt->rq = NULL; in bnx2fc_free_session_resc()
878 if (tgt->cq) { in bnx2fc_free_session_resc()
879 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_free_session_resc()
880 tgt->cq, tgt->cq_dma); in bnx2fc_free_session_resc()
881 tgt->cq = NULL; in bnx2fc_free_session_resc()
884 if (tgt->sq) { in bnx2fc_free_session_resc()
885 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_free_session_resc()
886 tgt->sq, tgt->sq_dma); in bnx2fc_free_session_resc()
887 tgt->sq = NULL; in bnx2fc_free_session_resc()