]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: cfg80211: pass net_device to .set_monitor_channel
authorFelix Fietkau <nbd@nbd.name>
Wed, 9 Oct 2024 08:25:47 +0000 (10:25 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Wed, 23 Oct 2024 14:45:35 +0000 (16:45 +0200)
Preparation for allowing multiple monitor interfaces with different channels
on a multi-radio wiphy.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
Link: https://patch.msgid.link/35fa652dbfebf93343f8b9a08fdef0467a2a02dc.1728462320.git-series.nbd@nbd.name
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/ath/wil6210/cfg80211.c
drivers/net/wireless/marvell/libertas/cfg.c
drivers/net/wireless/microchip/wilc1000/cfg80211.c
include/net/cfg80211.h
net/mac80211/cfg.c
net/wireless/chan.c
net/wireless/core.h
net/wireless/nl80211.c
net/wireless/rdev-ops.h
net/wireless/trace.h
net/wireless/wext-compat.c

index e8f1d30a8d73c50a815345d576eaef687cb9a920..a1a0a9223e74acc1cbef2e2b05e5d20dbad66ade 100644 (file)
@@ -1493,6 +1493,7 @@ out:
 }
 
 static int wil_cfg80211_set_channel(struct wiphy *wiphy,
+                                   struct net_device *dev,
                                    struct cfg80211_chan_def *chandef)
 {
        struct wil6210_priv *wil = wiphy_to_wil(wiphy);
index afe9bcd3ad46d7d37fdb0c138210f540e3173a19..2e2c193716d96a9fd2a12ac18e3bd07e33206b79 100644 (file)
@@ -486,6 +486,7 @@ static int lbs_add_wps_enrollee_tlv(u8 *tlv, const u8 *ie, size_t ie_len)
  */
 
 static int lbs_cfg_set_monitor_channel(struct wiphy *wiphy,
+                                      struct net_device *dev,
                                       struct cfg80211_chan_def *chandef)
 {
        struct lbs_private *priv = wiphy_priv(wiphy);
index b0dae6f7c633b31904f46d4393cd4c2d8b69ed6e..e96736cc7259b981ba01d04a622533953a04d717 100644 (file)
@@ -231,6 +231,7 @@ struct wilc_vif *wilc_get_wl_to_vif(struct wilc *wl)
 }
 
 static int set_channel(struct wiphy *wiphy,
+                      struct net_device *dev,
                       struct cfg80211_chan_def *chandef)
 {
        struct wilc *wl = wiphy_priv(wiphy);
@@ -1424,7 +1425,7 @@ static int start_ap(struct wiphy *wiphy, struct net_device *dev,
        struct wilc_vif *vif = netdev_priv(dev);
        int ret;
 
-       ret = set_channel(wiphy, &settings->chandef);
+       ret = set_channel(wiphy, dev, &settings->chandef);
        if (ret != 0)
                netdev_err(dev, "Error in setting channel\n");
 
index 3100733f3e231147c277ff109a19ecbacfed7697..5feb93ba04009335a5b160823a2d274af0c5101e 100644 (file)
@@ -4694,6 +4694,7 @@ struct cfg80211_ops {
                                             struct ieee80211_channel *chan);
 
        int     (*set_monitor_channel)(struct wiphy *wiphy,
+                                      struct net_device *dev,
                                       struct cfg80211_chan_def *chandef);
 
        int     (*scan)(struct wiphy *wiphy,
index ecc138869b4b0a7687302bbeb69c2eec67b93214..492349d6f7bb3cb45ef1c0588ba34d4e8dc07f6c 100644 (file)
@@ -897,6 +897,7 @@ static int ieee80211_get_station(struct wiphy *wiphy, struct net_device *dev,
 }
 
 static int ieee80211_set_monitor_channel(struct wiphy *wiphy,
+                                        struct net_device *dev,
                                         struct cfg80211_chan_def *chandef)
 {
        struct ieee80211_local *local = wiphy_priv(wiphy);
index afd86f7c66cefe863cf7e7706480a2fdc0d15410..40b6375a5de44c5fbb6dfb78a7d7407f989be03b 100644 (file)
@@ -1628,6 +1628,7 @@ bool cfg80211_reg_check_beaconing(struct wiphy *wiphy,
 EXPORT_SYMBOL(cfg80211_reg_check_beaconing);
 
 int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
+                                struct net_device *dev,
                                 struct cfg80211_chan_def *chandef)
 {
        if (!rdev->ops->set_monitor_channel)
@@ -1635,7 +1636,7 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
        if (!cfg80211_has_monitors_only(rdev))
                return -EBUSY;
 
-       return rdev_set_monitor_channel(rdev, chandef);
+       return rdev_set_monitor_channel(rdev, dev, chandef);
 }
 
 bool cfg80211_any_usable_channels(struct wiphy *wiphy,
index 3b3e3cd7027ac602f32db6868db9228d0aaea934..4c45f994a8c0c949ea9cf15a8dfa637753f5f75d 100644 (file)
@@ -516,6 +516,7 @@ static inline unsigned int elapsed_jiffies_msecs(unsigned long start)
 }
 
 int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev,
+                                struct net_device *dev,
                                 struct cfg80211_chan_def *chandef);
 
 int ieee80211_get_ratemask(struct ieee80211_supported_band *sband,
index aa78f18dd454cecf0066989f0059fa0ce65a3b4f..84015f56e93a04336bbc4b0c2ad12339ead5201a 100644 (file)
@@ -3567,7 +3567,7 @@ static int __nl80211_set_channel(struct cfg80211_registered_device *rdev,
        case NL80211_IFTYPE_MESH_POINT:
                return cfg80211_set_mesh_channel(rdev, wdev, &chandef);
        case NL80211_IFTYPE_MONITOR:
-               return cfg80211_set_monitor_channel(rdev, &chandef);
+               return cfg80211_set_monitor_channel(rdev, dev, &chandef);
        default:
                break;
        }
index f5adbf6b5c846c1f8e565837abd71033c7b47097..adb6105bbb7d1d0a7a097a120c2a121121bf3f24 100644 (file)
@@ -445,11 +445,12 @@ rdev_libertas_set_mesh_channel(struct cfg80211_registered_device *rdev,
 
 static inline int
 rdev_set_monitor_channel(struct cfg80211_registered_device *rdev,
+                        struct net_device *dev,
                         struct cfg80211_chan_def *chandef)
 {
        int ret;
-       trace_rdev_set_monitor_channel(&rdev->wiphy, chandef);
-       ret = rdev->ops->set_monitor_channel(&rdev->wiphy, chandef);
+       trace_rdev_set_monitor_channel(&rdev->wiphy, dev, chandef);
+       ret = rdev->ops->set_monitor_channel(&rdev->wiphy, dev, chandef);
        trace_rdev_return_int(&rdev->wiphy, ret);
        return ret;
 }
index 97c21b627791a385349b7b689b9127b6a423b530..d5c9bb614fa6de0bf98605b00f61b4e3b9a689a2 100644 (file)
@@ -1318,19 +1318,21 @@ TRACE_EVENT(rdev_libertas_set_mesh_channel,
 );
 
 TRACE_EVENT(rdev_set_monitor_channel,
-       TP_PROTO(struct wiphy *wiphy,
+       TP_PROTO(struct wiphy *wiphy, struct net_device *netdev,
                 struct cfg80211_chan_def *chandef),
-       TP_ARGS(wiphy, chandef),
+       TP_ARGS(wiphy, netdev, chandef),
        TP_STRUCT__entry(
                WIPHY_ENTRY
+               NETDEV_ENTRY
                CHAN_DEF_ENTRY
        ),
        TP_fast_assign(
                WIPHY_ASSIGN;
+               NETDEV_ASSIGN;
                CHAN_DEF_ASSIGN(chandef);
        ),
-       TP_printk(WIPHY_PR_FMT ", " CHAN_DEF_PR_FMT,
-                 WIPHY_PR_ARG, CHAN_DEF_PR_ARG)
+       TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", " CHAN_DEF_PR_FMT,
+                 WIPHY_PR_ARG, NETDEV_PR_ARG, CHAN_DEF_PR_ARG)
 );
 
 TRACE_EVENT(rdev_auth,
index 0c8d3797a02e089d8ddb8b819c9ed795daf631f4..90d5c05926673174ee02a2321ee7d3de3f0be691 100644 (file)
@@ -821,7 +821,7 @@ static int cfg80211_wext_siwfreq(struct net_device *dev,
                        ret = -EINVAL;
                        break;
                }
-               ret = cfg80211_set_monitor_channel(rdev, &chandef);
+               ret = cfg80211_set_monitor_channel(rdev, dev, &chandef);
                break;
        case NL80211_IFTYPE_MESH_POINT:
                freq = cfg80211_wext_freq(wextfreq);