Rev 3206 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3206 | Rev 3346 | ||
---|---|---|---|
Line 271... | Line 271... | ||
271 | 271 | ||
Line 272... | Line 272... | ||
272 | ; Fill in the direct call addresses into the struct |
272 | ; Fill in the direct call addresses into the struct |
273 | 273 | ||
274 | mov [device.reset], reset |
- | |
275 | mov [device.transmit], transmit |
- | |
276 | mov [device.get_MAC], read_mac |
274 | mov [device.reset], reset |
277 | mov [device.set_MAC], MAC_write |
275 | mov [device.transmit], transmit |
Line 278... | Line 276... | ||
278 | mov [device.unload], unload |
276 | mov [device.unload], unload |
Line 559... | Line 557... | ||
559 | ; Indicate that we have successfully reset the card |
557 | ; Indicate that we have successfully reset the card |
Line 560... | Line 558... | ||
560 | 558 | ||
Line 561... | Line 559... | ||
561 | DEBUGF 1,"Resetting %s complete\n", my_service |
559 | DEBUGF 1,"Resetting %s complete\n", my_service |
562 | - | ||
Line -... | Line 560... | ||
- | 560 | ||
- | 561 | mov [device.mtu], 1514 |
|
- | 562 | ||
- | 563 | ; Set link state to unknown |
|
563 | mov [device.mtu], 1514 |
564 | mov [device.state], ETH_LINK_UNKOWN |
Line 564... | Line 565... | ||
564 | xor eax, eax ; indicate that we have successfully reset the card |
565 | |
565 | 566 | xor eax, eax ; indicate that we have successfully reset the card |
|
Line 667... | Line 668... | ||
667 | inc [device.packets_tx] |
668 | inc [device.packets_tx] |
668 | mov eax, [esp + 8] |
669 | mov eax, [esp + 8] |
669 | add dword [device.bytes_tx], eax |
670 | add dword [device.bytes_tx], eax |
670 | adc dword [device.bytes_tx + 4], 0 |
671 | adc dword [device.bytes_tx + 4], 0 |
Line -... | Line 672... | ||
- | 672 | ||
- | 673 | DEBUGF 1,"Transmit OK\n" |
|
671 | 674 | ||
672 | xor eax, eax |
675 | xor eax, eax |
Line 673... | Line 676... | ||
673 | ret 8 |
676 | ret 8 |
674 | 677 | ||
Line 779... | Line 782... | ||
779 | pop ax |
782 | pop ax |
Line 780... | Line 783... | ||
780 | 783 | ||
Line 781... | Line 784... | ||
781 | .no_rx: |
784 | .no_rx: |
782 | - | ||
- | 785 | ||
- | 786 | ; Cleanup after TX |
|
783 | ; Cleanup after TX |
787 | cmp [txfd.status], 0 |
784 | 788 | je .done |
|
- | 789 | cmp [last_tx_buffer], 0 |
|
- | 790 | je .done |
|
785 | cmp [last_tx_buffer], 0 |
791 | push ax |
786 | je .done |
792 | DEBUGF 1, "Removing packet 0x%x from RAM!\n", [last_tx_buffer] |
- | 793 | stdcall KernelFree, [last_tx_buffer] |
|
Line 787... | Line 794... | ||
787 | stdcall KernelFree, [last_tx_buffer] |
794 | mov [last_tx_buffer], 0 |
- | 795 | pop ax |
|
- | 796 | ||
- | 797 | .done: |
|
- | 798 | and ax, 00111100b |
|
- | 799 | cmp ax, 00001000b |
|
- | 800 | jne .fail |
|
- | 801 | ||
- | 802 | DEBUGF 1, "out of resources!\n" |
|
- | 803 | ; Restart the RX |
|
- | 804 | ||
- | 805 | ; allocate new descriptor |
|
- | 806 | ||
- | 807 | stdcall KernelAlloc, 2000 |
|
- | 808 | mov [device.rx_desc], eax |
|
- | 809 | mov esi, eax |
|
- | 810 | GetRealAddr |
|
- | 811 | mov [esi + rxfd.status], 0x0000 |
|
- | 812 | mov [esi + rxfd.command], 0xc000 ; End of list + Suspend |
|
- | 813 | mov [esi + rxfd.link], eax |
|
- | 814 | mov [esi + rxfd.count], 0 |
|
- | 815 | mov [esi + rxfd.size], 1528 |
|
- | 816 | ||
- | 817 | ; restart RX |
|
- | 818 | ||
- | 819 | set_io 0 |
|
- | 820 | set_io reg_scb_ptr |
|
- | 821 | ; lea eax, [device.rx_desc] |
|
- | 822 | ; GetRealAddr |
|
- | 823 | out dx, eax |
|
- | 824 | ||
- | 825 | set_io reg_scb_cmd |
|
- | 826 | mov ax, RX_START |
|
788 | mov [last_tx_buffer], 0 |
827 | out dx, ax |
Line 789... | Line 828... | ||
789 | 828 | call cmd_wait |