@@ -318,7 +318,7 @@ struct ieee80211_vif_chanctx_switch {
* @BSS_CHANGED_IDLE: Idle changed for this BSS/interface.
* @BSS_CHANGED_SSID: SSID changed for this BSS (AP and IBSS mode)
* @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode)
- * @BSS_CHANGED_PS: PS changed for this BSS (STA mode)
+ * @BSS_CHANGED_PS: PS changed for this BSS (AP and STA mode)
* @BSS_CHANGED_TXPOWER: TX power setting changed for this interface
* @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS)
* changed
@@ -683,6 +683,7 @@ struct ieee80211_fils_discovery {
* beamformee
* @eht_mu_beamformer: in AP-mode, does this BSS enable operation as an EHT MU
* beamformer
+ * @ap_ps_enable: enable/disable ap power save.
*/
struct ieee80211_bss_conf {
struct ieee80211_vif *vif;
@@ -776,6 +777,7 @@ struct ieee80211_bss_conf {
bool eht_su_beamformer;
bool eht_su_beamformee;
bool eht_mu_beamformer;
+ bool ap_ps_enable;
};
/**
@@ -2646,6 +2648,8 @@ struct ieee80211_txq {
* @IEEE80211_HW_MLO_MCAST_MULTI_LINK_TX: Hardware/driver handles transmitting
* multicast frames on all links, mac80211 should not do that.
*
+ * @IEEE80211_HW_SUPPORTS_AP_PS: Hardware supports AP power save.
+ *
* @NUM_IEEE80211_HW_FLAGS: number of hardware flags, used for sizing arrays
*/
enum ieee80211_hw_flags {
@@ -2703,6 +2707,7 @@ enum ieee80211_hw_flags {
IEEE80211_HW_SUPPORTS_CONC_MON_RX_DECAP,
IEEE80211_HW_DETECTS_COLOR_COLLISION,
IEEE80211_HW_MLO_MCAST_MULTI_LINK_TX,
+ IEEE80211_HW_SUPPORTS_AP_PS,
/* keep last, obviously */
NUM_IEEE80211_HW_FLAGS
@@ -1468,6 +1468,7 @@ static int ieee80211_update_ap(struct wiphy *wiphy, struct net_device *dev,
struct beacon_data *old;
int err;
struct ieee80211_bss_conf *link_conf;
+ u32 changed = 0;
sdata_assert_lock(sdata);
@@ -1488,20 +1489,30 @@ static int ieee80211_update_ap(struct wiphy *wiphy, struct net_device *dev,
if (!old)
return -ENOENT;
- err = ieee80211_assign_beacon(sdata, link, ¶ms->settings.beacon,
- NULL, NULL);
- if (err < 0)
- return err;
+ if (test_bit(BEACON_VALID, params->valid)) {
+ err = ieee80211_assign_beacon(sdata, link, ¶ms->settings.beacon,
+ NULL, NULL);
+ if (err < 0)
+ return err;
+
+ changed |= err;
+ }
+
+ if (ieee80211_hw_check(&sdata->local->hw, SUPPORTS_AP_PS) &&
+ test_bit(AP_PS_VALID, params->valid)) {
+ sdata->vif.bss_conf.ap_ps_enable = params->settings.ap_ps_enable;
+ changed |= BSS_CHANGED_PS;
+ }
if (params->settings.beacon.he_bss_color_valid &&
params->settings.beacon.he_bss_color.enabled !=
link_conf->he_bss_color.enabled) {
link_conf->he_bss_color.enabled =
params->settings.beacon.he_bss_color.enabled;
- err |= BSS_CHANGED_HE_BSS_COLOR;
+ changed |= BSS_CHANGED_HE_BSS_COLOR;
}
- ieee80211_link_info_change_notify(sdata, link, err);
+ ieee80211_vif_cfg_change_notify(sdata, changed);
return 0;
}
@@ -496,6 +496,7 @@ static const char *hw_flag_names[] = {
FLAG(SUPPORTS_CONC_MON_RX_DECAP),
FLAG(DETECTS_COLOR_COLLISION),
FLAG(MLO_MCAST_MULTI_LINK_TX),
+ FLAG(SUPPORTS_AP_PS),
#undef FLAG
};