usb_wwan.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  1. // SPDX-License-Identifier: GPL-2.0
  2. /*
  3. USB Driver layer for GSM modems
  4. Copyright (C) 2005 Matthias Urlichs <[email protected]>
  5. Portions copied from the Keyspan driver by Hugh Blemings <[email protected]>
  6. History: see the git log.
  7. Work sponsored by: Sigos GmbH, Germany <[email protected]>
  8. This driver exists because the "normal" serial driver doesn't work too well
  9. with GSM modems. Issues:
  10. - data loss -- one single Receive URB is not nearly enough
  11. - controlling the baud rate doesn't make sense
  12. */
  13. #define DRIVER_AUTHOR "Matthias Urlichs <[email protected]>"
  14. #define DRIVER_DESC "USB Driver for GSM modems"
  15. #include <linux/kernel.h>
  16. #include <linux/jiffies.h>
  17. #include <linux/errno.h>
  18. #include <linux/slab.h>
  19. #include <linux/tty.h>
  20. #include <linux/tty_flip.h>
  21. #include <linux/module.h>
  22. #include <linux/bitops.h>
  23. #include <linux/uaccess.h>
  24. #include <linux/usb.h>
  25. #include <linux/usb/cdc.h>
  26. #include <linux/usb/serial.h>
  27. #include <linux/serial.h>
  28. #include "usb-wwan.h"
  29. /*
  30. * Generate DTR/RTS signals on the port using the SET_CONTROL_LINE_STATE request
  31. * in CDC ACM.
  32. */
  33. static int usb_wwan_send_setup(struct usb_serial_port *port)
  34. {
  35. struct usb_serial *serial = port->serial;
  36. struct usb_wwan_port_private *portdata;
  37. int val = 0;
  38. int ifnum;
  39. int res;
  40. portdata = usb_get_serial_port_data(port);
  41. if (portdata->dtr_state)
  42. val |= USB_CDC_CTRL_DTR;
  43. if (portdata->rts_state)
  44. val |= USB_CDC_CTRL_RTS;
  45. ifnum = serial->interface->cur_altsetting->desc.bInterfaceNumber;
  46. res = usb_autopm_get_interface(serial->interface);
  47. if (res)
  48. return res;
  49. res = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
  50. USB_CDC_REQ_SET_CONTROL_LINE_STATE,
  51. USB_DIR_OUT | USB_TYPE_CLASS | USB_RECIP_INTERFACE,
  52. val, ifnum, NULL, 0, USB_CTRL_SET_TIMEOUT);
  53. usb_autopm_put_interface(port->serial->interface);
  54. return res;
  55. }
  56. void usb_wwan_dtr_rts(struct usb_serial_port *port, int on)
  57. {
  58. struct usb_wwan_port_private *portdata;
  59. struct usb_wwan_intf_private *intfdata;
  60. intfdata = usb_get_serial_data(port->serial);
  61. if (!intfdata->use_send_setup)
  62. return;
  63. portdata = usb_get_serial_port_data(port);
  64. /* FIXME: locking */
  65. portdata->rts_state = on;
  66. portdata->dtr_state = on;
  67. usb_wwan_send_setup(port);
  68. }
  69. EXPORT_SYMBOL(usb_wwan_dtr_rts);
  70. int usb_wwan_tiocmget(struct tty_struct *tty)
  71. {
  72. struct usb_serial_port *port = tty->driver_data;
  73. unsigned int value;
  74. struct usb_wwan_port_private *portdata;
  75. portdata = usb_get_serial_port_data(port);
  76. value = ((portdata->rts_state) ? TIOCM_RTS : 0) |
  77. ((portdata->dtr_state) ? TIOCM_DTR : 0) |
  78. ((portdata->cts_state) ? TIOCM_CTS : 0) |
  79. ((portdata->dsr_state) ? TIOCM_DSR : 0) |
  80. ((portdata->dcd_state) ? TIOCM_CAR : 0) |
  81. ((portdata->ri_state) ? TIOCM_RNG : 0);
  82. return value;
  83. }
  84. EXPORT_SYMBOL(usb_wwan_tiocmget);
  85. int usb_wwan_tiocmset(struct tty_struct *tty,
  86. unsigned int set, unsigned int clear)
  87. {
  88. struct usb_serial_port *port = tty->driver_data;
  89. struct usb_wwan_port_private *portdata;
  90. struct usb_wwan_intf_private *intfdata;
  91. portdata = usb_get_serial_port_data(port);
  92. intfdata = usb_get_serial_data(port->serial);
  93. if (!intfdata->use_send_setup)
  94. return -EINVAL;
  95. /* FIXME: what locks portdata fields ? */
  96. if (set & TIOCM_RTS)
  97. portdata->rts_state = 1;
  98. if (set & TIOCM_DTR)
  99. portdata->dtr_state = 1;
  100. if (clear & TIOCM_RTS)
  101. portdata->rts_state = 0;
  102. if (clear & TIOCM_DTR)
  103. portdata->dtr_state = 0;
  104. return usb_wwan_send_setup(port);
  105. }
  106. EXPORT_SYMBOL(usb_wwan_tiocmset);
  107. int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
  108. const unsigned char *buf, int count)
  109. {
  110. struct usb_wwan_port_private *portdata;
  111. struct usb_wwan_intf_private *intfdata;
  112. int i;
  113. int left, todo;
  114. struct urb *this_urb = NULL; /* spurious */
  115. int err;
  116. unsigned long flags;
  117. portdata = usb_get_serial_port_data(port);
  118. intfdata = usb_get_serial_data(port->serial);
  119. dev_dbg(&port->dev, "%s: write (%d chars)\n", __func__, count);
  120. left = count;
  121. for (i = 0; left > 0 && i < N_OUT_URB; i++) {
  122. todo = left;
  123. if (todo > OUT_BUFLEN)
  124. todo = OUT_BUFLEN;
  125. this_urb = portdata->out_urbs[i];
  126. if (test_and_set_bit(i, &portdata->out_busy)) {
  127. if (time_before(jiffies,
  128. portdata->tx_start_time[i] + 10 * HZ))
  129. continue;
  130. usb_unlink_urb(this_urb);
  131. continue;
  132. }
  133. dev_dbg(&port->dev, "%s: endpoint %d buf %d\n", __func__,
  134. usb_pipeendpoint(this_urb->pipe), i);
  135. err = usb_autopm_get_interface_async(port->serial->interface);
  136. if (err < 0) {
  137. clear_bit(i, &portdata->out_busy);
  138. break;
  139. }
  140. /* send the data */
  141. memcpy(this_urb->transfer_buffer, buf, todo);
  142. this_urb->transfer_buffer_length = todo;
  143. spin_lock_irqsave(&intfdata->susp_lock, flags);
  144. if (intfdata->suspended) {
  145. usb_anchor_urb(this_urb, &portdata->delayed);
  146. spin_unlock_irqrestore(&intfdata->susp_lock, flags);
  147. } else {
  148. intfdata->in_flight++;
  149. spin_unlock_irqrestore(&intfdata->susp_lock, flags);
  150. err = usb_submit_urb(this_urb, GFP_ATOMIC);
  151. if (err) {
  152. dev_err(&port->dev,
  153. "%s: submit urb %d failed: %d\n",
  154. __func__, i, err);
  155. clear_bit(i, &portdata->out_busy);
  156. spin_lock_irqsave(&intfdata->susp_lock, flags);
  157. intfdata->in_flight--;
  158. spin_unlock_irqrestore(&intfdata->susp_lock,
  159. flags);
  160. usb_autopm_put_interface_async(port->serial->interface);
  161. break;
  162. }
  163. }
  164. portdata->tx_start_time[i] = jiffies;
  165. buf += todo;
  166. left -= todo;
  167. }
  168. count -= left;
  169. dev_dbg(&port->dev, "%s: wrote (did %d)\n", __func__, count);
  170. return count;
  171. }
  172. EXPORT_SYMBOL(usb_wwan_write);
  173. static void usb_wwan_indat_callback(struct urb *urb)
  174. {
  175. int err;
  176. int endpoint;
  177. struct usb_serial_port *port;
  178. struct device *dev;
  179. unsigned char *data = urb->transfer_buffer;
  180. int status = urb->status;
  181. endpoint = usb_pipeendpoint(urb->pipe);
  182. port = urb->context;
  183. dev = &port->dev;
  184. if (status) {
  185. dev_dbg(dev, "%s: nonzero status: %d on endpoint %02x.\n",
  186. __func__, status, endpoint);
  187. /* don't resubmit on fatal errors */
  188. if (status == -ESHUTDOWN || status == -ENOENT)
  189. return;
  190. } else {
  191. if (urb->actual_length) {
  192. tty_insert_flip_string(&port->port, data,
  193. urb->actual_length);
  194. tty_flip_buffer_push(&port->port);
  195. } else
  196. dev_dbg(dev, "%s: empty read urb received\n", __func__);
  197. }
  198. /* Resubmit urb so we continue receiving */
  199. err = usb_submit_urb(urb, GFP_ATOMIC);
  200. if (err) {
  201. if (err != -EPERM && err != -ENODEV) {
  202. dev_err(dev, "%s: resubmit read urb failed. (%d)\n",
  203. __func__, err);
  204. /* busy also in error unless we are killed */
  205. usb_mark_last_busy(port->serial->dev);
  206. }
  207. } else {
  208. usb_mark_last_busy(port->serial->dev);
  209. }
  210. }
  211. static void usb_wwan_outdat_callback(struct urb *urb)
  212. {
  213. struct usb_serial_port *port;
  214. struct usb_wwan_port_private *portdata;
  215. struct usb_wwan_intf_private *intfdata;
  216. unsigned long flags;
  217. int i;
  218. port = urb->context;
  219. intfdata = usb_get_serial_data(port->serial);
  220. usb_serial_port_softint(port);
  221. usb_autopm_put_interface_async(port->serial->interface);
  222. portdata = usb_get_serial_port_data(port);
  223. spin_lock_irqsave(&intfdata->susp_lock, flags);
  224. intfdata->in_flight--;
  225. spin_unlock_irqrestore(&intfdata->susp_lock, flags);
  226. for (i = 0; i < N_OUT_URB; ++i) {
  227. if (portdata->out_urbs[i] == urb) {
  228. smp_mb__before_atomic();
  229. clear_bit(i, &portdata->out_busy);
  230. break;
  231. }
  232. }
  233. }
  234. unsigned int usb_wwan_write_room(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. unsigned 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. if (this_urb && !test_bit(i, &portdata->out_busy))
  245. data_len += OUT_BUFLEN;
  246. }
  247. dev_dbg(&port->dev, "%s: %u\n", __func__, data_len);
  248. return data_len;
  249. }
  250. EXPORT_SYMBOL(usb_wwan_write_room);
  251. unsigned int usb_wwan_chars_in_buffer(struct tty_struct *tty)
  252. {
  253. struct usb_serial_port *port = tty->driver_data;
  254. struct usb_wwan_port_private *portdata;
  255. int i;
  256. unsigned int data_len = 0;
  257. struct urb *this_urb;
  258. portdata = usb_get_serial_port_data(port);
  259. for (i = 0; i < N_OUT_URB; i++) {
  260. this_urb = portdata->out_urbs[i];
  261. /* FIXME: This locking is insufficient as this_urb may
  262. go unused during the test */
  263. if (this_urb && test_bit(i, &portdata->out_busy))
  264. data_len += this_urb->transfer_buffer_length;
  265. }
  266. dev_dbg(&port->dev, "%s: %u\n", __func__, data_len);
  267. return data_len;
  268. }
  269. EXPORT_SYMBOL(usb_wwan_chars_in_buffer);
  270. int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port)
  271. {
  272. struct usb_wwan_port_private *portdata;
  273. struct usb_wwan_intf_private *intfdata;
  274. struct usb_serial *serial = port->serial;
  275. int i, err;
  276. struct urb *urb;
  277. portdata = usb_get_serial_port_data(port);
  278. intfdata = usb_get_serial_data(serial);
  279. if (port->interrupt_in_urb) {
  280. err = usb_submit_urb(port->interrupt_in_urb, GFP_KERNEL);
  281. if (err) {
  282. dev_err(&port->dev, "%s: submit int urb failed: %d\n",
  283. __func__, err);
  284. }
  285. }
  286. /* Start reading from the IN endpoint */
  287. for (i = 0; i < N_IN_URB; i++) {
  288. urb = portdata->in_urbs[i];
  289. if (!urb)
  290. continue;
  291. err = usb_submit_urb(urb, GFP_KERNEL);
  292. if (err) {
  293. dev_err(&port->dev,
  294. "%s: submit read urb %d failed: %d\n",
  295. __func__, i, err);
  296. }
  297. }
  298. spin_lock_irq(&intfdata->susp_lock);
  299. if (++intfdata->open_ports == 1)
  300. serial->interface->needs_remote_wakeup = 1;
  301. spin_unlock_irq(&intfdata->susp_lock);
  302. /* this balances a get in the generic USB serial code */
  303. usb_autopm_put_interface(serial->interface);
  304. return 0;
  305. }
  306. EXPORT_SYMBOL(usb_wwan_open);
  307. static void unbusy_queued_urb(struct urb *urb,
  308. struct usb_wwan_port_private *portdata)
  309. {
  310. int i;
  311. for (i = 0; i < N_OUT_URB; i++) {
  312. if (urb == portdata->out_urbs[i]) {
  313. clear_bit(i, &portdata->out_busy);
  314. break;
  315. }
  316. }
  317. }
  318. void usb_wwan_close(struct usb_serial_port *port)
  319. {
  320. int i;
  321. struct usb_serial *serial = port->serial;
  322. struct usb_wwan_port_private *portdata;
  323. struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
  324. struct urb *urb;
  325. portdata = usb_get_serial_port_data(port);
  326. /*
  327. * Need to take susp_lock to make sure port is not already being
  328. * resumed, but no need to hold it due to the tty-port initialized
  329. * flag.
  330. */
  331. spin_lock_irq(&intfdata->susp_lock);
  332. if (--intfdata->open_ports == 0)
  333. serial->interface->needs_remote_wakeup = 0;
  334. spin_unlock_irq(&intfdata->susp_lock);
  335. for (;;) {
  336. urb = usb_get_from_anchor(&portdata->delayed);
  337. if (!urb)
  338. break;
  339. unbusy_queued_urb(urb, portdata);
  340. usb_autopm_put_interface_async(serial->interface);
  341. }
  342. for (i = 0; i < N_IN_URB; i++)
  343. usb_kill_urb(portdata->in_urbs[i]);
  344. for (i = 0; i < N_OUT_URB; i++)
  345. usb_kill_urb(portdata->out_urbs[i]);
  346. usb_kill_urb(port->interrupt_in_urb);
  347. usb_autopm_get_interface_no_resume(serial->interface);
  348. }
  349. EXPORT_SYMBOL(usb_wwan_close);
  350. static struct urb *usb_wwan_setup_urb(struct usb_serial_port *port,
  351. int endpoint,
  352. int dir, void *ctx, char *buf, int len,
  353. void (*callback) (struct urb *))
  354. {
  355. struct usb_serial *serial = port->serial;
  356. struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
  357. struct urb *urb;
  358. urb = usb_alloc_urb(0, GFP_KERNEL); /* No ISO */
  359. if (!urb)
  360. return NULL;
  361. usb_fill_bulk_urb(urb, serial->dev,
  362. usb_sndbulkpipe(serial->dev, endpoint) | dir,
  363. buf, len, callback, ctx);
  364. if (intfdata->use_zlp && dir == USB_DIR_OUT)
  365. urb->transfer_flags |= URB_ZERO_PACKET;
  366. return urb;
  367. }
  368. int usb_wwan_port_probe(struct usb_serial_port *port)
  369. {
  370. struct usb_wwan_port_private *portdata;
  371. struct urb *urb;
  372. u8 *buffer;
  373. int i;
  374. if (!port->bulk_in_size || !port->bulk_out_size)
  375. return -ENODEV;
  376. portdata = kzalloc(sizeof(*portdata), GFP_KERNEL);
  377. if (!portdata)
  378. return -ENOMEM;
  379. init_usb_anchor(&portdata->delayed);
  380. for (i = 0; i < N_IN_URB; i++) {
  381. buffer = (u8 *)__get_free_page(GFP_KERNEL);
  382. if (!buffer)
  383. goto bail_out_error;
  384. portdata->in_buffer[i] = buffer;
  385. urb = usb_wwan_setup_urb(port, port->bulk_in_endpointAddress,
  386. USB_DIR_IN, port,
  387. buffer, IN_BUFLEN,
  388. usb_wwan_indat_callback);
  389. portdata->in_urbs[i] = urb;
  390. }
  391. for (i = 0; i < N_OUT_URB; i++) {
  392. buffer = kmalloc(OUT_BUFLEN, GFP_KERNEL);
  393. if (!buffer)
  394. goto bail_out_error2;
  395. portdata->out_buffer[i] = buffer;
  396. urb = usb_wwan_setup_urb(port, port->bulk_out_endpointAddress,
  397. USB_DIR_OUT, port,
  398. buffer, OUT_BUFLEN,
  399. usb_wwan_outdat_callback);
  400. portdata->out_urbs[i] = urb;
  401. }
  402. usb_set_serial_port_data(port, portdata);
  403. return 0;
  404. bail_out_error2:
  405. for (i = 0; i < N_OUT_URB; i++) {
  406. usb_free_urb(portdata->out_urbs[i]);
  407. kfree(portdata->out_buffer[i]);
  408. }
  409. bail_out_error:
  410. for (i = 0; i < N_IN_URB; i++) {
  411. usb_free_urb(portdata->in_urbs[i]);
  412. free_page((unsigned long)portdata->in_buffer[i]);
  413. }
  414. kfree(portdata);
  415. return -ENOMEM;
  416. }
  417. EXPORT_SYMBOL_GPL(usb_wwan_port_probe);
  418. void usb_wwan_port_remove(struct usb_serial_port *port)
  419. {
  420. int i;
  421. struct usb_wwan_port_private *portdata;
  422. portdata = usb_get_serial_port_data(port);
  423. usb_set_serial_port_data(port, NULL);
  424. for (i = 0; i < N_IN_URB; i++) {
  425. usb_free_urb(portdata->in_urbs[i]);
  426. free_page((unsigned long)portdata->in_buffer[i]);
  427. }
  428. for (i = 0; i < N_OUT_URB; i++) {
  429. usb_free_urb(portdata->out_urbs[i]);
  430. kfree(portdata->out_buffer[i]);
  431. }
  432. kfree(portdata);
  433. }
  434. EXPORT_SYMBOL(usb_wwan_port_remove);
  435. #ifdef CONFIG_PM
  436. static void stop_urbs(struct usb_serial *serial)
  437. {
  438. int i, j;
  439. struct usb_serial_port *port;
  440. struct usb_wwan_port_private *portdata;
  441. for (i = 0; i < serial->num_ports; ++i) {
  442. port = serial->port[i];
  443. portdata = usb_get_serial_port_data(port);
  444. if (!portdata)
  445. continue;
  446. for (j = 0; j < N_IN_URB; j++)
  447. usb_kill_urb(portdata->in_urbs[j]);
  448. for (j = 0; j < N_OUT_URB; j++)
  449. usb_kill_urb(portdata->out_urbs[j]);
  450. usb_kill_urb(port->interrupt_in_urb);
  451. }
  452. }
  453. int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message)
  454. {
  455. struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
  456. spin_lock_irq(&intfdata->susp_lock);
  457. if (PMSG_IS_AUTO(message)) {
  458. if (intfdata->in_flight) {
  459. spin_unlock_irq(&intfdata->susp_lock);
  460. return -EBUSY;
  461. }
  462. }
  463. intfdata->suspended = 1;
  464. spin_unlock_irq(&intfdata->susp_lock);
  465. stop_urbs(serial);
  466. return 0;
  467. }
  468. EXPORT_SYMBOL(usb_wwan_suspend);
  469. /* Caller must hold susp_lock. */
  470. static int usb_wwan_submit_delayed_urbs(struct usb_serial_port *port)
  471. {
  472. struct usb_serial *serial = port->serial;
  473. struct usb_wwan_intf_private *data = usb_get_serial_data(serial);
  474. struct usb_wwan_port_private *portdata;
  475. struct urb *urb;
  476. int err_count = 0;
  477. int err;
  478. portdata = usb_get_serial_port_data(port);
  479. for (;;) {
  480. urb = usb_get_from_anchor(&portdata->delayed);
  481. if (!urb)
  482. break;
  483. err = usb_submit_urb(urb, GFP_ATOMIC);
  484. if (err) {
  485. dev_err(&port->dev, "%s: submit urb failed: %d\n",
  486. __func__, err);
  487. err_count++;
  488. unbusy_queued_urb(urb, portdata);
  489. usb_autopm_put_interface_async(serial->interface);
  490. continue;
  491. }
  492. data->in_flight++;
  493. }
  494. if (err_count)
  495. return -EIO;
  496. return 0;
  497. }
  498. int usb_wwan_resume(struct usb_serial *serial)
  499. {
  500. int i, j;
  501. struct usb_serial_port *port;
  502. struct usb_wwan_intf_private *intfdata = usb_get_serial_data(serial);
  503. struct usb_wwan_port_private *portdata;
  504. struct urb *urb;
  505. int err;
  506. int err_count = 0;
  507. spin_lock_irq(&intfdata->susp_lock);
  508. for (i = 0; i < serial->num_ports; i++) {
  509. port = serial->port[i];
  510. if (!tty_port_initialized(&port->port))
  511. continue;
  512. portdata = usb_get_serial_port_data(port);
  513. if (port->interrupt_in_urb) {
  514. err = usb_submit_urb(port->interrupt_in_urb,
  515. GFP_ATOMIC);
  516. if (err) {
  517. dev_err(&port->dev,
  518. "%s: submit int urb failed: %d\n",
  519. __func__, err);
  520. err_count++;
  521. }
  522. }
  523. err = usb_wwan_submit_delayed_urbs(port);
  524. if (err)
  525. err_count++;
  526. for (j = 0; j < N_IN_URB; j++) {
  527. urb = portdata->in_urbs[j];
  528. err = usb_submit_urb(urb, GFP_ATOMIC);
  529. if (err < 0) {
  530. dev_err(&port->dev,
  531. "%s: submit read urb %d failed: %d\n",
  532. __func__, i, err);
  533. err_count++;
  534. }
  535. }
  536. }
  537. intfdata->suspended = 0;
  538. spin_unlock_irq(&intfdata->susp_lock);
  539. if (err_count)
  540. return -EIO;
  541. return 0;
  542. }
  543. EXPORT_SYMBOL(usb_wwan_resume);
  544. #endif
  545. MODULE_AUTHOR(DRIVER_AUTHOR);
  546. MODULE_DESCRIPTION(DRIVER_DESC);
  547. MODULE_LICENSE("GPL v2");