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()
139 if (bnx2fc_map_doorbell(tgt)) { in bnx2fc_offload_session()
143 clear_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_offload_session()
144 rval = bnx2fc_send_session_enable_req(port, tgt); in bnx2fc_offload_session()
149 bnx2fc_ofld_wait(tgt); in bnx2fc_offload_session()
150 if (!(test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags))) in bnx2fc_offload_session()
156 BNX2FC_TGT_DBG(tgt, "bnx2fc_offload_session - offload error\n"); in bnx2fc_offload_session()
157 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_offload_session()
159 bnx2fc_free_session_resc(hba, tgt); in bnx2fc_offload_session()
161 if (tgt->fcoe_conn_id != -1) in bnx2fc_offload_session()
162 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id); in bnx2fc_offload_session()
166 void bnx2fc_flush_active_ios(struct bnx2fc_rport *tgt) in bnx2fc_flush_active_ios() argument
172 BNX2FC_TGT_DBG(tgt, "Entered flush_active_ios - %d\n", in bnx2fc_flush_active_ios()
173 tgt->num_active_ios.counter); in bnx2fc_flush_active_ios()
175 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
176 tgt->flush_in_prog = 1; in bnx2fc_flush_active_ios()
178 list_for_each_entry_safe(io_req, tmp, &tgt->active_cmd_queue, link) { in bnx2fc_flush_active_ios()
200 if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags)) in bnx2fc_flush_active_ios()
208 list_for_each_entry_safe(io_req, tmp, &tgt->active_tm_queue, link) { in bnx2fc_flush_active_ios()
217 list_for_each_entry_safe(io_req, tmp, &tgt->els_queue, link) { in bnx2fc_flush_active_ios()
234 if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags)) in bnx2fc_flush_active_ios()
242 list_for_each_entry_safe(io_req, tmp, &tgt->io_retire_queue, link) { in bnx2fc_flush_active_ios()
263 BNX2FC_TGT_DBG(tgt, "IOs flushed = %d\n", i); in bnx2fc_flush_active_ios()
265 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
267 while ((tgt->num_active_ios.counter != 0) && (i++ < BNX2FC_WAIT_CNT)) in bnx2fc_flush_active_ios()
269 if (tgt->num_active_ios.counter != 0) in bnx2fc_flush_active_ios()
272 tgt->rdata->ids.port_id, tgt->num_active_ios.counter); in bnx2fc_flush_active_ios()
273 spin_lock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
274 tgt->flush_in_prog = 0; in bnx2fc_flush_active_ios()
275 spin_unlock_bh(&tgt->tgt_lock); in bnx2fc_flush_active_ios()
278 static void bnx2fc_upld_wait(struct bnx2fc_rport *tgt) in bnx2fc_upld_wait() argument
280 timer_setup(&tgt->upld_timer, bnx2fc_upld_timer, 0); in bnx2fc_upld_wait()
281 mod_timer(&tgt->upld_timer, jiffies + BNX2FC_FW_TIMEOUT); in bnx2fc_upld_wait()
282 wait_event_interruptible(tgt->upld_wait, in bnx2fc_upld_wait()
285 &tgt->flags))); in bnx2fc_upld_wait()
288 del_timer_sync(&tgt->upld_timer); in bnx2fc_upld_wait()
292 struct bnx2fc_rport *tgt) in bnx2fc_upload_session() argument
297 BNX2FC_TGT_DBG(tgt, "upload_session: active_ios = %d\n", in bnx2fc_upload_session()
298 tgt->num_active_ios.counter); in bnx2fc_upload_session()
304 clear_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_upload_session()
305 bnx2fc_send_session_disable_req(port, tgt); in bnx2fc_upload_session()
311 BNX2FC_TGT_DBG(tgt, "waiting for disable compl\n"); in bnx2fc_upload_session()
312 bnx2fc_upld_wait(tgt); in bnx2fc_upload_session()
318 BNX2FC_TGT_DBG(tgt, "flush/upload - disable wait flags = 0x%lx\n", in bnx2fc_upload_session()
319 tgt->flags); in bnx2fc_upload_session()
320 bnx2fc_flush_active_ios(tgt); in bnx2fc_upload_session()
323 if (test_bit(BNX2FC_FLAG_DISABLED, &tgt->flags)) { in bnx2fc_upload_session()
324 BNX2FC_TGT_DBG(tgt, "send destroy req\n"); in bnx2fc_upload_session()
325 clear_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_upload_session()
326 bnx2fc_send_session_destroy_req(hba, tgt); in bnx2fc_upload_session()
329 bnx2fc_upld_wait(tgt); in bnx2fc_upload_session()
331 if (!(test_bit(BNX2FC_FLAG_DESTROYED, &tgt->flags))) in bnx2fc_upload_session()
334 BNX2FC_TGT_DBG(tgt, "destroy wait complete flags = 0x%lx\n", in bnx2fc_upload_session()
335 tgt->flags); in bnx2fc_upload_session()
337 } else if (test_bit(BNX2FC_FLAG_DISABLE_FAILED, &tgt->flags)) { in bnx2fc_upload_session()
346 bnx2fc_free_session_resc(hba, tgt); in bnx2fc_upload_session()
347 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id); in bnx2fc_upload_session()
350 static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt, in bnx2fc_init_tgt() argument
358 struct b577xx_doorbell_set_prod *sq_db = &tgt->sq_db; in bnx2fc_init_tgt()
359 struct b577xx_fcoe_rx_doorbell *rx_db = &tgt->rx_db; in bnx2fc_init_tgt()
361 tgt->rport = rport; in bnx2fc_init_tgt()
362 tgt->rdata = rdata; in bnx2fc_init_tgt()
363 tgt->port = port; in bnx2fc_init_tgt()
366 BNX2FC_TGT_DBG(tgt, "exceeded max sessions. logoff this tgt\n"); in bnx2fc_init_tgt()
367 tgt->fcoe_conn_id = -1; in bnx2fc_init_tgt()
371 tgt->fcoe_conn_id = bnx2fc_alloc_conn_id(hba, tgt); in bnx2fc_init_tgt()
372 if (tgt->fcoe_conn_id == -1) in bnx2fc_init_tgt()
375 BNX2FC_TGT_DBG(tgt, "init_tgt - conn_id = 0x%x\n", tgt->fcoe_conn_id); in bnx2fc_init_tgt()
377 tgt->max_sqes = BNX2FC_SQ_WQES_MAX; in bnx2fc_init_tgt()
378 tgt->max_rqes = BNX2FC_RQ_WQES_MAX; in bnx2fc_init_tgt()
379 tgt->max_cqes = BNX2FC_CQ_WQES_MAX; in bnx2fc_init_tgt()
380 atomic_set(&tgt->free_sqes, BNX2FC_SQ_WQES_MAX); in bnx2fc_init_tgt()
383 tgt->sq_curr_toggle_bit = 1; in bnx2fc_init_tgt()
384 tgt->cq_curr_toggle_bit = 1; in bnx2fc_init_tgt()
385 tgt->sq_prod_idx = 0; in bnx2fc_init_tgt()
386 tgt->cq_cons_idx = 0; in bnx2fc_init_tgt()
387 tgt->rq_prod_idx = 0x8000; in bnx2fc_init_tgt()
388 tgt->rq_cons_idx = 0; in bnx2fc_init_tgt()
389 atomic_set(&tgt->num_active_ios, 0); in bnx2fc_init_tgt()
390 tgt->retry_delay_timestamp = 0; in bnx2fc_init_tgt()
395 tgt->dev_type = TYPE_TAPE; in bnx2fc_init_tgt()
396 tgt->io_timeout = 0; /* use default ULP timeout */ in bnx2fc_init_tgt()
398 tgt->dev_type = TYPE_DISK; in bnx2fc_init_tgt()
399 tgt->io_timeout = BNX2FC_IO_TIMEOUT; in bnx2fc_init_tgt()
414 spin_lock_init(&tgt->tgt_lock); in bnx2fc_init_tgt()
415 spin_lock_init(&tgt->cq_lock); in bnx2fc_init_tgt()
418 INIT_LIST_HEAD(&tgt->active_cmd_queue); in bnx2fc_init_tgt()
421 INIT_LIST_HEAD(&tgt->io_retire_queue); in bnx2fc_init_tgt()
423 INIT_LIST_HEAD(&tgt->els_queue); in bnx2fc_init_tgt()
426 INIT_LIST_HEAD(&tgt->active_tm_queue); in bnx2fc_init_tgt()
428 init_waitqueue_head(&tgt->ofld_wait); in bnx2fc_init_tgt()
429 init_waitqueue_head(&tgt->upld_wait); in bnx2fc_init_tgt()
448 struct bnx2fc_rport *tgt; in bnx2fc_rport_event_handler() local
489 tgt = (struct bnx2fc_rport *)&rp[1]; in bnx2fc_rport_event_handler()
492 if (test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags)) { in bnx2fc_rport_event_handler()
493 BNX2FC_TGT_DBG(tgt, "already offloaded\n"); in bnx2fc_rport_event_handler()
502 bnx2fc_offload_session(port, tgt, rdata); in bnx2fc_rport_event_handler()
504 BNX2FC_TGT_DBG(tgt, "OFFLOAD num_ofld_sess = %d\n", in bnx2fc_rport_event_handler()
507 if (test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags)) { in bnx2fc_rport_event_handler()
509 BNX2FC_TGT_DBG(tgt, "sess offloaded\n"); in bnx2fc_rport_event_handler()
513 set_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags); in bnx2fc_rport_event_handler()
520 BNX2FC_TGT_DBG(tgt, "Port is being logged off as " in bnx2fc_rport_event_handler()
543 tgt = (struct bnx2fc_rport *)&rp[1]; in bnx2fc_rport_event_handler()
545 if (!(test_bit(BNX2FC_FLAG_ENABLED, &tgt->flags))) { in bnx2fc_rport_event_handler()
549 clear_bit(BNX2FC_FLAG_SESSION_READY, &tgt->flags); in bnx2fc_rport_event_handler()
551 bnx2fc_upload_session(port, tgt); in bnx2fc_rport_event_handler()
553 BNX2FC_TGT_DBG(tgt, "UPLOAD num_ofld_sess = %d\n", in bnx2fc_rport_event_handler()
583 struct bnx2fc_rport *tgt; in bnx2fc_tgt_lookup() local
588 tgt = hba->tgt_ofld_list[i]; in bnx2fc_tgt_lookup()
589 if ((tgt) && (tgt->port == port)) { in bnx2fc_tgt_lookup()
590 rdata = tgt->rdata; in bnx2fc_tgt_lookup()
593 BNX2FC_TGT_DBG(tgt, "rport " in bnx2fc_tgt_lookup()
595 return tgt; in bnx2fc_tgt_lookup()
597 BNX2FC_TGT_DBG(tgt, "rport 0x%x " in bnx2fc_tgt_lookup()
616 struct bnx2fc_rport *tgt) in bnx2fc_alloc_conn_id() argument
645 hba->tgt_ofld_list[conn_id] = tgt; in bnx2fc_alloc_conn_id()
646 tgt->fcoe_conn_id = conn_id; in bnx2fc_alloc_conn_id()
663 struct bnx2fc_rport *tgt) in bnx2fc_alloc_session_resc() argument
670 tgt->sq_mem_size = tgt->max_sqes * BNX2FC_SQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
671 tgt->sq_mem_size = (tgt->sq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
674 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_alloc_session_resc()
675 &tgt->sq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
676 if (!tgt->sq) { in bnx2fc_alloc_session_resc()
678 tgt->sq_mem_size); in bnx2fc_alloc_session_resc()
683 tgt->cq_mem_size = tgt->max_cqes * BNX2FC_CQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
684 tgt->cq_mem_size = (tgt->cq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
687 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_alloc_session_resc()
688 &tgt->cq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
689 if (!tgt->cq) { in bnx2fc_alloc_session_resc()
691 tgt->cq_mem_size); in bnx2fc_alloc_session_resc()
696 tgt->rq_mem_size = tgt->max_rqes * BNX2FC_RQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
697 tgt->rq_mem_size = (tgt->rq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
700 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_alloc_session_resc()
701 &tgt->rq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
702 if (!tgt->rq) { in bnx2fc_alloc_session_resc()
704 tgt->rq_mem_size); in bnx2fc_alloc_session_resc()
708 tgt->rq_pbl_size = (tgt->rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2fc_alloc_session_resc()
709 tgt->rq_pbl_size = (tgt->rq_pbl_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
712 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_alloc_session_resc()
713 &tgt->rq_pbl_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
714 if (!tgt->rq_pbl) { in bnx2fc_alloc_session_resc()
716 tgt->rq_pbl_size); in bnx2fc_alloc_session_resc()
720 num_pages = tgt->rq_mem_size / CNIC_PAGE_SIZE; in bnx2fc_alloc_session_resc()
721 page = tgt->rq_dma; in bnx2fc_alloc_session_resc()
722 pbl = (u32 *)tgt->rq_pbl; in bnx2fc_alloc_session_resc()
733 tgt->xferq_mem_size = tgt->max_sqes * BNX2FC_XFERQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
734 tgt->xferq_mem_size = (tgt->xferq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
737 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
738 tgt->xferq_mem_size, &tgt->xferq_dma, in bnx2fc_alloc_session_resc()
740 if (!tgt->xferq) { in bnx2fc_alloc_session_resc()
742 tgt->xferq_mem_size); in bnx2fc_alloc_session_resc()
747 tgt->confq_mem_size = tgt->max_sqes * BNX2FC_CONFQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
748 tgt->confq_mem_size = (tgt->confq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
751 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
752 tgt->confq_mem_size, &tgt->confq_dma, in bnx2fc_alloc_session_resc()
754 if (!tgt->confq) { in bnx2fc_alloc_session_resc()
756 tgt->confq_mem_size); in bnx2fc_alloc_session_resc()
760 tgt->confq_pbl_size = in bnx2fc_alloc_session_resc()
761 (tgt->confq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2fc_alloc_session_resc()
762 tgt->confq_pbl_size = in bnx2fc_alloc_session_resc()
763 (tgt->confq_pbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2fc_alloc_session_resc()
765 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
766 tgt->confq_pbl_size, in bnx2fc_alloc_session_resc()
767 &tgt->confq_pbl_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
768 if (!tgt->confq_pbl) { in bnx2fc_alloc_session_resc()
770 tgt->confq_pbl_size); in bnx2fc_alloc_session_resc()
774 num_pages = tgt->confq_mem_size / CNIC_PAGE_SIZE; in bnx2fc_alloc_session_resc()
775 page = tgt->confq_dma; in bnx2fc_alloc_session_resc()
776 pbl = (u32 *)tgt->confq_pbl; in bnx2fc_alloc_session_resc()
787 tgt->conn_db_mem_size = sizeof(struct fcoe_conn_db); in bnx2fc_alloc_session_resc()
789 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
790 tgt->conn_db_mem_size, in bnx2fc_alloc_session_resc()
791 &tgt->conn_db_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
792 if (!tgt->conn_db) { in bnx2fc_alloc_session_resc()
794 tgt->conn_db_mem_size); in bnx2fc_alloc_session_resc()
800 tgt->lcq_mem_size = (tgt->max_sqes + 8) * BNX2FC_SQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
801 tgt->lcq_mem_size = (tgt->lcq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
804 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_alloc_session_resc()
805 &tgt->lcq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
807 if (!tgt->lcq) { in bnx2fc_alloc_session_resc()
809 tgt->lcq_mem_size); in bnx2fc_alloc_session_resc()
813 tgt->conn_db->rq_prod = 0x8000; in bnx2fc_alloc_session_resc()
830 struct bnx2fc_rport *tgt) in bnx2fc_free_session_resc() argument
834 BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n"); in bnx2fc_free_session_resc()
836 spin_lock_bh(&tgt->cq_lock); in bnx2fc_free_session_resc()
837 ctx_base_ptr = tgt->ctx_base; in bnx2fc_free_session_resc()
838 tgt->ctx_base = NULL; in bnx2fc_free_session_resc()
841 if (tgt->lcq) { in bnx2fc_free_session_resc()
842 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_free_session_resc()
843 tgt->lcq, tgt->lcq_dma); in bnx2fc_free_session_resc()
844 tgt->lcq = NULL; in bnx2fc_free_session_resc()
847 if (tgt->conn_db) { in bnx2fc_free_session_resc()
848 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size, in bnx2fc_free_session_resc()
849 tgt->conn_db, tgt->conn_db_dma); in bnx2fc_free_session_resc()
850 tgt->conn_db = NULL; in bnx2fc_free_session_resc()
853 if (tgt->confq_pbl) { in bnx2fc_free_session_resc()
854 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size, in bnx2fc_free_session_resc()
855 tgt->confq_pbl, tgt->confq_pbl_dma); in bnx2fc_free_session_resc()
856 tgt->confq_pbl = NULL; in bnx2fc_free_session_resc()
858 if (tgt->confq) { in bnx2fc_free_session_resc()
859 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size, in bnx2fc_free_session_resc()
860 tgt->confq, tgt->confq_dma); in bnx2fc_free_session_resc()
861 tgt->confq = NULL; in bnx2fc_free_session_resc()
864 if (tgt->xferq) { in bnx2fc_free_session_resc()
865 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, in bnx2fc_free_session_resc()
866 tgt->xferq, tgt->xferq_dma); in bnx2fc_free_session_resc()
867 tgt->xferq = NULL; in bnx2fc_free_session_resc()
870 if (tgt->rq_pbl) { in bnx2fc_free_session_resc()
871 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_free_session_resc()
872 tgt->rq_pbl, tgt->rq_pbl_dma); in bnx2fc_free_session_resc()
873 tgt->rq_pbl = NULL; in bnx2fc_free_session_resc()
875 if (tgt->rq) { in bnx2fc_free_session_resc()
876 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_free_session_resc()
877 tgt->rq, tgt->rq_dma); in bnx2fc_free_session_resc()
878 tgt->rq = NULL; in bnx2fc_free_session_resc()
881 if (tgt->cq) { in bnx2fc_free_session_resc()
882 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_free_session_resc()
883 tgt->cq, tgt->cq_dma); in bnx2fc_free_session_resc()
884 tgt->cq = NULL; in bnx2fc_free_session_resc()
887 if (tgt->sq) { in bnx2fc_free_session_resc()
888 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_free_session_resc()
889 tgt->sq, tgt->sq_dma); in bnx2fc_free_session_resc()
890 tgt->sq = NULL; in bnx2fc_free_session_resc()
892 spin_unlock_bh(&tgt->cq_lock); in bnx2fc_free_session_resc()