Deleted Added
full compact
ieee80211_ddb.c (194739) ieee80211_ddb.c (195618)
1/*-
2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2007-2009 Sam Leffler, Errno Consulting
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 10 unchanged lines hidden (view full) ---

19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25
26#include <sys/cdefs.h>
27__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ddb.c 194739 2009-06-23 17:03:45Z bz $");
27__FBSDID("$FreeBSD: head/sys/net80211/ieee80211_ddb.c 195618 2009-07-11 15:02:45Z rpaulo $");
28
29#include "opt_ddb.h"
30#include "opt_wlan.h"
31
32#ifdef DDB
33/*
34 * IEEE 802.11 DDB support
35 */

--- 9 unchanged lines hidden (view full) ---

45#include <net/if_types.h>
46#include <net/ethernet.h>
47#include <net/vnet.h>
48
49#include <net80211/ieee80211_var.h>
50#ifdef IEEE80211_SUPPORT_TDMA
51#include <net80211/ieee80211_tdma.h>
52#endif
28
29#include "opt_ddb.h"
30#include "opt_wlan.h"
31
32#ifdef DDB
33/*
34 * IEEE 802.11 DDB support
35 */

--- 9 unchanged lines hidden (view full) ---

45#include <net/if_types.h>
46#include <net/ethernet.h>
47#include <net/vnet.h>
48
49#include <net80211/ieee80211_var.h>
50#ifdef IEEE80211_SUPPORT_TDMA
51#include <net80211/ieee80211_tdma.h>
52#endif
53#ifdef IEEE80211_SUPPORT_MESH
54#include <net80211/ieee80211_mesh.h>
55#endif
53
54#include <ddb/ddb.h>
55#include <ddb/db_sym.h>
56
57#define DB_PRINTSYM(prefix, name, addr) do { \
58 db_printf("%s%-25s : ", prefix, name); \
59 db_printsym((db_addr_t) addr, DB_STGY_ANY); \
60 db_printf("\n"); \

--- 9 unchanged lines hidden (view full) ---

70static void _db_show_channel(const char *tag, const struct ieee80211_channel *);
71static void _db_show_ssid(const char *tag, int ix, int len, const uint8_t *);
72static void _db_show_appie(const char *tag, const struct ieee80211_appie *);
73static void _db_show_key(const char *tag, int ix, const struct ieee80211_key *);
74static void _db_show_roamparams(const char *tag, const void *arg,
75 const struct ieee80211_roamparam *rp);
76static void _db_show_txparams(const char *tag, const void *arg,
77 const struct ieee80211_txparam *tp);
56
57#include <ddb/ddb.h>
58#include <ddb/db_sym.h>
59
60#define DB_PRINTSYM(prefix, name, addr) do { \
61 db_printf("%s%-25s : ", prefix, name); \
62 db_printsym((db_addr_t) addr, DB_STGY_ANY); \
63 db_printf("\n"); \

--- 9 unchanged lines hidden (view full) ---

73static void _db_show_channel(const char *tag, const struct ieee80211_channel *);
74static void _db_show_ssid(const char *tag, int ix, int len, const uint8_t *);
75static void _db_show_appie(const char *tag, const struct ieee80211_appie *);
76static void _db_show_key(const char *tag, int ix, const struct ieee80211_key *);
77static void _db_show_roamparams(const char *tag, const void *arg,
78 const struct ieee80211_roamparam *rp);
79static void _db_show_txparams(const char *tag, const void *arg,
80 const struct ieee80211_txparam *tp);
81static void _db_show_ageq(const char *tag, const struct ieee80211_ageq *q);
78static void _db_show_stats(const struct ieee80211_stats *);
82static void _db_show_stats(const struct ieee80211_stats *);
83#ifdef IEEE80211_SUPPORT_MESH
84static void _db_show_mesh(const struct ieee80211_mesh_state *);
85#endif
79
80DB_SHOW_COMMAND(sta, db_show_sta)
81{
82 if (!have_addr) {
83 db_printf("usage: show sta <addr>\n");
84 return;
85 }
86 _db_show_sta((const struct ieee80211_node *) addr);

--- 86 unchanged lines hidden (view full) ---

173 vap->iv_ifp->if_xname, vap);
174 db_printf("\n");
175 } else
176 _db_show_com(ic, 1, 1, 1);
177 }
178 }
179}
180
86
87DB_SHOW_COMMAND(sta, db_show_sta)
88{
89 if (!have_addr) {
90 db_printf("usage: show sta <addr>\n");
91 return;
92 }
93 _db_show_sta((const struct ieee80211_node *) addr);

--- 86 unchanged lines hidden (view full) ---

180 vap->iv_ifp->if_xname, vap);
181 db_printf("\n");
182 } else
183 _db_show_com(ic, 1, 1, 1);
184 }
185 }
186}
187
188#ifdef IEEE80211_SUPPORT_MESH
189DB_SHOW_ALL_COMMAND(mesh, db_show_mesh)
190{
191 const struct ieee80211_mesh_state *ms;
192
193 if (!have_addr) {
194 db_printf("usage: show mesh <addr>\n");
195 return;
196 }
197 ms = (const struct ieee80211_mesh_state *) addr;
198 _db_show_mesh(ms);
199}
200#endif /* IEEE80211_SUPPORT_MESH */
201
181static void
182_db_show_txampdu(const char *sep, int ix, const struct ieee80211_tx_ampdu *tap)
183{
184 db_printf("%stxampdu[%d]: %p flags %b %s\n",
185 sep, ix, tap, tap->txa_flags, IEEE80211_AGGR_BITS,
186 ieee80211_wme_acnames[tap->txa_ac]);
187 db_printf("%s token %u lastsample %d pkts %d avgpps %d qbytes %d qframes %d\n",
188 sep, tap->txa_token, tap->txa_lastsample, tap->txa_pkts,

--- 89 unchanged lines hidden (view full) ---

278 if (ni->ni_tx_ampdu[i].txa_flags & IEEE80211_AGGR_SETUP)
279 _db_show_txampdu("\t", i, &ni->ni_tx_ampdu[i]);
280 for (i = 0; i < WME_NUM_TID; i++)
281 if (ni->ni_rx_ampdu[i].rxa_flags)
282 _db_show_rxampdu("\t", i, &ni->ni_rx_ampdu[i]);
283
284 db_printf("\tinact %u inact_reload %u txrate %u\n",
285 ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate);
202static void
203_db_show_txampdu(const char *sep, int ix, const struct ieee80211_tx_ampdu *tap)
204{
205 db_printf("%stxampdu[%d]: %p flags %b %s\n",
206 sep, ix, tap, tap->txa_flags, IEEE80211_AGGR_BITS,
207 ieee80211_wme_acnames[tap->txa_ac]);
208 db_printf("%s token %u lastsample %d pkts %d avgpps %d qbytes %d qframes %d\n",
209 sep, tap->txa_token, tap->txa_lastsample, tap->txa_pkts,

--- 89 unchanged lines hidden (view full) ---

299 if (ni->ni_tx_ampdu[i].txa_flags & IEEE80211_AGGR_SETUP)
300 _db_show_txampdu("\t", i, &ni->ni_tx_ampdu[i]);
301 for (i = 0; i < WME_NUM_TID; i++)
302 if (ni->ni_rx_ampdu[i].rxa_flags)
303 _db_show_rxampdu("\t", i, &ni->ni_rx_ampdu[i]);
304
305 db_printf("\tinact %u inact_reload %u txrate %u\n",
306 ni->ni_inact, ni->ni_inact_reload, ni->ni_txrate);
286 /* XXX wdsq */
307#ifdef IEEE80211_SUPPORT_MESH
308 _db_show_ssid("\tmeshid ", 0, ni->ni_meshidlen, ni->ni_meshid);
309 db_printf(" mlstate %b mllid 0x%x mlpid 0x%x mlrcnt %u mltval %u\n",
310 ni->ni_mlstate, IEEE80211_MESH_MLSTATE_BITS,
311 ni->ni_mllid, ni->ni_mlpid, ni->ni_mlrcnt, ni->ni_mltval);
312#endif
287}
288
289#ifdef IEEE80211_SUPPORT_TDMA
290static void
291_db_show_tdma(const char *sep, const struct ieee80211_tdma_state *ts, int showprocs)
292{
293 db_printf("%stdma %p:\n", sep, ts);
294 db_printf("%s version %u slot %u bintval %u peer %p\n", sep,

--- 263 unchanged lines hidden (view full) ---

558 db_printf("\n");
559
560 db_printf("\tscan %p", ic->ic_scan);
561 db_printf(" lastdata %d", ic->ic_lastdata);
562 db_printf(" lastscan %d", ic->ic_lastscan);
563 db_printf("\n");
564
565 db_printf("\tmax_keyix %d", ic->ic_max_keyix);
313}
314
315#ifdef IEEE80211_SUPPORT_TDMA
316static void
317_db_show_tdma(const char *sep, const struct ieee80211_tdma_state *ts, int showprocs)
318{
319 db_printf("%stdma %p:\n", sep, ts);
320 db_printf("%s version %u slot %u bintval %u peer %p\n", sep,

--- 263 unchanged lines hidden (view full) ---

584 db_printf("\n");
585
586 db_printf("\tscan %p", ic->ic_scan);
587 db_printf(" lastdata %d", ic->ic_lastdata);
588 db_printf(" lastscan %d", ic->ic_lastscan);
589 db_printf("\n");
590
591 db_printf("\tmax_keyix %d", ic->ic_max_keyix);
592 db_printf(" hash_key 0x%x", ic->ic_hash_key);
566 db_printf(" wme %p", &ic->ic_wme);
567 if (!showsta)
568 db_printf(" sta %p", &ic->ic_sta);
569 db_printf("\n");
593 db_printf(" wme %p", &ic->ic_wme);
594 if (!showsta)
595 db_printf(" sta %p", &ic->ic_sta);
596 db_printf("\n");
597 db_printf("\tstageq@%p:\n", &ic->ic_stageq);
598 _db_show_ageq("\t", &ic->ic_stageq);
570 if (showsta)
571 _db_show_node_table("\t", &ic->ic_sta);
572
573 db_printf("\tprotmode %d", ic->ic_protmode);
574 db_printf(" nonerpsta %u", ic->ic_nonerpsta);
575 db_printf(" longslotsta %u", ic->ic_longslotsta);
576 db_printf(" lastnonerp %d", ic->ic_lastnonerp);
577 db_printf("\n");

--- 60 unchanged lines hidden (view full) ---

638}
639
640static void
641_db_show_node_table(const char *tag, const struct ieee80211_node_table *nt)
642{
643 int i;
644
645 db_printf("%s%s@%p:\n", tag, nt->nt_name, nt);
599 if (showsta)
600 _db_show_node_table("\t", &ic->ic_sta);
601
602 db_printf("\tprotmode %d", ic->ic_protmode);
603 db_printf(" nonerpsta %u", ic->ic_nonerpsta);
604 db_printf(" longslotsta %u", ic->ic_longslotsta);
605 db_printf(" lastnonerp %d", ic->ic_lastnonerp);
606 db_printf("\n");

--- 60 unchanged lines hidden (view full) ---

667}
668
669static void
670_db_show_node_table(const char *tag, const struct ieee80211_node_table *nt)
671{
672 int i;
673
674 db_printf("%s%s@%p:\n", tag, nt->nt_name, nt);
646 db_printf("%s nodelock %p", tag, &nt->nt_nodelock);
675 db_printf("%s nodelock %p", tag, &nt->nt_nodelock);
647 db_printf(" inact_init %d", nt->nt_inact_init);
648 db_printf(" scanlock %p", &nt->nt_scanlock);
649 db_printf(" scangen %u\n", nt->nt_scangen);
676 db_printf(" inact_init %d", nt->nt_inact_init);
677 db_printf(" scanlock %p", &nt->nt_scanlock);
678 db_printf(" scangen %u\n", nt->nt_scangen);
650 db_printf("%s keyixmax %d keyixmap %p\n",
679 db_printf("%s keyixmax %d keyixmap %p\n",
651 tag, nt->nt_keyixmax, nt->nt_keyixmap);
652 for (i = 0; i < nt->nt_keyixmax; i++) {
653 const struct ieee80211_node *ni = nt->nt_keyixmap[i];
654 if (ni != NULL)
680 tag, nt->nt_keyixmax, nt->nt_keyixmap);
681 for (i = 0; i < nt->nt_keyixmax; i++) {
682 const struct ieee80211_node *ni = nt->nt_keyixmap[i];
683 if (ni != NULL)
655 db_printf("%s [%3u] %p %s\n", tag, i, ni,
684 db_printf("%s [%3u] %p %s\n", tag, i, ni,
656 ether_sprintf(ni->ni_macaddr));
657 }
658}
659
660static void
661_db_show_channel(const char *tag, const struct ieee80211_channel *c)
662{
663 db_printf("%s ", tag);

--- 141 unchanged lines hidden (view full) ---

805 db_printf(tag, arg);
806 printrate("ucastrate", tp->ucastrate);
807 printrate("mcastrate", tp->mcastrate);
808 printrate("mgmtrate", tp->mgmtrate);
809 db_printf(" maxretry %d", tp->maxretry);
810}
811
812static void
685 ether_sprintf(ni->ni_macaddr));
686 }
687}
688
689static void
690_db_show_channel(const char *tag, const struct ieee80211_channel *c)
691{
692 db_printf("%s ", tag);

--- 141 unchanged lines hidden (view full) ---

834 db_printf(tag, arg);
835 printrate("ucastrate", tp->ucastrate);
836 printrate("mcastrate", tp->mcastrate);
837 printrate("mgmtrate", tp->mgmtrate);
838 db_printf(" maxretry %d", tp->maxretry);
839}
840
841static void
842_db_show_ageq(const char *tag, const struct ieee80211_ageq *q)
843{
844 const struct mbuf *m;
845
846 db_printf("%s lock %p len %d maxlen %d drops %d head %p tail %p\n",
847 tag, &q->aq_lock, q->aq_len, q->aq_maxlen, q->aq_drops,
848 q->aq_head, q->aq_tail);
849 for (m = q->aq_head; m != NULL; m = m->m_nextpkt)
850 db_printf("%s %p (len %d, %b)\n", tag, m, m->m_len,
851 /* XXX could be either TX or RX but is mostly TX */
852 m->m_flags, IEEE80211_MBUF_TX_FLAG_BITS);
853}
854
855static void
813_db_show_stats(const struct ieee80211_stats *is)
814{
815}
856_db_show_stats(const struct ieee80211_stats *is)
857{
858}
859
860#ifdef IEEE80211_SUPPORT_MESH
861static void
862_db_show_mesh(const struct ieee80211_mesh_state *ms)
863{
864 struct ieee80211_mesh_route *rt;
865 int i;
866
867 _db_show_ssid(" meshid ", 0, ms->ms_idlen, ms->ms_id);
868 db_printf("nextseq %u ttl %u flags 0x%x\n", ms->ms_seq,
869 ms->ms_ttl, ms->ms_flags);
870 db_printf("routing table:\n");
871 i = 0;
872 TAILQ_FOREACH(rt, &ms->ms_routes, rt_next) {
873 db_printf("entry %d:\tdest: %6D nexthop: %6D metric: %u", i,
874 rt->rt_dest, ":", rt->rt_nexthop, ":", rt->rt_metric);
875 db_printf("\tlifetime: %u lastseq: %u priv: %p\n",
876 rt->rt_lifetime, rt->rt_lastmseq, rt->rt_priv);
877 i++;
878 }
879}
880#endif /* IEEE80211_SUPPORT_MESH */
816#endif /* DDB */
881#endif /* DDB */