Lines Matching refs:phba

34 					 struct beiscsi_hba *phba,  in mgmt_vendor_specific_fw_cmd()  argument
71 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in mgmt_vendor_specific_fw_cmd()
79 wrb = alloc_mcc_wrb(phba, &tag); in mgmt_vendor_specific_fw_cmd()
92 be_mcc_notify(phba, tag); in mgmt_vendor_specific_fw_cmd()
109 int mgmt_open_connection(struct beiscsi_hba *phba, in mgmt_open_connection() argument
118 struct be_ctrl_info *ctrl = &phba->ctrl; in mgmt_open_connection()
131 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in mgmt_open_connection()
137 phwi_ctrlr = phba->phwi_ctrlr; in mgmt_open_connection()
142 def_hdr_id = (unsigned short)HWI_GET_DEF_HDRQ_ID(phba, ulp_num); in mgmt_open_connection()
143 def_data_id = (unsigned short)HWI_GET_DEF_BUFQ_ID(phba, ulp_num); in mgmt_open_connection()
146 ISCSI_GET_PDU_TEMPLATE_ADDRESS(phba, ptemplate_address); in mgmt_open_connection()
149 wrb = alloc_mcc_wrb(phba, &tag); in mgmt_open_connection()
186 i = phba->nxt_cqid++; in mgmt_open_connection()
187 if (phba->nxt_cqid == phba->num_cpus) in mgmt_open_connection()
188 phba->nxt_cqid = 0; in mgmt_open_connection()
190 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in mgmt_open_connection()
202 if (!is_chip_be2_be3r(phba)) { in mgmt_open_connection()
208 be_mcc_notify(phba, tag); in mgmt_open_connection()
222 static int beiscsi_exec_nemb_cmd(struct beiscsi_hba *phba, in beiscsi_exec_nemb_cmd() argument
228 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_exec_nemb_cmd()
235 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_exec_nemb_cmd()
252 tag_mem = &phba->ctrl.ptag_state[tag].tag_mem_state; in beiscsi_exec_nemb_cmd()
259 be_mcc_notify(phba, tag); in beiscsi_exec_nemb_cmd()
266 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, nonemb_cmd); in beiscsi_exec_nemb_cmd()
274 static int beiscsi_prep_nemb_cmd(struct beiscsi_hba *phba, in beiscsi_prep_nemb_cmd() argument
278 cmd->va = dma_alloc_coherent(&phba->ctrl.pdev->dev, size, &cmd->dma, in beiscsi_prep_nemb_cmd()
281 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_prep_nemb_cmd()
287 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_prep_nemb_cmd()
293 static void beiscsi_free_nemb_cmd(struct beiscsi_hba *phba, in beiscsi_free_nemb_cmd() argument
303 dma_free_coherent(&phba->ctrl.pdev->dev, cmd->size, cmd->va, cmd->dma); in beiscsi_free_nemb_cmd()
306 static void __beiscsi_eq_delay_compl(struct beiscsi_hba *phba, unsigned int tag) in __beiscsi_eq_delay_compl() argument
311 __beiscsi_mcc_compl_status(phba, tag, NULL, NULL); in __beiscsi_eq_delay_compl()
312 tag_mem = &phba->ctrl.ptag_state[tag].tag_mem_state; in __beiscsi_eq_delay_compl()
314 dma_free_coherent(&phba->pcidev->dev, tag_mem->size, in __beiscsi_eq_delay_compl()
320 int beiscsi_modify_eq_delay(struct beiscsi_hba *phba, in beiscsi_modify_eq_delay() argument
327 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_COMMON, in beiscsi_modify_eq_delay()
341 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, __beiscsi_eq_delay_compl, in beiscsi_modify_eq_delay()
348 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_modify_eq_delay()
360 int beiscsi_get_initiator_name(struct beiscsi_hba *phba, char *name, bool cfg) in beiscsi_get_initiator_name() argument
367 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI_INI, in beiscsi_get_initiator_name()
375 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, in beiscsi_get_initiator_name()
377 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_get_initiator_name()
379 beiscsi_log(phba, KERN_ERR, in beiscsi_get_initiator_name()
388 unsigned int beiscsi_if_get_handle(struct beiscsi_hba *phba) in beiscsi_if_get_handle() argument
390 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_if_get_handle()
399 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_if_get_handle()
410 be_mcc_notify(phba, tag); in beiscsi_if_get_handle()
413 status = beiscsi_mccq_compl_wait(phba, tag, &wrb, NULL); in beiscsi_if_get_handle()
415 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_get_handle()
422 phba->interface_handle = pbe_allid->if_hndl_list[0]; in beiscsi_if_get_handle()
437 static int beiscsi_if_mod_gw(struct beiscsi_hba *phba, in beiscsi_if_mod_gw() argument
444 rt_val = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI, in beiscsi_if_mod_gw()
455 rt_val = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, NULL, 0); in beiscsi_if_mod_gw()
456 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rt_val); in beiscsi_if_mod_gw()
460 int beiscsi_if_set_gw(struct beiscsi_hba *phba, u32 ip_type, u8 *gw) in beiscsi_if_set_gw() argument
466 rt_val = beiscsi_if_get_gw(phba, ip_type, &gw_resp); in beiscsi_if_set_gw()
468 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_set_gw()
474 rt_val = beiscsi_if_mod_gw(phba, IP_ACTION_DEL, ip_type, in beiscsi_if_set_gw()
477 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_set_gw()
483 rt_val = beiscsi_if_mod_gw(phba, IP_ACTION_ADD, ip_type, gw); in beiscsi_if_set_gw()
485 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_set_gw()
491 int beiscsi_if_get_gw(struct beiscsi_hba *phba, u32 ip_type, in beiscsi_if_get_gw() argument
498 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI, in beiscsi_if_get_gw()
507 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, resp, in beiscsi_if_get_gw()
509 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_if_get_gw()
514 beiscsi_if_clr_ip(struct beiscsi_hba *phba, in beiscsi_if_clr_ip() argument
521 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI, in beiscsi_if_clr_ip()
531 phba->interface_handle; in beiscsi_if_clr_ip()
541 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, NULL, 0); in beiscsi_if_clr_ip()
543 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_if_clr_ip()
547 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_if_clr_ip()
552 beiscsi_if_set_ip(struct beiscsi_hba *phba, u8 *ip, in beiscsi_if_set_ip() argument
560 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI, in beiscsi_if_set_ip()
570 phba->interface_handle; in beiscsi_if_set_ip()
580 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, NULL, 0); in beiscsi_if_set_ip()
586 __beiscsi_log(phba, KERN_ERR, in beiscsi_if_set_ip()
592 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_if_set_ip()
596 int beiscsi_if_en_static(struct beiscsi_hba *phba, u32 ip_type, in beiscsi_if_en_static() argument
604 rc = beiscsi_if_get_info(phba, ip_type, &if_info); in beiscsi_if_en_static()
609 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, in beiscsi_if_en_static()
617 reldhcp->interface_hndl = phba->interface_handle; in beiscsi_if_en_static()
619 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, NULL, 0); in beiscsi_if_en_static()
620 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_if_en_static()
622 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_en_static()
631 rc = beiscsi_if_clr_ip(phba, if_info); in beiscsi_if_en_static()
638 rc = beiscsi_if_set_ip(phba, ip, subnet, ip_type); in beiscsi_if_en_static()
644 int beiscsi_if_en_dhcp(struct beiscsi_hba *phba, u32 ip_type) in beiscsi_if_en_dhcp() argument
653 rc = beiscsi_if_get_info(phba, ip_type, &if_info); in beiscsi_if_en_dhcp()
658 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_en_dhcp()
665 rc = beiscsi_if_clr_ip(phba, if_info); in beiscsi_if_en_dhcp()
673 rc = beiscsi_if_get_gw(phba, if_info->ip_addr.ip_type, &gw_resp); in beiscsi_if_en_dhcp()
675 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_en_dhcp()
681 rc = beiscsi_if_mod_gw(phba, IP_ACTION_DEL, in beiscsi_if_en_dhcp()
684 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_if_en_dhcp()
690 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI, in beiscsi_if_en_dhcp()
699 dhcpreq->interface_hndl = phba->interface_handle; in beiscsi_if_en_dhcp()
701 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, NULL, 0); in beiscsi_if_en_dhcp()
702 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_if_en_dhcp()
720 int beiscsi_if_set_vlan(struct beiscsi_hba *phba, uint16_t vlan_tag) in beiscsi_if_set_vlan() argument
725 tag = be_cmd_set_vlan(phba, vlan_tag); in beiscsi_if_set_vlan()
727 beiscsi_log(phba, KERN_ERR, in beiscsi_if_set_vlan()
733 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL); in beiscsi_if_set_vlan()
735 beiscsi_log(phba, KERN_ERR, in beiscsi_if_set_vlan()
744 int beiscsi_if_get_info(struct beiscsi_hba *phba, int ip_type, in beiscsi_if_get_info() argument
752 rc = beiscsi_if_get_handle(phba); in beiscsi_if_get_info()
757 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, in beiscsi_if_get_info()
765 req->interface_hndl = phba->interface_handle; in beiscsi_if_get_info()
771 beiscsi_log(phba, KERN_ERR, in beiscsi_if_get_info()
775 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, in beiscsi_if_get_info()
780 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, *if_info, in beiscsi_if_get_info()
791 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_if_get_info()
795 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in beiscsi_if_get_info()
802 int mgmt_get_nic_conf(struct beiscsi_hba *phba, in mgmt_get_nic_conf() argument
808 rc = beiscsi_prep_nemb_cmd(phba, &nonemb_cmd, CMD_SUBSYSTEM_ISCSI, in mgmt_get_nic_conf()
814 rc = beiscsi_exec_nemb_cmd(phba, &nonemb_cmd, NULL, nic, sizeof(*nic)); in mgmt_get_nic_conf()
815 beiscsi_free_nemb_cmd(phba, &nonemb_cmd, rc); in mgmt_get_nic_conf()
819 static void beiscsi_boot_process_compl(struct beiscsi_hba *phba, in beiscsi_boot_process_compl() argument
829 if (!test_bit(BEISCSI_HBA_BOOT_WORK, &phba->state)) { in beiscsi_boot_process_compl()
830 __beiscsi_log(phba, KERN_ERR, in beiscsi_boot_process_compl()
832 __func__, phba->state); in beiscsi_boot_process_compl()
836 if (phba->boot_struct.tag != tag) { in beiscsi_boot_process_compl()
837 __beiscsi_log(phba, KERN_ERR, in beiscsi_boot_process_compl()
839 __func__, tag, phba->boot_struct.tag); in beiscsi_boot_process_compl()
842 bs = &phba->boot_struct; in beiscsi_boot_process_compl()
847 status = __beiscsi_mcc_compl_status(phba, tag, NULL, NULL); in beiscsi_boot_process_compl()
854 status = __beiscsi_mcc_compl_status(phba, tag, &wrb, NULL); in beiscsi_boot_process_compl()
867 status = __beiscsi_mcc_compl_status(phba, tag, NULL, in beiscsi_boot_process_compl()
875 __beiscsi_log(phba, KERN_ERR, in beiscsi_boot_process_compl()
880 dma_free_coherent(&phba->ctrl.pdev->dev, bs->nonemb_cmd.size, in beiscsi_boot_process_compl()
885 status = __beiscsi_mcc_compl_status(phba, tag, &wrb, NULL); in beiscsi_boot_process_compl()
889 __beiscsi_log(phba, KERN_ERR, in beiscsi_boot_process_compl()
905 __beiscsi_log(phba, KERN_ERR, in beiscsi_boot_process_compl()
911 clear_bit(BEISCSI_HBA_BOOT_WORK, &phba->state); in beiscsi_boot_process_compl()
914 schedule_work(&phba->boot_work); in beiscsi_boot_process_compl()
925 unsigned int beiscsi_boot_logout_sess(struct beiscsi_hba *phba) in beiscsi_boot_logout_sess() argument
927 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_boot_logout_sess()
933 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_boot_logout_sess()
945 req->session_handle = phba->boot_struct.boot_sess.session_handle; in beiscsi_boot_logout_sess()
947 phba->boot_struct.tag = tag; in beiscsi_boot_logout_sess()
951 be_mcc_notify(phba, tag); in beiscsi_boot_logout_sess()
964 unsigned int beiscsi_boot_reopen_sess(struct beiscsi_hba *phba) in beiscsi_boot_reopen_sess() argument
966 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_boot_reopen_sess()
972 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_boot_reopen_sess()
986 phba->boot_struct.tag = tag; in beiscsi_boot_reopen_sess()
990 be_mcc_notify(phba, tag); in beiscsi_boot_reopen_sess()
1005 unsigned int beiscsi_boot_get_sinfo(struct beiscsi_hba *phba) in beiscsi_boot_get_sinfo() argument
1007 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_boot_get_sinfo()
1015 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_boot_get_sinfo()
1021 nonemb_cmd = &phba->boot_struct.nonemb_cmd; in beiscsi_boot_get_sinfo()
1023 nonemb_cmd->va = dma_alloc_coherent(&phba->ctrl.pdev->dev, in beiscsi_boot_get_sinfo()
1039 req->session_handle = phba->boot_struct.s_handle; in beiscsi_boot_get_sinfo()
1044 phba->boot_struct.tag = tag; in beiscsi_boot_get_sinfo()
1048 be_mcc_notify(phba, tag); in beiscsi_boot_get_sinfo()
1053 unsigned int __beiscsi_boot_get_shandle(struct beiscsi_hba *phba, int async) in __beiscsi_boot_get_shandle() argument
1055 struct be_ctrl_info *ctrl = &phba->ctrl; in __beiscsi_boot_get_shandle()
1061 wrb = alloc_mcc_wrb(phba, &tag); in __beiscsi_boot_get_shandle()
1074 phba->boot_struct.tag = tag; in __beiscsi_boot_get_shandle()
1079 be_mcc_notify(phba, tag); in __beiscsi_boot_get_shandle()
1094 int beiscsi_boot_get_shandle(struct beiscsi_hba *phba, unsigned int *s_handle) in beiscsi_boot_get_shandle() argument
1103 tag = __beiscsi_boot_get_shandle(phba, 0); in beiscsi_boot_get_shandle()
1105 beiscsi_log(phba, KERN_ERR, in beiscsi_boot_get_shandle()
1111 rc = beiscsi_mccq_compl_wait(phba, tag, &wrb, NULL); in beiscsi_boot_get_shandle()
1113 beiscsi_log(phba, KERN_ERR, in beiscsi_boot_get_shandle()
1122 __beiscsi_log(phba, KERN_INFO, in beiscsi_boot_get_shandle()
1162 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_fw_ver_disp() local
1164 return snprintf(buf, PAGE_SIZE, "%s\n", phba->fw_ver_str); in beiscsi_fw_ver_disp()
1181 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_active_session_disp() local
1185 if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) { in beiscsi_active_session_disp()
1186 avlbl_cids = BEISCSI_ULP_AVLBL_CID(phba, ulp_num); in beiscsi_active_session_disp()
1187 total_cids = BEISCSI_GET_CID_COUNT(phba, ulp_num); in beiscsi_active_session_disp()
1213 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_free_session_disp() local
1217 if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) in beiscsi_free_session_disp()
1220 BEISCSI_ULP_AVLBL_CID(phba, ulp_num)); in beiscsi_free_session_disp()
1244 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_adap_family_disp() local
1246 dev_id = phba->pcidev->device; in beiscsi_adap_family_disp()
1278 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_phys_port_disp() local
1281 phba->fw_config.phys_port); in beiscsi_phys_port_disp()
1434 unsigned int beiscsi_invalidate_cxn(struct beiscsi_hba *phba, in beiscsi_invalidate_cxn() argument
1438 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_invalidate_cxn()
1443 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_invalidate_cxn()
1466 be_mcc_notify(phba, tag); in beiscsi_invalidate_cxn()
1471 unsigned int beiscsi_upload_cxn(struct beiscsi_hba *phba, in beiscsi_upload_cxn() argument
1474 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_upload_cxn()
1480 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_upload_cxn()
1495 be_mcc_notify(phba, tag); in beiscsi_upload_cxn()
1500 int beiscsi_mgmt_invalidate_icds(struct beiscsi_hba *phba, in beiscsi_mgmt_invalidate_icds() argument
1504 struct be_ctrl_info *ctrl = &phba->ctrl; in beiscsi_mgmt_invalidate_icds()
1516 nonemb_cmd.va = dma_alloc_coherent(&phba->ctrl.pdev->dev, in beiscsi_mgmt_invalidate_icds()
1520 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_EH, in beiscsi_mgmt_invalidate_icds()
1526 wrb = alloc_mcc_wrb(phba, &tag); in beiscsi_mgmt_invalidate_icds()
1529 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, in beiscsi_mgmt_invalidate_icds()
1551 be_mcc_notify(phba, tag); in beiscsi_mgmt_invalidate_icds()
1554 rc = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd); in beiscsi_mgmt_invalidate_icds()
1556 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, in beiscsi_mgmt_invalidate_icds()