diff options
author | Seth Forshee <seth.forshee@canonical.com> | 2012-11-15 09:08:09 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-20 14:07:38 -0500 |
commit | cdf4352f5c59ee5599579ea3bfa4d8972c3f72f1 (patch) | |
tree | 4da0209dd5517e49053f067b40b50c75dd366a21 /drivers/net | |
parent | 5211fa2c483dc85134e46a17a72210dc41a0802d (diff) |
brcmsmac: Improve tx trace and debug support
Add the brcmsmac_tx trace system for tx debugging. Existing code to dump
tx status and descriptors are converted to using tracepoints, allowing
for more efficient collection and post-processing of this data. These
tracepoints are placed to collect data for all tx frames instead of only
on errors. Logging of tx errors is also improved.
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/ampdu.c | 11 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h | 53 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/main.c | 271 | ||||
-rw-r--r-- | drivers/net/wireless/brcm80211/brcmsmac/main.h | 9 |
4 files changed, 94 insertions, 250 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c index 56d2d6bb5eb7..1de94f30564f 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include "main.h" | 22 | #include "main.h" |
23 | #include "ampdu.h" | 23 | #include "ampdu.h" |
24 | #include "debug.h" | 24 | #include "debug.h" |
25 | #include "brcms_trace_events.h" | ||
25 | 26 | ||
26 | /* max number of mpdus in an ampdu */ | 27 | /* max number of mpdus in an ampdu */ |
27 | #define AMPDU_MAX_MPDU 32 | 28 | #define AMPDU_MAX_MPDU 32 |
@@ -930,12 +931,6 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb, | |||
930 | brcms_err(wlc->hw->d11core, | 931 | brcms_err(wlc->hw->d11core, |
931 | "%s: ampdu tx phy error (0x%x)\n", | 932 | "%s: ampdu tx phy error (0x%x)\n", |
932 | __func__, txs->phyerr); | 933 | __func__, txs->phyerr); |
933 | |||
934 | if (brcm_msg_level & BRCM_DL_INFO) { | ||
935 | brcmu_prpkt("txpkt (AMPDU)", p); | ||
936 | brcms_c_print_txdesc((struct d11txh *) p->data); | ||
937 | } | ||
938 | brcms_c_print_txstatus(txs); | ||
939 | } | 934 | } |
940 | } | 935 | } |
941 | 936 | ||
@@ -948,6 +943,8 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb, | |||
948 | h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN); | 943 | h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN); |
949 | seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT; | 944 | seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT; |
950 | 945 | ||
946 | trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, sizeof(*txh)); | ||
947 | |||
951 | if (tot_mpdu == 0) { | 948 | if (tot_mpdu == 0) { |
952 | mcs = plcp[0] & MIMO_PLCP_MCS_MASK; | 949 | mcs = plcp[0] & MIMO_PLCP_MCS_MASK; |
953 | mimoantsel = le16_to_cpu(txh->ABI_MimoAntSel); | 950 | mimoantsel = le16_to_cpu(txh->ABI_MimoAntSel); |
@@ -1077,6 +1074,8 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb, | |||
1077 | while (p) { | 1074 | while (p) { |
1078 | tx_info = IEEE80211_SKB_CB(p); | 1075 | tx_info = IEEE80211_SKB_CB(p); |
1079 | txh = (struct d11txh *) p->data; | 1076 | txh = (struct d11txh *) p->data; |
1077 | trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, | ||
1078 | sizeof(*txh)); | ||
1080 | mcl = le16_to_cpu(txh->MacTxControlLow); | 1079 | mcl = le16_to_cpu(txh->MacTxControlLow); |
1081 | brcmu_pkt_buf_free_skb(p); | 1080 | brcmu_pkt_buf_free_skb(p); |
1082 | /* break out if last packet of ampdu */ | 1081 | /* break out if last packet of ampdu */ |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h index a9aed1f92374..96a962abc89a 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/brcms_trace_events.h | |||
@@ -18,6 +18,8 @@ | |||
18 | 18 | ||
19 | #define __TRACE_BRCMSMAC_H | 19 | #define __TRACE_BRCMSMAC_H |
20 | 20 | ||
21 | #include <linux/types.h> | ||
22 | #include <linux/device.h> | ||
21 | #include <linux/tracepoint.h> | 23 | #include <linux/tracepoint.h> |
22 | #include "mac80211_if.h" | 24 | #include "mac80211_if.h" |
23 | 25 | ||
@@ -84,6 +86,57 @@ TRACE_EVENT(brcms_dpc, | |||
84 | ); | 86 | ); |
85 | 87 | ||
86 | #undef TRACE_SYSTEM | 88 | #undef TRACE_SYSTEM |
89 | #define TRACE_SYSTEM brcmsmac_tx | ||
90 | |||
91 | TRACE_EVENT(brcms_txdesc, | ||
92 | TP_PROTO(const struct device *dev, | ||
93 | void *txh, size_t txh_len), | ||
94 | TP_ARGS(dev, txh, txh_len), | ||
95 | TP_STRUCT__entry( | ||
96 | __string(dev, dev_name(dev)) | ||
97 | __dynamic_array(u8, txh, txh_len) | ||
98 | ), | ||
99 | TP_fast_assign( | ||
100 | __assign_str(dev, dev_name(dev)); | ||
101 | memcpy(__get_dynamic_array(txh), txh, txh_len); | ||
102 | ), | ||
103 | TP_printk("[%s] txdesc", __get_str(dev)) | ||
104 | ); | ||
105 | |||
106 | TRACE_EVENT(brcms_txstatus, | ||
107 | TP_PROTO(const struct device *dev, u16 framelen, u16 frameid, | ||
108 | u16 status, u16 lasttxtime, u16 sequence, u16 phyerr, | ||
109 | u16 ackphyrxsh), | ||
110 | TP_ARGS(dev, framelen, frameid, status, lasttxtime, sequence, phyerr, | ||
111 | ackphyrxsh), | ||
112 | TP_STRUCT__entry( | ||
113 | __string(dev, dev_name(dev)) | ||
114 | __field(u16, framelen) | ||
115 | __field(u16, frameid) | ||
116 | __field(u16, status) | ||
117 | __field(u16, lasttxtime) | ||
118 | __field(u16, sequence) | ||
119 | __field(u16, phyerr) | ||
120 | __field(u16, ackphyrxsh) | ||
121 | ), | ||
122 | TP_fast_assign( | ||
123 | __assign_str(dev, dev_name(dev)); | ||
124 | __entry->framelen = framelen; | ||
125 | __entry->frameid = frameid; | ||
126 | __entry->status = status; | ||
127 | __entry->lasttxtime = lasttxtime; | ||
128 | __entry->sequence = sequence; | ||
129 | __entry->phyerr = phyerr; | ||
130 | __entry->ackphyrxsh = ackphyrxsh; | ||
131 | ), | ||
132 | TP_printk("[%s] FrameId %#04x TxStatus %#04x LastTxTime %#04x " | ||
133 | "Seq %#04x PHYTxStatus %#04x RxAck %#04x", | ||
134 | __get_str(dev), __entry->frameid, __entry->status, | ||
135 | __entry->lasttxtime, __entry->sequence, __entry->phyerr, | ||
136 | __entry->ackphyrxsh) | ||
137 | ); | ||
138 | |||
139 | #undef TRACE_SYSTEM | ||
87 | #define TRACE_SYSTEM brcmsmac_msg | 140 | #define TRACE_SYSTEM brcmsmac_msg |
88 | 141 | ||
89 | #define MAX_MSG_LEN 100 | 142 | #define MAX_MSG_LEN 100 |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c index 84440a8751fd..9480debef755 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.c +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "soc.h" | 36 | #include "soc.h" |
37 | #include "dma.h" | 37 | #include "dma.h" |
38 | #include "debug.h" | 38 | #include "debug.h" |
39 | #include "brcms_trace_events.h" | ||
39 | 40 | ||
40 | /* watchdog timer, in unit of ms */ | 41 | /* watchdog timer, in unit of ms */ |
41 | #define TIMER_INTERVAL_WATCHDOG 1000 | 42 | #define TIMER_INTERVAL_WATCHDOG 1000 |
@@ -862,7 +863,7 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | |||
862 | struct sk_buff *p = NULL; | 863 | struct sk_buff *p = NULL; |
863 | uint queue = NFIFO; | 864 | uint queue = NFIFO; |
864 | struct dma_pub *dma = NULL; | 865 | struct dma_pub *dma = NULL; |
865 | struct d11txh *txh; | 866 | struct d11txh *txh = NULL; |
866 | struct scb *scb = NULL; | 867 | struct scb *scb = NULL; |
867 | bool free_pdu; | 868 | bool free_pdu; |
868 | int tx_rts, tx_frame_count, tx_rts_count; | 869 | int tx_rts, tx_frame_count, tx_rts_count; |
@@ -875,6 +876,10 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | |||
875 | int i; | 876 | int i; |
876 | bool fatal = true; | 877 | bool fatal = true; |
877 | 878 | ||
879 | trace_brcms_txstatus(&wlc->hw->d11core->dev, txs->framelen, | ||
880 | txs->frameid, txs->status, txs->lasttxtime, | ||
881 | txs->sequence, txs->phyerr, txs->ackphyrxsh); | ||
882 | |||
878 | /* discard intermediate indications for ucode with one legitimate case: | 883 | /* discard intermediate indications for ucode with one legitimate case: |
879 | * e.g. if "useRTS" is set. ucode did a successful rts/cts exchange, | 884 | * e.g. if "useRTS" is set. ucode did a successful rts/cts exchange, |
880 | * but the subsequent tx of DATA failed. so it will start rts/cts | 885 | * but the subsequent tx of DATA failed. so it will start rts/cts |
@@ -888,29 +893,30 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | |||
888 | } | 893 | } |
889 | 894 | ||
890 | queue = txs->frameid & TXFID_QUEUE_MASK; | 895 | queue = txs->frameid & TXFID_QUEUE_MASK; |
891 | if (queue >= NFIFO) | 896 | if (queue >= NFIFO) { |
897 | brcms_err(wlc->hw->d11core, "queue %u >= NFIFO\n", queue); | ||
892 | goto out; | 898 | goto out; |
899 | } | ||
893 | 900 | ||
894 | dma = wlc->hw->di[queue]; | 901 | dma = wlc->hw->di[queue]; |
895 | 902 | ||
896 | p = dma_getnexttxp(wlc->hw->di[queue], DMA_RANGE_TRANSMITTED); | 903 | p = dma_getnexttxp(wlc->hw->di[queue], DMA_RANGE_TRANSMITTED); |
897 | if (p == NULL) | 904 | if (p == NULL) { |
905 | brcms_err(wlc->hw->d11core, "dma_getnexttxp returned null!\n"); | ||
898 | goto out; | 906 | goto out; |
907 | } | ||
899 | 908 | ||
900 | txh = (struct d11txh *) (p->data); | 909 | txh = (struct d11txh *) (p->data); |
901 | mcl = le16_to_cpu(txh->MacTxControlLow); | 910 | mcl = le16_to_cpu(txh->MacTxControlLow); |
902 | 911 | ||
903 | if (txs->phyerr) { | 912 | if (txs->phyerr) |
904 | if (brcm_msg_level & BRCM_DL_INFO) { | 913 | brcms_err(wlc->hw->d11core, "phyerr 0x%x, rate 0x%x\n", |
905 | brcms_err(wlc->hw->d11core, "phyerr 0x%x, rate 0x%x\n", | 914 | txs->phyerr, txh->MainRates); |
906 | txs->phyerr, txh->MainRates); | ||
907 | brcms_c_print_txdesc(txh); | ||
908 | } | ||
909 | brcms_c_print_txstatus(txs); | ||
910 | } | ||
911 | 915 | ||
912 | if (txs->frameid != le16_to_cpu(txh->TxFrameID)) | 916 | if (txs->frameid != le16_to_cpu(txh->TxFrameID)) { |
917 | brcms_err(wlc->hw->d11core, "frameid != txh->TxFrameID\n"); | ||
913 | goto out; | 918 | goto out; |
919 | } | ||
914 | tx_info = IEEE80211_SKB_CB(p); | 920 | tx_info = IEEE80211_SKB_CB(p); |
915 | h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN); | 921 | h = (struct ieee80211_hdr *)((u8 *) (txh + 1) + D11_PHY_HDR_LEN); |
916 | 922 | ||
@@ -923,11 +929,20 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | |||
923 | goto out; | 929 | goto out; |
924 | } | 930 | } |
925 | 931 | ||
932 | /* | ||
933 | * brcms_c_ampdu_dotxstatus() will trace tx descriptors for AMPDU | ||
934 | * frames; this traces them for the rest. | ||
935 | */ | ||
936 | trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, sizeof(*txh)); | ||
937 | |||
926 | supr_status = txs->status & TX_STATUS_SUPR_MASK; | 938 | supr_status = txs->status & TX_STATUS_SUPR_MASK; |
927 | if (supr_status == TX_STATUS_SUPR_BADCH) | 939 | if (supr_status == TX_STATUS_SUPR_BADCH) { |
940 | unsigned xfts = le16_to_cpu(txh->XtraFrameTypes); | ||
928 | brcms_dbg_tx(wlc->hw->d11core, | 941 | brcms_dbg_tx(wlc->hw->d11core, |
929 | "Pkt tx suppressed, possibly channel %d\n", | 942 | "Pkt tx suppressed, dest chan %u, current %d\n", |
943 | (xfts >> XFTS_CHANNEL_SHIFT) & 0xff, | ||
930 | CHSPEC_CHANNEL(wlc->default_bss->chanspec)); | 944 | CHSPEC_CHANNEL(wlc->default_bss->chanspec)); |
945 | } | ||
931 | 946 | ||
932 | tx_rts = le16_to_cpu(txh->MacTxControlLow) & TXC_SENDRTS; | 947 | tx_rts = le16_to_cpu(txh->MacTxControlLow) & TXC_SENDRTS; |
933 | tx_frame_count = | 948 | tx_frame_count = |
@@ -1018,8 +1033,13 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, struct tx_status *txs) | |||
1018 | fatal = false; | 1033 | fatal = false; |
1019 | 1034 | ||
1020 | out: | 1035 | out: |
1021 | if (fatal && p) | 1036 | if (fatal) { |
1022 | brcmu_pkt_buf_free_skb(p); | 1037 | if (txh) |
1038 | trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, | ||
1039 | sizeof(*txh)); | ||
1040 | if (p) | ||
1041 | brcmu_pkt_buf_free_skb(p); | ||
1042 | } | ||
1023 | 1043 | ||
1024 | if (dma && queue < NFIFO) { | 1044 | if (dma && queue < NFIFO) { |
1025 | u16 ac_queue = brcms_fifo_to_ac(queue); | 1045 | u16 ac_queue = brcms_fifo_to_ac(queue); |
@@ -1049,8 +1069,6 @@ brcms_b_txstatus(struct brcms_hardware *wlc_hw, bool bound, bool *fatal) | |||
1049 | */ | 1069 | */ |
1050 | uint max_tx_num = bound ? TXSBND : -1; | 1070 | uint max_tx_num = bound ? TXSBND : -1; |
1051 | 1071 | ||
1052 | brcms_dbg_tx(core, "wl%d\n", wlc_hw->unit); | ||
1053 | |||
1054 | txs = &txstatus; | 1072 | txs = &txstatus; |
1055 | core = wlc_hw->d11core; | 1073 | core = wlc_hw->d11core; |
1056 | *fatal = false; | 1074 | *fatal = false; |
@@ -5662,45 +5680,6 @@ int brcms_c_module_unregister(struct brcms_pub *pub, const char *name, | |||
5662 | return -ENODATA; | 5680 | return -ENODATA; |
5663 | } | 5681 | } |
5664 | 5682 | ||
5665 | void brcms_c_print_txstatus(struct tx_status *txs) | ||
5666 | { | ||
5667 | pr_debug("\ntxpkt (MPDU) Complete\n"); | ||
5668 | |||
5669 | pr_debug("FrameID: %04x TxStatus: %04x\n", txs->frameid, txs->status); | ||
5670 | |||
5671 | pr_debug("[15:12] %d frame attempts\n", | ||
5672 | (txs->status & TX_STATUS_FRM_RTX_MASK) >> | ||
5673 | TX_STATUS_FRM_RTX_SHIFT); | ||
5674 | pr_debug(" [11:8] %d rts attempts\n", | ||
5675 | (txs->status & TX_STATUS_RTS_RTX_MASK) >> | ||
5676 | TX_STATUS_RTS_RTX_SHIFT); | ||
5677 | pr_debug(" [7] %d PM mode indicated\n", | ||
5678 | txs->status & TX_STATUS_PMINDCTD ? 1 : 0); | ||
5679 | pr_debug(" [6] %d intermediate status\n", | ||
5680 | txs->status & TX_STATUS_INTERMEDIATE ? 1 : 0); | ||
5681 | pr_debug(" [5] %d AMPDU\n", | ||
5682 | txs->status & TX_STATUS_AMPDU ? 1 : 0); | ||
5683 | pr_debug(" [4:2] %d Frame Suppressed Reason (%s)\n", | ||
5684 | (txs->status & TX_STATUS_SUPR_MASK) >> TX_STATUS_SUPR_SHIFT, | ||
5685 | (const char *[]) { | ||
5686 | "None", | ||
5687 | "PMQ Entry", | ||
5688 | "Flush request", | ||
5689 | "Previous frag failure", | ||
5690 | "Channel mismatch", | ||
5691 | "Lifetime Expiry", | ||
5692 | "Underflow" | ||
5693 | } [(txs->status & TX_STATUS_SUPR_MASK) >> | ||
5694 | TX_STATUS_SUPR_SHIFT]); | ||
5695 | pr_debug(" [1] %d acked\n", | ||
5696 | txs->status & TX_STATUS_ACK_RCV ? 1 : 0); | ||
5697 | |||
5698 | pr_debug("LastTxTime: %04x Seq: %04x PHYTxStatus: %04x RxAckRSSI: %04x RxAckSQ: %04x\n", | ||
5699 | txs->lasttxtime, txs->sequence, txs->phyerr, | ||
5700 | (txs->ackphyrxsh & PRXS1_JSSI_MASK) >> PRXS1_JSSI_SHIFT, | ||
5701 | (txs->ackphyrxsh & PRXS1_SQ_MASK) >> PRXS1_SQ_SHIFT); | ||
5702 | } | ||
5703 | |||
5704 | static bool brcms_c_chipmatch_pci(struct bcma_device *core) | 5683 | static bool brcms_c_chipmatch_pci(struct bcma_device *core) |
5705 | { | 5684 | { |
5706 | struct pci_dev *pcidev = core->bus->host_pci; | 5685 | struct pci_dev *pcidev = core->bus->host_pci; |
@@ -5749,184 +5728,6 @@ bool brcms_c_chipmatch(struct bcma_device *core) | |||
5749 | } | 5728 | } |
5750 | } | 5729 | } |
5751 | 5730 | ||
5752 | #if defined(DEBUG) | ||
5753 | void brcms_c_print_txdesc(struct d11txh *txh) | ||
5754 | { | ||
5755 | u16 mtcl = le16_to_cpu(txh->MacTxControlLow); | ||
5756 | u16 mtch = le16_to_cpu(txh->MacTxControlHigh); | ||
5757 | u16 mfc = le16_to_cpu(txh->MacFrameControl); | ||
5758 | u16 tfest = le16_to_cpu(txh->TxFesTimeNormal); | ||
5759 | u16 ptcw = le16_to_cpu(txh->PhyTxControlWord); | ||
5760 | u16 ptcw_1 = le16_to_cpu(txh->PhyTxControlWord_1); | ||
5761 | u16 ptcw_1_Fbr = le16_to_cpu(txh->PhyTxControlWord_1_Fbr); | ||
5762 | u16 ptcw_1_Rts = le16_to_cpu(txh->PhyTxControlWord_1_Rts); | ||
5763 | u16 ptcw_1_FbrRts = le16_to_cpu(txh->PhyTxControlWord_1_FbrRts); | ||
5764 | u16 mainrates = le16_to_cpu(txh->MainRates); | ||
5765 | u16 xtraft = le16_to_cpu(txh->XtraFrameTypes); | ||
5766 | u8 *iv = txh->IV; | ||
5767 | u8 *ra = txh->TxFrameRA; | ||
5768 | u16 tfestfb = le16_to_cpu(txh->TxFesTimeFallback); | ||
5769 | u8 *rtspfb = txh->RTSPLCPFallback; | ||
5770 | u16 rtsdfb = le16_to_cpu(txh->RTSDurFallback); | ||
5771 | u8 *fragpfb = txh->FragPLCPFallback; | ||
5772 | u16 fragdfb = le16_to_cpu(txh->FragDurFallback); | ||
5773 | u16 mmodelen = le16_to_cpu(txh->MModeLen); | ||
5774 | u16 mmodefbrlen = le16_to_cpu(txh->MModeFbrLen); | ||
5775 | u16 tfid = le16_to_cpu(txh->TxFrameID); | ||
5776 | u16 txs = le16_to_cpu(txh->TxStatus); | ||
5777 | u16 mnmpdu = le16_to_cpu(txh->MaxNMpdus); | ||
5778 | u16 mabyte = le16_to_cpu(txh->MaxABytes_MRT); | ||
5779 | u16 mabyte_f = le16_to_cpu(txh->MaxABytes_FBR); | ||
5780 | u16 mmbyte = le16_to_cpu(txh->MinMBytes); | ||
5781 | |||
5782 | u8 *rtsph = txh->RTSPhyHeader; | ||
5783 | struct ieee80211_rts rts = txh->rts_frame; | ||
5784 | |||
5785 | /* add plcp header along with txh descriptor */ | ||
5786 | brcmu_dbg_hex_dump(txh, sizeof(struct d11txh) + 48, | ||
5787 | "Raw TxDesc + plcp header:\n"); | ||
5788 | |||
5789 | pr_debug("TxCtlLow: %04x ", mtcl); | ||
5790 | pr_debug("TxCtlHigh: %04x ", mtch); | ||
5791 | pr_debug("FC: %04x ", mfc); | ||
5792 | pr_debug("FES Time: %04x\n", tfest); | ||
5793 | pr_debug("PhyCtl: %04x%s ", ptcw, | ||
5794 | (ptcw & PHY_TXC_SHORT_HDR) ? " short" : ""); | ||
5795 | pr_debug("PhyCtl_1: %04x ", ptcw_1); | ||
5796 | pr_debug("PhyCtl_1_Fbr: %04x\n", ptcw_1_Fbr); | ||
5797 | pr_debug("PhyCtl_1_Rts: %04x ", ptcw_1_Rts); | ||
5798 | pr_debug("PhyCtl_1_Fbr_Rts: %04x\n", ptcw_1_FbrRts); | ||
5799 | pr_debug("MainRates: %04x ", mainrates); | ||
5800 | pr_debug("XtraFrameTypes: %04x ", xtraft); | ||
5801 | pr_debug("\n"); | ||
5802 | |||
5803 | print_hex_dump_bytes("SecIV:", DUMP_PREFIX_OFFSET, iv, sizeof(txh->IV)); | ||
5804 | print_hex_dump_bytes("RA:", DUMP_PREFIX_OFFSET, | ||
5805 | ra, sizeof(txh->TxFrameRA)); | ||
5806 | |||
5807 | pr_debug("Fb FES Time: %04x ", tfestfb); | ||
5808 | print_hex_dump_bytes("Fb RTS PLCP:", DUMP_PREFIX_OFFSET, | ||
5809 | rtspfb, sizeof(txh->RTSPLCPFallback)); | ||
5810 | pr_debug("RTS DUR: %04x ", rtsdfb); | ||
5811 | print_hex_dump_bytes("PLCP:", DUMP_PREFIX_OFFSET, | ||
5812 | fragpfb, sizeof(txh->FragPLCPFallback)); | ||
5813 | pr_debug("DUR: %04x", fragdfb); | ||
5814 | pr_debug("\n"); | ||
5815 | |||
5816 | pr_debug("MModeLen: %04x ", mmodelen); | ||
5817 | pr_debug("MModeFbrLen: %04x\n", mmodefbrlen); | ||
5818 | |||
5819 | pr_debug("FrameID: %04x\n", tfid); | ||
5820 | pr_debug("TxStatus: %04x\n", txs); | ||
5821 | |||
5822 | pr_debug("MaxNumMpdu: %04x\n", mnmpdu); | ||
5823 | pr_debug("MaxAggbyte: %04x\n", mabyte); | ||
5824 | pr_debug("MaxAggbyte_fb: %04x\n", mabyte_f); | ||
5825 | pr_debug("MinByte: %04x\n", mmbyte); | ||
5826 | |||
5827 | print_hex_dump_bytes("RTS PLCP:", DUMP_PREFIX_OFFSET, | ||
5828 | rtsph, sizeof(txh->RTSPhyHeader)); | ||
5829 | print_hex_dump_bytes("RTS Frame:", DUMP_PREFIX_OFFSET, | ||
5830 | (u8 *)&rts, sizeof(txh->rts_frame)); | ||
5831 | pr_debug("\n"); | ||
5832 | } | ||
5833 | #endif /* defined(DEBUG) */ | ||
5834 | |||
5835 | #if defined(DEBUG) | ||
5836 | static int | ||
5837 | brcms_c_format_flags(const struct brcms_c_bit_desc *bd, u32 flags, char *buf, | ||
5838 | int len) | ||
5839 | { | ||
5840 | int i; | ||
5841 | char *p = buf; | ||
5842 | char hexstr[16]; | ||
5843 | int slen = 0, nlen = 0; | ||
5844 | u32 bit; | ||
5845 | const char *name; | ||
5846 | |||
5847 | if (len < 2 || !buf) | ||
5848 | return 0; | ||
5849 | |||
5850 | buf[0] = '\0'; | ||
5851 | |||
5852 | for (i = 0; flags != 0; i++) { | ||
5853 | bit = bd[i].bit; | ||
5854 | name = bd[i].name; | ||
5855 | if (bit == 0 && flags != 0) { | ||
5856 | /* print any unnamed bits */ | ||
5857 | snprintf(hexstr, 16, "0x%X", flags); | ||
5858 | name = hexstr; | ||
5859 | flags = 0; /* exit loop */ | ||
5860 | } else if ((flags & bit) == 0) | ||
5861 | continue; | ||
5862 | flags &= ~bit; | ||
5863 | nlen = strlen(name); | ||
5864 | slen += nlen; | ||
5865 | /* count btwn flag space */ | ||
5866 | if (flags != 0) | ||
5867 | slen += 1; | ||
5868 | /* need NULL char as well */ | ||
5869 | if (len <= slen) | ||
5870 | break; | ||
5871 | /* copy NULL char but don't count it */ | ||
5872 | strncpy(p, name, nlen + 1); | ||
5873 | p += nlen; | ||
5874 | /* copy btwn flag space and NULL char */ | ||
5875 | if (flags != 0) | ||
5876 | p += snprintf(p, 2, " "); | ||
5877 | len -= slen; | ||
5878 | } | ||
5879 | |||
5880 | /* indicate the str was too short */ | ||
5881 | if (flags != 0) { | ||
5882 | if (len < 2) | ||
5883 | p -= 2 - len; /* overwrite last char */ | ||
5884 | p += snprintf(p, 2, ">"); | ||
5885 | } | ||
5886 | |||
5887 | return (int)(p - buf); | ||
5888 | } | ||
5889 | #endif /* defined(DEBUG) */ | ||
5890 | |||
5891 | #if defined(DEBUG) | ||
5892 | void brcms_c_print_rxh(struct d11rxhdr *rxh) | ||
5893 | { | ||
5894 | u16 len = rxh->RxFrameSize; | ||
5895 | u16 phystatus_0 = rxh->PhyRxStatus_0; | ||
5896 | u16 phystatus_1 = rxh->PhyRxStatus_1; | ||
5897 | u16 phystatus_2 = rxh->PhyRxStatus_2; | ||
5898 | u16 phystatus_3 = rxh->PhyRxStatus_3; | ||
5899 | u16 macstatus1 = rxh->RxStatus1; | ||
5900 | u16 macstatus2 = rxh->RxStatus2; | ||
5901 | char flagstr[64]; | ||
5902 | char lenbuf[20]; | ||
5903 | static const struct brcms_c_bit_desc macstat_flags[] = { | ||
5904 | {RXS_FCSERR, "FCSErr"}, | ||
5905 | {RXS_RESPFRAMETX, "Reply"}, | ||
5906 | {RXS_PBPRES, "PADDING"}, | ||
5907 | {RXS_DECATMPT, "DeCr"}, | ||
5908 | {RXS_DECERR, "DeCrErr"}, | ||
5909 | {RXS_BCNSENT, "Bcn"}, | ||
5910 | {0, NULL} | ||
5911 | }; | ||
5912 | |||
5913 | brcmu_dbg_hex_dump(rxh, sizeof(struct d11rxhdr), "Raw RxDesc:\n"); | ||
5914 | |||
5915 | brcms_c_format_flags(macstat_flags, macstatus1, flagstr, 64); | ||
5916 | |||
5917 | snprintf(lenbuf, sizeof(lenbuf), "0x%x", len); | ||
5918 | |||
5919 | pr_debug("RxFrameSize: %6s (%d)%s\n", lenbuf, len, | ||
5920 | (rxh->PhyRxStatus_0 & PRXS0_SHORTH) ? " short preamble" : ""); | ||
5921 | pr_debug("RxPHYStatus: %04x %04x %04x %04x\n", | ||
5922 | phystatus_0, phystatus_1, phystatus_2, phystatus_3); | ||
5923 | pr_debug("RxMACStatus: %x %s\n", macstatus1, flagstr); | ||
5924 | pr_debug("RXMACaggtype: %x\n", | ||
5925 | (macstatus2 & RXS_AGGTYPE_MASK)); | ||
5926 | pr_debug("RxTSFTime: %04x\n", rxh->RxTSFTime); | ||
5927 | } | ||
5928 | #endif /* defined(DEBUG) */ | ||
5929 | |||
5930 | u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate) | 5731 | u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate) |
5931 | { | 5732 | { |
5932 | u16 table_ptr; | 5733 | u16 table_ptr; |
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h b/drivers/net/wireless/brcm80211/brcmsmac/main.h index 8a58cc12d19d..fb447747c2c6 100644 --- a/drivers/net/wireless/brcm80211/brcmsmac/main.h +++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h | |||
@@ -612,18 +612,9 @@ struct brcms_bss_cfg { | |||
612 | 612 | ||
613 | extern int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, | 613 | extern int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, |
614 | struct sk_buff *p); | 614 | struct sk_buff *p); |
615 | extern void brcms_c_print_txstatus(struct tx_status *txs); | ||
616 | extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo, | 615 | extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo, |
617 | uint *blocks); | 616 | uint *blocks); |
618 | 617 | ||
619 | #if defined(DEBUG) | ||
620 | extern void brcms_c_print_txdesc(struct d11txh *txh); | ||
621 | #else | ||
622 | static inline void brcms_c_print_txdesc(struct d11txh *txh) | ||
623 | { | ||
624 | } | ||
625 | #endif | ||
626 | |||
627 | extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config); | 618 | extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config); |
628 | extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags); | 619 | extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags); |
629 | extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, | 620 | extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, |