Fixed controll_callback. Added GPL header to the driver. Added USB functions in imports.inc

git-svn-id: svn://kolibrios.org@4980 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
gtament 2014-06-17 19:38:17 +00:00
parent 81384e65b4
commit 7dd994b4b2
2 changed files with 23 additions and 11 deletions

View File

@ -93,6 +93,12 @@ kernel_export \
LFBAddress,\ LFBAddress,\
GetDisplay,\ GetDisplay,\
SetScreen,\ SetScreen,\
\
RegUSBDriver,\
USBOpenPipe,\
USBNormalTransferAsync,\
USBControlTransferAsync,\
USBGetParam,\
\ \
NetRegDev,\ NetRegDev,\
NetUnRegDev,\ NetUnRegDev,\

View File

@ -1,3 +1,10 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; Copyright (C) KolibriOS team 2004-2014. All rights reserved. ;;
;; Distributed under terms of the GNU General Public License ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; standard driver stuff ; standard driver stuff
format MS COFF format MS COFF
@ -7,10 +14,10 @@ DEBUG = 1
__DEBUG__ = 1 __DEBUG__ = 1
__DEBUG_LEVEL__ = 1 __DEBUG_LEVEL__ = 1
include '../proc32.inc' include '../../proc32.inc'
include '../imports.inc' include '../../imports.inc'
include '../fdo.inc' include '../../fdo.inc'
include '../struct.inc' include '../../struct.inc'
public START public START
public version public version
@ -171,7 +178,7 @@ proc AddDevice stdcall uses ebx, .config_pipe:DWORD, .config_descr:DWORD, .inter
cmp word[eax+usb_descr.idVendor], 0x0403 cmp word[eax+usb_descr.idVendor], 0x0403
jnz .notftdi jnz .notftdi
DEBUGF 1,'K : FTDI USB device detected\n' DEBUGF 1,'K : FTDI USB device detected\n'
movi eax, sizeof.ftdi_context mov eax, sizeof.ftdi_context
call Kmalloc call Kmalloc
test eax, eax test eax, eax
jnz @f jnz @f
@ -237,7 +244,6 @@ endl
xor esi, esi xor esi, esi
call CreateEvent call CreateEvent
mov edi, [ioctl] mov edi, [ioctl]
DEBUGF 1,'K : Event created %x %x\n' , eax, edx
mov [EventData], eax mov [EventData], eax
mov [EventData+4], edx mov [EventData+4], edx
mov dword[ConfPacket], (FTDI_DEVICE_IN_REQTYPE) + (SIO_SET_BITMODE_REQUEST shl 8) + (0x0000 shl 16) mov dword[ConfPacket], (FTDI_DEVICE_IN_REQTYPE) + (SIO_SET_BITMODE_REQUEST shl 8) + (0x0000 shl 16)
@ -282,11 +288,11 @@ restore out_size
align 4 align 4
proc control_callback stdcall uses ebx, .pipe:DWORD, .status:DWORD, .buffer:DWORD, .length:DWORD, .calldata:DWORD proc control_callback stdcall uses ebx, edi, .pipe:DWORD, .status:DWORD, .buffer:DWORD, .length:DWORD, .calldata:DWORD
mov eax, [.calldata] mov ecx, [.calldata]
mov ebx, [.calldata+4] mov eax, [ecx]
DEBUGF 1,'K : EventData %x %x', [.calldata], [.calldata+4] mov ebx, [ecx+4]
xor edx, edx xor edx, edx
call RaiseEvent call RaiseEvent
DEBUGF 1, 'K : status is %d\n', [.status+24h] DEBUGF 1, 'K : status is %d\n', [.status+24h]