12,7 → 12,7 |
;; ;; |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
|
format PE DLL native 0.05 |
format MS COFF |
|
DEBUG = 1 |
|
23,10 → 23,13 |
node.next equ ftdi_context.next_context |
|
include '../../proc32.inc' |
include '../../peimport.inc' |
include '../../imports.inc' |
include '../../fdo.inc' |
include '../../struct.inc' |
|
public START |
public version |
|
; USB constants |
DEVICE_DESCR_TYPE = 1 |
CONFIG_DESCR_TYPE = 2 |
175,14 → 178,14 |
wLength dw ? |
ends |
|
section '.flat' code readable executable |
section '.flat' code readable align 16 |
; The start procedure. |
proc START c, .reason:DWORD, .cmdline:DWORD |
proc START stdcall, .reason:DWORD |
|
xor eax, eax ; initialize return value |
cmp [.reason], 1 ; compare the argument |
jnz .nothing |
invoke RegUSBDriver, my_driver, service_proc, usb_functions |
stdcall RegUSBDriver, my_driver, service_proc, usb_functions |
|
.nothing: |
ret |
191,20 → 194,20 |
|
proc AddDevice stdcall uses ebx esi edi, .config_pipe:DWORD, .config_descr:DWORD, .interface:DWORD |
|
invoke USBGetParam, [.config_pipe], 0 |
stdcall USBGetParam, [.config_pipe], 0 |
mov edx, eax |
DEBUGF 2,'K : Detected device vendor: 0x%x\n', [eax+usb_descr.idVendor] |
DEBUGF 1,'K : Detected device vendor: %x\n', [eax+usb_descr.idVendor] |
cmp word[eax+usb_descr.idVendor], 0x0403 |
jnz .notftdi |
mov eax, sizeof.ftdi_context |
invoke Kmalloc |
call Kmalloc |
test eax, eax |
jnz @f |
mov esi, nomemory_msg |
invoke SysMsgBoardStr |
call SysMsgBoardStr |
jmp .nothing |
@@: |
DEBUGF 2,'K : Adding struct to list 0x%x\n', eax |
DEBUGF 1,'K : Adding struct to list %x\n', eax |
call linkedlist_add |
|
mov ebx, [.config_pipe] |
219,7 → 222,7 |
jmp .slow |
|
mov cx, [edx+usb_descr.bcdDevice] |
DEBUGF 2, 'K : Chip type 0x%x\n', ecx |
DEBUGF 1, 'K : Chip type %x\n', ecx |
cmp cx, 0x400 |
jnz @f |
mov [eax + ftdi_context.chipType], TYPE_BM |
259,13 → 262,11 |
add [eax + ftdi_context.maxPacketSize], 512-64 |
.slow: |
mov ebx, eax |
invoke USBOpenPipe, [.config_pipe], 0x81, \ |
[ebx + ftdi_context.maxPacketSize], BULK_PIPE, 0 |
stdcall USBOpenPipe, [.config_pipe], 0x81, [ebx + ftdi_context.maxPacketSize], BULK_PIPE, 0 |
test eax, eax |
jz .nothing |
mov [ebx + ftdi_context.outEP], eax |
invoke USBOpenPipe, [.config_pipe], 0x02, \ |
[ebx + ftdi_context.maxPacketSize], BULK_PIPE, 0 |
stdcall USBOpenPipe, [.config_pipe], 0x02, [ebx + ftdi_context.maxPacketSize], BULK_PIPE, 0 |
test eax, eax |
jz .nothing |
mov [ebx + ftdi_context.inEP], eax |
287,6 → 288,7 |
output equ IOCTL.output |
out_size equ IOCTL.out_size |
|
align 4 |
proc service_proc stdcall uses ebx esi edi, ioctl:DWORD |
locals |
ConfPacket rb 10 |
345,7 → 347,7 |
xor ecx, ecx |
.bulkevent: |
xor esi, esi |
invoke CreateEvent |
call CreateEvent |
mov [EventData], eax |
mov [EventData+4], edx |
pop edi eax |
407,12 → 409,12 |
test eax, eax |
jz @f |
mov eax, dword[ConfPacket] |
invoke Kfree |
call Kfree |
@@: |
;---Dirty hack end |
mov eax, [EventData] |
mov ebx, [EventData+4] |
invoke DestroyEvent |
call DestroyEvent |
jmp .endswitch |
|
.ftdi_out_control_transfer_withinp: |
426,16 → 428,15 |
mov word[ConfPacket+6], cx |
.own_index: |
mov ebx, [edi+4] |
DEBUGF 2,'K : ConfPacket 0x%x 0x%x\n', [ConfPacket], [ConfPacket+4] |
DEBUGF 1,'K : ConfPacket %x %x\n', [ConfPacket], [ConfPacket+4] |
lea esi, [ConfPacket] |
lea edi, [EventData] |
invoke USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, 0,\ |
0, control_callback, edi, 0 |
stdcall USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, 0, 0, control_callback, edi, 0 |
test eax, eax |
jz .error |
mov eax, [EventData] |
mov ebx, [EventData+4] |
invoke WaitEvent |
call WaitEvent |
mov eax, [EventData+8] |
test eax, eax |
jz .endswitch |
442,101 → 443,60 |
jmp .error |
|
.ftdi_setrtshigh: |
DEBUGF 2,'K : FTDI Setting RTS pin HIGH PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_MODEM_CTRL_REQUEST shl 8) \ |
+ (SIO_SET_RTS_HIGH shl 16) |
;DEBUGF 1,'K : FTDI Setting RTS pin HIGH\n' |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_MODEM_CTRL_REQUEST shl 8) + (SIO_SET_RTS_HIGH shl 16) |
jmp .ftdi_out_control_transfer_noinp |
|
.ftdi_setrtslow: |
DEBUGF 2,'K : FTDI Setting RTS pin LOW PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_MODEM_CTRL_REQUEST shl 8) \ |
+ (SIO_SET_RTS_LOW shl 16) |
;DEBUGF 1,'K : FTDI Setting RTS pin LOW\n' |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_MODEM_CTRL_REQUEST shl 8) + (SIO_SET_RTS_LOW shl 16) |
jmp .ftdi_out_control_transfer_noinp |
|
.ftdi_setdtrhigh: |
DEBUGF 2,'K : FTDI Setting DTR pin HIGH PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_MODEM_CTRL_REQUEST shl 8) \ |
+ (SIO_SET_DTR_HIGH shl 16) |
;DEBUGF 1,'K : FTDI Setting DTR pin HIGH\n' |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_MODEM_CTRL_REQUEST shl 8) + (SIO_SET_DTR_HIGH shl 16) |
jmp .ftdi_out_control_transfer_noinp |
|
.ftdi_setdtrlow: |
DEBUGF 2,'K : FTDI Setting DTR pin LOW PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_MODEM_CTRL_REQUEST shl 8) \ |
+ (SIO_SET_DTR_LOW shl 16) |
;DEBUGF 1,'K : FTDI Setting DTR pin LOW\n' |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_MODEM_CTRL_REQUEST shl 8) + (SIO_SET_DTR_LOW shl 16) |
jmp .ftdi_out_control_transfer_noinp |
|
.ftdi_usb_reset: |
DEBUGF 2,'K : FTDI Reseting PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_RESET_REQUEST shl 8) \+ |
(SIO_RESET_SIO shl 16) |
;DEBUGF 1,'K : FTDI Reseting\n' |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_RESET_REQUEST shl 8) + (SIO_RESET_SIO shl 16) |
jmp .ftdi_out_control_transfer_noinp |
|
.ftdi_purge_rx_buf: |
DEBUGF 2, 'K : FTDI Purge TX buffer PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_RESET_REQUEST shl 8) \ |
+ (SIO_RESET_PURGE_RX shl 16) |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_RESET_REQUEST shl 8) + (SIO_RESET_PURGE_RX shl 16) |
jmp .ftdi_out_control_transfer_noinp |
|
.ftdi_purge_tx_buf: |
DEBUGF 2, 'K : FTDI Purge RX buffer PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_RESET_REQUEST shl 8) \ |
+ (SIO_RESET_PURGE_TX shl 16) |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_RESET_REQUEST shl 8) + (SIO_RESET_PURGE_TX shl 16) |
jmp .ftdi_out_control_transfer_noinp |
|
.ftdi_set_bitmode: |
DEBUGF 2, 'K : FTDI Set bitmode 0x%x, bitmask 0x%x %d PID: %d Dev handler 0x0x%x\n', \ |
[edi+8]:2,[edi+10]:2,[edi],[edi+4] |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_BITMODE_REQUEST shl 8) |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_BITMODE_REQUEST shl 8) |
jmp .ftdi_out_control_transfer_withinp |
|
.ftdi_set_line_property: |
DEBUGF 2, 'K : FTDI Set line property 0x%x PID: %d Dev handler 0x0x%x\n', \ |
[edi+8]:4,[edi],[edi+4] |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_DATA_REQUEST shl 8) |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_DATA_REQUEST shl 8) |
jmp .ftdi_out_control_transfer_withinp |
|
.ftdi_set_latency_timer: |
DEBUGF 2, 'K : FTDI Set latency %d PID: %d Dev handler 0x0x%x\n', \ |
[edi+8],[edi],[edi+4] |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_LATENCY_TIMER_REQUEST shl 8) |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_LATENCY_TIMER_REQUEST shl 8) |
jmp .ftdi_out_control_transfer_withinp |
|
.ftdi_set_event_char: |
DEBUGF 2, 'K : FTDI Set event char %c PID: %d Dev handler 0x0x%x\n', \ |
[edi+8],[edi],[edi+4] |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_EVENT_CHAR_REQUEST shl 8) |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_EVENT_CHAR_REQUEST shl 8) |
jmp .ftdi_out_control_transfer_withinp |
|
.ftdi_set_error_char: |
DEBUGF 2, 'K : FTDI Set error char %c PID: %d Dev handler 0x0x%x\n', \ |
[edi+8],[edi],[edi+4] |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_ERROR_CHAR_REQUEST shl 8) |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_ERROR_CHAR_REQUEST shl 8) |
jmp .ftdi_out_control_transfer_withinp |
|
.ftdi_setflowctrl: |
DEBUGF 2, 'K : FTDI Set flow control PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_FLOW_CTRL_REQUEST shl 8) + (0 shl 16) |
mov dword[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_FLOW_CTRL_REQUEST shl 8) + (0 shl 16) |
mov ebx, [edi+4] |
mov cx, word[edi+8] |
or ecx, [ebx + ftdi_context.index] |
546,11 → 506,8 |
jmp .own_index |
|
.ftdi_read_pins: |
DEBUGF 2, 'K : FTDI Read pins PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov ebx, [edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_IN_REQTYPE) / |
+ (SIO_READ_PINS_REQUEST shl 8) + (0 shl 16) |
mov dword[ConfPacket], FTDI_DEVICE_IN_REQTYPE + (SIO_READ_PINS_REQUEST shl 8) + (0 shl 16) |
mov ecx, [ebx + ftdi_context.index] |
mov word[ConfPacket+4], cx |
mov word[ConfPacket+6], 1 |
559,11 → 516,10 |
mov ecx, esi |
add ecx, 8 |
mov word[ConfPacket+8], 0 |
invoke USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, ecx, / |
1, control_callback, edi, 0 |
stdcall USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, ecx, 1, control_callback, edi, 0 |
mov eax, [EventData] |
mov ebx, [EventData+4] |
invoke WaitEvent |
call WaitEvent |
xor ebx, ebx |
mov bx, word[ConfPacket+8] |
mov ecx, [ioctl] |
575,8 → 531,6 |
jmp .error |
|
.ftdi_set_wchunksize: |
DEBUGF 2, 'K : FTDI Set write chunksize %d bytes PID: %d Dev handler 0x0x%x\n', \ |
[edi+8], [edi], [edi+4] |
mov ebx, [edi+4] |
mov ecx, [edi+8] |
cmp [ebx + ftdi_context.maxPacketSize], ecx |
585,8 → 539,6 |
jmp .endswitch |
|
.ftdi_get_wchunksize: |
DEBUGF 2, 'K : FTDI Get write chunksize PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov esi, [edi+output] |
mov edi, [edi+input] |
mov ebx, [edi+4] |
595,8 → 547,6 |
jmp .endswitch |
|
.ftdi_set_rchunksize: |
DEBUGF 2, 'K : FTDI Set read chunksize %d bytes PID: %d Dev handler 0x0x%x\n', \ |
[edi+8], [edi], [edi+4] |
mov ebx, [edi+4] |
mov ecx, [edi+8] |
cmp [ebx + ftdi_context.maxPacketSize], ecx |
605,8 → 555,6 |
jmp .endswitch |
|
.ftdi_get_rchunksize: |
DEBUGF 2, 'K : FTDI Get read chunksize PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov esi, [edi+output] |
mov edi, [edi+input] |
mov ebx, [edi+4] |
615,18 → 563,16 |
jmp .endswitch |
|
.ftdi_write_data: |
DEBUGF 2, 'K : FTDI Write %d bytes PID: %d Dev handler 0x%x\n', [edi+8],\ |
[edi], [edi+4] |
mov esi, edi |
add esi, 12 |
mov ebx, [edi+4] |
;---Dirty hack begin |
mov eax, [edi+8] |
invoke Kmalloc |
call Kmalloc |
test eax, eax |
jnz @f |
mov esi, nomemory_msg |
invoke SysMsgBoardStr |
call SysMsgBoardStr |
jmp .eventdestroy |
@@: |
mov dword[ConfPacket], eax |
648,11 → 594,10 |
add esi, ecx |
lea eax, [EventData] |
push ecx ebx esi edi |
invoke USBNormalTransferAsync, [ebx + ftdi_context.inEP], esi, edx, \ |
bulk_callback, eax, 1 |
stdcall USBNormalTransferAsync, [ebx + ftdi_context.inEP], esi, edx, bulk_callback, eax, 1 |
mov eax, [EventData] |
mov ebx, [EventData+4] |
invoke WaitEvent |
call WaitEvent |
pop edi esi ebx ecx |
cmp [EventData+8], -1 |
jz .error |
662,8 → 607,6 |
jmp .write_loop |
|
.ftdi_read_data: |
DEBUGF 2, 'K : FTDI Read %d bytes PID: %d Dev handler 0x%x\n', [edi+8],\ |
[edi], [edi+4] |
mov edi, [ioctl] |
mov esi, [edi+input] |
mov edi, [edi+output] |
670,20 → 613,20 |
mov ebx, [esi+4] |
;---Dirty hack begin |
mov eax, [esi+8] |
invoke Kmalloc |
call Kmalloc |
test eax, eax |
jnz @f |
mov esi, nomemory_msg |
invoke SysMsgBoardStr |
call SysMsgBoardStr |
jmp .eventdestroy |
@@: |
mov edi, eax |
; push edi eax |
; mov ecx, [esi+8] |
; xor eax, eax |
; rep stosb |
; pop eax edi |
mov dword[ConfPacket], eax ; Store in ConfPacket ptr to allocated memory |
push edi eax |
mov ecx, [esi+8] |
xor eax, eax |
rep stosb |
pop eax edi |
mov dword[ConfPacket], eax ; Store in ConfPAcket ptr to allocated memory |
;---Dirty hack end |
xor ecx, ecx |
.read_loop: |
698,11 → 641,10 |
lea eax, [EventData] |
add edi, ecx |
push esi edi ecx ebx |
invoke USBNormalTransferAsync, [ebx + ftdi_context.outEP], edi, edx, \ |
bulk_callback, eax, 1 |
stdcall USBNormalTransferAsync, [ebx + ftdi_context.outEP], edi, edx, bulk_callback, eax, 1 |
mov eax, [EventData] |
mov ebx, [EventData+4] |
invoke WaitEvent |
call WaitEvent |
pop ebx ecx edi esi |
cmp [EventData+8], -1 |
jz .error |
720,11 → 662,8 |
;---Dirty hack end |
|
.ftdi_poll_modem_status: |
DEBUGF 2, 'K : FTDI Poll modem status PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov ebx, [edi+4] |
mov dword[ConfPacket], (FTDI_DEVICE_IN_REQTYPE) \ |
+ (SIO_POLL_MODEM_STATUS_REQUEST shl 8) + (0 shl 16) |
mov dword[ConfPacket], FTDI_DEVICE_IN_REQTYPE + (SIO_POLL_MODEM_STATUS_REQUEST shl 8) + (0 shl 16) |
mov ecx, [ebx + ftdi_context.index] |
mov word[ConfPacket+4], cx |
mov word[ConfPacket+6], 1 |
732,11 → 671,10 |
lea edi, [EventData] |
mov ecx, [ioctl] |
mov ecx, [ecx+output] |
invoke USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, ecx, \ |
2, control_callback, edi, 0 |
stdcall USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, ecx, 2, control_callback, edi, 0 |
mov eax, [EventData] |
mov ebx, [EventData+4] |
invoke WaitEvent |
call WaitEvent |
mov ax, word[ecx] |
xchg ah, al |
and ah, 0xFF |
744,11 → 682,8 |
jmp .endswitch |
|
.ftdi_get_latency_timer: |
DEBUGF 2, 'K : FTDI Get latency timer PID: %d Dev handler 0x0x%x\n', [edi],\ |
[edi+4] |
mov ebx, [edi+4] |
mov dword[ConfPacket], FTDI_DEVICE_IN_REQTYPE \ |
+ (SIO_GET_LATENCY_TIMER_REQUEST shl 8) + (0 shl 16) |
mov dword[ConfPacket], FTDI_DEVICE_IN_REQTYPE + (SIO_GET_LATENCY_TIMER_REQUEST shl 8) + (0 shl 16) |
mov ecx, [ebx + ftdi_context.index] |
mov word[ConfPacket+4], cx |
mov word[ConfPacket+6], 1 |
756,15 → 691,13 |
lea edi, [EventData] |
mov ecx, [ioctl] |
mov ecx, [ecx+output] |
invoke USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, ecx, \ |
2, control_callback, edi, 0 |
stdcall USBControlTransferAsync, [ebx + ftdi_context.nullP], esi, ecx, 2, control_callback, edi, 0 |
mov eax, [EventData] |
mov ebx, [EventData+4] |
invoke WaitEvent |
call WaitEvent |
jmp .endswitch |
|
.ftdi_get_list: |
DEBUGF 2, 'K : FTDI devices\' list request\n' |
mov edi, [edi+output] |
xor ecx, ecx |
call linkedlist_gethead |
794,7 → 727,6 |
jmp .endswitch |
|
.ftdi_lock: |
DEBUGF 2, 'K : FTDI Lock PID: %d Dev handler 0x0x%x\n', [edi], [edi+4] |
mov esi, [edi+input] |
mov ebx, [esi+4] |
mov eax, [ebx + ftdi_context.lockPID] |
808,7 → 740,6 |
jmp .endswitch |
|
.ftdi_unlock: |
DEBUGF 2, 'K : FTDI Unlock PID: %d Dev handler 0x0x%x\n', [edi], [edi+4] |
mov esi, [edi+input] |
mov edi, [edi+output] |
mov ebx, [esi+4] |
825,8 → 756,6 |
H_CLK = 120000000 |
C_CLK = 48000000 |
.ftdi_set_baudrate: |
DEBUGF 2, 'K : FTDI Set baudrate to %d PID: %d Dev handle: 0x%x\n',\ |
[edi+8], [edi], [edi+4] |
mov ebx, [edi+4] |
cmp [ebx + ftdi_context.chipType], TYPE_2232H |
jl .c_clk |
954,8 → 883,7 |
or ecx, [ebx + ftdi_context.index] |
|
.preparepacket: |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) \ |
+ (SIO_SET_BAUDRATE_REQUEST shl 8) |
mov word[ConfPacket], (FTDI_DEVICE_OUT_REQTYPE) + (SIO_SET_BAUDRATE_REQUEST shl 8) |
mov word[ConfPacket+2], ax |
mov word[ConfPacket+4], cx |
mov word[ConfPacket+6], 0 |
970,8 → 898,8 |
restore out_size |
|
|
proc control_callback stdcall uses ebx edi esi, .pipe:DWORD, .status:DWORD, \ |
.buffer:DWORD, .length:DWORD, .calldata:DWORD |
align 4 |
proc control_callback stdcall uses ebx edi esi, .pipe:DWORD, .status:DWORD, .buffer:DWORD, .length:DWORD, .calldata:DWORD |
|
DEBUGF 1, 'K : status is %d\n', [.status] |
mov ecx, [.calldata] |
981,12 → 909,11 |
mov [ecx+8], edx |
xor esi, esi |
xor edx, edx |
invoke RaiseEvent |
call RaiseEvent |
ret |
endp |
|
proc bulk_callback stdcall uses ebx edi esi, .pipe:DWORD, .status:DWORD, \ |
.buffer:DWORD, .length:DWORD, .calldata:DWORD |
proc bulk_callback stdcall uses ebx edi esi, .pipe:DWORD, .status:DWORD, .buffer:DWORD, .length:DWORD, .calldata:DWORD |
|
DEBUGF 1, 'K : status is %d\n', [.status] |
mov ecx, [.calldata] |
1005,23 → 932,23 |
.ok: |
xor esi, esi |
xor edx, edx |
invoke RaiseEvent |
call RaiseEvent |
ret |
endp |
|
proc DeviceDisconnected stdcall uses ebx esi edi, .device_data:DWORD |
|
DEBUGF 1, 'K : FTDI deleting device data 0x%x\n', [.device_data] |
DEBUGF 1, 'K : FTDI deleting device data %x\n', [.device_data] |
mov eax, [.device_data] |
call linkedlist_unlink |
invoke Kfree |
call linkedlist_delete |
ret |
endp |
|
include 'linkedlist.inc' |
|
; Exported variable: kernel API version. |
align 4 |
|
version dd 50005h |
; Structure with callback functions. |
usb_functions: |
dd 12 |
1028,8 → 955,11 |
dd AddDevice |
dd DeviceDisconnected |
|
data fixups |
end data |
;for DEBUGF macro |
include_debug_strings |
|
;for DEBUGF macro |
include_debug_strings |
|
|
|
; for uninitialized data |
;section '.data' data readable writable align 16 |