wifi: cfg80211: split struct cfg80211_ap_settings
authorJohannes Berg <johannes.berg@intel.com>
Mon, 25 Sep 2023 06:56:38 +0000 (08:56 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 25 Sep 2023 07:00:39 +0000 (09:00 +0200)
Using the full struct cfg80211_ap_settings for an update is
misleading, since most settings cannot be updated. Split the
update case off into a new struct cfg80211_ap_update.

Change-Id: I3ba4dd9280938ab41252f145227a7005edf327e4
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 files changed:
drivers/net/wireless/ath/ath6kl/cfg80211.c
drivers/net/wireless/ath/wil6210/cfg80211.c
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
drivers/net/wireless/marvell/mwifiex/cfg80211.c
drivers/net/wireless/microchip/wilc1000/cfg80211.c
drivers/net/wireless/quantenna/qtnfmac/cfg80211.c
drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
include/net/cfg80211.h
net/mac80211/cfg.c
net/wireless/nl80211.c
net/wireless/rdev-ops.h
net/wireless/trace.h

index eea60e2fca44582f746a78e5b2d51c15ca6404ef..e37db4af33deee87a23f089d88b7f6d719ae1a85 100644 (file)
@@ -2954,7 +2954,7 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev,
 }
 
 static int ath6kl_change_beacon(struct wiphy *wiphy, struct net_device *dev,
-                               struct cfg80211_ap_settings *params)
+                               struct cfg80211_ap_update *params)
 {
        struct ath6kl_vif *vif = netdev_priv(dev);
 
index dfbb478ae2747bef52f34e2520c5be12c87429c7..dbe4b3478f03ffbc923ef07b9a02a5cb9c4376bc 100644 (file)
@@ -2082,7 +2082,7 @@ void wil_cfg80211_ap_recovery(struct wil6210_priv *wil)
 
 static int wil_cfg80211_change_beacon(struct wiphy *wiphy,
                                      struct net_device *ndev,
-                                     struct cfg80211_ap_settings *params)
+                                     struct cfg80211_ap_update *params)
 {
        struct wil6210_priv *wil = wiphy_to_wil(wiphy);
        struct wireless_dev *wdev = ndev->ieee80211_ptr;
index 9012456e1a18ebab8f2b85be5091ce7aac177e98..667462369a32fc01e8ee58ec2ed5990d99d24e37 100644 (file)
@@ -5415,7 +5415,7 @@ static int brcmf_cfg80211_stop_ap(struct wiphy *wiphy, struct net_device *ndev,
 
 static s32
 brcmf_cfg80211_change_beacon(struct wiphy *wiphy, struct net_device *ndev,
-                            struct cfg80211_ap_settings *info)
+                            struct cfg80211_ap_update *info)
 {
        struct brcmf_if *ifp = netdev_priv(ndev);
 
index 70473be42d7b764189b991aefc63c6b16e3c7895..7a15ea8072e6f99726ff8119b7bbf8f56c3e4492 100644 (file)
@@ -1835,7 +1835,7 @@ static int mwifiex_cfg80211_set_cqm_rssi_config(struct wiphy *wiphy,
  */
 static int mwifiex_cfg80211_change_beacon(struct wiphy *wiphy,
                                          struct net_device *dev,
-                                         struct cfg80211_ap_settings *params)
+                                         struct cfg80211_ap_update *params)
 {
        struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
        struct mwifiex_adapter *adapter = priv->adapter;
index 3447470d3d0266711ac5bac1cde787ed1ac59fac..da52f91693b5bf3481860ddeee803f7b094529d0 100644 (file)
@@ -1441,7 +1441,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
 }
 
 static int change_beacon(struct wiphy *wiphy, struct net_device *dev,
-                        struct cfg80211_ap_settings *params)
+                        struct cfg80211_ap_update *params)
 {
        struct wilc_vif *vif = netdev_priv(dev);
 
index 9388adcdcac12a16948931d68a2403fda908afe7..663d77770fce70d63935743ed23727be5eeae1b6 100644 (file)
@@ -331,7 +331,7 @@ out:
 }
 
 static int qtnf_change_beacon(struct wiphy *wiphy, struct net_device *dev,
-                             struct cfg80211_ap_settings *info)
+                             struct cfg80211_ap_update *info)
 {
        struct qtnf_vif *vif = qtnf_netdev_get_priv(dev);
 
index 5ddc2d9a6060fd038e051828442b9b0daa8d00bf..1e683212027c7894b84d8a0e35f6d8badd1e0d81 100644 (file)
@@ -2319,7 +2319,7 @@ static int cfg80211_rtw_start_ap(struct wiphy *wiphy, struct net_device *ndev,
 }
 
 static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev,
-               struct cfg80211_ap_settings *info)
+               struct cfg80211_ap_update *info)
 {
        struct adapter *adapter = rtw_netdev_priv(ndev);
 
index 9af714431b22fe74e5e8ef05a13efa14709f830b..899e9ffa604871f958d8cd876b2b66ae70a0fe16 100644 (file)
@@ -1480,6 +1480,22 @@ struct cfg80211_ap_settings {
        u16 punct_bitmap;
 };
 
+
+/**
+ * struct cfg80211_ap_update - AP configuration update
+ *
+ * Subset of &struct cfg80211_ap_settings, for updating a running AP.
+ *
+ * @beacon: beacon data
+ * @fils_discovery: FILS discovery transmission parameters
+ * @unsol_bcast_probe_resp: Unsolicited broadcast probe response parameters
+ */
+struct cfg80211_ap_update {
+       struct cfg80211_beacon_data beacon;
+       struct cfg80211_fils_discovery fils_discovery;
+       struct cfg80211_unsol_bcast_probe_resp unsol_bcast_probe_resp;
+};
+
 /**
  * struct cfg80211_csa_settings - channel switch settings
  *
@@ -4523,7 +4539,7 @@ struct cfg80211_ops {
        int     (*start_ap)(struct wiphy *wiphy, struct net_device *dev,
                            struct cfg80211_ap_settings *settings);
        int     (*change_beacon)(struct wiphy *wiphy, struct net_device *dev,
-                                struct cfg80211_ap_settings *info);
+                                struct cfg80211_ap_update *info);
        int     (*stop_ap)(struct wiphy *wiphy, struct net_device *dev,
                           unsigned int link_id);
 
index e751d4eba8f561324b40f655023e46bee754e4b5..e1a64a154287277f5b2ffe2ba478bc6292ad428c 100644 (file)
@@ -1477,7 +1477,7 @@ error:
 }
 
 static int ieee80211_change_beacon(struct wiphy *wiphy, struct net_device *dev,
-                                  struct cfg80211_ap_settings *params)
+                                  struct cfg80211_ap_update *params)
 
 {
        struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
index e64bf2a58b36db94ba5bcc20ded718d6e09c00e2..cbdf635e60257c151e4fa0a5273cb3e1ca94f080 100644 (file)
@@ -5636,11 +5636,10 @@ static int nl80211_parse_he_obss_pd(struct nlattr *attrs,
 
 static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev,
                                        struct nlattr *attrs,
-                                       struct cfg80211_ap_settings *params)
+                                       struct cfg80211_fils_discovery *fd)
 {
        struct nlattr *tb[NL80211_FILS_DISCOVERY_ATTR_MAX + 1];
        int ret;
-       struct cfg80211_fils_discovery *fd = &params->fils_discovery;
 
        if (!wiphy_ext_feature_isset(&rdev->wiphy,
                                     NL80211_EXT_FEATURE_FILS_DISCOVERY))
@@ -5674,12 +5673,10 @@ static int nl80211_parse_fils_discovery(struct cfg80211_registered_device *rdev,
 static int
 nl80211_parse_unsol_bcast_probe_resp(struct cfg80211_registered_device *rdev,
                                     struct nlattr *attrs,
-                                    struct cfg80211_ap_settings *params)
+                                    struct cfg80211_unsol_bcast_probe_resp *presp)
 {
        struct nlattr *tb[NL80211_UNSOL_BCAST_PROBE_RESP_ATTR_MAX + 1];
        int ret;
-       struct cfg80211_unsol_bcast_probe_resp *presp =
-                                       &params->unsol_bcast_probe_resp;
 
        if (!wiphy_ext_feature_isset(&rdev->wiphy,
                                     NL80211_EXT_FEATURE_UNSOL_BCAST_PROBE_RESP))
@@ -6122,7 +6119,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
        if (info->attrs[NL80211_ATTR_FILS_DISCOVERY]) {
                err = nl80211_parse_fils_discovery(rdev,
                                                   info->attrs[NL80211_ATTR_FILS_DISCOVERY],
-                                                  params);
+                                                  &params->fils_discovery);
                if (err)
                        goto out;
        }
@@ -6130,7 +6127,7 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
        if (info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP]) {
                err = nl80211_parse_unsol_bcast_probe_resp(
                        rdev, info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP],
-                       params);
+                       &params->unsol_bcast_probe_resp);
                if (err)
                        goto out;
        }
@@ -6202,7 +6199,7 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info)
        unsigned int link_id = nl80211_link_id(info->attrs);
        struct net_device *dev = info->user_ptr[1];
        struct wireless_dev *wdev = dev->ieee80211_ptr;
-       struct cfg80211_ap_settings *params;
+       struct cfg80211_ap_update *params;
        struct nlattr *attr;
        int err;
 
@@ -6227,14 +6224,16 @@ static int nl80211_set_beacon(struct sk_buff *skb, struct genl_info *info)
 
        attr = info->attrs[NL80211_ATTR_FILS_DISCOVERY];
        if (attr) {
-               err = nl80211_parse_fils_discovery(rdev, attr, params);
+               err = nl80211_parse_fils_discovery(rdev, attr,
+                                                  &params->fils_discovery);
                if (err)
                        goto out;
        }
 
        attr = info->attrs[NL80211_ATTR_UNSOL_BCAST_PROBE_RESP];
        if (attr) {
-               err = nl80211_parse_unsol_bcast_probe_resp(rdev, attr, params);
+               err = nl80211_parse_unsol_bcast_probe_resp(rdev, attr,
+                                                          &params->unsol_bcast_probe_resp);
                if (err)
                        goto out;
        }
index c6a2c07e380b14a759f5de56445c8ea470b02cde..2214a90cf1012cb16f1f8ac27d9a4e364c400e2b 100644 (file)
@@ -173,7 +173,7 @@ static inline int rdev_start_ap(struct cfg80211_registered_device *rdev,
 
 static inline int rdev_change_beacon(struct cfg80211_registered_device *rdev,
                                     struct net_device *dev,
-                                    struct cfg80211_ap_settings *info)
+                                    struct cfg80211_ap_update *info)
 {
        int ret;
        trace_rdev_change_beacon(&rdev->wiphy, dev, info);
index 1557dc1d58e29847cfbf696702cc54bdb93c187d..da2b73951c32b20ed2bc6b11de466ce2c5173d78 100644 (file)
@@ -615,7 +615,7 @@ TRACE_EVENT(rdev_start_ap,
 
 TRACE_EVENT(rdev_change_beacon,
        TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
-                struct cfg80211_ap_settings *info),
+                struct cfg80211_ap_update *info),
        TP_ARGS(wiphy, netdev, info),
        TP_STRUCT__entry(
                WIPHY_ENTRY