mac80211: implement RANN processing and forwarding
Subsystems (2)
PATCH v3 11/20 mac80211: implement RANN processing and forwarding
Process the RANN (Root Annoucement) Frame and try to find the HWMP root station by sending a PREQ.
--- include/linux/ieee80211.h | 15 ++++++++ net/mac80211/ieee80211_i.h | 1 + net/mac80211/mesh_hwmp.c | 79 +++++++++++++++++++++++++++++++++++++++---- net/mac80211/util.c | 4 ++ 4 files changed, 91 insertions(+), 8 deletions(-)
include/linux/ieee80211.h +15 -0
@@ -554,6 +554,20 @@ struct ieee80211_tim_ie {u8 virtual_map[1 ]; } __attribute__ ((packed)); +/** +* struct ieee80211_rann_ie +* +* This structure refers to "Root Announcement information element" +*/ +struct ieee80211_rann_ie { +u8 rann_flags; +u8 rann_hopcount; +u8 rann_ttl; +u8 rann_addr[ETH_ALEN ]; +u32 rann_seq; +u32 rann_metric; +} __attribute__ ((packed)); +#define WLAN_SA_QUERY_TR_ID_LEN 2struct ieee80211_mgmt {
@@ -1070,6 +1084,7 @@ enum ieee80211_eid {WLAN_EID_PREQ =68 ,WLAN_EID_PREP =69 ,WLAN_EID_PERR =70 , +WLAN_EID_RANN =49 ,/* compatible with FreeBSD */ /* 802.11h */ WLAN_EID_PWR_CONSTRAINT =32 , WLAN_EID_PWR_CAPABILITY = 33,
net/mac80211/ieee80211_i.h +1 -0
@@ -799,6 +799,7 @@ struct ieee802_11_elems {u8 *preq;u8 *prep;u8 *perr; +struct ieee80211_rann_ie *rann;u8 *ch_switch_elem;u8 *country_elem;u8 *pwr_constr_elem;
net/mac80211/mesh_hwmp.c +71 -8
127 lines not on this page · raw message
net/mac80211/util.c +4 -0
@@ -685,6 +685,10 @@ u32 ieee802_11_parse_elems_crc(u8 *start, size_t len, elems->perr = pos; elems->perr_len = elen;break ; +case WLAN_EID_RANN : +if (elen >=sizeof (struct ieee80211_rann_ie )) + elems->rann = (void *)pos; +break ;case WLAN_EID_CHANNEL_SWITCH : elems->ch_switch_elem = pos; elems->ch_switch_elem_len = elen;
Signature · 1 line
1.5.6.5
Quoted 29 lines · Rui Paulo
Process the RANN (Root Annoucement) Frame and try to find the HWMP root station by sending a PREQ.
Signed-off-by Rui Paulo <[email protected]>Signed-off-by Javier Cardona <[email protected]>Reviewed-by Andrey Yurovsky <[email protected]>Tested-by Brian Cavagnolo <[email protected]>--- include/linux/ieee80211.h | 15 ++++++++ net/mac80211/ieee80211_i.h | 1 + net/mac80211/mesh_hwmp.c | 79 +++++++++++++++++++++++++++++++++++++++---- net/mac80211/util.c | 4 ++ 4 files changed, 91 insertions(+), 8 deletions(-)include/linux/ieee80211.h +7
-0@@ -554,6 +554,20 @@ struct ieee80211_tim_ie {u8 virtual_map[1 ]; } __attribute__ ((packed)); +/** +* struct ieee80211_rann_ie +* +* This structure refers to "Root Announcement information element" +*/ +struct ieee80211_rann_ie { +u8 rann_flags;
include/linux/ieee80211.h struct ieee80211_tim_ie { · line 573
Quoted 10 lines
include/linux/ieee80211.h +7
-0+u8 rann_hopcount; +u8 rann_ttl; +u8 rann_addr[ETH_ALEN ]; +u32 rann_seq; +u32 rann_metric; +} __attribute__ ((packed)); +#define WLAN_SA_QUERY_TR_ID_LEN 2struct ieee80211_mgmt {
In file included from net/wireless/lib80211.c:19:include/linux/ieee80211.h:566: error: ‘ETH_ALEN’ undeclared here (not in a function)
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.
Johannes Berg
maintainerQuoted 6 lines · Rui Paulo
Hi John,
Quoted 2 lines · John W. Linville
In file included from
net/wireless/lib80211.c:19:include/linux/ieee80211.h:566: error: ‘ETH_ALEN’ undeclared here (not in a function)
Quoted 6 lines
Hmm, I must've busted my testing procedure. I'm sorry.
Anyway, I noticed that nothing uses
ETH_ALENinieee80211.hand there are quite some places we could use it. Should we includeif_ether.hinieee80211.h(probably too evil) or should I just keep using 6 instead ofETH_ALEN?
When John mentioned this I remembered falling into that trap before .. maybe better to just keep using 6, sorry!
johannes
Quoted 9 lines · Johannes Berg
Quoted 8 lines · Rui Paulo
Hi John,
Quoted 2 lines · John W. Linville
In file included from
net/wireless/lib80211.c:19:include/linux/ieee80211.h:566: error: ‘ETH_ALEN’ undeclared here (not in a function)Hmm, I must've busted my testing procedure. I'm sorry.
Quoted 7 lines
Quoted 4 lines
Anyway, I noticed that nothing uses
ETH_ALENinieee80211.hand there are quite some places we could use it. Should we includeif_ether.hinieee80211.h(probably too evil) or should I just keep using 6 instead ofETH_ALEN?When John mentioned this I remembered falling into that trap before .. maybe better to just keep using 6, sorry!
I don't much care either way. FWIW I would tend to prefer ETH_ALEN over 6, so long as it doesn't break the build... :-)
John
Signature · 2 lines
John W. Linville Someday the world will need a hero, and you [email protected] might be all we have. Be ready.