Lines Matching refs:hba

22 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba,
24 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
26 static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
28 static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id);
86 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_offload_session() local
100 rval = bnx2fc_alloc_session_resc(hba, tgt); in bnx2fc_offload_session()
159 bnx2fc_free_session_resc(hba, tgt); in bnx2fc_offload_session()
162 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id); in bnx2fc_offload_session()
295 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_upload_session() local
326 bnx2fc_send_session_destroy_req(hba, tgt); 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()
357 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_init_tgt() local
365 if (hba->num_ofld_sess >= BNX2FC_NUM_MAX_SESS) { in bnx2fc_init_tgt()
371 tgt->fcoe_conn_id = bnx2fc_alloc_conn_id(hba, tgt); in bnx2fc_init_tgt()
445 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_rport_event_handler() local
488 mutex_lock(&hba->hba_mutex); in bnx2fc_rport_event_handler()
494 mutex_unlock(&hba->hba_mutex); in bnx2fc_rport_event_handler()
505 hba->num_ofld_sess); in bnx2fc_rport_event_handler()
511 hba->num_ofld_sess++; in bnx2fc_rport_event_handler()
523 mutex_unlock(&hba->hba_mutex); in bnx2fc_rport_event_handler()
538 mutex_lock(&hba->hba_mutex); in bnx2fc_rport_event_handler()
546 mutex_unlock(&hba->hba_mutex); in bnx2fc_rport_event_handler()
552 hba->num_ofld_sess--; in bnx2fc_rport_event_handler()
554 hba->num_ofld_sess); in bnx2fc_rport_event_handler()
559 if ((hba->wait_for_link_down) && in bnx2fc_rport_event_handler()
560 (hba->num_ofld_sess == 0)) { in bnx2fc_rport_event_handler()
561 wake_up_interruptible(&hba->shutdown_wait); in bnx2fc_rport_event_handler()
563 mutex_unlock(&hba->hba_mutex); in bnx2fc_rport_event_handler()
582 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_tgt_lookup() local
588 tgt = hba->tgt_ofld_list[i]; in bnx2fc_tgt_lookup()
615 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba, in bnx2fc_alloc_conn_id() argument
628 spin_lock_bh(&hba->hba_lock); in bnx2fc_alloc_conn_id()
629 next = hba->next_conn_id; in bnx2fc_alloc_conn_id()
630 conn_id = hba->next_conn_id++; in bnx2fc_alloc_conn_id()
631 if (hba->next_conn_id == BNX2FC_NUM_MAX_SESS) in bnx2fc_alloc_conn_id()
632 hba->next_conn_id = 0; in bnx2fc_alloc_conn_id()
634 while (hba->tgt_ofld_list[conn_id] != NULL) { in bnx2fc_alloc_conn_id()
641 spin_unlock_bh(&hba->hba_lock); in bnx2fc_alloc_conn_id()
645 hba->tgt_ofld_list[conn_id] = tgt; in bnx2fc_alloc_conn_id()
647 spin_unlock_bh(&hba->hba_lock); in bnx2fc_alloc_conn_id()
651 static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id) in bnx2fc_free_conn_id() argument
654 spin_lock_bh(&hba->hba_lock); in bnx2fc_free_conn_id()
655 hba->tgt_ofld_list[conn_id] = NULL; in bnx2fc_free_conn_id()
656 spin_unlock_bh(&hba->hba_lock); in bnx2fc_free_conn_id()
662 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba, in bnx2fc_alloc_session_resc() argument
674 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_alloc_session_resc()
687 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_alloc_session_resc()
700 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_alloc_session_resc()
712 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_alloc_session_resc()
737 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
751 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
765 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
789 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
804 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_alloc_session_resc()
829 static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, in bnx2fc_free_session_resc() argument
841 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_free_session_resc()
847 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size, in bnx2fc_free_session_resc()
853 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size, in bnx2fc_free_session_resc()
858 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size, in bnx2fc_free_session_resc()
864 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, in bnx2fc_free_session_resc()
870 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_free_session_resc()
875 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_free_session_resc()
881 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_free_session_resc()
887 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_free_session_resc()