Lines Matching refs:hba

82 void bnx2i_identify_device(struct bnx2i_hba *hba, struct cnic_dev *dev)  in bnx2i_identify_device()  argument
84 hba->cnic_dev_type = 0; in bnx2i_identify_device()
86 if (hba->pci_did == PCI_DEVICE_ID_NX2_5706 || in bnx2i_identify_device()
87 hba->pci_did == PCI_DEVICE_ID_NX2_5706S) { in bnx2i_identify_device()
88 set_bit(BNX2I_NX2_DEV_5706, &hba->cnic_dev_type); in bnx2i_identify_device()
89 } else if (hba->pci_did == PCI_DEVICE_ID_NX2_5708 || in bnx2i_identify_device()
90 hba->pci_did == PCI_DEVICE_ID_NX2_5708S) { in bnx2i_identify_device()
91 set_bit(BNX2I_NX2_DEV_5708, &hba->cnic_dev_type); in bnx2i_identify_device()
92 } else if (hba->pci_did == PCI_DEVICE_ID_NX2_5709 || in bnx2i_identify_device()
93 hba->pci_did == PCI_DEVICE_ID_NX2_5709S) { in bnx2i_identify_device()
94 set_bit(BNX2I_NX2_DEV_5709, &hba->cnic_dev_type); in bnx2i_identify_device()
95 hba->mail_queue_access = BNX2I_MQ_BIN_MODE; in bnx2i_identify_device()
98 set_bit(BNX2I_NX2_DEV_57710, &hba->cnic_dev_type); in bnx2i_identify_device()
101 hba->pci_did); in bnx2i_identify_device()
111 struct bnx2i_hba *hba = NULL; in get_adapter_list_head() local
120 hba = tmp_hba; in get_adapter_list_head()
126 return hba; in get_adapter_list_head()
137 struct bnx2i_hba *hba, *temp; in bnx2i_find_hba_for_cnic() local
140 list_for_each_entry_safe(hba, temp, &adapter_list, link) { in bnx2i_find_hba_for_cnic()
141 if (hba->cnic == cnic) { in bnx2i_find_hba_for_cnic()
143 return hba; in bnx2i_find_hba_for_cnic()
166 struct bnx2i_hba *hba = handle; in bnx2i_start() local
174 bnx2i_send_fw_iscsi_init_msg(hba); in bnx2i_start()
175 while (!test_bit(ADAPTER_STATE_UP, &hba->adapter_state) && in bnx2i_start()
176 !test_bit(ADAPTER_STATE_INIT_FAILED, &hba->adapter_state) && i--) in bnx2i_start()
188 static void bnx2i_chip_cleanup(struct bnx2i_hba *hba) in bnx2i_chip_cleanup() argument
193 if (hba->ofld_conns_active) { in bnx2i_chip_cleanup()
199 "connections\n", hba->netdev->name, in bnx2i_chip_cleanup()
200 hba->ofld_conns_active); in bnx2i_chip_cleanup()
201 mutex_lock(&hba->net_dev_lock); in bnx2i_chip_cleanup()
202 list_for_each_safe(pos, tmp, &hba->ep_active_list) { in bnx2i_chip_cleanup()
208 mutex_unlock(&hba->net_dev_lock); in bnx2i_chip_cleanup()
222 struct bnx2i_hba *hba = handle; in bnx2i_stop() local
228 &hba->adapter_state)) { in bnx2i_stop()
229 iscsi_host_for_each_session(hba->shost, in bnx2i_stop()
231 wait_delay = hba->hba_shutdown_tmo; in bnx2i_stop()
238 wait_event_interruptible_timeout(hba->eh_wait, in bnx2i_stop()
239 (list_empty(&hba->ep_ofld_list) && in bnx2i_stop()
240 list_empty(&hba->ep_destroy_list)), in bnx2i_stop()
246 while (hba->ofld_conns_active) { in bnx2i_stop()
247 conns_active = hba->ofld_conns_active; in bnx2i_stop()
248 wait_event_interruptible_timeout(hba->eh_wait, in bnx2i_stop()
249 (hba->ofld_conns_active != conns_active), in bnx2i_stop()
251 if (hba->ofld_conns_active == conns_active) in bnx2i_stop()
254 bnx2i_chip_cleanup(hba); in bnx2i_stop()
259 clear_bit(ADAPTER_STATE_GOING_DOWN, &hba->adapter_state); in bnx2i_stop()
260 clear_bit(ADAPTER_STATE_UP, &hba->adapter_state); in bnx2i_stop()
273 static int bnx2i_init_one(struct bnx2i_hba *hba, struct cnic_dev *cnic) in bnx2i_init_one() argument
280 "iSCSI\n", hba->netdev->name); in bnx2i_init_one()
285 hba->cnic = cnic; in bnx2i_init_one()
286 rc = cnic->register_device(cnic, CNIC_ULP_ISCSI, hba); in bnx2i_init_one()
288 hba->age++; in bnx2i_init_one()
289 set_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); in bnx2i_init_one()
290 list_add_tail(&hba->link, &adapter_list); in bnx2i_init_one()
294 "hba=%p, cnic=%p\n", hba, cnic); in bnx2i_init_one()
319 struct bnx2i_hba *hba; in bnx2i_ulp_init() local
322 hba = bnx2i_alloc_hba(dev); in bnx2i_ulp_init()
323 if (!hba) { in bnx2i_ulp_init()
329 clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); in bnx2i_ulp_init()
330 if (bnx2i_init_one(hba, dev)) { in bnx2i_ulp_init()
331 printk(KERN_ERR "bnx2i - hba %p init failed\n", hba); in bnx2i_ulp_init()
332 bnx2i_free_hba(hba); in bnx2i_ulp_init()
344 struct bnx2i_hba *hba; in bnx2i_ulp_exit() local
346 hba = bnx2i_find_hba_for_cnic(dev); in bnx2i_ulp_exit()
347 if (!hba) { in bnx2i_ulp_exit()
353 list_del_init(&hba->link); in bnx2i_ulp_exit()
356 if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { in bnx2i_ulp_exit()
357 hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); in bnx2i_ulp_exit()
358 clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); in bnx2i_ulp_exit()
362 bnx2i_free_hba(hba); in bnx2i_ulp_exit()
375 struct bnx2i_hba *hba = handle; in bnx2i_get_stats() local
378 if (!hba) in bnx2i_get_stats()
381 stats = (struct iscsi_stats_info *)hba->cnic->stats_addr; in bnx2i_get_stats()
387 memcpy(stats->mac_add1 + 2, hba->cnic->mac_addr, ETH_ALEN); in bnx2i_get_stats()
389 stats->max_frame_size = hba->netdev->mtu; in bnx2i_get_stats()
390 stats->txq_size = hba->max_sqes; in bnx2i_get_stats()
391 stats->rxq_size = hba->max_cqes; in bnx2i_get_stats()
396 GET_STATS_64(hba, stats, rx_pdus); in bnx2i_get_stats()
397 GET_STATS_64(hba, stats, rx_bytes); in bnx2i_get_stats()
399 GET_STATS_64(hba, stats, tx_pdus); in bnx2i_get_stats()
400 GET_STATS_64(hba, stats, tx_bytes); in bnx2i_get_stats()
525 struct bnx2i_hba *hba; in bnx2i_mod_exit() local
529 hba = list_entry(adapter_list.next, struct bnx2i_hba, link); in bnx2i_mod_exit()
530 list_del(&hba->link); in bnx2i_mod_exit()
533 if (test_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic)) { in bnx2i_mod_exit()
534 bnx2i_chip_cleanup(hba); in bnx2i_mod_exit()
535 hba->cnic->unregister_device(hba->cnic, CNIC_ULP_ISCSI); in bnx2i_mod_exit()
536 clear_bit(BNX2I_CNIC_REGISTERED, &hba->reg_with_cnic); in bnx2i_mod_exit()
539 bnx2i_free_hba(hba); in bnx2i_mod_exit()