]> err.no Git - linux-2.6/blobdiff - drivers/usb/serial/keyspan.h
keyspan: use request_firmware()
[linux-2.6] / drivers / usb / serial / keyspan.h
index 6413d73c139cb39a0beb209aebe12e33e964ee2d..b52fb657a24410887e7925c874c36b48c3c3c771 100644 (file)
@@ -99,89 +99,9 @@ static int  keyspan_usa90_send_setup (struct usb_serial *serial,
                                         struct usb_serial_port *port,
                                         int reset_port);
 
-/* Struct used for firmware - increased size of data section
-   to allow Keyspan's 'C' firmware struct to be used unmodified */
-struct ezusb_hex_record {
-       __u16 address;
-       __u8 data_size;
-       __u8 data[64];
-};
-
-/* Conditionally include firmware images, if they aren't
-   included create a null pointer instead.  Current 
-   firmware images aren't optimised to remove duplicate
-   addresses in the image itself. */
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28
-       #include "keyspan_usa28_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa28_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28X
-       #include "keyspan_usa28x_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa28x_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28XA
-       #include "keyspan_usa28xa_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa28xa_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA28XB
-       #include "keyspan_usa28xb_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa28xb_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19
-       #include "keyspan_usa19_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa19_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QI
-       #include "keyspan_usa19qi_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa19qi_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_MPR
-        #include "keyspan_mpr_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_mpr_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19QW
-       #include "keyspan_usa19qw_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa19qw_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA18X
-       #include "keyspan_usa18x_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa18x_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA19W
-       #include "keyspan_usa19w_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa19w_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA49W
-       #include "keyspan_usa49w_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa49w_firmware = NULL;
-#endif
-
-#ifdef CONFIG_USB_SERIAL_KEYSPAN_USA49WLC
-        #include "keyspan_usa49wlc_fw.h"
-#else
-       static const struct ezusb_hex_record *keyspan_usa49wlc_firmware = NULL;
-#endif
+static int  keyspan_usa67_send_setup   (struct usb_serial *serial,
+                                        struct usb_serial_port *port,
+                                        int reset_port);
 
 /* Values used for baud rate calculation - device specific */
 #define        KEYSPAN_INVALID_BAUD_RATE               (-1)
@@ -230,15 +150,16 @@ struct ezusb_hex_record {
 #define        keyspan_usa28x_product_id               0x0110
 #define        keyspan_usa28xa_product_id              0x0115
 #define        keyspan_usa28xb_product_id              0x0110
+#define        keyspan_usa28xg_product_id              0x0135
 #define        keyspan_usa49w_product_id               0x010a
 #define        keyspan_usa49wlc_product_id             0x012a
-
+#define        keyspan_usa49wg_product_id              0x0131
 
 struct keyspan_device_details {
        /* product ID value */
        int     product_id;
 
-       enum    {msg_usa26, msg_usa28, msg_usa49, msg_usa90} msg_format;
+       enum    {msg_usa26, msg_usa28, msg_usa49, msg_usa90, msg_usa67} msg_format;
 
                /* Number of physical ports */
        int     num_ports;
@@ -265,6 +186,9 @@ struct keyspan_device_details {
                /* Endpoint used for input status */
        int     instat_endpoint;
 
+               /* Endpoint used for input data 49WG only */
+       int     indat_endpoint;
+
                /* Endpoint used for global control functions */
        int     glocont_endpoint;
 
@@ -288,6 +212,7 @@ static const struct keyspan_device_details usa18x_device_details = {
        .inack_endpoints        = {0x85},
        .outcont_endpoints      = {0x05},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa19w_calc_baud,
        .baudclk                = KEYSPAN_USA18X_BAUDCLK,
@@ -304,6 +229,7 @@ static const struct keyspan_device_details usa19_device_details = {
        .inack_endpoints        = {0x83},
        .outcont_endpoints      = {0x03},
        .instat_endpoint        = 0x84,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = -1,
        .calculate_baud_rate    = keyspan_usa19_calc_baud,
        .baudclk                = KEYSPAN_USA19_BAUDCLK,
@@ -320,6 +246,7 @@ static const struct keyspan_device_details usa19qi_device_details = {
        .inack_endpoints        = {0x83},
        .outcont_endpoints      = {0x03},
        .instat_endpoint        = 0x84,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = -1,
        .calculate_baud_rate    = keyspan_usa28_calc_baud,
        .baudclk                = KEYSPAN_USA19_BAUDCLK,
@@ -336,6 +263,7 @@ static const struct keyspan_device_details mpr_device_details = {
        .inack_endpoints        = {0x83},
        .outcont_endpoints      = {0x03},
        .instat_endpoint        = 0x84,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = -1,
        .calculate_baud_rate    = keyspan_usa28_calc_baud,
        .baudclk                = KEYSPAN_USA19_BAUDCLK,
@@ -352,6 +280,7 @@ static const struct keyspan_device_details usa19qw_device_details = {
        .inack_endpoints        = {0x85},
        .outcont_endpoints      = {0x05},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa19w_calc_baud,
        .baudclk                = KEYSPAN_USA19W_BAUDCLK,
@@ -368,6 +297,7 @@ static const struct keyspan_device_details usa19w_device_details = {
        .inack_endpoints        = {0x85},
        .outcont_endpoints      = {0x05},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa19w_calc_baud,
        .baudclk                = KEYSPAN_USA19W_BAUDCLK,
@@ -384,6 +314,7 @@ static const struct keyspan_device_details usa19hs_device_details = {
        .inack_endpoints        = {-1},
        .outcont_endpoints      = {0x02},
        .instat_endpoint        = 0x82,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = -1,
        .calculate_baud_rate    = keyspan_usa19hs_calc_baud,
        .baudclk                = KEYSPAN_USA19HS_BAUDCLK,
@@ -400,6 +331,7 @@ static const struct keyspan_device_details usa28_device_details = {
        .inack_endpoints        = {0x85, 0x86},
        .outcont_endpoints      = {0x05, 0x06},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa28_calc_baud,
        .baudclk                = KEYSPAN_USA28_BAUDCLK,                
@@ -416,6 +348,7 @@ static const struct keyspan_device_details usa28x_device_details = {
        .inack_endpoints        = {0x85, 0x86},
        .outcont_endpoints      = {0x05, 0x06},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa19w_calc_baud,
        .baudclk                = KEYSPAN_USA28X_BAUDCLK,
@@ -432,11 +365,28 @@ static const struct keyspan_device_details usa28xa_device_details = {
        .inack_endpoints        = {0x85, 0x86},
        .outcont_endpoints      = {0x05, 0x06},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa19w_calc_baud,
        .baudclk                = KEYSPAN_USA28X_BAUDCLK,
 };
 
+static const struct keyspan_device_details usa28xg_device_details = {
+       .product_id             = keyspan_usa28xg_product_id,
+       .msg_format             = msg_usa67,
+       .num_ports              = 2,
+       .indat_endp_flip        = 0,
+       .outdat_endp_flip       = 0,
+       .indat_endpoints        = {0x84, 0x88},
+       .outdat_endpoints       = {0x02, 0x06},
+       .inack_endpoints        = {-1, -1},
+       .outcont_endpoints      = {-1, -1},
+       .instat_endpoint        = 0x81,
+       .indat_endpoint         = -1,
+       .glocont_endpoint       = 0x01,
+       .calculate_baud_rate    = keyspan_usa19w_calc_baud,
+       .baudclk                = KEYSPAN_USA28X_BAUDCLK,
+};
 /* We don't need a separate entry for the usa28xb as it appears as a 28x anyway */
 
 static const struct keyspan_device_details usa49w_device_details = {
@@ -450,6 +400,7 @@ static const struct keyspan_device_details usa49w_device_details = {
        .inack_endpoints        = {-1, -1, -1, -1},
        .outcont_endpoints      = {-1, -1, -1, -1},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa19w_calc_baud,
        .baudclk                = KEYSPAN_USA49W_BAUDCLK,
@@ -466,11 +417,29 @@ static const struct keyspan_device_details usa49wlc_device_details = {
        .inack_endpoints        = {-1, -1, -1, -1},
        .outcont_endpoints      = {-1, -1, -1, -1},
        .instat_endpoint        = 0x87,
+       .indat_endpoint         = -1,
        .glocont_endpoint       = 0x07,
        .calculate_baud_rate    = keyspan_usa19w_calc_baud,
        .baudclk                = KEYSPAN_USA19W_BAUDCLK,
 };
 
+static const struct keyspan_device_details usa49wg_device_details = {
+       .product_id             = keyspan_usa49wg_product_id,
+       .msg_format             = msg_usa49,
+       .num_ports              = 4,
+       .indat_endp_flip        = 0,
+       .outdat_endp_flip       = 0,
+       .indat_endpoints        = {-1, -1, -1, -1},             /* single 'global' data in EP */
+       .outdat_endpoints       = {0x01, 0x02, 0x04, 0x06},
+       .inack_endpoints        = {-1, -1, -1, -1},
+       .outcont_endpoints      = {-1, -1, -1, -1},
+       .instat_endpoint        = 0x81,
+       .indat_endpoint         = 0x88,
+       .glocont_endpoint       = 0x00,                         /* uses control EP */
+       .calculate_baud_rate    = keyspan_usa19w_calc_baud,
+       .baudclk                = KEYSPAN_USA19W_BAUDCLK,
+};
+
 static const struct keyspan_device_details *keyspan_devices[] = {
        &usa18x_device_details,
        &usa19_device_details,
@@ -482,9 +451,11 @@ static const struct keyspan_device_details *keyspan_devices[] = {
        &usa28_device_details,
        &usa28x_device_details,
        &usa28xa_device_details,
+       &usa28xg_device_details,
        /* 28xb not required as it renumerates as a 28x */
        &usa49w_device_details,
        &usa49wlc_device_details,
+       &usa49wg_device_details,
        NULL,
 };
 
@@ -512,8 +483,10 @@ static struct usb_device_id keyspan_ids_combined[] = {
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) },
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) },
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_product_id) },
+       { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) },
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id)},
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)},
+       { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)},
        { } /* Terminating entry */
 };
 
@@ -560,12 +533,14 @@ static struct usb_device_id keyspan_2port_ids[] = {
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28x_product_id) },
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xa_product_id) },
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xb_product_id) },
+       { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa28xg_product_id) },
        { } /* Terminating entry */
 };
 
 static struct usb_device_id keyspan_4port_ids[] = {
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49w_product_id) },
        { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wlc_product_id)},
+       { USB_DEVICE(KEYSPAN_VENDOR_ID, keyspan_usa49wg_product_id)},
        { } /* Terminating entry */
 };
 
@@ -577,9 +552,6 @@ static struct usb_serial_driver keyspan_pre_device = {
        },
        .description            = "Keyspan - (without firmware)",
        .id_table               = keyspan_pre_ids,
-       .num_interrupt_in       = NUM_DONT_CARE,
-       .num_bulk_in            = NUM_DONT_CARE,
-       .num_bulk_out           = NUM_DONT_CARE,
        .num_ports              = 1,
        .attach                 = keyspan_fake_startup,
 };
@@ -591,9 +563,6 @@ static struct usb_serial_driver keyspan_1port_device = {
        },
        .description            = "Keyspan 1 port adapter",
        .id_table               = keyspan_1port_ids,
-       .num_interrupt_in       = NUM_DONT_CARE,
-       .num_bulk_in            = NUM_DONT_CARE,
-       .num_bulk_out           = NUM_DONT_CARE,
        .num_ports              = 1,
        .open                   = keyspan_open,
        .close                  = keyspan_close,
@@ -618,9 +587,6 @@ static struct usb_serial_driver keyspan_2port_device = {
        },
        .description            = "Keyspan 2 port adapter",
        .id_table               = keyspan_2port_ids,
-       .num_interrupt_in       = NUM_DONT_CARE,
-       .num_bulk_in            = NUM_DONT_CARE,
-       .num_bulk_out           = NUM_DONT_CARE,
        .num_ports              = 2,
        .open                   = keyspan_open,
        .close                  = keyspan_close,
@@ -645,9 +611,6 @@ static struct usb_serial_driver keyspan_4port_device = {
        },
        .description            = "Keyspan 4 port adapter",
        .id_table               = keyspan_4port_ids,
-       .num_interrupt_in       = NUM_DONT_CARE,
-       .num_bulk_in            = 5,
-       .num_bulk_out           = 5,
        .num_ports              = 4,
        .open                   = keyspan_open,
        .close                  = keyspan_close,