Extending sys/dev/mii

Marius Strobl marius at alchemy.franken.de
Fri Jan 27 14:16:01 UTC 2012


On Thu, Jan 26, 2012 at 05:25:02PM +0100, Hans Petter Selasky wrote:
> On Thursday 26 January 2012 17:25:09 Stefan Bethke wrote:
> > Am 25.01.2012 um 23:17 schrieb Marius Strobl:
> > > On Sat, Jan 21, 2012 at 12:08:34AM +0100, Stefan Bethke wrote:
> > >> - miibus has a funny way of attaching to it's parent.  Making the parent
> > >> a bus that automatically attaches matching children does not lead to
> > >> good results.
> > > 
> > > That's the idea behind auto-probing, which all FreeBSD bus drivers
> > > implement as far as the physical bus supports it.
> > 
> > Sorry, I should have been more specific.  I had problems when the device
> > that miibus attaches to implements autoprobing and auto-attaches miibus
> > directly, instead of through mii_attach().
> > 
> 
> Hi,
> 
> While staying at the topic. All unneccesary panic() statements should be 
> removed from mii() drivers. Sometimes, when you unplug a USB network device, a 
> mii read can fail and that should not crash the system!
> 

Uhm, there's a single KASSERT() in mii_phy_setmedia() that you also
can only hit when actually trying to set invalid media but otherwise
there's no call to panic() in sys/dev/mii/*. If you are seeing panics
due to MII access failing these must be triggered by upper layers.

Marius



More information about the freebsd-arch mailing list