Re: events when (de)associating or when cable is (un)plugged

From: Vincent Jardin (vjardin_at_free.fr)
Date: 03/27/04

  • Next message: M. Warner Losh: "Re: usbd config file parse behaviour"
    To: Bruce M Simpson <bms@spc.org>, Dirk-Willem van Gulik <dirkx@asemantics.com>
    Date: Sat, 27 Mar 2004 19:18:16 +0100
    
    

    See NetBSD mii source code too:
    They announce when a cable is plugged and unplugged on the routing socket.

    mii_physubr.c
     ...
    void
    mii_phy_update(struct mii_softc *sc, int cmd)
    {
            struct mii_data *mii = sc->mii_pdata;
            int announce, s;

            if (sc->mii_media_active != mii->mii_media_active ||
                sc->mii_media_status != mii->mii_media_status ||
                cmd == MII_MEDIACHG) {
                    announce = mii_phy_statusmsg(sc);
                    (*mii->mii_statchg)(sc->mii_dev.dv_parent);
                    sc->mii_media_active = mii->mii_media_active;
                    sc->mii_media_status = mii->mii_media_status;

                    if (announce) {
                            s = splnet();
                            rt_ifmsg(mii->mii_ifp);
                            splx(s);
                    }
            }
    }

    Regards,
      Vincent

    On Saturday 27 March 2004 18:56, Bruce M Simpson wrote:
    > On Sat, Mar 27, 2004 at 03:37:44AM +0100, Dirk-Willem van Gulik wrote:
    > > Suleiman,
    > >
    > > Thanks for all the help - I just hacked up the patch below and took
    > > http://green.homeunix.org/~green/linkwatcher.c for testing. I also
    > > had to add the LINKUP/DOWN in some non-mii using ethernet
    > > cards (as only miibus(4) seems to issue this event).
    >
    > Nice! I'll take a more indepth look at this when less pressed. Keep on
    > hacking. Would be nice to hook up with the WirelessLeiden folks too...
    >
    > Good stuff,
    > BMS
    > _______________________________________________
    > freebsd-hackers@freebsd.org mailing list
    > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
    _______________________________________________
    freebsd-hackers@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
    To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"


  • Next message: M. Warner Losh: "Re: usbd config file parse behaviour"