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;
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);
569 mutex_unlock(&hba->hba_mutex);
588 struct bnx2fc_hba *hba = interface->hba;
594 tgt = hba->tgt_ofld_list[i];
618 * @hba: pointer to adapter structure
621 static u32 bnx2fc_alloc_conn_id(struct bnx2fc_hba *hba,
626 /* called with hba mutex held */
630 * both hba mutex and hba lock. Atleast hba mutex or
631 * hba lock needs to be held for read access.
634 spin_lock_bh(&hba->hba_lock);
635 next = hba->next_conn_id;
636 conn_id = hba->next_conn_id++;
637 if (hba->next_conn_id == BNX2FC_NUM_MAX_SESS)
638 hba->next_conn_id = 0;
640 while (hba->tgt_ofld_list[conn_id] != NULL) {
647 spin_unlock_bh(&hba->hba_lock);
651 hba->tgt_ofld_list[conn_id] = tgt;
653 spin_unlock_bh(&hba->hba_lock);
657 static void bnx2fc_free_conn_id(struct bnx2fc_hba *hba, u32 conn_id)
659 /* called with hba mutex held */
660 spin_lock_bh(&hba->hba_lock);
661 hba->tgt_ofld_list[conn_id] = NULL;
662 spin_unlock_bh(&hba->hba_lock);
669 static int bnx2fc_alloc_session_resc(struct bnx2fc_hba *hba,
681 tgt->sq = dma_alloc_coherent(&hba->pcidev->dev, tgt->sq_mem_size,
695 tgt->cq = dma_alloc_coherent(&hba->pcidev->dev, tgt->cq_mem_size,
709 tgt->rq = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_mem_size,
722 tgt->rq_pbl = dma_alloc_coherent(&hba->pcidev->dev, tgt->rq_pbl_size,
748 tgt->xferq = dma_alloc_coherent(&hba->pcidev->dev, tgt->xferq_mem_size,
762 tgt->confq = dma_alloc_coherent(&hba->pcidev->dev, tgt->confq_mem_size,
776 tgt->confq_pbl = dma_alloc_coherent(&hba->pcidev->dev,
801 tgt->conn_db = dma_alloc_coherent(&hba->pcidev->dev,
817 tgt->lcq = dma_alloc_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
838 * @hba: adapter structure pointer
843 static void bnx2fc_free_session_resc(struct bnx2fc_hba *hba,
856 dma_free_coherent(&hba->pcidev->dev, tgt->lcq_mem_size,
862 dma_free_coherent(&hba->pcidev->dev, tgt->conn_db_mem_size,
868 dma_free_coherent(&hba->pcidev->dev, tgt->confq_pbl_size,
873 dma_free_coherent(&hba->pcidev->dev, tgt->confq_mem_size,
879 dma_free_coherent(&hba->pcidev->dev, tgt->xferq_mem_size,
885 dma_free_coherent(&hba->pcidev->dev, tgt->rq_pbl_size,
890 dma_free_coherent(&hba->pcidev->dev, tgt->rq_mem_size,
896 dma_free_coherent(&hba->pcidev->dev, tgt->cq_mem_size,
902 dma_free_coherent(&hba->pcidev->dev, tgt->sq_mem_size,