usb_wwan.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665
  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. return;
  194. }
  195. static void usb_wwan_outdat_callback(struct urb *urb)
  196. {
  197. struct usb_serial_port *port;
  198. struct usb_wwan_port_private *portdata;
  199. struct usb_wwan_intf_private *intfdata;
  200. int i;
  201. dbg("%s", __func__);
  202. port = urb->context;
  203. intfdata = port->serial->private;
  204. usb_serial_port_softint(port);
  205. usb_autopm_put_interface_async(port->serial->interface);
  206. portdata = usb_get_serial_port_data(port);
  207. spin_lock(&intfdata->susp_lock);
  208. intfdata->in_flight--;
  209. spin_unlock(&intfdata->susp_lock);
  210. for (i = 0; i < N_OUT_URB; ++i) {
  211. if (portdata->out_urbs[i] == urb) {
  212. smp_mb__before_clear_bit();
  213. clear_bit(i, &portdata->out_busy);
  214. break;
  215. }
  216. }
  217. }
  218. int usb_wwan_write_room(struct tty_struct *tty)
  219. {
  220. struct usb_serial_port *port = tty->driver_data;
  221. struct usb_wwan_port_private *portdata;
  222. int i;
  223. int data_len = 0;
  224. struct urb *this_urb;
  225. portdata = usb_get_serial_port_data(port);
  226. for (i = 0; i < N_OUT_URB; i++) {
  227. this_urb = portdata->out_urbs[i];
  228. if (this_urb && !test_bit(i, &portdata->out_busy))
  229. data_len += OUT_BUFLEN;
  230. }
  231. dbg("%s: %d", __func__, data_len);
  232. return data_len;
  233. }
  234. EXPORT_SYMBOL(usb_wwan_write_room);
  235. int usb_wwan_chars_in_buffer(struct tty_struct *tty)
  236. {
  237. struct usb_serial_port *port = tty->driver_data;
  238. struct usb_wwan_port_private *portdata;
  239. int i;
  240. int data_len = 0;
  241. struct urb *this_urb;
  242. portdata = usb_get_serial_port_data(port);
  243. for (i = 0; i < N_OUT_URB; i++) {
  244. this_urb = portdata->out_urbs[i];
  245. /* FIXME: This locking is insufficient as this_urb may
  246. go unused during the test */
  247. if (this_urb && test_bit(i, &portdata->out_busy))
  248. data_len += this_urb->transfer_buffer_length;
  249. }
  250. dbg("%s: %d", __func__, data_len);
  251. return data_len;
  252. }
  253. EXPORT_SYMBOL(usb_wwan_chars_in_buffer);
  254. int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
  255. {
  256. struct usb_wwan_port_private *portdata;
  257. struct usb_wwan_intf_private *intfdata;
  258. struct usb_serial *serial = port->serial;
  259. int i, err;
  260. struct urb *urb;
  261. portdata = usb_get_serial_port_data(port);
  262. intfdata = serial->private;
  263. dbg("%s", __func__);
  264. /* Start reading from the IN endpoint */
  265. for (i = 0; i < N_IN_URB; i++) {
  266. urb = portdata->in_urbs[i];
  267. if (!urb)
  268. continue;
  269. err = usb_submit_urb(urb, GFP_KERNEL);
  270. if (err) {
  271. dbg("%s: submit urb %d failed (%d) %d",
  272. __func__, i, err, urb->transfer_buffer_length);
  273. }
  274. }
  275. if (intfdata->send_setup)
  276. intfdata->send_setup(port);
  277. serial->interface->needs_remote_wakeup = 1;
  278. spin_lock_irq(&intfdata->susp_lock);
  279. portdata->opened = 1;
  280. spin_unlock_irq(&intfdata->susp_lock);
  281. usb_autopm_put_interface(serial->interface);
  282. return 0;
  283. }
  284. EXPORT_SYMBOL(usb_wwan_open);
  285. void usb_wwan_close(struct usb_serial_port *port)
  286. {
  287. int i;
  288. struct usb_serial *serial = port->serial;
  289. struct usb_wwan_port_private *portdata;
  290. struct usb_wwan_intf_private *intfdata = port->serial->private;
  291. dbg("%s", __func__);
  292. portdata = usb_get_serial_port_data(port);
  293. if (serial->dev) {
  294. /* Stop reading/writing urbs */
  295. spin_lock_irq(&intfdata->susp_lock);
  296. portdata->opened = 0;
  297. spin_unlock_irq(&intfdata->susp_lock);
  298. for (i = 0; i < N_IN_URB; i++)
  299. usb_kill_urb(portdata->in_urbs[i]);
  300. for (i = 0; i < N_OUT_URB; i++)
  301. usb_kill_urb(portdata->out_urbs[i]);
  302. usb_autopm_get_interface(serial->interface);
  303. serial->interface->needs_remote_wakeup = 0;
  304. }
  305. }
  306. EXPORT_SYMBOL(usb_wwan_close);
  307. /* Helper functions used by usb_wwan_setup_urbs */
  308. static struct urb *usb_wwan_setup_urb(struct usb_serial *serial, int endpoint,
  309. int dir, void *ctx, char *buf, int len,
  310. void (*callback) (struct urb *))
  311. {
  312. struct urb *urb;
  313. if (endpoint == -1)
  314. return NULL; /* endpoint not needed */
  315. urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
  316. if (urb == NULL) {
  317. dbg("%s: alloc for endpoint %d failed.", __func__, endpoint);
  318. return NULL;
  319. }
  320. /* Fill URB using supplied data. */
  321. usb_fill_bulk_urb(urb, serial->dev,
  322. usb_sndbulkpipe(serial->dev, endpoint) | dir,
  323. buf, len, callback, ctx);
  324. return urb;
  325. }
  326. /* Setup urbs */
  327. static void usb_wwan_setup_urbs(struct usb_serial *serial)
  328. {
  329. int i, j;
  330. struct usb_serial_port *port;
  331. struct usb_wwan_port_private *portdata;
  332. dbg("%s", __func__);
  333. for (i = 0; i < serial->num_ports; i++) {
  334. port = serial->port[i];
  335. portdata = usb_get_serial_port_data(port);
  336. /* Do indat endpoints first */
  337. for (j = 0; j < N_IN_URB; ++j) {
  338. portdata->in_urbs[j] = usb_wwan_setup_urb(serial,
  339. port->
  340. bulk_in_endpointAddress,
  341. USB_DIR_IN,
  342. port,
  343. portdata->
  344. in_buffer[j],
  345. IN_BUFLEN,
  346. usb_wwan_indat_callback);
  347. }
  348. /* outdat endpoints */
  349. for (j = 0; j < N_OUT_URB; ++j) {
  350. portdata->out_urbs[j] = usb_wwan_setup_urb(serial,
  351. port->
  352. bulk_out_endpointAddress,
  353. USB_DIR_OUT,
  354. port,
  355. portdata->
  356. out_buffer
  357. [j],
  358. OUT_BUFLEN,
  359. usb_wwan_outdat_callback);
  360. }
  361. }
  362. }
  363. int usb_wwan_startup(struct usb_serial *serial)
  364. {
  365. int i, j, err;
  366. struct usb_serial_port *port;
  367. struct usb_wwan_port_private *portdata;
  368. u8 *buffer;
  369. dbg("%s", __func__);
  370. /* Now setup per port private data */
  371. for (i = 0; i < serial->num_ports; i++) {
  372. port = serial->port[i];
  373. portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
  374. if (!portdata) {
  375. dbg("%s: kmalloc for usb_wwan_port_private (%d) failed!.",
  376. __func__, i);
  377. return 1;
  378. }
  379. init_usb_anchor(&portdata->delayed);
  380. for (j = 0; j < N_IN_URB; j++) {
  381. buffer = (u8 *) __get_free_page(GFP_KERNEL);
  382. if (!buffer)
  383. goto bail_out_error;
  384. portdata->in_buffer[j] = buffer;
  385. }
  386. for (j = 0; j < N_OUT_URB; j++) {
  387. buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
  388. if (!buffer)
  389. goto bail_out_error2;
  390. portdata->out_buffer[j] = buffer;
  391. }
  392. usb_set_serial_port_data(port, portdata);
  393. if (!port->interrupt_in_urb)
  394. continue;
  395. err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
  396. if (err)
  397. dbg("%s: submit irq_in urb failed %d", __func__, err);
  398. }
  399. usb_wwan_setup_urbs(serial);
  400. return 0;
  401. bail_out_error2:
  402. for (j = 0; j < N_OUT_URB; j++)
  403. kfree(portdata->out_buffer[j]);
  404. bail_out_error:
  405. for (j = 0; j < N_IN_URB; j++)
  406. if (portdata->in_buffer[j])
  407. free_page((unsigned long)portdata->in_buffer[j]);
  408. kfree(portdata);
  409. return 1;
  410. }
  411. EXPORT_SYMBOL(usb_wwan_startup);
  412. static void stop_read_write_urbs(struct usb_serial *serial)
  413. {
  414. int i, j;
  415. struct usb_serial_port *port;
  416. struct usb_wwan_port_private *portdata;
  417. /* Stop reading/writing urbs */
  418. for (i = 0; i < serial->num_ports; ++i) {
  419. port = serial->port[i];
  420. portdata = usb_get_serial_port_data(port);
  421. for (j = 0; j < N_IN_URB; j++)
  422. usb_kill_urb(portdata->in_urbs[j]);
  423. for (j = 0; j < N_OUT_URB; j++)
  424. usb_kill_urb(portdata->out_urbs[j]);
  425. }
  426. }
  427. void usb_wwan_disconnect(struct usb_serial *serial)
  428. {
  429. dbg("%s", __func__);
  430. stop_read_write_urbs(serial);
  431. }
  432. EXPORT_SYMBOL(usb_wwan_disconnect);
  433. void usb_wwan_release(struct usb_serial *serial)
  434. {
  435. int i, j;
  436. struct usb_serial_port *port;
  437. struct usb_wwan_port_private *portdata;
  438. dbg("%s", __func__);
  439. /* Now free them */
  440. for (i = 0; i < serial->num_ports; ++i) {
  441. port = serial->port[i];
  442. portdata = usb_get_serial_port_data(port);
  443. for (j = 0; j < N_IN_URB; j++) {
  444. usb_free_urb(portdata->in_urbs[j]);
  445. free_page((unsigned long)
  446. portdata->in_buffer[j]);
  447. portdata->in_urbs[j] = NULL;
  448. }
  449. for (j = 0; j < N_OUT_URB; j++) {
  450. usb_free_urb(portdata->out_urbs[j]);
  451. kfree(portdata->out_buffer[j]);
  452. portdata->out_urbs[j] = NULL;
  453. }
  454. }
  455. /* Now free per port private data */
  456. for (i = 0; i < serial->num_ports; i++) {
  457. port = serial->port[i];
  458. kfree(usb_get_serial_port_data(port));
  459. }
  460. }
  461. EXPORT_SYMBOL(usb_wwan_release);
  462. #ifdef CONFIG_PM
  463. int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
  464. {
  465. struct usb_wwan_intf_private *intfdata = serial->private;
  466. int b;
  467. dbg("%s entered", __func__);
  468. if (message.event & PM_EVENT_AUTO) {
  469. spin_lock_irq(&intfdata->susp_lock);
  470. b = intfdata->in_flight;
  471. spin_unlock_irq(&intfdata->susp_lock);
  472. if (b)
  473. return -EBUSY;
  474. }
  475. spin_lock_irq(&intfdata->susp_lock);
  476. intfdata->suspended = 1;
  477. spin_unlock_irq(&intfdata->susp_lock);
  478. stop_read_write_urbs(serial);
  479. return 0;
  480. }
  481. EXPORT_SYMBOL(usb_wwan_suspend);
  482. static void play_delayed(struct usb_serial_port *port)
  483. {
  484. struct usb_wwan_intf_private *data;
  485. struct usb_wwan_port_private *portdata;
  486. struct urb *urb;
  487. int err;
  488. portdata = usb_get_serial_port_data(port);
  489. data = port->serial->private;
  490. while ((urb = usb_get_from_anchor(&portdata->delayed))) {
  491. err = usb_submit_urb(urb, GFP_ATOMIC);
  492. if (!err)
  493. data->in_flight++;
  494. }
  495. }
  496. int usb_wwan_resume(struct usb_serial *serial)
  497. {
  498. int i, j;
  499. struct usb_serial_port *port;
  500. struct usb_wwan_intf_private *intfdata = serial->private;
  501. struct usb_wwan_port_private *portdata;
  502. struct urb *urb;
  503. int err = 0;
  504. dbg("%s entered", __func__);
  505. /* get the interrupt URBs resubmitted unconditionally */
  506. for (i = 0; i < serial->num_ports; i++) {
  507. port = serial->port[i];
  508. if (!port->interrupt_in_urb) {
  509. dbg("%s: No interrupt URB for port %d", __func__, i);
  510. continue;
  511. }
  512. err = usb_submit_urb(port->interrupt_in_urb, GFP_NOIO);
  513. dbg("Submitted interrupt URB for port %d (result %d)", i, err);
  514. if (err < 0) {
  515. err("%s: Error %d for interrupt URB of port%d",
  516. __func__, err, i);
  517. goto err_out;
  518. }
  519. }
  520. for (i = 0; i < serial->num_ports; i++) {
  521. /* walk all ports */
  522. port = serial->port[i];
  523. portdata = usb_get_serial_port_data(port);
  524. /* skip closed ports */
  525. spin_lock_irq(&intfdata->susp_lock);
  526. if (!portdata->opened) {
  527. spin_unlock_irq(&intfdata->susp_lock);
  528. continue;
  529. }
  530. for (j = 0; j < N_IN_URB; j++) {
  531. urb = portdata->in_urbs[j];
  532. err = usb_submit_urb(urb, GFP_ATOMIC);
  533. if (err < 0) {
  534. err("%s: Error %d for bulk URB %d",
  535. __func__, err, i);
  536. spin_unlock_irq(&intfdata->susp_lock);
  537. goto err_out;
  538. }
  539. }
  540. play_delayed(port);
  541. spin_unlock_irq(&intfdata->susp_lock);
  542. }
  543. spin_lock_irq(&intfdata->susp_lock);
  544. intfdata->suspended = 0;
  545. spin_unlock_irq(&intfdata->susp_lock);
  546. err_out:
  547. return err;
  548. }
  549. EXPORT_SYMBOL(usb_wwan_resume);
  550. #endif
  551. MODULE_AUTHOR(DRIVER_AUTHOR);
  552. MODULE_DESCRIPTION(DRIVER_DESC);
  553. MODULE_VERSION(DRIVER_VERSION);
  554. MODULE_LICENSE("GPL");
  555. module_param(debug, bool, S_IRUGO | S_IWUSR);
  556. MODULE_PARM_DESC(debug, "Debug messages");