summaryrefslogtreecommitdiffstats
path: root/sys/net80211/ieee80211_ddb.c
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2009-07-11 15:02:45 +0000
committerrpaulo <rpaulo@FreeBSD.org>2009-07-11 15:02:45 +0000
commit8424d740209fc6cee8a8bc4deba2a40cdc77d1fd (patch)
tree7dd4e6a8c026ec13b70ca0a34e625684d79ec055 /sys/net80211/ieee80211_ddb.c
parentba5583d31888cb78136b114790fce49c792c14d0 (diff)
downloadFreeBSD-src-8424d740209fc6cee8a8bc4deba2a40cdc77d1fd.zip
FreeBSD-src-8424d740209fc6cee8a8bc4deba2a40cdc77d1fd.tar.gz
Implementation of the upcoming Wireless Mesh standard, 802.11s, on the
net80211 wireless stack. This work is based on the March 2009 D3.0 draft standard. This standard is expected to become final next year. This includes two main net80211 modules, ieee80211_mesh.c which deals with peer link management, link metric calculation, routing table control and mesh configuration and ieee80211_hwmp.c which deals with the actually routing process on the mesh network. HWMP is the mandatory routing protocol on by the mesh standard, but others, such as RA-OLSR, can be implemented. Authentication and encryption are not implemented. There are several scripts under tools/tools/net80211/scripts that can be used to test different mesh network topologies and they also teach you how to setup a mesh vap (for the impatient: ifconfig wlan0 create wlandev ... wlanmode mesh). A new build option is available: IEEE80211_SUPPORT_MESH and it's enabled by default on GENERIC kernels for i386, amd64, sparc64 and pc98. Drivers that support mesh networks right now are: ath, ral and mwl. More information at: http://wiki.freebsd.org/WifiMesh Please note that this work is experimental. Also, please note that bridging a mesh vap with another network interface is not yet supported. Many thanks to the FreeBSD Foundation for sponsoring this project and to Sam Leffler for his support. Also, I would like to thank Gateworks Corporation for sending me a Cambria board which was used during the development of this project. Reviewed by: sam Approved by: re (kensmith) Obtained from: projects/mesh11s
Diffstat (limited to 'sys/net80211/ieee80211_ddb.c')
-rw-r--r--sys/net80211/ieee80211_ddb.c73
1 files changed, 69 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_ddb.c b/sys/net80211/ieee80211_ddb.c
index 6d70930..57447d5 100644
--- a/sys/net80211/ieee80211_ddb.c
+++ b/sys/net80211/ieee80211_ddb.c
@@ -50,6 +50,9 @@ __FBSDID("$FreeBSD$");
#ifdef IEEE80211_SUPPORT_TDMA
#include <net80211/ieee80211_tdma.h>
#endif
+#ifdef IEEE80211_SUPPORT_MESH
+#include <net80211/ieee80211_mesh.h>
+#endif
#include <ddb/ddb.h>
#include <ddb/db_sym.h>
@@ -75,7 +78,11 @@ static void _db_show_roamparams(const char *tag, const void *arg,
const struct ieee80211_roamparam *rp);
static void _db_show_txparams(const char *tag, const void *arg,
const struct ieee80211_txparam *tp);
+static void _db_show_ageq(const char *tag, const struct ieee80211_ageq *q);
static void _db_show_stats(const struct ieee80211_stats *);
+#ifdef IEEE80211_SUPPORT_MESH
+static void _db_show_mesh(const struct ieee80211_mesh_state *);
+#endif
DB_SHOW_COMMAND(sta, db_show_sta)
{
@@ -178,6 +185,20 @@ DB_SHOW_ALL_COMMAND(vaps, db_show_all_vaps)
}
}
+#ifdef IEEE80211_SUPPORT_MESH
+DB_SHOW_ALL_COMMAND(mesh, db_show_mesh)
+{
+ const struct ieee80211_mesh_state *ms;
+
+ if (!have_addr) {
+ db_printf("usage: show mesh <addr>\n");
+ return;
+ }
+ ms = (const struct ieee80211_mesh_state *) addr;
+ _db_show_mesh(ms);
+}
+#endif /* IEEE80211_SUPPORT_MESH */
+
static void
_db_show_txampdu(const char *sep, int ix, const struct ieee80211_tx_ampdu *tap)
{
@@ -283,7 +304,12 @@ _db_show_sta(const struct ieee80211_node *ni)
db_printf("\tinact %u inact_reload %u txrate %u\n",
ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate);
- /* XXX wdsq */
+#ifdef IEEE80211_SUPPORT_MESH
+ _db_show_ssid("\tmeshid ", 0, ni->ni_meshidlen, ni->ni_meshid);
+ db_printf(" mlstate %b mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n",
+ ni->ni_mlstate, IEEE80211_MESH_MLSTATE_BITS,
+ ni->ni_mllid, ni->ni_mlpid, ni->ni_mlrcnt, ni->ni_mltval);
+#endif
}
#ifdef IEEE80211_SUPPORT_TDMA
@@ -563,10 +589,13 @@ _db_show_com(const struct ieee80211com *ic, int showvaps, int showsta, int showp
db_printf("\n");
db_printf("\tmax_keyix %d", ic->ic_max_keyix);
+ db_printf(" hash_key 0x%x", ic->ic_hash_key);
db_printf(" wme %p", &ic->ic_wme);
if (!showsta)
db_printf(" sta %p", &ic->ic_sta);
db_printf("\n");
+ db_printf("\tstageq@%p:\n", &ic->ic_stageq);
+ _db_show_ageq("\t", &ic->ic_stageq);
if (showsta)
_db_show_node_table("\t", &ic->ic_sta);
@@ -643,16 +672,16 @@ _db_show_node_table(const char *tag, const struct ieee80211_node_table *nt)
int i;
db_printf("%s%s@%p:\n", tag, nt->nt_name, nt);
- db_printf("%s nodelock %p", tag, &nt->nt_nodelock);
+ db_printf("%s nodelock %p", tag, &nt->nt_nodelock);
db_printf(" inact_init %d", nt->nt_inact_init);
db_printf(" scanlock %p", &nt->nt_scanlock);
db_printf(" scangen %u\n", nt->nt_scangen);
- db_printf("%s keyixmax %d keyixmap %p\n",
+ db_printf("%s keyixmax %d keyixmap %p\n",
tag, nt->nt_keyixmax, nt->nt_keyixmap);
for (i = 0; i < nt->nt_keyixmax; i++) {
const struct ieee80211_node *ni = nt->nt_keyixmap[i];
if (ni != NULL)
- db_printf("%s [%3u] %p %s\n", tag, i, ni,
+ db_printf("%s [%3u] %p %s\n", tag, i, ni,
ether_sprintf(ni->ni_macaddr));
}
}
@@ -810,7 +839,43 @@ _db_show_txparams(const char *tag, const void *arg,
}
static void
+_db_show_ageq(const char *tag, const struct ieee80211_ageq *q)
+{
+ const struct mbuf *m;
+
+ db_printf("%s lock %p len %d maxlen %d drops %d head %p tail %p\n",
+ tag, &q->aq_lock, q->aq_len, q->aq_maxlen, q->aq_drops,
+ q->aq_head, q->aq_tail);
+ for (m = q->aq_head; m != NULL; m = m->m_nextpkt)
+ db_printf("%s %p (len %d, %b)\n", tag, m, m->m_len,
+ /* XXX could be either TX or RX but is mostly TX */
+ m->m_flags, IEEE80211_MBUF_TX_FLAG_BITS);
+}
+
+static void
_db_show_stats(const struct ieee80211_stats *is)
{
}
+
+#ifdef IEEE80211_SUPPORT_MESH
+static void
+_db_show_mesh(const struct ieee80211_mesh_state *ms)
+{
+ struct ieee80211_mesh_route *rt;
+ int i;
+
+ _db_show_ssid(" meshid ", 0, ms->ms_idlen, ms->ms_id);
+ db_printf("nextseq %u ttl %u flags 0x%x\n", ms->ms_seq,
+ ms->ms_ttl, ms->ms_flags);
+ db_printf("routing table:\n");
+ i = 0;
+ TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) {
+ db_printf("entry %d:\tdest: %6D nexthop: %6D metric: %u", i,
+ rt->rt_dest, ":", rt->rt_nexthop, ":", rt->rt_metric);
+ db_printf("\tlifetime: %u lastseq: %u priv: %p\n",
+ rt->rt_lifetime, rt->rt_lastmseq, rt->rt_priv);
+ i++;
+ }
+}
+#endif /* IEEE80211_SUPPORT_MESH */
#endif /* DDB */
OpenPOWER on IntegriCloud