Lines Matching +full:reboot +full:- +full:mode
29 * ------------
32 * ------------------
34 * This is a pseudo driver for the Netra-1280 watchdog
35 * timer (WDT). It provides for an *application-driven*
36 * WDT (AWDT), not a traditional, hardware-based WDT. A
37 * hardware-based feature is already present on the
38 * Netra-1280, and it is referred to here as the
42 * an AWDT; they are mutually-exclusive. Once in AWDT
43 * mode, one can only transition to SWDT mode via a reboot.
46 * terminate their wdog-app in order to do some debugging,
47 * or even to load a new version of the wdog-app.
49 * The wdog-app does an open() of the /dev/ntwdt device node
55 * progress of a Solaris reboot. ScApp will reset Solaris
62 * even though its clock-interrupt could still run (and the
63 * SWDT's watchdog timer therefore re-armed), the system could
70 * ----------------------------
72 * This pseudo-driver does not have any 'extern' functions.
82 * ---------------------------------
85 * machine global to ScApp and ntwdt is either in AWDT mode
86 * or in SWDT mode. These two peers communicate via the SBBC
94 * softstate. The wdog-app's actions cause changes to this
97 * The wdog-app uses the LOMIOCDOGTIME ioctl to specify
99 * therefore the VWDT). The wdog-app then uses the
103 * the VWDT from expiring, the wdog-app uses the
104 * LOMIOCDOGPAT ioctl to re-arm (or "pat") the watchdog.
106 * last LOMIOCDOGTIME ioctl. The wdog-app can use the
109 * The wdog-app can also specify how Recovery is to be
114 * ntwdt. The wdog-app specifies the Recovery policy
118 * ------------------
121 * by reading a well-known area of IOSRAM (SBBC_TOD_KEY)
123 * Solaris-generated "heartbeat" field is older
130 * puts the system in AWDT mode, it disables todsg's
142 * the user stops re-arming the VWDT or Solaris
149 * re-arming the VWDT (ie, DOGPAT ioctl), ntwdt
156 * ----------------
158 * ntwdt only handles one of the coarse-grained
160 * power-down, DR) that are possible during a Solaris
164 * use the wdog-app to disable the watchdog, else
172 * Solaris reboot/crashdump latency.
177 * ntwdt. After having exited OBP, the wdog-app can
179 * will get both ScApp and ntwdt in-sync).
182 * -------
209 * interrupt-block-cookie corresponding to DDI_SOFTINT_LOW.
230 * -----------------
232 * "ddi-forceattach=1;"
233 * ------------------
236 * loaded at boot-time AND to not be removed from memory
237 * solely due to memory-pressure.
240 * possible) tell ScApp of the current mode of the
241 * state-machine (eg, SWDT). This is needed for the case
242 * when Solaris is re-loaded while in AWDT mode; having
244 * of any "split-brain" scenario where ScApp and Solaris
245 * are not in the same mode.
251 * ScApp could be re-loaded after AWDT mode had been
252 * entered and the wdog-app had close()'d ntwdt. ScApp
255 * state-machine. Having ntwdt remain loaded allows this
258 * "ntwdt-boottimeout=600;"
259 * ----------------------
262 * use when ntwdt is aware of the need to reboot/reload Solaris.
269 * ntwdt boundary-checks the specified value, and if out-of-range,
276 * If ntwdt-boottimeout is set to a value less than an actual
278 * Note that a continuous series of ScApp-induced resets will
280 * into the watchdog-expired state.
303 #include <sys/reboot.h>
313 * tunable to simulate a Solaris hang. If is non-zero, then
323 #define NTWDT_BOOT_TIMEOUT_PROP "ntwdt-boottimeout"
326 * watchdog-timeout values (in seconds):
330 * reboot.
341 #define OFFSET(base, field) ((char *)&base.field - (char *)&base)
368 int ntwdt_is_initial_enable; /* 1st wdog-enable? */
385 ((p)->ntwdt_wdog_flags |= NTWDT_FLAG_##f)
387 ((p)->ntwdt_wdog_flags &= ~NTWDT_FLAG_##f)
402 * if non-zero, then the app-wdog feature is available on
407 * if non-zero, then application has used the LOMIOCDOGCTL
408 * ioctl at least once in order to Enable the app-wdog.
409 * Also, if this is non-zero, then system is in AWDT mode,
410 * else it is in SWDT mode.
488 "ntwdt-Netra-T12", /* Name of the module. */
511 /* used in non-debug version of module */
597 /* see if app-wdog is supported on our config */ in ntwdt_attach()
616 ntwdt_ptr->ntwdt_dip = dip; in ntwdt_attach()
617 ntwdt_ptr->ntwdt_cycl_id = CYCLIC_NONE; in ntwdt_attach()
618 mutex_init(&ntwdt_ptr->ntwdt_mutex, NULL, in ntwdt_attach()
624 ntwdt_ptr->ntwdt_wdog_state = in ntwdt_attach()
626 wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_attach()
629 * Create an iblock-cookie so that ntwdt_wdog_mutex can be in ntwdt_attach()
633 &wdog_state->ntwdt_wdog_mtx_cookie) != DDI_SUCCESS) { in ntwdt_attach()
638 mutex_init(&wdog_state->ntwdt_wdog_mutex, NULL, MUTEX_DRIVER, in ntwdt_attach()
639 (void *)wdog_state->ntwdt_wdog_mtx_cookie); in ntwdt_attach()
642 mutex_init(&wdog_state->ntwdt_event_lock, NULL, in ntwdt_attach()
646 wdog_state->ntwdt_cyclic_interval = NANOSEC; in ntwdt_attach()
652 hdlr = &wdog_state->ntwdt_cycl_hdlr; in ntwdt_attach()
653 hdlr->cyh_level = CY_LOCK_LEVEL; in ntwdt_attach()
654 hdlr->cyh_func = ntwdt_cyclic_pat; in ntwdt_attach()
655 hdlr->cyh_arg = (void *)ntwdt_ptr; in ntwdt_attach()
695 mutex_destroy(&wdog_state->ntwdt_event_lock); in ntwdt_attach()
696 mutex_destroy(&wdog_state->ntwdt_wdog_mutex); in ntwdt_attach()
699 ntwdt_ptr->ntwdt_wdog_state = NULL; in ntwdt_attach()
701 mutex_destroy(&ntwdt_ptr->ntwdt_mutex); in ntwdt_attach()
710 * Do static checks to see if the app-wdog feature is supported in
713 * If the kernel debugger was booted, then we disallow the app-wdog
715 * debuggability of system than its ability to support an app-wdog.
719 * of the IOSRAM mailbox messages that is specific to the app-wdog
720 * protocol, then we disallow use of the app-wdog feature (else
721 * we could have a "split-brain" scenario where Solaris supports
722 * app-wdog but ScApp doesn't).
726 * from under Solaris, then once in AWDT mode, Solaris has no way
743 * it does not support the app-wdog feature. Also, in ntwdt_chk_wdog_support()
761 NTWDT_DBG(WDT_DBG_PROT, ("app-wdog is %savailable", in ntwdt_chk_wdog_support()
768 * Check to see if ScApp supports the app-watchdog feature.
771 * specific to the app-wdog protocol. If ScApp does not
773 * (as well as the remainder of the app-wdog protocol).
822 mutex_destroy(&ntwdt_ptr->ntwdt_wdog_state->ntwdt_event_lock); in ntwdt_detach()
823 mutex_destroy(&ntwdt_ptr->ntwdt_wdog_state->ntwdt_wdog_mutex); in ntwdt_detach()
824 kmem_free(ntwdt_ptr->ntwdt_wdog_state, in ntwdt_detach()
826 ntwdt_ptr->ntwdt_wdog_state = NULL; in ntwdt_detach()
828 mutex_destroy(&ntwdt_ptr->ntwdt_mutex); in ntwdt_detach()
845 * the Event declaring that ScApp is coming up from a reboot
870 if (ddi_add_softintr(ntwdt_ptr->ntwdt_dip, DDI_SOFTINT_LOW, in ntwdt_add_mbox_handlers()
881 * trigger the worker-handler (ntwdt_mbox_softintr). in ntwdt_add_mbox_handlers()
887 &sbbc_msg, NULL, &ntwdt_ptr->ntwdt_wdog_state->ntwdt_event_lock); in ntwdt_add_mbox_handlers()
965 * a non-privileged user could cause denial-of-service
993 mutex_enter(&ntwdt_ptr->ntwdt_wdog_state->ntwdt_wdog_mutex); in ntwdt_open()
994 mutex_enter(&ntwdt_ptr->ntwdt_mutex); in ntwdt_open()
995 if (ntwdt_ptr->ntwdt_open_flag != 0) in ntwdt_open()
998 ntwdt_ptr->ntwdt_open_flag = 1; in ntwdt_open()
999 mutex_exit(&ntwdt_ptr->ntwdt_mutex); in ntwdt_open()
1000 mutex_exit(&ntwdt_ptr->ntwdt_wdog_state->ntwdt_wdog_mutex); in ntwdt_open()
1014 * case of monitoring a Solaris reboot in terms
1030 mutex_enter(&ntwdt_ptr->ntwdt_wdog_state->ntwdt_wdog_mutex); in ntwdt_close()
1031 mutex_enter(&ntwdt_ptr->ntwdt_mutex); in ntwdt_close()
1032 if (ntwdt_ptr->ntwdt_open_flag != 0) { in ntwdt_close()
1033 ntwdt_ptr->ntwdt_open_flag = 0; in ntwdt_close()
1035 mutex_exit(&ntwdt_ptr->ntwdt_mutex); in ntwdt_close()
1036 mutex_exit(&ntwdt_ptr->ntwdt_wdog_state->ntwdt_wdog_mutex); in ntwdt_close()
1043 ntwdt_ioctl(dev_t dev, int cmd, intptr_t arg, int mode, in ntwdt_ioctl() argument
1054 /* Only allow ioctl's if Solaris/ScApp support app-wdog */ in ntwdt_ioctl()
1058 wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_ioctl()
1067 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1069 wdog_state->ntwdt_reset_enabled; in ntwdt_ioctl()
1071 wdog_state->ntwdt_wdog_enabled; in ntwdt_ioctl()
1073 wdog_state->ntwdt_wdog_timeout; in ntwdt_ioctl()
1074 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1081 sizeof (lom_dogstate_t), mode) != 0) { in ntwdt_ioctl()
1096 sizeof (lom_dogctl_t), mode) != 0) { in ntwdt_ioctl()
1105 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1107 if (wdog_state->ntwdt_wdog_timeout == 0) { in ntwdt_ioctl()
1117 * Return error for the non-sensical combination: in ntwdt_ioctl()
1127 * Store the user-specified state in our softstate. in ntwdt_ioctl()
1137 wdog_state->ntwdt_reset_enabled = in ntwdt_ioctl()
1139 wdog_state->ntwdt_wdog_enabled = in ntwdt_ioctl()
1142 if (wdog_state->ntwdt_wdog_enabled != 0) { in ntwdt_ioctl()
1150 if (wdog_state->ntwdt_timer_running == 0) { in ntwdt_ioctl()
1159 if (wdog_state->ntwdt_timer_running != 0) { in ntwdt_ioctl()
1171 if (wdog_state->ntwdt_wdog_enabled != 0 && in ntwdt_ioctl()
1172 wdog_state->ntwdt_is_initial_enable == 0) { in ntwdt_ioctl()
1174 /* switch from SWDT to AWDT mode */ in ntwdt_ioctl()
1177 /* Tell ScApp we're in AWDT mode */ in ntwdt_ioctl()
1184 wdog_state->ntwdt_wdog_enabled); in ntwdt_ioctl()
1186 wdog_state->ntwdt_reset_enabled); in ntwdt_ioctl()
1188 if (wdog_state->ntwdt_wdog_enabled != 0 && in ntwdt_ioctl()
1189 wdog_state->ntwdt_is_initial_enable == 0) { in ntwdt_ioctl()
1193 * machine. (If this field is non-zero, in ntwdt_ioctl()
1202 /* "the first watchdog-enable has been seen" */ in ntwdt_ioctl()
1203 wdog_state->ntwdt_is_initial_enable = 1; in ntwdt_ioctl()
1206 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1218 sizeof (uint32_t), mode) != 0) { in ntwdt_ioctl()
1233 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1235 wdog_state->ntwdt_wdog_timeout = lom_dogtime; in ntwdt_ioctl()
1238 * If watchdog is currently running, re-arm the in ntwdt_ioctl()
1241 if (wdog_state->ntwdt_timer_running != 0) { in ntwdt_ioctl()
1248 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1254 * Allow user to re-arm ("pat") the watchdog. in ntwdt_ioctl()
1258 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1264 if (!(wdog_state->ntwdt_wdog_enabled && in ntwdt_ioctl()
1265 wdog_state->ntwdt_timer_running)) in ntwdt_ioctl()
1268 if (wdog_state->ntwdt_wdog_expired == 0) { in ntwdt_ioctl()
1269 /* then VWDT has not expired; re-arm it */ in ntwdt_ioctl()
1272 NTWDT_DBG(WDT_DBG_VWDT, ("VWDT re-armed:" in ntwdt_ioctl()
1274 wdog_state->ntwdt_secs_remaining)); in ntwdt_ioctl()
1277 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1285 * panic-handler code. in ntwdt_ioctl()
1297 * o recovery-enabled in ntwdt_ioctl()
1305 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1308 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1324 sizeof (ntwdt_data_t), mode) != 0) { in ntwdt_ioctl()
1337 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_ioctl()
1355 * NOT represent a full, one-second period. If the Cyclic
1364 wdog_state->ntwdt_secs_remaining = in ntwdt_arm_vwdt()
1365 wdog_state->ntwdt_wdog_timeout; in ntwdt_arm_vwdt()
1367 if (wdog_state->ntwdt_timer_running != 0) in ntwdt_arm_vwdt()
1374 * Switch from SWDT mode to AWDT mode.
1380 ASSERT(wdog_state->ntwdt_is_initial_enable == 0); in ntwdt_swdt_to_awdt()
1384 * display a message so user knows that SWDT Mode in ntwdt_swdt_to_awdt()
1393 /* "we are in AWDT mode" */ in ntwdt_swdt_to_awdt()
1400 * AWDT's watchdog-timeout period. This Cyclic runs at
1402 * soft-interrupt in order to complete all processing.
1406 * a soft-interrupt allows for a consistent (eg, MT-safe)
1418 /* post-down to DDI_SOFTINT_LOW */ in ntwdt_cyclic_pat()
1423 * This is the soft-interrupt triggered by the AWDT
1438 * interrupt-context: DDI_SOFTINT_LOW
1446 wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_cyclic_softint()
1448 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_cyclic_softint()
1450 if ((wdog_state->ntwdt_wdog_flags & in ntwdt_cyclic_softint()
1456 wdog_state->ntwdt_wdog_flags &= ~NTWDT_FLAG_SKIP_CYCLIC; in ntwdt_cyclic_softint()
1460 if (wdog_state->ntwdt_timer_running == 0 || in ntwdt_cyclic_softint()
1461 (ntwdt_ptr->ntwdt_cycl_id == CYCLIC_NONE) || in ntwdt_cyclic_softint()
1462 (wdog_state->ntwdt_wdog_enabled == 0)) in ntwdt_cyclic_softint()
1465 /* re-arm ("pat") the hardware watchdog */ in ntwdt_cyclic_softint()
1469 if (--wdog_state->ntwdt_secs_remaining == 0) { in ntwdt_cyclic_softint()
1471 cmn_err(CE_WARN, "application-watchdog expired"); in ntwdt_cyclic_softint()
1473 wdog_state->ntwdt_wdog_expired = 1; in ntwdt_cyclic_softint()
1475 if (wdog_state->ntwdt_reset_enabled != 0) { in ntwdt_cyclic_softint()
1477 * Update ScApp so that the new wdog-timeout in ntwdt_cyclic_softint()
1481 * actual Solaris reboot time. This will allow in ntwdt_cyclic_softint()
1482 * our forced-reboot to not cause an unplanned in ntwdt_cyclic_softint()
1488 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_cyclic_softint()
1496 wdog_state->ntwdt_wdog_enabled = 0; in ntwdt_cyclic_softint()
1500 * the "2x-timeout" artifact. Eg, Solaris in ntwdt_cyclic_softint()
1501 * times-out at t(x) and ScApp times-out at t(2x), in ntwdt_cyclic_softint()
1505 wdog_state->ntwdt_wdog_enabled); in ntwdt_cyclic_softint()
1514 " seconds", wdog_state->ntwdt_secs_remaining)); in ntwdt_cyclic_softint()
1517 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_cyclic_softint()
1523 * Program the AWDT watchdog-timeout value to that specified
1528 * o interrupt context: (from software-interrupt)
1534 ntwdt_wdog_t *wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_reprogram_wd()
1537 * Program the AWDT watchdog-timeout value only if the in ntwdt_reprogram_wd()
1542 if (wdog_state->ntwdt_wdog_enabled != 0 && in ntwdt_reprogram_wd()
1543 wdog_state->ntwdt_reset_enabled != 0 && in ntwdt_reprogram_wd()
1544 wdog_state->ntwdt_timer_running != 0) { in ntwdt_reprogram_wd()
1547 wdog_state->ntwdt_boot_timeout); in ntwdt_reprogram_wd()
1550 wdog_state->ntwdt_boot_timeout); in ntwdt_reprogram_wd()
1556 * It will set the watchdog-timeout value to be that as specified
1560 * that's larger than the actual reboot latency, ScApp will
1580 ntwdt_wdog_t *wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_start_timer()
1581 cyc_handler_t *hdlr = &wdog_state->ntwdt_cycl_hdlr; in ntwdt_start_timer()
1582 cyc_time_t *when = &wdog_state->ntwdt_cycl_time; in ntwdt_start_timer()
1585 * Init Cyclic so its first expiry occurs wdog-timeout in ntwdt_start_timer()
1588 when->cyt_interval = wdog_state->ntwdt_cyclic_interval; in ntwdt_start_timer()
1589 when->cyt_when = gethrtime() + when->cyt_interval; in ntwdt_start_timer()
1591 wdog_state->ntwdt_wdog_expired = 0; in ntwdt_start_timer()
1592 wdog_state->ntwdt_timer_running = 1; in ntwdt_start_timer()
1595 if (ntwdt_ptr->ntwdt_cycl_id == CYCLIC_NONE) in ntwdt_start_timer()
1596 ntwdt_ptr->ntwdt_cycl_id = cyclic_add(hdlr, when); in ntwdt_start_timer()
1599 NTWDT_DBG(WDT_DBG_VWDT, ("AWDT's cyclic-driven timer is started")); in ntwdt_start_timer()
1607 * from interrupt-context. Note that when this is
1614 ntwdt_wdog_t *wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_stop_timer()
1617 if (ntwdt_ptr->ntwdt_cycl_id != CYCLIC_NONE) in ntwdt_stop_timer()
1618 cyclic_remove(ntwdt_ptr->ntwdt_cycl_id); in ntwdt_stop_timer()
1621 wdog_state->ntwdt_timer_running = 0; in ntwdt_stop_timer()
1622 ntwdt_ptr->ntwdt_cycl_id = CYCLIC_NONE; in ntwdt_stop_timer()
1624 NTWDT_DBG(WDT_DBG_VWDT, ("AWDT's cyclic-driven timer is stopped")); in ntwdt_stop_timer()
1629 * do it in a thread-safe manner).
1640 ntwdt_wdog_t *wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_stop_timer_lock()
1642 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_stop_timer_lock()
1644 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_stop_timer_lock()
1694 wdog_state = ntwdt_ptr->ntwdt_wdog_state; in ntwdt_read_props()
1698 * the watchdog-timeout should be set to when in ntwdt_read_props()
1701 * to reboot and write crashdump. If not, in ntwdt_read_props()
1703 * watchdog-timeout. in ntwdt_read_props()
1705 wdog_state->ntwdt_boot_timeout = in ntwdt_read_props()
1709 ntwdt_ptr->ntwdt_dip, DDI_PROP_DONTPASS, in ntwdt_read_props()
1710 NTWDT_BOOT_TIMEOUT_PROP, -1); in ntwdt_read_props()
1712 if (boot_timeout != -1 && boot_timeout > 0 && in ntwdt_read_props()
1714 wdog_state->ntwdt_boot_timeout = in ntwdt_read_props()
1720 wdog_state->ntwdt_boot_timeout)); in ntwdt_read_props()
1744 * variable when system is in SWDT mode. in ntwdt_set_swdt_state()
1770 rstatep->ntwdt_wdog_timeout); in ntwdt_set_awdt_state()
1772 rstatep->ntwdt_reset_enabled); in ntwdt_set_awdt_state()
1774 rstatep->ntwdt_wdog_enabled); in ntwdt_set_awdt_state()
1787 * a driver-specific representation of a mailbox <Value> is
1801 NTWDT_DBG(WDT_DBG_PROT, ("MBOX_SET of 'recovery-enabled':" in ntwdt_set_cfgvar()
1810 NTWDT_DBG(WDT_DBG_PROT, ("MBOX_SET of 'wdog-enabled':" in ntwdt_set_cfgvar()
1819 NTWDT_DBG(WDT_DBG_PROT, ("MBOX_SET of 'wdog-timeout':" in ntwdt_set_cfgvar()
1827 NTWDT_DBG(WDT_DBG_PROT, ("MBOX_SET of 'wdog-mode':" in ntwdt_set_cfgvar()
1881 NTWDT_DBG(WDT_DBG_PROT, ("MBOX_GET of 'reset-enabled':" in ntwdt_get_cfgvar()
1888 NTWDT_DBG(WDT_DBG_PROT, ("MBOX_GET of 'wdog-enabled':" in ntwdt_get_cfgvar()
1895 NTWDT_DBG(WDT_DBG_PROT, ("MBOX_GET of 'wdog-timeout':" in ntwdt_get_cfgvar()
1911 * This "heartbeat" is normally used in SWDT Mode, but when
1912 * in AWDT Mode, ScApp also uses its value to determine if Solaris
1913 * is up-and-running.
1942 * location that's used to specify Solaris' watchdog-timeout
1945 * In SWDT Mode, this location can hold values [0,n).
1946 * In AWDT Mode, this location must have value 0 (else
1947 * after a ScApp-reboot, ScApp could mistakenly interpret
1948 * that the system is in SWDT Mode).
1966 * Soft-interrupt handler that is triggered when ScApp wants
1967 * to know the current state of the app-wdog.
1980 * command, then the lock-hold latency would be greatly reduced.
1992 wdog_state = ((ntwdt_state_t *)arg)->ntwdt_wdog_state; in ntwdt_mbox_softint()
1996 mutex_enter(&wdog_state->ntwdt_wdog_mutex); in ntwdt_mbox_softint()
2001 mutex_exit(&wdog_state->ntwdt_wdog_mutex); in ntwdt_mbox_softint()
2009 * The only (sub-)type of Event we handle is the
2011 * a soft-interrupt only if we are in AWDT mode.
2014 * state of the AWDT variables. Design-wise, this is used to
2016 * AWDT mode (if the SC reboots in SWDT mode, then ScApp
2029 * by SC when in AWDT mode.
2042 if (msg->msg_buf == NULL) { in ntwdt_event_data_handler()
2046 payload = (lw8_event_t *)msg->msg_buf; in ntwdt_event_data_handler()
2048 switch (payload->event_type) { in ntwdt_event_data_handler()
2055 "received in %s mode", in ntwdt_event_data_handler()
2059 /* then system is in AWDT mode */ in ntwdt_event_data_handler()
2066 ("MBOX_EVENT_LW8: %d", payload->event_type)); in ntwdt_event_data_handler()
2093 reqp->msg_type.type = LW8_MBOX; in ntwdt_lomcmd()
2094 reqp->msg_type.sub_type = (uint16_t)cmd; in ntwdt_lomcmd()
2098 resp->msg_type.type = LW8_MBOX; in ntwdt_lomcmd()
2099 resp->msg_type.sub_type = (uint16_t)cmd; in ntwdt_lomcmd()
2103 reqp->msg_len = 0; in ntwdt_lomcmd()
2104 reqp->msg_buf = (caddr_t)NULL; in ntwdt_lomcmd()
2105 resp->msg_len = sizeof (lw8_get_wdt_t); in ntwdt_lomcmd()
2106 resp->msg_buf = (caddr_t)arg; in ntwdt_lomcmd()
2110 reqp->msg_len = sizeof (lw8_set_wdt_t); in ntwdt_lomcmd()
2111 reqp->msg_buf = (caddr_t)arg; in ntwdt_lomcmd()
2112 resp->msg_len = 0; in ntwdt_lomcmd()
2113 resp->msg_buf = (caddr_t)NULL; in ntwdt_lomcmd()
2123 if ((rv) || (resp->msg_status != SG_MBOX_STATUS_SUCCESS)) { in ntwdt_lomcmd()
2126 " (rv/msg_status)=(%d/%d)", rv, resp->msg_status)); in ntwdt_lomcmd()
2129 if (resp->msg_status > 0) { in ntwdt_lomcmd()
2130 return (resp->msg_status); in ntwdt_lomcmd()
2134 switch (resp->msg_status) { in ntwdt_lomcmd()