Date: Fri, 3 Jul 2009 14:37:10 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r195307 - projects/mesh11s/sys/net80211 Message-ID: <200907031437.n63EbApC080395@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: rpaulo Date: Fri Jul 3 14:37:10 2009 New Revision: 195307 URL: http://svn.freebsd.org/changeset/base/195307 Log: Fix some problems with the recent action frame overhaul. Sponsored by: The FreeBSD Foundation Modified: projects/mesh11s/sys/net80211/ieee80211_action.c projects/mesh11s/sys/net80211/ieee80211_mesh.c Modified: projects/mesh11s/sys/net80211/ieee80211_action.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_action.c Fri Jul 3 11:37:58 2009 (r195306) +++ projects/mesh11s/sys/net80211/ieee80211_action.c Fri Jul 3 14:37:10 2009 (r195307) @@ -62,6 +62,13 @@ static ieee80211_send_action_func *ht_se send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, }; +static ieee80211_send_action_func *meshpl_send_action[8] = { + send_inval, send_inval, send_inval, send_inval, + send_inval, send_inval, send_inval, send_inval, +}; +static ieee80211_send_action_func *meshlm_send_action[4] = { + send_inval, send_inval, send_inval, send_inval, +}; static ieee80211_send_action_func *vendor_send_action[8] = { send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, send_inval, @@ -82,6 +89,16 @@ ieee80211_send_action_register(int cat, break; ht_send_action[act] = f; return 0; + case IEEE80211_ACTION_CAT_MESHPEERING: + if (act >= N(meshpl_send_action)) + break; + meshpl_send_action[act] = f; + return 0; + case IEEE80211_ACTION_CAT_MESHLMETRIC: + if (act >= N(meshlm_send_action)) + break; + meshlm_send_action[act] = f; + return 0; case IEEE80211_ACTION_CAT_VENDOR: if (act >= N(vendor_send_action)) break; @@ -113,6 +130,14 @@ ieee80211_send_action(struct ieee80211_n if (act < N(ht_send_action)) f = ht_send_action[act]; break; + case IEEE80211_ACTION_CAT_MESHPEERING: + if (act < N(meshpl_send_action)) + f = meshpl_send_action[act]; + break; + case IEEE80211_ACTION_CAT_MESHLMETRIC: + if (act < N(meshlm_send_action)) + f = meshlm_send_action[act]; + break; case IEEE80211_ACTION_CAT_VENDOR: if (act < N(vendor_send_action)) f = vendor_send_action[act]; @@ -137,6 +162,13 @@ static ieee80211_recv_action_func *ht_re recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, }; +static ieee80211_recv_action_func *meshpl_recv_action[8] = { + recv_inval, recv_inval, recv_inval, recv_inval, + recv_inval, recv_inval, recv_inval, recv_inval, +}; +static ieee80211_recv_action_func *meshlm_recv_action[4] = { + recv_inval, recv_inval, recv_inval, recv_inval, +}; static ieee80211_recv_action_func *vendor_recv_action[8] = { recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, recv_inval, @@ -157,6 +189,16 @@ ieee80211_recv_action_register(int cat, break; ht_recv_action[act] = f; return 0; + case IEEE80211_ACTION_CAT_MESHPEERING: + if (act >= N(meshpl_recv_action)) + break; + meshpl_recv_action[act] = f; + return 0; + case IEEE80211_ACTION_CAT_MESHLMETRIC: + if (act >= N(meshlm_recv_action)) + break; + meshlm_recv_action[act] = f; + return 0; case IEEE80211_ACTION_CAT_VENDOR: if (act >= N(vendor_recv_action)) break; @@ -191,6 +233,14 @@ ieee80211_recv_action(struct ieee80211_n if (ia->ia_action < N(ht_recv_action)) f = ht_recv_action[ia->ia_action]; break; + case IEEE80211_ACTION_CAT_MESHPEERING: + if (ia->ia_action < N(meshpl_recv_action)) + f = meshpl_recv_action[ia->ia_action]; + break; + case IEEE80211_ACTION_CAT_MESHLMETRIC: + if (ia->ia_action < N(meshlm_recv_action)) + f = meshlm_recv_action[ia->ia_action]; + break; case IEEE80211_ACTION_CAT_VENDOR: if (ia->ia_action < N(vendor_recv_action)) f = vendor_recv_action[ia->ia_action]; Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 3 11:37:58 2009 (r195306) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 3 14:37:10 2009 (r195307) @@ -1104,7 +1104,8 @@ mesh_recv_action_meshpeering_open(struct uint16_t args[3]; /* +2 for capabilites */ - meshpeer = mesh_parse_meshpeering_action(ni, wh, frm + 2, efrm, &ie); + meshpeer = mesh_parse_meshpeering_action(ni, wh, + frm + sizeof(struct ieee80211_action) + 2, efrm, &ie); if (meshpeer == NULL) { return 0; } @@ -1238,7 +1239,8 @@ mesh_recv_action_meshpeering_confirm(str uint16_t args[3]; /* +2+2+2 for capabilites + status code + AID */ - meshpeer = mesh_parse_meshpeering_action(ni, wh, frm+2+2+2, efrm, &ie); + meshpeer = mesh_parse_meshpeering_action(ni, wh, + frm + sizeof(struct ieee80211_action) + 2 + 2 + 2, efrm, &ie); if (meshpeer == NULL) { return 0; } @@ -1383,6 +1385,7 @@ mesh_send_action_meshpeering_open(struct { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; + struct ieee80211_mesh_state *ms = vap->iv_mesh; uint16_t *args = args0; const struct ieee80211_rateset *rs; struct mbuf *m; @@ -1399,8 +1402,13 @@ mesh_send_action_meshpeering_open(struct m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ - /* XXX may action payload */ - + sizeof(struct ieee80211_action_ba_addbaresponse) + + sizeof(uint16_t) /* capabilites */ + + sizeof(struct ieee80211_meshpeerver_ie) + + 2 + IEEE80211_RATE_SIZE + + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + + 2 + ms->ms_idlen /* Mesh ID */ + + sizeof(struct ieee80211_meshconf_ie) + + sizeof(struct ieee80211_meshpeer_ie) ); if (m != NULL) { /* @@ -1441,6 +1449,7 @@ mesh_send_action_meshpeering_confirm(str { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; + struct ieee80211_mesh_state *ms = vap->iv_mesh; uint16_t *args = args0; const struct ieee80211_rateset *rs; struct mbuf *m; @@ -1458,8 +1467,15 @@ mesh_send_action_meshpeering_confirm(str m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ - /* XXX may action payload */ - + sizeof(struct ieee80211_action_ba_addbaresponse) + + sizeof(uint16_t) /* capabilites */ + + sizeof(uint16_t) /* status code */ + + sizeof(uint16_t) /* AID */ + + sizeof(struct ieee80211_meshpeerver_ie) + + 2 + IEEE80211_RATE_SIZE + + 2 + (IEEE80211_RATE_MAXSIZE - IEEE80211_RATE_SIZE) + + 2 + ms->ms_idlen /* Mesh ID */ + + sizeof(struct ieee80211_meshconf_ie) + + sizeof(struct ieee80211_meshpeer_ie) ); if (m != NULL) { /* @@ -1505,6 +1521,7 @@ mesh_send_action_meshpeering_close(struc { struct ieee80211vap *vap = ni->ni_vap; struct ieee80211com *ic = ni->ni_ic; + struct ieee80211_mesh_state *ms = vap->iv_mesh; uint16_t *args = args0; struct mbuf *m; uint8_t *frm; @@ -1521,8 +1538,10 @@ mesh_send_action_meshpeering_close(struc m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ - /* XXX may action payload */ - + sizeof(struct ieee80211_action_ba_addbaresponse) + + sizeof(uint16_t) /* reason code */ + + sizeof(struct ieee80211_meshpeerver_ie) + + 2 + ms->ms_idlen /* Mesh ID */ + + sizeof(struct ieee80211_meshpeer_ie) ); if (m != NULL) { /* @@ -1610,6 +1629,7 @@ mesh_send_action_meshlink_reply(struct i m = ieee80211_getmgtframe(&frm, ic->ic_headroom + sizeof(struct ieee80211_frame), sizeof(uint16_t) /* action+category */ + + sizeof(struct ieee80211_meshlmetric_ie) ); if (m != NULL) { /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907031437.n63EbApC080395>