Subversion Repositories Kolibri OS

Rev

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

Rev 2935 Rev 2981
Line 504... Line 504...
504
reset_dontstart:
504
reset_dontstart:
505
        DEBUGF  1,"Reset\n"
505
        DEBUGF  1,"Reset\n"
Line 506... Line 506...
506
 
506
 
Line -... Line 507...
-
 
507
        mov     esi, [device.mmio_addr]
-
 
508
 
-
 
509
        or      dword [esi + REG_CTRL], CTRL_RST        ; reset device
-
 
510
  .loop:
-
 
511
        push    esi
-
 
512
        xor     esi, esi
-
 
513
        inc     esi
-
 
514
        call    Sleep
-
 
515
        pop     esi
-
 
516
        test    dword [esi + REG_CTRL], CTRL_RST
507
        mov     esi, [device.mmio_addr]
517
        jnz     .loop
508
 
518
 
509
        mov     dword [esi + REG_IMC], 0xffffffff       ; Disable all interrupt causes
519
        mov     dword [esi + REG_IMC], 0xffffffff       ; Disable all interrupt causes
Line 510... Line 520...
510
        mov     eax, dword [esi + REG_ICR]              ; Clear any pending interrupts
520
        mov     eax, dword [esi + REG_ICR]              ; Clear any pending interrupts
Line 564... Line 574...
564
        xor     eax, eax
574
        xor     eax, eax
565
        mov     [esi + REG_RDTR], eax                   ; Clear the Receive Delay Timer Register
575
        mov     [esi + REG_RDTR], eax                   ; Clear the Receive Delay Timer Register
566
        mov     [esi + REG_RADV], eax                   ; Clear the Receive Interrupt Absolute Delay Timer
576
        mov     [esi + REG_RADV], eax                   ; Clear the Receive Interrupt Absolute Delay Timer
567
        mov     [esi + REG_RSRPD], eax                  ; Clear the Receive Small Packet Detect Interrupt
577
        mov     [esi + REG_RSRPD], eax                  ; Clear the Receive Small Packet Detect Interrupt
568
        or      eax, 1 shl 0 + 1 shl 7                  ; TXDW + RXT0
578
        or      eax, 1 shl 0 + 1 shl 7                  ; TXDW + RXT0
569
        mov     eax, -1 ;;;; hack!
579
        mov     eax, 1+4+16 ;;;; hack!
570
        mov     [esi + REG_IMS], eax                    ; Enable interrupt types
580
        mov     [esi + REG_IMS], eax                    ; Enable interrupt types
Line 571... Line 581...
571
 
581
 
Line 572... Line 582...
572
        mov     [device.mtu], 1514
582
        mov     [device.mtu], 1514
Line 746... Line 756...
746
; reset descriptor status
756
; reset descriptor status
747
        mov     esi, [device.mmio_addr]
757
        mov     esi, [device.mmio_addr]
748
        mov     dword [esi + REG_RDH], 0x00000000       ; Receive Descriptor Head
758
        mov     dword [esi + REG_RDH], 0x00000000       ; Receive Descriptor Head
749
        mov     dword [esi + REG_RDT], 0x00000001       ; Receive Descriptor Tail
759
        mov     dword [esi + REG_RDT], 0x00000001       ; Receive Descriptor Tail
Line 750... Line 760...
750
 
760
 
751
        jmp     EthReceiver
761
        jmp     Eth_input
752
  .retaddr:
762
  .retaddr:
Line 753... Line 763...
753
        pop     eax
763
        pop     eax