smsusb.c 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. /****************************************************************
  2. Siano Mobile Silicon, Inc.
  3. MDTV receiver kernel modules.
  4. Copyright (C) 2005-2009, Uri Shkolnik, Anatoly Greenblat
  5. This program is free software: you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation, either version 2 of the License, or
  8. (at your option) any later version.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. GNU General Public License for more details.
  13. You should have received a copy of the GNU General Public License
  14. along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. ****************************************************************/
  16. #include <linux/kernel.h>
  17. #include <linux/init.h>
  18. #include <linux/usb.h>
  19. #include <linux/firmware.h>
  20. #include <linux/slab.h>
  21. #include <linux/module.h>
  22. #include "smscoreapi.h"
  23. #include "sms-cards.h"
  24. #include "smsendian.h"
  25. static int sms_dbg;
  26. module_param_named(debug, sms_dbg, int, 0644);
  27. MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))");
  28. #define USB1_BUFFER_SIZE 0x1000
  29. #define USB2_BUFFER_SIZE 0x2000
  30. #define MAX_BUFFERS 50
  31. #define MAX_URBS 10
  32. struct smsusb_device_t;
  33. enum smsusb_state {
  34. SMSUSB_DISCONNECTED,
  35. SMSUSB_SUSPENDED,
  36. SMSUSB_ACTIVE
  37. };
  38. struct smsusb_urb_t {
  39. struct list_head entry;
  40. struct smscore_buffer_t *cb;
  41. struct smsusb_device_t *dev;
  42. struct urb urb;
  43. };
  44. struct smsusb_device_t {
  45. struct usb_device *udev;
  46. struct smscore_device_t *coredev;
  47. struct smsusb_urb_t surbs[MAX_URBS];
  48. int response_alignment;
  49. int buffer_size;
  50. unsigned char in_ep;
  51. unsigned char out_ep;
  52. enum smsusb_state state;
  53. };
  54. static int smsusb_submit_urb(struct smsusb_device_t *dev,
  55. struct smsusb_urb_t *surb);
  56. /**
  57. * Completing URB's callback handler - top half (interrupt context)
  58. * adds completing sms urb to the global surbs list and activtes the worker
  59. * thread the surb
  60. * IMPORTANT - blocking functions must not be called from here !!!
  61. * @param urb pointer to a completing urb object
  62. */
  63. static void smsusb_onresponse(struct urb *urb)
  64. {
  65. struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context;
  66. struct smsusb_device_t *dev = surb->dev;
  67. if (urb->status == -ESHUTDOWN) {
  68. sms_err("error, urb status %d (-ESHUTDOWN), %d bytes",
  69. urb->status, urb->actual_length);
  70. return;
  71. }
  72. if ((urb->actual_length > 0) && (urb->status == 0)) {
  73. struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)surb->cb->p;
  74. smsendian_handle_message_header(phdr);
  75. if (urb->actual_length >= phdr->msg_length) {
  76. surb->cb->size = phdr->msg_length;
  77. if (dev->response_alignment &&
  78. (phdr->msg_flags & MSG_HDR_FLAG_SPLIT_MSG)) {
  79. surb->cb->offset =
  80. dev->response_alignment +
  81. ((phdr->msg_flags >> 8) & 3);
  82. /* sanity check */
  83. if (((int) phdr->msg_length +
  84. surb->cb->offset) > urb->actual_length) {
  85. sms_err("invalid response "
  86. "msglen %d offset %d "
  87. "size %d",
  88. phdr->msg_length,
  89. surb->cb->offset,
  90. urb->actual_length);
  91. goto exit_and_resubmit;
  92. }
  93. /* move buffer pointer and
  94. * copy header to its new location */
  95. memcpy((char *) phdr + surb->cb->offset,
  96. phdr, sizeof(struct sms_msg_hdr));
  97. } else
  98. surb->cb->offset = 0;
  99. sms_debug("received %s(%d) size: %d",
  100. smscore_translate_msg(phdr->msg_type),
  101. phdr->msg_type, phdr->msg_length);
  102. smsendian_handle_rx_message((struct sms_msg_data *) phdr);
  103. smscore_onresponse(dev->coredev, surb->cb);
  104. surb->cb = NULL;
  105. } else {
  106. sms_err("invalid response "
  107. "msglen %d actual %d",
  108. phdr->msg_length, urb->actual_length);
  109. }
  110. } else
  111. sms_err("error, urb status %d, %d bytes",
  112. urb->status, urb->actual_length);
  113. exit_and_resubmit:
  114. smsusb_submit_urb(dev, surb);
  115. }
  116. static int smsusb_submit_urb(struct smsusb_device_t *dev,
  117. struct smsusb_urb_t *surb)
  118. {
  119. if (!surb->cb) {
  120. surb->cb = smscore_getbuffer(dev->coredev);
  121. if (!surb->cb) {
  122. sms_err("smscore_getbuffer(...) returned NULL");
  123. return -ENOMEM;
  124. }
  125. }
  126. usb_fill_bulk_urb(
  127. &surb->urb,
  128. dev->udev,
  129. usb_rcvbulkpipe(dev->udev, dev->in_ep),
  130. surb->cb->p,
  131. dev->buffer_size,
  132. smsusb_onresponse,
  133. surb
  134. );
  135. surb->urb.transfer_dma = surb->cb->phys;
  136. surb->urb.transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
  137. return usb_submit_urb(&surb->urb, GFP_ATOMIC);
  138. }
  139. static void smsusb_stop_streaming(struct smsusb_device_t *dev)
  140. {
  141. int i;
  142. for (i = 0; i < MAX_URBS; i++) {
  143. usb_kill_urb(&dev->surbs[i].urb);
  144. if (dev->surbs[i].cb) {
  145. smscore_putbuffer(dev->coredev, dev->surbs[i].cb);
  146. dev->surbs[i].cb = NULL;
  147. }
  148. }
  149. }
  150. static int smsusb_start_streaming(struct smsusb_device_t *dev)
  151. {
  152. int i, rc;
  153. for (i = 0; i < MAX_URBS; i++) {
  154. rc = smsusb_submit_urb(dev, &dev->surbs[i]);
  155. if (rc < 0) {
  156. sms_err("smsusb_submit_urb(...) failed");
  157. smsusb_stop_streaming(dev);
  158. break;
  159. }
  160. }
  161. return rc;
  162. }
  163. static int smsusb_sendrequest(void *context, void *buffer, size_t size)
  164. {
  165. struct smsusb_device_t *dev = (struct smsusb_device_t *) context;
  166. struct sms_msg_hdr *phdr = (struct sms_msg_hdr *) buffer;
  167. int dummy;
  168. if (dev->state != SMSUSB_ACTIVE) {
  169. sms_debug("Device not active yet");
  170. return -ENOENT;
  171. }
  172. sms_debug("sending %s(%d) size: %d",
  173. smscore_translate_msg(phdr->msg_type), phdr->msg_type,
  174. phdr->msg_length);
  175. smsendian_handle_tx_message((struct sms_msg_data *) phdr);
  176. smsendian_handle_message_header((struct sms_msg_hdr *)buffer);
  177. return usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
  178. buffer, size, &dummy, 1000);
  179. }
  180. static char *smsusb1_fw_lkup[] = {
  181. "dvbt_stellar_usb.inp",
  182. "dvbh_stellar_usb.inp",
  183. "tdmb_stellar_usb.inp",
  184. "none",
  185. "dvbt_bda_stellar_usb.inp",
  186. };
  187. static inline char *sms_get_fw_name(int mode, int board_id)
  188. {
  189. char **fw = sms_get_board(board_id)->fw;
  190. return (fw && fw[mode]) ? fw[mode] : smsusb1_fw_lkup[mode];
  191. }
  192. static int smsusb1_load_firmware(struct usb_device *udev, int id, int board_id)
  193. {
  194. const struct firmware *fw;
  195. u8 *fw_buffer;
  196. int rc, dummy;
  197. char *fw_filename;
  198. if (id < 0)
  199. id = sms_get_board(board_id)->default_mode;
  200. if (id < DEVICE_MODE_DVBT || id > DEVICE_MODE_DVBT_BDA) {
  201. sms_err("invalid firmware id specified %d", id);
  202. return -EINVAL;
  203. }
  204. fw_filename = sms_get_fw_name(id, board_id);
  205. rc = request_firmware(&fw, fw_filename, &udev->dev);
  206. if (rc < 0) {
  207. sms_warn("failed to open \"%s\" mode %d, "
  208. "trying again with default firmware", fw_filename, id);
  209. fw_filename = smsusb1_fw_lkup[id];
  210. rc = request_firmware(&fw, fw_filename, &udev->dev);
  211. if (rc < 0) {
  212. sms_warn("failed to open \"%s\" mode %d",
  213. fw_filename, id);
  214. return rc;
  215. }
  216. }
  217. fw_buffer = kmalloc(fw->size, GFP_KERNEL);
  218. if (fw_buffer) {
  219. memcpy(fw_buffer, fw->data, fw->size);
  220. rc = usb_bulk_msg(udev, usb_sndbulkpipe(udev, 2),
  221. fw_buffer, fw->size, &dummy, 1000);
  222. sms_info("sent %zd(%d) bytes, rc %d", fw->size, dummy, rc);
  223. kfree(fw_buffer);
  224. } else {
  225. sms_err("failed to allocate firmware buffer");
  226. rc = -ENOMEM;
  227. }
  228. sms_info("read FW %s, size=%zd", fw_filename, fw->size);
  229. release_firmware(fw);
  230. return rc;
  231. }
  232. static void smsusb1_detectmode(void *context, int *mode)
  233. {
  234. char *product_string =
  235. ((struct smsusb_device_t *) context)->udev->product;
  236. *mode = DEVICE_MODE_NONE;
  237. if (!product_string) {
  238. product_string = "none";
  239. sms_err("product string not found");
  240. } else if (strstr(product_string, "DVBH"))
  241. *mode = 1;
  242. else if (strstr(product_string, "BDA"))
  243. *mode = 4;
  244. else if (strstr(product_string, "DVBT"))
  245. *mode = 0;
  246. else if (strstr(product_string, "TDMB"))
  247. *mode = 2;
  248. sms_info("%d \"%s\"", *mode, product_string);
  249. }
  250. static int smsusb1_setmode(void *context, int mode)
  251. {
  252. struct sms_msg_hdr msg = { MSG_SW_RELOAD_REQ, 0, HIF_TASK,
  253. sizeof(struct sms_msg_hdr), 0 };
  254. if (mode < DEVICE_MODE_DVBT || mode > DEVICE_MODE_DVBT_BDA) {
  255. sms_err("invalid firmware id specified %d", mode);
  256. return -EINVAL;
  257. }
  258. return smsusb_sendrequest(context, &msg, sizeof(msg));
  259. }
  260. static void smsusb_term_device(struct usb_interface *intf)
  261. {
  262. struct smsusb_device_t *dev = usb_get_intfdata(intf);
  263. if (dev) {
  264. dev->state = SMSUSB_DISCONNECTED;
  265. smsusb_stop_streaming(dev);
  266. /* unregister from smscore */
  267. if (dev->coredev)
  268. smscore_unregister_device(dev->coredev);
  269. sms_info("device 0x%p destroyed", dev);
  270. kfree(dev);
  271. }
  272. usb_set_intfdata(intf, NULL);
  273. }
  274. static int smsusb_init_device(struct usb_interface *intf, int board_id)
  275. {
  276. struct smsdevice_params_t params;
  277. struct smsusb_device_t *dev;
  278. int i, rc;
  279. /* create device object */
  280. dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
  281. if (!dev) {
  282. sms_err("kzalloc(sizeof(struct smsusb_device_t) failed");
  283. return -ENOMEM;
  284. }
  285. memset(&params, 0, sizeof(params));
  286. usb_set_intfdata(intf, dev);
  287. dev->udev = interface_to_usbdev(intf);
  288. dev->state = SMSUSB_DISCONNECTED;
  289. params.device_type = sms_get_board(board_id)->type;
  290. switch (params.device_type) {
  291. case SMS_STELLAR:
  292. dev->buffer_size = USB1_BUFFER_SIZE;
  293. params.setmode_handler = smsusb1_setmode;
  294. params.detectmode_handler = smsusb1_detectmode;
  295. break;
  296. case SMS_UNKNOWN_TYPE:
  297. sms_err("Unspecified sms device type!");
  298. /* fall-thru */
  299. default:
  300. dev->buffer_size = USB2_BUFFER_SIZE;
  301. dev->response_alignment =
  302. le16_to_cpu(dev->udev->ep_in[1]->desc.wMaxPacketSize) -
  303. sizeof(struct sms_msg_hdr);
  304. params.flags |= SMS_DEVICE_FAMILY2;
  305. break;
  306. }
  307. for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) {
  308. if (intf->cur_altsetting->endpoint[i].desc. bEndpointAddress & USB_DIR_IN)
  309. dev->in_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress;
  310. else
  311. dev->out_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress;
  312. }
  313. sms_info("in_ep = %02x, out_ep = %02x",
  314. dev->in_ep, dev->out_ep);
  315. params.device = &dev->udev->dev;
  316. params.buffer_size = dev->buffer_size;
  317. params.num_buffers = MAX_BUFFERS;
  318. params.sendrequest_handler = smsusb_sendrequest;
  319. params.context = dev;
  320. usb_make_path(dev->udev, params.devpath, sizeof(params.devpath));
  321. /* register in smscore */
  322. rc = smscore_register_device(&params, &dev->coredev);
  323. if (rc < 0) {
  324. sms_err("smscore_register_device(...) failed, rc %d", rc);
  325. smsusb_term_device(intf);
  326. return rc;
  327. }
  328. smscore_set_board_id(dev->coredev, board_id);
  329. dev->coredev->is_usb_device = true;
  330. /* initialize urbs */
  331. for (i = 0; i < MAX_URBS; i++) {
  332. dev->surbs[i].dev = dev;
  333. usb_init_urb(&dev->surbs[i].urb);
  334. }
  335. sms_info("smsusb_start_streaming(...).");
  336. rc = smsusb_start_streaming(dev);
  337. if (rc < 0) {
  338. sms_err("smsusb_start_streaming(...) failed");
  339. smsusb_term_device(intf);
  340. return rc;
  341. }
  342. dev->state = SMSUSB_ACTIVE;
  343. rc = smscore_start_device(dev->coredev);
  344. if (rc < 0) {
  345. sms_err("smscore_start_device(...) failed");
  346. smsusb_term_device(intf);
  347. return rc;
  348. }
  349. sms_info("device 0x%p created", dev);
  350. return rc;
  351. }
  352. static int smsusb_probe(struct usb_interface *intf,
  353. const struct usb_device_id *id)
  354. {
  355. struct usb_device *udev = interface_to_usbdev(intf);
  356. char devpath[32];
  357. int i, rc;
  358. sms_info("board id=%lu, interface number %d",
  359. id->driver_info,
  360. intf->cur_altsetting->desc.bInterfaceNumber);
  361. if (sms_get_board(id->driver_info)->intf_num !=
  362. intf->cur_altsetting->desc.bInterfaceNumber) {
  363. sms_debug("interface %d won't be used. Expecting interface %d to popup",
  364. intf->cur_altsetting->desc.bInterfaceNumber,
  365. sms_get_board(id->driver_info)->intf_num);
  366. return -ENODEV;
  367. }
  368. if (intf->num_altsetting > 1) {
  369. rc = usb_set_interface(udev,
  370. intf->cur_altsetting->desc.bInterfaceNumber,
  371. 0);
  372. if (rc < 0) {
  373. sms_err("usb_set_interface failed, rc %d", rc);
  374. return rc;
  375. }
  376. }
  377. sms_info("smsusb_probe %d",
  378. intf->cur_altsetting->desc.bInterfaceNumber);
  379. for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) {
  380. sms_info("endpoint %d %02x %02x %d", i,
  381. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
  382. intf->cur_altsetting->endpoint[i].desc.bmAttributes,
  383. intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
  384. if (intf->cur_altsetting->endpoint[i].desc.bEndpointAddress &
  385. USB_DIR_IN)
  386. rc = usb_clear_halt(udev, usb_rcvbulkpipe(udev,
  387. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress));
  388. else
  389. rc = usb_clear_halt(udev, usb_sndbulkpipe(udev,
  390. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress));
  391. }
  392. if ((udev->actconfig->desc.bNumInterfaces == 2) &&
  393. (intf->cur_altsetting->desc.bInterfaceNumber == 0)) {
  394. sms_debug("rom interface 0 is not used");
  395. return -ENODEV;
  396. }
  397. if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) {
  398. /* Detected a Siano Stellar uninitialized */
  399. snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
  400. udev->bus->busnum, udev->devpath);
  401. sms_info("stellar device in cold state was found at %s.", devpath);
  402. rc = smsusb1_load_firmware(
  403. udev, smscore_registry_getmode(devpath),
  404. id->driver_info);
  405. /* This device will reset and gain another USB ID */
  406. if (!rc)
  407. sms_info("stellar device now in warm state");
  408. else
  409. sms_err("Failed to put stellar in warm state. Error: %d", rc);
  410. return rc;
  411. } else {
  412. rc = smsusb_init_device(intf, id->driver_info);
  413. }
  414. sms_info("Device initialized with return code %d", rc);
  415. sms_board_load_modules(id->driver_info);
  416. return rc;
  417. }
  418. static void smsusb_disconnect(struct usb_interface *intf)
  419. {
  420. smsusb_term_device(intf);
  421. }
  422. static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg)
  423. {
  424. struct smsusb_device_t *dev = usb_get_intfdata(intf);
  425. printk(KERN_INFO "%s Entering status %d.\n", __func__, msg.event);
  426. dev->state = SMSUSB_SUSPENDED;
  427. /*smscore_set_power_mode(dev, SMS_POWER_MODE_SUSPENDED);*/
  428. smsusb_stop_streaming(dev);
  429. return 0;
  430. }
  431. static int smsusb_resume(struct usb_interface *intf)
  432. {
  433. int rc, i;
  434. struct smsusb_device_t *dev = usb_get_intfdata(intf);
  435. struct usb_device *udev = interface_to_usbdev(intf);
  436. printk(KERN_INFO "%s Entering.\n", __func__);
  437. usb_clear_halt(udev, usb_rcvbulkpipe(udev, dev->in_ep));
  438. usb_clear_halt(udev, usb_sndbulkpipe(udev, dev->out_ep));
  439. for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++)
  440. printk(KERN_INFO "endpoint %d %02x %02x %d\n", i,
  441. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
  442. intf->cur_altsetting->endpoint[i].desc.bmAttributes,
  443. intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
  444. if (intf->num_altsetting > 0) {
  445. rc = usb_set_interface(udev,
  446. intf->cur_altsetting->desc.
  447. bInterfaceNumber, 0);
  448. if (rc < 0) {
  449. printk(KERN_INFO "%s usb_set_interface failed, "
  450. "rc %d\n", __func__, rc);
  451. return rc;
  452. }
  453. }
  454. smsusb_start_streaming(dev);
  455. return 0;
  456. }
  457. static const struct usb_device_id smsusb_id_table[] = {
  458. /* This device is only present before firmware load */
  459. { USB_DEVICE(0x187f, 0x0010),
  460. .driver_info = SMS1XXX_BOARD_SIANO_STELLAR_ROM },
  461. /* This device pops up after firmware load */
  462. { USB_DEVICE(0x187f, 0x0100),
  463. .driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
  464. { USB_DEVICE(0x187f, 0x0200),
  465. .driver_info = SMS1XXX_BOARD_SIANO_NOVA_A },
  466. { USB_DEVICE(0x187f, 0x0201),
  467. .driver_info = SMS1XXX_BOARD_SIANO_NOVA_B },
  468. { USB_DEVICE(0x187f, 0x0300),
  469. .driver_info = SMS1XXX_BOARD_SIANO_VEGA },
  470. { USB_DEVICE(0x2040, 0x1700),
  471. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT },
  472. { USB_DEVICE(0x2040, 0x1800),
  473. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A },
  474. { USB_DEVICE(0x2040, 0x1801),
  475. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B },
  476. { USB_DEVICE(0x2040, 0x2000),
  477. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  478. { USB_DEVICE(0x2040, 0x2009),
  479. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 },
  480. { USB_DEVICE(0x2040, 0x200a),
  481. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  482. { USB_DEVICE(0x2040, 0x2010),
  483. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  484. { USB_DEVICE(0x2040, 0x2011),
  485. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  486. { USB_DEVICE(0x2040, 0x2019),
  487. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  488. { USB_DEVICE(0x2040, 0x5500),
  489. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  490. { USB_DEVICE(0x2040, 0x5510),
  491. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  492. { USB_DEVICE(0x2040, 0x5520),
  493. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  494. { USB_DEVICE(0x2040, 0x5530),
  495. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  496. { USB_DEVICE(0x2040, 0x5580),
  497. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  498. { USB_DEVICE(0x2040, 0x5590),
  499. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  500. { USB_DEVICE(0x187f, 0x0202),
  501. .driver_info = SMS1XXX_BOARD_SIANO_NICE },
  502. { USB_DEVICE(0x187f, 0x0301),
  503. .driver_info = SMS1XXX_BOARD_SIANO_VENICE },
  504. { USB_DEVICE(0x2040, 0xb900),
  505. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  506. { USB_DEVICE(0x2040, 0xb910),
  507. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  508. { USB_DEVICE(0x2040, 0xb980),
  509. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  510. { USB_DEVICE(0x2040, 0xb990),
  511. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  512. { USB_DEVICE(0x2040, 0xc000),
  513. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  514. { USB_DEVICE(0x2040, 0xc010),
  515. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  516. { USB_DEVICE(0x2040, 0xc080),
  517. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  518. { USB_DEVICE(0x2040, 0xc090),
  519. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  520. { USB_DEVICE(0x2040, 0xc0a0),
  521. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  522. { USB_DEVICE(0x2040, 0xf5a0),
  523. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  524. { USB_DEVICE(0x187f, 0x0202),
  525. .driver_info = SMS1XXX_BOARD_SIANO_NICE },
  526. { USB_DEVICE(0x187f, 0x0301),
  527. .driver_info = SMS1XXX_BOARD_SIANO_VENICE },
  528. { USB_DEVICE(0x187f, 0x0302),
  529. .driver_info = SMS1XXX_BOARD_SIANO_VENICE },
  530. { USB_DEVICE(0x187f, 0x0310),
  531. .driver_info = SMS1XXX_BOARD_SIANO_MING },
  532. { USB_DEVICE(0x187f, 0x0500),
  533. .driver_info = SMS1XXX_BOARD_SIANO_PELE },
  534. { USB_DEVICE(0x187f, 0x0600),
  535. .driver_info = SMS1XXX_BOARD_SIANO_RIO },
  536. { USB_DEVICE(0x187f, 0x0700),
  537. .driver_info = SMS1XXX_BOARD_SIANO_DENVER_2160 },
  538. { USB_DEVICE(0x187f, 0x0800),
  539. .driver_info = SMS1XXX_BOARD_SIANO_DENVER_1530 },
  540. { USB_DEVICE(0x19D2, 0x0086),
  541. .driver_info = SMS1XXX_BOARD_ZTE_DVB_DATA_CARD },
  542. { USB_DEVICE(0x19D2, 0x0078),
  543. .driver_info = SMS1XXX_BOARD_ONDA_MDTV_DATA_CARD },
  544. { USB_DEVICE(0x3275, 0x0080),
  545. .driver_info = SMS1XXX_BOARD_SIANO_RIO },
  546. { } /* Terminating entry */
  547. };
  548. MODULE_DEVICE_TABLE(usb, smsusb_id_table);
  549. static struct usb_driver smsusb_driver = {
  550. .name = "smsusb",
  551. .probe = smsusb_probe,
  552. .disconnect = smsusb_disconnect,
  553. .id_table = smsusb_id_table,
  554. .suspend = smsusb_suspend,
  555. .resume = smsusb_resume,
  556. };
  557. module_usb_driver(smsusb_driver);
  558. MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle");
  559. MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)");
  560. MODULE_LICENSE("GPL");