Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jul 2009 16:33:42 +0000 (UTC)
From:      Sam Leffler <sam@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r195317 - in projects/mesh11s/sys: dev/mwl net80211
Message-ID:  <200907031633.n63GXgpt082935@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sam
Date: Fri Jul  3 16:33:42 2009
New Revision: 195317
URL: http://svn.freebsd.org/changeset/base/195317

Log:
  Add a pointer to the 802.11 header to the recv action handler api;
  this is needed by mesh handlers and it may be difficult to locate it
  based on the start of the action frame contents.
  
  Reviewed by:	rpaulo

Modified:
  projects/mesh11s/sys/dev/mwl/if_mwl.c
  projects/mesh11s/sys/dev/mwl/if_mwlvar.h
  projects/mesh11s/sys/net80211/ieee80211_action.c
  projects/mesh11s/sys/net80211/ieee80211_action.h
  projects/mesh11s/sys/net80211/ieee80211_adhoc.c
  projects/mesh11s/sys/net80211/ieee80211_hostap.c
  projects/mesh11s/sys/net80211/ieee80211_ht.c
  projects/mesh11s/sys/net80211/ieee80211_hwmp.c
  projects/mesh11s/sys/net80211/ieee80211_mesh.c
  projects/mesh11s/sys/net80211/ieee80211_sta.c
  projects/mesh11s/sys/net80211/ieee80211_var.h
  projects/mesh11s/sys/net80211/ieee80211_wds.c

Modified: projects/mesh11s/sys/dev/mwl/if_mwl.c
==============================================================================
--- projects/mesh11s/sys/dev/mwl/if_mwl.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/dev/mwl/if_mwl.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -145,6 +145,7 @@ static int	mwl_chan_set(struct mwl_softc
 static void	mwl_draintxq(struct mwl_softc *);
 static void	mwl_cleartxq(struct mwl_softc *, struct ieee80211vap *);
 static int	mwl_recv_action(struct ieee80211_node *,
+			const struct ieee80211_frame *,
 			const uint8_t *, const uint8_t *);
 static int	mwl_addba_request(struct ieee80211_node *,
 			struct ieee80211_tx_ampdu *, int dialogtoken,
@@ -3652,7 +3653,8 @@ mwl_cleartxq(struct mwl_softc *sc, struc
 }
 
 static int
-mwl_recv_action(struct ieee80211_node *ni, const uint8_t *frm, const uint8_t *efrm)
+mwl_recv_action(struct ieee80211_node *ni, const struct ieee80211_frame *wh,
+	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct mwl_softc *sc = ni->ni_ic->ic_ifp->if_softc;
 	const struct ieee80211_action *ia;
@@ -3668,7 +3670,7 @@ mwl_recv_action(struct ieee80211_node *n
 		    MS(mps->am_control, IEEE80211_A_HT_MIMOPWRSAVE_MODE));
 		return 0;
 	} else
-		return sc->sc_recv_action(ni, frm, efrm);
+		return sc->sc_recv_action(ni, wh, frm, efrm);
 }
 
 static int

Modified: projects/mesh11s/sys/dev/mwl/if_mwlvar.h
==============================================================================
--- projects/mesh11s/sys/dev/mwl/if_mwlvar.h	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/dev/mwl/if_mwlvar.h	Fri Jul  3 16:33:42 2009	(r195317)
@@ -286,6 +286,7 @@ struct mwl_softc {
 	void 			(*sc_node_cleanup)(struct ieee80211_node *);
 	void 			(*sc_node_drain)(struct ieee80211_node *);
 	int			(*sc_recv_action)(struct ieee80211_node *,
+				    const struct ieee80211_frame *,
 				    const uint8_t *, const uint8_t *);
 	int			(*sc_addba_request)(struct ieee80211_node *,
 				    struct ieee80211_tx_ampdu *,

Modified: projects/mesh11s/sys/net80211/ieee80211_action.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_action.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_action.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -161,8 +161,8 @@ ieee80211_send_action(struct ieee80211_n
 }
 
 static int
-recv_inval(struct ieee80211_node *ni, const uint8_t *frm,
-	const uint8_t *efrm)
+recv_inval(struct ieee80211_node *ni, const struct ieee80211_frame *wh,
+	const uint8_t *frm, const uint8_t *efrm)
 {
 	return EINVAL;
 }
@@ -238,8 +238,9 @@ ieee80211_recv_action_unregister(int cat
 }
 
 int
-ieee80211_recv_action(struct ieee80211_node *ni, const uint8_t *frm,
-	const uint8_t *efrm)
+ieee80211_recv_action(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
+	const uint8_t *frm, const uint8_t *efrm)
 {
 #define	N(a)	(sizeof(a) / sizeof(a[0]))
 	ieee80211_recv_action_func *f = recv_inval;
@@ -272,6 +273,6 @@ ieee80211_recv_action(struct ieee80211_n
 			f = vendor_recv_action[ia->ia_action];
 		break;
 	}
-	return f(ni, frm, efrm);
+	return f(ni, wh, frm, efrm);
 #undef N
 }

Modified: projects/mesh11s/sys/net80211/ieee80211_action.h
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_action.h	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_action.h	Fri Jul  3 16:33:42 2009	(r195317)
@@ -32,6 +32,7 @@
  */
 
 struct ieee80211_node;
+struct ieee80211_frame;
 
 typedef int ieee80211_send_action_func(struct ieee80211_node *,
     int, int, void *);
@@ -41,10 +42,11 @@ void	ieee80211_send_action_unregister(in
 int	ieee80211_send_action(struct ieee80211_node *, int, int, void *);
 
 typedef int ieee80211_recv_action_func(struct ieee80211_node *,
-    const uint8_t *, const uint8_t *);
+    const struct ieee80211_frame *, const uint8_t *, const uint8_t *);
 int	ieee80211_recv_action_register(int cat, int act,
 		ieee80211_recv_action_func *);
 void	ieee80211_recv_action_unregister(int cat, int act);
 int	ieee80211_recv_action(struct ieee80211_node *,
+		const struct ieee80211_frame *,
 		const uint8_t *, const uint8_t *);
 #endif /* _NET80211_IEEE80211_ACTION_H_ */

Modified: projects/mesh11s/sys/net80211/ieee80211_adhoc.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_adhoc.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_adhoc.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -879,7 +879,7 @@ adhoc_recv_mgmt(struct ieee80211_node *n
 			}
 			break;
 		}
-		ic->ic_recv_action(ni, frm, efrm);
+		ic->ic_recv_action(ni, wh, frm, efrm);
 		break;
 	}
 

Modified: projects/mesh11s/sys/net80211/ieee80211_hostap.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_hostap.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_hostap.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -2189,7 +2189,7 @@ hostap_recv_mgmt(struct ieee80211_node *
 	case IEEE80211_FC0_SUBTYPE_ACTION:
 		if (vap->iv_state == IEEE80211_S_RUN) {
 			if (ieee80211_parse_action(ni, m0) == 0)
-				ic->ic_recv_action(ni, frm, efrm);
+				ic->ic_recv_action(ni, wh, frm, efrm);
 		} else
 			vap->iv_stats.is_rx_mgtdiscard++;
 		break;

Modified: projects/mesh11s/sys/net80211/ieee80211_ht.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_ht.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_ht.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -1613,6 +1613,7 @@ ieee80211_addba_stop(struct ieee80211_no
  */
 static int
 ht_recv_action_ba_addba_request(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211com *ic = ni->ni_ic;
@@ -1677,6 +1678,7 @@ ht_recv_action_ba_addba_request(struct i
 
 static int
 ht_recv_action_ba_addba_response(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211com *ic = ni->ni_ic;
@@ -1751,6 +1753,7 @@ ht_recv_action_ba_addba_response(struct 
 
 static int
 ht_recv_action_ba_delba(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211com *ic = ni->ni_ic;
@@ -1782,6 +1785,7 @@ ht_recv_action_ba_delba(struct ieee80211
 
 static int
 ht_recv_action_ht_txchwidth(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	int chw;
@@ -1800,6 +1804,7 @@ ht_recv_action_ht_txchwidth(struct ieee8
 
 static int
 ht_recv_action_ht_mimopwrsave(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	const struct ieee80211_action_ht_mimopowersave *mps =

Modified: projects/mesh11s/sys/net80211/ieee80211_hwmp.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_hwmp.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_hwmp.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -321,13 +321,11 @@ ieee80211_hwmp_newstate(struct ieee80211
 
 static int
 hwmp_recv_action_meshpath_preq(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct ieee80211_meshpreq_ie preq;
-	/* XXX true for multi-hop action frames? */
-	const struct ieee80211_frame *wh = (const struct ieee80211_frame *)
-	    (frm - sizeof(struct ieee80211_frame));
 	const uint8_t *iefrm = frm + 2; /* action + code */
 
 	while (efrm - iefrm > 1) {
@@ -356,13 +354,11 @@ hwmp_recv_action_meshpath_preq(struct ie
 
 static int
 hwmp_recv_action_meshpath_prep(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct ieee80211_meshprep_ie prep;
-	/* XXX true for multi-hop action frames? */
-	const struct ieee80211_frame *wh = (const struct ieee80211_frame *)
-	    (frm - sizeof(struct ieee80211_frame));
 	const uint8_t *iefrm = frm + 2; /* action + code */
 
 	while (efrm - iefrm > 1) {
@@ -388,13 +384,11 @@ hwmp_recv_action_meshpath_prep(struct ie
 
 static int
 hwmp_recv_action_meshpath_perr(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211_meshperr_ie perr;
 	struct ieee80211vap *vap = ni->ni_vap;
-	/* XXX true for multi-hop action frames? */
-	const struct ieee80211_frame *wh = (const struct ieee80211_frame *)
-	    (frm - sizeof(struct ieee80211_frame));
 	const uint8_t *iefrm = frm + 2; /* action + code */
 
 	while (efrm - iefrm > 1) {
@@ -419,13 +413,11 @@ hwmp_recv_action_meshpath_perr(struct ie
 
 static int
 hwmp_recv_action_meshpath_rann(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
 	struct ieee80211_meshrann_ie rann;
-	/* XXX true for multi-hop action frames? */
-	const struct ieee80211_frame *wh = (const struct ieee80211_frame *)
-	    (frm - sizeof(struct ieee80211_frame));
 	const uint8_t *iefrm = frm + 2; /* action + code */
 
 	while (efrm - iefrm > 1) {

Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_mesh.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_mesh.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -978,7 +978,7 @@ mesh_recv_mgmt(struct ieee80211_node *ni
 		}
 		/* XXX parse_action is a bit useless now */
 		if (ieee80211_parse_action(ni, m0) == 0)
-			ic->ic_recv_action(ni, frm, efrm);
+			ic->ic_recv_action(ni, wh, frm, efrm);
 		break;
 	case IEEE80211_FC0_SUBTYPE_AUTH:
 	case IEEE80211_FC0_SUBTYPE_ASSOC_REQ:
@@ -1094,12 +1094,10 @@ mesh_parse_meshpeering_action(struct iee
 
 static int
 mesh_recv_action_meshpeering_open(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
-	/* XXX multi-hop action frames? */
-	const struct ieee80211_frame *wh = (const struct ieee80211_frame *)
-	    (frm - sizeof(struct ieee80211_frame));
 	struct ieee80211_meshpeer_ie ie;
 	const struct ieee80211_meshpeer_ie *meshpeer;
 	uint16_t args[3];
@@ -1228,12 +1226,10 @@ mesh_recv_action_meshpeering_open(struct
 
 static int
 mesh_recv_action_meshpeering_confirm(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
-	/* XXX multi-hop action frames? */
-	const struct ieee80211_frame *wh = (const struct ieee80211_frame *)
-	    (frm - sizeof(struct ieee80211_frame));
 	struct ieee80211_meshpeer_ie ie;
 	const struct ieee80211_meshpeer_ie *meshpeer;
 	uint16_t args[3];
@@ -1291,6 +1287,7 @@ mesh_recv_action_meshpeering_confirm(str
 
 static int
 mesh_recv_action_meshpeering_close(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	struct ieee80211vap *vap = ni->ni_vap;
@@ -1330,6 +1327,7 @@ mesh_recv_action_meshpeering_close(struc
  */
 static int
 mesh_recv_action_meshlmetric_req(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	uint32_t metric;
@@ -1345,6 +1343,7 @@ mesh_recv_action_meshlmetric_req(struct 
 
 static int
 mesh_recv_action_meshlmetric_rep(struct ieee80211_node *ni,
+	const struct ieee80211_frame *wh,
 	const uint8_t *frm, const uint8_t *efrm)
 {
 	return 0;

Modified: projects/mesh11s/sys/net80211/ieee80211_sta.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_sta.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_sta.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -1717,7 +1717,7 @@ sta_recv_mgmt(struct ieee80211_node *ni,
 	case IEEE80211_FC0_SUBTYPE_ACTION:
 		if (vap->iv_state == IEEE80211_S_RUN) {
 			if (ieee80211_parse_action(ni, m0) == 0)
-				ic->ic_recv_action(ni, frm, efrm);
+				ic->ic_recv_action(ni, wh, frm, efrm);
 		} else
 			vap->iv_stats.is_rx_mgtdiscard++;
 		break;

Modified: projects/mesh11s/sys/net80211/ieee80211_var.h
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_var.h	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_var.h	Fri Jul  3 16:33:42 2009	(r195317)
@@ -286,6 +286,7 @@ struct ieee80211com {
 	 * from an assocated HT station.
 	 */
 	int			(*ic_recv_action)(struct ieee80211_node *,
+				    const struct ieee80211_frame *,
 				    const uint8_t *frm, const uint8_t *efrm);
 	int			(*ic_send_action)(struct ieee80211_node *,
 				    int category, int action, void *);

Modified: projects/mesh11s/sys/net80211/ieee80211_wds.c
==============================================================================
--- projects/mesh11s/sys/net80211/ieee80211_wds.c	Fri Jul  3 16:01:40 2009	(r195316)
+++ projects/mesh11s/sys/net80211/ieee80211_wds.c	Fri Jul  3 16:33:42 2009	(r195317)
@@ -777,7 +777,7 @@ wds_recv_mgmt(struct ieee80211_node *ni,
 		}
 		ni->ni_inact = ni->ni_inact_reload;
 		if (ieee80211_parse_action(ni, m0) == 0)
-			ic->ic_recv_action(ni, frm, efrm);
+			ic->ic_recv_action(ni, wh, frm, efrm);
 		break;
 	default:
 		IEEE80211_DISCARD(vap, IEEE80211_MSG_ANY,



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