smsusb.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725
  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 "smscoreapi.h"
  17. #include <linux/kernel.h>
  18. #include <linux/init.h>
  19. #include <linux/usb.h>
  20. #include <linux/firmware.h>
  21. #include <linux/slab.h>
  22. #include <linux/module.h>
  23. #include "sms-cards.h"
  24. #include "smsendian.h"
  25. #define USB1_BUFFER_SIZE 0x1000
  26. #define USB2_BUFFER_SIZE 0x2000
  27. #define MAX_BUFFERS 50
  28. #define MAX_URBS 10
  29. struct smsusb_device_t;
  30. enum smsusb_state {
  31. SMSUSB_DISCONNECTED,
  32. SMSUSB_SUSPENDED,
  33. SMSUSB_ACTIVE
  34. };
  35. struct smsusb_urb_t {
  36. struct list_head entry;
  37. struct smscore_buffer_t *cb;
  38. struct smsusb_device_t *dev;
  39. struct urb urb;
  40. };
  41. struct smsusb_device_t {
  42. struct usb_device *udev;
  43. struct smscore_device_t *coredev;
  44. struct smsusb_urb_t surbs[MAX_URBS];
  45. int response_alignment;
  46. int buffer_size;
  47. unsigned char in_ep;
  48. unsigned char out_ep;
  49. enum smsusb_state state;
  50. };
  51. static int smsusb_submit_urb(struct smsusb_device_t *dev,
  52. struct smsusb_urb_t *surb);
  53. /**
  54. * Completing URB's callback handler - top half (interrupt context)
  55. * adds completing sms urb to the global surbs list and activtes the worker
  56. * thread the surb
  57. * IMPORTANT - blocking functions must not be called from here !!!
  58. * @param urb pointer to a completing urb object
  59. */
  60. static void smsusb_onresponse(struct urb *urb)
  61. {
  62. struct smsusb_urb_t *surb = (struct smsusb_urb_t *) urb->context;
  63. struct smsusb_device_t *dev = surb->dev;
  64. if (urb->status == -ESHUTDOWN) {
  65. pr_err("error, urb status %d (-ESHUTDOWN), %d bytes\n",
  66. urb->status, urb->actual_length);
  67. return;
  68. }
  69. if ((urb->actual_length > 0) && (urb->status == 0)) {
  70. struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)surb->cb->p;
  71. smsendian_handle_message_header(phdr);
  72. if (urb->actual_length >= phdr->msg_length) {
  73. surb->cb->size = phdr->msg_length;
  74. if (dev->response_alignment &&
  75. (phdr->msg_flags & MSG_HDR_FLAG_SPLIT_MSG)) {
  76. surb->cb->offset =
  77. dev->response_alignment +
  78. ((phdr->msg_flags >> 8) & 3);
  79. /* sanity check */
  80. if (((int) phdr->msg_length +
  81. surb->cb->offset) > urb->actual_length) {
  82. pr_err("invalid response msglen %d offset %d size %d\n",
  83. phdr->msg_length,
  84. surb->cb->offset,
  85. urb->actual_length);
  86. goto exit_and_resubmit;
  87. }
  88. /* move buffer pointer and
  89. * copy header to its new location */
  90. memcpy((char *) phdr + surb->cb->offset,
  91. phdr, sizeof(struct sms_msg_hdr));
  92. } else
  93. surb->cb->offset = 0;
  94. pr_debug("received %s(%d) size: %d\n",
  95. smscore_translate_msg(phdr->msg_type),
  96. phdr->msg_type, phdr->msg_length);
  97. smsendian_handle_rx_message((struct sms_msg_data *) phdr);
  98. smscore_onresponse(dev->coredev, surb->cb);
  99. surb->cb = NULL;
  100. } else {
  101. pr_err("invalid response msglen %d actual %d\n",
  102. phdr->msg_length, urb->actual_length);
  103. }
  104. } else
  105. pr_err("error, urb status %d, %d bytes\n",
  106. urb->status, urb->actual_length);
  107. exit_and_resubmit:
  108. smsusb_submit_urb(dev, surb);
  109. }
  110. static int smsusb_submit_urb(struct smsusb_device_t *dev,
  111. struct smsusb_urb_t *surb)
  112. {
  113. if (!surb->cb) {
  114. surb->cb = smscore_getbuffer(dev->coredev);
  115. if (!surb->cb) {
  116. pr_err("smscore_getbuffer(...) returned NULL\n");
  117. return -ENOMEM;
  118. }
  119. }
  120. usb_fill_bulk_urb(
  121. &surb->urb,
  122. dev->udev,
  123. usb_rcvbulkpipe(dev->udev, dev->in_ep),
  124. surb->cb->p,
  125. dev->buffer_size,
  126. smsusb_onresponse,
  127. surb
  128. );
  129. surb->urb.transfer_dma = surb->cb->phys;
  130. surb->urb.transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
  131. return usb_submit_urb(&surb->urb, GFP_ATOMIC);
  132. }
  133. static void smsusb_stop_streaming(struct smsusb_device_t *dev)
  134. {
  135. int i;
  136. for (i = 0; i < MAX_URBS; i++) {
  137. usb_kill_urb(&dev->surbs[i].urb);
  138. if (dev->surbs[i].cb) {
  139. smscore_putbuffer(dev->coredev, dev->surbs[i].cb);
  140. dev->surbs[i].cb = NULL;
  141. }
  142. }
  143. }
  144. static int smsusb_start_streaming(struct smsusb_device_t *dev)
  145. {
  146. int i, rc;
  147. for (i = 0; i < MAX_URBS; i++) {
  148. rc = smsusb_submit_urb(dev, &dev->surbs[i]);
  149. if (rc < 0) {
  150. pr_err("smsusb_submit_urb(...) failed\n");
  151. smsusb_stop_streaming(dev);
  152. break;
  153. }
  154. }
  155. return rc;
  156. }
  157. static int smsusb_sendrequest(void *context, void *buffer, size_t size)
  158. {
  159. struct smsusb_device_t *dev = (struct smsusb_device_t *) context;
  160. struct sms_msg_hdr *phdr;
  161. int dummy, ret;
  162. if (dev->state != SMSUSB_ACTIVE) {
  163. pr_debug("Device not active yet\n");
  164. return -ENOENT;
  165. }
  166. phdr = kmalloc(size, GFP_KERNEL);
  167. if (!phdr)
  168. return -ENOMEM;
  169. memcpy(phdr, buffer, size);
  170. pr_debug("sending %s(%d) size: %d\n",
  171. smscore_translate_msg(phdr->msg_type), phdr->msg_type,
  172. phdr->msg_length);
  173. smsendian_handle_tx_message((struct sms_msg_data *) phdr);
  174. smsendian_handle_message_header((struct sms_msg_hdr *)phdr);
  175. ret = usb_bulk_msg(dev->udev, usb_sndbulkpipe(dev->udev, 2),
  176. phdr, size, &dummy, 1000);
  177. kfree(phdr);
  178. return ret;
  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. pr_err("invalid firmware id specified %d\n", 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. pr_warn("failed to open '%s' mode %d, trying again with default firmware\n",
  208. fw_filename, id);
  209. fw_filename = smsusb1_fw_lkup[id];
  210. rc = request_firmware(&fw, fw_filename, &udev->dev);
  211. if (rc < 0) {
  212. pr_warn("failed to open '%s' mode %d\n",
  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. pr_debug("sent %zu(%d) bytes, rc %d\n", fw->size, dummy, rc);
  223. kfree(fw_buffer);
  224. } else {
  225. pr_err("failed to allocate firmware buffer\n");
  226. rc = -ENOMEM;
  227. }
  228. pr_debug("read FW %s, size=%zu\n", 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. pr_err("product string not found\n");
  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. pr_debug("%d \"%s\"\n", *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. pr_err("invalid firmware id specified %d\n", 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. pr_debug("device 0x%p destroyed\n", dev);
  270. kfree(dev);
  271. }
  272. usb_set_intfdata(intf, NULL);
  273. }
  274. static void *siano_media_device_register(struct smsusb_device_t *dev,
  275. int board_id)
  276. {
  277. #ifdef CONFIG_MEDIA_CONTROLLER_DVB
  278. struct media_device *mdev;
  279. struct usb_device *udev = dev->udev;
  280. struct sms_board *board = sms_get_board(board_id);
  281. int ret;
  282. mdev = kzalloc(sizeof(*mdev), GFP_KERNEL);
  283. if (!mdev)
  284. return NULL;
  285. mdev->dev = &udev->dev;
  286. strlcpy(mdev->model, board->name, sizeof(mdev->model));
  287. if (udev->serial)
  288. strlcpy(mdev->serial, udev->serial, sizeof(mdev->serial));
  289. strcpy(mdev->bus_info, udev->devpath);
  290. mdev->hw_revision = le16_to_cpu(udev->descriptor.bcdDevice);
  291. mdev->driver_version = LINUX_VERSION_CODE;
  292. ret = media_device_register(mdev);
  293. if (ret) {
  294. pr_err("Couldn't create a media device. Error: %d\n",
  295. ret);
  296. kfree(mdev);
  297. return NULL;
  298. }
  299. pr_info("media controller created\n");
  300. return mdev;
  301. #else
  302. return NULL;
  303. #endif
  304. }
  305. static int smsusb_init_device(struct usb_interface *intf, int board_id)
  306. {
  307. struct smsdevice_params_t params;
  308. struct smsusb_device_t *dev;
  309. void *mdev;
  310. int i, rc;
  311. /* create device object */
  312. dev = kzalloc(sizeof(struct smsusb_device_t), GFP_KERNEL);
  313. if (!dev)
  314. return -ENOMEM;
  315. memset(&params, 0, sizeof(params));
  316. usb_set_intfdata(intf, dev);
  317. dev->udev = interface_to_usbdev(intf);
  318. dev->state = SMSUSB_DISCONNECTED;
  319. params.device_type = sms_get_board(board_id)->type;
  320. switch (params.device_type) {
  321. case SMS_STELLAR:
  322. dev->buffer_size = USB1_BUFFER_SIZE;
  323. params.setmode_handler = smsusb1_setmode;
  324. params.detectmode_handler = smsusb1_detectmode;
  325. break;
  326. case SMS_UNKNOWN_TYPE:
  327. pr_err("Unspecified sms device type!\n");
  328. /* fall-thru */
  329. default:
  330. dev->buffer_size = USB2_BUFFER_SIZE;
  331. dev->response_alignment =
  332. le16_to_cpu(dev->udev->ep_in[1]->desc.wMaxPacketSize) -
  333. sizeof(struct sms_msg_hdr);
  334. params.flags |= SMS_DEVICE_FAMILY2;
  335. break;
  336. }
  337. for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) {
  338. if (intf->cur_altsetting->endpoint[i].desc. bEndpointAddress & USB_DIR_IN)
  339. dev->in_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress;
  340. else
  341. dev->out_ep = intf->cur_altsetting->endpoint[i].desc.bEndpointAddress;
  342. }
  343. pr_debug("in_ep = %02x, out_ep = %02x\n",
  344. dev->in_ep, dev->out_ep);
  345. params.device = &dev->udev->dev;
  346. params.buffer_size = dev->buffer_size;
  347. params.num_buffers = MAX_BUFFERS;
  348. params.sendrequest_handler = smsusb_sendrequest;
  349. params.context = dev;
  350. usb_make_path(dev->udev, params.devpath, sizeof(params.devpath));
  351. mdev = siano_media_device_register(dev, board_id);
  352. /* register in smscore */
  353. rc = smscore_register_device(&params, &dev->coredev, mdev);
  354. if (rc < 0) {
  355. pr_err("smscore_register_device(...) failed, rc %d\n", rc);
  356. smsusb_term_device(intf);
  357. #ifdef CONFIG_MEDIA_CONTROLLER_DVB
  358. media_device_unregister(mdev);
  359. #endif
  360. kfree(mdev);
  361. return rc;
  362. }
  363. smscore_set_board_id(dev->coredev, board_id);
  364. dev->coredev->is_usb_device = true;
  365. /* initialize urbs */
  366. for (i = 0; i < MAX_URBS; i++) {
  367. dev->surbs[i].dev = dev;
  368. usb_init_urb(&dev->surbs[i].urb);
  369. }
  370. pr_debug("smsusb_start_streaming(...).\n");
  371. rc = smsusb_start_streaming(dev);
  372. if (rc < 0) {
  373. pr_err("smsusb_start_streaming(...) failed\n");
  374. smsusb_term_device(intf);
  375. return rc;
  376. }
  377. dev->state = SMSUSB_ACTIVE;
  378. rc = smscore_start_device(dev->coredev);
  379. if (rc < 0) {
  380. pr_err("smscore_start_device(...) failed\n");
  381. smsusb_term_device(intf);
  382. return rc;
  383. }
  384. pr_debug("device 0x%p created\n", dev);
  385. return rc;
  386. }
  387. static int smsusb_probe(struct usb_interface *intf,
  388. const struct usb_device_id *id)
  389. {
  390. struct usb_device *udev = interface_to_usbdev(intf);
  391. char devpath[32];
  392. int i, rc;
  393. pr_info("board id=%lu, interface number %d\n",
  394. id->driver_info,
  395. intf->cur_altsetting->desc.bInterfaceNumber);
  396. if (sms_get_board(id->driver_info)->intf_num !=
  397. intf->cur_altsetting->desc.bInterfaceNumber) {
  398. pr_debug("interface %d won't be used. Expecting interface %d to popup\n",
  399. intf->cur_altsetting->desc.bInterfaceNumber,
  400. sms_get_board(id->driver_info)->intf_num);
  401. return -ENODEV;
  402. }
  403. if (intf->num_altsetting > 1) {
  404. rc = usb_set_interface(udev,
  405. intf->cur_altsetting->desc.bInterfaceNumber,
  406. 0);
  407. if (rc < 0) {
  408. pr_err("usb_set_interface failed, rc %d\n", rc);
  409. return rc;
  410. }
  411. }
  412. pr_debug("smsusb_probe %d\n",
  413. intf->cur_altsetting->desc.bInterfaceNumber);
  414. for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++) {
  415. pr_debug("endpoint %d %02x %02x %d\n", i,
  416. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
  417. intf->cur_altsetting->endpoint[i].desc.bmAttributes,
  418. intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
  419. if (intf->cur_altsetting->endpoint[i].desc.bEndpointAddress &
  420. USB_DIR_IN)
  421. rc = usb_clear_halt(udev, usb_rcvbulkpipe(udev,
  422. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress));
  423. else
  424. rc = usb_clear_halt(udev, usb_sndbulkpipe(udev,
  425. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress));
  426. }
  427. if ((udev->actconfig->desc.bNumInterfaces == 2) &&
  428. (intf->cur_altsetting->desc.bInterfaceNumber == 0)) {
  429. pr_debug("rom interface 0 is not used\n");
  430. return -ENODEV;
  431. }
  432. if (id->driver_info == SMS1XXX_BOARD_SIANO_STELLAR_ROM) {
  433. /* Detected a Siano Stellar uninitialized */
  434. snprintf(devpath, sizeof(devpath), "usb\\%d-%s",
  435. udev->bus->busnum, udev->devpath);
  436. pr_info("stellar device in cold state was found at %s.\n",
  437. devpath);
  438. rc = smsusb1_load_firmware(
  439. udev, smscore_registry_getmode(devpath),
  440. id->driver_info);
  441. /* This device will reset and gain another USB ID */
  442. if (!rc)
  443. pr_info("stellar device now in warm state\n");
  444. else
  445. pr_err("Failed to put stellar in warm state. Error: %d\n",
  446. rc);
  447. return rc;
  448. } else {
  449. rc = smsusb_init_device(intf, id->driver_info);
  450. }
  451. pr_info("Device initialized with return code %d\n", rc);
  452. sms_board_load_modules(id->driver_info);
  453. return rc;
  454. }
  455. static void smsusb_disconnect(struct usb_interface *intf)
  456. {
  457. smsusb_term_device(intf);
  458. }
  459. static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg)
  460. {
  461. struct smsusb_device_t *dev = usb_get_intfdata(intf);
  462. printk(KERN_INFO "%s Entering status %d.\n", __func__, msg.event);
  463. dev->state = SMSUSB_SUSPENDED;
  464. /*smscore_set_power_mode(dev, SMS_POWER_MODE_SUSPENDED);*/
  465. smsusb_stop_streaming(dev);
  466. return 0;
  467. }
  468. static int smsusb_resume(struct usb_interface *intf)
  469. {
  470. int rc, i;
  471. struct smsusb_device_t *dev = usb_get_intfdata(intf);
  472. struct usb_device *udev = interface_to_usbdev(intf);
  473. printk(KERN_INFO "%s Entering.\n", __func__);
  474. usb_clear_halt(udev, usb_rcvbulkpipe(udev, dev->in_ep));
  475. usb_clear_halt(udev, usb_sndbulkpipe(udev, dev->out_ep));
  476. for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i++)
  477. printk(KERN_INFO "endpoint %d %02x %02x %d\n", i,
  478. intf->cur_altsetting->endpoint[i].desc.bEndpointAddress,
  479. intf->cur_altsetting->endpoint[i].desc.bmAttributes,
  480. intf->cur_altsetting->endpoint[i].desc.wMaxPacketSize);
  481. if (intf->num_altsetting > 0) {
  482. rc = usb_set_interface(udev,
  483. intf->cur_altsetting->desc.
  484. bInterfaceNumber, 0);
  485. if (rc < 0) {
  486. printk(KERN_INFO "%s usb_set_interface failed, "
  487. "rc %d\n", __func__, rc);
  488. return rc;
  489. }
  490. }
  491. smsusb_start_streaming(dev);
  492. return 0;
  493. }
  494. static const struct usb_device_id smsusb_id_table[] = {
  495. /* This device is only present before firmware load */
  496. { USB_DEVICE(0x187f, 0x0010),
  497. .driver_info = SMS1XXX_BOARD_SIANO_STELLAR_ROM },
  498. /* This device pops up after firmware load */
  499. { USB_DEVICE(0x187f, 0x0100),
  500. .driver_info = SMS1XXX_BOARD_SIANO_STELLAR },
  501. { USB_DEVICE(0x187f, 0x0200),
  502. .driver_info = SMS1XXX_BOARD_SIANO_NOVA_A },
  503. { USB_DEVICE(0x187f, 0x0201),
  504. .driver_info = SMS1XXX_BOARD_SIANO_NOVA_B },
  505. { USB_DEVICE(0x187f, 0x0300),
  506. .driver_info = SMS1XXX_BOARD_SIANO_VEGA },
  507. { USB_DEVICE(0x2040, 0x1700),
  508. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT },
  509. { USB_DEVICE(0x2040, 0x1800),
  510. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A },
  511. { USB_DEVICE(0x2040, 0x1801),
  512. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B },
  513. { USB_DEVICE(0x2040, 0x2000),
  514. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  515. { USB_DEVICE(0x2040, 0x2009),
  516. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 },
  517. { USB_DEVICE(0x2040, 0x200a),
  518. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  519. { USB_DEVICE(0x2040, 0x2010),
  520. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  521. { USB_DEVICE(0x2040, 0x2011),
  522. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  523. { USB_DEVICE(0x2040, 0x2019),
  524. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD },
  525. { USB_DEVICE(0x2040, 0x5500),
  526. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  527. { USB_DEVICE(0x2040, 0x5510),
  528. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  529. { USB_DEVICE(0x2040, 0x5520),
  530. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  531. { USB_DEVICE(0x2040, 0x5530),
  532. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  533. { USB_DEVICE(0x2040, 0x5580),
  534. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  535. { USB_DEVICE(0x2040, 0x5590),
  536. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  537. { USB_DEVICE(0x187f, 0x0202),
  538. .driver_info = SMS1XXX_BOARD_SIANO_NICE },
  539. { USB_DEVICE(0x187f, 0x0301),
  540. .driver_info = SMS1XXX_BOARD_SIANO_VENICE },
  541. { USB_DEVICE(0x2040, 0xb900),
  542. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  543. { USB_DEVICE(0x2040, 0xb910),
  544. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  545. { USB_DEVICE(0x2040, 0xb980),
  546. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  547. { USB_DEVICE(0x2040, 0xb990),
  548. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  549. { USB_DEVICE(0x2040, 0xc000),
  550. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  551. { USB_DEVICE(0x2040, 0xc010),
  552. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  553. { USB_DEVICE(0x2040, 0xc080),
  554. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  555. { USB_DEVICE(0x2040, 0xc090),
  556. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  557. { USB_DEVICE(0x2040, 0xc0a0),
  558. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  559. { USB_DEVICE(0x2040, 0xf5a0),
  560. .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM },
  561. { USB_DEVICE(0x187f, 0x0202),
  562. .driver_info = SMS1XXX_BOARD_SIANO_NICE },
  563. { USB_DEVICE(0x187f, 0x0301),
  564. .driver_info = SMS1XXX_BOARD_SIANO_VENICE },
  565. { USB_DEVICE(0x187f, 0x0302),
  566. .driver_info = SMS1XXX_BOARD_SIANO_VENICE },
  567. { USB_DEVICE(0x187f, 0x0310),
  568. .driver_info = SMS1XXX_BOARD_SIANO_MING },
  569. { USB_DEVICE(0x187f, 0x0500),
  570. .driver_info = SMS1XXX_BOARD_SIANO_PELE },
  571. { USB_DEVICE(0x187f, 0x0600),
  572. .driver_info = SMS1XXX_BOARD_SIANO_RIO },
  573. { USB_DEVICE(0x187f, 0x0700),
  574. .driver_info = SMS1XXX_BOARD_SIANO_DENVER_2160 },
  575. { USB_DEVICE(0x187f, 0x0800),
  576. .driver_info = SMS1XXX_BOARD_SIANO_DENVER_1530 },
  577. { USB_DEVICE(0x19D2, 0x0086),
  578. .driver_info = SMS1XXX_BOARD_ZTE_DVB_DATA_CARD },
  579. { USB_DEVICE(0x19D2, 0x0078),
  580. .driver_info = SMS1XXX_BOARD_ONDA_MDTV_DATA_CARD },
  581. { USB_DEVICE(0x3275, 0x0080),
  582. .driver_info = SMS1XXX_BOARD_SIANO_RIO },
  583. { USB_DEVICE(0x2013, 0x0257),
  584. .driver_info = SMS1XXX_BOARD_PCTV_77E },
  585. { } /* Terminating entry */
  586. };
  587. MODULE_DEVICE_TABLE(usb, smsusb_id_table);
  588. static struct usb_driver smsusb_driver = {
  589. .name = "smsusb",
  590. .probe = smsusb_probe,
  591. .disconnect = smsusb_disconnect,
  592. .id_table = smsusb_id_table,
  593. .suspend = smsusb_suspend,
  594. .resume = smsusb_resume,
  595. };
  596. module_usb_driver(smsusb_driver);
  597. MODULE_DESCRIPTION("Driver for the Siano SMS1xxx USB dongle");
  598. MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris@siano-ms.com)");
  599. MODULE_LICENSE("GPL");