]> err.no Git - linux-2.6/blobdiff - drivers/usb/class/cdc-acm.h
Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[linux-2.6] / drivers / usb / class / cdc-acm.h
index fd2aaccdcbac7a4d04cc65f74743ea92541299fe..046e064b033af6675bb48208b277f9967130c243 100644 (file)
  * in line disciplines. They ask for empty space amount, receive our URB size,
  * and proceed to issue several 1-character writes, assuming they will fit.
  * The very first write takes a complete URB. Fortunately, this only happens
- * when processing onlcr, so we only need 2 buffers.
+ * when processing onlcr, so we only need 2 buffers. These values must be
+ * powers of 2.
  */
-#define ACM_NWB  2
-#define ACM_NRU  16
-#define ACM_NRB  16
+#define ACM_NW  16
+#define ACM_NR  16
 
 struct acm_wb {
        unsigned char *buf;
        dma_addr_t dmah;
        int len;
        int use;
+       struct urb              *urb;
+       struct acm              *instance;
 };
 
 struct acm_rb {
@@ -88,21 +90,25 @@ struct acm {
        struct usb_interface *control;                  /* control interface */
        struct usb_interface *data;                     /* data interface */
        struct tty_struct *tty;                         /* the corresponding tty */
-       struct urb *ctrlurb, *writeurb;                 /* urbs */
+       struct urb *ctrlurb;                    /* urbs */
        u8 *ctrl_buffer;                                /* buffers of urbs */
        dma_addr_t ctrl_dma;                            /* dma handles of buffers */
-       struct acm_wb wb[ACM_NWB];
-       struct acm_ru ru[ACM_NRU];
-       struct acm_rb rb[ACM_NRB];
+       u8 *country_codes;                              /* country codes from device */
+       unsigned int country_code_size;                 /* size of this buffer */
+       unsigned int country_rel_date;                  /* release date of version */
+       struct acm_wb wb[ACM_NW];
+       struct acm_ru ru[ACM_NR];
+       struct acm_rb rb[ACM_NR];
+       int rx_buflimit;
        int rx_endpoint;
        spinlock_t read_lock;
        struct list_head spare_read_urbs;
        struct list_head spare_read_bufs;
        struct list_head filled_read_bufs;
-       int write_current;                              /* current write buffer */
        int write_used;                                 /* number of non-empty write buffers */
        int write_ready;                                /* write urb is not running */
        spinlock_t write_lock;
+       struct mutex mutex;
        struct usb_cdc_line_coding line;                /* bits, stop, parity */
        struct work_struct work;                        /* work queue entry for line discipline waking up */
        struct tasklet_struct urb_task;                 /* rx processing */
@@ -116,9 +122,11 @@ struct acm {
        unsigned char throttle;                         /* throttled by tty layer */
        unsigned char clocal;                           /* termios CLOCAL */
        unsigned int ctrl_caps;                         /* control capabilities from the class specific header */
+       unsigned int susp_count;                        /* number of suspended interfaces */
 };
 
 #define CDC_DATA_INTERFACE_TYPE        0x0a
 
 /* constants describing various quirks and errors */
 #define NO_UNION_NORMAL                        1
+#define SINGLE_RX_URB                  2