Skip to contentSkip to conversation

mac80211: implement RANN processing and forwarding

PATCH Superseded Rui Paulo 3 participants 4 messages Nov 10, 2009 – Nov 11, 2009 1 message not in the archive

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Rui Paulo

author
#0 lore raw

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
index 50c684d..e6cd039 100644
@@ -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 2
 
 struct 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
index 1f4f88a..f6fdea6 100644
@@ -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
index aedbaaa..da86e15 100644
@@ -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
#1 lore raw
Quoted 29 lines · Rui Paulo

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 +7 -0
index 50c684d..e6cd039 100644
@@ -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 2
 
 struct 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.
maintainer
#3 lore raw
In reply to a message not in the archive
Quoted 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_ALEN in ieee80211.h and there are quite some places we could use it. Should we include if_ether.h in ieee80211.h (probably too evil) or should I just keep using 6 instead of ETH_ALEN ?

When John mentioned this I remembered falling into that trap before .. maybe better to just keep using 6, sorry!

johannes

#4 lore raw
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_ALEN in ieee80211.h and there are quite some places we could use it. Should we include if_ether.h in ieee80211.h (probably too evil) or should I just keep using 6 instead of ETH_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.