usb.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  1. /*
  2. * Intel Wireless WiMAX Connection 2400m
  3. * Linux driver model glue for USB device, reset & fw upload
  4. *
  5. *
  6. * Copyright (C) 2007-2008 Intel Corporation <linux-wimax@intel.com>
  7. * Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
  8. * Yanir Lubetkin <yanirx.lubetkin@intel.com>
  9. *
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License version
  12. * 2 as published by the Free Software Foundation.
  13. *
  14. * This program is distributed in the hope that it will be useful,
  15. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  17. * GNU General Public License for more details.
  18. *
  19. * You should have received a copy of the GNU General Public License
  20. * along with this program; if not, write to the Free Software
  21. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
  22. * 02110-1301, USA.
  23. *
  24. *
  25. * See i2400m-usb.h for a general description of this driver.
  26. *
  27. * This file implements driver model glue, and hook ups for the
  28. * generic driver to implement the bus-specific functions (device
  29. * communication setup/tear down, firmware upload and resetting).
  30. *
  31. * ROADMAP
  32. *
  33. * i2400mu_probe()
  34. * alloc_netdev()...
  35. * i2400mu_netdev_setup()
  36. * i2400mu_init()
  37. * i2400m_netdev_setup()
  38. * i2400m_setup()...
  39. *
  40. * i2400mu_disconnect
  41. * i2400m_release()
  42. * free_netdev()
  43. *
  44. * i2400mu_suspend()
  45. * i2400m_cmd_enter_powersave()
  46. * i2400mu_notification_release()
  47. *
  48. * i2400mu_resume()
  49. * i2400mu_notification_setup()
  50. *
  51. * i2400mu_bus_dev_start() Called by i2400m_dev_start() [who is
  52. * i2400mu_tx_setup() called by i2400m_setup()]
  53. * i2400mu_rx_setup()
  54. * i2400mu_notification_setup()
  55. *
  56. * i2400mu_bus_dev_stop() Called by i2400m_dev_stop() [who is
  57. * i2400mu_notification_release() called by i2400m_release()]
  58. * i2400mu_rx_release()
  59. * i2400mu_tx_release()
  60. *
  61. * i2400mu_bus_reset() Called by i2400m->bus_reset
  62. * __i2400mu_reset()
  63. * __i2400mu_send_barker()
  64. * usb_reset_device()
  65. */
  66. #include "i2400m-usb.h"
  67. #include <linux/wimax/i2400m.h>
  68. #include <linux/debugfs.h>
  69. #define D_SUBMODULE usb
  70. #include "usb-debug-levels.h"
  71. /* Our firmware file name */
  72. static const char *i2400mu_bus_fw_names[] = {
  73. #define I2400MU_FW_FILE_NAME_v1_4 "i2400m-fw-usb-1.4.sbcf"
  74. I2400MU_FW_FILE_NAME_v1_4,
  75. #define I2400MU_FW_FILE_NAME_v1_3 "i2400m-fw-usb-1.3.sbcf"
  76. I2400MU_FW_FILE_NAME_v1_3,
  77. NULL,
  78. };
  79. static
  80. int i2400mu_bus_dev_start(struct i2400m *i2400m)
  81. {
  82. int result;
  83. struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m);
  84. struct device *dev = &i2400mu->usb_iface->dev;
  85. d_fnstart(3, dev, "(i2400m %p)\n", i2400m);
  86. result = i2400mu_tx_setup(i2400mu);
  87. if (result < 0)
  88. goto error_usb_tx_setup;
  89. result = i2400mu_rx_setup(i2400mu);
  90. if (result < 0)
  91. goto error_usb_rx_setup;
  92. result = i2400mu_notification_setup(i2400mu);
  93. if (result < 0)
  94. goto error_notif_setup;
  95. d_fnend(3, dev, "(i2400m %p) = %d\n", i2400m, result);
  96. return result;
  97. error_notif_setup:
  98. i2400mu_rx_release(i2400mu);
  99. error_usb_rx_setup:
  100. i2400mu_tx_release(i2400mu);
  101. error_usb_tx_setup:
  102. d_fnend(3, dev, "(i2400m %p) = void\n", i2400m);
  103. return result;
  104. }
  105. static
  106. void i2400mu_bus_dev_stop(struct i2400m *i2400m)
  107. {
  108. struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m);
  109. struct device *dev = &i2400mu->usb_iface->dev;
  110. d_fnstart(3, dev, "(i2400m %p)\n", i2400m);
  111. i2400mu_notification_release(i2400mu);
  112. i2400mu_rx_release(i2400mu);
  113. i2400mu_tx_release(i2400mu);
  114. d_fnend(3, dev, "(i2400m %p) = void\n", i2400m);
  115. }
  116. /*
  117. * Sends a barker buffer to the device
  118. *
  119. * This helper will allocate a kmalloced buffer and use it to transmit
  120. * (then free it). Reason for this is that other arches cannot use
  121. * stack/vmalloc/text areas for DMA transfers.
  122. *
  123. * Error recovery here is simpler: anything is considered a hard error
  124. * and will move the reset code to use a last-resort bus-based reset.
  125. */
  126. static
  127. int __i2400mu_send_barker(struct i2400mu *i2400mu,
  128. const __le32 *barker,
  129. size_t barker_size,
  130. unsigned endpoint)
  131. {
  132. struct usb_endpoint_descriptor *epd = NULL;
  133. int pipe, actual_len, ret;
  134. struct device *dev = &i2400mu->usb_iface->dev;
  135. void *buffer;
  136. int do_autopm = 1;
  137. ret = usb_autopm_get_interface(i2400mu->usb_iface);
  138. if (ret < 0) {
  139. dev_err(dev, "RESET: can't get autopm: %d\n", ret);
  140. do_autopm = 0;
  141. }
  142. ret = -ENOMEM;
  143. buffer = kmalloc(barker_size, GFP_KERNEL);
  144. if (buffer == NULL)
  145. goto error_kzalloc;
  146. epd = usb_get_epd(i2400mu->usb_iface, endpoint);
  147. pipe = usb_sndbulkpipe(i2400mu->usb_dev, epd->bEndpointAddress);
  148. memcpy(buffer, barker, barker_size);
  149. ret = usb_bulk_msg(i2400mu->usb_dev, pipe, buffer, barker_size,
  150. &actual_len, HZ);
  151. if (ret < 0) {
  152. if (ret != -EINVAL)
  153. dev_err(dev, "E: barker error: %d\n", ret);
  154. } else if (actual_len != barker_size) {
  155. dev_err(dev, "E: only %d bytes transmitted\n", actual_len);
  156. ret = -EIO;
  157. }
  158. kfree(buffer);
  159. error_kzalloc:
  160. if (do_autopm)
  161. usb_autopm_put_interface(i2400mu->usb_iface);
  162. return ret;
  163. }
  164. /*
  165. * Reset a device at different levels (warm, cold or bus)
  166. *
  167. * @i2400m: device descriptor
  168. * @reset_type: soft, warm or bus reset (I2400M_RT_WARM/SOFT/BUS)
  169. *
  170. * Warm and cold resets get a USB reset if they fail.
  171. *
  172. * Warm reset:
  173. *
  174. * The device will be fully reset internally, but won't be
  175. * disconnected from the USB bus (so no reenumeration will
  176. * happen). Firmware upload will be neccessary.
  177. *
  178. * The device will send a reboot barker in the notification endpoint
  179. * that will trigger the driver to reinitialize the state
  180. * automatically from notif.c:i2400m_notification_grok() into
  181. * i2400m_dev_bootstrap_delayed().
  182. *
  183. * Cold and bus (USB) reset:
  184. *
  185. * The device will be fully reset internally, disconnected from the
  186. * USB bus an a reenumeration will happen. Firmware upload will be
  187. * neccessary. Thus, we don't do any locking or struct
  188. * reinitialization, as we are going to be fully disconnected and
  189. * reenumerated.
  190. *
  191. * Note we need to return -ENODEV if a warm reset was requested and we
  192. * had to resort to a bus reset. See i2400m_op_reset(), wimax_reset()
  193. * and wimax_dev->op_reset.
  194. *
  195. * WARNING: no driver state saved/fixed
  196. */
  197. static
  198. int i2400mu_bus_reset(struct i2400m *i2400m, enum i2400m_reset_type rt)
  199. {
  200. int result;
  201. struct i2400mu *i2400mu =
  202. container_of(i2400m, struct i2400mu, i2400m);
  203. struct device *dev = i2400m_dev(i2400m);
  204. static const __le32 i2400m_WARM_BOOT_BARKER[4] = {
  205. cpu_to_le32(I2400M_WARM_RESET_BARKER),
  206. cpu_to_le32(I2400M_WARM_RESET_BARKER),
  207. cpu_to_le32(I2400M_WARM_RESET_BARKER),
  208. cpu_to_le32(I2400M_WARM_RESET_BARKER),
  209. };
  210. static const __le32 i2400m_COLD_BOOT_BARKER[4] = {
  211. cpu_to_le32(I2400M_COLD_RESET_BARKER),
  212. cpu_to_le32(I2400M_COLD_RESET_BARKER),
  213. cpu_to_le32(I2400M_COLD_RESET_BARKER),
  214. cpu_to_le32(I2400M_COLD_RESET_BARKER),
  215. };
  216. d_fnstart(3, dev, "(i2400m %p rt %u)\n", i2400m, rt);
  217. if (rt == I2400M_RT_WARM)
  218. result = __i2400mu_send_barker(i2400mu, i2400m_WARM_BOOT_BARKER,
  219. sizeof(i2400m_WARM_BOOT_BARKER),
  220. I2400MU_EP_BULK_OUT);
  221. else if (rt == I2400M_RT_COLD)
  222. result = __i2400mu_send_barker(i2400mu, i2400m_COLD_BOOT_BARKER,
  223. sizeof(i2400m_COLD_BOOT_BARKER),
  224. I2400MU_EP_RESET_COLD);
  225. else if (rt == I2400M_RT_BUS) {
  226. do_bus_reset:
  227. result = usb_reset_device(i2400mu->usb_dev);
  228. switch (result) {
  229. case 0:
  230. case -EINVAL: /* device is gone */
  231. case -ENODEV:
  232. case -ENOENT:
  233. case -ESHUTDOWN:
  234. result = rt == I2400M_RT_WARM ? -ENODEV : 0;
  235. break; /* We assume the device is disconnected */
  236. default:
  237. dev_err(dev, "USB reset failed (%d), giving up!\n",
  238. result);
  239. }
  240. } else
  241. BUG();
  242. if (result < 0
  243. && result != -EINVAL /* device is gone */
  244. && rt != I2400M_RT_BUS) {
  245. dev_err(dev, "%s reset failed (%d); trying USB reset\n",
  246. rt == I2400M_RT_WARM ? "warm" : "cold", result);
  247. rt = I2400M_RT_BUS;
  248. goto do_bus_reset;
  249. }
  250. d_fnend(3, dev, "(i2400m %p rt %u) = %d\n", i2400m, rt, result);
  251. return result;
  252. }
  253. static
  254. void i2400mu_netdev_setup(struct net_device *net_dev)
  255. {
  256. struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
  257. struct i2400mu *i2400mu = container_of(i2400m, struct i2400mu, i2400m);
  258. i2400mu_init(i2400mu);
  259. i2400m_netdev_setup(net_dev);
  260. }
  261. /*
  262. * Debug levels control; see debug.h
  263. */
  264. struct d_level D_LEVEL[] = {
  265. D_SUBMODULE_DEFINE(usb),
  266. D_SUBMODULE_DEFINE(fw),
  267. D_SUBMODULE_DEFINE(notif),
  268. D_SUBMODULE_DEFINE(rx),
  269. D_SUBMODULE_DEFINE(tx),
  270. };
  271. size_t D_LEVEL_SIZE = ARRAY_SIZE(D_LEVEL);
  272. #define __debugfs_register(prefix, name, parent) \
  273. do { \
  274. result = d_level_register_debugfs(prefix, name, parent); \
  275. if (result < 0) \
  276. goto error; \
  277. } while (0)
  278. static
  279. int i2400mu_debugfs_add(struct i2400mu *i2400mu)
  280. {
  281. int result;
  282. struct device *dev = &i2400mu->usb_iface->dev;
  283. struct dentry *dentry = i2400mu->i2400m.wimax_dev.debugfs_dentry;
  284. struct dentry *fd;
  285. dentry = debugfs_create_dir("i2400m-usb", dentry);
  286. result = PTR_ERR(dentry);
  287. if (IS_ERR(dentry)) {
  288. if (result == -ENODEV)
  289. result = 0; /* No debugfs support */
  290. goto error;
  291. }
  292. i2400mu->debugfs_dentry = dentry;
  293. __debugfs_register("dl_", usb, dentry);
  294. __debugfs_register("dl_", fw, dentry);
  295. __debugfs_register("dl_", notif, dentry);
  296. __debugfs_register("dl_", rx, dentry);
  297. __debugfs_register("dl_", tx, dentry);
  298. /* Don't touch these if you don't know what you are doing */
  299. fd = debugfs_create_u8("rx_size_auto_shrink", 0600, dentry,
  300. &i2400mu->rx_size_auto_shrink);
  301. result = PTR_ERR(fd);
  302. if (IS_ERR(fd) && result != -ENODEV) {
  303. dev_err(dev, "Can't create debugfs entry "
  304. "rx_size_auto_shrink: %d\n", result);
  305. goto error;
  306. }
  307. fd = debugfs_create_size_t("rx_size", 0600, dentry,
  308. &i2400mu->rx_size);
  309. result = PTR_ERR(fd);
  310. if (IS_ERR(fd) && result != -ENODEV) {
  311. dev_err(dev, "Can't create debugfs entry "
  312. "rx_size: %d\n", result);
  313. goto error;
  314. }
  315. return 0;
  316. error:
  317. debugfs_remove_recursive(i2400mu->debugfs_dentry);
  318. return result;
  319. }
  320. /*
  321. * Probe a i2400m interface and register it
  322. *
  323. * @iface: USB interface to link to
  324. * @id: USB class/subclass/protocol id
  325. * @returns: 0 if ok, < 0 errno code on error.
  326. *
  327. * Alloc a net device, initialize the bus-specific details and then
  328. * calls the bus-generic initialization routine. That will register
  329. * the wimax and netdev devices, upload the firmware [using
  330. * _bus_bm_*()], call _bus_dev_start() to finalize the setup of the
  331. * communication with the device and then will start to talk to it to
  332. * finnish setting it up.
  333. */
  334. static
  335. int i2400mu_probe(struct usb_interface *iface,
  336. const struct usb_device_id *id)
  337. {
  338. int result;
  339. struct net_device *net_dev;
  340. struct device *dev = &iface->dev;
  341. struct i2400m *i2400m;
  342. struct i2400mu *i2400mu;
  343. struct usb_device *usb_dev = interface_to_usbdev(iface);
  344. if (usb_dev->speed != USB_SPEED_HIGH)
  345. dev_err(dev, "device not connected as high speed\n");
  346. /* Allocate instance [calls i2400m_netdev_setup() on it]. */
  347. result = -ENOMEM;
  348. net_dev = alloc_netdev(sizeof(*i2400mu), "wmx%d",
  349. i2400mu_netdev_setup);
  350. if (net_dev == NULL) {
  351. dev_err(dev, "no memory for network device instance\n");
  352. goto error_alloc_netdev;
  353. }
  354. SET_NETDEV_DEV(net_dev, dev);
  355. i2400m = net_dev_to_i2400m(net_dev);
  356. i2400mu = container_of(i2400m, struct i2400mu, i2400m);
  357. i2400m->wimax_dev.net_dev = net_dev;
  358. i2400mu->usb_dev = usb_get_dev(usb_dev);
  359. i2400mu->usb_iface = iface;
  360. usb_set_intfdata(iface, i2400mu);
  361. i2400m->bus_tx_block_size = I2400MU_BLK_SIZE;
  362. i2400m->bus_pl_size_max = I2400MU_PL_SIZE_MAX;
  363. i2400m->bus_dev_start = i2400mu_bus_dev_start;
  364. i2400m->bus_dev_stop = i2400mu_bus_dev_stop;
  365. i2400m->bus_tx_kick = i2400mu_bus_tx_kick;
  366. i2400m->bus_reset = i2400mu_bus_reset;
  367. i2400m->bus_bm_cmd_send = i2400mu_bus_bm_cmd_send;
  368. i2400m->bus_bm_wait_for_ack = i2400mu_bus_bm_wait_for_ack;
  369. i2400m->bus_fw_names = i2400mu_bus_fw_names;
  370. i2400m->bus_bm_mac_addr_impaired = 0;
  371. #ifdef CONFIG_PM
  372. iface->needs_remote_wakeup = 1; /* autosuspend (15s delay) */
  373. device_init_wakeup(dev, 1);
  374. usb_autopm_enable(i2400mu->usb_iface);
  375. usb_dev->autosuspend_delay = 15 * HZ;
  376. usb_dev->autosuspend_disabled = 0;
  377. #endif
  378. result = i2400m_setup(i2400m, I2400M_BRI_MAC_REINIT);
  379. if (result < 0) {
  380. dev_err(dev, "cannot setup device: %d\n", result);
  381. goto error_setup;
  382. }
  383. result = i2400mu_debugfs_add(i2400mu);
  384. if (result < 0) {
  385. dev_err(dev, "Can't register i2400mu's debugfs: %d\n", result);
  386. goto error_debugfs_add;
  387. }
  388. return 0;
  389. error_debugfs_add:
  390. i2400m_release(i2400m);
  391. error_setup:
  392. usb_set_intfdata(iface, NULL);
  393. usb_put_dev(i2400mu->usb_dev);
  394. free_netdev(net_dev);
  395. error_alloc_netdev:
  396. return result;
  397. }
  398. /*
  399. * Disconect a i2400m from the system.
  400. *
  401. * i2400m_stop() has been called before, so al the rx and tx contexts
  402. * have been taken down already. Make sure the queue is stopped,
  403. * unregister netdev and i2400m, free and kill.
  404. */
  405. static
  406. void i2400mu_disconnect(struct usb_interface *iface)
  407. {
  408. struct i2400mu *i2400mu = usb_get_intfdata(iface);
  409. struct i2400m *i2400m = &i2400mu->i2400m;
  410. struct net_device *net_dev = i2400m->wimax_dev.net_dev;
  411. struct device *dev = &iface->dev;
  412. d_fnstart(3, dev, "(iface %p i2400m %p)\n", iface, i2400m);
  413. debugfs_remove_recursive(i2400mu->debugfs_dentry);
  414. i2400m_release(i2400m);
  415. usb_set_intfdata(iface, NULL);
  416. usb_put_dev(i2400mu->usb_dev);
  417. free_netdev(net_dev);
  418. d_fnend(3, dev, "(iface %p i2400m %p) = void\n", iface, i2400m);
  419. }
  420. /*
  421. * Get the device ready for USB port or system standby and hibernation
  422. *
  423. * USB port and system standby are handled the same.
  424. *
  425. * When the system hibernates, the USB device is powered down and then
  426. * up, so we don't really have to do much here, as it will be seen as
  427. * a reconnect. Still for simplicity we consider this case the same as
  428. * suspend, so that the device has a chance to do notify the base
  429. * station (if connected).
  430. *
  431. * So at the end, the three cases require common handling.
  432. *
  433. * If at the time of this call the device's firmware is not loaded,
  434. * nothing has to be done.
  435. *
  436. * If the firmware is loaded, we need to:
  437. *
  438. * - tell the device to go into host interface power save mode, wait
  439. * for it to ack
  440. *
  441. * This is quite more interesting than it is; we need to execute a
  442. * command, but this time, we don't want the code in usb-{tx,rx}.c
  443. * to call the usb_autopm_get/put_interface() barriers as it'd
  444. * deadlock, so we need to decrement i2400mu->do_autopm, that acts
  445. * as a poor man's semaphore. Ugly, but it works.
  446. *
  447. * As well, the device might refuse going to sleep for whichever
  448. * reason. In this case we just fail. For system suspend/hibernate,
  449. * we *can't* fail. We look at usb_dev->auto_pm to see if the
  450. * suspend call comes from the USB stack or from the system and act
  451. * in consequence.
  452. *
  453. * - stop the notification endpoint polling
  454. */
  455. static
  456. int i2400mu_suspend(struct usb_interface *iface, pm_message_t pm_msg)
  457. {
  458. int result = 0;
  459. struct device *dev = &iface->dev;
  460. struct i2400mu *i2400mu = usb_get_intfdata(iface);
  461. #ifdef CONFIG_PM
  462. struct usb_device *usb_dev = i2400mu->usb_dev;
  463. #endif
  464. struct i2400m *i2400m = &i2400mu->i2400m;
  465. d_fnstart(3, dev, "(iface %p pm_msg %u)\n", iface, pm_msg.event);
  466. if (i2400m->updown == 0)
  467. goto no_firmware;
  468. d_printf(1, dev, "fw up, requesting standby\n");
  469. atomic_dec(&i2400mu->do_autopm);
  470. result = i2400m_cmd_enter_powersave(i2400m);
  471. atomic_inc(&i2400mu->do_autopm);
  472. #ifdef CONFIG_PM
  473. if (result < 0 && usb_dev->auto_pm == 0) {
  474. /* System suspend, can't fail */
  475. dev_err(dev, "failed to suspend, will reset on resume\n");
  476. result = 0;
  477. }
  478. #endif
  479. if (result < 0)
  480. goto error_enter_powersave;
  481. i2400mu_notification_release(i2400mu);
  482. d_printf(1, dev, "fw up, got standby\n");
  483. error_enter_powersave:
  484. no_firmware:
  485. d_fnend(3, dev, "(iface %p pm_msg %u) = %d\n",
  486. iface, pm_msg.event, result);
  487. return result;
  488. }
  489. static
  490. int i2400mu_resume(struct usb_interface *iface)
  491. {
  492. int ret = 0;
  493. struct device *dev = &iface->dev;
  494. struct i2400mu *i2400mu = usb_get_intfdata(iface);
  495. struct i2400m *i2400m = &i2400mu->i2400m;
  496. d_fnstart(3, dev, "(iface %p)\n", iface);
  497. if (i2400m->updown == 0) {
  498. d_printf(1, dev, "fw was down, no resume neeed\n");
  499. goto out;
  500. }
  501. d_printf(1, dev, "fw was up, resuming\n");
  502. i2400mu_notification_setup(i2400mu);
  503. /* USB has flow control, so we don't need to give it time to
  504. * come back; otherwise, we'd use something like a get-state
  505. * command... */
  506. out:
  507. d_fnend(3, dev, "(iface %p) = %d\n", iface, ret);
  508. return ret;
  509. }
  510. static
  511. struct usb_device_id i2400mu_id_table[] = {
  512. { USB_DEVICE(0x8086, 0x0181) },
  513. { USB_DEVICE(0x8086, 0x1403) },
  514. { USB_DEVICE(0x8086, 0x1405) },
  515. { USB_DEVICE(0x8086, 0x0180) },
  516. { USB_DEVICE(0x8086, 0x0182) },
  517. { USB_DEVICE(0x8086, 0x1406) },
  518. { USB_DEVICE(0x8086, 0x1403) },
  519. { },
  520. };
  521. MODULE_DEVICE_TABLE(usb, i2400mu_id_table);
  522. static
  523. struct usb_driver i2400mu_driver = {
  524. .name = KBUILD_MODNAME,
  525. .suspend = i2400mu_suspend,
  526. .resume = i2400mu_resume,
  527. .probe = i2400mu_probe,
  528. .disconnect = i2400mu_disconnect,
  529. .id_table = i2400mu_id_table,
  530. .supports_autosuspend = 1,
  531. };
  532. static
  533. int __init i2400mu_driver_init(void)
  534. {
  535. return usb_register(&i2400mu_driver);
  536. }
  537. module_init(i2400mu_driver_init);
  538. static
  539. void __exit i2400mu_driver_exit(void)
  540. {
  541. flush_scheduled_work(); /* for the stuff we schedule from sysfs.c */
  542. usb_deregister(&i2400mu_driver);
  543. }
  544. module_exit(i2400mu_driver_exit);
  545. MODULE_AUTHOR("Intel Corporation <linux-wimax@intel.com>");
  546. MODULE_DESCRIPTION("Intel 2400M WiMAX networking for USB");
  547. MODULE_LICENSE("GPL");
  548. MODULE_FIRMWARE(I2400MU_FW_FILE_NAME_v1_4);
  549. MODULE_FIRMWARE(I2400MU_FW_FILE_NAME_v1_3);