Lines Matching refs:hba

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