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