Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 27 Jan 2008 19:08:33 GMT
From:      Sam Leffler <sam@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 134226 for review
Message-ID:  <200801271908.m0RJ8XtS031464@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=134226

Change 134226 by sam@sam_ebb on 2008/01/27 19:08:32

	add a public function ieee80211_node_deauth to drop a station
	associated to an ap vap; useful for drivers that need to drop
	a station for various reasons

Affected files ...

.. //depot/projects/vap/sys/net80211/ieee80211_hostap.c#6 edit
.. //depot/projects/vap/sys/net80211/ieee80211_node.c#20 edit
.. //depot/projects/vap/sys/net80211/ieee80211_node.h#13 edit

Differences ...

==== //depot/projects/vap/sys/net80211/ieee80211_hostap.c#6 (text+ko) ====

@@ -1505,8 +1505,7 @@
 
 	return 1;
 bad:
-	IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DEAUTH, reason);
-	ieee80211_node_leave(ni);
+	ieee80211_node_deauth(ni, reason);
 	return 0;
 }
 

==== //depot/projects/vap/sys/net80211/ieee80211_node.c#20 (text+ko) ====

@@ -721,6 +721,20 @@
 	ieee80211_notify_node_leave(ni);
 }
 
+/*
+ * Send a deauthenticate frame and drop the station.
+ */
+void
+ieee80211_node_deauth(struct ieee80211_node *ni, int reason)
+{
+	/* NB: bump the refcnt to be sure temporay nodes are not reclaimed */
+	ieee80211_ref_node(ni);
+	if (ni->ni_associd != 0)
+		IEEE80211_SEND_MGMT(ni, IEEE80211_FC0_SUBTYPE_DEAUTH, reason);
+	ieee80211_node_leave(ni);
+	ieee80211_free_node(ni);
+}
+
 static struct ieee80211_node *
 node_alloc(struct ieee80211_node_table *nt)
 {

==== //depot/projects/vap/sys/net80211/ieee80211_node.h#13 (text+ko) ====

@@ -275,6 +275,7 @@
 int	ieee80211_sta_join(struct ieee80211vap *,
 		const struct ieee80211_scan_entry *);
 void	ieee80211_sta_leave(struct ieee80211_node *);
+void	ieee80211_node_deauth(struct ieee80211_node *, int);
 
 int	ieee80211_ies_init(struct ieee80211_ies *, const uint8_t *, int);
 void	ieee80211_ies_cleanup(struct ieee80211_ies *);



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