3 @@ -441,6 +441,21 @@ struct hostapd_sta_info {
7 + * struct hostapd_openwrt_stats - OpenWrt custom STA/AP statistics
9 +struct hostapd_openwrt_stats {
11 + u64 neighbor_report_tx;
15 + u64 bss_transition_query_rx;
16 + u64 bss_transition_request_tx;
17 + u64 bss_transition_response_rx;
22 * struct hostapd_iface - hostapd per-interface data structure
24 struct hostapd_iface {
25 @@ -562,6 +577,9 @@ struct hostapd_iface {
26 u64 last_channel_time_busy;
27 u8 channel_utilization;
29 + /* OpenWrt specific statistics */
30 + struct hostapd_openwrt_stats openwrt_stats;
32 unsigned int chan_util_samples_sum;
33 unsigned int chan_util_num_sample_periods;
34 unsigned int chan_util_average;
37 @@ -386,6 +386,7 @@ static int ieee802_11_send_bss_trans_mgm
38 mgmt->u.action.u.bss_tm_req.validity_interval = 1;
39 pos = mgmt->u.action.u.bss_tm_req.variable;
41 + hapd->iface->openwrt_stats.wnm.bss_transition_request_tx++;
42 wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to "
43 MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u "
44 "validity_interval=%u",
45 @@ -646,10 +647,12 @@ int ieee802_11_rx_wnm_action_ap(struct h
48 case WNM_BSS_TRANS_MGMT_QUERY:
49 + hapd->iface->openwrt_stats.wnm.bss_transition_query_rx++;
50 ieee802_11_rx_bss_trans_mgmt_query(hapd, mgmt->sa, payload,
53 case WNM_BSS_TRANS_MGMT_RESP:
54 + hapd->iface->openwrt_stats.wnm.bss_transition_response_rx++;
55 ieee802_11_rx_bss_trans_mgmt_resp(hapd, mgmt->sa, payload,
58 @@ -696,6 +699,7 @@ int wnm_send_disassoc_imminent(struct ho
60 pos = mgmt->u.action.u.bss_tm_req.variable;
62 + hapd->iface->openwrt_stats.wnm.bss_transition_request_tx++;
63 wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request frame to indicate imminent disassociation (disassoc_timer=%d) to "
64 MACSTR, disassoc_timer, MAC2STR(sta->addr));
65 if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0, NULL, 0, 0) < 0) {
66 @@ -777,6 +781,7 @@ int wnm_send_ess_disassoc_imminent(struc
70 + hapd->iface->openwrt_stats.wnm.bss_transition_request_tx++;
72 /* send disassociation frame after time-out */
73 set_disassoc_timer(hapd, sta, disassoc_timer);
74 @@ -856,6 +861,7 @@ int wnm_send_bss_tm_req(struct hostapd_d
78 + hapd->iface->openwrt_stats.wnm.bss_transition_request_tx++;
80 /* send disassociation frame after time-out */
81 set_disassoc_timer(hapd, sta, disassoc_timer);
84 @@ -269,6 +269,8 @@ static void hostapd_send_nei_report_resp
88 + hapd->iface->openwrt_stats.rrm.neighbor_report_tx++;
90 hostapd_drv_send_action(hapd, hapd->iface->freq, 0, addr,
91 wpabuf_head(buf), wpabuf_len(buf));