mac80211: copy configured beacon tx rate to driver
authorRajkumar Manoharan <rmanohar@codeaurora.org>
Sat, 3 Oct 2020 22:04:18 +0000 (15:04 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 8 Oct 2020 10:26:35 +0000 (12:26 +0200)
The user is allowed to change beacon tx rate (HT/VHT/HE) from hostapd.
This information needs to be passed to the driver when the rate control
is offloaded to the firmware. The driver capability of allowing beacon
rate is already validated in cfg80211, so simply passing the rate
information to the driver is enough.

Signed-off-by: Rajkumar Manoharan <rmanohar@codeaurora.org>
Link: https://lore.kernel.org/r/1601762658-15627-1-git-send-email-rmanohar@codeaurora.org
[adjust commit message slightly]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
include/net/mac80211.h
net/mac80211/cfg.c

index 4747d446179aa99f487da3002a356af651966eef..e8e295dae744e4dc8d86182d193e0e387206a6e9 100644 (file)
@@ -628,6 +628,8 @@ struct ieee80211_fils_discovery {
  * @unsol_bcast_probe_resp_interval: Unsolicited broadcast probe response
  *     interval.
  * @s1g: BSS is S1G BSS (affects Association Request format).
+ * @beacon_tx_rate: The configured beacon transmit rate that needs to be passed
+ *     to driver when rate control is offloaded to firmware.
  */
 struct ieee80211_bss_conf {
        const u8 *bssid;
@@ -698,6 +700,7 @@ struct ieee80211_bss_conf {
        struct ieee80211_fils_discovery fils_discovery;
        u32 unsol_bcast_probe_resp_interval;
        bool s1g;
+       struct cfg80211_bitrate_mask beacon_tx_rate;
 };
 
 /**
index eb52aafd9381997142e336e27ef4341f98d49280..7276e66ae435e438604921116808d38cb9a84591 100644 (file)
@@ -1154,6 +1154,9 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
                }
        }
 
+       if (ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL))
+               sdata->vif.bss_conf.beacon_tx_rate = params->beacon_rate;
+
        err = ieee80211_assign_beacon(sdata, &params->beacon, NULL);
        if (err < 0)
                goto error;