link state with the new usb_net driver

Sebastian Sumpf Sebastian.Sumpf at genode-labs.com
Fri Feb 2 10:57:16 CET 2024


Hello Pirmin,

On 02.02.24 10:22, Pirmin Duss wrote:
> Hello Genodians
> 
> While testing my changed usb_net driver that supports SMSC95XX on arm_v8a I 
> discovered, that the link state isn't propagated to the connected nic_router as 
> it has been with the old version.
> 
> With the old driver the log output of nic_router was as follows when the cable 
> was connected/disconnected:
> 
> <connect cable>
> [init -> nic_router] [secondary_nic] NIC sessions: 1
> [init -> nic_router] [secondary_nic] dynamic IP config: interface 
> 10.10.10.10/16, ...
> 
> <disconnect cable>
> [init -> nic_router] [secondary_nic] dynamic IP config: none
> [init -> nic_router] [secondary_nic] NIC sessions: 0
> 
> 
> With the new driver nic_router always reports:
> 
> [init -> nic_router] [secondary_nic] NIC sessions: 1
> 
> 
> As I do not have any other devices that need the usb_net driver,
> I'm not sure, if this only happens for my driver or if this is consistent with 
> all other device types.
> 
> Could someone with an other usb_net driven device give me feedback, if
> other devices show the same log outputs?

It works and is tested for all drivers except SMC95xx, where it is not working. 
The reason is that the driver registers itself as an mdio driver for itself and 
uses the PHY and IRQ domain infrastructure (see: smsc95xx_bind -> 
phy_connect_direct) to track link state changes. The old Linux driver did not it 
this way and I have not taken the time to look into it because to enable the 
MDIO/PHY parts for virt_linux is non-trivial. You could try and find out how the 
old Linux driver implemented link-state changes and maybe there is an easier way 
to do it.

Btw, I had to patch the driver so it will not report link state down ("NIC 
sessions: 0") all the time ;)

Regards,

Sebastian

-- 
Sebastian Sumpf
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth







More information about the users mailing list