Commit 9146782b authored by Arend van Spriel's avatar Arend van Spriel Committed by John W. Linville

brcmsmac: fix statistic counter update function

The 802.11 core statistics are retrieved from the core registers
but not stored. So the debug code was never triggered to give a
warning message on tx underruns or rx overflows. This patch fixes
this and assures the statistics are stored in the snapshot.
Reviewed-by: default avatarHante Meuleman <meuleman@broadcom.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 7a1283d8
...@@ -3081,7 +3081,7 @@ static bool brcms_c_ps_allowed(struct brcms_c_info *wlc) ...@@ -3081,7 +3081,7 @@ static bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
static void brcms_c_statsupd(struct brcms_c_info *wlc) static void brcms_c_statsupd(struct brcms_c_info *wlc)
{ {
int i; int i;
struct macstat macstats; struct macstat *macstats;
#ifdef DEBUG #ifdef DEBUG
u16 delta; u16 delta;
u16 rxf0ovfl; u16 rxf0ovfl;
...@@ -3092,31 +3092,31 @@ static void brcms_c_statsupd(struct brcms_c_info *wlc) ...@@ -3092,31 +3092,31 @@ static void brcms_c_statsupd(struct brcms_c_info *wlc)
if (!wlc->pub->up) if (!wlc->pub->up)
return; return;
macstats = wlc->core->macstat_snapshot;
#ifdef DEBUG #ifdef DEBUG
/* save last rx fifo 0 overflow count */ /* save last rx fifo 0 overflow count */
rxf0ovfl = wlc->core->macstat_snapshot->rxf0ovfl; rxf0ovfl = macstats->rxf0ovfl;
/* save last tx fifo underflow count */ /* save last tx fifo underflow count */
for (i = 0; i < NFIFO; i++) for (i = 0; i < NFIFO; i++)
txfunfl[i] = wlc->core->macstat_snapshot->txfunfl[i]; txfunfl[i] = macstats->txfunfl[i];
#endif /* DEBUG */ #endif /* DEBUG */
/* Read mac stats from contiguous shared memory */ /* Read mac stats from contiguous shared memory */
brcms_b_copyfrom_objmem(wlc->hw, M_UCODE_MACSTAT, &macstats, brcms_b_copyfrom_objmem(wlc->hw, M_UCODE_MACSTAT, macstats,
sizeof(struct macstat), OBJADDR_SHM_SEL); sizeof(*macstats), OBJADDR_SHM_SEL);
#ifdef DEBUG #ifdef DEBUG
/* check for rx fifo 0 overflow */ /* check for rx fifo 0 overflow */
delta = (u16) (wlc->core->macstat_snapshot->rxf0ovfl - rxf0ovfl); delta = (u16)(macstats->rxf0ovfl - rxf0ovfl);
if (delta) if (delta)
brcms_err(wlc->hw->d11core, "wl%d: %u rx fifo 0 overflows!\n", brcms_err(wlc->hw->d11core, "wl%d: %u rx fifo 0 overflows!\n",
wlc->pub->unit, delta); wlc->pub->unit, delta);
/* check for tx fifo underflows */ /* check for tx fifo underflows */
for (i = 0; i < NFIFO; i++) { for (i = 0; i < NFIFO; i++) {
delta = delta = macstats->txfunfl[i] - txfunfl[i];
(u16) (wlc->core->macstat_snapshot->txfunfl[i] -
txfunfl[i]);
if (delta) if (delta)
brcms_err(wlc->hw->d11core, brcms_err(wlc->hw->d11core,
"wl%d: %u tx fifo %d underflows!\n", "wl%d: %u tx fifo %d underflows!\n",
......
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