Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/mii - Go to splimp() when sending the rtsock message...



details:   https://anonhg.NetBSD.org/src/rev/dcc4183c8090
branches:  trunk
changeset: 483683:dcc4183c8090
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Mar 15 20:34:43 2000 +0000

description:
- Go to splimp() when sending the rtsock message regarding link status.
- Would like to notify protocols if a link goes up or down, to e.g.
  restart Duplicate Address Detection, etc.  Add a comment to this
  effect.

diffstat:

 sys/dev/mii/mii_physubr.c |  14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diffs (43 lines):

diff -r 20f5f223140d -r dcc4183c8090 sys/dev/mii/mii_physubr.c
--- a/sys/dev/mii/mii_physubr.c Wed Mar 15 18:39:50 2000 +0000
+++ b/sys/dev/mii/mii_physubr.c Wed Mar 15 20:34:43 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: mii_physubr.c,v 1.15 2000/03/06 20:56:57 thorpej Exp $ */
+/*     $NetBSD: mii_physubr.c,v 1.16 2000/03/15 20:34:43 thorpej Exp $ */
 
 /*-
  * Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@@ -277,7 +277,7 @@
 {
        struct mii_data *mii = sc->mii_pdata;
        struct ifnet *ifp = mii->mii_ifp;
-       int baudrate, link_state, announce = 0;
+       int s, baudrate, link_state, announce = 0;
 
        if (mii->mii_media_status & IFM_AVALID) {
                if (mii->mii_media_status & IFM_ACTIVE)
@@ -291,6 +291,11 @@
 
        if (link_state != ifp->if_link_state) {
                ifp->if_link_state = link_state;
+               /*
+                * XXX Right here we'd like to notify protocols
+                * XXX that the link status has changed, so that
+                * XXX e.g. Duplicate Address Detection can restart.
+                */
                announce = 1;
        }
 
@@ -299,8 +304,11 @@
                announce = 1;
        }
 
-       if (announce)
+       if (announce) {
+               s = splimp();   /* XXX Should be splnet() */
                rt_ifmsg(ifp);
+               splx(s);
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index