wifi: nl80211: allow link ID in set_wiphy with frequency
authorIlan Peer <ilan.peer@intel.com>
Sun, 12 Jun 2022 13:49:45 +0000 (16:49 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 15 Jul 2022 09:43:20 +0000 (11:43 +0200)
This simplifies hostapd implementation, since it didn't
switch to NL80211_CMD_SET_CHANNEL.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 53d63effbca9fe8f6e6a68c481904571c3385b3b..0bf1f7267b89d9d52908263e30694ad6ed17db72 100644 (file)
@@ -3475,16 +3475,19 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
        }
 
        if (info->attrs[NL80211_ATTR_WIPHY_FREQ]) {
+               int link_id = nl80211_link_id_or_invalid(info->attrs);
+
                if (wdev) {
                        wdev_lock(wdev);
                        result = __nl80211_set_channel(
                                rdev,
                                nl80211_can_set_dev_channel(wdev) ? netdev : NULL,
-                               info, -1);
+                               info, link_id);
                        wdev_unlock(wdev);
                } else {
-                       result = __nl80211_set_channel(rdev, netdev, info, -1);
+                       result = __nl80211_set_channel(rdev, netdev, info, link_id);
                }
+
                if (result)
                        goto out;
        }