13,6 → 13,7 |
|
include '../proc32.inc' |
include '../imports.inc' |
include 'urb.inc' |
|
struc UHCI |
{ |
371,6 → 372,42 |
ret |
endp |
|
|
align 4 |
proc usb_get_descriptor stdcall, dev:dword, type:dword, index:dword,\ |
buf:dword, size:dword |
|
locals |
count dd ? |
endl |
|
mov esi, [buf] |
mov ecx, [size] |
xor eax, eax |
cld |
rep stosb |
|
mov [count], 3 |
@@: |
mov eax, [type] |
shl eax, 8 |
add eax, [index] |
stdcall usb_control_msg, [dev],pipe,USB_REQ_GET_DESCRIPTOR,\ |
USB_DIR_IN, eax,0,[buf], [size],\ |
USB_CTRL_GET_TIMEOUT |
test eax, eax |
jz .next |
cmp eax, -1 |
je .next |
jmp. ok |
.next: |
dec [count] |
jnz @B |
mov eax, -1 |
.ok: |
ret |
endp |
|
DEVICE_ID equ 0x24D2 ; pci device id |
VENDOR_ID equ 0x8086 ; device vendor id |
QEMU_USB equ 0x7020 |