Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 27 Jan 2004 09:59:59 -0800
From:      Sam Leffler <sam@errno.com>
To:        Bill Paul <wpaul@FreeBSD.org>, src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   Re: cvs commit: src/sys/dev/if_ndis if_ndis.c
Message-ID:  <200401270959.59072.sam@errno.com>
In-Reply-To: <200401270757.i0R7vhdU000442@repoman.freebsd.org>
References:  <200401270757.i0R7vhdU000442@repoman.freebsd.org>

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

--Boundary-00=_fcqFArRKLzffq33
Content-Type: text/plain;
  charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

On Monday 26 January 2004 11:57 pm, Bill Paul wrote:
> wpaul       2004/01/26 23:57:42 PST
>
>   FreeBSD src repository
>
>   Modified files:
>     sys/dev/if_ndis      if_ndis.c
>   Log:
>   Add a kludge to avoid having ndis_init() called needlessly by dhclient
>   on an SIOCSIFADDR (by way of brain damage in net80211).
>
>   Also, avoid trying to set NDIS_80211_AUTHMODE_AUTO since the Microsoft
>   documentation I have recommends not using it, and the Centrino driver
>   seems to dislike being told to use it.

Attached is the patch I sent you a while back to fix the issue you're working 
around.  It works for me on wi and ath devices but I didn't commit because I 
received zero feedback.  If others will test it I'll commit it and you can 
(probably) remove your hack.

	Sam

--Boundary-00=_fcqFArRKLzffq33
Content-Type: text/x-diff;
  charset="iso-8859-1";
  name="net80211.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
	filename="net80211.patch"

? net80211.patch
Index: ieee80211_ioctl.c
===================================================================
RCS file: /home/ncvs/src/sys/net80211/ieee80211_ioctl.c,v
retrieving revision 1.11
diff -u -r1.11 ieee80211_ioctl.c
--- ieee80211_ioctl.c	19 Jan 2004 05:25:43 -0000	1.11
+++ ieee80211_ioctl.c	27 Jan 2004 17:53:10 -0000
@@ -49,6 +49,16 @@
 #include <net/if_media.h>
 #include <net/ethernet.h>
 
+#ifdef INET
+#include <netinet/in.h>
+#include <netinet/if_ether.h>
+#endif
+
+#ifdef IPX
+#include <netipx/ipx.h>
+#include <netipx/ipx_if.h>
+#endif
+
 #include <net80211/ieee80211_var.h>
 #include <net80211/ieee80211_ioctl.h>
 
@@ -756,6 +766,7 @@
 	u_int8_t tmpkey[IEEE80211_KEYBUF_SIZE];
 	char tmpssid[IEEE80211_NWID_LEN];
 	struct ieee80211_channel *chan;
+	struct ifaddr *ifa;			/* XXX */
 
 	switch (cmd) {
 	case SIOCSIFMEDIA:
@@ -1017,6 +1028,51 @@
 	case SIOCG80211STATS:
 		ifr = (struct ifreq *)data;
 		copyout(&ic->ic_stats, ifr->ifr_data, sizeof (ic->ic_stats));
+		break;
+	case SIOCSIFADDR:
+		/*
+		 * XXX Handle this directly so we can supress if_init calls.
+		 * XXX This should be done in ether_ioctl but for the moment
+		 * XXX there are too many other parts of the system that
+		 * XXX set IFF_UP and so supress if_init being called when
+		 * XXX it should be.
+		 */
+		ifa = (struct ifaddr *) data;
+		switch (ifa->ifa_addr->sa_family) {
+#ifdef INET
+		case AF_INET:
+			if ((ifp->if_flags & IFF_UP) == 0) {
+				ifp->if_flags |= IFF_UP;
+				ifp->if_init(ifp->if_softc);
+			}
+			arp_ifinit(ifp, ifa);
+			break;
+#endif
+#ifdef IPX
+		/*
+		 * XXX - This code is probably wrong,
+		 *	 but has been copied many times.
+		 */
+		case AF_IPX: {
+			struct ipx_addr *ina = &(IA_SIPX(ifa)->sipx_addr);
+			struct arpcom *ac = (struct arpcom *)ifp;
+
+			if (ipx_nullhost(*ina))
+				ina->x_host = *(union ipx_host *) ac->ac_enaddr;
+			else
+				bcopy((caddr_t) ina->x_host.c_host,
+				      (caddr_t) ac->ac_enaddr,
+				      sizeof(ac->ac_enaddr));
+			/* fall thru... */
+		}
+#endif
+		default:
+			if ((ifp->if_flags & IFF_UP) == 0) {
+				ifp->if_flags |= IFF_UP;
+				ifp->if_init(ifp->if_softc);
+			}
+			break;
+		}
 		break;
 	case SIOCSIFMTU:
 		ifr = (struct ifreq *)data;

--Boundary-00=_fcqFArRKLzffq33--



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