Lines Matching refs:phba
48 struct beiscsi_hba *phba; in beiscsi_session_create() local
60 phba = beiscsi_ep->phba; in beiscsi_session_create()
62 if (phba->state & BE_ADAPTER_PCI_ERR) { in beiscsi_session_create()
63 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_session_create()
67 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_session_create()
71 if (cmds_max > beiscsi_ep->phba->params.wrbs_per_cxn) { in beiscsi_session_create()
72 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_session_create()
76 beiscsi_ep->phba->params.wrbs_per_cxn, in beiscsi_session_create()
77 beiscsi_ep->phba->params.wrbs_per_cxn); in beiscsi_session_create()
79 cmds_max = beiscsi_ep->phba->params.wrbs_per_cxn; in beiscsi_session_create()
82 shost = phba->shost; in beiscsi_session_create()
93 phba->pcidev, in beiscsi_session_create()
130 struct beiscsi_hba *phba; in beiscsi_conn_create() local
139 phba = iscsi_host_priv(shost); in beiscsi_conn_create()
141 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_create()
152 beiscsi_conn->phba = phba; in beiscsi_conn_create()
166 static int beiscsi_bindconn_cid(struct beiscsi_hba *phba, in beiscsi_bindconn_cid() argument
172 if (phba->conn_table[cri_index]) { in beiscsi_bindconn_cid()
173 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_bindconn_cid()
178 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_bindconn_cid()
182 phba->conn_table[cri_index] = beiscsi_conn; in beiscsi_bindconn_cid()
202 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_conn_bind() local
203 struct hwi_controller *phwi_ctrlr = phba->phwi_ctrlr; in beiscsi_conn_bind()
217 if (beiscsi_ep->phba != phba) { in beiscsi_conn_bind()
218 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_conn_bind()
220 beiscsi_ep->phba, phba); in beiscsi_conn_bind()
233 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_bind()
237 return beiscsi_bindconn_cid(phba, beiscsi_conn, beiscsi_ep->ep_cid); in beiscsi_conn_bind()
240 static int beiscsi_create_ipv4_iface(struct beiscsi_hba *phba) in beiscsi_create_ipv4_iface() argument
242 if (phba->ipv4_iface) in beiscsi_create_ipv4_iface()
245 phba->ipv4_iface = iscsi_create_iface(phba->shost, in beiscsi_create_ipv4_iface()
249 if (!phba->ipv4_iface) { in beiscsi_create_ipv4_iface()
250 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_create_ipv4_iface()
259 static int beiscsi_create_ipv6_iface(struct beiscsi_hba *phba) in beiscsi_create_ipv6_iface() argument
261 if (phba->ipv6_iface) in beiscsi_create_ipv6_iface()
264 phba->ipv6_iface = iscsi_create_iface(phba->shost, in beiscsi_create_ipv6_iface()
268 if (!phba->ipv6_iface) { in beiscsi_create_ipv6_iface()
269 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_create_ipv6_iface()
278 void beiscsi_create_def_ifaces(struct beiscsi_hba *phba) in beiscsi_create_def_ifaces() argument
282 if (!mgmt_get_if_info(phba, BE2_IPV4, &if_info)) { in beiscsi_create_def_ifaces()
283 beiscsi_create_ipv4_iface(phba); in beiscsi_create_def_ifaces()
287 if (!mgmt_get_if_info(phba, BE2_IPV6, &if_info)) { in beiscsi_create_def_ifaces()
288 beiscsi_create_ipv6_iface(phba); in beiscsi_create_def_ifaces()
293 void beiscsi_destroy_def_ifaces(struct beiscsi_hba *phba) in beiscsi_destroy_def_ifaces() argument
295 if (phba->ipv6_iface) in beiscsi_destroy_def_ifaces()
296 iscsi_destroy_iface(phba->ipv6_iface); in beiscsi_destroy_def_ifaces()
297 if (phba->ipv4_iface) in beiscsi_destroy_def_ifaces()
298 iscsi_destroy_iface(phba->ipv4_iface); in beiscsi_destroy_def_ifaces()
306 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_set_static_ip() local
336 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_set_static_ip()
342 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_set_static_ip()
347 ret = mgmt_set_ip(phba, iface_ip, iface_subnet, in beiscsi_set_static_ip()
369 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_set_vlan_tag() local
373 if (mgmt_get_all_if_id(phba)) { in beiscsi_set_vlan_tag()
374 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_set_vlan_tag()
382 ret = mgmt_set_vlan(phba, BEISCSI_VLAN_DISABLE); in beiscsi_set_vlan_tag()
385 ret = mgmt_set_vlan(phba, in beiscsi_set_vlan_tag()
389 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_set_vlan_tag()
403 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_set_ipv4() local
409 ret = mgmt_set_gateway(phba, iface_param); in beiscsi_set_ipv4()
413 ret = mgmt_set_ip(phba, iface_param, in beiscsi_set_ipv4()
419 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_set_ipv4()
425 ret = beiscsi_create_ipv4_iface(phba); in beiscsi_set_ipv4()
427 iscsi_destroy_iface(phba->ipv4_iface); in beiscsi_set_ipv4()
439 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_set_ipv4()
452 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_set_ipv6() local
458 ret = beiscsi_create_ipv6_iface(phba); in beiscsi_set_ipv6()
460 iscsi_destroy_iface(phba->ipv6_iface); in beiscsi_set_ipv6()
465 ret = mgmt_set_ip(phba, iface_param, NULL, in beiscsi_set_ipv6()
469 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_set_ipv6()
481 struct beiscsi_hba *phba = iscsi_host_priv(shost); in be2iscsi_iface_set_param() local
486 if (phba->state & BE_ADAPTER_PCI_ERR) { in be2iscsi_iface_set_param()
487 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in be2iscsi_iface_set_param()
502 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in be2iscsi_iface_set_param()
520 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in be2iscsi_iface_set_param()
533 static int be2iscsi_get_if_param(struct beiscsi_hba *phba, in be2iscsi_get_if_param() argument
543 len = mgmt_get_if_info(phba, ip_type, &if_info); in be2iscsi_get_if_param()
597 struct beiscsi_hba *phba = iscsi_host_priv(shost); in be2iscsi_iface_get_param() local
601 if (phba->state & BE_ADAPTER_PCI_ERR) { in be2iscsi_iface_get_param()
602 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in be2iscsi_iface_get_param()
615 len = be2iscsi_get_if_param(phba, iface, param, buf); in be2iscsi_iface_get_param()
622 len = mgmt_get_gateway(phba, BE2_IPV4, &gateway); in be2iscsi_iface_get_param()
647 beiscsi_log(beiscsi_ep->phba, KERN_INFO, in beiscsi_ep_get_param()
673 struct beiscsi_hba *phba = NULL; in beiscsi_set_param() local
676 phba = ((struct beiscsi_conn *)conn->dd_data)->phba; in beiscsi_set_param()
677 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_set_param()
718 static int beiscsi_get_initname(char *buf, struct beiscsi_hba *phba) in beiscsi_get_initname() argument
725 tag = be_cmd_get_initname(phba); in beiscsi_get_initname()
727 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_initname()
733 rc = beiscsi_mccq_compl(phba, tag, &wrb, NULL); in beiscsi_get_initname()
735 beiscsi_log(phba, KERN_ERR, in beiscsi_get_initname()
753 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_get_port_state() local
756 ihost->port_state = (phba->state == BE_ADAPTER_LINK_UP) ? in beiscsi_get_port_state()
772 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_get_port_speed() local
775 tag = be_cmd_get_port_speed(phba); in beiscsi_get_port_speed()
777 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_port_speed()
782 rc = beiscsi_mccq_compl(phba, tag, &wrb, NULL); in beiscsi_get_port_speed()
784 beiscsi_log(phba, KERN_ERR, in beiscsi_get_port_speed()
821 struct beiscsi_hba *phba = iscsi_host_priv(shost); in beiscsi_get_host_param() local
825 if (phba->state & BE_ADAPTER_PCI_ERR) { in beiscsi_get_host_param()
826 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
830 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
837 status = beiscsi_get_macaddr(buf, phba); in beiscsi_get_host_param()
839 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
845 status = beiscsi_get_initname(buf, phba); in beiscsi_get_host_param()
847 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
859 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_get_host_param()
871 int beiscsi_get_macaddr(char *buf, struct beiscsi_hba *phba) in beiscsi_get_macaddr() argument
876 if (phba->mac_addr_set) in beiscsi_get_macaddr()
877 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN); in beiscsi_get_macaddr()
880 rc = mgmt_get_nic_conf(phba, &resp); in beiscsi_get_macaddr()
884 phba->mac_addr_set = true; in beiscsi_get_macaddr()
885 memcpy(phba->mac_address, resp.mac_address, ETH_ALEN); in beiscsi_get_macaddr()
886 return sysfs_format_mac(buf, phba->mac_address, ETH_ALEN); in beiscsi_get_macaddr()
900 struct beiscsi_hba *phba = NULL; in beiscsi_conn_get_stats() local
902 phba = ((struct beiscsi_conn *)conn->dd_data)->phba; in beiscsi_conn_get_stats()
903 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_conn_get_stats()
976 struct beiscsi_hba *phba; in beiscsi_conn_start() local
978 phba = ((struct beiscsi_conn *)conn->dd_data)->phba; in beiscsi_conn_start()
980 if (phba->state & BE_ADAPTER_PCI_ERR) { in beiscsi_conn_start()
981 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_conn_start()
985 beiscsi_log(beiscsi_conn->phba, KERN_INFO, in beiscsi_conn_start()
993 beiscsi_log(beiscsi_conn->phba, KERN_ERR, in beiscsi_conn_start()
1008 static int beiscsi_get_cid(struct beiscsi_hba *phba) in beiscsi_get_cid() argument
1015 cid_avlbl_ulp0 = (phba->cid_array_info[BEISCSI_ULP0]) ? in beiscsi_get_cid()
1016 BEISCSI_ULP0_AVLBL_CID(phba) : 0; in beiscsi_get_cid()
1017 cid_avlbl_ulp1 = (phba->cid_array_info[BEISCSI_ULP1]) ? in beiscsi_get_cid()
1018 BEISCSI_ULP1_AVLBL_CID(phba) : 0; in beiscsi_get_cid()
1022 if (test_bit(cid_from_ulp, (void *)&phba->fw_config.ulp_supported)) { in beiscsi_get_cid()
1023 cid_info = phba->cid_array_info[cid_from_ulp]; in beiscsi_get_cid()
1030 phba, cid_from_ulp)) in beiscsi_get_cid()
1043 static void beiscsi_put_cid(struct beiscsi_hba *phba, unsigned short cid) in beiscsi_put_cid() argument
1051 phwi_ctrlr = phba->phwi_ctrlr; in beiscsi_put_cid()
1055 cid_info = phba->cid_array_info[cid_post_ulp]; in beiscsi_put_cid()
1059 if (cid_info->cid_free == BEISCSI_GET_CID_COUNT(phba, cid_post_ulp)) in beiscsi_put_cid()
1069 struct beiscsi_hba *phba = beiscsi_ep->phba; in beiscsi_free_ep() local
1072 beiscsi_put_cid(phba, beiscsi_ep->ep_cid); in beiscsi_free_ep()
1073 beiscsi_ep->phba = NULL; in beiscsi_free_ep()
1074 phba->ep_array[BE_GET_CRI_FROM_CID in beiscsi_free_ep()
1106 struct beiscsi_hba *phba = beiscsi_ep->phba; in beiscsi_open_conn() local
1112 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1115 beiscsi_ep->ep_cid = beiscsi_get_cid(phba); in beiscsi_open_conn()
1117 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1122 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1126 phba->ep_array[BE_GET_CRI_FROM_CID in beiscsi_open_conn()
1131 if (is_chip_be2_be3r(phba)) in beiscsi_open_conn()
1136 nonemb_cmd.va = pci_alloc_consistent(phba->ctrl.pdev, in beiscsi_open_conn()
1141 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1150 tag = mgmt_open_connection(phba, dst_addr, beiscsi_ep, &nonemb_cmd); in beiscsi_open_conn()
1152 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1156 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, in beiscsi_open_conn()
1162 ret = beiscsi_mccq_compl(phba, tag, NULL, &nonemb_cmd); in beiscsi_open_conn()
1164 beiscsi_log(phba, KERN_ERR, in beiscsi_open_conn()
1169 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, in beiscsi_open_conn()
1180 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_open_conn()
1183 pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, in beiscsi_open_conn()
1200 struct beiscsi_hba *phba; in beiscsi_ep_connect() local
1206 phba = iscsi_host_priv(shost); in beiscsi_ep_connect()
1214 if (beiscsi_error(phba)) { in beiscsi_ep_connect()
1216 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_ep_connect()
1221 if (phba->state & BE_ADAPTER_PCI_ERR) { in beiscsi_ep_connect()
1223 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_ep_connect()
1226 } else if (phba->state & BE_ADAPTER_LINK_DOWN) { in beiscsi_ep_connect()
1228 beiscsi_log(phba, KERN_WARNING, BEISCSI_LOG_CONFIG, in beiscsi_ep_connect()
1240 beiscsi_ep->phba = phba; in beiscsi_ep_connect()
1244 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_ep_connect()
1267 beiscsi_log(beiscsi_ep->phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_ep_poll()
1283 static void beiscsi_flush_cq(struct beiscsi_hba *phba) in beiscsi_flush_cq() argument
1290 phwi_ctrlr = phba->phwi_ctrlr; in beiscsi_flush_cq()
1293 for (i = 0; i < phba->num_cpus; i++) { in beiscsi_flush_cq()
1310 struct beiscsi_hba *phba = beiscsi_ep->phba; in beiscsi_close_conn() local
1312 tag = mgmt_upload_connection(phba, beiscsi_ep->ep_cid, flag); in beiscsi_close_conn()
1314 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_close_conn()
1321 ret = beiscsi_mccq_compl(phba, tag, NULL, NULL); in beiscsi_close_conn()
1324 beiscsi_flush_cq(phba); in beiscsi_close_conn()
1334 static int beiscsi_unbind_conn_to_cid(struct beiscsi_hba *phba, in beiscsi_unbind_conn_to_cid() argument
1339 if (phba->conn_table[cri_index]) in beiscsi_unbind_conn_to_cid()
1340 phba->conn_table[cri_index] = NULL; in beiscsi_unbind_conn_to_cid()
1342 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_unbind_conn_to_cid()
1359 struct beiscsi_hba *phba; in beiscsi_ep_disconnect() local
1365 phba = beiscsi_ep->phba; in beiscsi_ep_disconnect()
1366 beiscsi_log(phba, KERN_INFO, BEISCSI_LOG_CONFIG, in beiscsi_ep_disconnect()
1380 if (phba->state & BE_ADAPTER_PCI_ERR) { in beiscsi_ep_disconnect()
1381 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_ep_disconnect()
1386 tag = mgmt_invalidate_connection(phba, beiscsi_ep, in beiscsi_ep_disconnect()
1391 beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, in beiscsi_ep_disconnect()
1396 beiscsi_mccq_compl(phba, tag, NULL, NULL); in beiscsi_ep_disconnect()
1401 beiscsi_unbind_conn_to_cid(phba, beiscsi_ep->ep_cid); in beiscsi_ep_disconnect()