]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/isdn/hisax/hfc_usb.c
Merge branch 'master'
[linux-2.6-omap-h63xx.git] / drivers / isdn / hisax / hfc_usb.c
index 32bf0d5d0f9a0d0692414c683a6547c3050be5e9..262c4412741904bb5dd16ac1252966474ada9a1d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * hfc_usb.c
  *
- * $Id: hfc_usb.c,v 4.36 2005/04/08 09:55:13 martinb1 Exp $
+ * $Id: hfc_usb.c,v 2.3.2.13 2006/02/17 17:17:22 mbachem Exp $
  *
  * modular HiSax ISDN driver for Colognechip HFC-S USB chip
  *
@@ -45,7 +45,7 @@
 #include "hfc_usb.h"
 
 static const char *hfcusb_revision =
-    "$Revision: 4.36 $ $Date: 2005/04/08 09:55:13 $ ";
+    "$Revision: 2.3.2.13 $ $Date: 2006/02/17 17:17:22 $ ";
 
 /* Hisax debug support
 * use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG
@@ -71,78 +71,68 @@ typedef struct {
 /****************************************/
 static struct usb_device_id hfcusb_idtab[] = {
        {
-        .idVendor = 0x0959,
-        .idProduct = 0x2bd0,
+        USB_DEVICE(0x0959, 0x2bd0),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_OFF, {4, 0, 2, 1},
                           "ISDN USB TA (Cologne Chip HFC-S USB based)"}),
        },
        {
-        .idVendor = 0x0675,
-        .idProduct = 0x1688,
+        USB_DEVICE(0x0675, 0x1688),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {1, 2, 0, 0},
                           "DrayTek miniVigor 128 USB ISDN TA"}),
        },
        {
-        .idVendor = 0x07b0,
-        .idProduct = 0x0007,
+        USB_DEVICE(0x07b0, 0x0007),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {0x80, -64, -32, -16},
                           "Billion tiny USB ISDN TA 128"}),
        },
        {
-        .idVendor = 0x0742,
-        .idProduct = 0x2008,
+        USB_DEVICE(0x0742, 0x2008),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {4, 0, 2, 1},
                           "Stollmann USB TA"}),
         },
        {
-        .idVendor = 0x0742,
-        .idProduct = 0x2009,
+        USB_DEVICE(0x0742, 0x2009),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {4, 0, 2, 1},
                           "Aceex USB ISDN TA"}),
         },
        {
-        .idVendor = 0x0742,
-        .idProduct = 0x200A,
+        USB_DEVICE(0x0742, 0x200A),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {4, 0, 2, 1},
                           "OEM USB ISDN TA"}),
         },
        {
-        .idVendor = 0x08e3,
-        .idProduct = 0x0301,
+        USB_DEVICE(0x08e3, 0x0301),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {2, 0, 1, 4},
                           "Olitec USB RNIS"}),
         },
        {
-        .idVendor = 0x07fa,
-        .idProduct = 0x0846,
+        USB_DEVICE(0x07fa, 0x0846),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {0x80, -64, -32, -16},
                           "Bewan Modem RNIS USB"}),
         },
        {
-        .idVendor = 0x07fa,
-        .idProduct = 0x0847,
+        USB_DEVICE(0x07fa, 0x0847),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {0x80, -64, -32, -16},
                           "Djinn Numeris USB"}),
         },
        {
-        .idVendor = 0x07b0,
-        .idProduct = 0x0006,
+        USB_DEVICE(0x07b0, 0x0006),
         .driver_info = (unsigned long) &((hfcsusb_vdata)
                          {LED_SCHEME1, {0x80, -64, -32, -16},
                           "Twister ISDN TA"}),
         },
+       { }
 };
 
-
 /***************************************************************/
 /* structure defining input+output fifos (interrupt/bulk mode) */
 /***************************************************************/
@@ -229,7 +219,7 @@ symbolic(struct hfcusb_symbolic_list list[], const int num)
        for (i = 0; list[i].name != NULL; i++)
                if (list[i].num == num)
                        return (list[i].name);
-       return "<unkown ERROR>";
+       return "<unknown ERROR>";
 }
 
 
@@ -245,9 +235,9 @@ ctrl_start_transfer(hfcusb_data * hfc)
                hfc->ctrl_urb->transfer_buffer = NULL;
                hfc->ctrl_urb->transfer_buffer_length = 0;
                hfc->ctrl_write.wIndex =
-                   hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg;
+                   cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg);
                hfc->ctrl_write.wValue =
-                   hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val;
+                   cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val);
 
                usb_submit_urb(hfc->ctrl_urb, GFP_ATOMIC);      /* start transfer */
        }
@@ -1292,7 +1282,7 @@ usb_init(hfcusb_data * hfc)
        /* init the background machinery for control requests */
        hfc->ctrl_read.bRequestType = 0xc0;
        hfc->ctrl_read.bRequest = 1;
-       hfc->ctrl_read.wLength = 1;
+       hfc->ctrl_read.wLength = cpu_to_le16(1);
        hfc->ctrl_write.bRequestType = 0x40;
        hfc->ctrl_write.bRequest = 0;
        hfc->ctrl_write.wLength = 0;
@@ -1383,9 +1373,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
 
        vend_idx = 0xffff;
        for (i = 0; hfcusb_idtab[i].idVendor; i++) {
-               if (dev->descriptor.idVendor == hfcusb_idtab[i].idVendor
-                   && dev->descriptor.idProduct ==
-                   hfcusb_idtab[i].idProduct) {
+               if ((le16_to_cpu(dev->descriptor.idVendor) == hfcusb_idtab[i].idVendor)
+                   && (le16_to_cpu(dev->descriptor.idProduct) == hfcusb_idtab[i].idProduct)) {
                        vend_idx = i;
                        continue;
                }
@@ -1526,8 +1515,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                                                            usb_transfer_mode
                                                            = USB_INT;
                                                        packet_size =
-                                                           ep->desc.
-                                                           wMaxPacketSize;
+                                                           le16_to_cpu(ep->desc.wMaxPacketSize);
                                                        break;
                                                case USB_ENDPOINT_XFER_BULK:
                                                        if (ep_addr & 0x80)
@@ -1555,8 +1543,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                                                            usb_transfer_mode
                                                            = USB_BULK;
                                                        packet_size =
-                                                           ep->desc.
-                                                           wMaxPacketSize;
+                                                           le16_to_cpu(ep->desc.wMaxPacketSize);
                                                        break;
                                                case USB_ENDPOINT_XFER_ISOC:
                                                        if (ep_addr & 0x80)
@@ -1584,8 +1571,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                                                            usb_transfer_mode
                                                            = USB_ISOC;
                                                        iso_packet_size =
-                                                           ep->desc.
-                                                           wMaxPacketSize;
+                                                           le16_to_cpu(ep->desc.wMaxPacketSize);
                                                        break;
                                                default:
                                                        context->
@@ -1598,10 +1584,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
                                                    fifonum = cidx;
                                                context->fifos[cidx].hfc =
                                                    context;
-                                               context->fifos[cidx].
-                                                   usb_packet_maxlen =
-                                                   ep->desc.
-                                                   wMaxPacketSize;
+                                               context->fifos[cidx].usb_packet_maxlen =
+                                                   le16_to_cpu(ep->desc.wMaxPacketSize);
                                                context->fifos[cidx].
                                                    intervall =
                                                    ep->desc.bInterval;
@@ -1725,7 +1709,6 @@ hfc_usb_disconnect(struct usb_interface
 /* our driver information structure */
 /************************************/
 static struct usb_driver hfc_drv = {
-       .owner = THIS_MODULE,
        .name  = "hfc_usb",
        .id_table = hfcusb_idtab,
        .probe = hfc_usb_probe,