summaryrefslogtreecommitdiffstats
path: root/sys/dev/if_ndis
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2004-01-27 07:57:42 +0000
committerwpaul <wpaul@FreeBSD.org>2004-01-27 07:57:42 +0000
commitcc4f21e732e8195537089aa832c883c45bbfd2e2 (patch)
tree6c56786d56335f77abd96c1667d8f74665de9b94 /sys/dev/if_ndis
parent3e473871199d01a31c6304bf16a91b85dd246566 (diff)
downloadFreeBSD-src-cc4f21e732e8195537089aa832c883c45bbfd2e2.zip
FreeBSD-src-cc4f21e732e8195537089aa832c883c45bbfd2e2.tar.gz
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.
Diffstat (limited to 'sys/dev/if_ndis')
-rw-r--r--sys/dev/if_ndis/if_ndis.c32
1 files changed, 22 insertions, 10 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index 6e6a2c2..ae2397e 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -1438,6 +1438,15 @@ ndis_init(xsc)
int i, error;
/*
+ * Avoid reintializing the link unnecessarily.
+ * This should be dealt with in a better way by
+ * fixing the upper layer modules so they don't
+ * call ifp->if_init() quite as often.
+ */
+ if (sc->ndis_link && sc->ndis_skip)
+ return;
+
+ /*
* Cancel pending I/O and free all RX/TX buffers.
*/
ndis_reset_nic(sc);
@@ -1589,13 +1598,6 @@ ndis_setstate_80211(sc)
if (!(ifp->if_flags & IFF_UP))
return;
- arg = NDIS_80211_AUTHMODE_AUTO;
- len = sizeof(arg);
- rval = ndis_set_info(sc, OID_802_11_AUTHENTICATION_MODE, &arg, &len);
-
- if (rval)
- device_printf (sc->ndis_dev, "set auth failed: %d\n", rval);
-
/* Set network infrastructure mode. */
len = sizeof(arg);
@@ -1667,12 +1669,20 @@ ndis_setstate_80211(sc)
ic->ic_wep_mode = IEEE80211_WEP_8021X;
}
#endif
+ arg = NDIS_80211_AUTHMODE_SHARED;
} else {
arg = NDIS_80211_WEPSTAT_DISABLED;
len = sizeof(arg);
ndis_set_info(sc, OID_802_11_WEP_STATUS, &arg, &len);
+ arg = NDIS_80211_AUTHMODE_OPEN;
}
+ len = sizeof(arg);
+ rval = ndis_set_info(sc, OID_802_11_AUTHENTICATION_MODE, &arg, &len);
+
+ if (rval)
+ device_printf (sc->ndis_dev, "set auth failed: %d\n", rval);
+
/* Set SSID. */
len = sizeof(ssid);
@@ -1992,8 +2002,8 @@ ndis_ioctl(ifp, command, data)
if (sc->ndis_80211) {
error = ieee80211_ioctl(ifp, command, data);
if (error == ENETRESET) {
- /*ndis_setstate_80211(sc);*/
- ndis_init(sc);
+ ndis_setstate_80211(sc);
+ /*ndis_init(sc);*/
error = 0;
}
} else
@@ -2019,6 +2029,7 @@ ndis_ioctl(ifp, command, data)
if (error != ENOTTY)
break;
default:
+ sc->ndis_skip = 1;
if (sc->ndis_80211) {
error = ieee80211_ioctl(ifp, command, data);
if (error == ENETRESET) {
@@ -2027,6 +2038,7 @@ ndis_ioctl(ifp, command, data)
}
} else
error = ether_ioctl(ifp, command, data);
+ sc->ndis_skip = 0;
break;
}
@@ -2205,7 +2217,7 @@ ndis_shutdown(dev)
device_t dev;
{
struct ndis_softc *sc;
-printf("dev shutting down...\n");
+
sc = device_get_softc(dev);
ndis_shutdown_nic(sc);
OpenPOWER on IntegriCloud