mac80211: support FTM responder configuration/statistics
Subsystems (2)
PATCH RESEND v3 2/3 mac80211: support FTM responder configuration/statistics
New bss param ftm_responder is used to notify the driver to enable fine timing request (FTM) responder role in AP mode.
Plumb the new cfg80211 API for FTM responder statistics through to the driver API in mac80211.
Signed-off-by David Spinadel <[email protected]>
Signed-off-by Johannes Berg <[email protected]>
Signed-off-by Pradeep Kumar Chitrapu <[email protected]>
---
v3:
- fixed ftm responder disabled case to be not supported.
- changed ftm_responder param from bool to s8.
include/net/mac80211.h | 13 ++++++++ net/mac80211/cfg.c | 84 +++++++++++++++++++++++++++++++++++++++++++++++ net/mac80211/driver-ops.h | 16 +++++++++ net/mac80211/trace.h | 23 +++++++++++++ net/mac80211/util.c | 3 ++ 5 files changed, 139 insertions(+)
include/net/mac80211.h +13 -0
@@ -308,6 +308,8 @@ struct ieee80211_vif_chanctx_switch {* @BSS_CHANGED_KEEP_ALIVE: keep alive options (idle period or protected * keep alive) changed. * @BSS_CHANGED_MCAST_RATE: Multicast Rate setting changed for this interface +* @BSS_CHANGED_FTM_RESPONDER: fime timing reasurement request responder +* functionality changed for this BSS (AP mode). * */ enum ieee80211_bss_change {
@@ -337,6 +339,7 @@ enum ieee80211_bss_change {BSS_CHANGED_MU_GROUPS =1 <<23 ,BSS_CHANGED_KEEP_ALIVE =1 <<24 ,BSS_CHANGED_MCAST_RATE =1 <<25 , + BSS_CHANGED_FTM_RESPONDER = 1<<26, /* when adding here, make sure to change ieee80211_reconfig */ };
@@ -561,6 +564,9 @@ struct ieee80211_mu_group_data {* @protected_keep_alive: if set, indicates that the station should send an RSN * protected frame to the AP to reset the idle timer at the AP for the * station. +* @ftm_responder: whether to enable or disable fine timing measurement FTM +* responder functionality. +* @ftmr_params: configurable lci/civic parameter when enabling FTM responder. */ struct ieee80211_bss_conf {const u8 *bssid;
@@ -611,6 +617,8 @@ struct ieee80211_bss_conf {bool allow_p2p_go_ps;u16 max_idle_period;bool protected_keep_alive; +s8 ftm_responder; +struct cfg80211_ftm_responder_params *ftmr_params; };/**
@@ -3546,6 +3554,8 @@ enum ieee80211_reconfig_type {* @del_nan_func: Remove a NAN function. The driver must call * ieee80211_nan_func_terminated() with * NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal. +* @get_ftm_responder_stats: Retrieve FTM responder statistics, if available. +* Statistics should be cumulative, currently no way to reset is provided. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw,
@@ -3828,6 +3838,9 @@ struct ieee80211_ops {void (*del_nan_func)(struct ieee80211_hw *hw,struct ieee80211_vif *vif,u8 instance_id); +int (*get_ftm_responder_stats)(struct ieee80211_hw *hw, +struct ieee80211_vif *vif, +struct cfg80211_ftm_responder_stats *ftm_stats); };/**
net/mac80211/cfg.c +84 -0
112 lines not on this page · raw message
net/mac80211/driver-ops.h +16 -0
@@ -1173,6 +1173,22 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local, local->ops->wake_tx_queue (&local->hw, &txq->txq); } +static inline int +drv_get_ftm_responder_stats (struct ieee80211_local *local, +struct ieee80211_sub_if_data *sdata, +struct cfg80211_ftm_responder_stats *ftm_stats) +{ +u32 ret = -EOPNOTSUPP ; + +if (local->ops->get_ftm_responder_stats) + ret = local->ops->get_ftm_responder_stats (&local->hw, + &sdata->vif, + ftm_stats); +trace_drv_get_ftm_responder_stats (local, sdata, ftm_stats); + +return ret; +} +static inline int drv_start_nan (struct ieee80211_local *local,struct ieee80211_sub_if_data *sdata,struct cfg80211_nan_conf *conf)
net/mac80211/trace.h +23 -0
@@ -2600,6 +2600,29 @@ struct trace_switch_entry { ) ); +TRACE_EVENT (drv_get_ftm_responder_stats, + TP_PROTO(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + struct cfg80211_ftm_responder_stats *ftm_stats), + +TP_ARGS (local, sdata, ftm_stats), + +TP_STRUCT__entry ( +LOCAL_ENTRY + VIF_ENTRY + ), + +TP_fast_assign ( + LOCAL_ASSIGN; + VIF_ASSIGN; + ), + +TP_printk ( + LOCAL_PR_FMT VIF_PR_FMT, +LOCAL_PR_ARG ,VIF_PR_ARG + ) +); +#endif /* !__MAC80211_DRIVER_TRACE || TRACE_HEADER_MULTI_READ */ #undef TRACE_INCLUDE_PATH
net/mac80211/util.c +3 -0
@@ -2176,6 +2176,9 @@ int ieee80211_reconfig(struct ieee80211_local *local)case NL80211_IFTYPE_AP : changed |=BSS_CHANGED_SSID |BSS_CHANGED_P2P_PS ; +if (sdata->vif.bss_conf.ftm_responder !=-1 ) + changed |=BSS_CHANGED_FTM_RESPONDER ; +if (sdata->vif.type ==NL80211_IFTYPE_AP ) { changed |=BSS_CHANGED_AP_PROBE_RESP ;
Signature · 7 lines
1.9.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k