wkz / mdio-tools

Low-level debug tools for MDIO devices.
GNU General Public License v2.0
66 stars 31 forks source link

Device Auto Detection #22

Open wkz opened 1 year ago

wkz commented 1 year ago

It would be great if mdio could auto detect commonly used devices and let the user access them with a simple alias.

Ideas:

Create aliases based on:

  1. Associated netdev name, if available
  2. Object type combined with bus ID and address

Example usage:

root@box # mdio dev
DEV         TYPE     ADDR  BUS
mmd0-9      mmd       0x9  *et@30be0000!mdio!switch@4!mdio
mmd0-a      mmd       0xa  *et@30be0000!mdio!switch@4!mdio
eth3        mva       0x8  *et@30be0000!mdio!switch@4!mdio
eth4        mva       0x7  *et@30be0000!mdio!switch@4!mdio
mvls4-4     mvls      0x4  30be0000.ethernet-1
phy0-0      phy       0x0  *et@30be0000!mdio!switch@4!mdio
phy0-1      phy       0x1  *et@30be0000!mdio!switch@4!mdio
phy0-2      phy       0x2  *et@30be0000!mdio!switch@4!mdio
phy0-3      phy       0x3  *et@30be0000!mdio!switch@4!mdio
phy0-4      phy       0x4  *et@30be0000!mdio!switch@4!mdio
phy0-5      phy       0x5  *et@30be0000!mdio!switch@4!mdio
phy0-6      phy       0x6  *et@30be0000!mdio!switch@4!mdio

On such a system

etc.