Subversion Repositories Kolibri OS

Rev

Rev 2981 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2981 Rev 3155
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2004-2011. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2004-2013. All rights reserved.    ;;
4
;; Distributed under terms of the GNU General Public License       ;;
4
;; Distributed under terms of the GNU General Public License       ;;
5
;;                                                                 ;;
5
;;                                                                 ;;
6
;;  R6040 driver for KolibriOS                                     ;;
6
;;  R6040 driver for KolibriOS                                     ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;  based on R6040.c from linux                                    ;;
8
;;  based on R6040.c from linux                                    ;;
Line 222... Line 222...
222
        cmp [state], 1
222
        cmp [state], 1
223
        jne .exit
223
        jne .exit
Line 224... Line 224...
224
 
224
 
Line 225... Line 225...
225
  .entry:
225
  .entry:
226
 
226
 
227
        DEBUGF  2,"Loading R6040 driver\n"
227
        DEBUGF  2,"Loading %s driver\n", my_service
Line 228... Line 228...
228
        stdcall RegService, my_service, service_proc
228
        stdcall RegService, my_service, service_proc
229
        ret
229
        ret
Line 253... Line 253...
253
 
253
 
254
        cmp     eax, 0 ;SRV_GETVERSION
254
        cmp     eax, 0 ;SRV_GETVERSION
Line 255... Line 255...
255
        jne     @F
255
        jne     @F
256
 
256
 
257
        cmp     [IOCTL.out_size], 4
257
        cmp     [IOCTL.out_size], 4
258
        jl      .fail
258
        jb      .fail
Line 259... Line 259...
259
        mov     eax, [IOCTL.output]
259
        mov     eax, [IOCTL.output]
260
        mov     [eax], dword API_VERSION
260
        mov     [eax], dword API_VERSION
Line 266... Line 266...
266
  @@:
266
  @@:
267
        cmp     eax, 1 ;SRV_HOOK
267
        cmp     eax, 1 ;SRV_HOOK
268
        jne     .fail
268
        jne     .fail
Line 269... Line 269...
269
 
269
 
270
        cmp     [IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
270
        cmp     [IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
Line 271... Line 271...
271
        jl      .fail
271
        jb      .fail
272
 
272
 
273
        mov     eax, [IOCTL.input]
273
        mov     eax, [IOCTL.input]
Line 292... Line 292...
292
 
292
 
293
 
293
 
294
; This device doesnt have its own eth_device structure yet, lets create one
294
; This device doesnt have its own eth_device structure yet, lets create one
295
  .firstdevice:
295
  .firstdevice:
Line 296... Line 296...
296
        cmp     [devices], MAX_DEVICES                  ; First check if the driver can handle one more card
296
        cmp     [devices], MAX_DEVICES                  ; First check if the driver can handle one more card
Line 297... Line 297...
297
        jge     .fail
297
        jae     .fail
Line 754... Line 754...
754
        [eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\
754
        [eax+00]:2,[eax+01]:2,[eax+02]:2,[eax+03]:2,[eax+04]:2,[eax+05]:2,\
755
        [eax+06]:2,[eax+07]:2,[eax+08]:2,[eax+09]:2,[eax+10]:2,[eax+11]:2,\
755
        [eax+06]:2,[eax+07]:2,[eax+08]:2,[eax+09]:2,[eax+10]:2,[eax+11]:2,\
756
        [eax+13]:2,[eax+12]:2
756
        [eax+13]:2,[eax+12]:2
Line 757... Line 757...
757
 
757
 
758
        cmp     dword [esp+8], 1514
758
        cmp     dword [esp+8], 1514
759
        jg      .fail
759
        ja      .fail
760
        cmp     dword [esp+8], 60
760
        cmp     dword [esp+8], 60
Line 761... Line 761...
761
        jl      .fail
761
        jb      .fail
762
 
762
 
763
        movzx   edi, [device.cur_tx]
763
        movzx   edi, [device.cur_tx]
764
        shl     edi, 5
764
        shl     edi, 5
Line 811... Line 811...
811
        jz      .do_send
811
        jz      .do_send
812
        mov     esi, 10
812
        mov     esi, 10
813
        call    Sleep
813
        call    Sleep
814
        call    GetTimerTicks
814
        call    GetTimerTicks
815
        cmp     edx, eax
815
        cmp     edx, eax
816
        jl      .l2
816
        jb      .l2
Line 817... Line 817...
817
 
817
 
818
        DEBUGF  1,"Send timeout\n"
818
        DEBUGF  1,"Send timeout\n"
819
        xor     eax, eax
819
        xor     eax, eax
820
        dec     eax
820
        dec     eax