Lines Matching refs:hba
21 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba,
23 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
25 static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
27 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()
569 mutex_unlock(&hba->hba_mutex); in bnx2fc_rport_event_handler()
588 struct bnx2fc_hba *hba = interface->hba; in bnx2fc_tgt_lookup() local
594 tgt = hba->tgt_ofld_list[i]; in bnx2fc_tgt_lookup()
621 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba, in bnx2fc_alloc_conn_id() argument
634 spin_lock_bh(&hba->hba_lock); in bnx2fc_alloc_conn_id()
635 next = hba->next_conn_id; in bnx2fc_alloc_conn_id()
636 conn_id = hba->next_conn_id++; in bnx2fc_alloc_conn_id()
637 if (hba->next_conn_id == BNX2FC_NUM_MAX_SESS) in bnx2fc_alloc_conn_id()
638 hba->next_conn_id = 0; in bnx2fc_alloc_conn_id()
640 while (hba->tgt_ofld_list[conn_id] != NULL) { in bnx2fc_alloc_conn_id()
647 spin_unlock_bh(&hba->hba_lock); in bnx2fc_alloc_conn_id()
651 hba->tgt_ofld_list[conn_id] = tgt; in bnx2fc_alloc_conn_id()
653 spin_unlock_bh(&hba->hba_lock); in bnx2fc_alloc_conn_id()
657 static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id) in bnx2fc_free_conn_id() argument
660 spin_lock_bh(&hba->hba_lock); in bnx2fc_free_conn_id()
661 hba->tgt_ofld_list[conn_id] = NULL; in bnx2fc_free_conn_id()
662 spin_unlock_bh(&hba->hba_lock); in bnx2fc_free_conn_id()
669 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba, in bnx2fc_alloc_session_resc() argument
681 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_alloc_session_resc()
695 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_alloc_session_resc()
709 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_alloc_session_resc()
722 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_alloc_session_resc()
748 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, in bnx2fc_alloc_session_resc()
762 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, tgt->confq_mem_size, in bnx2fc_alloc_session_resc()
776 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
801 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev, in bnx2fc_alloc_session_resc()
817 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_alloc_session_resc()
843 static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba, in bnx2fc_free_session_resc() argument
856 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size, in bnx2fc_free_session_resc()
862 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size, in bnx2fc_free_session_resc()
868 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size, in bnx2fc_free_session_resc()
873 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size, in bnx2fc_free_session_resc()
879 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size, in bnx2fc_free_session_resc()
885 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size, in bnx2fc_free_session_resc()
890 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size, in bnx2fc_free_session_resc()
896 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size, in bnx2fc_free_session_resc()
902 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size, in bnx2fc_free_session_resc()