aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest
diff options
context:
space:
mode:
authorJouni Malinen <jouni.malinen@atheros.com>2011-01-07 16:52:56 +0200
committerJouni Malinen <j@w1.fi>2011-01-07 16:52:56 +0200
commite7ba4e2c7417e621b51d1e03c696eec4d6486dc4 (patch)
tree5c7f26eda90878f61b713dca2b8d844a9b01fff0 /wlantest
parent7e7a57ae3f873c7580649c1713d2ef891f97ccc2 (diff)
downloadexternal_wpa_supplicant_8_ti-e7ba4e2c7417e621b51d1e03c696eec4d6486dc4.zip
external_wpa_supplicant_8_ti-e7ba4e2c7417e621b51d1e03c696eec4d6486dc4.tar.gz
external_wpa_supplicant_8_ti-e7ba4e2c7417e621b51d1e03c696eec4d6486dc4.tar.bz2
wlantest: Add counters for AP deauth/disassoc while asleep/awake
These can be used to check whether the STA is in power save mode and because of that, is not seeing disconnection notifications.
Diffstat (limited to 'wlantest')
-rw-r--r--wlantest/rx_mgmt.c18
-rw-r--r--wlantest/wlantest_cli.c4
-rw-r--r--wlantest/wlantest_ctrl.h4
3 files changed, 22 insertions, 4 deletions
diff --git a/wlantest/rx_mgmt.c b/wlantest/rx_mgmt.c
index 234de61..dd430be 100644
--- a/wlantest/rx_mgmt.c
+++ b/wlantest/rx_mgmt.c
@@ -204,10 +204,14 @@ static void rx_mgmt_deauth(struct wlantest *wt, const u8 *data, size_t len,
return;
}
- if (os_memcmp(mgmt->sa, mgmt->bssid, ETH_ALEN) == 0)
+ if (os_memcmp(mgmt->sa, mgmt->bssid, ETH_ALEN) == 0) {
sta->counters[valid ? WLANTEST_STA_COUNTER_VALID_DEAUTH_RX :
WLANTEST_STA_COUNTER_INVALID_DEAUTH_RX]++;
- else
+ if (sta->pwrmgt && !sta->pspoll)
+ sta->counters[WLANTEST_STA_COUNTER_DEAUTH_RX_ASLEEP]++;
+ else
+ sta->counters[WLANTEST_STA_COUNTER_DEAUTH_RX_AWAKE]++;
+ } else
sta->counters[valid ? WLANTEST_STA_COUNTER_VALID_DEAUTH_TX :
WLANTEST_STA_COUNTER_INVALID_DEAUTH_TX]++;
@@ -529,10 +533,16 @@ static void rx_mgmt_disassoc(struct wlantest *wt, const u8 *data, size_t len,
return;
}
- if (os_memcmp(mgmt->sa, mgmt->bssid, ETH_ALEN) == 0)
+ if (os_memcmp(mgmt->sa, mgmt->bssid, ETH_ALEN) == 0) {
sta->counters[valid ? WLANTEST_STA_COUNTER_VALID_DISASSOC_RX :
WLANTEST_STA_COUNTER_INVALID_DISASSOC_RX]++;
- else
+ if (sta->pwrmgt && !sta->pspoll)
+ sta->counters[
+ WLANTEST_STA_COUNTER_DISASSOC_RX_ASLEEP]++;
+ else
+ sta->counters[
+ WLANTEST_STA_COUNTER_DISASSOC_RX_AWAKE]++;
+ } else
sta->counters[valid ? WLANTEST_STA_COUNTER_VALID_DISASSOC_TX :
WLANTEST_STA_COUNTER_INVALID_DISASSOC_TX]++;
diff --git a/wlantest/wlantest_cli.c b/wlantest/wlantest_cli.c
index a2bb6b9..da25524 100644
--- a/wlantest/wlantest_cli.c
+++ b/wlantest/wlantest_cli.c
@@ -547,6 +547,10 @@ static const struct sta_counters sta_counters[] = {
WLANTEST_STA_COUNTER_INVALID_DEAUTH_RX_ACK },
{ "invalid_disassoc_rx_ack",
WLANTEST_STA_COUNTER_INVALID_DISASSOC_RX_ACK },
+ { "deauth_rx_asleep", WLANTEST_STA_COUNTER_DEAUTH_RX_ASLEEP },
+ { "deauth_rx_awake", WLANTEST_STA_COUNTER_DEAUTH_RX_AWAKE },
+ { "disassoc_rx_asleep", WLANTEST_STA_COUNTER_DISASSOC_RX_ASLEEP },
+ { "disassoc_rx_awake", WLANTEST_STA_COUNTER_DISASSOC_RX_AWAKE },
{ NULL, 0 }
};
diff --git a/wlantest/wlantest_ctrl.h b/wlantest/wlantest_ctrl.h
index 0dbf8c5..fa6b766 100644
--- a/wlantest/wlantest_ctrl.h
+++ b/wlantest/wlantest_ctrl.h
@@ -101,6 +101,10 @@ enum wlantest_sta_counter {
WLANTEST_STA_COUNTER_VALID_DISASSOC_RX_ACK,
WLANTEST_STA_COUNTER_INVALID_DEAUTH_RX_ACK,
WLANTEST_STA_COUNTER_INVALID_DISASSOC_RX_ACK,
+ WLANTEST_STA_COUNTER_DEAUTH_RX_ASLEEP,
+ WLANTEST_STA_COUNTER_DEAUTH_RX_AWAKE,
+ WLANTEST_STA_COUNTER_DISASSOC_RX_ASLEEP,
+ WLANTEST_STA_COUNTER_DISASSOC_RX_AWAKE,
NUM_WLANTEST_STA_COUNTER
};