Skip to content

Commit

Permalink
wlcore: debugfs: add some counters for sync/async rx/tx loops
Browse files Browse the repository at this point in the history
Signed-off-by: Arik Nemtsov <arik@wizery.com>
  • Loading branch information
ariknem committed Mar 6, 2013
1 parent 3825e0b commit 2bd6a26
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions drivers/net/wireless/ti/wlcore/debugfs.c
Expand Up @@ -742,6 +742,12 @@ static ssize_t driver_state_read(struct file *file, char __user *user_buf,
DRIVER_STATE_PRINT_STR(chip.fw_ver_str);
DRIVER_STATE_PRINT_STR(chip.phy_fw_ver_str);
DRIVER_STATE_PRINT_INT(recovery_count);
DRIVER_STATE_PRINT_INT(sync_memcpy);
DRIVER_STATE_PRINT_INT(total_memcpy);
DRIVER_STATE_PRINT_INT(wait_memcpy);
DRIVER_STATE_PRINT_INT(nowait_memcpy);
DRIVER_STATE_PRINT_INT(total_rx);
DRIVER_STATE_PRINT_INT(total_norx);

#undef DRIVER_STATE_PRINT_INT
#undef DRIVER_STATE_PRINT_LONG
Expand Down
5 changes: 5 additions & 0 deletions drivers/net/wireless/ti/wlcore/rx.c
Expand Up @@ -222,6 +222,11 @@ int wlcore_rx(struct wl1271 *wl, struct wl_fw_status_1 *status)
int ret = 0;
int orig_cnt = wl->rx_counter, diff;

if (drv_rx_counter != fw_rx_counter)
wl->total_rx++;
else
wl->total_norx++;

while (drv_rx_counter != fw_rx_counter) {
buf_size = 0;
rx_counter = drv_rx_counter;
Expand Down
8 changes: 7 additions & 1 deletion drivers/net/wireless/ti/wlcore/tx.c
Expand Up @@ -861,7 +861,11 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
while (1) {
if (test_and_clear_bit(WL1271_FLAG_ASYNC_TX_MEMCPY,
&wl->flags)) {
flush_work(&wl->memcpy_work);
if (flush_work(&wl->memcpy_work))
wl->wait_memcpy++;
else
wl->nowait_memcpy++;

ret = wl->tx_memcpy.ret;
buf_offset = wl->tx_memcpy.num_bytes;
last_len = wl->tx_memcpy.last_len;
Expand All @@ -870,7 +874,9 @@ int wlcore_tx_work_locked(struct wl1271 *wl)
} else {
ret = wlcore_tx_dequeue_and_copy(wl, &buf_offset,
&last_len, active_hlids);
wl->sync_memcpy++;
}
wl->total_memcpy++;
if (ret != -EAGAIN) {
goto out_ack;
} else {
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/wireless/ti/wlcore/wlcore.h
Expand Up @@ -483,6 +483,13 @@ struct wl1271 {

u32 irq_count;
u32 irq_loop_count;

u32 sync_memcpy;
u32 wait_memcpy;
u32 nowait_memcpy;
u32 total_memcpy;
u32 total_rx;
u32 total_norx;
};

int __devinit wlcore_probe(struct wl1271 *wl, struct platform_device *pdev);
Expand Down

0 comments on commit 2bd6a26

Please sign in to comment.