[Zrouter-src-freebsd] ZRouter.org: push to FreeBSD HEAD tree

zrouter-src-freebsd at zrouter.org zrouter-src-freebsd at zrouter.org
Fri Mar 2 15:40:18 UTC 2012


details:   http://zrouter.org/hg/FreeBSD/head//rev/94ee7312d4f7
changeset: 408:94ee7312d4f7
user:      ray at terran.dlink.ua
date:      Fri Mar 02 17:20:40 2012 +0200
description:
Update to FreeBSD-HEAD @232391

diffstat:

 head/sys/net80211/ieee80211.h          |  75 ++++++++++++++++++---------------
 head/sys/net80211/ieee80211_input.c    |   5 +-
 head/sys/net80211/ieee80211_ioctl.h    |   5 +-
 head/sys/net80211/ieee80211_mesh.c     |  35 +++++++--------
 head/sys/net80211/ieee80211_mesh.h     |  66 +++++++++++++++++++++++------
 head/sys/net80211/ieee80211_node.h     |   4 +-
 head/sys/net80211/ieee80211_output.c   |   9 +++-
 head/sys/net80211/ieee80211_proto.c    |   8 +++-
 head/sys/net80211/ieee80211_radiotap.h |   8 +++-
 head/sys/net80211/ieee80211_scan.c     |  15 ++++++-
 head/sys/net80211/ieee80211_sta.c      |   7 ++-
 head/sys/net80211/ieee80211_var.h      |   2 +-
 12 files changed, 156 insertions(+), 83 deletions(-)

diffs (566 lines):

diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211.h
--- a/head/sys/net80211/ieee80211.h	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211.h	Fri Mar 02 17:20:40 2012 +0200
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/net80211/ieee80211.h 227331 2011-11-08 04:00:24Z adrian $
+ * $FreeBSD: head/sys/net80211/ieee80211.h 231187 2012-02-08 06:56:19Z adrian $
  */
 #ifndef _NET80211_IEEE80211_H_
 #define _NET80211_IEEE80211_H_
@@ -709,27 +709,32 @@
 	IEEE80211_ELEMID_VENDOR		= 221,	/* vendor private */
 
 	/*
-	 * 802.11s IEs based on D3.03 spec and were not assigned by
-	 * ANA. Beware changing them because some of them are being
-	 * kept compatible with Linux.
+	 * 802.11s IEs
+	 * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55,
+	 * but they defined a new with id 117 called PEER_MGMT.
+	 * NB: complies with open80211
 	 */
-	IEEE80211_ELEMID_MESHCONF	= 51,
-	IEEE80211_ELEMID_MESHID		= 52,
-	IEEE80211_ELEMID_MESHLINK	= 35,
-	IEEE80211_ELEMID_MESHCNGST	= 36,
-	IEEE80211_ELEMID_MESHPEER	= 55,
-	IEEE80211_ELEMID_MESHCSA	= 38,
-	IEEE80211_ELEMID_MESHTIM	= 39,
-	IEEE80211_ELEMID_MESHAWAKEW	= 40,
-	IEEE80211_ELEMID_MESHBEACONT	= 41,
-	IEEE80211_ELEMID_MESHPANN	= 48,
-	IEEE80211_ELEMID_MESHRANN	= 49,
-	IEEE80211_ELEMID_MESHPREQ	= 68,
-	IEEE80211_ELEMID_MESHPREP	= 69,
-	IEEE80211_ELEMID_MESHPERR	= 70,
-	IEEE80211_ELEMID_MESHPXU	= 53,
-	IEEE80211_ELEMID_MESHPXUC	= 54,
-	IEEE80211_ELEMID_MESHAH		= 60, /* Abbreviated Handshake */
+	IEEE80211_ELEMID_MESHCONF	= 113,
+	IEEE80211_ELEMID_MESHID		= 114,
+	IEEE80211_ELEMID_MESHLINK	= 115,
+	IEEE80211_ELEMID_MESHCNGST	= 116,
+	IEEE80211_ELEMID_MESHPEER	= 117,
+	IEEE80211_ELEMID_MESHCSA	= 118,
+	IEEE80211_ELEMID_MESHTIM	= 39, /* XXX: remove */
+	IEEE80211_ELEMID_MESHAWAKEW	= 119,
+	IEEE80211_ELEMID_MESHBEACONT	= 120,
+	/* 121-124 MMCAOP not implemented yet */
+	IEEE80211_ELEMID_MESHPANN	= 125, /* XXX: is GANN now, not used */
+	IEEE80211_ELEMID_MESHRANN	= 126,
+	/* 127 Extended Capabilities */
+	/* 128-129 reserved */
+	IEEE80211_ELEMID_MESHPREQ	= 130,
+	IEEE80211_ELEMID_MESHPREP	= 131,
+	IEEE80211_ELEMID_MESHPERR	= 132,
+	/* 133-136 reserved */
+	IEEE80211_ELEMID_MESHPXU	= 137,
+	IEEE80211_ELEMID_MESHPXUC	= 138,
+	IEEE80211_ELEMID_MESHAH		= 60, /* XXX: remove */
 };
 
 struct ieee80211_tim_ie {
@@ -927,19 +932,21 @@
 	IEEE80211_REASON_SETUP_NEEDED		= 38,	/* 11e */
 	IEEE80211_REASON_TIMEOUT		= 39,	/* 11e */
 
-	/* values not yet allocated by ANA */
-	IEEE80211_REASON_PEER_LINK_CANCELED	= 2,	/* 11s */
-	IEEE80211_REASON_MESH_MAX_PEERS		= 3,	/* 11s */
-	IEEE80211_REASON_MESH_CPVIOLATION	= 4,	/* 11s */
-	IEEE80211_REASON_MESH_CLOSE_RCVD	= 5,	/* 11s */
-	IEEE80211_REASON_MESH_MAX_RETRIES	= 6,	/* 11s */
-	IEEE80211_REASON_MESH_CONFIRM_TIMEOUT	= 7,	/* 11s */
-	IEEE80211_REASON_MESH_INVALID_GTK	= 8,	/* 11s */
-	IEEE80211_REASON_MESH_INCONS_PARAMS	= 9,	/* 11s */
-	IEEE80211_REASON_MESH_INVALID_SECURITY	= 10,	/* 11s */
-	IEEE80211_REASON_MESH_PERR_UNSPEC	= 11,	/* 11s */
-	IEEE80211_REASON_MESH_PERR_NO_FI	= 12,	/* 11s */
-	IEEE80211_REASON_MESH_PERR_DEST_UNREACH	= 13,	/* 11s */
+	IEEE80211_REASON_PEER_LINK_CANCELED	= 52,	/* 11s */
+	IEEE80211_REASON_MESH_MAX_PEERS		= 53,	/* 11s */
+	IEEE80211_REASON_MESH_CPVIOLATION	= 54,	/* 11s */
+	IEEE80211_REASON_MESH_CLOSE_RCVD	= 55,	/* 11s */
+	IEEE80211_REASON_MESH_MAX_RETRIES	= 56,	/* 11s */
+	IEEE80211_REASON_MESH_CONFIRM_TIMEOUT	= 57,	/* 11s */
+	IEEE80211_REASON_MESH_INVALID_GTK	= 58,	/* 11s */
+	IEEE80211_REASON_MESH_INCONS_PARAMS	= 59,	/* 11s */
+	IEEE80211_REASON_MESH_INVALID_SECURITY	= 60,	/* 11s */
+	IEEE80211_REASON_MESH_PERR_NO_PROXY	= 61,	/* 11s */
+	IEEE80211_REASON_MESH_PERR_NO_FI	= 62,	/* 11s */
+	IEEE80211_REASON_MESH_PERR_DEST_UNREACH	= 63,	/* 11s */
+	IEEE80211_REASON_MESH_MAC_ALRDY_EXISTS_MBSS = 64, /* 11s */
+	IEEE80211_REASON_MESH_CHAN_SWITCH_REG	= 65,	/* 11s */
+	IEEE80211_REASON_MESH_CHAN_SWITCH_UNSPEC = 66,	/* 11s */
 
 	IEEE80211_STATUS_SUCCESS		= 0,
 	IEEE80211_STATUS_UNSPECIFIED		= 1,
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_input.c
--- a/head/sys/net80211/ieee80211_input.c	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_input.c	Fri Mar 02 17:20:40 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_input.c 227331 2011-11-08 04:00:24Z adrian $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_input.c 232269 2012-02-28 21:41:47Z adrian $");
 
 #include "opt_wlan.h"
 
@@ -652,7 +652,8 @@
 	      scan->bintval <= IEEE80211_BINTVAL_MAX)) {
 		IEEE80211_DISCARD(vap,
 		    IEEE80211_MSG_ELEMID | IEEE80211_MSG_INPUT,
-		    wh, NULL, "bogus beacon interval", scan->bintval);
+		    wh, NULL, "bogus beacon interval (%d TU)",
+		    (int) scan->bintval);
 		vap->iv_stats.is_rx_badbintval++;
 		scan->status |= IEEE80211_BPARSE_BINTVAL_INVALID;
 	}
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_ioctl.h
--- a/head/sys/net80211/ieee80211_ioctl.h	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_ioctl.h	Fri Mar 02 17:20:40 2012 +0200
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/net80211/ieee80211_ioctl.h 227331 2011-11-08 04:00:24Z adrian $
+ * $FreeBSD: head/sys/net80211/ieee80211_ioctl.h 232244 2012-02-28 04:05:35Z adrian $
  */
 #ifndef _NET80211_IEEE80211_IOCTL_H_
 #define _NET80211_IEEE80211_IOCTL_H_
@@ -241,8 +241,9 @@
 	uint32_t	is_mesh_notproxy;	/* dropped 'cuz not proxying */
 	uint32_t	is_rx_badalign;		/* dropped 'cuz misaligned */
 	uint32_t	is_hwmp_proxy;		/* PREP for proxy route */
+	uint32_t	is_beacon_bad;		/* Number of bad beacons */
 	
-	uint32_t	is_spare[11];
+	uint32_t	is_spare[10];
 };
 
 /*
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_mesh.c
--- a/head/sys/net80211/ieee80211_mesh.c	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_mesh.c	Fri Mar 02 17:20:40 2012 +0200
@@ -28,7 +28,7 @@
  */ 
 #include <sys/cdefs.h>
 #ifdef __FreeBSD__
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_mesh.c 228622 2011-12-17 10:32:31Z bschmidt $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_mesh.c 231576 2012-02-13 07:47:36Z adrian $");
 #endif
 
 /*
@@ -442,19 +442,19 @@
 	ieee80211_recv_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC,
 	    IEEE80211_ACTION_MESHLMETRIC_REP, mesh_recv_action_meshlmetric_rep);
 
-	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, 
+	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING,
 	    IEEE80211_ACTION_MESHPEERING_OPEN,
 	    mesh_send_action_meshpeering_open);
-	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, 
+	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING,
 	    IEEE80211_ACTION_MESHPEERING_CONFIRM,
 	    mesh_send_action_meshpeering_confirm);
-	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING, 
+	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHPEERING,
 	    IEEE80211_ACTION_MESHPEERING_CLOSE,
 	    mesh_send_action_meshpeering_close);
-	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, 
+	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC,
 	    IEEE80211_ACTION_MESHLMETRIC_REQ,
 	    mesh_send_action_meshlink_request);
-	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC, 
+	ieee80211_send_action_register(IEEE80211_ACTION_CAT_MESHLMETRIC,
 	    IEEE80211_ACTION_MESHLMETRIC_REP,
 	    mesh_send_action_meshlink_reply);
 
@@ -1934,10 +1934,10 @@
 	    ic->ic_headroom + sizeof(struct ieee80211_frame),
 	    sizeof(uint16_t)	/* action+category */
 	    + sizeof(uint16_t)	/* capabilites */
-	    + 2 + IEEE80211_RATE_SIZE	 
-	    + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)	 
+	    + 2 + IEEE80211_RATE_SIZE
+	    + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)
 	    + 2 + IEEE80211_MESHID_LEN
-	    + sizeof(struct ieee80211_meshconf_ie)	 
+	    + sizeof(struct ieee80211_meshconf_ie)
 	    + sizeof(struct ieee80211_meshpeer_ie)
 	);
 	if (m != NULL) {
@@ -1997,10 +1997,10 @@
 	    + sizeof(uint16_t)	/* capabilites */
 	    + sizeof(uint16_t)	/* status code */
 	    + sizeof(uint16_t)	/* AID */
-	    + 2 + IEEE80211_RATE_SIZE	 
-	    + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)	 
+	    + 2 + IEEE80211_RATE_SIZE
+	    + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE)
 	    + 2 + IEEE80211_MESHID_LEN
-	    + sizeof(struct ieee80211_meshconf_ie)	 
+	    + sizeof(struct ieee80211_meshconf_ie)
 	    + sizeof(struct ieee80211_meshpeer_ie)
 	);
 	if (m != NULL) {
@@ -2063,7 +2063,7 @@
 	    sizeof(uint16_t)	/* action+category */
 	    + sizeof(uint16_t)	/* reason code */
 	    + 2 + IEEE80211_MESHID_LEN
-	    + sizeof(struct ieee80211_meshpeer_ie) 
+	    + sizeof(struct ieee80211_meshpeer_ie)
 	);
 	if (m != NULL) {
 		/*
@@ -2289,7 +2289,6 @@
 	const struct ieee80211_meshconf_ie *meshconf =
 	    (const struct ieee80211_meshconf_ie *) ie;
 	const struct ieee80211_mesh_state *ms = vap->iv_mesh;
-	uint16_t cap;
 
 	if (meshconf == NULL)
 		return 1;
@@ -2323,10 +2322,8 @@
 		    meshconf->conf_pselid);
 		return 1;
 	}
-	/* NB: conf_cap is only read correctly here */
-	cap = LE_READ_2(&meshconf->conf_cap);
 	/* Not accepting peers */
-	if (!(cap & IEEE80211_MESHCONF_CAP_AP)) {
+	if (!(meshconf->conf_cap & IEEE80211_MESHCONF_CAP_AP)) {
 		IEEE80211_DPRINTF(vap, IEEE80211_MSG_MESH,
 		    "not accepting peers: 0x%x\n", meshconf->conf_cap);
 		return 1;
@@ -2395,7 +2392,7 @@
 	KASSERT(vap->iv_opmode == IEEE80211_M_MBSS, ("not a MBSS vap"));
 
 	*frm++ = IEEE80211_ELEMID_MESHCONF;
-	*frm++ = sizeof(struct ieee80211_meshconf_ie) - 2;
+	*frm++ = IEEE80211_MESH_CONF_SZ;
 	*frm++ = ms->ms_ppath->mpp_ie;		/* path selection */
 	*frm++ = ms->ms_pmetric->mpm_ie;	/* link metric */
 	*frm++ = IEEE80211_MESHCONF_CC_DISABLED;
@@ -2411,7 +2408,7 @@
 		caps |= IEEE80211_MESHCONF_CAP_AP;
 	if (ms->ms_flags & IEEE80211_MESHFLAGS_FWD)
 		caps |= IEEE80211_MESHCONF_CAP_FWRD;
-	ADDSHORT(frm, caps);
+	*frm++ = caps;
 	return frm;
 }
 
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_mesh.h
--- a/head/sys/net80211/ieee80211_mesh.h	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_mesh.h	Fri Mar 02 17:20:40 2012 +0200
@@ -26,7 +26,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
  * SUCH DAMAGE. 
  * 
- * $FreeBSD: head/sys/net80211/ieee80211_mesh.h 202178 2010-01-12 22:22:27Z rpaulo $
+ * $FreeBSD: head/sys/net80211/ieee80211_mesh.h 231576 2012-02-13 07:47:36Z adrian $
  */
 #ifndef _NET80211_IEEE80211_MESH_H_
 #define _NET80211_IEEE80211_MESH_H_
@@ -40,6 +40,7 @@
  * 802.11s Information Elements.
 */
 /* Mesh Configuration */
+#define IEEE80211_MESH_CONF_SZ		(7)
 struct ieee80211_meshconf_ie {
 	uint8_t		conf_ie;	/* IEEE80211_ELEMID_MESHCONF */
 	uint8_t		conf_len;
@@ -49,31 +50,66 @@
 	uint8_t		conf_syncid;	/* Sync. Protocol ID */
 	uint8_t		conf_authid;	/* Auth. Protocol ID */
 	uint8_t		conf_form;	/* Formation Information */
-	uint16_t	conf_cap;
+	uint8_t		conf_cap;
 } __packed;
 
 /* Hybrid Wireless Mesh Protocol */
-#define	IEEE80211_MESHCONF_PATH_HWMP		0x00
+enum {
+	/* 0 reserved */
+	IEEE80211_MESHCONF_PATH_HWMP		= 1,
+	/* 2-254 reserved */
+	IEEE80211_MESHCONF_PATH_VENDOR		= 255,
+};
+
 /* Airtime Link Metric */
-#define	IEEE80211_MESHCONF_METRIC_AIRTIME	0x00
+enum {
+	/* 0 reserved */
+	IEEE80211_MESHCONF_METRIC_AIRTIME	= 1,
+	/* 2-254 reserved */
+	IEEE80211_MESHCONF_METRIC_VENDOR	= 255,
+};
+
 /* Congestion Control */
-#define	IEEE80211_MESHCONF_CC_DISABLED		0x00
-#define	IEEE80211_MESHCONF_CC_SIG		0x01
+enum {
+	IEEE80211_MESHCONF_CC_DISABLED		= 0,
+	IEEE80211_MESHCONF_CC_SIG		= 1,
+	/* 2-254 reserved */
+	IEEE80211_MESHCONF_CC_VENDOR		= 255,
+};
+
 /* Neighbour Offset */
-#define	IEEE80211_MESHCONF_SYNC_NEIGHOFF	0x00
-#define	IEEE80211_MESHCONF_AUTH_DISABLED	0x00
-/* Simultaneous Authenticaction of Equals */
-#define	IEEE80211_MESHCONF_AUTH_SAE		0x01
-#define	IEEE80211_MESHCONF_FORM_MP		0x01 /* Connected to Portal */
-#define	IEEE80211_MESHCONF_FORM_NNEIGH_MASK	0x04 /* Number of Neighbours */
+enum {
+	/* 0 reserved */
+	IEEE80211_MESHCONF_SYNC_NEIGHOFF	= 1,
+	/* 2-254 rserved */
+	IEEE80211_MESHCONF_SYNC_VENDOR		= 255,
+};
+
+/* Authentication Protocol Identifier */
+enum {
+	
+	IEEE80211_MESHCONF_AUTH_DISABLED	= 0,
+	/* Simultaneous Authenticaction of Equals */
+	IEEE80211_MESHCONF_AUTH_SEA		= 1,
+	IEEE80211_MESHCONF_AUTH_8021X		= 2, /* IEEE 802.1X */
+	/* 3-254 reserved */
+	IEEE80211_MESHCONF_AUTH_VENDOR		= 255,
+};
+
+/* Mesh Formation Info */
+#define	IEEE80211_MESHCONF_FORM_MP	0x01 	/* Connected to Portal */
+#define	IEEE80211_MESHCONF_FORM_NNEIGH_MASK 0x7E /* Number of Neighbours */
+#define	IEEE80211_MESHCONF_FORM_SA	0xF0 	/* indicating 802.1X auth */
+
+/* Mesh Capability */
 #define	IEEE80211_MESHCONF_CAP_AP	0x01	/* Accepting Peers */
 #define	IEEE80211_MESHCONF_CAP_MCCAS	0x02	/* MCCA supported */
 #define	IEEE80211_MESHCONF_CAP_MCCAE	0x04	/* MCCA enabled */
 #define	IEEE80211_MESHCONF_CAP_FWRD 	0x08	/* forwarding enabled */
 #define	IEEE80211_MESHCONF_CAP_BTR	0x10	/* Beacon Timing Report Enab */
-#define	IEEE80211_MESHCONF_CAP_TBTTA	0x20	/* TBTT Adj. Enabled */
-#define	IEEE80211_MESHCONF_CAP_TBTT	0x40	/* TBTT Adjusting  */
-#define	IEEE80211_MESHCONF_CAP_PSL	0x80	/* Power Save Level */
+#define	IEEE80211_MESHCONF_CAP_TBTT	0x20	/* TBTT Adjusting  */
+#define	IEEE80211_MESHCONF_CAP_PSL	0x40	/* Power Save Level */
+/* 0x80 reserved */
 
 /* Mesh Identifier */
 struct ieee80211_meshid_ie {
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_node.h
--- a/head/sys/net80211/ieee80211_node.h	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_node.h	Fri Mar 02 17:20:40 2012 +0200
@@ -23,7 +23,7 @@
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- * $FreeBSD: head/sys/net80211/ieee80211_node.h 220445 2011-04-08 09:20:45Z adrian $
+ * $FreeBSD: head/sys/net80211/ieee80211_node.h 231939 2012-02-20 15:05:21Z ray $
  */
 #ifndef _NET80211_IEEE80211_NODE_H_
 #define _NET80211_IEEE80211_NODE_H_
@@ -299,8 +299,6 @@
 	*ni = NULL;			/* guard against use */
 }
 
-struct ieee80211com;
-
 void	ieee80211_node_attach(struct ieee80211com *);
 void	ieee80211_node_lateattach(struct ieee80211com *);
 void	ieee80211_node_detach(struct ieee80211com *);
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_output.c
--- a/head/sys/net80211/ieee80211_output.c	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_output.c	Fri Mar 02 17:20:40 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_output.c 229795 2012-01-07 23:41:38Z bz $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_output.c 232097 2012-02-24 05:40:36Z adrian $");
 
 #include "opt_inet.h"
 #include "opt_inet6.h"
@@ -157,8 +157,10 @@
 			    "%s: ignore queue, in %s state\n",
 			    __func__, ieee80211_state_name[vap->iv_state]);
 			vap->iv_stats.is_tx_badstate++;
+			IEEE80211_UNLOCK(ic);
+			IFQ_LOCK(&ifp->if_snd);
 			ifp->if_drv_flags |= IFF_DRV_OACTIVE;
-			IEEE80211_UNLOCK(ic);
+			IFQ_UNLOCK(&ifp->if_snd);
 			return;
 		}
 		IEEE80211_UNLOCK(ic);
@@ -389,7 +391,9 @@
 	struct ieee80211_frame *wh;
 	int error;
 
+	IFQ_LOCK(&ifp->if_snd);
 	if (ifp->if_drv_flags & IFF_DRV_OACTIVE) {
+		IFQ_UNLOCK(&ifp->if_snd);
 		/*
 		 * Short-circuit requests if the vap is marked OACTIVE
 		 * as this can happen because a packet came down through
@@ -400,6 +404,7 @@
 		 */
 		senderr(ENETDOWN);
 	}
+	IFQ_UNLOCK(&ifp->if_snd);
 	vap = ifp->if_softc;
 	/*
 	 * Hand to the 802.3 code if not tagged as
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_proto.c
--- a/head/sys/net80211/ieee80211_proto.c	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_proto.c	Fri Mar 02 17:20:40 2012 +0200
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_proto.c 225913 2011-10-02 02:42:31Z adrian $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_proto.c 232096 2012-02-24 05:39:00Z adrian $");
 
 /*
  * IEEE 802.11 protocol support.
@@ -1615,6 +1615,7 @@
 		if (vap->iv_state != IEEE80211_S_INIT) {
 			/* NB: iv_newstate may drop the lock */
 			vap->iv_newstate(vap, IEEE80211_S_INIT, 0);
+			IEEE80211_LOCK_ASSERT(ic);
 			vap->iv_flags_ext |= IEEE80211_FEXT_SCANWAIT;
 		}
 	}
@@ -1649,6 +1650,7 @@
 			vap->iv_newstate(vap,
 			    vap->iv_opmode == IEEE80211_M_STA ?
 			        IEEE80211_S_SCAN : IEEE80211_S_RUN, 0);
+			IEEE80211_LOCK_ASSERT(ic);
 		}
 	}
 }
@@ -1678,6 +1680,7 @@
 		    ieee80211_state_name[vap->iv_state],
 		    ieee80211_state_name[IEEE80211_S_INIT], arg);
 		vap->iv_newstate(vap, IEEE80211_S_INIT, arg);
+		IEEE80211_LOCK_ASSERT(ic);
 		vap->iv_flags_ext &= ~IEEE80211_FEXT_REINIT;
 	}
 
@@ -1699,6 +1702,7 @@
 	    ieee80211_state_name[ostate], ieee80211_state_name[nstate], arg);
 
 	rc = vap->iv_newstate(vap, nstate, arg);
+	IEEE80211_LOCK_ASSERT(ic);
 	vap->iv_flags_ext &= ~IEEE80211_FEXT_STATEWAIT;
 	if (rc != 0) {
 		/* State transition failed */
@@ -1724,7 +1728,9 @@
 		 * Note this can also happen as a result of SLEEP->RUN
 		 * (i.e. coming out of power save mode).
 		 */
+		IF_LOCK(&vap->iv_ifp->if_snd);
 		vap->iv_ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
+		IF_UNLOCK(&vap->iv_ifp->if_snd);
 		if_start(vap->iv_ifp);
 
 		/* bring up any vaps waiting on us */
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_radiotap.h
--- a/head/sys/net80211/ieee80211_radiotap.h	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_radiotap.h	Fri Mar 02 17:20:40 2012 +0200
@@ -1,4 +1,4 @@
-/* $FreeBSD: head/sys/net80211/ieee80211_radiotap.h 229952 2012-01-11 01:09:08Z adrian $ */
+/* $FreeBSD: head/sys/net80211/ieee80211_radiotap.h 232095 2012-02-24 05:33:11Z adrian $ */
 /* $NetBSD: ieee80211_radiotap.h,v 1.16 2007/01/06 05:51:15 dyoung Exp $ */
 
 /*-
@@ -54,6 +54,12 @@
 
 #define	IEEE80211_RADIOTAP_HDRLEN	64	/* XXX deprecated */
 
+struct ieee80211_radiotap_vendor_header {
+	uint8_t		vh_oui[3];	/* 3 byte vendor OUI */
+	uint8_t		vh_sub_ns;	/* Sub namespace of this section */
+	uint16_t	vh_skip_len;	/* Length of this vendor section */
+} __packed;
+
 /*
  * The radio capture header precedes the 802.11 header.
  *
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_scan.c
--- a/head/sys/net80211/ieee80211_scan.c	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_scan.c	Fri Mar 02 17:20:40 2012 +0200
@@ -24,7 +24,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan.c 218091 2011-01-30 14:00:50Z bschmidt $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_scan.c 232373 2012-03-02 02:53:43Z adrian $");
 
 /*
  * IEEE 802.11 scanning support.
@@ -960,6 +960,19 @@
 	IEEE80211_LOCK(ic);
 
 	/*
+	 * Since a cancellation may have occured during one of the
+	 * driver calls (whilst unlocked), update scandone.
+	 */
+	if (scandone == 0 &&
+	    ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0)) {
+		/* XXX printf? */
+		if_printf(vap->iv_ifp,
+		    "%s: OOPS! scan cancelled during driver call!\n",
+		    __func__);
+	}
+	scandone |= ((SCAN_PRIVATE(ss)->ss_iflags & ISCAN_CANCEL) != 0);
+
+	/*
 	 * Record scan complete time.  Note that we also do
 	 * this when canceled so any background scan will
 	 * not be restarted for a while.
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_sta.c
--- a/head/sys/net80211/ieee80211_sta.c	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_sta.c	Fri Mar 02 17:20:40 2012 +0200
@@ -25,7 +25,7 @@
 
 #include <sys/cdefs.h>
 #ifdef __FreeBSD__
-__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_sta.c 227339 2011-11-08 14:34:01Z adrian $");
+__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_sta.c 232270 2012-02-28 21:43:29Z adrian $");
 #endif
 
 /*
@@ -1305,8 +1305,11 @@
 			return;
 		}
 		/* XXX probe response in sta mode when !scanning? */
-		if (ieee80211_parse_beacon(ni, m0, &scan) != 0)
+		if (ieee80211_parse_beacon(ni, m0, &scan) != 0) {
+			if (! (ic->ic_flags & IEEE80211_F_SCAN))
+				vap->iv_stats.is_beacon_bad++;
 			return;
+		}
 		/*
 		 * Count frame now that we know it's to be processed.
 		 */
diff -r c81d2e364ab8 -r 94ee7312d4f7 head/sys/net80211/ieee80211_var.h
--- a/head/sys/net80211/ieee80211_var.h	Fri Mar 02 17:18:35 2012 +0200
+++ b/head/sys/net80211/ieee80211_var.h	Fri Mar 02 17:20:40 2012 +0200
@@ -27,7 +27,7 @@
  */
 #ifndef _NET80211_IEEE80211_VAR_H_
 #define _NET80211_IEEE80211_VAR_H_
-
+#define	IEEE80211_DEBUG	1
 /*
  * Definitions for IEEE 802.11 drivers.
  */


More information about the Zrouter-src-freebsd mailing list