Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb make ural_ioctl look like other wireless drivers...



details:   https://anonhg.NetBSD.org/src/rev/2adc392862cf
branches:  trunk
changeset: 762497:2adc392862cf
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Tue Feb 22 01:11:30 2011 +0000

description:
make ural_ioctl look like other wireless drivers, should make dhcpcd and
mdnsd work again

diffstat:

 sys/dev/usb/if_ural.c |  19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diffs (59 lines):

diff -r a049310a8d79 -r 2adc392862cf sys/dev/usb/if_ural.c
--- a/sys/dev/usb/if_ural.c     Tue Feb 22 00:58:08 2011 +0000
+++ b/sys/dev/usb/if_ural.c     Tue Feb 22 01:11:30 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_ural.c,v 1.36 2010/11/03 22:28:31 dyoung Exp $ */
+/*     $NetBSD: if_ural.c,v 1.37 2011/02/22 01:11:30 jmcneill Exp $ */
 /*     $FreeBSD: /repoman/r/ncvs/src/sys/dev/usb/if_ural.c,v 1.40 2006/06/02 23:14:40 sam Exp $        */
 
 /*-
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.36 2010/11/03 22:28:31 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_ural.c,v 1.37 2011/02/22 01:11:30 jmcneill Exp $");
 
 
 #include <sys/param.h>
@@ -1486,6 +1486,9 @@
 Static int
 ural_ioctl(struct ifnet *ifp, u_long cmd, void *data)
 {
+#define IS_RUNNING(ifp) \
+       (((ifp)->if_flags & IFF_UP) && ((ifp)->if_flags & IFF_RUNNING))
+
        struct ural_softc *sc = ifp->if_softc;
        struct ieee80211com *ic = &sc->sc_ic;
        int s, error = 0;
@@ -1512,13 +1515,20 @@
                }
                break;
 
+       case SIOCADDMULTI:
+       case SIOCDELMULTI:
+               if ((error = ether_ioctl(ifp, cmd, data)) == ENETRESET) {
+                       error = 0;
+               }
+               break;
+
        default:
                error = ieee80211_ioctl(ic, cmd, data);
        }
 
        if (error == ENETRESET) {
-               if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
-                   (IFF_UP | IFF_RUNNING))
+               if (IS_RUNNING(ifp) &&
+                       (ic->ic_roaming != IEEE80211_ROAMING_MANUAL))
                        ural_init(ifp);
                error = 0;
        }
@@ -1526,6 +1536,7 @@
        splx(s);
 
        return error;
+#undef IS_RUNNING
 }
 
 Static void



Home | Main Index | Thread Index | Old Index