Lines Matching refs:phba

43 	struct beiscsi_hba *phba;  in beiscsi_session_create()  local
54 phba = beiscsi_ep->phba; in beiscsi_session_create()
56 if (!beiscsi_hba_is_online(phba)) { in beiscsi_session_create()
57 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_session_create()
58 "BS_%d : HBA in error 0x%lx\n", phba->state); in beiscsi_session_create()
62 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_session_create()
64 if (cmds_max > beiscsi_ep->phba->params.wrbs_per_cxn) { in beiscsi_session_create()
65 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_session_create()
69 beiscsi_ep->phba->params.wrbs_per_cxn, in beiscsi_session_create()
70 beiscsi_ep->phba->params.wrbs_per_cxn); in beiscsi_session_create()
72 cmds_max = beiscsi_ep->phba->params.wrbs_per_cxn; in beiscsi_session_create()
75 shost = phba->shost; in beiscsi_session_create()
86 &phba->pcidev->dev, in beiscsi_session_create()
133 struct beiscsi_hba *phba; in beiscsi_conn_create() local
142 phba = iscsi_host_priv(shost); in beiscsi_conn_create()
144 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_create()
155 beiscsi_conn->phba = phba; in beiscsi_conn_create()
179 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_conn_bind() local
180 struct hwi_controller *phwi_ctrlr = phba->phwi_ctrlr; in beiscsi_conn_bind()
198 if (beiscsi_ep->phba != phba) { in beiscsi_conn_bind()
199 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_conn_bind()
201 beiscsi_ep->phba, phba); in beiscsi_conn_bind()
206 if (phba->conn_table[cri_index]) { in beiscsi_conn_bind()
207 if (beiscsi_conn != phba->conn_table[cri_index] || in beiscsi_conn_bind()
208 beiscsi_ep != phba->conn_table[cri_index]->ep) { in beiscsi_conn_bind()
209 __beiscsi_log(phba, KERN_ERR, in beiscsi_conn_bind()
214 phba->conn_table[cri_index]); in beiscsi_conn_bind()
229 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_bind()
232 phba->conn_table[cri_index] = beiscsi_conn; in beiscsi_conn_bind()
239 static int beiscsi_iface_create_ipv4(struct beiscsi_hba *phba) in beiscsi_iface_create_ipv4() argument
241 if (phba->ipv4_iface) in beiscsi_iface_create_ipv4()
244 phba->ipv4_iface = iscsi_create_iface(phba->shost, in beiscsi_iface_create_ipv4()
248 if (!phba->ipv4_iface) { in beiscsi_iface_create_ipv4()
249 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_iface_create_ipv4()
258 static int beiscsi_iface_create_ipv6(struct beiscsi_hba *phba) in beiscsi_iface_create_ipv6() argument
260 if (phba->ipv6_iface) in beiscsi_iface_create_ipv6()
263 phba->ipv6_iface = iscsi_create_iface(phba->shost, in beiscsi_iface_create_ipv6()
267 if (!phba->ipv6_iface) { in beiscsi_iface_create_ipv6()
268 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_iface_create_ipv6()
277 void beiscsi_iface_create_default(struct beiscsi_hba *phba) in beiscsi_iface_create_default() argument
281 if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V4, &if_info)) { in beiscsi_iface_create_default()
282 beiscsi_iface_create_ipv4(phba); in beiscsi_iface_create_default()
286 if (!beiscsi_if_get_info(phba, BEISCSI_IP_TYPE_V6, &if_info)) { in beiscsi_iface_create_default()
287 beiscsi_iface_create_ipv6(phba); in beiscsi_iface_create_default()
292 void beiscsi_iface_destroy_default(struct beiscsi_hba *phba) in beiscsi_iface_destroy_default() argument
294 if (phba->ipv6_iface) { in beiscsi_iface_destroy_default()
295 iscsi_destroy_iface(phba->ipv6_iface); in beiscsi_iface_destroy_default()
296 phba->ipv6_iface = NULL; in beiscsi_iface_destroy_default()
298 if (phba->ipv4_iface) { in beiscsi_iface_destroy_default()
299 iscsi_destroy_iface(phba->ipv4_iface); in beiscsi_iface_destroy_default()
300 phba->ipv4_iface = NULL; in beiscsi_iface_destroy_default()
320 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_iface_config_vlan() local
327 ret = beiscsi_if_set_vlan(phba, BEISCSI_VLAN_DISABLE); in beiscsi_iface_config_vlan()
330 ret = beiscsi_if_set_vlan(phba, in beiscsi_iface_config_vlan()
343 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_iface_config_ipv4() local
352 ret = beiscsi_iface_create_ipv4(phba); in beiscsi_iface_config_ipv4()
354 iscsi_destroy_iface(phba->ipv4_iface); in beiscsi_iface_config_ipv4()
355 phba->ipv4_iface = NULL; in beiscsi_iface_config_ipv4()
360 ret = beiscsi_if_set_gw(phba, BEISCSI_IP_TYPE_V4, gw); in beiscsi_iface_config_ipv4()
364 ret = beiscsi_if_en_dhcp(phba, BEISCSI_IP_TYPE_V4); in beiscsi_iface_config_ipv4()
367 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4, in beiscsi_iface_config_ipv4()
370 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_iface_config_ipv4()
381 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4, in beiscsi_iface_config_ipv4()
395 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V4, in beiscsi_iface_config_ipv4()
408 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_iface_config_ipv6() local
414 ret = beiscsi_iface_create_ipv6(phba); in beiscsi_iface_config_ipv6()
416 iscsi_destroy_iface(phba->ipv6_iface); in beiscsi_iface_config_ipv6()
417 phba->ipv6_iface = NULL; in beiscsi_iface_config_ipv6()
421 ret = beiscsi_if_en_static(phba, BEISCSI_IP_TYPE_V6, in beiscsi_iface_config_ipv6()
433 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_iface_set_param() local
438 if (!beiscsi_hba_is_online(phba)) { in beiscsi_iface_set_param()
439 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_iface_set_param()
440 "BS_%d : HBA in error 0x%lx\n", phba->state); in beiscsi_iface_set_param()
445 ret = beiscsi_if_get_handle(phba); in beiscsi_iface_set_param()
447 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_iface_set_param()
462 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_iface_set_param()
470 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_iface_set_param()
497 __beiscsi_log(phba, KERN_ERR, in beiscsi_iface_set_param()
511 static int __beiscsi_iface_get_param(struct beiscsi_hba *phba, in __beiscsi_iface_get_param() argument
521 len = beiscsi_if_get_info(phba, ip_type, &if_info); in __beiscsi_iface_get_param()
575 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_iface_get_param() local
581 if (!beiscsi_hba_is_online(phba)) { in beiscsi_iface_get_param()
582 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_iface_get_param()
583 "BS_%d : HBA in error 0x%lx\n", phba->state); in beiscsi_iface_get_param()
595 len = __beiscsi_iface_get_param(phba, iface, param, buf); in beiscsi_iface_get_param()
600 phba->ipv4_iface ? "enable" : "disable"); in beiscsi_iface_get_param()
603 phba->ipv6_iface ? "enable" : "disable"); in beiscsi_iface_get_param()
607 len = beiscsi_if_get_gw(phba, BEISCSI_IP_TYPE_V4, &gateway); in beiscsi_iface_get_param()
630 beiscsi_log(beiscsi_ep->phba, KERN_INFO, in beiscsi_ep_get_param()
656 struct beiscsi_hba *phba = NULL; in beiscsi_set_param() local
659 phba = ((struct beiscsi_conn *)conn->dd_data)->phba; in beiscsi_set_param()
660 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_set_param()
702 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_get_port_state() local
705 ihost->port_state = test_bit(BEISCSI_HBA_LINK_UP, &phba->state) ? in beiscsi_get_port_state()
716 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_get_port_speed() local
719 switch (phba->port_speed) { in beiscsi_get_port_speed()
753 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_get_host_param() local
756 if (!beiscsi_hba_is_online(phba)) { in beiscsi_get_host_param()
757 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
758 "BS_%d : HBA in error 0x%lx\n", phba->state); in beiscsi_get_host_param()
761 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
766 status = beiscsi_get_macaddr(buf, phba); in beiscsi_get_host_param()
768 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
775 status = beiscsi_get_initiator_name(phba, buf, true); in beiscsi_get_host_param()
777 status = beiscsi_get_initiator_name(phba, buf, false); in beiscsi_get_host_param()
779 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
799 int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba) in beiscsi_get_macaddr() argument
804 if (phba->mac_addr_set) in beiscsi_get_macaddr()
805 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN); in beiscsi_get_macaddr()
808 rc = mgmt_get_nic_conf(phba, &resp); in beiscsi_get_macaddr()
812 phba->mac_addr_set = true; in beiscsi_get_macaddr()
813 memcpy(phba->mac_address, resp.mac_address, ETH_ALEN); in beiscsi_get_macaddr()
814 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN); in beiscsi_get_macaddr()
828 struct beiscsi_hba *phba = NULL; in beiscsi_conn_get_stats() local
830 phba = ((struct beiscsi_conn *)conn->dd_data)->phba; in beiscsi_conn_get_stats()
831 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_get_stats()
904 struct beiscsi_hba *phba; in beiscsi_conn_start() local
906 phba = ((struct beiscsi_conn *)conn->dd_data)->phba; in beiscsi_conn_start()
908 if (!beiscsi_hba_is_online(phba)) { in beiscsi_conn_start()
909 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_start()
910 "BS_%d : HBA in error 0x%lx\n", phba->state); in beiscsi_conn_start()
913 beiscsi_log(beiscsi_conn->phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_start()
919 beiscsi_log(beiscsi_conn->phba, KERN_ERR, in beiscsi_conn_start()
934 static int beiscsi_get_cid(struct beiscsi_hba *phba) in beiscsi_get_cid() argument
941 cid_avlbl_ulp0 = (phba->cid_array_info[BEISCSI_ULP0]) ? in beiscsi_get_cid()
942 BEISCSI_ULP0_AVLBL_CID(phba) : 0; in beiscsi_get_cid()
943 cid_avlbl_ulp1 = (phba->cid_array_info[BEISCSI_ULP1]) ? in beiscsi_get_cid()
944 BEISCSI_ULP1_AVLBL_CID(phba) : 0; in beiscsi_get_cid()
952 if (!test_bit(cid_from_ulp, (void *)&phba->fw_config.ulp_supported)) in beiscsi_get_cid()
955 cid_info = phba->cid_array_info[cid_from_ulp]; in beiscsi_get_cid()
958 __beiscsi_log(phba, KERN_ERR, in beiscsi_get_cid()
965 if (cid_info->cid_alloc == BEISCSI_GET_CID_COUNT(phba, cid_from_ulp)) in beiscsi_get_cid()
976 static void beiscsi_put_cid(struct beiscsi_hba *phba, unsigned short cid) in beiscsi_put_cid() argument
984 phwi_ctrlr = phba->phwi_ctrlr; in beiscsi_put_cid()
988 cid_info = phba->cid_array_info[cid_post_ulp]; in beiscsi_put_cid()
991 __beiscsi_log(phba, KERN_ERR, in beiscsi_put_cid()
997 if (cid_info->cid_free == BEISCSI_GET_CID_COUNT(phba, cid_post_ulp)) in beiscsi_put_cid()
1008 struct beiscsi_hba *phba = beiscsi_ep->phba; in beiscsi_free_ep() local
1011 beiscsi_put_cid(phba, beiscsi_ep->ep_cid); in beiscsi_free_ep()
1012 beiscsi_ep->phba = NULL; in beiscsi_free_ep()
1014 phba->ep_array[BE_GET_CRI_FROM_CID(beiscsi_ep->ep_cid)] = NULL; in beiscsi_free_ep()
1051 struct beiscsi_hba *phba = beiscsi_ep->phba; in beiscsi_open_conn() local
1057 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1060 beiscsi_ep->ep_cid = beiscsi_get_cid(phba); in beiscsi_open_conn()
1062 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1067 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1071 phba->ep_array[BE_GET_CRI_FROM_CID in beiscsi_open_conn()
1076 if (is_chip_be2_be3r(phba)) in beiscsi_open_conn()
1081 nonemb_cmd.va = dma_alloc_coherent(&phba->ctrl.pdev->dev, in beiscsi_open_conn()
1086 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1095 tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd); in beiscsi_open_conn()
1097 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1101 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, in beiscsi_open_conn()
1107 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd); in beiscsi_open_conn()
1109 beiscsi_log(phba, KERN_ERR, in beiscsi_open_conn()
1114 dma_free_coherent(&phba->ctrl.pdev->dev, in beiscsi_open_conn()
1126 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1129 dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, in beiscsi_open_conn()
1146 struct beiscsi_hba *phba; in beiscsi_ep_connect() local
1157 phba = iscsi_host_priv(shost); in beiscsi_ep_connect()
1158 if (!beiscsi_hba_is_online(phba)) { in beiscsi_ep_connect()
1160 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_ep_connect()
1161 "BS_%d : HBA in error 0x%lx\n", phba->state); in beiscsi_ep_connect()
1164 if (!test_bit(BEISCSI_HBA_LINK_UP, &phba->state)) { in beiscsi_ep_connect()
1166 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_ep_connect()
1178 beiscsi_ep->phba = phba; in beiscsi_ep_connect()
1182 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_ep_connect()
1205 beiscsi_log(beiscsi_ep->phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_ep_poll()
1221 static void beiscsi_flush_cq(struct beiscsi_hba *phba) in beiscsi_flush_cq() argument
1228 phwi_ctrlr = phba->phwi_ctrlr; in beiscsi_flush_cq()
1231 for (i = 0; i < phba->num_cpus; i++) { in beiscsi_flush_cq()
1247 struct beiscsi_hba *phba = beiscsi_ep->phba; in beiscsi_conn_close() local
1257 tag = beiscsi_invalidate_cxn(phba, beiscsi_ep); in beiscsi_conn_close()
1259 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL); in beiscsi_conn_close()
1262 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_close()
1271 beiscsi_flush_cq(phba); in beiscsi_conn_close()
1278 tag = beiscsi_upload_cxn(phba, beiscsi_ep); in beiscsi_conn_close()
1280 ret = beiscsi_mccq_compl_wait(phba, tag, NULL, NULL); in beiscsi_conn_close()
1283 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_close()
1303 struct beiscsi_hba *phba; in beiscsi_ep_disconnect() local
1307 phba = beiscsi_ep->phba; in beiscsi_ep_disconnect()
1308 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_ep_disconnect()
1313 if (!phba->ep_array[cri_index]) { in beiscsi_ep_disconnect()
1314 __beiscsi_log(phba, KERN_ERR, in beiscsi_ep_disconnect()
1321 if (!beiscsi_hba_is_online(phba)) { in beiscsi_ep_disconnect()
1322 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_ep_disconnect()
1323 "BS_%d : HBA in error 0x%lx\n", phba->state); in beiscsi_ep_disconnect()
1330 __beiscsi_log(phba, KERN_ERR, in beiscsi_ep_disconnect()
1336 if (!phba->conn_table[cri_index]) in beiscsi_ep_disconnect()
1337 __beiscsi_log(phba, KERN_ERR, in beiscsi_ep_disconnect()
1340 phba->conn_table[cri_index] = NULL; in beiscsi_ep_disconnect()