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-2010. 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
;;  MTD80x driver for KolibriOS                                    ;;
6
;;  MTD80x driver for KolibriOS                                    ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;  Based on mtd80x.c from the etherboot project                   ;;
8
;;  Based on mtd80x.c from the etherboot project                   ;;
Line 323... Line 323...
323
        cmp [state], 1
323
        cmp [state], 1
324
        jne .exit
324
        jne .exit
Line 325... Line 325...
325
 
325
 
Line 326... Line 326...
326
  .entry:
326
  .entry:
327
 
327
 
328
        DEBUGF  2,"Loading mtd80x driver\n"
328
        DEBUGF  2,"Loading %s driver\n", my_service
Line 329... Line 329...
329
        stdcall RegService, my_service, service_proc
329
        stdcall RegService, my_service, service_proc
330
        ret
330
        ret
Line 354... Line 354...
354
 
354
 
355
        cmp     eax, 0 ;SRV_GETVERSION
355
        cmp     eax, 0 ;SRV_GETVERSION
Line 356... Line 356...
356
        jne     @F
356
        jne     @F
357
 
357
 
358
        cmp     [IOCTL.out_size], 4
358
        cmp     [IOCTL.out_size], 4
359
        jl      .fail
359
        jb      .fail
Line 360... Line 360...
360
        mov     eax, [IOCTL.output]
360
        mov     eax, [IOCTL.output]
361
        mov     [eax], dword API_VERSION
361
        mov     [eax], dword API_VERSION
Line 367... Line 367...
367
  @@:
367
  @@:
368
        cmp     eax, 1 ;SRV_HOOK
368
        cmp     eax, 1 ;SRV_HOOK
369
        jne     .fail
369
        jne     .fail
Line 370... Line 370...
370
 
370
 
371
        cmp     [IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
371
        cmp     [IOCTL.inp_size], 3                     ; Data input must be at least 3 bytes
Line 372... Line 372...
372
        jl      .fail
372
        jb      .fail
373
 
373
 
374
        mov     eax, [IOCTL.input]
374
        mov     eax, [IOCTL.input]
Line 393... Line 393...
393
 
393
 
394
 
394
 
395
; This device doesnt have its own eth_device structure yet, lets create one
395
; This device doesnt have its own eth_device structure yet, lets create one
396
  .firstdevice:
396
  .firstdevice:
Line 397... Line 397...
397
        cmp     [devices], MAX_DEVICES                  ; First check if the driver can handle one more card
397
        cmp     [devices], MAX_DEVICES                  ; First check if the driver can handle one more card
Line 398... Line 398...
398
        jge     .fail
398
        jae     .fail