Subversion Repositories Kolibri OS

Rev

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

Rev 2910 Rev 2912
Line 572... Line 572...
572
;        lea     eax, [device.txd]
572
;        lea     eax, [device.txd]
573
;        GetRealAddr
573
;        GetRealAddr
574
        out     dx, eax
574
        out     dx, eax
Line 575... Line 575...
575
 
575
 
-
 
576
        mov     [device.cur_tx], 0              ; Set current tx descriptor to 0
Line 576... Line 577...
576
        mov     [device.cur_tx], 0              ; Set current tx descriptor to 0
577
        mov     [device.last_tx], 0
Line 577... Line 578...
577
 
578
 
578
        DEBUGF  1, "Initialising RX Descriptors\n"
579
        DEBUGF  1, "Initialising RX Descriptors\n"
Line 989... Line 990...
989
 
990
 
990
        movzx   ecx, [device.cur_tx]
991
        movzx   ecx, [device.cur_tx]
991
        shl     ecx, 4                  ; *16
992
        shl     ecx, 4                  ; *16
Line 992... Line 993...
992
        lea     ecx, [device.txd + ecx]
993
        lea     ecx, [device.txd + ecx]
993
 
994
 
Line 994... Line 995...
994
;; TODO: check if desc is empty (for example: check for eax, 0x6200000  at [ecx+4]
995
        test    dword [ecx + 4], 0x80000000     ; card owns descriptor ?
995
;;; or: count number of available descriptors
996
        jnz     .error
996
 
997
 
997
        mov     eax, [esp + 4]
998
        mov     eax, [esp + 4]
Line 1119... Line 1120...
1119
        mov     dword [ecx + 4], RX_BUFF_SZ
1120
        mov     dword [ecx + 4], RX_BUFF_SZ
Line 1120... Line 1121...
1120
 
1121
 
1121
        inc     [device.cur_rx]                          ; get next descriptor
1122
        inc     [device.cur_rx]                          ; get next descriptor
Line 1122... Line -...
1122
        and     [device.cur_rx], NUM_RX_DESC-1           ; only 4 descriptors 0-3
-
 
1123
 
-
 
1124
; Enable Receiver    CHECKME
-
 
1125
;        set_io  0
-
 
1126
;        set_io  cr              ; Command Register offset
-
 
1127
;        in      eax, dx         ; Get current Command Register
-
 
1128
;        or      eax, RxENA      ; Enable Receiver
-
 
1129
;        out     dx, eax
1123
        and     [device.cur_rx], NUM_RX_DESC-1           ; only 4 descriptors 0-3
Line 1130... Line 1124...
1130
 
1124
 
1131
        pop     ax
1125
        pop     ax
1132
 
1126
 
Line 1133... Line 1127...
1133
  .no_rx:
1127
  .no_rx:
Line -... Line 1128...
-
 
1128
        test    ax, TxOK
-
 
1129
        jz      .no_tx
-
 
1130
 
1134
        test    ax, TxOK
1131
        DEBUGF  1, "TX ok!\n"
-
 
1132
 
-
 
1133
  .tx_loop:
-
 
1134
        movzx   ecx, [device.last_tx]
-
 
1135
        shl     ecx, 4                  ; *16
-
 
1136
        lea     ecx, [device.txd + ecx]
-
 
1137
 
-
 
1138
        test    dword [ecx + 4], 0x80000000   ; card owns descr
-
 
1139
        jnz     .no_tx
-
 
1140
        cmp     dword [ecx + 12], 0
1135
        jz      .no_tx
1141
        je      .no_tx
-
 
1142
 
-
 
1143
        DEBUGF  1, "Freeing packet = %x\n", [ecx + 12]:8
-
 
1144
        push    dword [ecx + 12]
-
 
1145
        mov     dword [ecx + 12], 0
Line 1136... Line 1146...
1136
 
1146
        call    KernelFree
Line 1137... Line 1147...
1137
        DEBUGF  1, "TX ok!\n"
1147