belkin_sa.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. /*
  2. * Belkin USB Serial Adapter Driver
  3. *
  4. * Copyright (C) 2000 William Greathouse (wgreathouse@smva.com)
  5. * Copyright (C) 2000-2001 Greg Kroah-Hartman (greg@kroah.com)
  6. *
  7. * This program is largely derived from work by the linux-usb group
  8. * and associated source files. Please see the usb/serial files for
  9. * individual credits and copyrights.
  10. *
  11. * This program is free software; you can redistribute it and/or modify
  12. * it under the terms of the GNU General Public License as published by
  13. * the Free Software Foundation; either version 2 of the License, or
  14. * (at your option) any later version.
  15. *
  16. * See Documentation/usb/usb-serial.txt for more information on using this
  17. * driver
  18. *
  19. * TODO:
  20. * -- Add true modem contol line query capability. Currently we track the
  21. * states reported by the interrupt and the states we request.
  22. * -- Add error reporting back to application for UART error conditions.
  23. * Just point me at how to implement this and I'll do it. I've put the
  24. * framework in, but haven't analyzed the "tty_flip" interface yet.
  25. * -- Add support for flush commands
  26. * -- Add everything that is missing :)
  27. *
  28. * 27-Nov-2001 gkh
  29. * compressed all the differnent device entries into 1.
  30. *
  31. * 30-May-2001 gkh
  32. * switched from using spinlock to a semaphore, which fixes lots of
  33. * problems.
  34. *
  35. * 08-Apr-2001 gb
  36. * - Identify version on module load.
  37. *
  38. * 12-Mar-2001 gkh
  39. * - Added support for the GoHubs GO-COM232 device which is the same as the
  40. * Peracom device.
  41. *
  42. * 06-Nov-2000 gkh
  43. * - Added support for the old Belkin and Peracom devices.
  44. * - Made the port able to be opened multiple times.
  45. * - Added some defaults incase the line settings are things these devices
  46. * can't support.
  47. *
  48. * 18-Oct-2000 William Greathouse
  49. * Released into the wild (linux-usb-devel)
  50. *
  51. * 17-Oct-2000 William Greathouse
  52. * Add code to recognize firmware version and set hardware flow control
  53. * appropriately. Belkin states that firmware prior to 3.05 does not
  54. * operate correctly in hardware handshake mode. I have verified this
  55. * on firmware 2.05 -- for both RTS and DTR input flow control, the control
  56. * line is not reset. The test performed by the Belkin Win* driver is
  57. * to enable hardware flow control for firmware 2.06 or greater and
  58. * for 1.00 or prior. I am only enabling for 2.06 or greater.
  59. *
  60. * 12-Oct-2000 William Greathouse
  61. * First cut at supporting Belkin USB Serial Adapter F5U103
  62. * I did not have a copy of the original work to support this
  63. * adapter, so pardon any stupid mistakes. All of the information
  64. * I am using to write this driver was acquired by using a modified
  65. * UsbSnoop on Windows2000 and from examining the other USB drivers.
  66. */
  67. #include <linux/kernel.h>
  68. #include <linux/errno.h>
  69. #include <linux/init.h>
  70. #include <linux/slab.h>
  71. #include <linux/tty.h>
  72. #include <linux/tty_driver.h>
  73. #include <linux/tty_flip.h>
  74. #include <linux/module.h>
  75. #include <linux/spinlock.h>
  76. #include <linux/uaccess.h>
  77. #include <linux/usb.h>
  78. #include <linux/usb/serial.h>
  79. #include "belkin_sa.h"
  80. static int debug;
  81. /*
  82. * Version Information
  83. */
  84. #define DRIVER_VERSION "v1.2"
  85. #define DRIVER_AUTHOR "William Greathouse <wgreathouse@smva.com>"
  86. #define DRIVER_DESC "USB Belkin Serial converter driver"
  87. /* function prototypes for a Belkin USB Serial Adapter F5U103 */
  88. static int belkin_sa_startup(struct usb_serial *serial);
  89. static void belkin_sa_shutdown(struct usb_serial *serial);
  90. static int belkin_sa_open(struct tty_struct *tty,
  91. struct usb_serial_port *port, struct file *filp);
  92. static void belkin_sa_close(struct tty_struct *tty,
  93. struct usb_serial_port *port, struct file *filp);
  94. static void belkin_sa_read_int_callback(struct urb *urb);
  95. static void belkin_sa_set_termios(struct tty_struct *tty,
  96. struct usb_serial_port *port, struct ktermios * old);
  97. static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state);
  98. static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file);
  99. static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file,
  100. unsigned int set, unsigned int clear);
  101. static struct usb_device_id id_table_combined [] = {
  102. { USB_DEVICE(BELKIN_SA_VID, BELKIN_SA_PID) },
  103. { USB_DEVICE(BELKIN_OLD_VID, BELKIN_OLD_PID) },
  104. { USB_DEVICE(PERACOM_VID, PERACOM_PID) },
  105. { USB_DEVICE(GOHUBS_VID, GOHUBS_PID) },
  106. { USB_DEVICE(GOHUBS_VID, HANDYLINK_PID) },
  107. { USB_DEVICE(BELKIN_DOCKSTATION_VID, BELKIN_DOCKSTATION_PID) },
  108. { } /* Terminating entry */
  109. };
  110. MODULE_DEVICE_TABLE(usb, id_table_combined);
  111. static struct usb_driver belkin_driver = {
  112. .name = "belkin",
  113. .probe = usb_serial_probe,
  114. .disconnect = usb_serial_disconnect,
  115. .id_table = id_table_combined,
  116. .no_dynamic_id = 1,
  117. };
  118. /* All of the device info needed for the serial converters */
  119. static struct usb_serial_driver belkin_device = {
  120. .driver = {
  121. .owner = THIS_MODULE,
  122. .name = "belkin",
  123. },
  124. .description = "Belkin / Peracom / GoHubs USB Serial Adapter",
  125. .usb_driver = &belkin_driver,
  126. .id_table = id_table_combined,
  127. .num_ports = 1,
  128. .open = belkin_sa_open,
  129. .close = belkin_sa_close,
  130. .read_int_callback = belkin_sa_read_int_callback,
  131. /* How we get the status info */
  132. .set_termios = belkin_sa_set_termios,
  133. .break_ctl = belkin_sa_break_ctl,
  134. .tiocmget = belkin_sa_tiocmget,
  135. .tiocmset = belkin_sa_tiocmset,
  136. .attach = belkin_sa_startup,
  137. .shutdown = belkin_sa_shutdown,
  138. };
  139. struct belkin_sa_private {
  140. spinlock_t lock;
  141. unsigned long control_state;
  142. unsigned char last_lsr;
  143. unsigned char last_msr;
  144. int bad_flow_control;
  145. };
  146. /*
  147. * ***************************************************************************
  148. * Belkin USB Serial Adapter F5U103 specific driver functions
  149. * ***************************************************************************
  150. */
  151. #define WDR_TIMEOUT 5000 /* default urb timeout */
  152. /* assumes that struct usb_serial *serial is available */
  153. #define BSA_USB_CMD(c, v) usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0), \
  154. (c), BELKIN_SA_SET_REQUEST_TYPE, \
  155. (v), 0, NULL, 0, WDR_TIMEOUT)
  156. /* do some startup allocations not currently performed by usb_serial_probe() */
  157. static int belkin_sa_startup(struct usb_serial *serial)
  158. {
  159. struct usb_device *dev = serial->dev;
  160. struct belkin_sa_private *priv;
  161. /* allocate the private data structure */
  162. priv = kmalloc(sizeof(struct belkin_sa_private), GFP_KERNEL);
  163. if (!priv)
  164. return -1; /* error */
  165. /* set initial values for control structures */
  166. spin_lock_init(&priv->lock);
  167. priv->control_state = 0;
  168. priv->last_lsr = 0;
  169. priv->last_msr = 0;
  170. /* see comments at top of file */
  171. priv->bad_flow_control =
  172. (le16_to_cpu(dev->descriptor.bcdDevice) <= 0x0206) ? 1 : 0;
  173. info("bcdDevice: %04x, bfc: %d",
  174. le16_to_cpu(dev->descriptor.bcdDevice),
  175. priv->bad_flow_control);
  176. init_waitqueue_head(&serial->port[0]->write_wait);
  177. usb_set_serial_port_data(serial->port[0], priv);
  178. return 0;
  179. }
  180. static void belkin_sa_shutdown(struct usb_serial *serial)
  181. {
  182. struct belkin_sa_private *priv;
  183. int i;
  184. dbg("%s", __func__);
  185. /* stop reads and writes on all ports */
  186. for (i = 0; i < serial->num_ports; ++i) {
  187. /* My special items, the standard routines free my urbs */
  188. priv = usb_get_serial_port_data(serial->port[i]);
  189. kfree(priv);
  190. }
  191. }
  192. static int belkin_sa_open(struct tty_struct *tty,
  193. struct usb_serial_port *port, struct file *filp)
  194. {
  195. int retval = 0;
  196. dbg("%s port %d", __func__, port->number);
  197. /*Start reading from the device*/
  198. /* TODO: Look at possibility of submitting multiple URBs to device to
  199. * enhance buffering. Win trace shows 16 initial read URBs.
  200. */
  201. port->read_urb->dev = port->serial->dev;
  202. retval = usb_submit_urb(port->read_urb, GFP_KERNEL);
  203. if (retval) {
  204. err("usb_submit_urb(read bulk) failed");
  205. goto exit;
  206. }
  207. port->interrupt_in_urb->dev = port->serial->dev;
  208. retval = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
  209. if (retval) {
  210. usb_kill_urb(port->read_urb);
  211. err(" usb_submit_urb(read int) failed");
  212. }
  213. exit:
  214. return retval;
  215. } /* belkin_sa_open */
  216. static void belkin_sa_close(struct tty_struct *tty,
  217. struct usb_serial_port *port, struct file *filp)
  218. {
  219. dbg("%s port %d", __func__, port->number);
  220. /* shutdown our bulk reads and writes */
  221. usb_kill_urb(port->write_urb);
  222. usb_kill_urb(port->read_urb);
  223. usb_kill_urb(port->interrupt_in_urb);
  224. } /* belkin_sa_close */
  225. static void belkin_sa_read_int_callback(struct urb *urb)
  226. {
  227. struct usb_serial_port *port = urb->context;
  228. struct belkin_sa_private *priv;
  229. unsigned char *data = urb->transfer_buffer;
  230. int retval;
  231. int status = urb->status;
  232. unsigned long flags;
  233. switch (status) {
  234. case 0:
  235. /* success */
  236. break;
  237. case -ECONNRESET:
  238. case -ENOENT:
  239. case -ESHUTDOWN:
  240. /* this urb is terminated, clean up */
  241. dbg("%s - urb shutting down with status: %d",
  242. __func__, status);
  243. return;
  244. default:
  245. dbg("%s - nonzero urb status received: %d",
  246. __func__, status);
  247. goto exit;
  248. }
  249. usb_serial_debug_data(debug, &port->dev, __func__,
  250. urb->actual_length, data);
  251. /* Handle known interrupt data */
  252. /* ignore data[0] and data[1] */
  253. priv = usb_get_serial_port_data(port);
  254. spin_lock_irqsave(&priv->lock, flags);
  255. priv->last_msr = data[BELKIN_SA_MSR_INDEX];
  256. /* Record Control Line states */
  257. if (priv->last_msr & BELKIN_SA_MSR_DSR)
  258. priv->control_state |= TIOCM_DSR;
  259. else
  260. priv->control_state &= ~TIOCM_DSR;
  261. if (priv->last_msr & BELKIN_SA_MSR_CTS)
  262. priv->control_state |= TIOCM_CTS;
  263. else
  264. priv->control_state &= ~TIOCM_CTS;
  265. if (priv->last_msr & BELKIN_SA_MSR_RI)
  266. priv->control_state |= TIOCM_RI;
  267. else
  268. priv->control_state &= ~TIOCM_RI;
  269. if (priv->last_msr & BELKIN_SA_MSR_CD)
  270. priv->control_state |= TIOCM_CD;
  271. else
  272. priv->control_state &= ~TIOCM_CD;
  273. /* Now to report any errors */
  274. priv->last_lsr = data[BELKIN_SA_LSR_INDEX];
  275. #if 0
  276. /*
  277. * fill in the flip buffer here, but I do not know the relation
  278. * to the current/next receive buffer or characters. I need
  279. * to look in to this before committing any code.
  280. */
  281. if (priv->last_lsr & BELKIN_SA_LSR_ERR) {
  282. tty = port->port.tty;
  283. /* Overrun Error */
  284. if (priv->last_lsr & BELKIN_SA_LSR_OE) {
  285. }
  286. /* Parity Error */
  287. if (priv->last_lsr & BELKIN_SA_LSR_PE) {
  288. }
  289. /* Framing Error */
  290. if (priv->last_lsr & BELKIN_SA_LSR_FE) {
  291. }
  292. /* Break Indicator */
  293. if (priv->last_lsr & BELKIN_SA_LSR_BI) {
  294. }
  295. }
  296. #endif
  297. spin_unlock_irqrestore(&priv->lock, flags);
  298. exit:
  299. retval = usb_submit_urb(urb, GFP_ATOMIC);
  300. if (retval)
  301. err("%s - usb_submit_urb failed with result %d",
  302. __func__, retval);
  303. }
  304. static void belkin_sa_set_termios(struct tty_struct *tty,
  305. struct usb_serial_port *port, struct ktermios *old_termios)
  306. {
  307. struct usb_serial *serial = port->serial;
  308. struct belkin_sa_private *priv = usb_get_serial_port_data(port);
  309. unsigned int iflag;
  310. unsigned int cflag;
  311. unsigned int old_iflag = 0;
  312. unsigned int old_cflag = 0;
  313. __u16 urb_value = 0; /* Will hold the new flags */
  314. unsigned long flags;
  315. unsigned long control_state;
  316. int bad_flow_control;
  317. speed_t baud;
  318. struct ktermios *termios = tty->termios;
  319. iflag = termios->c_iflag;
  320. cflag = termios->c_cflag;
  321. termios->c_cflag &= ~CMSPAR;
  322. /* get a local copy of the current port settings */
  323. spin_lock_irqsave(&priv->lock, flags);
  324. control_state = priv->control_state;
  325. bad_flow_control = priv->bad_flow_control;
  326. spin_unlock_irqrestore(&priv->lock, flags);
  327. old_iflag = old_termios->c_iflag;
  328. old_cflag = old_termios->c_cflag;
  329. /* Set the baud rate */
  330. if ((cflag & CBAUD) != (old_cflag & CBAUD)) {
  331. /* reassert DTR and (maybe) RTS on transition from B0 */
  332. if ((old_cflag & CBAUD) == B0) {
  333. control_state |= (TIOCM_DTR|TIOCM_RTS);
  334. if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 1) < 0)
  335. err("Set DTR error");
  336. /* don't set RTS if using hardware flow control */
  337. if (!(old_cflag & CRTSCTS))
  338. if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST
  339. , 1) < 0)
  340. err("Set RTS error");
  341. }
  342. }
  343. baud = tty_get_baud_rate(tty);
  344. if (baud) {
  345. urb_value = BELKIN_SA_BAUD(baud);
  346. /* Clip to maximum speed */
  347. if (urb_value == 0)
  348. urb_value = 1;
  349. /* Turn it back into a resulting real baud rate */
  350. baud = BELKIN_SA_BAUD(urb_value);
  351. /* Report the actual baud rate back to the caller */
  352. tty_encode_baud_rate(tty, baud, baud);
  353. if (BSA_USB_CMD(BELKIN_SA_SET_BAUDRATE_REQUEST, urb_value) < 0)
  354. err("Set baudrate error");
  355. } else {
  356. /* Disable flow control */
  357. if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST,
  358. BELKIN_SA_FLOW_NONE) < 0)
  359. err("Disable flowcontrol error");
  360. /* Drop RTS and DTR */
  361. control_state &= ~(TIOCM_DTR | TIOCM_RTS);
  362. if (BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, 0) < 0)
  363. err("DTR LOW error");
  364. if (BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, 0) < 0)
  365. err("RTS LOW error");
  366. }
  367. /* set the parity */
  368. if ((cflag ^ old_cflag) & (PARENB | PARODD)) {
  369. if (cflag & PARENB)
  370. urb_value = (cflag & PARODD) ? BELKIN_SA_PARITY_ODD
  371. : BELKIN_SA_PARITY_EVEN;
  372. else
  373. urb_value = BELKIN_SA_PARITY_NONE;
  374. if (BSA_USB_CMD(BELKIN_SA_SET_PARITY_REQUEST, urb_value) < 0)
  375. err("Set parity error");
  376. }
  377. /* set the number of data bits */
  378. if ((cflag & CSIZE) != (old_cflag & CSIZE)) {
  379. switch (cflag & CSIZE) {
  380. case CS5:
  381. urb_value = BELKIN_SA_DATA_BITS(5);
  382. break;
  383. case CS6:
  384. urb_value = BELKIN_SA_DATA_BITS(6);
  385. break;
  386. case CS7:
  387. urb_value = BELKIN_SA_DATA_BITS(7);
  388. break;
  389. case CS8:
  390. urb_value = BELKIN_SA_DATA_BITS(8);
  391. break;
  392. default: dbg("CSIZE was not CS5-CS8, using default of 8");
  393. urb_value = BELKIN_SA_DATA_BITS(8);
  394. break;
  395. }
  396. if (BSA_USB_CMD(BELKIN_SA_SET_DATA_BITS_REQUEST, urb_value) < 0)
  397. err("Set data bits error");
  398. }
  399. /* set the number of stop bits */
  400. if ((cflag & CSTOPB) != (old_cflag & CSTOPB)) {
  401. urb_value = (cflag & CSTOPB) ? BELKIN_SA_STOP_BITS(2)
  402. : BELKIN_SA_STOP_BITS(1);
  403. if (BSA_USB_CMD(BELKIN_SA_SET_STOP_BITS_REQUEST,
  404. urb_value) < 0)
  405. err("Set stop bits error");
  406. }
  407. /* Set flow control */
  408. if (((iflag ^ old_iflag) & (IXOFF | IXON)) ||
  409. ((cflag ^ old_cflag) & CRTSCTS)) {
  410. urb_value = 0;
  411. if ((iflag & IXOFF) || (iflag & IXON))
  412. urb_value |= (BELKIN_SA_FLOW_OXON | BELKIN_SA_FLOW_IXON);
  413. else
  414. urb_value &= ~(BELKIN_SA_FLOW_OXON | BELKIN_SA_FLOW_IXON);
  415. if (cflag & CRTSCTS)
  416. urb_value |= (BELKIN_SA_FLOW_OCTS | BELKIN_SA_FLOW_IRTS);
  417. else
  418. urb_value &= ~(BELKIN_SA_FLOW_OCTS | BELKIN_SA_FLOW_IRTS);
  419. if (bad_flow_control)
  420. urb_value &= ~(BELKIN_SA_FLOW_IRTS);
  421. if (BSA_USB_CMD(BELKIN_SA_SET_FLOW_CTRL_REQUEST, urb_value) < 0)
  422. err("Set flow control error");
  423. }
  424. /* save off the modified port settings */
  425. spin_lock_irqsave(&priv->lock, flags);
  426. priv->control_state = control_state;
  427. spin_unlock_irqrestore(&priv->lock, flags);
  428. } /* belkin_sa_set_termios */
  429. static void belkin_sa_break_ctl(struct tty_struct *tty, int break_state)
  430. {
  431. struct usb_serial_port *port = tty->driver_data;
  432. struct usb_serial *serial = port->serial;
  433. if (BSA_USB_CMD(BELKIN_SA_SET_BREAK_REQUEST, break_state ? 1 : 0) < 0)
  434. err("Set break_ctl %d", break_state);
  435. }
  436. static int belkin_sa_tiocmget(struct tty_struct *tty, struct file *file)
  437. {
  438. struct usb_serial_port *port = tty->driver_data;
  439. struct belkin_sa_private *priv = usb_get_serial_port_data(port);
  440. unsigned long control_state;
  441. unsigned long flags;
  442. dbg("%s", __func__);
  443. spin_lock_irqsave(&priv->lock, flags);
  444. control_state = priv->control_state;
  445. spin_unlock_irqrestore(&priv->lock, flags);
  446. return control_state;
  447. }
  448. static int belkin_sa_tiocmset(struct tty_struct *tty, struct file *file,
  449. unsigned int set, unsigned int clear)
  450. {
  451. struct usb_serial_port *port = tty->driver_data;
  452. struct usb_serial *serial = port->serial;
  453. struct belkin_sa_private *priv = usb_get_serial_port_data(port);
  454. unsigned long control_state;
  455. unsigned long flags;
  456. int retval;
  457. int rts = 0;
  458. int dtr = 0;
  459. dbg("%s", __func__);
  460. spin_lock_irqsave(&priv->lock, flags);
  461. control_state = priv->control_state;
  462. if (set & TIOCM_RTS) {
  463. control_state |= TIOCM_RTS;
  464. rts = 1;
  465. }
  466. if (set & TIOCM_DTR) {
  467. control_state |= TIOCM_DTR;
  468. dtr = 1;
  469. }
  470. if (clear & TIOCM_RTS) {
  471. control_state &= ~TIOCM_RTS;
  472. rts = 0;
  473. }
  474. if (clear & TIOCM_DTR) {
  475. control_state &= ~TIOCM_DTR;
  476. dtr = 0;
  477. }
  478. priv->control_state = control_state;
  479. spin_unlock_irqrestore(&priv->lock, flags);
  480. retval = BSA_USB_CMD(BELKIN_SA_SET_RTS_REQUEST, rts);
  481. if (retval < 0) {
  482. err("Set RTS error %d", retval);
  483. goto exit;
  484. }
  485. retval = BSA_USB_CMD(BELKIN_SA_SET_DTR_REQUEST, dtr);
  486. if (retval < 0) {
  487. err("Set DTR error %d", retval);
  488. goto exit;
  489. }
  490. exit:
  491. return retval;
  492. }
  493. static int __init belkin_sa_init(void)
  494. {
  495. int retval;
  496. retval = usb_serial_register(&belkin_device);
  497. if (retval)
  498. goto failed_usb_serial_register;
  499. retval = usb_register(&belkin_driver);
  500. if (retval)
  501. goto failed_usb_register;
  502. info(DRIVER_DESC " " DRIVER_VERSION);
  503. return 0;
  504. failed_usb_register:
  505. usb_serial_deregister(&belkin_device);
  506. failed_usb_serial_register:
  507. return retval;
  508. }
  509. static void __exit belkin_sa_exit (void)
  510. {
  511. usb_deregister(&belkin_driver);
  512. usb_serial_deregister(&belkin_device);
  513. }
  514. module_init(belkin_sa_init);
  515. module_exit(belkin_sa_exit);
  516. MODULE_AUTHOR(DRIVER_AUTHOR);
  517. MODULE_DESCRIPTION(DRIVER_DESC);
  518. MODULE_VERSION(DRIVER_VERSION);
  519. MODULE_LICENSE("GPL");
  520. module_param(debug, bool, S_IRUGO | S_IWUSR);
  521. MODULE_PARM_DESC(debug, "Debug enabled or not");