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);
157 bnx2fc_free_session_resc(hba, tgt);
160 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id);
293 struct bnx2fc_hba *hba = interface->hba;
299 * Called with hba->hba_mutex held.
324 bnx2fc_send_session_destroy_req(hba, tgt);
344 bnx2fc_free_session_resc(hba, tgt);
345 bnx2fc_free_conn_id(hba, tgt->fcoe_conn_id);
355 struct bnx2fc_hba *hba = interface->hba;
363 if (hba->num_ofld_sess >= BNX2FC_NUM_MAX_SESS) {
369 tgt->fcoe_conn_id = bnx2fc_alloc_conn_id(hba, tgt);
443 struct bnx2fc_hba *hba = interface->hba;
483 * Offload process is protected with hba mutex.
486 mutex_lock(&hba->hba_mutex);
492 mutex_unlock(&hba->hba_mutex);
503 hba->num_ofld_sess);
508 /* This counter is protected with hba mutex */
509 hba->num_ofld_sess++;
521 mutex_unlock(&hba->hba_mutex);
536 mutex_lock(&hba->hba_mutex);
544 mutex_unlock(&hba->hba_mutex);
550 hba->num_ofld_sess--;
552 hba->num_ofld_sess);
557 if ((hba->wait_for_link_down) &&
558 (hba->num_ofld_sess == 0)) {
559 wake_up_interruptible(&hba->shutdown_wait);
561 mutex_unlock(&hba->hba_mutex);
580 struct bnx2fc_hba *hba = interface->hba;
586 tgt = hba->tgt_ofld_list[i];
610 * @hba: pointer to adapter structure
613 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba,
618 /* called with hba mutex held */
622 * both hba mutex and hba lock. Atleast hba mutex or
623 * hba lock needs to be held for read access.
626 spin_lock_bh(&hba->hba_lock);
627 next = hba->next_conn_id;
628 conn_id = hba->next_conn_id++;
629 if (hba->next_conn_id == BNX2FC_NUM_MAX_SESS)
630 hba->next_conn_id = 0;
632 while (hba->tgt_ofld_list[conn_id] != NULL) {
639 spin_unlock_bh(&hba->hba_lock);
643 hba->tgt_ofld_list[conn_id] = tgt;
645 spin_unlock_bh(&hba->hba_lock);
649 static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id)
651 /* called with hba mutex held */
652 spin_lock_bh(&hba->hba_lock);
653 hba->tgt_ofld_list[conn_id] = NULL;
654 spin_unlock_bh(&hba->hba_lock);
660 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
672 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size,
685 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size,
698 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size,
710 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size,
735 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev,
749 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev,
763 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev,
787 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev,
802 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
822 * @hba: adapter structure pointer
827 static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
839 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
845 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size,
851 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size,
856 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size,
862 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size,
868 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size,
873 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size,
879 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size,
885 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size,