diff options
| author | Nitesh Shah <niteshs@codeaurora.org> | 2017-03-27 19:42:15 +0530 |
|---|---|---|
| committer | Nitesh Shah <niteshs@codeaurora.org> | 2017-04-05 11:55:07 +0530 |
| commit | 7eed440897387069fa88089af38cee8a763f1906 (patch) | |
| tree | 35403049e85b15b6c84704a791c3e46aef88279e | |
| parent | 9d06b93823bc3adb8e23e48c91eb0c81cb98cf94 (diff) | |
qcacld-2.0: Show peer in getTdlsPeers only if STA is associated
If the STA is previously associated with AP and has TDLS peers,
then getTdlsPeers will show the peers even after STA is
disassociated.
Thus, the fix is to show the peers only if the STA is in
connected state.
Change-Id: I8686ae3b8bb007b58942cdbd8873e48f227fe443
CRs-Fixed: 2025462
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_tdls.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/CORE/HDD/src/wlan_hdd_tdls.c b/CORE/HDD/src/wlan_hdd_tdls.c index dc3171c4cc89..76fbe93ed58d 100644 --- a/CORE/HDD/src/wlan_hdd_tdls.c +++ b/CORE/HDD/src/wlan_hdd_tdls.c @@ -2303,12 +2303,25 @@ int wlan_hdd_tdls_get_all_peers(hdd_adapter_t *pAdapter, char *buf, int buflen) hddTdlsPeer_t *curr_peer; tdlsCtx_t *pHddTdlsCtx; hdd_context_t *pHddCtx = WLAN_HDD_GET_CTX(pAdapter); + hdd_station_ctx_t *hdd_sta_ctx; ENTER(); if (0 != (wlan_hdd_validate_context(pHddCtx))) return 0; + if ((WLAN_HDD_INFRA_STATION != pAdapter->device_mode) + && (WLAN_HDD_P2P_CLIENT != pAdapter->device_mode)) { + len = scnprintf(buf, buflen, "\nNo TDLS support for this adapter"); + return len; + } + + hdd_sta_ctx = WLAN_HDD_GET_STATION_CTX_PTR(pAdapter); + if (eConnectionState_Associated != hdd_sta_ctx->conn_info.connState) { + len = scnprintf(buf, buflen, "\nSTA is not associated\n"); + return len; + } + init_len = buflen; len = scnprintf(buf, buflen, "\n%-18s%-3s%-4s%-3s%-5s\n", "MAC", "Id", "cap", "up", "RSSI"); |
