summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorsam <sam@FreeBSD.org>2005-01-27 17:39:17 +0000
committersam <sam@FreeBSD.org>2005-01-27 17:39:17 +0000
commit217734da8444808c7ae715f08255313cd0fe44a4 (patch)
treea4c3aba54580b06158d4b18a6416daec85814346 /sys
parentb7940dca39fef56a68fe9e9e5ce9d46dd895a89b (diff)
downloadFreeBSD-src-217734da8444808c7ae715f08255313cd0fe44a4.zip
FreeBSD-src-217734da8444808c7ae715f08255313cd0fe44a4.tar.gz
supply a default ic_reset method for drivers; the ioctl code expect this
method to always be setup Submitted by: Tai-hwa Liang
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/sys/net80211/ieee80211.c b/sys/net80211/ieee80211.c
index 98dba5f..b25f047 100644
--- a/sys/net80211/ieee80211.c
+++ b/sys/net80211/ieee80211.c
@@ -103,6 +103,21 @@ ieee80211_remove_vap(struct ieee80211com *ic)
mtx_unlock(&ieee80211_vap_mtx);
}
+/*
+ * Default reset method for use with the ioctl support. This
+ * method is invoked after any state change in the 802.11
+ * layer that should be propagated to the hardware but not
+ * require re-initialization of the 802.11 state machine (e.g
+ * rescanning for an ap). We always return ENETRESET which
+ * should cause the driver to re-initialize the device. Drivers
+ * can override this method to implement more optimized support.
+ */
+static int
+ieee80211_default_reset(struct ifnet *ifp)
+{
+ return ENETRESET;
+}
+
void
ieee80211_ifattach(struct ieee80211com *ic)
{
@@ -181,6 +196,13 @@ ieee80211_ifattach(struct ieee80211com *ic)
ieee80211_add_vap(ic);
ieee80211_sysctl_attach(ic); /* NB: requires ic_vap */
+
+ /*
+ * Install a default reset method for the ioctl support.
+ * The driver is expected to fill this in before calling us.
+ */
+ if (ic->ic_reset == NULL)
+ ic->ic_reset = ieee80211_default_reset;
}
void
OpenPOWER on IntegriCloud