Subversion Repositories Kolibri OS

Rev

Rev 1029 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1029 serge 1
 
1600 serge 2
1029 serge 3
 
1600 serge 4
 
1029 serge 5
  int     available;          /**< Count of available items in this slab. */
6
  void   *start;              /**< Start address of first item. */
7
  addr_t  nextavail;          /**< The index of next available item. */
8
  addr_t  dma;
9
} slab_t;
10
11
 
12
 
13
#define USB_CLASS_COMM                     2
14
#define USB_CLASS_HID                      3
15
#define USB_CLASS_PHYSICAL                 5
16
#define USB_CLASS_STILL_IMAGE              6
17
#define USB_CLASS_PRINTER                  7
18
#define USB_CLASS_MASS_STORAGE             8
19
#define USB_CLASS_HUB                      9
20
#define USB_CLASS_CDC_DATA              0x0a
21
#define USB_CLASS_CSCID                 0x0b    /* chip+ smart card */
22
#define USB_CLASS_CONTENT_SEC           0x0d    /* content security */
23
#define USB_CLASS_VIDEO                 0x0e
24
#define USB_CLASS_WIRELESS_CONTROLLER	0xe0
25
#define USB_CLASS_MISC                  0xef
26
#define USB_CLASS_APP_SPEC              0xfe
27
#define USB_CLASS_VENDOR_SPEC           0xff
28
29
 
30
 
31
{
32
    addr_t  qlink;
33
    addr_t  qelem;
34
35
 
36
    u32_t   r1;
37
38
 
39
40
 
41
{
42
    list_t  list;
1600 serge 43
1029 serge 44
 
45
46
 
47
    count_t frame_number;
48
    addr_t  frame_dma;
49
50
 
51
52
 
53
    addr_t  data_dma;
54
55
 
56
57
 
58
59
 
60
    PCITAG  PciTag;
61
    addr_t  ioBase[6];
62
    addr_t  memBase[6];
63
    size_t  memSize[6];
64
    u32_t   memType[6];
65
}hc_t;
66
67
 
68
{
69
	/* Hardware fields */
70
    addr_t   link;
71
    u32_t    status;
72
    u32_t    token;
73
    addr_t   buffer;
74
75
 
76
    addr_t   dma;
77
78
 
79
80
 
81
82
 
83
  //  struct list_head fl_list;
84
85
 
86
} td_t __attribute__((aligned(16)));
87
88
 
89
#define TD_CTRL_C_ERR_MASK	(3 << 27)	/* Error Counter bits */
90
#define TD_CTRL_C_ERR_SHIFT	27
91
#define TD_CTRL_LS          (1 << 26)   /* Low Speed Device */
92
#define TD_CTRL_IOS         (1 << 25)   /* Isochronous Select */
93
#define TD_CTRL_IOC         (1 << 24)   /* Interrupt on Complete */
94
#define TD_CTRL_ACTIVE		(1 << 23)	/* TD Active */
95
#define TD_CTRL_STALLED		(1 << 22)	/* TD Stalled */
96
#define TD_CTRL_DBUFERR		(1 << 21)	/* Data Buffer Error */
97
#define TD_CTRL_BABBLE		(1 << 20)	/* Babble Detected */
98
#define TD_CTRL_NAK         (1 << 19)   /* NAK Received */
99
#define TD_CTRL_CRCTIMEO	(1 << 18)	/* CRC/Time Out Error */
100
#define TD_CTRL_BITSTUFF    (1 << 17)   /* Bit Stuff Error */
101
102
 
103
                        TD_CTRL_BABBLE  | TD_CTRL_CRCTIMEO | \
104
                        TD_CTRL_BITSTUFF)
105
106
 
107
{
108
    u8_t    bLength;
109
    u8_t    bDescriptorType;
110
    u16_t   bcdUSB;
111
112
 
113
    u8_t    bDeviceSubClass;
114
    u8_t    bDeviceProtocol;
115
    u8_t    bMaxPacketSize0;
116
117
 
118
    u16_t   idProduct;
119
    u16_t   bcdDevice;
120
121
 
122
    u8_t    iProduct;
123
    u8_t    iSerialNumber;
124
    u8_t    bNumConfigurations;
125
}dev_descr_t;
126
127
 
128
{
129
    u8_t    bLength;
130
    u8_t    bDescriptorType;
131
    u16_t   wTotalLength;
132
    u8_t    bNumInterfaces;
133
    u8_t    bConfigurationValue;
134
    u8_t    iConfiguration;
135
    u8_t    bmAttributes;
136
    u8_t    bMaxPower;
137
}conf_descr_t;
138
139
 
140
{
141
    u8_t    bLength;
142
    u8_t    bDescriptorType;
143
    u8_t    bInterfaceNumber;
144
    u8_t    bAlternateSetting;
145
    u8_t    bNumEndpoints;
146
    u8_t    bInterfaceClass;
147
    u8_t    bInterfaceSubClass;
148
    u8_t    bInterfaceProtocol;
149
    u8_t    iInterface;
150
}interface_descr_t ;
151
152
 
153
{
154
    u8_t    bLength;
155
    u8_t    bDescriptorType;
156
157
 
158
    u8_t    bmAttributes;
159
    u16_t   wMaxPacketSize;
160
    u8_t    bInterval;
161
162
 
163
	/* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
164
    u8_t    bRefresh;
165
    u8_t    bSynchAddress;
166
}endpoint_descr_t;
167
168
 
169
{
170
    addr_t  address;
171
    addr_t  size;
172
    u32_t   toggle;
173
174
 
175
176
 
177
{
178
    u8_t    bRequestType;
179
    u8_t    bRequest;
180
    u16_t   wValue;
181
    u16_t   wIndex;
182
    u16_t   wLength;
183
}ctrl_request_t;
184
185
 
186
 
187
{
188
    list_t  list;
1600 serge 189
    u32_t   id;
1029 serge 190
191
 
192
193
 
194
    addr_t  addr;
195
196
 
197
198
 
199
200
 
201
    int     port;
202
203
 
204
    conf_descr_t  *conf;
205
}udev_t;
206
207
 
208
{
209
    list_t        list;
1600 serge 210
    td_t         *td_head;
1029 serge 211
    td_t         *td_tail;
212
    addr_t        data;
213
    size_t        size;
214
    udev_t       *dev;
215
    u32_t         type;
216
    bool        (*handler)(udev_t *dev, struct   tag_request *rq);
1600 serge 217
}request_t;
1029 serge 218
219
 
220
 
221
222
 
223
         ( (((size)-1)<<21)|(toggle)|(((ep)&0xF)<<15)|((addr)<<8)|(pid))
224
225
 
1600 serge 226
227
 
228
                  void *data, size_t req_size);
1029 serge 229
230
 
1600 serge 231
1029 serge 232
 
1600 serge 233
1029 serge 234
 
1600 serge 235
1029 serge 236
 
237
{
238
    u8_t  buttons;
1600 serge 239
    char  x;
240
    char  y;
241
    char  z;
242
}__attribute__ ((packed));
1029 serge 243
244
 
245
#define DIN    0x69
246
247
 
248
#define DATA1  (1<<19)
249
#define>
250