Rev 5525 | Rev 5561 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5525 | Rev 5560 | ||
---|---|---|---|
Line 16... | Line 16... | ||
16 | ;; Intel's programming manual for i8255x: ;; |
16 | ;; Intel's programming manual for i8255x: ;; |
17 | ;; http://www.intel.com/design/network/manuals/8255x_opensdm.htm ;; |
17 | ;; http://www.intel.com/design/network/manuals/8255x_opensdm.htm ;; |
18 | ;; ;; |
18 | ;; ;; |
19 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
19 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line -... | Line 20... | ||
- | 20 | ||
Line 20... | Line 21... | ||
20 | 21 | ;TODO: use more RX buffers |
|
21 | 22 | ||
Line 22... | Line 23... | ||
22 | format PE DLL native |
23 | format PE DLL native |
Line 375... | Line 376... | ||
375 | ; - Remove device from local list (device_list) |
376 | ; - Remove device from local list (device_list) |
376 | ; - call unregister function in kernel |
377 | ; - call unregister function in kernel |
377 | ; - Remove all allocated structures and buffers the card used |
378 | ; - Remove all allocated structures and buffers the card used |
Line 378... | Line 379... | ||
378 | 379 | ||
379 | or eax,-1 |
- | |
380 | 380 | or eax, -1 |
|
Line 381... | Line 381... | ||
381 | ret |
381 | ret |
382 | 382 | ||
Line 609... | Line 609... | ||
609 | mov [ebx + device.rx_desc], eax |
609 | mov [ebx + device.rx_desc], eax |
610 | mov esi, eax |
610 | mov esi, eax |
611 | invoke GetPhysAddr |
611 | invoke GetPhysAddr |
612 | add eax, NET_BUFF.data |
612 | add eax, NET_BUFF.data |
613 | mov [esi + sizeof.NET_BUFF + rxfd.status], 0x0000 |
613 | mov [esi + sizeof.NET_BUFF + rxfd.status], 0x0000 |
614 | mov [esi + sizeof.NET_BUFF + rxfd.command], 0x0000 |
614 | mov [esi + sizeof.NET_BUFF + rxfd.command], 0xc000 ; End of list + Suspend |
615 | mov [esi + sizeof.NET_BUFF + rxfd.link], eax |
615 | mov [esi + sizeof.NET_BUFF + rxfd.link], eax |
616 | mov [esi + sizeof.NET_BUFF + rxfd.count], 0 |
616 | mov [esi + sizeof.NET_BUFF + rxfd.count], 0 |
617 | mov [esi + sizeof.NET_BUFF + rxfd.size], 1528 |
617 | mov [esi + sizeof.NET_BUFF + rxfd.size], 1528 |
Line 618... | Line 618... | ||
618 | 618 | ||
Line 619... | Line 619... | ||
619 | ret |
619 | ret |
620 | - | ||
621 | .out_of_mem: |
620 | |
Line 835... | Line 834... | ||
835 | 834 | ||
Line 836... | Line 835... | ||
836 | ; restart RX |
835 | ; restart RX |
837 | 836 | ||
838 | set_io [ebx + device.io_addr], 0 |
837 | set_io [ebx + device.io_addr], 0 |
839 | set_io [ebx + device.io_addr], reg_scb_ptr |
838 | set_io [ebx + device.io_addr], reg_scb_ptr |
- | 839 | ; mov eax, [ebx + device.rx_desc] |
|
840 | ; lea eax, [ebx + device.rx_desc] |
840 | ; invoke GetPhysAddr |
Line 841... | Line 841... | ||
841 | ; invoke GetPhysAddr |
841 | ; add eax, NET_BUFF.data |
842 | out dx, eax |
842 | out dx, eax |
843 | 843 | ||
Line 888... | Line 888... | ||
888 | 888 | ||
889 | and ax, 00111100b |
889 | and ax, 00111100b |
890 | cmp ax, 00001000b |
890 | cmp ax, 00001000b |
Line 891... | Line 891... | ||
891 | jne .fail |
891 | jne .fail |
892 | - | ||
Line 893... | Line -... | ||
893 | DEBUGF 1, "out of resources!\n" |
- | |
894 | ; Restart the RX |
- | |
895 | 892 | ||
896 | ; allocate new descriptor |
- | |
897 | 893 | DEBUGF 2, "Out of resources!\n" |
|
898 | invoke KernelAlloc, 2000 |
894 | |
899 | mov [ebx + device.rx_desc], eax |
- | |
900 | mov esi, eax |
- | |
901 | invoke GetPhysAddr |
- | |
902 | mov [esi + rxfd.status], 0x0000 |
- | |
903 | mov [esi + rxfd.command], 0xc000 ; End of list + Suspend |
- | |
Line 904... | Line 895... | ||
904 | mov [esi + rxfd.link], eax |
895 | ; call init_rx_ring |
905 | mov [esi + rxfd.count], 0 |
- | |
906 | mov [esi + rxfd.size], 1528 |
896 | ; test eax, eax |
907 | 897 | ; jz .fail |
|
908 | ; restart RX |
898 | |
909 | 899 | ; restart RX |
|
- | 900 | set_io [ebx + device.io_addr], 0 |
|
910 | set_io [ebx + device.io_addr], 0 |
901 | set_io [ebx + device.io_addr], reg_scb_ptr |
Line 911... | Line 902... | ||
911 | set_io [ebx + device.io_addr], reg_scb_ptr |
902 | mov eax, [ebx + device.rx_desc] |
912 | ; lea eax, [ebx + device.rx_desc] |
903 | invoke GetPhysAddr |
913 | ; invoke GetPhysAddr |
904 | add eax, NET_BUFF.data |