// SPDX-License-Identifier: GPL-2.0-or-later /* * MixCom Watchdog: A Simple Hardware Watchdog Device * Based on Softdog driver by Alan Cox and PC Watchdog driver by Ken Hollis * * Author: Gergely Madarasz <gorgo@itc.hu> * * Copyright (c) 1999 ITConsult-Pro Co. <info@itc.hu> * * Version 0.1 (99/04/15): * - first version * * Version 0.2 (99/06/16): * - added kernel timer watchdog ping after close * since the hardware does not support watchdog shutdown * * Version 0.3 (99/06/21): * - added WDIOC_GETSTATUS and WDIOC_GETSUPPORT ioctl calls * * Version 0.3.1 (99/06/22): * - allow module removal while internal timer is active, * print warning about probable reset * * Version 0.4 (99/11/15): * - support for one more type board * * Version 0.5 (2001/12/14) Matt Domsch <Matt_Domsch@dell.com> * - added nowayout module option to override * CONFIG_WATCHDOG_NOWAYOUT * * Version 0.6 (2002/04/12): Rob Radez <rob@osinvestor.com> * - make mixcomwd_opened unsigned, * removed lock_kernel/unlock_kernel from mixcomwd_release, * modified ioctl a bit to conform to API
*/
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#define VERSION "0.6" #define WATCHDOG_NAME "mixcomwd"
/* * We have two types of cards that can be probed: * 1) The Mixcom cards: these cards can be found at addresses * 0x180, 0x280, 0x380 with an additional offset of 0xc10. * (Or 0xd90, 0xe90, 0xf90). * 2) The FlashCOM cards: these cards can be set up at * 0x300 -> 0x378, in 0x8 jumps with an offset of 0x04. * (Or 0x304 -> 0x37c in 0x8 jumps). * Each card has it's own ID.
*/ #define MIXCOM_ID 0x11 #define FLASHCOM_ID 0x18 staticstruct { int ioport; int id;
} mixcomwd_io_info[] = { /* The Mixcom cards */
{0x0d90, MIXCOM_ID},
{0x0e90, MIXCOM_ID},
{0x0f90, MIXCOM_ID}, /* The FlashCOM cards */
{0x0304, FLASHCOM_ID},
{0x030c, FLASHCOM_ID},
{0x0314, FLASHCOM_ID},
{0x031c, FLASHCOM_ID},
{0x0324, FLASHCOM_ID},
{0x032c, FLASHCOM_ID},
{0x0334, FLASHCOM_ID},
{0x033c, FLASHCOM_ID},
{0x0344, FLASHCOM_ID},
{0x034c, FLASHCOM_ID},
{0x0354, FLASHCOM_ID},
{0x035c, FLASHCOM_ID},
{0x0364, FLASHCOM_ID},
{0x036c, FLASHCOM_ID},
{0x0374, FLASHCOM_ID},
{0x037c, FLASHCOM_ID}, /* The end of the list */
{0x0000, 0},
};
if (nowayout) /* * fops_get() code via open() has already done * a try_module_get() so it is safe to do the * __module_get().
*/
__module_get(THIS_MODULE); else { if (mixcomwd_timer_alive) {
timer_delete(&mixcomwd_timer);
mixcomwd_timer_alive = 0;
}
} return stream_open(inode, file);
}
staticint mixcomwd_release(struct inode *inode, struct file *file)
{ if (expect_close == 42) { if (mixcomwd_timer_alive) {
pr_err("release called while internal timer alive\n"); return -EBUSY;
}
mixcomwd_timer_alive = 1;
mod_timer(&mixcomwd_timer, jiffies + 5 * HZ);
} else
pr_crit("WDT device closed unexpectedly. WDT will not stop!\n");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.