UPSTREAM: wifi: nl80211: allow link ID in set_wiphy with frequency

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>

Bug: 253289327
Change-Id: I8ff64675ac7eeb5474333d544bbf31844843e650
(cherry picked from commit 69c3f2d30c357613f9059809bc95170301056aee)
Signed-off-by: Kiran Kumar Lokere <quic_klokere@quicinc.com>
Signed-off-by: Veerendranath Jakkam <quic_vjakkam@quicinc.com>
This commit is contained in:
Ilan Peer
2022-06-12 16:49:45 +03:00
committed by Todd Kjos
parent eed91854a5
commit 8f37e21b18

View File

@@ -3456,16 +3456,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;
}