Lines Matching defs: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;
100 rval = bnx2fc_alloc_session_resc(hba, tgt);
159 bnx2fc_free_session_resc(hba, tgt);
162 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id);
295 struct bnx2fc_hba *hba = interface->hba;
301 * Called with hba->hba_mutex held.
326 bnx2fc_send_session_destroy_req(hba, tgt);
346 bnx2fc_free_session_resc(hba, tgt);
347 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id);
357 struct bnx2fc_hba *hba = interface->hba;
365 if (hba->num_ofld_sess >= BNX2FC_NUM_MAX_SESS) {
371 tgt->fcoe_conn_id = bnx2fc_alloc_conn_id(hba, tgt);
445 struct bnx2fc_hba *hba = interface->hba;
485 * Offlaod process is protected with hba mutex.
488 mutex_lock(&hba->hba_mutex);
494 mutex_unlock(&hba->hba_mutex);
505 hba->num_ofld_sess);
510 /* This counter is protected with hba mutex */
511 hba->num_ofld_sess++;
523 mutex_unlock(&hba->hba_mutex);
538 mutex_lock(&hba->hba_mutex);
546 mutex_unlock(&hba->hba_mutex);
552 hba->num_ofld_sess--;
554 hba->num_ofld_sess);
559 if ((hba->wait_for_link_down) &&
560 (hba->num_ofld_sess == 0)) {
561 wake_up_interruptible(&hba->shutdown_wait);
563 mutex_unlock(&hba->hba_mutex);
582 struct bnx2fc_hba *hba = interface->hba;
588 tgt = hba->tgt_ofld_list[i];
612 * @hba: pointer to adapter structure
615 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba,
620 /* called with hba mutex held */
624 * both hba mutex and hba lock. Atleast hba mutex or
625 * hba lock needs to be held for read access.
628 spin_lock_bh(&hba->hba_lock);
629 next = hba->next_conn_id;
630 conn_id = hba->next_conn_id++;
631 if (hba->next_conn_id == BNX2FC_NUM_MAX_SESS)
632 hba->next_conn_id = 0;
634 while (hba->tgt_ofld_list[conn_id] != NULL) {
641 spin_unlock_bh(&hba->hba_lock);
645 hba->tgt_ofld_list[conn_id] = tgt;
647 spin_unlock_bh(&hba->hba_lock);
651 static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id)
653 /* called with hba mutex held */
654 spin_lock_bh(&hba->hba_lock);
655 hba->tgt_ofld_list[conn_id] = NULL;
656 spin_unlock_bh(&hba->hba_lock);
662 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
674 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size,
687 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size,
700 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size,
712 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size,
737 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev,
751 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev,
765 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev,
789 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev,
804 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
824 * @hba: adapter structure pointer
829 static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
842 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
848 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size,
854 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size,
859 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size,
865 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size,
871 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size,
876 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size,
882 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size,
888 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size,