550,7 → 550,8 |
jz @f |
and eax,PCI_BASE_ADDRESS_IO_MASK |
jmp .exit |
@@: push eax |
@@: |
push eax |
and eax,PCI_BASE_ADDRESS_MEM_TYPE_MASK |
cmp eax,PCI_BASE_ADDRESS_MEM_TYPE_64 |
jne .not64 |
583,7 → 584,8 |
|
; Check that the chip has finished the reset |
mov ecx,1000 |
@@: RTL_R8 RTL8169_REG_ChipCmd |
@@: |
RTL_R8 RTL8169_REG_ChipCmd |
test al,RTL8169_CMD_Reset |
jz @f |
stdcall udelay,10 |
594,7 → 596,8 |
and eax,0x7c800000 |
; DEBUGF 1,"K : rtl8169_init_board: TxConfig & 0x7c800000 = 0x%x\n",eax |
mov esi,mac_info-8 |
@@: add esi,8 |
@@: |
add esi, 8 |
mov ecx,eax |
and ecx,[esi] |
cmp ecx,[esi] |
609,7 → 612,8 |
jnz @f |
mov [rtl8169_tpc.pcfg],PCFG_METHOD_1 |
jmp .pconf |
@@: dec al |
@@: |
dec al |
jnz .pconf |
mov [rtl8169_tpc.pcfg],PCFG_METHOD_2 |
.pconf: |
617,7 → 621,8 |
; identify chip attached to board |
mov ecx,10 |
mov eax,[rtl8169_tpc.mcfg] |
@@: dec ecx |
@@: |
dec ecx |
js @f |
cmp eax,[rtl_chip_info+ecx*8] |
jne @b |
661,7 → 666,8 |
je @f |
cmp [rtl8169_tpc.mcfg],MCFG_METHOD_03 |
jne .not_2_or_3 |
@@: stdcall RTL8169_WRITE_GMII_REG,0x1F,0x0001 |
@@: |
stdcall RTL8169_WRITE_GMII_REG, 0x1F, 0x0001 |
stdcall RTL8169_WRITE_GMII_REG,0x15,0x1000 |
stdcall RTL8169_WRITE_GMII_REG,0x18,0x65C7 |
stdcall RTL8169_WRITE_GMII_REG,0x04,0x0000 |
727,7 → 733,8 |
|
mov ecx,2000 |
; Check if the RTL8169 has completed writing to the specified MII register |
@@: RTL_R32 RTL8169_REG_PHYAR |
@@: |
RTL_R32 RTL8169_REG_PHYAR |
test eax,0x80000000 |
jz .exit |
stdcall udelay,1 ;;;100 |
749,7 → 756,8 |
|
mov ecx,2000 |
; Check if the RTL8169 has completed retrieving data from the specified MII register |
@@: RTL_R32 RTL8169_REG_PHYAR |
@@: |
RTL_R32 RTL8169_REG_PHYAR |
test eax,0x80000000 |
jnz .exit |
stdcall udelay,1 ;;;100 |
802,7 → 810,8 |
mov edi,rtl8169_tpc.Tx_skbuff |
mov eax,rtl8169_txb |
mov ecx,NUM_TX_DESC |
@@: stosd |
@@: |
stosd |
inc eax ; add eax,RX_BUF_SIZE ??? |
loop @b |
|
818,7 → 827,8 |
mov edi,[rtl8169_tpc.RxDescArray] |
mov eax,rtl8169_rxb |
mov ecx,NUM_RX_DESC |
@@: mov [esi],eax |
@@: |
mov [esi], eax |
mov [edi+rtl8169_RxDesc.buf_addr],eax |
sub [edi+rtl8169_RxDesc.buf_addr],OS_BASE ; shurf 28.09.2008 |
mov [edi+rtl8169_RxDesc.status],RTL8169_DSB_OWNbit or RX_BUF_SIZE |
840,7 → 850,8 |
RTL_W8 RTL8169_REG_ChipCmd,RTL8169_CMD_Reset |
; Check that the chip has finished the reset |
mov ecx,1000 |
@@: RTL_R8 RTL8169_REG_ChipCmd |
@@: |
RTL_R8 RTL8169_REG_ChipCmd |
and al,RTL8169_CMD_Reset |
jz @f |
stdcall udelay,10 |
872,7 → 883,8 |
; DEBUGF 1,"K : Set MAC Reg C+CR Offset 0xE0: bit-3 and bit-14\n" |
jmp .set |
@@:;DEBUGF 1,"K : Set MAC Reg C+CR Offset 0xE0: bit-3\n" |
.set: RTL_W16 RTL8169_REG_CPlusCmd,ax |
.set: |
RTL_W16 RTL8169_REG_CPlusCmd,ax |
|
; RTL_W16 0xE2,0x1517 |
; RTL_W16 0xE2,0x152a |
929,7 → 941,8 |
add edx,RTL8169_REG_MAC0 |
xor ebx,ebx |
; Get MAC address. FIXME: read EEPROM |
@@: RTL_R8 dx |
@@: |
RTL_R8 dx |
mov [node_addr+ebx],al |
inc edx |
inc ebx |
969,7 → 982,8 |
stdcall udelay,100 |
mov ecx,10000 |
; wait for auto-negotiation process |
@@: dec ecx |
@@: |
dec ecx |
jz @f |
stdcall RTL8169_READ_GMII_REG,RTL8169_PHY_STAT_REG |
stdcall udelay,100 |
1081,12 → 1095,14 |
and ecx,0x0FFF |
xor al,al |
add edi,ecx |
@@: cmp ecx,ETH_ZLEN |
@@: |
cmp ecx, ETH_ZLEN |
jae @f |
stosb |
inc ecx |
jmp @b |
@@: pop eax |
@@: |
pop eax |
|
mov ebx,eax |
mov eax,sizeof.rtl8169_TxDesc |
1100,11 → 1116,13 |
cmp eax,ETH_ZLEN |
jae @f |
mov eax,ETH_ZLEN |
@@: or eax,RTL8169_DSB_OWNbit or RTL8169_DSB_FSbit or RTL8169_DSB_LSbit |
@@: |
or eax, RTL8169_DSB_OWNbit or RTL8169_DSB_FSbit or RTL8169_DSB_LSbit |
cmp [rtl8169_tpc.cur_tx],NUM_TX_DESC - 1 |
jne @f |
or eax,RTL8169_DSB_EORbit |
@@: mov [ebx + rtl8169_TxDesc.status],eax |
@@: |
mov [ebx + rtl8169_TxDesc.status], eax |
|
RTL_W8 RTL8169_REG_TxPoll,0x40 ; set polling bit |
|
1114,7 → 1132,8 |
;!!! to = currticks() + TX_TIMEOUT; |
;!!! while ((tpc->TxDescArray[entry].status & OWNbit) && (currticks() < to)); /* wait */ |
mov ecx,TX_TIMEOUT / 10 |
@@: test [ebx + rtl8169_TxDesc.status],RTL8169_DSB_OWNbit |
@@: |
test [ebx + rtl8169_TxDesc.status], RTL8169_DSB_OWNbit |
jnz @f |
stdcall udelay,10 |
loop @b |
1195,7 → 1214,8 |
cmp [rtl8169_tpc.cur_rx],NUM_RX_DESC - 1 |
jne @f |
or eax,RTL8169_DSB_EORbit |
@@: mov [ebx + rtl8169_RxDesc.status],eax |
@@: |
mov [ebx + rtl8169_RxDesc.status], eax |
|
mov [ebx + rtl8169_RxDesc.buf_addr],edx |
sub [ebx + rtl8169_RxDesc.buf_addr],OS_BASE ; shurf 28.09.2008 |
Property changes: |
Added: svn:eol-style |
+native |
\ No newline at end of property |