Subject: Re: Issue with Micrel PCI Network Driver.

From: Bjørn Mork <[email-masked]>
Date: Tue, 12 Feb 2013 11:10:59 +0100

Ben Hutchings <[email-masked]> writes:
> On Mon, 2013-02-11 at 17:46 +0000, Ben Hutchings wrote:
>> On Fri, 2013-02-08 at 17:17 -0600, Joseph Lutz wrote:
>> > I am having an issue with one of the network interface drivers. The 
>> > driver in question is 'drivers/net/ethernet/micrel/ksz884x.c', the 
>> > driver for the Micrel-Kendin device 8841.
>> > I am trying to get systemd to rename the three network interfaces in my 
>> > embedded atom system. I have one of the interfaces being renamed (an 
>> > Intel Corporation 82574L), but the two Micrel interfaces are not being 
>> > renamed. I traced this down to the driver not populating the 
>> > /sys/devices/pci* information. Instead it places the driver into 
>> > /sys/devices/virtual/net/.
>> [...]
>> 
>> Right, this driver doesn't specify the parent device (PCI device) for
>> the net devices it creates.
>> 
>> All you should need to is add:
>> 	SET_NETDEV_DEV(dev, pdev);
>> underneath the call to alloc_etherdev().
>
> Or rather:
> 	SET_NETDEV_DEV(dev, &pdev->dev);

That should of course be fixed.  But this bug should not prevent
userspace from renaming the device, should it? Sounds like a userspace
application making too many stupid assumptions to me.  Does it work for
network devices attached to other buses?

Bjørn