usb_wwan.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. /*
  2. USB Driver layer for GSM modems
  3. Copyright (C) 2005 Matthias Urlichs <smurf@smurf.noris.de>
  4. This driver is free software; you can redistribute it and/or modify
  5. it under the terms of Version 2 of the GNU General Public License as
  6. published by the Free Software Foundation.
  7. Portions copied from the Keyspan driver by Hugh Blemings <hugh@blemings.org>
  8. History: see the git log.
  9. Work sponsored by: Sigos GmbH, Germany <info@sigos.de>
  10. This driver exists because the "normal" serial driver doesn't work too well
  11. with GSM modems. Issues:
  12. - data loss -- one single Receive URB is not nearly enough
  13. - controlling the baud rate doesn't make sense
  14. */
  15. #define DRIVER_VERSION "v0.7.2"
  16. #define DRIVER_AUTHOR "Matthias Urlichs <smurf@smurf.noris.de>"
  17. #define DRIVER_DESC "USB Driver for GSM modems"
  18. #include <linux/kernel.h>
  19. #include <linux/jiffies.h>
  20. #include <linux/errno.h>
  21. #include <linux/slab.h>
  22. #include <linux/tty.h>
  23. #include <linux/tty_flip.h>
  24. #include <linux/module.h>
  25. #include <linux/bitops.h>
  26. #include <linux/usb.h>
  27. #include <linux/usb/serial.h>
  28. #include "usb-wwan.h"
  29. static int debug;
  30. void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
  31. {
  32. struct usb_serial *serial = port->serial;
  33. struct usb_wwan_port_private *portdata;
  34. struct usb_wwan_intf_private *intfdata;
  35. dbg("%s", __func__);
  36. intfdata = port->serial->private;
  37. if (!intfdata->send_setup)
  38. return;
  39. portdata = usb_get_serial_port_data(port);
  40. mutex_lock(&serial->disc_mutex);
  41. portdata->rts_state = on;
  42. portdata->dtr_state = on;
  43. if (serial->dev)
  44. intfdata->send_setup(port);
  45. mutex_unlock(&serial->disc_mutex);
  46. }
  47. EXPORT_SYMBOL(usb_wwan_dtr_rts);
  48. void usb_wwan_set_termios(struct tty_struct *tty,
  49. struct usb_serial_port *port,
  50. struct ktermios *old_termios)
  51. {
  52. struct usb_wwan_intf_private *intfdata = port->serial->private;
  53. dbg("%s", __func__);
  54. /* Doesn't support option setting */
  55. tty_termios_copy_hw(tty->termios, old_termios);
  56. if (intfdata->send_setup)
  57. intfdata->send_setup(port);
  58. }
  59. EXPORT_SYMBOL(usb_wwan_set_termios);
  60. int usb_wwan_tiocmget(struct tty_struct *tty, struct file *file)
  61. {
  62. struct usb_serial_port *port = tty->driver_data;
  63. unsigned int value;
  64. struct usb_wwan_port_private *portdata;
  65. portdata = usb_get_serial_port_data(port);
  66. value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
  67. ((portdata->dtr_state) ? TIOCM_DTR : 0) |
  68. ((portdata->cts_state) ? TIOCM_CTS : 0) |
  69. ((portdata->dsr_state) ? TIOCM_DSR : 0) |
  70. ((portdata->dcd_state) ? TIOCM_CAR : 0) |
  71. ((portdata->ri_state) ? TIOCM_RNG : 0);
  72. return value;
  73. }
  74. EXPORT_SYMBOL(usb_wwan_tiocmget);
  75. int usb_wwan_tiocmset(struct tty_struct *tty, struct file *file,
  76. unsigned int set, unsigned int clear)
  77. {
  78. struct usb_serial_port *port = tty->driver_data;
  79. struct usb_wwan_port_private *portdata;
  80. struct usb_wwan_intf_private *intfdata;
  81. portdata = usb_get_serial_port_data(port);
  82. intfdata = port->serial->private;
  83. if (!intfdata->send_setup)
  84. return -EINVAL;
  85. /* FIXME: what locks portdata fields ? */
  86. if (set & TIOCM_RTS)
  87. portdata->rts_state = 1;
  88. if (set & TIOCM_DTR)
  89. portdata->dtr_state = 1;
  90. if (clear & TIOCM_RTS)
  91. portdata->rts_state = 0;
  92. if (clear & TIOCM_DTR)
  93. portdata->dtr_state = 0;
  94. return intfdata->send_setup(port);
  95. }
  96. EXPORT_SYMBOL(usb_wwan_tiocmset);
  97. /* Write */
  98. int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
  99. const unsigned char *buf, int count)
  100. {
  101. struct usb_wwan_port_private *portdata;
  102. struct usb_wwan_intf_private *intfdata;
  103. int i;
  104. int left, todo;
  105. struct urb *this_urb = NULL; /* spurious */
  106. int err;
  107. unsigned long flags;
  108. portdata = usb_get_serial_port_data(port);
  109. intfdata = port->serial->private;
  110. dbg("%s: write (%d chars)", __func__, count);
  111. i = 0;
  112. left = count;
  113. for (i = 0; left > 0 && i < N_OUT_URB; i++) {
  114. todo = left;
  115. if (todo > OUT_BUFLEN)
  116. todo = OUT_BUFLEN;
  117. this_urb = portdata->out_urbs[i];
  118. if (test_and_set_bit(i, &portdata->out_busy)) {
  119. if (time_before(jiffies,
  120. portdata->tx_start_time[i] + 10 * HZ))
  121. continue;
  122. usb_unlink_urb(this_urb);
  123. continue;
  124. }
  125. dbg("%s: endpoint %d buf %d", __func__,
  126. usb_pipeendpoint(this_urb->pipe), i);
  127. err = usb_autopm_get_interface_async(port->serial->interface);
  128. if (err < 0)
  129. break;
  130. /* send the data */
  131. memcpy(this_urb->transfer_buffer, buf, todo);
  132. this_urb->transfer_buffer_length = todo;
  133. spin_lock_irqsave(&intfdata->susp_lock, flags);
  134. if (intfdata->suspended) {
  135. usb_anchor_urb(this_urb, &portdata->delayed);
  136. spin_unlock_irqrestore(&intfdata->susp_lock, flags);
  137. } else {
  138. intfdata->in_flight++;
  139. spin_unlock_irqrestore(&intfdata->susp_lock, flags);
  140. err = usb_submit_urb(this_urb, GFP_ATOMIC);
  141. if (err) {
  142. dbg("usb_submit_urb %p (write bulk) failed "
  143. "(%d)", this_urb, err);
  144. clear_bit(i, &portdata->out_busy);
  145. spin_lock_irqsave(&intfdata->susp_lock, flags);
  146. intfdata->in_flight--;
  147. spin_unlock_irqrestore(&intfdata->susp_lock,
  148. flags);
  149. continue;
  150. }
  151. }
  152. portdata->tx_start_time[i] = jiffies;
  153. buf += todo;
  154. left -= todo;
  155. }
  156. count -= left;
  157. dbg("%s: wrote (did %d)", __func__, count);
  158. return count;
  159. }
  160. EXPORT_SYMBOL(usb_wwan_write);
  161. static void usb_wwan_indat_callback(struct urb *urb)
  162. {
  163. int err;
  164. int endpoint;
  165. struct usb_serial_port *port;
  166. struct tty_struct *tty;
  167. unsigned char *data = urb->transfer_buffer;
  168. int status = urb->status;
  169. dbg("%s: %p", __func__, urb);
  170. endpoint = usb_pipeendpoint(urb->pipe);
  171. port = urb->context;
  172. if (status) {
  173. dbg("%s: nonzero status: %d on endpoint %02x.",
  174. __func__, status, endpoint);
  175. } else {
  176. tty = tty_port_tty_get(&port->port);
  177. if (urb->actual_length) {
  178. tty_insert_flip_string(tty, data, urb->actual_length);
  179. tty_flip_buffer_push(tty);
  180. } else
  181. dbg("%s: empty read urb received", __func__);
  182. tty_kref_put(tty);
  183. /* Resubmit urb so we continue receiving */
  184. if (status != -ESHUTDOWN) {
  185. err = usb_submit_urb(urb, GFP_ATOMIC);
  186. if (err && err != -EPERM)
  187. printk(KERN_ERR "%s: resubmit read urb failed. "
  188. "(%d)", __func__, err);
  189. else
  190. usb_mark_last_busy(port->serial->dev);
  191. }
  192. }
  193. }
  194. static void usb_wwan_outdat_callback(struct urb *urb)
  195. {
  196. struct usb_serial_port *port;
  197. struct usb_wwan_port_private *portdata;
  198. struct usb_wwan_intf_private *intfdata;
  199. int i;
  200. dbg("%s", __func__);
  201. port = urb->context;
  202. intfdata = port->serial->private;
  203. usb_serial_port_softint(port);
  204. usb_autopm_put_interface_async(port->serial->interface);
  205. portdata = usb_get_serial_port_data(port);
  206. spin_lock(&intfdata->susp_lock);
  207. intfdata->in_flight--;
  208. spin_unlock(&intfdata->susp_lock);
  209. for (i = 0; i < N_OUT_URB; ++i) {
  210. if (portdata->out_urbs[i] == urb) {
  211. smp_mb__before_clear_bit();
  212. clear_bit(i, &portdata->out_busy);
  213. break;
  214. }
  215. }
  216. }
  217. int usb_wwan_write_room(struct tty_struct *tty)
  218. {
  219. struct usb_serial_port *port = tty->driver_data;
  220. struct usb_wwan_port_private *portdata;
  221. int i;
  222. int data_len = 0;
  223. struct urb *this_urb;
  224. portdata = usb_get_serial_port_data(port);
  225. for (i = 0; i < N_OUT_URB; i++) {
  226. this_urb = portdata->out_urbs[i];
  227. if (this_urb && !test_bit(i, &portdata->out_busy))
  228. data_len += OUT_BUFLEN;
  229. }
  230. dbg("%s: %d", __func__, data_len);
  231. return data_len;
  232. }
  233. EXPORT_SYMBOL(usb_wwan_write_room);
  234. int usb_wwan_chars_in_buffer(struct tty_struct *tty)
  235. {
  236. struct usb_serial_port *port = tty->driver_data;
  237. struct usb_wwan_port_private *portdata;
  238. int i;
  239. int data_len = 0;
  240. struct urb *this_urb;
  241. portdata = usb_get_serial_port_data(port);
  242. for (i = 0; i < N_OUT_URB; i++) {
  243. this_urb = portdata->out_urbs[i];
  244. /* FIXME: This locking is insufficient as this_urb may
  245. go unused during the test */
  246. if (this_urb && test_bit(i, &portdata->out_busy))
  247. data_len += this_urb->transfer_buffer_length;
  248. }
  249. dbg("%s: %d", __func__, data_len);
  250. return data_len;
  251. }
  252. EXPORT_SYMBOL(usb_wwan_chars_in_buffer);
  253. int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
  254. {
  255. struct usb_wwan_port_private *portdata;
  256. struct usb_wwan_intf_private *intfdata;
  257. struct usb_serial *serial = port->serial;
  258. int i, err;
  259. struct urb *urb;
  260. portdata = usb_get_serial_port_data(port);
  261. intfdata = serial->private;
  262. dbg("%s", __func__);
  263. /* Start reading from the IN endpoint */
  264. for (i = 0; i < N_IN_URB; i++) {
  265. urb = portdata->in_urbs[i];
  266. if (!urb)
  267. continue;
  268. err = usb_submit_urb(urb, GFP_KERNEL);
  269. if (err) {
  270. dbg("%s: submit urb %d failed (%d) %d",
  271. __func__, i, err, urb->transfer_buffer_length);
  272. }
  273. }
  274. if (intfdata->send_setup)
  275. intfdata->send_setup(port);
  276. serial->interface->needs_remote_wakeup = 1;
  277. spin_lock_irq(&intfdata->susp_lock);
  278. portdata->opened = 1;
  279. spin_unlock_irq(&intfdata->susp_lock);
  280. usb_autopm_put_interface(serial->interface);
  281. return 0;
  282. }
  283. EXPORT_SYMBOL(usb_wwan_open);
  284. void usb_wwan_close(struct usb_serial_port *port)
  285. {
  286. int i;
  287. struct usb_serial *serial = port->serial;
  288. struct usb_wwan_port_private *portdata;
  289. struct usb_wwan_intf_private *intfdata = port->serial->private;
  290. dbg("%s", __func__);
  291. portdata = usb_get_serial_port_data(port);
  292. if (serial->dev) {
  293. /* Stop reading/writing urbs */
  294. spin_lock_irq(&intfdata->susp_lock);
  295. portdata->opened = 0;
  296. spin_unlock_irq(&intfdata->susp_lock);
  297. for (i = 0; i < N_IN_URB; i++)
  298. usb_kill_urb(portdata->in_urbs[i]);
  299. for (i = 0; i < N_OUT_URB; i++)
  300. usb_kill_urb(portdata->out_urbs[i]);
  301. usb_autopm_get_interface(serial->interface);
  302. serial->interface->needs_remote_wakeup = 0;
  303. }
  304. }
  305. EXPORT_SYMBOL(usb_wwan_close);
  306. /* Helper functions used by usb_wwan_setup_urbs */
  307. static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint,
  308. int dir, void *ctx, char *buf, int len,
  309. void (*callback) (struct urb *))
  310. {
  311. struct urb *urb;
  312. if (endpoint == -1)
  313. return NULL; /* endpoint not needed */
  314. urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
  315. if (urb == NULL) {
  316. dbg("%s: alloc for endpoint %d failed.", __func__, endpoint);
  317. return NULL;
  318. }
  319. /* Fill URB using supplied data. */
  320. usb_fill_bulk_urb(urb, serial->dev,
  321. usb_sndbulkpipe(serial->dev, endpoint) | dir,
  322. buf, len, callback, ctx);
  323. return urb;
  324. }
  325. /* Setup urbs */
  326. static void usb_wwan_setup_urbs(struct usb_serial *serial)
  327. {
  328. int i, j;
  329. struct usb_serial_port *port;
  330. struct usb_wwan_port_private *portdata;
  331. dbg("%s", __func__);
  332. for (i = 0; i < serial->num_ports; i++) {
  333. port = serial->port[i];
  334. portdata = usb_get_serial_port_data(port);
  335. /* Do indat endpoints first */
  336. for (j = 0; j < N_IN_URB; ++j) {
  337. portdata->in_urbs[j] = usb_wwan_setup_urb(serial,
  338. port->
  339. bulk_in_endpointAddress,
  340. USB_DIR_IN,
  341. port,
  342. portdata->
  343. in_buffer[j],
  344. IN_BUFLEN,
  345. usb_wwan_indat_callback);
  346. }
  347. /* outdat endpoints */
  348. for (j = 0; j < N_OUT_URB; ++j) {
  349. portdata->out_urbs[j] = usb_wwan_setup_urb(serial,
  350. port->
  351. bulk_out_endpointAddress,
  352. USB_DIR_OUT,
  353. port,
  354. portdata->
  355. out_buffer
  356. [j],
  357. OUT_BUFLEN,
  358. usb_wwan_outdat_callback);
  359. }
  360. }
  361. }
  362. int usb_wwan_startup(struct usb_serial *serial)
  363. {
  364. int i, j, err;
  365. struct usb_serial_port *port;
  366. struct usb_wwan_port_private *portdata;
  367. u8 *buffer;
  368. dbg("%s", __func__);
  369. /* Now setup per port private data */
  370. for (i = 0; i < serial->num_ports; i++) {
  371. port = serial->port[i];
  372. portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
  373. if (!portdata) {
  374. dbg("%s: kmalloc for usb_wwan_port_private (%d) failed!.",
  375. __func__, i);
  376. return 1;
  377. }
  378. init_usb_anchor(&portdata->delayed);
  379. for (j = 0; j < N_IN_URB; j++) {
  380. buffer = (u8 *) __get_free_page(GFP_KERNEL);
  381. if (!buffer)
  382. goto bail_out_error;
  383. portdata->in_buffer[j] = buffer;
  384. }
  385. for (j = 0; j < N_OUT_URB; j++) {
  386. buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
  387. if (!buffer)
  388. goto bail_out_error2;
  389. portdata->out_buffer[j] = buffer;
  390. }
  391. usb_set_serial_port_data(port, portdata);
  392. if (!port->interrupt_in_urb)
  393. continue;
  394. err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
  395. if (err)
  396. dbg("%s: submit irq_in urb failed %d", __func__, err);
  397. }
  398. usb_wwan_setup_urbs(serial);
  399. return 0;
  400. bail_out_error2:
  401. for (j = 0; j < N_OUT_URB; j++)
  402. kfree(portdata->out_buffer[j]);
  403. bail_out_error:
  404. for (j = 0; j < N_IN_URB; j++)
  405. if (portdata->in_buffer[j])
  406. free_page((unsigned long)portdata->in_buffer[j]);
  407. kfree(portdata);
  408. return 1;
  409. }
  410. EXPORT_SYMBOL(usb_wwan_startup);
  411. static void stop_read_write_urbs(struct usb_serial *serial)
  412. {
  413. int i, j;
  414. struct usb_serial_port *port;
  415. struct usb_wwan_port_private *portdata;
  416. /* Stop reading/writing urbs */
  417. for (i = 0; i < serial->num_ports; ++i) {
  418. port = serial->port[i];
  419. portdata = usb_get_serial_port_data(port);
  420. for (j = 0; j < N_IN_URB; j++)
  421. usb_kill_urb(portdata->in_urbs[j]);
  422. for (j = 0; j < N_OUT_URB; j++)
  423. usb_kill_urb(portdata->out_urbs[j]);
  424. }
  425. }
  426. void usb_wwan_disconnect(struct usb_serial *serial)
  427. {
  428. dbg("%s", __func__);
  429. stop_read_write_urbs(serial);
  430. }
  431. EXPORT_SYMBOL(usb_wwan_disconnect);
  432. void usb_wwan_release(struct usb_serial *serial)
  433. {
  434. int i, j;
  435. struct usb_serial_port *port;
  436. struct usb_wwan_port_private *portdata;
  437. dbg("%s", __func__);
  438. /* Now free them */
  439. for (i = 0; i < serial->num_ports; ++i) {
  440. port = serial->port[i];
  441. portdata = usb_get_serial_port_data(port);
  442. for (j = 0; j < N_IN_URB; j++) {
  443. usb_free_urb(portdata->in_urbs[j]);
  444. free_page((unsigned long)
  445. portdata->in_buffer[j]);
  446. portdata->in_urbs[j] = NULL;
  447. }
  448. for (j = 0; j < N_OUT_URB; j++) {
  449. usb_free_urb(portdata->out_urbs[j]);
  450. kfree(portdata->out_buffer[j]);
  451. portdata->out_urbs[j] = NULL;
  452. }
  453. }
  454. /* Now free per port private data */
  455. for (i = 0; i < serial->num_ports; i++) {
  456. port = serial->port[i];
  457. kfree(usb_get_serial_port_data(port));
  458. }
  459. }
  460. EXPORT_SYMBOL(usb_wwan_release);
  461. #ifdef CONFIG_PM
  462. int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
  463. {
  464. struct usb_wwan_intf_private *intfdata = serial->private;
  465. int b;
  466. dbg("%s entered", __func__);
  467. if (message.event & PM_EVENT_AUTO) {
  468. spin_lock_irq(&intfdata->susp_lock);
  469. b = intfdata->in_flight;
  470. spin_unlock_irq(&intfdata->susp_lock);
  471. if (b)
  472. return -EBUSY;
  473. }
  474. spin_lock_irq(&intfdata->susp_lock);
  475. intfdata->suspended = 1;
  476. spin_unlock_irq(&intfdata->susp_lock);
  477. stop_read_write_urbs(serial);
  478. return 0;
  479. }
  480. EXPORT_SYMBOL(usb_wwan_suspend);
  481. static void play_delayed(struct usb_serial_port *port)
  482. {
  483. struct usb_wwan_intf_private *data;
  484. struct usb_wwan_port_private *portdata;
  485. struct urb *urb;
  486. int err;
  487. portdata = usb_get_serial_port_data(port);
  488. data = port->serial->private;
  489. while ((urb = usb_get_from_anchor(&portdata->delayed))) {
  490. err = usb_submit_urb(urb, GFP_ATOMIC);
  491. if (!err)
  492. data->in_flight++;
  493. }
  494. }
  495. int usb_wwan_resume(struct usb_serial *serial)
  496. {
  497. int i, j;
  498. struct usb_serial_port *port;
  499. struct usb_wwan_intf_private *intfdata = serial->private;
  500. struct usb_wwan_port_private *portdata;
  501. struct urb *urb;
  502. int err = 0;
  503. dbg("%s entered", __func__);
  504. /* get the interrupt URBs resubmitted unconditionally */
  505. for (i = 0; i < serial->num_ports; i++) {
  506. port = serial->port[i];
  507. if (!port->interrupt_in_urb) {
  508. dbg("%s: No interrupt URB for port %d", __func__, i);
  509. continue;
  510. }
  511. err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
  512. dbg("Submitted interrupt URB for port %d (result %d)", i, err);
  513. if (err < 0) {
  514. err("%s: Error %d for interrupt URB of port%d",
  515. __func__, err, i);
  516. goto err_out;
  517. }
  518. }
  519. for (i = 0; i < serial->num_ports; i++) {
  520. /* walk all ports */
  521. port = serial->port[i];
  522. portdata = usb_get_serial_port_data(port);
  523. /* skip closed ports */
  524. spin_lock_irq(&intfdata->susp_lock);
  525. if (!portdata->opened) {
  526. spin_unlock_irq(&intfdata->susp_lock);
  527. continue;
  528. }
  529. for (j = 0; j < N_IN_URB; j++) {
  530. urb = portdata->in_urbs[j];
  531. err = usb_submit_urb(urb, GFP_ATOMIC);
  532. if (err < 0) {
  533. err("%s: Error %d for bulk URB %d",
  534. __func__, err, i);
  535. spin_unlock_irq(&intfdata->susp_lock);
  536. goto err_out;
  537. }
  538. }
  539. play_delayed(port);
  540. spin_unlock_irq(&intfdata->susp_lock);
  541. }
  542. spin_lock_irq(&intfdata->susp_lock);
  543. intfdata->suspended = 0;
  544. spin_unlock_irq(&intfdata->susp_lock);
  545. err_out:
  546. return err;
  547. }
  548. EXPORT_SYMBOL(usb_wwan_resume);
  549. #endif
  550. MODULE_AUTHOR(DRIVER_AUTHOR);
  551. MODULE_DESCRIPTION(DRIVER_DESC);
  552. MODULE_VERSION(DRIVER_VERSION);
  553. MODULE_LICENSE("GPL");
  554. module_param(debug, bool, S_IRUGO | S_IWUSR);
  555. MODULE_PARM_DESC(debug, "Debug messages");