Re: AW: AW: AW: [PATCH net] net: usb: lan78xx: restore VLAN filter table after device reset
From: Nicolai Buchwitz
Date: Fri Jun 19 2026 - 10:03:30 EST
Hi Sven
On 19.6.2026 15:31, Sven Schuchmann wrote:
Hello Nicolai,
looks good from my point of view
(Calling the lan78xx_write_vlan_table() from
lan78xx_mac_link_up() and from lan78xx_reset()).
Thanks.
But I investigated a little more and it seems the hash table
(which is right behind the vlan table in the controllers memory)
also gets cleared. I wrote some random data into this table and have
seen that it gets also cleared. I think this needs to be fixed too.
Something like
static int lan78xx_write_mchash_table(struct lan78xx_net *dev)
{
struct lan78xx_priv *pdata = (struct lan78xx_priv *)(dev->data[0]);
return lan78xx_dataport_write(dev, DP_SEL_RSEL_VLAN_DA_,
DP_SEL_VHF_VLAN_LEN,
DP_SEL_VHF_HASH_LEN, pdata->mchash_table); // from lan78xx_deferred_multicast_write)
}
with callers in lan78xx_deferred_multicast_write() and lan78xx_mac_link_up(), should
do the trick?
In the Datasheet from the LAN7801 I can read:
"After a reset event, the RFE will automatically initialize the contents of the VHF to 0h."
Where VHF also refers to the hash table.
But I still do not understand what reset is happening when I just unplug the network cable....
I suspect it is triggered from the PHY:
8.10 (MAC Reset Watchdog Timer):
"A portion of the MAC operates on clocks generated by the Ethernet PHY [...] PHY Reset
(PHY_RST) results in resetting the portion of the MAC operating on the PHY receive and
transmit clocks."
So which PHY are you using?
[...]
Thanks,
Nicolai