Lines Matching refs:hba

37 static void emlxs_timer_check_loopback(emlxs_hba_t *hba);
43 static void emlxs_timer_check_pools(emlxs_hba_t *hba);
45 static void emlxs_timer_check_fw_update(emlxs_hba_t *hba);
46 static void emlxs_timer_check_heartbeat(emlxs_hba_t *hba);
47 static uint32_t emlxs_timer_check_pkts(emlxs_hba_t *hba, uint8_t *flag);
49 static void emlxs_timer_check_linkup(emlxs_hba_t *hba);
53 static void emlxs_timer_check_channels(emlxs_hba_t *hba, uint8_t *flag);
58 static void emlxs_tx_watchdog(emlxs_hba_t *hba);
62 emlxs_timeout(emlxs_hba_t *hba, uint32_t timeout) in emlxs_timeout() argument
83 emlxs_hba_t *hba = (emlxs_hba_t *)arg; in emlxs_timer() local
86 if (!hba->timer_id) { in emlxs_timer()
93 if (hba->timer_flags & EMLXS_TIMER_BUSY) { in emlxs_timer()
99 if (hba->timer_flags & EMLXS_TIMER_KILL) { in emlxs_timer()
100 hba->timer_id = 0; in emlxs_timer()
101 hba->timer_tics = 0; in emlxs_timer()
102 hba->timer_flags |= EMLXS_TIMER_ENDED; in emlxs_timer()
108 hba->timer_flags |= (EMLXS_TIMER_BUSY | EMLXS_TIMER_STARTED); in emlxs_timer()
109 hba->timer_tics = DRV_TIME; in emlxs_timer()
112 if (hba->io_active & 0x80000000) { in emlxs_timer()
114 "Timer: io_active=0x%x. Reset to zero.", hba->io_active); in emlxs_timer()
115 hba->io_active = 0; in emlxs_timer()
120 EMLXS_SLI_POLL_ERRATT(hba); in emlxs_timer()
123 emlxs_timer_checks(hba); in emlxs_timer()
128 hba->timer_flags &= ~EMLXS_TIMER_BUSY; in emlxs_timer()
131 if (!(hba->timer_flags & EMLXS_TIMER_KILL)) { in emlxs_timer()
132 hba->timer_id = in emlxs_timer()
133 timeout(emlxs_timer, (void *)hba, in emlxs_timer()
136 hba->timer_id = 0; in emlxs_timer()
137 hba->timer_flags |= EMLXS_TIMER_ENDED; in emlxs_timer()
148 emlxs_timer_checks(emlxs_hba_t *hba) in emlxs_timer_checks() argument
156 if (hba->state < FC_LINK_DOWN) { in emlxs_timer_checks()
163 EMLXS_SLI_TIMER(hba); in emlxs_timer_checks()
166 emlxs_timer_check_events(hba); in emlxs_timer_checks()
169 emlxs_timer_check_heartbeat(hba); in emlxs_timer_checks()
172 emlxs_timer_check_fw_update(hba); in emlxs_timer_checks()
175 emlxs_pm_idle_timer(hba); in emlxs_timer_checks()
179 emlxs_timer_check_loopback(hba); in emlxs_timer_checks()
182 rc = emlxs_timer_check_pkts(hba, flag); in emlxs_timer_checks()
190 emlxs_timer_check_linkup(hba); in emlxs_timer_checks()
220 emlxs_timer_check_pools(hba); in emlxs_timer_checks()
224 emlxs_timer_check_channels(hba, flag); in emlxs_timer_checks()
232 emlxs_timer_start(emlxs_hba_t *hba) in emlxs_timer_start() argument
234 if (hba->timer_id) { in emlxs_timer_start()
240 if (!hba->timer_id) { in emlxs_timer_start()
241 hba->timer_flags = 0; in emlxs_timer_start()
242 hba->timer_id = in emlxs_timer_start()
243 timeout(emlxs_timer, (void *)hba, drv_usectohz(1000000)); in emlxs_timer_start()
251 emlxs_timer_stop(emlxs_hba_t *hba) in emlxs_timer_stop() argument
253 if (!hba->timer_id) { in emlxs_timer_stop()
258 hba->timer_flags |= EMLXS_TIMER_KILL; in emlxs_timer_stop()
260 while (hba->timer_id) { in emlxs_timer_stop()
273 emlxs_timer_check_pkts(emlxs_hba_t *hba, uint8_t *flag) in emlxs_timer_check_pkts() argument
295 if (hba->pkt_timer > hba->timer_tics) { in emlxs_timer_check_pkts()
299 hba->pkt_timer = hba->timer_tics + EMLXS_PKT_PERIOD; in emlxs_timer_check_pkts()
311 for (channelno = 0; channelno < hba->chan_count; channelno++) { in emlxs_timer_check_pkts()
312 cp = &hba->chan[channelno]; in emlxs_timer_check_pkts()
330 if (sbp && hba->timer_tics >= sbp->ticks) { in emlxs_timer_check_pkts()
389 if (sbp && hba->timer_tics >= sbp->ticks) { in emlxs_timer_check_pkts()
455 if (hba->sli_mode == EMLXS_HBA_SLI4_MODE) { in emlxs_timer_check_pkts()
495 if (hba->state >= FC_LINK_UP) { in emlxs_timer_check_pkts()
517 for (iotag = 1; iotag < hba->max_iotag; iotag++) { in emlxs_timer_check_pkts()
518 sbp = hba->fc_table[iotag]; in emlxs_timer_check_pkts()
539 hba->fc_table[iotag] = STALE_PACKET; in emlxs_timer_check_pkts()
540 hba->io_count--; in emlxs_timer_check_pkts()
545 (hba->timer_tics >= sbp->ticks)) { in emlxs_timer_check_pkts()
572 for (channelno = 0; channelno < hba->chan_count; channelno++) { in emlxs_timer_check_pkts()
576 cp = &hba->chan[channelno]; in emlxs_timer_check_pkts()
578 EMLXS_SLI_ISSUE_IOCB_CMD(hba, cp, 0); in emlxs_timer_check_pkts()
584 if (!(hba->reset_request & (FC_LINK_RESET | FC_PORT_RESET))) { in emlxs_timer_check_pkts()
585 hba->reset_request |= FC_LINK_RESET; in emlxs_timer_check_pkts()
588 emlxs_thread_spawn(hba, emlxs_reset_link_thread, NULL, in emlxs_timer_check_pkts()
596 if (!(hba->reset_request & FC_PORT_RESET)) { in emlxs_timer_check_pkts()
597 hba->reset_request |= FC_PORT_RESET; in emlxs_timer_check_pkts()
600 emlxs_thread_spawn(hba, emlxs_restart_thread, NULL, in emlxs_timer_check_pkts()
614 emlxs_timer_check_channels(emlxs_hba_t *hba, uint8_t *flag) in emlxs_timer_check_channels() argument
626 for (channelno = 0; channelno < hba->chan_count; channelno++) { in emlxs_timer_check_channels()
627 cp = &hba->chan[channelno]; in emlxs_timer_check_channels()
633 if (cp->timeout && (hba->timer_tics >= cp->timeout)) { in emlxs_timer_check_channels()
638 cp->timeout = hba->timer_tics + 10; in emlxs_timer_check_channels()
640 if (hba->state >= FC_LINK_UP) { in emlxs_timer_check_channels()
654 hba->channel_tx_count, in emlxs_timer_check_channels()
655 hba->io_count); in emlxs_timer_check_channels()
663 EMLXS_SLI_ISSUE_IOCB_CMD(hba, cp, 0); in emlxs_timer_check_channels()
675 emlxs_hba_t *hba = HBA; in emlxs_timer_check_nodes() local
707 channelno < hba->chan_count; in emlxs_timer_check_nodes()
712 (hba->timer_tics >= in emlxs_timer_check_nodes()
723 (hba->timer_tics >= nlp->nlp_force_rscn)) { in emlxs_timer_check_nodes()
758 emlxs_timer_check_loopback(emlxs_hba_t *hba) in emlxs_timer_check_loopback() argument
771 if (!hba->loopback_tics || (hba->timer_tics < hba->loopback_tics)) { in emlxs_timer_check_loopback()
776 hba->loopback_tics = 0; in emlxs_timer_check_loopback()
778 if (hba->flag & FC_LOOPBACK_MODE) { in emlxs_timer_check_loopback()
796 emlxs_timer_check_linkup(emlxs_hba_t *hba) in emlxs_timer_check_linkup() argument
802 if (hba->model_info.sli_mask & EMLXS_SLI4_MASK) { in emlxs_timer_check_linkup()
804 if (hba->mbox_queue.q_first) { in emlxs_timer_check_linkup()
814 if (hba->linkup_timer && (hba->timer_tics >= hba->linkup_timer)) { in emlxs_timer_check_linkup()
815 hba->linkup_timer = 0; in emlxs_timer_check_linkup()
818 if (hba->state >= FC_LINK_UP) { in emlxs_timer_check_linkup()
834 emlxs_timer_check_heartbeat(emlxs_hba_t *hba) in emlxs_timer_check_heartbeat() argument
845 if (hba->timer_tics < hba->heartbeat_timer) { in emlxs_timer_check_heartbeat()
849 hba->heartbeat_timer = hba->timer_tics + 5; in emlxs_timer_check_heartbeat()
852 if (hba->heartbeat_flag) { in emlxs_timer_check_heartbeat()
853 hba->heartbeat_flag = 0; in emlxs_timer_check_heartbeat()
860 if (hba->mbox_timer) { in emlxs_timer_check_heartbeat()
865 if (hba->heartbeat_active) { in emlxs_timer_check_heartbeat()
869 if ((mbq = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX)) == 0) { in emlxs_timer_check_heartbeat()
875 emlxs_mb_heartbeat(hba, mbq); in emlxs_timer_check_heartbeat()
876 hba->heartbeat_active = 1; in emlxs_timer_check_heartbeat()
878 rc = EMLXS_SLI_ISSUE_MBOX_CMD(hba, mbq, MBX_NOWAIT, 0); in emlxs_timer_check_heartbeat()
880 emlxs_mem_put(hba, MEM_MBOX, (void *)mbq); in emlxs_timer_check_heartbeat()
889 emlxs_timer_check_fw_update(emlxs_hba_t *hba) in emlxs_timer_check_fw_update() argument
894 if (!(hba->fw_flag & FW_UPDATE_NEEDED)) { in emlxs_timer_check_fw_update()
895 hba->fw_timer = 0; in emlxs_timer_check_fw_update()
899 if (hba->timer_tics < hba->fw_timer) { in emlxs_timer_check_fw_update()
920 DRIVER_NAME, hba->ddiinst, msgbuf); in emlxs_timer_check_fw_update()
923 hba->fw_timer = hba->timer_tics + (60 * 60 * 24); in emlxs_timer_check_fw_update()
933 emlxs_hba_t *hba = HBA; in emlxs_timer_check_discovery() local
949 while (hba->discovery_timer && in emlxs_timer_check_discovery()
950 (hba->timer_tics >= hba->discovery_timer) && in emlxs_timer_check_discovery()
951 (hba->state == FC_LINK_UP)) { in emlxs_timer_check_discovery()
961 (nlp->nlp_flag[hba->channel_fcp] & in emlxs_timer_check_discovery()
994 if ((hba->sli_mode < EMLXS_HBA_SLI4_MODE) && (send_clear_la == 1) && in emlxs_timer_check_discovery()
995 (mbox = (MAILBOXQ *)emlxs_mem_get(hba, MEM_MBOX))) { in emlxs_timer_check_discovery()
1002 if (hba->state != FC_LINK_UP) { in emlxs_timer_check_discovery()
1004 emlxs_mem_put(hba, MEM_MBOX, (void *)mbox); in emlxs_timer_check_discovery()
1007 EMLXS_STATE_CHANGE_LOCKED(hba, FC_CLEAR_LA); in emlxs_timer_check_discovery()
1009 hba->discovery_timer = 0; in emlxs_timer_check_discovery()
1014 emlxs_mb_clear_la(hba, mbox); in emlxs_timer_check_discovery()
1016 rc = EMLXS_SLI_ISSUE_MBOX_CMD(hba, mbox, MBX_NOWAIT, 0); in emlxs_timer_check_discovery()
1018 emlxs_mem_put(hba, MEM_MBOX, (void *)mbox); in emlxs_timer_check_discovery()
1031 emlxs_hba_t *hba = HBA; in emlxs_timer_check_clean_address() local
1035 (hba->timer_tics < port->clean_address_timer)) { in emlxs_timer_check_clean_address()
1048 port->did, port->prev_did, hba->fc_ratov); in emlxs_timer_check_clean_address()
1067 emlxs_hba_t *hba = HBA; in emlxs_timer_cancel_clean_address() local
1079 port->did, port->prev_did, hba->fc_ratov); in emlxs_timer_cancel_clean_address()
1089 emlxs_hba_t *hba = HBA; in emlxs_timer_check_ub() local
1095 if (port->ub_timer > hba->timer_tics) { in emlxs_timer_check_ub()
1099 port->ub_timer = hba->timer_tics + EMLXS_UB_PERIOD; in emlxs_timer_check_ub()
1118 hba->timer_tics) { in emlxs_timer_check_ub()
1163 emlxs_hba_t *hba = HBA; in emlxs_pkt_chip_timeout() local
1178 if (hba->state >= FC_LINK_UP) { in emlxs_pkt_chip_timeout()
1192 hba->timer_tics + (4 * hba->fc_ratov) + 10; in emlxs_pkt_chip_timeout()
1204 sbp->ticks = hba->timer_tics + 30; in emlxs_pkt_chip_timeout()
1224 sbp->ticks = hba->timer_tics + 30; in emlxs_pkt_chip_timeout()
1237 sbp->ticks = hba->timer_tics + 60; in emlxs_pkt_chip_timeout()
1248 sbp->ticks = hba->timer_tics + 60; in emlxs_pkt_chip_timeout()
1276 emlxs_timer_check_pools(emlxs_hba_t *hba) in emlxs_timer_check_pools() argument
1286 if (hba->mem_timer > hba->timer_tics) { in emlxs_timer_check_pools()
1290 hba->mem_timer = hba->timer_tics + cfg[CFG_MEM_DYNAMIC].current; in emlxs_timer_check_pools()
1292 seg = hba->memseg; in emlxs_timer_check_pools()
1295 emlxs_mem_pool_clean(hba, seg); in emlxs_timer_check_pools()
1316 emlxs_mem_pool_clean(hba, seg); in emlxs_timer_check_pools()
1331 emlxs_tx_watchdog(emlxs_hba_t *hba) in emlxs_tx_watchdog() argument
1354 for (iotag = 1; iotag < hba->max_iotag; iotag++) { in emlxs_tx_watchdog()
1355 sbp = hba->fc_table[iotag]; in emlxs_tx_watchdog()
1449 emlxs_hba_t *hba = HBA; in emlxs_timer_check_dhchap() local
1462 (hba->timer_tics >= ndlp->node_dhc.nlp_authrsp_tmo)) { in emlxs_timer_check_dhchap()
1469 (hba->timer_tics >= ndlp->node_dhc.nlp_reauth_tmo)) { in emlxs_timer_check_dhchap()