Rev 1886 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1886 | Rev 1889 | ||
---|---|---|---|
Line 193... | Line 193... | ||
193 | 193 | ||
Line 194... | Line 194... | ||
194 | .io_addr dd ? |
194 | .io_addr dd ? |
195 | 195 | ||
- | 196 | .cur_rx dw ? |
|
196 | .cur_rx dw ? |
197 | .cur_tx dw ? |
197 | .cur_tx dw ? |
198 | .last_tx dw ? |
198 | .phy_addr dw ? |
199 | .phy_addr dw ? |
199 | .phy_mode dw ? |
200 | .phy_mode dw ? |
200 | .mcr0 dw ? |
201 | .mcr0 dw ? |
Line 201... | Line 202... | ||
201 | .mcr1 dw ? |
202 | .mcr1 dw ? |
202 | .switch_sig dw ? |
203 | .switch_sig dw ? |
203 | 204 | ||
Line 204... | Line 205... | ||
204 | .pci_bus db ? |
205 | .pci_bus db ? |
Line 205... | Line 206... | ||
205 | .pci_dev db ? |
206 | .pci_dev db ? |
206 | .irq_line db ? |
207 | .irq_line db ? |
Line 207... | Line 208... | ||
207 | 208 | ||
Line 648... | Line 649... | ||
648 | GetRealAddr |
649 | GetRealAddr |
649 | mov ecx, TX_RING_SIZE |
650 | mov ecx, TX_RING_SIZE |
Line 650... | Line 651... | ||
650 | 651 | ||
651 | .next_desc: |
652 | .next_desc: |
- | 653 | mov [esi + x_head.ndesc], eax |
|
652 | mov [esi + x_head.ndesc], eax |
654 | mov [edi + x_head.skb_ptr], 0 |
Line 653... | Line 655... | ||
653 | mov [esi + x_head.status], DSC_OWNER_MAC |
655 | mov [esi + x_head.status], DSC_OWNER_MAC |
654 | 656 | ||
Line 829... | Line 831... | ||
829 | ; jl .l2 |
831 | ; jl .l2 |
Line 830... | Line 832... | ||
830 | 832 | ||
831 | xor eax, eax |
833 | xor eax, eax |
832 | dec eax |
834 | dec eax |
833 | .fail: |
835 | .fail: |
834 | DEBUGF 1,"R6040: Send timeout\n" |
836 | DEBUGF 1,"Send timeout\n" |
Line 874... | Line 876... | ||
874 | ; If not, try next device |
876 | ; If not, try next device |
Line 875... | Line 877... | ||
875 | 877 | ||
876 | add esi, 4 |
878 | add esi, 4 |
877 | dec ecx |
879 | dec ecx |
- | 880 | jnz .nextdevice |
|
878 | jnz .nextdevice |
881 | |
879 | ; If no device was found, abort (The irq was probably for a device, not registered to this driver) |
882 | .fail: ; If no device was found, abort (The irq was probably for a device, not registered to this driver) |
Line 880... | Line 883... | ||
880 | ret |
883 | ret |
Line 881... | Line 884... | ||
881 | 884 | ||
- | 885 | ; At this point, test for all possible reasons, and handle accordingly |
|
Line 882... | Line 886... | ||
882 | ; At this point, test for all possible reasons, and handle accordingly |
886 | |
883 | 887 | .got_it: |
|
Line 884... | Line 888... | ||
884 | .got_it: |
888 | push ax |
885 | 889 | ||
886 | test ax, RX_FINISH |
890 | test word [esp], RX_FINISH |
Line 940... | Line 944... | ||
940 | 944 | ||
Line 941... | Line 945... | ||
941 | ; At last, send packet to kernel |
945 | ; At last, send packet to kernel |
Line -... | Line 946... | ||
- | 946 | ||
942 | 947 | jmp EthReceiver |
|
Line -... | Line 948... | ||
- | 948 | ||
- | 949 | ||
- | 950 | .no_RX: |
|
943 | jmp EthReceiver |
951 | |
- | 952 | test word [esp], TX_FINISH |
|
- | 953 | jz .no_TX |
|
- | 954 | ||
- | 955 | .loop_tx: |
|
- | 956 | movzx edi, [device.last_tx] |
|
- | 957 | shl edi, 5 |
|
- | 958 | lea edi, [device.tx_ring + edi] |
|
- | 959 | ||
- | 960 | test [edi + x_head.status], DSC_OWNER_MAC |
|
- | 961 | jnz .tx_loop_end |
|
- | 962 | ||
- | 963 | cmp [edi + x_head.skb_ptr], 0 |
|
- | 964 | je .tx_loop_end |
|
- | 965 | ||
- | 966 | DEBUGF 1,"Freeing buffer 0x%x\n", [edi + x_head.skb_ptr] |
|
- | 967 | ||
- | 968 | push [edi + x_head.skb_ptr] |
|
- | 969 | call KernelFree |
|
- | 970 | mov [edi + x_head.skb_ptr], 0 |
|
Line -... | Line 971... | ||
- | 971 | ||
Line -... | Line 972... | ||
- | 972 | inc [device.last_tx] |
|
- | 973 | and [device.last_tx], TX_RING_SIZE - 1 |
|
944 | 974 | jmp .loop_tx |