Lines Matching refs:tgt
18 static int bnx2fc_init_tgt(struct bnx2fc_rport *tgt,
22 struct bnx2fc_rport *tgt);
24 struct bnx2fc_rport *tgt);
26 struct bnx2fc_rport *tgt);
32 struct bnx2fc_rport *tgt = (struct bnx2fc_rport *)data; in bnx2fc_upld_timer() local
34 BNX2FC_TGT_DBG(tgt, "upld_timer - Upload compl not received!!\n"); in bnx2fc_upld_timer()
36 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_upld_timer()
37 clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_upld_timer()
38 set_bit(BNX2FC_FLAG_UPLD_REQ_COMPL, &tgt->flags); in bnx2fc_upld_timer()
39 wake_up_interruptible(&tgt->upld_wait); in bnx2fc_upld_timer()
45 struct bnx2fc_rport *tgt = (struct bnx2fc_rport *)data; in bnx2fc_ofld_timer() local
47 BNX2FC_TGT_DBG(tgt, "entered bnx2fc_ofld_timer\n"); in bnx2fc_ofld_timer()
59 clear_bit(BNX2FC_FLAG_OFFLOADED, &tgt->flags); in bnx2fc_ofld_timer()
60 clear_bit(BNX2FC_FLAG_ENABLED, &tgt->flags); in bnx2fc_ofld_timer()
61 set_bit(BNX2FC_FLAG_OFLD_REQ_CMPL, &tgt->flags); in bnx2fc_ofld_timer()
62 wake_up_interruptible(&tgt->ofld_wait); in bnx2fc_ofld_timer()
65 static void bnx2fc_ofld_wait(struct bnx2fc_rport *tgt) in bnx2fc_ofld_wait() argument
67 setup_timer(&tgt->ofld_timer, bnx2fc_ofld_timer, (unsigned long)tgt); in bnx2fc_ofld_wait()
68 mod_timer(&tgt->ofld_timer, jiffies + BNX2FC_FW_TIMEOUT); in bnx2fc_ofld_wait()
70 wait_event_interruptible(tgt->ofld_wait, in bnx2fc_ofld_wait()
73 &tgt->flags))); in bnx2fc_ofld_wait()
76 del_timer_sync(&tgt->ofld_timer); in bnx2fc_ofld_wait()
80 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 setup_timer(&tgt->upld_timer, bnx2fc_upld_timer, (unsigned long)tgt); 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()
563 if (test_bit(BNX2FC_FLAG_EXPL_LOGO, &tgt->flags)) { in bnx2fc_rport_event_handler()
589 struct bnx2fc_rport *tgt; in bnx2fc_tgt_lookup() local
594 tgt = hba->tgt_ofld_list[i]; in bnx2fc_tgt_lookup()
595 if ((tgt) && (tgt->port == port)) { in bnx2fc_tgt_lookup()
596 rdata = tgt->rdata; in bnx2fc_tgt_lookup()
599 BNX2FC_TGT_DBG(tgt, "rport " in bnx2fc_tgt_lookup()
601 return tgt; in bnx2fc_tgt_lookup()
603 BNX2FC_TGT_DBG(tgt, "rport 0x%x " in bnx2fc_tgt_lookup()
622 struct bnx2fc_rport *tgt) in bnx2fc_alloc_conn_id() argument
651 hba->tgt_ofld_list[conn_id] = tgt; in bnx2fc_alloc_conn_id()
652 tgt->fcoe_conn_id = conn_id; in bnx2fc_alloc_conn_id()
670 struct bnx2fc_rport *tgt) in bnx2fc_alloc_session_resc() argument
677 tgt->sq_mem_size = tgt->max_sqes * BNX2FC_SQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
678 tgt->sq_mem_size = (tgt->sq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
681 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_alloc_session_resc()
682 &tgt->sq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
683 if (!tgt->sq) { in bnx2fc_alloc_session_resc()
685 tgt->sq_mem_size); in bnx2fc_alloc_session_resc()
688 memset(tgt->sq, 0, tgt->sq_mem_size); in bnx2fc_alloc_session_resc()
691 tgt->cq_mem_size = tgt->max_cqes * BNX2FC_CQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
692 tgt->cq_mem_size = (tgt->cq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
695 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_alloc_session_resc()
696 &tgt->cq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
697 if (!tgt->cq) { in bnx2fc_alloc_session_resc()
699 tgt->cq_mem_size); in bnx2fc_alloc_session_resc()
702 memset(tgt->cq, 0, tgt->cq_mem_size); in bnx2fc_alloc_session_resc()
705 tgt->rq_mem_size = tgt->max_rqes * BNX2FC_RQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
706 tgt->rq_mem_size = (tgt->rq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
709 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_alloc_session_resc()
710 &tgt->rq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
711 if (!tgt->rq) { in bnx2fc_alloc_session_resc()
713 tgt->rq_mem_size); in bnx2fc_alloc_session_resc()
716 memset(tgt->rq, 0, tgt->rq_mem_size); in bnx2fc_alloc_session_resc()
718 tgt->rq_pbl_size = (tgt->rq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2fc_alloc_session_resc()
719 tgt->rq_pbl_size = (tgt->rq_pbl_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
722 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_alloc_session_resc()
723 &tgt->rq_pbl_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
724 if (!tgt->rq_pbl) { in bnx2fc_alloc_session_resc()
726 tgt->rq_pbl_size); in bnx2fc_alloc_session_resc()
730 memset(tgt->rq_pbl, 0, tgt->rq_pbl_size); in bnx2fc_alloc_session_resc()
731 num_pages = tgt->rq_mem_size / CNIC_PAGE_SIZE; in bnx2fc_alloc_session_resc()
732 page = tgt->rq_dma; in bnx2fc_alloc_session_resc()
733 pbl = (u32 *)tgt->rq_pbl; in bnx2fc_alloc_session_resc()
744 tgt->xferq_mem_size = tgt->max_sqes * BNX2FC_XFERQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
745 tgt->xferq_mem_size = (tgt->xferq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
748 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, in bnx2fc_alloc_session_resc()
749 &tgt->xferq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
750 if (!tgt->xferq) { in bnx2fc_alloc_session_resc()
752 tgt->xferq_mem_size); in bnx2fc_alloc_session_resc()
755 memset(tgt->xferq, 0, tgt->xferq_mem_size); in bnx2fc_alloc_session_resc()
758 tgt->confq_mem_size = tgt->max_sqes * BNX2FC_CONFQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
759 tgt->confq_mem_size = (tgt->confq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
762 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, tgt->confq_mem_size, in bnx2fc_alloc_session_resc()
763 &tgt->confq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
764 if (!tgt->confq) { in bnx2fc_alloc_session_resc()
766 tgt->confq_mem_size); in bnx2fc_alloc_session_resc()
769 memset(tgt->confq, 0, tgt->confq_mem_size); in bnx2fc_alloc_session_resc()
771 tgt->confq_pbl_size = in bnx2fc_alloc_session_resc()
772 (tgt->confq_mem_size / CNIC_PAGE_SIZE) * sizeof(void *); in bnx2fc_alloc_session_resc()
773 tgt->confq_pbl_size = in bnx2fc_alloc_session_resc()
774 (tgt->confq_pbl_size + (CNIC_PAGE_SIZE - 1)) & CNIC_PAGE_MASK; in bnx2fc_alloc_session_resc()
776 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
777 tgt->confq_pbl_size, in bnx2fc_alloc_session_resc()
778 &tgt->confq_pbl_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
779 if (!tgt->confq_pbl) { in bnx2fc_alloc_session_resc()
781 tgt->confq_pbl_size); in bnx2fc_alloc_session_resc()
785 memset(tgt->confq_pbl, 0, tgt->confq_pbl_size); in bnx2fc_alloc_session_resc()
786 num_pages = tgt->confq_mem_size / CNIC_PAGE_SIZE; in bnx2fc_alloc_session_resc()
787 page = tgt->confq_dma; in bnx2fc_alloc_session_resc()
788 pbl = (u32 *)tgt->confq_pbl; in bnx2fc_alloc_session_resc()
799 tgt->conn_db_mem_size = sizeof(struct fcoe_conn_db); in bnx2fc_alloc_session_resc()
801 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
802 tgt->conn_db_mem_size, in bnx2fc_alloc_session_resc()
803 &tgt->conn_db_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
804 if (!tgt->conn_db) { in bnx2fc_alloc_session_resc()
806 tgt->conn_db_mem_size); in bnx2fc_alloc_session_resc()
809 memset(tgt->conn_db, 0, tgt->conn_db_mem_size); in bnx2fc_alloc_session_resc()
813 tgt->lcq_mem_size = (tgt->max_sqes + 8) * BNX2FC_SQ_WQE_SIZE; in bnx2fc_alloc_session_resc()
814 tgt->lcq_mem_size = (tgt->lcq_mem_size + (CNIC_PAGE_SIZE - 1)) & in bnx2fc_alloc_session_resc()
817 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_alloc_session_resc()
818 &tgt->lcq_dma, GFP_KERNEL); in bnx2fc_alloc_session_resc()
820 if (!tgt->lcq) { in bnx2fc_alloc_session_resc()
822 tgt->lcq_mem_size); in bnx2fc_alloc_session_resc()
825 memset(tgt->lcq, 0, tgt->lcq_mem_size); in bnx2fc_alloc_session_resc()
827 tgt->conn_db->rq_prod = 0x8000; in bnx2fc_alloc_session_resc()
844 struct bnx2fc_rport *tgt) in bnx2fc_free_session_resc() argument
848 BNX2FC_TGT_DBG(tgt, "Freeing up session resources\n"); in bnx2fc_free_session_resc()
850 spin_lock_bh(&tgt->cq_lock); in bnx2fc_free_session_resc()
851 ctx_base_ptr = tgt->ctx_base; in bnx2fc_free_session_resc()
852 tgt->ctx_base = NULL; in bnx2fc_free_session_resc()
855 if (tgt->lcq) { in bnx2fc_free_session_resc()
856 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_free_session_resc()
857 tgt->lcq, tgt->lcq_dma); in bnx2fc_free_session_resc()
858 tgt->lcq = NULL; in bnx2fc_free_session_resc()
861 if (tgt->conn_db) { in bnx2fc_free_session_resc()
862 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size, in bnx2fc_free_session_resc()
863 tgt->conn_db, tgt->conn_db_dma); in bnx2fc_free_session_resc()
864 tgt->conn_db = NULL; in bnx2fc_free_session_resc()
867 if (tgt->confq_pbl) { in bnx2fc_free_session_resc()
868 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size, in bnx2fc_free_session_resc()
869 tgt->confq_pbl, tgt->confq_pbl_dma); in bnx2fc_free_session_resc()
870 tgt->confq_pbl = NULL; in bnx2fc_free_session_resc()
872 if (tgt->confq) { in bnx2fc_free_session_resc()
873 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size, in bnx2fc_free_session_resc()
874 tgt->confq, tgt->confq_dma); in bnx2fc_free_session_resc()
875 tgt->confq = NULL; in bnx2fc_free_session_resc()
878 if (tgt->xferq) { in bnx2fc_free_session_resc()
879 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, in bnx2fc_free_session_resc()
880 tgt->xferq, tgt->xferq_dma); in bnx2fc_free_session_resc()
881 tgt->xferq = NULL; in bnx2fc_free_session_resc()
884 if (tgt->rq_pbl) { in bnx2fc_free_session_resc()
885 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_free_session_resc()
886 tgt->rq_pbl, tgt->rq_pbl_dma); in bnx2fc_free_session_resc()
887 tgt->rq_pbl = NULL; in bnx2fc_free_session_resc()
889 if (tgt->rq) { in bnx2fc_free_session_resc()
890 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_free_session_resc()
891 tgt->rq, tgt->rq_dma); in bnx2fc_free_session_resc()
892 tgt->rq = NULL; in bnx2fc_free_session_resc()
895 if (tgt->cq) { in bnx2fc_free_session_resc()
896 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_free_session_resc()
897 tgt->cq, tgt->cq_dma); in bnx2fc_free_session_resc()
898 tgt->cq = NULL; in bnx2fc_free_session_resc()
901 if (tgt->sq) { in bnx2fc_free_session_resc()
902 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_free_session_resc()
903 tgt->sq, tgt->sq_dma); in bnx2fc_free_session_resc()
904 tgt->sq = NULL; in bnx2fc_free_session_resc()
906 spin_unlock_bh(&tgt->cq_lock); in bnx2fc_free_session_resc()