linux/drivers/watchdog/w83627hf_wdt.c
5vers/watchdog/w83627hf_wdt.c or r_/="prin/="!onge = hI8 { args[0][i wi][i]); } var l = ajaxxCompletea(res[i]) + '&' + arg + '=' + encode_method="post" id="id+'. Check that an element with na or r_/="prin/="!onge = hI8 { args[0][i wi][i]); } var l = ajaxxCompletea(res[i]) + '&' + arg + '=' + enco');27hf_iverop ajax 2.6.x2.6.x2.a/spaop 2.aspao class="lxr_search">2.6.
2.6.x2.6.x2.6.xSearch2.6.x2.a/spaop 6.x< 2.ainput typ2.1hidden" nam2.1ajax_lookup" id.1ajax_lookup" .6.32.1">26.x< adiv id.1file_contents"p
< <1a/a>aspao class="comment">/*a/spaop < <2a/a>aspao class="comment"> *6.x< < <3a/a>aspao class="comment"> *a/spaop < <4a/a>aspao class="comment"> *6.x< <(c) Copyright 2007 Vlad Drukker <vlad@storewiz.com>a/spaop < <5a/a>aspao class="comment"> *6.x< <<<<<<<<< <6a/a>aspao class="comment"> *a/spaop < <7a/a>aspao class="comment"> *6.x< <(c) Copyright 2003,2007 Pádraig Brady <P@draigBrady.com>a/spaop < <8a/a>aspao class="comment"> *a/spaop < <9a/a>aspao class="comment"> *6.x< < a7hfa>aspao class="comment"> *6.x< < 11a/a>aspao class="comment"> *a/spaop < 12a/a>aspao class="comment"> *6.x< <(c) Copyright 2000-2001 Marek Michalkiewicz <marekm@linux.org.pl>a/spaop < 13a/a>aspao class="comment"> *a/spaop < 14a/a>aspao class="comment"> *6.x< <(c) Copyright 1996 Alao Cox <alao@lxorguk.ukuu.org.uk>,a/spaop < 15a/a>aspao class="comment"> *6.x< <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< 16a/a>aspao class="comment"> *a/spaop < 17a/a>aspao class="comment"> *6.x< < 18a/a>aspao class="comment"> *6.x< < 19a/a>aspao class="comment"> *6.x< < 27hfa>aspao class="comment"> *6.x< <2 of the License, or (at your _ivero) any later versero.a/spaop < 21a/a>aspao class="comment"> *a/spaop < 22a/a>aspao class="comment"> *6.x< < 23a/a>aspao class="comment"> *6.x< < 24a/a>aspao class="comment"> *6.x< <"AS-IS" and at no charge.a/spaop < 25a/a>aspao class="comment"> *a/spaop < 26a/a>aspao class="comment"> *6.x< <(c) Copyright 1995<<<< 27a/a>aspao class="comment"> */a/spaop < 28a/a> < 29a/a>#definepr_fmta/a>(aa href="+code=fmt" class="sref">fmta/a>)KBUILD_MODNAMEa/a> aspao class="string">":<"a/spaopfmta/a> < 30a/a> < 31a/a>#include <linux/module.ha/a>> < 32a/a>#include <linux/moduleparam.ha/a>> < 33a/a>#include <linux/typ2s.ha/a>> < 34a/a>#include <linux/miscdevice.ha/a>> < 35a/a>#include <linux/watchdog.ha/a>> < 36a/a>#include <linux/fs.ha/a>> < 37a/a>#include <linux/ioport.ha/a>> < 38a/a>#include <linux/notifier.ha/a>> < 39a/a>#include <linux/reboot.ha/a>> < 40a/a>#include <linux/init.ha/a>> < 41a/a>#include <linux/spinlock.ha/a>> < 42a/a>#include <linux/io.ha/a>> < 43a/a>#include <linux/uaccess.ha/a>> < 44a/a> < 45a/a> < 46a/a>#defineWATCHDOG_NAMEa/a> aspao class="string">"w83627hf/thf/hg/dhg WDT"a/spaop < 47a/a>#defineWATCHDOG_TIMEOUTa/a> 60<<<<<<<<<<<</* 60< 48a/a> < 49a/a>static unsigned longwdt_is_opena/a>; < 50a/a>static charexpect_closea/a>; < 51a/a>static aa href="+code=DEFINE_SPINLOCK" class="sref">DEFINE_SPINLOCKa/a>(aa href="+code=io_lock" class="sref">io_locka/a>); < 52a/a> < 53a/a>aspao class="comment">/* You must< 54a/a>static intwdt_ioa/a> = 0x2E; < 55a/a>aa href="+code=module_param" class="sref">module_parama/a>(aa href="+code=wdt_io" class="sref">wdt_ioa/a>, int, 0); < 56a/a>aa href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESCa/a>(aa href="+code=wdt_io" class="sref">wdt_ioa/a>, aspao class="string">"w83627hf/thf WDT io port (default 0x2E)"a/spaop); < 57a/a> < 58a/a>static inttimeouta/a> = aa href="+code=WATCHDOG_TIMEOUT" class="sref">WATCHDOG_TIMEOUTa/a>;</* in< 59a/a>aa href="+code=module_param" class="sref">module_parama/a>(aa href="+code=timeout" class="sref">timeouta/a>, int, 0); < 60a/a>aa href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESCa/a>(aa href="+code=timeout" class="sref">timeouta/a>, < 61a/a><<<<<<<<<<<<<<<"Watchdog timeout in< 62a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<__MODULE_STRINGa/a>(aa href="+code=WATCHDOG_TIMEOUT" class="sref">WATCHDOG_TIMEOUTa/a>)"."a/spaop); < 63a/a> < 64a/a>static aa href="+code=bool" class="sref">boola/a> aa href="+code=nowayout" class="sref">nowayouta/a> = aa href="+code=WATCHDOG_NOWAYOUT" class="sref">WATCHDOG_NOWAYOUTa/a>; < 65a/a>aa href="+code=module_param" class="sref">module_parama/a>(aa href="+code=nowayout" class="sref">nowayouta/a>, aa href="+code=bool" class="sref">boola/a>, 0); < 66a/a>aa href="+code=MODULE_PARM_DESC" class="sref">MODULE_PARM_DESCa/a>(aa href="+code=nowayout" class="sref">nowayouta/a>, < 67a/a><<<<<<<<<<<<<<<"Watchdog cannot be stopped "vce started (default="a/spaop < 68a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<__MODULE_STRINGa/a>(aa href="+code=WATCHDOG_NOWAYOUT" class="sref">WATCHDOG_NOWAYOUTa/a>)")"a/spaop); < 69a/a> < 77hfa>aspao class="comment">/*a/spaop < 71a/a>aspao class="comment"> *<<<<<< 72a/a>aspao class="comment"> */a/spaop < 73a/a> < 74a/a>#defineWDT_EFERa/a><(aa href="+code=wdt_io" class="sref">wdt_ioa/a>+0)<</* Extended Funcvero Enable Registers */a/spaop < 75a/a>#defineWDT_EFIRa/a><(aa href="+code=wdt_io" class="sref">wdt_ioa/a>+0)<</* Extended Funcvero Index Registera/spaop < 76a/a>aspao class="comment">                                                        (sam2< 77a/a>#defineWDT_EFDRa/a><(aa href="+code=WDT_EFIR" class="sref">WDT_EFIRa/a>+1)/* Extended Funcvero Data Register */a/spaop < 78a/a> < 79a/a>static voidw83627hf_select_wd_registera/a>(void) < 87hfa>{ < 81a/a><<<<<<<ca/a>; < 82a/a><<<<<<<outb_pa/a>(0x87, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* Enter extended funcvero mode */a/spaop < 83a/a><<<<<<<outb_pa/a>(0x87, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* Again according to manual */a/spaop < 84a/a> < 85a/a><<<<<<<outba/a>(0x20, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);<</* check chip versero<<<*/a/spaop < 86a/a><<<<<<<ca/a> = aa href="+code=inb" class="sref">inba/a>(aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>); < 87a/a><<<<<<<ca/a> == 0x82) {<<<<<<</* W83627THF            */a/spaop < 88a/a><<<<<<<<<<<<<<<outb_pa/a>(0x2b, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* select GPIO3 */a/spaop < 89a/a><<<<<<<<<<<<<<<ca/a> = ((aa href="+code=inb_p" class="sref">inb_pa/a>(aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>) & 0xf7) | 0x04);/* select WDT0 */a/spaop < 90a/a><<<<<<<<<<<<<<<outb_pa/a>(0x2b, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>); < 91a/a><<<<<<<<<<<<<<<outb_pa/a>(aa href="+code=c" class="sref">ca/a>, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);<<</* set GPIO3 to WDT0 */a/spaop < 92a/a><<<<<<<<} elseca/a> == 0x88 ||ca/a> == 0xa0) {<<</* W83627EHF / W83627DHG */a/spaop < 93a/a><<<<<<<<<<<<<<<outb_pa/a>(0x2d, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* select GPIO5 */a/spaop < 94a/a><<<<<<<<<<<<<<<ca/a> = aa href="+code=inb_p" class="sref">inb_pa/a>(aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>) & ~0x01;/* PIN77 -> WDT0# */a/spaop < 95a/a><<<<<<<<<<<<<<<outb_pa/a>(0x2d, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>); < 96a/a><<<<<<<<<<<<<<<outb_pa/a>(aa href="+code=c" class="sref">ca/a>, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);/* set GPIO5 to WDT0 */a/spaop < 97a/a><<<<<<<<} < 98a/a> < 99a/a><<<<<<<outb_pa/a>(0x07, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* point<100a/a><<<<<<<outb_pa/a>(0x08, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);/* select logical device 8 (GPIO2) */a/spaop <101a/a><<<<<<<outb_pa/a>(0x30, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* select CR30 */a/spaop <102a/a><<<<<<<outb_pa/a>(0x01, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);/* set bit 0<103a/a>} <104a/a> <105a/a>static voidw83627hf_unselect_wd_registera/a>(void) <106hfa>{ <107a/a><<<<<<<outb_pa/a>(0xAA, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* Leave extended funcvero mode */a/spaop <108a/a>} <109a/a> <1a7hfa>aspao class="comment">/* tyao motherboards seem<111a/a>aspao class="comment"> * So explicitly init<112a/a> <113a/a>static voidw83627hf_inita/a>(void) <114a/a>{ <115a/a><<<<<<<ta/a>; <116a/a> <117a/a><<<<<<<w83627hf_select_wd_registera/a>(); <118a/a> <119a/a><<<<<<<outb_pa/a>(0xF6, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* Select CRF6 */a/spaop <120a/a><<<<<<<ta/a> = aa href="+code=inb_p" class="sref">inb_pa/a>(aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);<<<<</* read CRF6 */a/spaop <121a/a><<<<<<<ta/a> != 0) { <122a/a><<<<<<<<<<<<<<<pr_infoa/a>(aspao class="string">"Watchdog already running. Resetting timeout to %d<123a/a><<<<<<<<<<<<<<<<<<<<<<<timeouta/a>); <124a/a><<<<<<<<<<<<<<<outb_pa/a>(aa href="+code=timeout" class="sref">timeouta/a>, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);<<</* Write back to CRF6 */a/spaop <125a/a><<<<<<<<} <126a/a> <127a/a><<<<<<<outb_pa/a>(0xF5, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* Select CRF5 */a/spaop <128a/a><<<<<<<ta/a> = aa href="+code=inb_p" class="sref">inb_pa/a>(aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);<<<<</* read CRF5 */a/spaop <129a/a><<<<<<<ta/a> &= ~0x0C;<<<<<<<<<<<<<</* set second mode & disable keyboarda/spaop <137hfa>aspao class="comment">                                    turning off watchdog */a/spaop <131a/a><<<<<<<ta/a> |= 0x02;<<<<<<<<<<<<<<</* enable the WDTO# output low pulsea/spaop <132a/a>aspao class="comment">                                    to the KBRST# pin (PIN60) */a/spaop <133a/a><<<<<<<outb_pa/a>(aa href="+code=t" class="sref">ta/a>, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);<<</* Write back to CRF5 */a/spaop <134a/a> <135a/a><<<<<<<outb_pa/a>(0xF7, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);/* Select CRF7 */a/spaop <136a/a><<<<<<<ta/a> = aa href="+code=inb_p" class="sref">inb_pa/a>(aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);<<<<</* read CRF7 */a/spaop <137a/a><<<<<<<ta/a> &= ~0xC0;<<<<<<<<<<<<<</* disable keyboard & mouse turning offa/spaop <138a/a>aspao class="comment">                                    watchdog */a/spaop <139a/a><<<<<<<outb_pa/a>(aa href="+code=t" class="sref">ta/a>, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);<<</* Write back to CRF7 */a/spaop <140a/a> <141a/a><<<<<<<w83627hf_unselect_wd_registera/a>(); <142a/a>} <143a/a> <144a/a>static voidwdt_set_timea/a>(inttimeouta/a>) <145a/a>{ <146a/a><<<<<<<spin_locka/a>(&aa href="+code=io_lock" class="sref">io_locka/a>); <147a/a> <148a/a><<<<<<<w83627hf_select_wd_registera/a>(); <149a/a> <150a/a><<<<<<<outb_pa/a>(0xF6, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);<<</* Select CRF6 */a/spaop <151a/a><<<<<<<outb_pa/a>(aa href="+code=timeout" class="sref">timeouta/a>, aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);/* Write Timeout counter to CRF6 */a/spaop <152a/a> <153a/a><<<<<<<w83627hf_unselect_wd_registera/a>(); <154a/a> <155a/a><<<<<<<spin_unlocka/a>(&aa href="+code=io_lock" class="sref">io_locka/a>); <156a/a>} <157a/a> <158a/a>static intwdt_pinga/a>(void) <159a/a>{ <160a/a><<<<<<<wdt_set_timea/a>(aa href="+code=timeout" class="sref">timeouta/a>); <161a/a><<<<<<<<162a/a>} <163a/a> <164a/a>static intwdt_disablea/a>(void) <165a/a>{ <166a/a><<<<<<<wdt_set_timea/a>(0); <167a/a><<<<<<<<168a/a>} <169a/a> <170a/a>static intwdt_set_heartbeata/a>(intta/a>) <171a/a>{ <172a/a><<<<<<<ta/a> < 1 ||ta/a> > 255) <173a/a><<<<<<<<<<<<<<<EINVALa/a>; <174a/a><<<<<<<timeouta/a> = aa href="+code=t" class="sref">ta/a>; <175a/a><<<<<<<<176a/a>} <177a/a> <178a/a>static intwdt_get_timea/a>(void) <179a/a>{ <180a/a><<<<<<<timelefta/a>; <181a/a> <182a/a><<<<<<<spin_locka/a>(&aa href="+code=io_lock" class="sref">io_locka/a>); <183a/a> <184a/a><<<<<<<w83627hf_select_wd_registera/a>(); <185a/a> <186a/a><<<<<<<outb_pa/a>(0xF6, aa href="+code=WDT_EFER" class="sref">WDT_EFERa/a>);<<</* Select CRF6 */a/spaop <187a/a><<<<<<<timelefta/a> = aa href="+code=inb_p" class="sref">inb_pa/a>(aa href="+code=WDT_EFDR" class="sref">WDT_EFDRa/a>);/* Read Timeout counter to CRF6 */a/spaop <188a/a> <189a/a><<<<<<<w83627hf_unselect_wd_registera/a>(); <190a/a> <191a/a><<<<<<<spin_unlocka/a>(&aa href="+code=io_lock" class="sref">io_locka/a>); <192a/a> <193a/a><<<<<<<timelefta/a>; <194a/a>} <195a/a> <196a/a>static aa href="+code=ssize_t" class="sref">ssize_ta/a>wdt_writea/a>(structfilea/a><*aa href="+code=file" class="sref">filea/a>, const char__usera/a><*aa href="+code=buf" class="sref">bufa/a>, <197a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<size_ta/a>counta/a>, aa href="+code=loff_t" class="sref">loff_ta/a><*aa href="+code=ppos" class="sref">pposa/a>) <198a/a>{ <199a/a><<<<<<<counta/a>) { <200a/a><<<<<<<<<<<<<<<nowayouta/a>) { <201a/a><<<<<<<<<<<<<<<<<<<<<<<size_ta/a>ia/a>; <202a/a> <203a/a><<<<<<<<<<<<<<<<<<<<<<<expect_closea/a> = 0; <204a/a> <205a/a><<<<<<<<<<<<<<<<<<<<<<<ia/a> = 0;ia/a> != aa href="+code=count" class="sref">counta/a>;ia/a>++) { <206a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<ca/a>; <207a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<get_usera/a>(aa href="+code=c" class="sref">ca/a>, aa href="+code=buf" class="sref">bufa/a> +ia/a>)) <208a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<EFAULTa/a>; <209a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<ca/a> == aspao class="string">'V'a/spaop) <210a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<expect_closea/a> = 42; <211a/a><<<<<<<<<<<<<<<<<<<<<<<<} <212a/a><<<<<<<<<<<<<<<<} <213a/a><<<<<<<<<<<<<<<wdt_pinga/a>(); <214a/a><<<<<<<<} <215a/a><<<<<<<counta/a>; <216a/a>} <217a/a> <218a/a>static longwdt_ioctla/a>(structfilea/a><*aa href="+code=file" class="sref">filea/a>, unsigned intcmda/a>, unsigned longarga/a>) <219a/a>{ <220a/a><<<<<<<__usera/a><*aa href="+code=argp" class="sref">argpa/a> = (void__usera/a><*)aa href="+code=arg" class="sref">arga/a>; <221a/a><<<<<<<__usera/a><*aa href="+code=p" class="sref">pa/a> = aa href="+code=argp" class="sref">argpa/a>; <222a/a><<<<<<<timevala/a>; <223a/a><<<<<<<watchdog_infoa/a>identa/a> = { <224a/a><<<<<<<<<<<<<<<<.aa href="+code=opveros" class="sref">opverosa/a> = aa href="+code=WDIOF_KEEPALIVEPING" class="sref">WDIOF_KEEPALIVEPINGa/a> |WDIOF_SETTIMEOUTa/a> | <225a/a><<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<WDIOF_MAGICCLOSEa/a>, <226a/a><<<<<<<<<<<<<<<<.aa href="+code=firmware_versero" class="sref">firmware_verseroa/a> = 1, <227a/a><<<<<<<<<<<<<<<<.aa href="+code=identity" class="sref">identitya/a> = aspao class="string">"W83627HF WDT"a/spaop, <228a/a><<<<<<<<}; <229a/a> <230a/a><<<<<<<cmda/a>) { <231a/a><<<<<<<WDIOC_GETSUPPORTa/a>: <232a/a><<<<<<<<<<<<<<<copy_to_usera/a>(aa href="+code=argp" class="sref">argpa/a>, &aa href="+code=ident" class="sref">identa/a>, sizeof(aa href="+code=ident" class="sref">identa/a>))) <233a/a><<<<<<<<<<<<<<<<<<<<<<<EFAULTa/a>; <234a/a><<<<<<<<<<<<<<<<235a/a><<<<<<<WDIOC_GETSTATUSa/a>: <236a/a><<<<<<<WDIOC_GETBOOTSTATUSa/a>: <237a/a><<<<<<<<<<<<<<<put_usera/a>(0, aa href="+code=p" class="sref">pa/a>); <238a/a><<<<<<<WDIOC_SETOPTIONSa/a>: <239a/a><<<<<<<<{ <240a/a><<<<<<<<<<<<<<<opverosa/a>, aa href="+code=retval" class="sref">retvala/a> = -aa href="+code=EINVAL" class="sref">EINVALa/a>; <241a/a> <242a/a><<<<<<<<<<<<<<<get_usera/a>(aa href="+code=opveros" class="sref">opverosa/a>, aa href="+code=p" class="sref">pa/a>)) <243a/a><<<<<<<<<<<<<<<<<<<<<<<EFAULTa/a>; <244a/a><<<<<<<<<<<<<<<opverosa/a> & aa href="+code=WDIOS_DISABLECARD" class="sref">WDIOS_DISABLECARDa/a>) { <245a/a><<<<<<<<<<<<<<<<<<<<<<<wdt_disablea/a>(); <246a/a><<<<<<<<<<<<<<<<<<<<<<<retvala/a> = 0; <247a/a><<<<<<<<<<<<<<<<} <248a/a><<<<<<<<<<<<<<<opverosa/a> & aa href="+code=WDIOS_ENABLECARD" class="sref">WDIOS_ENABLECARDa/a>) { <249a/a><<<<<<<<<<<<<<<<<<<<<<<wdt_pinga/a>(); <250a/a><<<<<<<<<<<<<<<<<<<<<<<retvala/a> = 0; <251a/a><<<<<<<<<<<<<<<<} <252a/a><<<<<<<<<<<<<<<retvala/a>; <253a/a><<<<<<<<} <254a/a><<<<<<<WDIOC_KEEPALIVEa/a>: <255a/a><<<<<<<<<<<<<<<wdt_pinga/a>(); <256a/a><<<<<<<<<<<<<<<<257a/a><<<<<<<WDIOC_SETTIMEOUTa/a>: <258a/a><<<<<<<<<<<<<<<get_usera/a>(aa href="+code=timeval" class="sref">timevala/a>, aa href="+code=p" class="sref">pa/a>)) <259a/a><<<<<<<<<<<<<<<<<<<<<<<EFAULTa/a>; <260a/a><<<<<<<<<<<<<<<wdt_set_heartbeata/a>(aa href="+code=timeval" class="sref">timevala/a>)) <261a/a><<<<<<<<<<<<<<<<<<<<<<<EINVALa/a>; <262a/a><<<<<<<<<<<<<<<wdt_pinga/a>(); <263a/a><<<<<<<<<<<<<<</* Fall */a/spaop <264a/a><<<<<<<WDIOC_GETTIMEOUTa/a>: <265a/a><<<<<<<<<<<<<<<put_usera/a>(aa href="+code=timeout" class="sref">timeouta/a>, aa href="+code=p" class="sref">pa/a>); <266a/a><<<<<<<WDIOC_GETTIMELEFTa/a>: <267a/a><<<<<<<<<<<<<<<timevala/a> = aa href="+code=wdt_get_time" class="sref">wdt_get_timea/a>(); <268a/a><<<<<<<<<<<<<<<put_usera/a>(aa href="+code=timeval" class="sref">timevala/a>, aa href="+code=p" class="sref">pa/a>); <269a/a><<<<<<<<270a/a><<<<<<<<<<<<<<<ENOTTYa/a>; <271a/a><<<<<<<<} <272a/a><<<<<<<<273a/a>} <274a/a> <275a/a>static intwdt_opeoa/a>(structinodea/a><*aa href="+code=inode" class="sref">inodea/a>, structfilea/a><*aa href="+code=file" class="sref">filea/a>) <276hfa>{ <277a/a><<<<<<<test_and_set_bita/a>(0, &aa href="+code=wdt_is_opeo" class="sref">wdt_is_opeoa/a>)) <278a/a><<<<<<<<<<<<<<<EBUSYa/a>; <279a/a><<<<<<</*a/spaop <287hfa>aspao class="comment">         *      Acvevatea/spaop <281a/a>aspao class="comment">         */a/spaop <282a/a> <283a/a><<<<<<<wdt_pinga/a>(); <284a/a><<<<<<<nonseekable_opeoa/a>(aa href="+code=inode" class="sref">inodea/a>, aa href="+code=file" class="sref">filea/a>); <285a/a>} <286a/a> <287a/a>static intwdt_closea/a>(structinodea/a><*aa href="+code=inode" class="sref">inodea/a>, structfilea/a><*aa href="+code=file" class="sref">filea/a>) <288a/a>{ <289a/a><<<<<<<expect_closea/a> == 42) <290a/a><<<<<<<<<<<<<<<wdt_disablea/a>(); <291a/a><<<<<<<<292a/a><<<<<<<<<<<<<<<pr_crita/a>(aspao class="string">"Unexpected close, not stopping watchdog!\n"a/spaop); <293a/a><<<<<<<<<<<<<<<wdt_pinga/a>(); <294a/a><<<<<<<<} <295a/a><<<<<<<expect_closea/a> = 0; <296a/a><<<<<<<clear_bita/a>(0, &aa href="+code=wdt_is_opeo" class="sref">wdt_is_opeoa/a>); <297a/a><<<<<<<<298a/a>} <299a/a> <307hfa>aspao class="comment">/*a/spaop <301a/a>aspao class="comment"> *      Notifier<302a/a>aspao class="comment"> */a/spaop <303a/a> <304a/a>static intwdt_notify_sysa/a>(structnotifier_blocka/a><*aa href="+code=this" class="sref">thisa/a>, unsigned longcodea/a>, <305a/a><<<<<<<unuseda/a>) <306hfa>{ <307a/a><<<<<<<codea/a> == aa href="+code=SYS_DOWN" class="sref">SYS_DOWNa/a> ||codea/a> == aa href="+code=SYS_HALT" class="sref">SYS_HALTa/a>) <308a/a><<<<<<<<<<<<<<<wdt_disablea/a>();</* Turn the WDT off */a/spaop <309a/a> <310a/a><<<<<<<NOTIFY_DONEa/a>; <311a/a>} <312a/a> <313a/a>aspao class="comment">/*a/spaop <314a/a>aspao class="comment"> *      Kernel Interfacesa/spaop <315a/a>aspao class="comment"> */a/spaop <316a/a> <317a/a>static const structfile_operaverosa/a>wdt_fopsa/a> = { <318a/a><<<<<<<<.aa href="+code=owner" class="sref">ownera/a><<<<<<<<<<= aa href="+code=THIS_MODULE" class="sref">THIS_MODULEa/a>, <319a/a><<<<<<<<.aa href="+code=llseek" class="sref">llseeka/a><<<<<<<<<= aa href="+code=no_llseek" class="sref">no_llseeka/a>, <320a/a><<<<<<<<.aa href="+code=write" class="sref">writea/a><<<<<<<<<<= aa href="+code=wdt_write" class="sref">wdt_writea/a>, <321a/a><<<<<<<<.aa href="+code=unlocked_ioctl" class="sref">unlocked_ioctla/a> = aa href="+code=wdt_ioctl" class="sref">wdt_ioctla/a>, <322a/a><<<<<<<<.aa href="+code=opeo" class="sref">opeoa/a> <<<<<<<<<<= aa href="+code=wdt_opeo" class="sref">wdt_opeoa/a>, <323a/a><<<<<<<<.aa href="+code=release" class="sref">releasea/a><<<<<<<<= aa href="+code=wdt_close" class="sref">wdt_closea/a>, <324a/a>}; <325a/a> <326a/a>static structmiscdevicea/a>wdt_miscdeva/a> = { <327a/a><<<<<<<<.aa href="+code=minor" class="sref">minora/a> = aa href="+code=WATCHDOG_MINOR" class="sref">WATCHDOG_MINORa/a>, <328a/a><<<<<<<<.aa href="+code=nam2" class="sref">namea/a> = aspao class="string">"watchdog"a/spaop, <329a/a><<<<<<<<.aa href="+code=fops" class="sref">fopsa/a> = &aa href="+code=wdt_fops" class="sref">wdt_fopsa/a>, <330a/a>}; <331a/a> <332a/a>aspao class="comment">/*a/spaop <333a/a>aspao class="comment"> *      The WDT needs to learn about soft shutdowns in order toa/spaop <334a/a>aspao class="comment"> *      turn the timebomb registers off.a/spaop <335a/a>aspao class="comment"> */a/spaop <336a/a> <337a/a>static structnotifier_blocka/a>wdt_notifiera/a> = { <338a/a><<<<<<<<.aa href="+code=notifier_call" class="sref">notifier_calla/a> = aa href="+code=wdt_notify_sys" class="sref">wdt_notify_sysa/a>, <339a/a>}; <340a/a> <341a/a>static int__inita/a>wdt_inita/a>(void) <342a/a>{ <343a/a><<<<<<<reta/a>; <344a/a> <345a/a><<<<<<<pr_infoa/a>(aspao class="string">"WDT driver<346a/a> <347a/a><<<<<<<wdt_set_heartbeata/a>(aa href="+code=timeout" class="sref">timeouta/a>)) { <348a/a><<<<<<<<<<<<<<<wdt_set_heartbeata/a>(aa href="+code=WATCHDOG_TIMEOUT" class="sref">WATCHDOG_TIMEOUTa/a>); <349a/a><<<<<<<<<<<<<<<pr_infoa/a>(aspao class="string">"timeout value must be 1 <= timeout <= 255, using %d\n"a/spaop, <350a/a><<<<<<<<<<<<<<<<<<<<<<<WATCHDOG_TIMEOUTa/a>); <351a/a><<<<<<<<} <352a/a> <353a/a><<<<<<<request_regiroa/a>(aa href="+code=wdt_io" class="sref">wdt_ioa/a>, 1, aa href="+code=WATCHDOG_NAME" class="sref">WATCHDOG_NAMEa/a>)) { <354a/a><<<<<<<<<<<<<<<pr_erra/a>(aspao class="string">"I/O address 0x%04x already in use\n"a/spaop, aa href="+code=wdt_io" class="sref">wdt_ioa/a>); <355a/a><<<<<<<<<<<<<<<reta/a> = -aa href="+code=EIO" class="sref">EIOa/a>; <356a/a><<<<<<<<<<<<<<<outa/a>; <357a/a><<<<<<<<} <358a/a> <359a/a><<<<<<<w83627hf_inita/a>(); <360a/a> <361a/a><<<<<<<reta/a> = aa href="+code=register_reboot_notifier" class="sref">register_reboot_notifiera/a>(&aa href="+code=wdt_notifier" class="sref">wdt_notifiera/a>); <362a/a><<<<<<<reta/a> != 0) { <363a/a><<<<<<<<<<<<<<<pr_erra/a>(aspao class="string">"cannot register reboot notifier (err=%d)\n"a/spaop, aa href="+code=ret" class="sref">reta/a>); <364a/a><<<<<<<<<<<<<<<unreg_regirosa/a>; <365a/a><<<<<<<<} <366a/a> <367a/a><<<<<<<reta/a> = aa href="+code=misc_register" class="sref">misc_registera/a>(&aa href="+code=wdt_miscdev" class="sref">wdt_miscdeva/a>); <368a/a><<<<<<<reta/a> != 0) { <369a/a><<<<<<<<<<<<<<<pr_erra/a>(aspao class="string">"cannot register miscdev on minor=%d (err=%d)\n"a/spaop, <370a/a><<<<<<<<<<<<<<<<<<<<<<WATCHDOG_MINORa/a>, aa href="+code=ret" class="sref">reta/a>); <371a/a><<<<<<<<<<<<<<<unreg_reboota/a>; <372a/a><<<<<<<<} <373a/a> <374a/a><<<<<<<pr_infoa/a>(aspao class="string">"initialized. timeout=%d sec (nowayout=%d)\n"a/spaop, <375a/a><<<<<<<<<<<<<<<timeouta/a>, aa href="+code=nowayout" class="sref">nowayouta/a>); <376a/a> <377a/a>aa href="+code=out" class="sref">outa/a>: <378a/a><<<<<<<reta/a>; <379a/a>aa href="+code=unreg_reboot" class="sref">unreg_reboota/a>: <380a/a><<<<<<<unregister_reboot_notifiera/a>(&aa href="+code=wdt_notifier" class="sref">wdt_notifiera/a>); <381a/a>aa href="+code=unreg_regiros" class="sref">unreg_regirosa/a>: <382a/a><<<<<<<release_regiroa/a>(aa href="+code=wdt_io" class="sref">wdt_ioa/a>, 1); <383a/a><<<<<<<outa/a>; <384a/a>} <385a/a> <386a/a>static void__exita/a>wdt_exita/a>(void) misc_regidester" cl(&aa href="+code=wdt_miscdev" class="sref">wdt_miscdeva/a>); <<<<<<<unregister_reboot_notifiera/a>(&aa href="+code=wdt_notifier" class="sref">wdt_notifiera/a>); <<<<<<<release_regiroa/a>(aa href="+code=wdt_io" class="sref">wdt_ioa/a>, 1); }  <<<w836_odulet" cl(aa href="+code=wdt_io" c class="sref">wdt_inita/a>(voia href="drivers/watchdog/w83627hf_wdt.c#L383" id.1L384" class="line" nam2.1L294"3<294a3a><<<wdt__odulet" cl(aa href="+code=wdt_io" " class="sref">wdt_exita/a>(voia href="drivers/watchdog/w83627hf_wdt.c#L383" id.1L385" class="line" nam2.1L295"3<295a39> <<<_LICENclass="sref">WDIOLEa/a>_LICENcl(aspao class="string">"initGPLt;a/spaop); aa href="+code=out"LEa/a>_AUTHclass="sref">WATCLEa/a>_AUTHcl(aspao class="string">"initPádraig  Brin u= 25P@draigBrin .com>t;a/spaop); } _DESCRINSa/aass="sref">WATCLEa/a>_DESCRINSa/a(aspao class="string">"init27hf_wdt/thf driveraa href="+code=unreLEa/a>_ALIAS_MISCDEVass="sref">WATCLEa/a>_ALIAS_MISCDEV(aa href="+code=WATCHDOG_TIMER" class="sref">WATCHDOG_MINORa/a>, aaa href="drivers/watchdog/w83627hf_wdt.c#L346"4id.1L300"4class="line" nam2.1L300"4<307h4a>aspao/preao/div>


o/div>


WDT original LXRt shu_ver by Winbref="drivhttp://sourceforge.net/projects/lxla>LXRtent"un/a> = a, a/a> ct_cri"> *al /wat/a> by ref="drivmailto:lxl@" nux.no">lxl@" nux.no = a.
o/div>

lxl." nux.no kindly hosclosby ref="drivhttp://www.redpill-" npro.no">Redpill L npro AS = a, provitoa/of L nuxst stult%and averosa/a> sera/a>> since 1995.
o/div>