Subversion Repositories Kolibri OS

Rev

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

Rev 3635 Rev 3685
Line 354... Line 354...
354
 
354
 
355
        mov     eax, [devices]                                          ; Add the device structure to our device list
355
        mov     eax, [devices]                                          ; Add the device structure to our device list
356
        mov     [device_list+4*eax], ebx                                ; (IRQ handler uses this list to find device)
356
        mov     [device_list+4*eax], ebx                                ; (IRQ handler uses this list to find device)
Line -... Line 357...
-
 
357
        inc     [devices]                                               ;
-
 
358
 
-
 
359
        call    reset
-
 
360
        test    eax, eax
357
        inc     [devices]                                               ;
361
        jnz     .destroy
358
 
362
 
Line 359... Line 363...
359
        mov     [device.type], NET_TYPE_ETH
363
        mov     [device.type], NET_TYPE_ETH
360
        call    NetRegDev
364
        call    NetRegDev
Line 375... Line 379...
375
        ret
379
        ret
Line 376... Line 380...
376
 
380
 
Line 377... Line 381...
377
; If an error occured, remove all allocated data and exit (returning -1 in eax)
381
; If an error occured, remove all allocated data and exit (returning -1 in eax)
-
 
382
 
378
 
383
  .destroy:
Line 379... Line 384...
379
  .destroy:
384
        ; todo: unregister device from device_list
380
        ; todo: reset device into virgin state
385
        ; todo: reset device into virgin state
381
 
386
 
Line 493... Line 498...
493
        set_io  0
498
        set_io  0
494
        set_io  REG_9346CR
499
        set_io  REG_9346CR
495
        out     dx, al
500
        out     dx, al
496
        DEBUGF  2, "done!\n"
501
        DEBUGF  2, "done!\n"
Line -... Line 502...
-
 
502
 
-
 
503
        xor     eax, eax
-
 
504
 
-
 
505
        ret
Line 497... Line 506...
497
 
506
 
498
 
507
 
499
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
508
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
500
;;
509
;;
Line 594... Line 603...
594
        out     dx, eax
603
        out     dx, eax
Line 595... Line 604...
595
 
604
 
596
; set RxBuffer address, init RX buffer offset
605
; set RxBuffer address, init RX buffer offset
597
        mov     eax, [device.rx_buffer]
606
        mov     eax, [device.rx_buffer]
598
        mov     dword[eax], 0                   ; clear receive flags for first packet (really needed??)
607
        mov     dword[eax], 0                   ; clear receive flags for first packet (really needed??)
599
        DEBUGF  2, "RX buffer virtual addr=0x%x\n", eax
608
        DEBUGF  1, "RX buffer virtual addr=0x%x\n", eax
600
        GetRealAddr
609
        GetRealAddr
601
        DEBUGF  2, "RX buffer real addr=0x%x\n", eax
610
        DEBUGF  1, "RX buffer real addr=0x%x\n", eax
602
        set_io  REG_RBSTART
611
        set_io  REG_RBSTART
Line 603... Line 612...
603
        out     dx, eax
612
        out     dx, eax
604
 
613