Lines Matching refs:phba

24 int beiscsi_pci_soft_reset(struct beiscsi_hba *phba)  in beiscsi_pci_soft_reset()  argument
34 pci_reset_offset = (u8 *)phba->pci_va + BE2_SOFT_RESET; in beiscsi_pci_soft_reset()
35 pci_online0_offset = (u8 *)phba->pci_va + BE2_PCI_ONLINE0; in beiscsi_pci_soft_reset()
36 pci_online1_offset = (u8 *)phba->pci_va + BE2_PCI_ONLINE1; in beiscsi_pci_soft_reset()
78 int be_chk_reset_complete(struct beiscsi_hba *phba) in be_chk_reset_complete() argument
85 mpu_sem = (u8 *)phba->csr_va + MPU_EP_SEMAPHORE; in be_chk_reset_complete()
98 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, in be_chk_reset_complete()
107 void be_mcc_notify(struct beiscsi_hba *phba) in be_mcc_notify() argument
109 struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q; in be_mcc_notify()
114 iowrite32(val, phba->db_va + DB_MCCQ_OFFSET); in be_mcc_notify()
117 unsigned int alloc_mcc_tag(struct beiscsi_hba *phba) in alloc_mcc_tag() argument
121 if (phba->ctrl.mcc_tag_available) { in alloc_mcc_tag()
122 tag = phba->ctrl.mcc_tag[phba->ctrl.mcc_alloc_index]; in alloc_mcc_tag()
123 phba->ctrl.mcc_tag[phba->ctrl.mcc_alloc_index] = 0; in alloc_mcc_tag()
124 phba->ctrl.mcc_numtag[tag] = 0; in alloc_mcc_tag()
127 phba->ctrl.mcc_tag_available--; in alloc_mcc_tag()
128 if (phba->ctrl.mcc_alloc_index == (MAX_MCC_CMD - 1)) in alloc_mcc_tag()
129 phba->ctrl.mcc_alloc_index = 0; in alloc_mcc_tag()
131 phba->ctrl.mcc_alloc_index++; in alloc_mcc_tag()
149 int beiscsi_mccq_compl(struct beiscsi_hba *phba, in beiscsi_mccq_compl() argument
159 struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q; in beiscsi_mccq_compl()
161 if (beiscsi_error(phba)) { in beiscsi_mccq_compl()
162 free_mcc_tag(&phba->ctrl, tag); in beiscsi_mccq_compl()
167 spin_lock(&phba->ctrl.mbox_lock); in beiscsi_mccq_compl()
168 phba->ctrl.ptag_state[tag].tag_state = MCC_TAG_STATE_RUNNING; in beiscsi_mccq_compl()
169 spin_unlock(&phba->ctrl.mbox_lock); in beiscsi_mccq_compl()
173 phba->ctrl.mcc_wait[tag], in beiscsi_mccq_compl()
174 phba->ctrl.mcc_numtag[tag], in beiscsi_mccq_compl()
181 spin_lock(&phba->ctrl.mbox_lock); in beiscsi_mccq_compl()
182 phba->ctrl.ptag_state[tag].tag_state = MCC_TAG_STATE_TIMEOUT; in beiscsi_mccq_compl()
183 spin_unlock(&phba->ctrl.mbox_lock); in beiscsi_mccq_compl()
186 tag_mem = &phba->ctrl.ptag_state[tag].tag_mem_state; in beiscsi_mccq_compl()
194 beiscsi_log(phba, KERN_ERR, in beiscsi_mccq_compl()
202 spin_lock(&phba->ctrl.mbox_lock); in beiscsi_mccq_compl()
203 phba->ctrl.ptag_state[tag].tag_state = MCC_TAG_STATE_COMPLETED; in beiscsi_mccq_compl()
204 spin_unlock(&phba->ctrl.mbox_lock); in beiscsi_mccq_compl()
207 mcc_tag_response = phba->ctrl.mcc_numtag[tag]; in beiscsi_mccq_compl()
225 beiscsi_log(phba, KERN_WARNING, in beiscsi_mccq_compl()
237 beiscsi_log(phba, KERN_WARNING, in beiscsi_mccq_compl()
253 free_mcc_tag(&phba->ctrl, tag); in beiscsi_mccq_compl()
322 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_mcc_compl_process() local
334 beiscsi_log(phba, KERN_ERR, in be_mcc_compl_process()
355 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_mcc_compl_process_isr() local
382 beiscsi_log(phba, KERN_WARNING, in be_mcc_compl_process_isr()
393 spin_lock(&phba->ctrl.mbox_lock); in be_mcc_compl_process_isr()
395 spin_unlock(&phba->ctrl.mbox_lock); in be_mcc_compl_process_isr()
404 static struct be_mcc_compl *be_mcc_compl_get(struct beiscsi_hba *phba) in be_mcc_compl_get() argument
406 struct be_queue_info *mcc_cq = &phba->ctrl.mcc_obj.cq; in be_mcc_compl_get()
425 struct beiscsi_hba *phba = iscsi_host_priv(shost); in be2iscsi_fail_session() local
428 if (phba->state & BE_ADAPTER_STATE_SHUTDOWN) in be2iscsi_fail_session()
436 void beiscsi_async_link_state_process(struct beiscsi_hba *phba, in beiscsi_async_link_state_process() argument
442 phba->state = BE_ADAPTER_LINK_DOWN; in beiscsi_async_link_state_process()
444 beiscsi_log(phba, KERN_ERR, in beiscsi_async_link_state_process()
449 iscsi_host_for_each_session(phba->shost, in beiscsi_async_link_state_process()
454 phba->state = BE_ADAPTER_LINK_UP | BE_ADAPTER_CHECK_BOOT; in beiscsi_async_link_state_process()
456 beiscsi_log(phba, KERN_ERR, in beiscsi_async_link_state_process()
463 int beiscsi_process_mcc(struct beiscsi_hba *phba) in beiscsi_process_mcc() argument
467 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_process_mcc()
469 spin_lock_bh(&phba->ctrl.mcc_cq_lock); in beiscsi_process_mcc()
470 while ((compl = be_mcc_compl_get(phba))) { in beiscsi_process_mcc()
475 beiscsi_async_link_state_process(phba, in beiscsi_process_mcc()
482 phba->state |= BE_ADAPTER_CHECK_BOOT; in beiscsi_process_mcc()
483 beiscsi_log(phba, KERN_ERR, in beiscsi_process_mcc()
491 beiscsi_log(phba, KERN_ERR, in beiscsi_process_mcc()
499 beiscsi_log(phba, KERN_ERR, in beiscsi_process_mcc()
507 atomic_dec(&phba->ctrl.mcc_obj.q.used); in beiscsi_process_mcc()
514 hwi_ring_cq_db(phba, phba->ctrl.mcc_obj.cq.id, num, 1, 0); in beiscsi_process_mcc()
516 spin_unlock_bh(&phba->ctrl.mcc_cq_lock); in beiscsi_process_mcc()
531 static int be_mcc_wait_compl(struct beiscsi_hba *phba) in be_mcc_wait_compl() argument
535 if (beiscsi_error(phba)) in be_mcc_wait_compl()
538 status = beiscsi_process_mcc(phba); in be_mcc_wait_compl()
542 if (atomic_read(&phba->ctrl.mcc_obj.q.used) == 0) in be_mcc_wait_compl()
547 beiscsi_log(phba, KERN_ERR, in be_mcc_wait_compl()
550 phba->fw_timeout = true; in be_mcc_wait_compl()
551 beiscsi_ue_detect(phba); in be_mcc_wait_compl()
567 int be_mcc_notify_wait(struct beiscsi_hba *phba) in be_mcc_notify_wait() argument
569 be_mcc_notify(phba); in be_mcc_notify_wait()
570 return be_mcc_wait_compl(phba); in be_mcc_notify_wait()
588 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_mbox_db_ready_wait() local
595 if (beiscsi_error(phba)) in be_mbox_db_ready_wait()
618 beiscsi_log(phba, KERN_ERR, in be_mbox_db_ready_wait()
621 phba->fw_timeout = true; in be_mbox_db_ready_wait()
622 beiscsi_ue_detect(phba); in be_mbox_db_ready_wait()
648 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_mbox_notify() local
677 beiscsi_log(phba, KERN_ERR, in be_mbox_notify()
684 beiscsi_log(phba, KERN_ERR, in be_mbox_notify()
697 static int be_mbox_notify_wait(struct beiscsi_hba *phba) in be_mbox_notify_wait() argument
701 void __iomem *db = phba->ctrl.db + MPU_MAILBOX_DB_OFFSET; in be_mbox_notify_wait()
702 struct be_dma_mem *mbox_mem = &phba->ctrl.mbox_mem; in be_mbox_notify_wait()
705 struct be_ctrl_info *ctrl = &phba->ctrl; in be_mbox_notify_wait()
737 beiscsi_log(phba, KERN_ERR, in be_mbox_notify_wait()
808 struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba) in wrb_from_mccq() argument
810 struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q; in wrb_from_mccq()
876 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_cmd_fw_initialize() local
896 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, in be_cmd_fw_initialize()
916 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_cmd_fw_uninit() local
937 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, in be_cmd_fw_uninit()
951 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in beiscsi_cmd_cq_create() local
965 if (is_chip_be2_be3r(phba)) { in beiscsi_cmd_cq_create()
1002 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, in beiscsi_cmd_cq_create()
1019 int beiscsi_cmd_mccq_create(struct beiscsi_hba *phba, in beiscsi_cmd_mccq_create() argument
1030 spin_lock(&phba->ctrl.mbox_lock); in beiscsi_cmd_mccq_create()
1031 ctrl = &phba->ctrl; in beiscsi_cmd_mccq_create()
1045 PCI_FUNC(phba->pcidev->devfn)); in beiscsi_cmd_mccq_create()
1055 status = be_mbox_notify_wait(phba); in beiscsi_cmd_mccq_create()
1061 spin_unlock(&phba->ctrl.mbox_lock); in beiscsi_cmd_mccq_create()
1071 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in beiscsi_cmd_q_destroy() local
1075 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_INIT, in beiscsi_cmd_q_destroy()
1150 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_cmd_create_default_pdu_queue() local
1163 if (phba->fw_config.dual_ulp_aware) { in be_cmd_create_default_pdu_queue()
1169 if (is_chip_be2_be3r(phba)) { in be_cmd_create_default_pdu_queue()
1211 defq_ring = &phba->phwi_ctrlr->default_pdu_hdr[ulp_num]; in be_cmd_create_default_pdu_queue()
1213 defq_ring = &phba->phwi_ctrlr-> in be_cmd_create_default_pdu_queue()
1218 if (!phba->fw_config.dual_ulp_aware) { in be_cmd_create_default_pdu_queue()
1251 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_cmd_wrbq_create() local
1263 if (phba->fw_config.dual_ulp_aware) { in be_cmd_wrbq_create()
1277 if (!phba->fw_config.dual_ulp_aware) { in be_cmd_wrbq_create()
1340 struct beiscsi_hba *phba = pci_get_drvdata(ctrl->pdev); in be_cmd_iscsi_post_sgl_pages() local
1371 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_INIT, in be_cmd_iscsi_post_sgl_pages()
1384 int beiscsi_cmd_reset_function(struct beiscsi_hba *phba) in beiscsi_cmd_reset_function() argument
1386 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_cmd_reset_function()
1397 status = be_mbox_notify_wait(phba); in beiscsi_cmd_reset_function()
1413 int be_cmd_set_vlan(struct beiscsi_hba *phba, in be_cmd_set_vlan() argument
1419 struct be_ctrl_info *ctrl = &phba->ctrl; in be_cmd_set_vlan()
1422 tag = alloc_mcc_tag(phba); in be_cmd_set_vlan()
1428 wrb = wrb_from_mccq(phba); in be_cmd_set_vlan()
1436 req->interface_hndl = phba->interface_handle; in be_cmd_set_vlan()
1439 be_mcc_notify(phba); in be_cmd_set_vlan()