Commit bc042b67 authored by Arend van Spriel's avatar Arend van Spriel Committed by Greg Kroah-Hartman

staging: brcm80211: remove #ifdef BCMDBG from regular functions

Under error condition debug functions are being called which
only have implementation when BCMDBG is defined. This result
in #ifdef BCMDBG blocks in functions. This patch fixes this by
mapping the debug functions to empty macro when BCMDBG is not
defined. This makes the calling function easier to read.
Reviewed-by: default avatarBrett Rudley <brudley@broadcom.com>
Reviewed-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 77919fd7
...@@ -1069,13 +1069,11 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb, ...@@ -1069,13 +1069,11 @@ wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
WL_ERROR("wl%d: wlc_ampdu_dotxstatus: tx phy error (0x%x)\n", WL_ERROR("wl%d: wlc_ampdu_dotxstatus: tx phy error (0x%x)\n",
wlc->pub->unit, txs->phyerr); wlc->pub->unit, txs->phyerr);
#ifdef BCMDBG
if (WL_ERROR_ON()) { if (WL_ERROR_ON()) {
prpkt("txpkt (AMPDU)", wlc->osh, p); prpkt("txpkt (AMPDU)", wlc->osh, p);
wlc_print_txdesc((d11txh_t *) p->data); wlc_print_txdesc((d11txh_t *) p->data);
wlc_print_txstatus(txs);
} }
#endif /* BCMDBG */ wlc_print_txstatus(txs);
} }
} }
......
...@@ -222,6 +222,8 @@ static bool in_send_q = false; ...@@ -222,6 +222,8 @@ static bool in_send_q = false;
static const char *fifo_names[] = { static const char *fifo_names[] = {
"AC_BK", "AC_BE", "AC_VI", "AC_VO", "BCMC", "ATIM" }; "AC_BK", "AC_BE", "AC_VI", "AC_VO", "BCMC", "ATIM" };
const char *aci_names[] = { "AC_BE", "AC_BK", "AC_VI", "AC_VO" }; const char *aci_names[] = { "AC_BE", "AC_BK", "AC_VI", "AC_VO" };
#else
static const char fifo_names[6][0];
#endif #endif
static const u8 acbitmap2maxprio[] = { static const u8 acbitmap2maxprio[] = {
...@@ -6414,7 +6416,6 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, ...@@ -6414,7 +6416,6 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
(u16) newfragthresh; (u16) newfragthresh;
} }
} }
#if defined(BCMDBG)
} else } else
WL_ERROR("wl%d: %s txop invalid for rate %d\n", WL_ERROR("wl%d: %s txop invalid for rate %d\n",
wlc->pub->unit, fifo_names[queue], wlc->pub->unit, fifo_names[queue],
...@@ -6426,9 +6427,6 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw, ...@@ -6426,9 +6427,6 @@ wlc_d11hdrs_mac80211(struct wlc_info *wlc, struct ieee80211_hw *hw,
fifo_names[queue], fifo_names[queue],
phylen, wlc->fragthresh[queue], phylen, wlc->fragthresh[queue],
dur, wlc->edcf_txop[ac]); dur, wlc->edcf_txop[ac]);
#else
}
#endif
} }
} }
...@@ -6696,11 +6694,11 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2) ...@@ -6696,11 +6694,11 @@ wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2)
mcl = ltoh16(txh->MacTxControlLow); mcl = ltoh16(txh->MacTxControlLow);
if (txs->phyerr) { if (txs->phyerr) {
if (WL_ERROR_ON()) {
WL_ERROR("phyerr 0x%x, rate 0x%x\n", WL_ERROR("phyerr 0x%x, rate 0x%x\n",
txs->phyerr, txh->MainRates); txs->phyerr, txh->MainRates);
#if defined(BCMDBG)
wlc_print_txdesc(txh); wlc_print_txdesc(txh);
#endif }
wlc_print_txstatus(txs); wlc_print_txstatus(txs);
} }
......
...@@ -842,6 +842,8 @@ extern void wlc_print_rxh(d11rxhdr_t *rxh); ...@@ -842,6 +842,8 @@ extern void wlc_print_rxh(d11rxhdr_t *rxh);
extern void wlc_print_hdrs(struct wlc_info *wlc, const char *prefix, u8 *frame, extern void wlc_print_hdrs(struct wlc_info *wlc, const char *prefix, u8 *frame,
d11txh_t *txh, d11rxhdr_t *rxh, uint len); d11txh_t *txh, d11rxhdr_t *rxh, uint len);
extern void wlc_print_txdesc(d11txh_t *txh); extern void wlc_print_txdesc(d11txh_t *txh);
#else
#define wlc_print_txdesc(a)
#endif #endif
#if defined(BCMDBG) #if defined(BCMDBG)
extern void wlc_print_dot11_mac_hdr(u8 *buf, int len); extern void wlc_print_dot11_mac_hdr(u8 *buf, int len);
......
...@@ -152,7 +152,10 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out); ...@@ -152,7 +152,10 @@ extern struct sk_buff *pktq_mdeq(struct pktq *pq, uint prec_bmp, int *prec_out);
#ifdef BCMDBG #ifdef BCMDBG
extern void prpkt(const char *msg, struct osl_info *osh, extern void prpkt(const char *msg, struct osl_info *osh,
struct sk_buff *p0); struct sk_buff *p0);
#else
#define prpkt(a, b, c)
#endif /* BCMDBG */ #endif /* BCMDBG */
#define bcm_perf_enable() #define bcm_perf_enable()
#define bcmstats(fmt) #define bcmstats(fmt)
#define bcmlog(fmt, a1, a2) #define bcmlog(fmt, a1, a2)
......
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