Module Name:    src
Committed By:   jmcneill
Date:           Tue Feb 22 01:11:30 UTC 2011

Modified Files:
        src/sys/dev/usb: if_ural.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/sys/dev/usb/if_ural.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/usb/if_ural.c
diff -u src/sys/dev/usb/if_ural.c:1.36 src/sys/dev/usb/if_ural.c:1.37
--- src/sys/dev/usb/if_ural.c:1.36	Wed Nov  3 22:28:31 2010
+++ src/sys/dev/usb/if_ural.c	Tue Feb 22 01:11:30 2011
@@ -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

Reply via email to