Date: Fri, 3 Jul 2009 18:31:14 +0000 (UTC) From: Sam Leffler <sam@FreeBSD.org> To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r195320 - projects/mesh11s/sys/net80211 Message-ID: <200907031831.n63IVEId085279@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: sam Date: Fri Jul 3 18:31:14 2009 New Revision: 195320 URL: http://svn.freebsd.org/changeset/base/195320 Log: Move mesh internal work out of the node area: o add ieee80211_mesh_node_init to setup mesh state in a node o add ieee80211_mesh_node_cleanup to cleanup mesh state in a node o add ieee80211_mesh_init_neighbor to init mesh state on neighbor discovery Reviewed by: rpaulo Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c projects/mesh11s/sys/net80211/ieee80211_mesh.h projects/mesh11s/sys/net80211/ieee80211_node.c Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 3 17:58:45 2009 (r195319) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.c Fri Jul 3 18:31:14 2009 (r195320) @@ -2019,6 +2019,36 @@ ieee80211_add_meshlmetric(uint8_t *frm, #undef ADDSHORT #undef ADDWORD +/* + * Initialize any mesh-specific node state. + */ +void +ieee80211_mesh_node_init(struct ieee80211vap *vap, struct ieee80211_node *ni) +{ + callout_init(&ni->ni_mltimer, CALLOUT_MPSAFE); +} + +/* + * Cleanup any mesh-specific node state. + */ +void +ieee80211_mesh_node_cleanup(struct ieee80211_node *ni) +{ + /* XXX stop/drain timer? */ +} + +/* + * Setup mesh-specific node state on neighbor discovery. + */ +void +ieee80211_mesh_init_neighbor(struct ieee80211_node *ni, + const struct ieee80211_frame *wh, + const struct ieee80211_scanparams *sp) +{ + ni->ni_meshidlen = sp->meshid[1]; + memcpy(ni->ni_meshid, sp->meshid + 2, sp->meshid[1]); +} + void ieee80211_create_mbss(struct ieee80211vap *vap, struct ieee80211_channel *chan) { Modified: projects/mesh11s/sys/net80211/ieee80211_mesh.h ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 3 17:58:45 2009 (r195319) +++ projects/mesh11s/sys/net80211/ieee80211_mesh.h Fri Jul 3 18:31:14 2009 (r195320) @@ -417,6 +417,14 @@ uint8_t * ieee80211_add_meshpeer(uint8_t uint16_t); uint32_t ieee80211_airtime_calc(struct ieee80211_node *); uint8_t * ieee80211_add_meshlmetric(uint8_t *, uint32_t); + +void ieee80211_mesh_node_init(struct ieee80211vap *, + struct ieee80211_node *); +void ieee80211_mesh_node_cleanup(struct ieee80211_node *); +struct ieee80211_scanparams; +void ieee80211_mesh_init_neighbor(struct ieee80211_node *, + const struct ieee80211_frame *, + const struct ieee80211_scanparams *); void ieee80211_create_mbss(struct ieee80211vap *, struct ieee80211_channel *); #endif /* _KERNEL */ Modified: projects/mesh11s/sys/net80211/ieee80211_node.c ============================================================================== --- projects/mesh11s/sys/net80211/ieee80211_node.c Fri Jul 3 17:58:45 2009 (r195319) +++ projects/mesh11s/sys/net80211/ieee80211_node.c Fri Jul 3 18:31:14 2009 (r195320) @@ -962,6 +962,11 @@ node_cleanup(struct ieee80211_node *ni) ieee80211_ff_node_cleanup(ni); #endif /* + * Cleanup any mesh-related state. + */ + if (vap->iv_opmode == IEEE80211_M_MBSS) + ieee80211_mesh_node_cleanup(ni); + /* * Clear any staging queue entries. */ ieee80211_ageq_drain_node(&ic->ic_stageq, ni); @@ -1100,6 +1105,8 @@ ieee80211_alloc_node(struct ieee80211_no ni->ni_inact = ni->ni_inact_reload; ni->ni_ath_defkeyix = 0x7fff; ieee80211_psq_init(&ni->ni_psq, "unknown"); + if (vap->iv_opmode == IEEE80211_M_MBSS) + ieee80211_mesh_node_init(vap, ni); IEEE80211_NODE_LOCK(nt); TAILQ_INSERT_TAIL(&nt->nt_node, ni, ni_list); @@ -1403,11 +1410,8 @@ ieee80211_init_neighbor(struct ieee80211 ni->ni_fhindex = sp->fhindex; ni->ni_erp = sp->erp; ni->ni_timoff = sp->timoff; - if (vap->iv_opmode == IEEE80211_M_MBSS) { - ni->ni_meshidlen = sp->meshid[1]; - memcpy(ni->ni_meshid, sp->meshid + 2, sp->meshid[1]); - callout_init(&ni->ni_mltimer, CALLOUT_MPSAFE); - } + if (vap->iv_opmode == IEEE80211_M_MBSS) + ieee80211_mesh_init_neighbor(ni, wh, sp); if (ieee80211_ies_init(&ni->ni_ies, sp->ies, sp->ies_len)) { ieee80211_ies_expand(&ni->ni_ies);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907031831.n63IVEId085279>