Subversion Repositories Kolibri OS

Rev

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

Rev 5166 Rev 6716
Line 1... Line 1...
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
1
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
;;                                                                 ;;
2
;;                                                                 ;;
3
;; Copyright (C) KolibriOS team 2010-2014. All rights reserved.    ;;
3
;; Copyright (C) KolibriOS team 2010-2016. 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
;;  netcfg.asm - Network driver control center for KolibriOS       ;;
6
;;  netcfg.asm - Network driver control center for KolibriOS       ;;
7
;;                                                                 ;;
7
;;                                                                 ;;
8
;;  Written by hidnplayr@kolibrios.org                             ;;
8
;;  Written by hidnplayr@kolibrios.org                             ;;
Line 12... Line 12...
12
;;                                                                 ;;
12
;;                                                                 ;;
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
13
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Line 14... Line 14...
14
 
14
 
Line -... Line 15...
-
 
15
format binary as ""
-
 
16
 
-
 
17
__DEBUG__       = 1
15
format binary as ""
18
__DEBUG_LEVEL__ = 1
16
 
19
 
Line 17... Line 20...
17
use32
20
use32
18
               org    0x0
21
               org    0x0
Line 23... Line 26...
23
               dd     IM_END               ; size of image
26
               dd     IM_END               ; size of image
24
               dd     (I_END+0x100)        ; memory for app
27
               dd     (I_END+0x100)        ; memory for app
25
               dd     (I_END+0x100)        ; esp
28
               dd     (I_END+0x100)        ; esp
26
               dd     param, 0x0           ; I_Param , I_Icon
29
               dd     param, 0x0           ; I_Param , I_Icon
Line 27... Line -...
27
 
-
 
28
type_ethernet equ 1
-
 
29
 
30
 
-
 
31
include '../../macros.inc'
Line 30... Line 32...
30
include '../../macros.inc'
32
include '../../debug-fdo.inc'
31
 
33
 
Line 32... Line 34...
32
START:
34
START:
Line 302... Line 304...
302
 
304
 
Line 303... Line 305...
303
load_and_start:
305
load_and_start:
304
 
306
 
305
        call    get_drv_ptr
307
        call    get_drv_ptr
Line 306... Line 308...
306
        cmp     eax, lbl_none
308
        cmp     eax, lbl_none
307
        je      .next
309
        je      .notsupp
308
 
310
 
309
        mov     ecx, eax
311
        mov     ecx, eax
310
        mcall   68, 16
312
        mcall   68, 16
Line 311... Line 313...
311
        test    eax, eax
313
        test    eax, eax
312
        jz      .next
314
        jz      .fail
313
        mov     [IOCTL.handle], eax
315
        mov     [IOCTL.handle], eax
Line 328... Line 330...
328
       .next:
330
  .next:
329
        cmp     byte[param], 'A'
331
        cmp     byte[param], 'A'
330
        je      Start_Enum.nextDev
332
        je      Start_Enum.nextDev
331
        jmp     exit
333
        jmp     exit
Line -... Line 334...
-
 
334
 
-
 
335
  .fail:
-
 
336
        DEBUGF  1,"Could not load network driver %s\n", ecx
-
 
337
        jmp     .next
-
 
338
 
-
 
339
  .notsupp:
-
 
340
        DEBUGF  1,"Unsupported PCI network card detected: 0x%x:0x%x\n", [PCI_Vendor]:4, [PCI_Device]:4
-
 
341
        jmp     .next
Line 332... Line 342...
332
 
342
 
333
 
343
 
334
 
344
 
Line 456... Line 466...
456
get_drv_ptr:
466
get_drv_ptr:
457
        mov     eax, driverlist        ; eax will be the pointer to latest driver title
467
        mov     eax, driverlist        ; eax will be the pointer to latest driver title
458
        mov     ebx, driverlist        ; ebx is the current pointer
468
        mov     ebx, driverlist        ; ebx is the current pointer
459
        mov     ecx, dword[PCI_Vendor] ; the device/vendor id of we want to find
469
        mov     ecx, dword[PCI_Vendor] ; the device/vendor id of we want to find
Line 460... Line 470...
460
 
470
 
461
       driverloop:
471
  .driverloop:
462
        inc     ebx
-
 
463
 
472
        inc     ebx
464
        cmp     byte[ebx],0
473
        cmp     byte[ebx], 0
465
        jne     driverloop
-
 
466
 
474
        jne     .driverloop
Line 467... Line 475...
467
        inc     ebx                    ; the device/vendor id list for the driver eax is pointing to starts here.
475
        inc     ebx                    ; the device/vendor id list for the driver eax is pointing to starts here.
468
 
476
 
469
       deviceloop:
477
  .deviceloop:
470
        cmp     dword[ebx],0
-
 
471
        je      nextdriver
478
        cmp     dword[ebx], 0
472
 
479
        je      .nextdriver
473
        cmp     dword[ebx],ecx
-
 
474
        je      driverfound
480
        cmp     dword[ebx], ecx
475
 
481
        je      .driverfound
Line 476... Line 482...
476
        add     ebx, 4
482
        add     ebx, 4
477
        jmp     deviceloop
483
        jmp     .deviceloop
478
 
-
 
479
       nextdriver:
484
 
480
        add     ebx, 4
485
  .nextdriver:
481
 
-
 
482
        cmp     dword[ebx],0
486
        add     ebx, 4
483
        je      nodriver
487
        cmp     dword[ebx], 0
Line 484... Line 488...
484
 
488
        je      .nodriver
485
        mov     eax,ebx
489
        mov     eax, ebx
486
        jmp     driverloop
490
        jmp     .driverloop
Line 487... Line 491...
487
 
491
 
488
       nodriver:
492
  .nodriver:
Line 489... Line 493...
489
        mov     eax, lbl_none          ; lets print the vendor Name
493
        mov     eax, lbl_none          ; lets print the vendor Name
490
        ret
494
        ret
Line 514... Line 518...
514
nonefound       db 'No compatible devices were found!',0
518
nonefound       db 'No compatible devices were found!',0
515
btn_start       db 'Start device',0
519
btn_start       db 'Start device',0
516
btn_reset       db 'Reset device',0
520
btn_reset       db 'Reset device',0
517
btn_stop        db 'Stop device',0
521
btn_stop        db 'Stop device',0
518
lbl_none        db 'none',0
522
lbl_none        db 'none',0
519
load_error      db 'Could not load driver!',0
523
load_error      db 'Could not load network driver!',0
-
 
524
 
-
 
525
include_debug_strings
Line 520... Line 526...
520
 
526
 
521
hardwareinfo:
527
hardwareinfo:
522
   .type        db 1 ; pci
528
   .type        db 1 ; pci
523
   .pci_bus     db ?
529
   .pci_bus     db ?