Subversion Repositories Kolibri OS

Rev

Rev 1605 | 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
 
1605 serge 41
 
42
43
 
44
#define SKEL_ASYNC      9
45
46
 
47
 
1029 serge 48
{
49
    list_t  list;
1600 serge 50
1029 serge 51
 
52
53
 
54
    count_t frame_number;
55
    addr_t  frame_dma;
56
57
 
1605 serge 58
1029 serge 59
 
60
    addr_t  data_dma;
61
62
 
63
64
 
65
66
 
67
    PCITAG  PciTag;
68
    addr_t  ioBase[6];
69
    addr_t  memBase[6];
70
    size_t  memSize[6];
71
    u32_t   memType[6];
72
    u32_t   irq_line;
1605 serge 73
1613 serge 74
 
75
}hc_t;
1029 serge 76
77
 
78
{
79
	/* Hardware fields */
80
    addr_t   link;
81
    u32_t    status;
82
    u32_t    token;
83
    addr_t   buffer;
84
85
 
86
    addr_t   dma;
87
88
 
89
90
 
91
92
 
93
  //  struct list_head fl_list;
94
95
 
96
} td_t __attribute__((aligned(16)));
97
98
 
99
#define TD_CTRL_C_ERR_MASK	(3 << 27)	/* Error Counter bits */
100
#define TD_CTRL_C_ERR_SHIFT	27
101
#define TD_CTRL_LS          (1 << 26)   /* Low Speed Device */
102
#define TD_CTRL_IOS         (1 << 25)   /* Isochronous Select */
103
#define TD_CTRL_IOC         (1 << 24)   /* Interrupt on Complete */
104
#define TD_CTRL_ACTIVE		(1 << 23)	/* TD Active */
105
#define TD_CTRL_STALLED		(1 << 22)	/* TD Stalled */
106
#define TD_CTRL_DBUFERR		(1 << 21)	/* Data Buffer Error */
107
#define TD_CTRL_BABBLE		(1 << 20)	/* Babble Detected */
108
#define TD_CTRL_NAK         (1 << 19)   /* NAK Received */
109
#define TD_CTRL_CRCTIMEO	(1 << 18)	/* CRC/Time Out Error */
110
#define TD_CTRL_BITSTUFF    (1 << 17)   /* Bit Stuff Error */
111
112
 
113
                        TD_CTRL_BABBLE  | TD_CTRL_CRCTIMEO | \
114
                        TD_CTRL_BITSTUFF)
115
116
 
117
{
118
    u8_t    bLength;
119
    u8_t    bDescriptorType;
120
    u16_t   bcdUSB;
121
122
 
123
    u8_t    bDeviceSubClass;
124
    u8_t    bDeviceProtocol;
125
    u8_t    bMaxPacketSize0;
126
127
 
128
    u16_t   idProduct;
129
    u16_t   bcdDevice;
130
131
 
132
    u8_t    iProduct;
133
    u8_t    iSerialNumber;
134
    u8_t    bNumConfigurations;
135
}dev_descr_t;
136
137
 
138
{
139
    u8_t    bLength;
140
    u8_t    bDescriptorType;
141
    u16_t   wTotalLength;
142
    u8_t    bNumInterfaces;
143
    u8_t    bConfigurationValue;
144
    u8_t    iConfiguration;
145
    u8_t    bmAttributes;
146
    u8_t    bMaxPower;
147
}conf_descr_t;
148
149
 
150
{
151
    u8_t    bLength;
152
    u8_t    bDescriptorType;
153
    u8_t    bInterfaceNumber;
154
    u8_t    bAlternateSetting;
155
    u8_t    bNumEndpoints;
156
    u8_t    bInterfaceClass;
157
    u8_t    bInterfaceSubClass;
158
    u8_t    bInterfaceProtocol;
159
    u8_t    iInterface;
160
}interface_descr_t ;
161
162
 
163
{
164
    u8_t    bLength;
165
    u8_t    bDescriptorType;
166
167
 
168
    u8_t    bmAttributes;
169
    u16_t   wMaxPacketSize;
170
    u8_t    bInterval;
171
172
 
173
	/* use USB_DT_ENDPOINT*_SIZE in bLength, not sizeof. */
174
    u8_t    bRefresh;
175
    u8_t    bSynchAddress;
176
}endpoint_descr_t;
177
178
 
179
{
180
    addr_t  address;
181
    addr_t  size;
182
    u32_t   toggle;
183
184
 
185
186
 
187
{
188
    u8_t    bRequestType;
189
    u8_t    bRequest;
190
    u16_t   wValue;
191
    u16_t   wIndex;
192
    u16_t   wLength;
193
}ctrl_request_t;
194
195
 
196
 
197
{
198
    list_t  list;
1600 serge 199
    u32_t   id;
1029 serge 200
201
 
202
203
 
204
    addr_t  addr;
205
206
 
207
208
 
209
210
 
211
    int     port;
212
213
 
214
    conf_descr_t  *conf;
215
}udev_t;
216
217
 
218
{
219
    list_t        list;
1600 serge 220
    td_t         *td_head;
1029 serge 221
    td_t         *td_tail;
222
    addr_t        data;
223
    size_t        size;
224
    udev_t       *dev;
225
    u32_t         type;
226
    int           qnum;
1605 serge 227
    evhandle_t    evh;
1613 serge 228
    kevent_t      event;
229
    bool        (*handler)(udev_t *dev, struct   tag_request *rq);
1600 serge 230
}request_t;
1029 serge 231
232
 
233
 
234
235
 
236
         ( (((size)-1)<<21)|(toggle)|(((ep)&0xF)<<15)|((addr)<<8)|(pid))
237
238
 
1600 serge 239
240
 
241
                  void *data, size_t req_size);
1029 serge 242
243
 
1600 serge 244
1029 serge 245
 
1600 serge 246
1029 serge 247
 
1600 serge 248
1029 serge 249
 
250
{
251
    u8_t  buttons;
1600 serge 252
    char  x;
253
    char  y;
254
    char  z;
255
}__attribute__ ((packed));
1029 serge 256
257
 
258
#define DIN    0x69
259
260
 
261
#define DATA1  (1<<19)
262
263
 
1605 serge 264
 
265
 
266
{
267
    asm("bsf %1,%0"
268
        :"=r" (val)
269
        :"rm" (val));
270
    return val;
271
}
272
273