Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 22 Apr 2002 06:59:31 +0700 (NOVST)
From:      "Semen A. Ustimenko" <semenu@FreeBSD.org>
To:        Bill Paul <wpaul@FreeBSD.org>
Cc:        freebsd-hackers@FreeBSD.org
Subject:   Re: MIIBUS_MEDIAINIT method
Message-ID:  <20020422061252.N2315-100000@def.the.net>
In-Reply-To: <20020421230424.9B4B637B400@hub.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help

Pretty clear now... Thanks! See below...

On Sun, 21 Apr 2002, Bill Paul wrote:

> > then the method will be called twice, and some NIC drivers (tx, xl, dc,
> > maybe more) will not behave well.
>
> They work fine if the author of the MAC driver was smart enough to check
> for this in his mediainit method and just return immmediately if the
> auxilliary media types have already been ifmedia_add()ed.
The authors of above drivers do not. :) I bet they didn't know...

And a quest: how will you know inside YOURMAC_miibus_mediainit() that this
is the call from the *last* PHY? (Not critical, but...)

> > Isn't it reasonable to stop all PHY drivers from calling MEDIAINIT, and
> > call it once per miibus instance in miibus_attach() or miibus_probe()
> > instead?
>
> No. We want the PHY driver to set up its media types in the ifmedia
> struct first, and then add our own after those, which means we have
> to wait until the end of the PHY's attach routine, and it's newbus
> that calls the attach routines, not the miibus code.
>
Ah, my bad... You're rigth. This is the main point - there is no place
which would be more appropriate to notify MAC driver about PHY attachement
completion.

Well.... But this isn't very nice...

As long as MEDIAINIT method is called per every PHY, it should at least
contain a PHY-identifying argument, i think... Yet mii_inst would be
enough, even to solve the ``quest above''. This way somebody could do
per-PHY tricks in MAC driver :)

If you really need to spot the all-PHYs-atachment-completion-event, then
you must await it from miibus device, i think.

> If you have a card or hardware configuration which is actually
> causing the scenario you describe, then say so.
No, I don't. But who knows what NIC there can exist?

> Otherwise, keep your fingers out of this code. No user-servicable parts
> inside. Keep out of children. Do not look into laser optics with
> remaining eye.
>
:) OK... As you say...

Just one more question:

Will the MIIBUS_LINKCHG method be MFCed?

Thanks!


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020422061252.N2315-100000>