diff options
author | Xinming Hu <huxm@marvell.com> | 2014-12-23 14:44:05 +0100 |
---|---|---|
committer | Kalle Valo <kvalo@codeaurora.org> | 2015-01-06 19:53:23 +0100 |
commit | 72df63100d54bc801700de2c6f525d0fd8bfd799 (patch) | |
tree | 1065b78af2b1ac873d4d0d93eafd8771d4428b96 /drivers/net/wireless/mwifiex/tdls.c | |
parent | ath5k: drop owner assignment from platform_drivers (diff) | |
download | linux-72df63100d54bc801700de2c6f525d0fd8bfd799.tar.xz linux-72df63100d54bc801700de2c6f525d0fd8bfd799.zip |
mwifiex: report tdls peers in debugfs
This patch add provision to show TDLS peer table in debugfs file.
Signed-off-by: Xinming Hu <huxm@marvell.com>
Signed-off-by: Cathy Luo <cluo@marvell.com>
Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Diffstat (limited to 'drivers/net/wireless/mwifiex/tdls.c')
-rw-r--r-- | drivers/net/wireless/mwifiex/tdls.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/tdls.c b/drivers/net/wireless/mwifiex/tdls.c index 22884b429be7..efa81d8f2597 100644 --- a/drivers/net/wireless/mwifiex/tdls.c +++ b/drivers/net/wireless/mwifiex/tdls.c @@ -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; |