Commit 8b7ef8b6 authored by Xinming Hu's avatar Xinming Hu Committed by Kalle Valo

mwifiex: add sdio multiport aggregation debug information

This patch sdio multi port aggregation statistics which can be
used for debugging. This debug data is collected in
/sys/kernel/debug/mwifiex/mlan0/debug.
Signed-off-by: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarAmitkumar Karwar <akarwar@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent a6139b62
......@@ -184,6 +184,7 @@ struct mwifiex_ds_tx_ba_stream_tbl {
};
#define DBG_CMD_NUM 5
#define MWIFIEX_DBG_SDIO_MP_NUM 10
struct tdls_peer_info {
u8 peer_addr[ETH_ALEN];
......@@ -235,6 +236,11 @@ struct mwifiex_debug_info {
u8 cmd_sent;
u8 cmd_resp_received;
u8 event_received;
u32 last_mp_wr_bitmap[MWIFIEX_DBG_SDIO_MP_NUM];
u32 last_mp_wr_ports[MWIFIEX_DBG_SDIO_MP_NUM];
u32 last_mp_wr_len[MWIFIEX_DBG_SDIO_MP_NUM];
u32 last_mp_curr_wr_port[MWIFIEX_DBG_SDIO_MP_NUM];
u8 last_sdio_mp_index;
};
#define MWIFIEX_KEY_INDEX_UNICAST 0x40000000
......
......@@ -223,6 +223,11 @@ struct mwifiex_dbg {
u16 last_cmd_resp_index;
u16 last_event[DBG_CMD_NUM];
u16 last_event_index;
u32 last_mp_wr_bitmap[MWIFIEX_DBG_SDIO_MP_NUM];
u32 last_mp_wr_ports[MWIFIEX_DBG_SDIO_MP_NUM];
u32 last_mp_wr_len[MWIFIEX_DBG_SDIO_MP_NUM];
u32 last_mp_curr_wr_port[MWIFIEX_DBG_SDIO_MP_NUM];
u8 last_sdio_mp_index;
};
enum MWIFIEX_HARDWARE_STATUS {
......
......@@ -1684,6 +1684,7 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
s32 f_precopy_cur_buf = 0;
s32 f_postcopy_cur_buf = 0;
u32 mport;
int index;
if (!card->mpa_tx.enabled ||
(card->has_control_mask && (port == CTRL_PORT)) ||
......@@ -1788,6 +1789,15 @@ static int mwifiex_host_to_card_mp_aggr(struct mwifiex_adapter *adapter,
ret = mwifiex_write_data_to_card(adapter, card->mpa_tx.buf,
card->mpa_tx.buf_len, mport);
/* Save the last multi port tx aggreagation info to debug log */
index = adapter->dbg.last_sdio_mp_index;
index = (index + 1) % MWIFIEX_DBG_SDIO_MP_NUM;
adapter->dbg.last_sdio_mp_index = index;
adapter->dbg.last_mp_wr_ports[index] = mport;
adapter->dbg.last_mp_wr_bitmap[index] = card->mp_wr_bitmap;
adapter->dbg.last_mp_wr_len[index] = card->mpa_tx.buf_len;
adapter->dbg.last_mp_curr_wr_port[index] = card->curr_wr_port;
MP_TX_AGGR_BUF_RESET(card);
}
......
......@@ -78,6 +78,16 @@ static struct mwifiex_debug_data items[] = {
item_addr(last_event), DBG_CMD_NUM},
{"last_event_index", item_size(last_event_index),
item_addr(last_event_index), 1},
{"last_mp_wr_bitmap", item_size(last_mp_wr_bitmap),
item_addr(last_mp_wr_bitmap), MWIFIEX_DBG_SDIO_MP_NUM},
{"last_mp_wr_ports", item_size(last_mp_wr_ports),
item_addr(last_mp_wr_ports), MWIFIEX_DBG_SDIO_MP_NUM},
{"last_mp_wr_len", item_size(last_mp_wr_len),
item_addr(last_mp_wr_len), MWIFIEX_DBG_SDIO_MP_NUM},
{"last_mp_curr_wr_port", item_size(last_mp_curr_wr_port),
item_addr(last_mp_curr_wr_port), MWIFIEX_DBG_SDIO_MP_NUM},
{"last_sdio_mp_index", item_size(last_sdio_mp_index),
item_addr(last_sdio_mp_index), 1},
{"num_cmd_h2c_fail", item_size(num_cmd_host_to_card_failure),
item_addr(num_cmd_host_to_card_failure), 1},
{"num_cmd_sleep_cfm_fail",
......@@ -233,6 +243,16 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv,
memcpy(info->last_event, adapter->dbg.last_event,
sizeof(adapter->dbg.last_event));
info->last_event_index = adapter->dbg.last_event_index;
memcpy(info->last_mp_wr_bitmap, adapter->dbg.last_mp_wr_bitmap,
sizeof(adapter->dbg.last_mp_wr_bitmap));
memcpy(info->last_mp_wr_ports, adapter->dbg.last_mp_wr_ports,
sizeof(adapter->dbg.last_mp_wr_ports));
memcpy(info->last_mp_curr_wr_port,
adapter->dbg.last_mp_curr_wr_port,
sizeof(adapter->dbg.last_mp_curr_wr_port));
memcpy(info->last_mp_wr_len, adapter->dbg.last_mp_wr_len,
sizeof(adapter->dbg.last_mp_wr_len));
info->last_sdio_mp_index = adapter->dbg.last_sdio_mp_index;
info->data_sent = adapter->data_sent;
info->cmd_sent = adapter->cmd_sent;
info->cmd_resp_received = adapter->cmd_resp_received;
......
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