Subject: Re: DSA driver - how to glue to a PCI based NIC's mdio?

From: Andrew Lunn <[email-masked]>
Date: Wed, 30 Sep 2015 23:40:52 +0200

> > information to the NIC's device driver. Better would be to have a
> > small shim driver which is loaded on your PCI_ID/DEVICE_ID. That would
> > instantiate the NIC driver, and insert a DSA platform device.
> 
> I was thinking of this as well, but then I would still need that shim
> to know the netdevice that the driver I'm shimming creates so I can't
> figure a way to do it without touching the PCI driver.

You can probably get that from the PCI information you have:

# /sys/devices/pci0000:00/0000:00:1c.2/0000:06:00.0 is the PCIe device. And it has

# /sys/devices/pci0000:00/0000:00:1c.2/0000:06:00.0/net$ ls -l
total 0
drwxr-xr-x 5 root root 0 Aug 19 18:23 eth0

So the linking is there.

   Andrew