~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to drivers/usb/class/cdc-acm.h

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
 */
53
53
 
54
54
/*
55
 
 * The only reason to have several buffers is to accomodate assumptions
 
55
 * The only reason to have several buffers is to accommodate assumptions
56
56
 * in line disciplines. They ask for empty space amount, receive our URB size,
57
57
 * and proceed to issue several 1-character writes, assuming they will fit.
58
58
 * The very first write takes a complete URB. Fortunately, this only happens
72
72
};
73
73
 
74
74
struct acm_rb {
75
 
        struct list_head        list;
76
75
        int                     size;
77
76
        unsigned char           *base;
78
77
        dma_addr_t              dma;
79
 
};
80
 
 
81
 
struct acm_ru {
82
 
        struct list_head        list;
83
 
        struct acm_rb           *buffer;
84
 
        struct urb              *urb;
 
78
        int                     index;
85
79
        struct acm              *instance;
86
80
};
87
81
 
97
91
        unsigned int country_code_size;                 /* size of this buffer */
98
92
        unsigned int country_rel_date;                  /* release date of version */
99
93
        struct acm_wb wb[ACM_NW];
100
 
        struct acm_ru ru[ACM_NR];
101
 
        struct acm_rb rb[ACM_NR];
 
94
        unsigned long read_urbs_free;
 
95
        struct urb *read_urbs[ACM_NR];
 
96
        struct acm_rb read_buffers[ACM_NR];
102
97
        int rx_buflimit;
103
98
        int rx_endpoint;
104
99
        spinlock_t read_lock;
105
 
        struct list_head spare_read_urbs;
106
 
        struct list_head spare_read_bufs;
107
 
        struct list_head filled_read_bufs;
108
100
        int write_used;                                 /* number of non-empty write buffers */
109
 
        int processing;
110
101
        int transmitting;
111
102
        spinlock_t write_lock;
112
103
        struct mutex mutex;
113
104
        struct usb_cdc_line_coding line;                /* bits, stop, parity */
114
105
        struct work_struct work;                        /* work queue entry for line discipline waking up */
115
 
        wait_queue_head_t drain_wait;                   /* close processing */
116
 
        struct tasklet_struct urb_task;                 /* rx processing */
117
 
        spinlock_t throttle_lock;                       /* synchronize throtteling and read callback */
118
106
        unsigned int ctrlin;                            /* input control lines (DCD, DSR, RI, break, overruns) */
119
107
        unsigned int ctrlout;                           /* output control lines (DTR, RTS) */
120
108
        unsigned int writesize;                         /* max packet size for the output bulk endpoint */
121
109
        unsigned int readsize,ctrlsize;                 /* buffer sizes for freeing */
122
110
        unsigned int minor;                             /* acm minor number */
123
 
        unsigned char throttle;                         /* throttled by tty layer */
124
111
        unsigned char clocal;                           /* termios CLOCAL */
125
112
        unsigned int ctrl_caps;                         /* control capabilities from the class specific header */
126
113
        unsigned int susp_count;                        /* number of suspended interfaces */
127
114
        unsigned int combined_interfaces:1;             /* control and data collapsed */
128
115
        unsigned int is_int_ep:1;                       /* interrupt endpoints contrary to spec used */
 
116
        unsigned int throttled:1;                       /* actually throttled */
 
117
        unsigned int throttle_req:1;                    /* throttle requested */
129
118
        u8 bInterval;
130
119
        struct acm_wb *delayed_wb;                      /* write queued for a device about to be woken */
131
120
};
137
126
#define SINGLE_RX_URB                   2
138
127
#define NO_CAP_LINE                     4
139
128
#define NOT_A_MODEM                     8
 
129
#define NO_DATA_INTERFACE               16