Commit 72df6310 authored by Xinming Hu's avatar Xinming Hu Committed by Kalle Valo

mwifiex: report tdls peers in debugfs

This patch add provision to show TDLS peer table in debugfs file.
Signed-off-by: default avatarXinming Hu <huxm@marvell.com>
Signed-off-by: default avatarCathy Luo <cluo@marvell.com>
Signed-off-by: default avatarAvinash Patil <patila@marvell.com>
Signed-off-by: default avatarKalle Valo <kvalo@codeaurora.org>
parent c0c3163a
......@@ -493,6 +493,15 @@ mwifiex_debug_read(struct file *file, char __user *ubuf,
}
}
if (info.tdls_peer_num) {
p += sprintf(p, "TDLS peer table:\n");
for (i = 0; i < info.tdls_peer_num; i++) {
p += sprintf(p, "peer = %pM",
info.tdls_list[i].peer_addr);
p += sprintf(p, "\n");
}
}
ret = simple_read_from_buffer(ubuf, count, ppos, (char *) page,
(unsigned long) p - page);
......
......@@ -41,6 +41,7 @@
#define MWIFIEX_MAX_TX_BASTREAM_SUPPORTED 2
#define MWIFIEX_MAX_RX_BASTREAM_SUPPORTED 16
#define MWIFIEX_MAX_TDLS_PEER_SUPPORTED 8
#define MWIFIEX_STA_AMPDU_DEF_TXWINSIZE 64
#define MWIFIEX_STA_AMPDU_DEF_RXWINSIZE 64
......
......@@ -180,7 +180,11 @@ struct mwifiex_ds_tx_ba_stream_tbl {
u8 amsdu;
};
#define DBG_CMD_NUM 5
#define DBG_CMD_NUM 5
struct tdls_peer_info {
u8 peer_addr[ETH_ALEN];
};
struct mwifiex_debug_info {
u32 int_counter;
......@@ -193,6 +197,9 @@ struct mwifiex_debug_info {
u32 rx_tbl_num;
struct mwifiex_ds_rx_reorder_tbl rx_tbl
[MWIFIEX_MAX_RX_BASTREAM_SUPPORTED];
u32 tdls_peer_num;
struct tdls_peer_info tdls_list
[MWIFIEX_MAX_TDLS_PEER_SUPPORTED];
u16 ps_mode;
u32 ps_state;
u8 is_deep_sleep;
......
......@@ -1324,6 +1324,8 @@ void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
u8 *buf, int len);
int mwifiex_tdls_oper(struct mwifiex_private *priv, const u8 *peer, u8 action);
int mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac);
int mwifiex_get_tdls_list(struct mwifiex_private *priv,
struct tdls_peer_info *buf);
void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv);
bool mwifiex_is_bss_in_11ac_mode(struct mwifiex_private *priv);
u8 mwifiex_get_center_freq_index(struct mwifiex_private *priv, u8 band,
......
......@@ -1123,6 +1123,36 @@ int mwifiex_get_tdls_link_status(struct mwifiex_private *priv, const u8 *mac)
return TDLS_NOT_SETUP;
}
int mwifiex_get_tdls_list(struct mwifiex_private *priv,
struct tdls_peer_info *buf)
{
struct mwifiex_sta_node *sta_ptr;
struct tdls_peer_info *peer = buf;
int count = 0;
unsigned long flags;
if (!ISSUPP_TDLS_ENABLED(priv->adapter->fw_cap_info))
return 0;
/* make sure we are in station mode and connected */
if (!(priv->bss_type == MWIFIEX_BSS_TYPE_STA && priv->media_connected))
return 0;
spin_lock_irqsave(&priv->sta_list_spinlock, flags);
list_for_each_entry(sta_ptr, &priv->sta_list, list) {
if (sta_ptr->tdls_status == TDLS_SETUP_COMPLETE) {
ether_addr_copy(peer->peer_addr, sta_ptr->mac_addr);
peer++;
count++;
if (count >= MWIFIEX_MAX_TDLS_PEER_SUPPORTED)
break;
}
}
spin_unlock_irqrestore(&priv->sta_list_spinlock, flags);
return count;
}
void mwifiex_disable_all_tdls_links(struct mwifiex_private *priv)
{
struct mwifiex_sta_node *sta_ptr;
......
......@@ -97,6 +97,8 @@ int mwifiex_get_debug_info(struct mwifiex_private *priv,
info->rx_tbl);
info->tx_tbl_num = mwifiex_get_tx_ba_stream_tbl(priv,
info->tx_tbl);
info->tdls_peer_num = mwifiex_get_tdls_list(priv,
info->tdls_list);
info->ps_mode = adapter->ps_mode;
info->ps_state = adapter->ps_state;
info->is_deep_sleep = adapter->is_deep_sleep;
......
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