@@ -4494,6 +4494,7 @@ struct cfg80211_ops {
struct cfg80211_fils_aad *fils_aad);
int (*set_radar_background)(struct wiphy *wiphy,
struct cfg80211_chan_def *chandef);
+ int (*get_avg_busy_time)(struct wiphy *wiphy, struct net_device *dev);
};
/*
@@ -3177,6 +3177,8 @@ enum nl80211_attrs {
NL80211_ATTR_DISABLE_EHT,
+ NL80211_ATTR_WIPHY_AVG_BUSY_TIME,
+
/* add attributes here, update the policy in nl80211.c */
__NL80211_ATTR_AFTER_LAST,
@@ -4536,6 +4536,13 @@ ieee80211_set_radar_background(struct wiphy *wiphy,
return local->ops->set_radar_background(&local->hw, chandef);
}
+static int ieee80211_get_avg_busy_time(struct wiphy *wiphy,
+ struct net_device *dev)
+{
+ struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+ return ewma_avg_busy_read(&sdata->avg_busy);
+}
+
const struct cfg80211_ops mac80211_config_ops = {
.add_virtual_intf = ieee80211_add_iface,
.del_virtual_intf = ieee80211_del_iface,
@@ -4641,4 +4648,5 @@ const struct cfg80211_ops mac80211_config_ops = {
.set_sar_specs = ieee80211_set_sar_specs,
.color_change = ieee80211_color_change,
.set_radar_background = ieee80211_set_radar_background,
+ .get_avg_busy_time = ieee80211_get_avg_busy_time,
};
@@ -3717,6 +3717,12 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag
goto nla_put_failure;
}
+ if (rdev->ops->get_avg_busy_time) {
+ int busy = rdev->ops->get_avg_busy_time(&rdev->wiphy, dev);
+ nla_put_u32(msg, NL80211_ATTR_WIPHY_AVG_BUSY_TIME,
+ busy);
+ }
+
wdev_lock(wdev);
switch (wdev->iftype) {
case NL80211_IFTYPE_AP:
Add the average busy time of the channel in the nl80211. Signed-off-by: Baligh Gasmi <gasmibal@gmail.com> --- include/net/cfg80211.h | 1 + include/uapi/linux/nl80211.h | 2 ++ net/mac80211/cfg.c | 8 ++++++++ net/wireless/nl80211.c | 6 ++++++ 4 files changed, 17 insertions(+)