Commit cdf4352f authored by Seth Forshee's avatar Seth Forshee Committed by John W. Linville

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: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarSeth Forshee <seth.forshee@canonical.com>
Tested-by: default avatarDaniel Wagner <wagi@monom.org>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5211fa2c
......@@ -22,6 +22,7 @@
#include "main.h"
#include "ampdu.h"
#include "debug.h"
#include "brcms_trace_events.h"
/* max number of mpdus in an ampdu */
#define AMPDU_MAX_MPDU 32
......@@ -930,12 +931,6 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
brcms_err(wlc->hw->d11core,
"%s: ampdu tx phy error (0x%x)\n",
__func__, txs->phyerr);
if (brcm_msg_level & BRCM_DL_INFO) {
brcmu_prpkt("txpkt (AMPDU)", p);
brcms_c_print_txdesc((struct d11txh *) p->data);
}
brcms_c_print_txstatus(txs);
}
}
......@@ -948,6 +943,8 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
h = (struct ieee80211_hdr *)(plcp + D11_PHY_HDR_LEN);
seq = le16_to_cpu(h->seq_ctrl) >> SEQNUM_SHIFT;
trace_brcms_txdesc(&wlc->hw->d11core->dev, txh, sizeof(*txh));
if (tot_mpdu == 0) {
mcs = plcp[0] & MIMO_PLCP_MCS_MASK;
mimoantsel = le16_to_cpu(txh->ABI_MimoAntSel);
......@@ -1077,6 +1074,8 @@ brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
while (p) {
tx_info = IEEE80211_SKB_CB(p);
txh = (struct d11txh *) p->data;
trace_brcms_txdesc(&wlc->hw->d11core->dev, txh,
sizeof(*txh));
mcl = le16_to_cpu(txh->MacTxControlLow);
brcmu_pkt_buf_free_skb(p);
/* break out if last packet of ampdu */
......
......@@ -18,6 +18,8 @@
#define __TRACE_BRCMSMAC_H
#include <linux/types.h>
#include <linux/device.h>
#include <linux/tracepoint.h>
#include "mac80211_if.h"
......@@ -83,6 +85,57 @@ TRACE_EVENT(brcms_dpc,
)
);
#undef TRACE_SYSTEM
#define TRACE_SYSTEM brcmsmac_tx
TRACE_EVENT(brcms_txdesc,
TP_PROTO(const struct device *dev,
void *txh, size_t txh_len),
TP_ARGS(dev, txh, txh_len),
TP_STRUCT__entry(
__string(dev, dev_name(dev))
__dynamic_array(u8, txh, txh_len)
),
TP_fast_assign(
__assign_str(dev, dev_name(dev));
memcpy(__get_dynamic_array(txh), txh, txh_len);
),
TP_printk("[%s] txdesc", __get_str(dev))
);
TRACE_EVENT(brcms_txstatus,
TP_PROTO(const struct device *dev, u16 framelen, u16 frameid,
u16 status, u16 lasttxtime, u16 sequence, u16 phyerr,
u16 ackphyrxsh),
TP_ARGS(dev, framelen, frameid, status, lasttxtime, sequence, phyerr,
ackphyrxsh),
TP_STRUCT__entry(
__string(dev, dev_name(dev))
__field(u16, framelen)
__field(u16, frameid)
__field(u16, status)
__field(u16, lasttxtime)
__field(u16, sequence)
__field(u16, phyerr)
__field(u16, ackphyrxsh)
),
TP_fast_assign(
__assign_str(dev, dev_name(dev));
__entry->framelen = framelen;
__entry->frameid = frameid;
__entry->status = status;
__entry->lasttxtime = lasttxtime;
__entry->sequence = sequence;
__entry->phyerr = phyerr;
__entry->ackphyrxsh = ackphyrxsh;
),
TP_printk("[%s] FrameId %#04x TxStatus %#04x LastTxTime %#04x "
"Seq %#04x PHYTxStatus %#04x RxAck %#04x",
__get_str(dev), __entry->frameid, __entry->status,
__entry->lasttxtime, __entry->sequence, __entry->phyerr,
__entry->ackphyrxsh)
);
#undef TRACE_SYSTEM
#define TRACE_SYSTEM brcmsmac_msg
......
......@@ -612,18 +612,9 @@ struct brcms_bss_cfg {
extern int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo,
struct sk_buff *p);
extern void brcms_c_print_txstatus(struct tx_status *txs);
extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
uint *blocks);
#if defined(DEBUG)
extern void brcms_c_print_txdesc(struct d11txh *txh);
#else
static inline void brcms_c_print_txdesc(struct d11txh *txh)
{
}
#endif
extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment