Subject: None
To: Christoph Kaegi <kgc@zhwin.ch>
From: Jonathan Stone <jonathan@dsg.stanford.edu>
List: tech-net
Date: 01/29/2005 14:46:47
In message <20050128143401.GA25506@zhwin.ch>,
Christoph Kaegi writes:

>This is a reply to a thread from December 2004.

[...]

>Thanks alot to Li Mingyu for the patch he provided.
>With this, the NICs are working and the system is now 
>running as a firewall with considerable load.
>It's only one day so far, but there's no problem until know.
>
>Maybe this could be integrated into the NetBSD sourcecode?

I dont think the change is suitable as it stands. THe patch from Li
Mingyu works well for you, but the commented-lines out lines are
actually necessary for other flavours of Pro/1000 chip.

I don't recally exactly which flavour of chip/PHY/TBI you have.
But can you try remove Li Minguy's // comments, then modifying the
if() statements to also check for the chip flavour you have, so the
if() before pci_decompose_tag() succeeds for your chip flavour --- if
((...)|| your chip) --- , and the if() before the sc->sc_ctrl fails
for your chip --- if ((...) && !(your chip) ---- and test it, then
that'd be a reaonable candidate for a commit.

Is there an open PR for this issue?


[[thanks for patch, etc. snipped]]

>On 07.12-19:33, Li Mingyu wrote:
>> The kernel you mailed me can't work well, cause it is a scsi driver.
>> So I don't have a real test on my board. But you can try the following way:
>> in src/sys/pci/if_wm.c
>> 1.
>> 	/*
>> 	 * Toggle the LSB of the MAC address on the second port
>> 	 * of the i82546.
>> 	 */
>> 	if (sc->sc_type == WM_T_82546 || sc->sc_type == WM_T_82546_3) {
>> //		if ((CSR_READ(sc, WMREG_STATUS) >> STATUS_FUNCID_SHIFT) & 1)
>> 		pci_decompose_tag(pc, pa->pa_tag, NULL, NULL, &function);
>> 		if (function == 1)
>> 		{
>> 			enaddr[5] ^= 1;
>> 			CSR_WRITE(sc, WMREG_STATUS, CSR_READ(sc,
>> WMREG_STATUS) | 0x04);
>> 		}
>> 	}
>> 2.
>> 
>> //	if (cfg1 & EEPROM_CFG1_ILOS)
>> //		sc->sc_ctrl |= CTRL_ILOS;
>> 	sc->sc_ctrl &= ~(0x1 << 21);
>> 
>> then you can ping a host(A) from the host(B)  with the new kernel to test if
>> the PHY can send the packets out.
>> for example, sniffer the packets on host A, if the driver is OK, you can
>> receive the ARP request packet from host B.
>> 
>> Any question, plx feel free to contact me.
>>  
>> 
>
>-- 
>----------------------------------------------------------------------
>Christoph Kaegi                                           kgc@zhwin.ch
>----------------------------------------------------------------------