Rev 3577 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3577 | Rev 3745 | ||
---|---|---|---|
Line 58... | Line 58... | ||
58 | Note that one device can implement many interfaces, so AddDevice may be |
58 | Note that one device can implement many interfaces, so AddDevice may be |
59 | called several times with the same 'configdescr' and different 'interfacedescr'. |
59 | called several times with the same 'configdescr' and different 'interfacedescr'. |
60 | The returned value NULL means that the initialization has failed. |
60 | The returned value NULL means that the initialization has failed. |
61 | Any other value means that configuration was successful; the kernel does not |
61 | Any other value means that configuration was successful; the kernel does not |
62 | try to interpret the value. It can be, for example, pointer to the internal |
62 | try to interpret the value. It can be, for example, pointer to the internal |
63 | data allocated with Kmalloc, or index in some internal table. Remember that |
63 | data allocated with Kmalloc, or index in some internal table. |
64 | Kmalloc() is NOT stdcall, it destroys ebx. |
- | |
Line 65... | Line 64... | ||
65 | 64 | ||
Line 66... | Line 65... | ||
66 | The driver can implement the function |
65 | The driver can implement the function |
67 | 66 | ||
Line 182... | Line 181... | ||
182 | USB_STATUS_PIDCHECK = 6 ; invalid PID check bits |
181 | USB_STATUS_PIDCHECK = 6 ; invalid PID check bits |
183 | USB_STATUS_WRONGPID = 7 ; unexpected PID value |
182 | USB_STATUS_WRONGPID = 7 ; unexpected PID value |
184 | USB_STATUS_OVERRUN = 8 ; too many data from endpoint |
183 | USB_STATUS_OVERRUN = 8 ; too many data from endpoint |
185 | USB_STATUS_UNDERRUN = 9 ; too few data from endpoint |
184 | USB_STATUS_UNDERRUN = 9 ; too few data from endpoint |
186 | USB_STATUS_BUFOVERRUN = 12 ; overflow of internal controller buffer |
185 | USB_STATUS_BUFOVERRUN = 12 ; overflow of internal controller buffer |
187 | ; possible only for isochronous transfers |
- | |
188 | USB_STATUS_BUFUNDERRUN = 13 ; underflow of internal controller buffer |
186 | USB_STATUS_BUFUNDERRUN = 13 ; underflow of internal controller buffer |
189 | ; possible only for isochronous transfers |
- | |
190 | USB_STATUS_CLOSED = 16 ; pipe closed, either explicitly with USBClosePipe |
187 | USB_STATUS_CLOSED = 16 ; pipe closed, either explicitly with USBClosePipe |
191 | ; or due to device disconnect |
188 | ; or due to device disconnect |
Line 192... | Line 189... | ||
192 | 189 | ||
193 | If several transfers are queued for the same pipe, their callback functions |
190 | If several transfers are queued for the same pipe, their callback functions |
194 | are called in the same order as they were queued. |
191 | are called in the same order as they were queued. |
195 | When a pipe is closed, either explicitly with USBClosePipe, or |
192 | When a pipe is closed, either explicitly with USBClosePipe, or |
196 | implicitly due to device disconnect, all callback functions are called |
193 | implicitly due to device disconnect, all callback functions are called |
197 | with USB_STATUS_CLOSED. The call to DeviceDisconnected() occurs after |
194 | with USB_STATUS_CLOSED. The call to DeviceDisconnected() occurs after |
- | 195 | all callbacks. |
|
- | 196 | ||
- | 197 | void* __stdcall USBGetParam(void* pipe0, int param); |
|
- | 198 | Returns miscellaneous parameters of the device. |
|
- | 199 | pipe0 is the pointer to the config pipe. |
|
- | 200 | param = 0: return pointer to device descriptor |
|
- | 201 | param = 1: return pointer to config descriptor, same as passed to AddDevice |
|
- | 202 | param = 2: return speed at which the device is operating, one of |
|
- | 203 | USB_SPEED_FS = 0 ; full-speed |
|
- | 204 | USB_SPEED_LS = 1 ; low-speed |