wdt.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. /*
  2. * Industrial Computer Source WDT500/501 driver
  3. *
  4. * (c) Copyright 1996-1997 Alan Cox <alan@lxorguk.ukuu.org.uk>,
  5. * All Rights Reserved.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version
  10. * 2 of the License, or (at your option) any later version.
  11. *
  12. * Neither Alan Cox nor CymruNet Ltd. admit liability nor provide
  13. * warranty for any of this software. This material is provided
  14. * "AS-IS" and at no charge.
  15. *
  16. * (c) Copyright 1995 Alan Cox <alan@lxorguk.ukuu.org.uk>
  17. *
  18. * Release 0.10.
  19. *
  20. * Fixes
  21. * Dave Gregorich : Modularisation and minor bugs
  22. * Alan Cox : Added the watchdog ioctl() stuff
  23. * Alan Cox : Fixed the reboot problem (as noted by
  24. * Matt Crocker).
  25. * Alan Cox : Added wdt= boot option
  26. * Alan Cox : Cleaned up copy/user stuff
  27. * Tim Hockin : Added insmod parameters, comment
  28. * cleanup, parameterized timeout
  29. * Tigran Aivazian : Restructured wdt_init() to handle
  30. * failures
  31. * Joel Becker : Added WDIOC_GET/SETTIMEOUT
  32. * Matt Domsch : Added nowayout module option
  33. */
  34. #include <linux/interrupt.h>
  35. #include <linux/module.h>
  36. #include <linux/moduleparam.h>
  37. #include <linux/types.h>
  38. #include <linux/miscdevice.h>
  39. #include <linux/watchdog.h>
  40. #include <linux/fs.h>
  41. #include <linux/ioport.h>
  42. #include <linux/notifier.h>
  43. #include <linux/reboot.h>
  44. #include <linux/init.h>
  45. #include <linux/io.h>
  46. #include <linux/uaccess.h>
  47. #include <asm/system.h>
  48. #include "wd501p.h"
  49. static unsigned long wdt_is_open;
  50. static char expect_close;
  51. /*
  52. * Module parameters
  53. */
  54. #define WD_TIMO 60 /* Default heartbeat = 60 seconds */
  55. static int heartbeat = WD_TIMO;
  56. static int wd_heartbeat;
  57. module_param(heartbeat, int, 0);
  58. MODULE_PARM_DESC(heartbeat,
  59. "Watchdog heartbeat in seconds. (0 < heartbeat < 65536, default="
  60. __MODULE_STRING(WD_TIMO) ")");
  61. static int nowayout = WATCHDOG_NOWAYOUT;
  62. module_param(nowayout, int, 0);
  63. MODULE_PARM_DESC(nowayout,
  64. "Watchdog cannot be stopped once started (default="
  65. __MODULE_STRING(WATCHDOG_NOWAYOUT) ")");
  66. /* You must set these - there is no sane way to probe for this board. */
  67. static int io = 0x240;
  68. static int irq = 11;
  69. static DEFINE_SPINLOCK(wdt_lock);
  70. module_param(io, int, 0);
  71. MODULE_PARM_DESC(io, "WDT io port (default=0x240)");
  72. module_param(irq, int, 0);
  73. MODULE_PARM_DESC(irq, "WDT irq (default=11)");
  74. #ifdef CONFIG_WDT_501
  75. /* Support for the Fan Tachometer on the WDT501-P */
  76. static int tachometer;
  77. module_param(tachometer, int, 0);
  78. MODULE_PARM_DESC(tachometer,
  79. "WDT501-P Fan Tachometer support (0=disable, default=0)");
  80. #endif /* CONFIG_WDT_501 */
  81. /*
  82. * Programming support
  83. */
  84. static void wdt_ctr_mode(int ctr, int mode)
  85. {
  86. ctr <<= 6;
  87. ctr |= 0x30;
  88. ctr |= (mode << 1);
  89. outb_p(ctr, WDT_CR);
  90. }
  91. static void wdt_ctr_load(int ctr, int val)
  92. {
  93. outb_p(val&0xFF, WDT_COUNT0+ctr);
  94. outb_p(val>>8, WDT_COUNT0+ctr);
  95. }
  96. /**
  97. * wdt_start:
  98. *
  99. * Start the watchdog driver.
  100. */
  101. static int wdt_start(void)
  102. {
  103. unsigned long flags;
  104. spin_lock_irqsave(&wdt_lock, flags);
  105. inb_p(WDT_DC); /* Disable watchdog */
  106. wdt_ctr_mode(0, 3); /* Program CTR0 for Mode 3:
  107. Square Wave Generator */
  108. wdt_ctr_mode(1, 2); /* Program CTR1 for Mode 2:
  109. Rate Generator */
  110. wdt_ctr_mode(2, 0); /* Program CTR2 for Mode 0:
  111. Pulse on Terminal Count */
  112. wdt_ctr_load(0, 8948); /* Count at 100Hz */
  113. wdt_ctr_load(1, wd_heartbeat); /* Heartbeat */
  114. wdt_ctr_load(2, 65535); /* Length of reset pulse */
  115. outb_p(0, WDT_DC); /* Enable watchdog */
  116. spin_unlock_irqrestore(&wdt_lock, flags);
  117. return 0;
  118. }
  119. /**
  120. * wdt_stop:
  121. *
  122. * Stop the watchdog driver.
  123. */
  124. static int wdt_stop(void)
  125. {
  126. unsigned long flags;
  127. spin_lock_irqsave(&wdt_lock, flags);
  128. /* Turn the card off */
  129. inb_p(WDT_DC); /* Disable watchdog */
  130. wdt_ctr_load(2, 0); /* 0 length reset pulses now */
  131. spin_unlock_irqrestore(&wdt_lock, flags);
  132. return 0;
  133. }
  134. /**
  135. * wdt_ping:
  136. *
  137. * Reload counter one with the watchdog heartbeat. We don't bother
  138. * reloading the cascade counter.
  139. */
  140. static int wdt_ping(void)
  141. {
  142. unsigned long flags;
  143. spin_lock_irqsave(&wdt_lock, flags);
  144. /* Write a watchdog value */
  145. inb_p(WDT_DC); /* Disable watchdog */
  146. wdt_ctr_mode(1, 2); /* Re-Program CTR1 for Mode 2:
  147. Rate Generator */
  148. wdt_ctr_load(1, wd_heartbeat); /* Heartbeat */
  149. outb_p(0, WDT_DC); /* Enable watchdog */
  150. spin_unlock_irqrestore(&wdt_lock, flags);
  151. return 0;
  152. }
  153. /**
  154. * wdt_set_heartbeat:
  155. * @t: the new heartbeat value that needs to be set.
  156. *
  157. * Set a new heartbeat value for the watchdog device. If the heartbeat
  158. * value is incorrect we keep the old value and return -EINVAL. If
  159. * successful we return 0.
  160. */
  161. static int wdt_set_heartbeat(int t)
  162. {
  163. if (t < 1 || t > 65535)
  164. return -EINVAL;
  165. heartbeat = t;
  166. wd_heartbeat = t * 100;
  167. return 0;
  168. }
  169. /**
  170. * wdt_get_status:
  171. * @status: the new status.
  172. *
  173. * Extract the status information from a WDT watchdog device. There are
  174. * several board variants so we have to know which bits are valid. Some
  175. * bits default to one and some to zero in order to be maximally painful.
  176. *
  177. * we then map the bits onto the status ioctl flags.
  178. */
  179. static int wdt_get_status(int *status)
  180. {
  181. unsigned char new_status;
  182. unsigned long flags;
  183. spin_lock_irqsave(&wdt_lock, flags);
  184. new_status = inb_p(WDT_SR);
  185. spin_unlock_irqrestore(&wdt_lock, flags);
  186. *status = 0;
  187. if (new_status & WDC_SR_ISOI0)
  188. *status |= WDIOF_EXTERN1;
  189. if (new_status & WDC_SR_ISII1)
  190. *status |= WDIOF_EXTERN2;
  191. #ifdef CONFIG_WDT_501
  192. if (!(new_status & WDC_SR_TGOOD))
  193. *status |= WDIOF_OVERHEAT;
  194. if (!(new_status & WDC_SR_PSUOVER))
  195. *status |= WDIOF_POWEROVER;
  196. if (!(new_status & WDC_SR_PSUUNDR))
  197. *status |= WDIOF_POWERUNDER;
  198. if (tachometer) {
  199. if (!(new_status & WDC_SR_FANGOOD))
  200. *status |= WDIOF_FANFAULT;
  201. }
  202. #endif /* CONFIG_WDT_501 */
  203. return 0;
  204. }
  205. #ifdef CONFIG_WDT_501
  206. /**
  207. * wdt_get_temperature:
  208. *
  209. * Reports the temperature in degrees Fahrenheit. The API is in
  210. * farenheit. It was designed by an imperial measurement luddite.
  211. */
  212. static int wdt_get_temperature(int *temperature)
  213. {
  214. unsigned short c;
  215. unsigned long flags;
  216. spin_lock_irqsave(&wdt_lock, flags);
  217. c = inb_p(WDT_RT);
  218. spin_unlock_irqrestore(&wdt_lock, flags);
  219. *temperature = (c * 11 / 15) + 7;
  220. return 0;
  221. }
  222. #endif /* CONFIG_WDT_501 */
  223. /**
  224. * wdt_interrupt:
  225. * @irq: Interrupt number
  226. * @dev_id: Unused as we don't allow multiple devices.
  227. *
  228. * Handle an interrupt from the board. These are raised when the status
  229. * map changes in what the board considers an interesting way. That means
  230. * a failure condition occurring.
  231. */
  232. static irqreturn_t wdt_interrupt(int irq, void *dev_id)
  233. {
  234. /*
  235. * Read the status register see what is up and
  236. * then printk it.
  237. */
  238. unsigned char status;
  239. spin_lock(&wdt_lock);
  240. status = inb_p(WDT_SR);
  241. printk(KERN_CRIT "WDT status %d\n", status);
  242. #ifdef CONFIG_WDT_501
  243. if (!(status & WDC_SR_TGOOD))
  244. printk(KERN_CRIT "Overheat alarm.(%d)\n", inb_p(WDT_RT));
  245. if (!(status & WDC_SR_PSUOVER))
  246. printk(KERN_CRIT "PSU over voltage.\n");
  247. if (!(status & WDC_SR_PSUUNDR))
  248. printk(KERN_CRIT "PSU under voltage.\n");
  249. if (tachometer) {
  250. if (!(status & WDC_SR_FANGOOD))
  251. printk(KERN_CRIT "Possible fan fault.\n");
  252. }
  253. #endif /* CONFIG_WDT_501 */
  254. if (!(status & WDC_SR_WCCR)) {
  255. #ifdef SOFTWARE_REBOOT
  256. #ifdef ONLY_TESTING
  257. printk(KERN_CRIT "Would Reboot.\n");
  258. #else
  259. printk(KERN_CRIT "Initiating system reboot.\n");
  260. emergency_restart();
  261. #endif
  262. #else
  263. printk(KERN_CRIT "Reset in 5ms.\n");
  264. #endif
  265. }
  266. spin_unlock(&wdt_lock);
  267. return IRQ_HANDLED;
  268. }
  269. /**
  270. * wdt_write:
  271. * @file: file handle to the watchdog
  272. * @buf: buffer to write (unused as data does not matter here
  273. * @count: count of bytes
  274. * @ppos: pointer to the position to write. No seeks allowed
  275. *
  276. * A write to a watchdog device is defined as a keepalive signal. Any
  277. * write of data will do, as we we don't define content meaning.
  278. */
  279. static ssize_t wdt_write(struct file *file, const char __user *buf,
  280. size_t count, loff_t *ppos)
  281. {
  282. if (count) {
  283. if (!nowayout) {
  284. size_t i;
  285. /* In case it was set long ago */
  286. expect_close = 0;
  287. for (i = 0; i != count; i++) {
  288. char c;
  289. if (get_user(c, buf + i))
  290. return -EFAULT;
  291. if (c == 'V')
  292. expect_close = 42;
  293. }
  294. }
  295. wdt_ping();
  296. }
  297. return count;
  298. }
  299. /**
  300. * wdt_ioctl:
  301. * @file: file handle to the device
  302. * @cmd: watchdog command
  303. * @arg: argument pointer
  304. *
  305. * The watchdog API defines a common set of functions for all watchdogs
  306. * according to their available features. We only actually usefully support
  307. * querying capabilities and current status.
  308. */
  309. static long wdt_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  310. {
  311. void __user *argp = (void __user *)arg;
  312. int __user *p = argp;
  313. int new_heartbeat;
  314. int status;
  315. static struct watchdog_info ident = {
  316. .options = WDIOF_SETTIMEOUT|
  317. WDIOF_MAGICCLOSE|
  318. WDIOF_KEEPALIVEPING,
  319. .firmware_version = 1,
  320. .identity = "WDT500/501",
  321. };
  322. /* Add options according to the card we have */
  323. ident.options |= (WDIOF_EXTERN1|WDIOF_EXTERN2);
  324. #ifdef CONFIG_WDT_501
  325. ident.options |= (WDIOF_OVERHEAT|WDIOF_POWERUNDER|WDIOF_POWEROVER);
  326. if (tachometer)
  327. ident.options |= WDIOF_FANFAULT;
  328. #endif /* CONFIG_WDT_501 */
  329. switch (cmd) {
  330. case WDIOC_GETSUPPORT:
  331. return copy_to_user(argp, &ident, sizeof(ident)) ? -EFAULT : 0;
  332. case WDIOC_GETSTATUS:
  333. wdt_get_status(&status);
  334. return put_user(status, p);
  335. case WDIOC_GETBOOTSTATUS:
  336. return put_user(0, p);
  337. case WDIOC_KEEPALIVE:
  338. wdt_ping();
  339. return 0;
  340. case WDIOC_SETTIMEOUT:
  341. if (get_user(new_heartbeat, p))
  342. return -EFAULT;
  343. if (wdt_set_heartbeat(new_heartbeat))
  344. return -EINVAL;
  345. wdt_ping();
  346. /* Fall */
  347. case WDIOC_GETTIMEOUT:
  348. return put_user(heartbeat, p);
  349. default:
  350. return -ENOTTY;
  351. }
  352. }
  353. /**
  354. * wdt_open:
  355. * @inode: inode of device
  356. * @file: file handle to device
  357. *
  358. * The watchdog device has been opened. The watchdog device is single
  359. * open and on opening we load the counters. Counter zero is a 100Hz
  360. * cascade, into counter 1 which downcounts to reboot. When the counter
  361. * triggers counter 2 downcounts the length of the reset pulse which
  362. * set set to be as long as possible.
  363. */
  364. static int wdt_open(struct inode *inode, struct file *file)
  365. {
  366. if (test_and_set_bit(0, &wdt_is_open))
  367. return -EBUSY;
  368. /*
  369. * Activate
  370. */
  371. wdt_start();
  372. return nonseekable_open(inode, file);
  373. }
  374. /**
  375. * wdt_release:
  376. * @inode: inode to board
  377. * @file: file handle to board
  378. *
  379. * The watchdog has a configurable API. There is a religious dispute
  380. * between people who want their watchdog to be able to shut down and
  381. * those who want to be sure if the watchdog manager dies the machine
  382. * reboots. In the former case we disable the counters, in the latter
  383. * case you have to open it again very soon.
  384. */
  385. static int wdt_release(struct inode *inode, struct file *file)
  386. {
  387. if (expect_close == 42) {
  388. wdt_stop();
  389. clear_bit(0, &wdt_is_open);
  390. } else {
  391. printk(KERN_CRIT
  392. "wdt: WDT device closed unexpectedly. WDT will not stop!\n");
  393. wdt_ping();
  394. }
  395. expect_close = 0;
  396. return 0;
  397. }
  398. #ifdef CONFIG_WDT_501
  399. /**
  400. * wdt_temp_read:
  401. * @file: file handle to the watchdog board
  402. * @buf: buffer to write 1 byte into
  403. * @count: length of buffer
  404. * @ptr: offset (no seek allowed)
  405. *
  406. * Temp_read reports the temperature in degrees Fahrenheit. The API is in
  407. * farenheit. It was designed by an imperial measurement luddite.
  408. */
  409. static ssize_t wdt_temp_read(struct file *file, char __user *buf,
  410. size_t count, loff_t *ptr)
  411. {
  412. int temperature;
  413. if (wdt_get_temperature(&temperature))
  414. return -EFAULT;
  415. if (copy_to_user(buf, &temperature, 1))
  416. return -EFAULT;
  417. return 1;
  418. }
  419. /**
  420. * wdt_temp_open:
  421. * @inode: inode of device
  422. * @file: file handle to device
  423. *
  424. * The temperature device has been opened.
  425. */
  426. static int wdt_temp_open(struct inode *inode, struct file *file)
  427. {
  428. return nonseekable_open(inode, file);
  429. }
  430. /**
  431. * wdt_temp_release:
  432. * @inode: inode to board
  433. * @file: file handle to board
  434. *
  435. * The temperature device has been closed.
  436. */
  437. static int wdt_temp_release(struct inode *inode, struct file *file)
  438. {
  439. return 0;
  440. }
  441. #endif /* CONFIG_WDT_501 */
  442. /**
  443. * notify_sys:
  444. * @this: our notifier block
  445. * @code: the event being reported
  446. * @unused: unused
  447. *
  448. * Our notifier is called on system shutdowns. We want to turn the card
  449. * off at reboot otherwise the machine will reboot again during memory
  450. * test or worse yet during the following fsck. This would suck, in fact
  451. * trust me - if it happens it does suck.
  452. */
  453. static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
  454. void *unused)
  455. {
  456. if (code == SYS_DOWN || code == SYS_HALT)
  457. wdt_stop();
  458. return NOTIFY_DONE;
  459. }
  460. /*
  461. * Kernel Interfaces
  462. */
  463. static const struct file_operations wdt_fops = {
  464. .owner = THIS_MODULE,
  465. .llseek = no_llseek,
  466. .write = wdt_write,
  467. .unlocked_ioctl = wdt_ioctl,
  468. .open = wdt_open,
  469. .release = wdt_release,
  470. };
  471. static struct miscdevice wdt_miscdev = {
  472. .minor = WATCHDOG_MINOR,
  473. .name = "watchdog",
  474. .fops = &wdt_fops,
  475. };
  476. #ifdef CONFIG_WDT_501
  477. static const struct file_operations wdt_temp_fops = {
  478. .owner = THIS_MODULE,
  479. .llseek = no_llseek,
  480. .read = wdt_temp_read,
  481. .open = wdt_temp_open,
  482. .release = wdt_temp_release,
  483. };
  484. static struct miscdevice temp_miscdev = {
  485. .minor = TEMP_MINOR,
  486. .name = "temperature",
  487. .fops = &wdt_temp_fops,
  488. };
  489. #endif /* CONFIG_WDT_501 */
  490. /*
  491. * The WDT card needs to learn about soft shutdowns in order to
  492. * turn the timebomb registers off.
  493. */
  494. static struct notifier_block wdt_notifier = {
  495. .notifier_call = wdt_notify_sys,
  496. };
  497. /**
  498. * cleanup_module:
  499. *
  500. * Unload the watchdog. You cannot do this with any file handles open.
  501. * If your watchdog is set to continue ticking on close and you unload
  502. * it, well it keeps ticking. We won't get the interrupt but the board
  503. * will not touch PC memory so all is fine. You just have to load a new
  504. * module in 60 seconds or reboot.
  505. */
  506. static void __exit wdt_exit(void)
  507. {
  508. misc_deregister(&wdt_miscdev);
  509. #ifdef CONFIG_WDT_501
  510. misc_deregister(&temp_miscdev);
  511. #endif /* CONFIG_WDT_501 */
  512. unregister_reboot_notifier(&wdt_notifier);
  513. free_irq(irq, NULL);
  514. release_region(io, 8);
  515. }
  516. /**
  517. * wdt_init:
  518. *
  519. * Set up the WDT watchdog board. All we have to do is grab the
  520. * resources we require and bitch if anyone beat us to them.
  521. * The open() function will actually kick the board off.
  522. */
  523. static int __init wdt_init(void)
  524. {
  525. int ret;
  526. /* Check that the heartbeat value is within it's range;
  527. if not reset to the default */
  528. if (wdt_set_heartbeat(heartbeat)) {
  529. wdt_set_heartbeat(WD_TIMO);
  530. printk(KERN_INFO "wdt: heartbeat value must be 0 < heartbeat < 65536, using %d\n",
  531. WD_TIMO);
  532. }
  533. if (!request_region(io, 8, "wdt501p")) {
  534. printk(KERN_ERR
  535. "wdt: I/O address 0x%04x already in use\n", io);
  536. ret = -EBUSY;
  537. goto out;
  538. }
  539. ret = request_irq(irq, wdt_interrupt, IRQF_DISABLED, "wdt501p", NULL);
  540. if (ret) {
  541. printk(KERN_ERR "wdt: IRQ %d is not free.\n", irq);
  542. goto outreg;
  543. }
  544. ret = register_reboot_notifier(&wdt_notifier);
  545. if (ret) {
  546. printk(KERN_ERR
  547. "wdt: cannot register reboot notifier (err=%d)\n", ret);
  548. goto outirq;
  549. }
  550. #ifdef CONFIG_WDT_501
  551. ret = misc_register(&temp_miscdev);
  552. if (ret) {
  553. printk(KERN_ERR
  554. "wdt: cannot register miscdev on minor=%d (err=%d)\n",
  555. TEMP_MINOR, ret);
  556. goto outrbt;
  557. }
  558. #endif /* CONFIG_WDT_501 */
  559. ret = misc_register(&wdt_miscdev);
  560. if (ret) {
  561. printk(KERN_ERR
  562. "wdt: cannot register miscdev on minor=%d (err=%d)\n",
  563. WATCHDOG_MINOR, ret);
  564. goto outmisc;
  565. }
  566. ret = 0;
  567. printk(KERN_INFO "WDT500/501-P driver 0.10 at 0x%04x (Interrupt %d). heartbeat=%d sec (nowayout=%d)\n",
  568. io, irq, heartbeat, nowayout);
  569. #ifdef CONFIG_WDT_501
  570. printk(KERN_INFO "wdt: Fan Tachometer is %s\n",
  571. (tachometer ? "Enabled" : "Disabled"));
  572. #endif /* CONFIG_WDT_501 */
  573. out:
  574. return ret;
  575. outmisc:
  576. #ifdef CONFIG_WDT_501
  577. misc_deregister(&temp_miscdev);
  578. outrbt:
  579. #endif /* CONFIG_WDT_501 */
  580. unregister_reboot_notifier(&wdt_notifier);
  581. outirq:
  582. free_irq(irq, NULL);
  583. outreg:
  584. release_region(io, 8);
  585. goto out;
  586. }
  587. module_init(wdt_init);
  588. module_exit(wdt_exit);
  589. MODULE_AUTHOR("Alan Cox");
  590. MODULE_DESCRIPTION("Driver for ISA ICS watchdog cards (WDT500/501)");
  591. MODULE_ALIAS_MISCDEV(WATCHDOG_MINOR);
  592. MODULE_ALIAS_MISCDEV(TEMP_MINOR);
  593. MODULE_LICENSE("GPL");