summaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorShaul Triebitz <shaul.triebitz@intel.com>2022-08-02 14:22:42 +0200
committerJohannes Berg <johannes.berg@intel.com>2022-08-25 10:40:57 +0200
commitc88f1542ee72872a276115c868f580a391f04a7b (patch)
tree13f55bd55a295b4739e215dd5e2a5e7b612223d8 /net/mac80211
parentwifi: cfg80211: add link id to txq params (diff)
downloadlinux-c88f1542ee72872a276115c868f580a391f04a7b.tar.xz
linux-c88f1542ee72872a276115c868f580a391f04a7b.zip
wifi: mac80211: use link in TXQ parameter configuration
Configure the correct link per the passed parameters. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/cfg.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 167acf843d75..d97e13b5c3a8 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -23,6 +23,24 @@
#include "mesh.h"
#include "wme.h"
+static struct ieee80211_link_data *
+ieee80211_link_or_deflink(struct ieee80211_sub_if_data *sdata, int link_id)
+{
+ struct ieee80211_link_data *link;
+
+ if (link_id < 0) {
+ if (sdata->vif.valid_links)
+ return ERR_PTR(-EINVAL);
+
+ return &sdata->deflink;
+ }
+
+ link = sdata_dereference(sdata->link[link_id], sdata);
+ if (!link)
+ return ERR_PTR(-ENOLINK);
+ return link;
+}
+
static void ieee80211_set_mu_mimo_follow(struct ieee80211_sub_if_data *sdata,
struct vif_params *params)
{
@@ -2568,7 +2586,8 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
{
struct ieee80211_local *local = wiphy_priv(wiphy);
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
- struct ieee80211_link_data *link = &sdata->deflink;
+ struct ieee80211_link_data *link =
+ ieee80211_link_or_deflink(sdata, params->link_id);
struct ieee80211_tx_queue_params p;
if (!local->ops->conf_tx)
@@ -2577,6 +2596,9 @@ static int ieee80211_set_txq_params(struct wiphy *wiphy,
if (local->hw.queues < IEEE80211_NUM_ACS)
return -EOPNOTSUPP;
+ if (IS_ERR(link))
+ return PTR_ERR(link);
+
memset(&p, 0, sizeof(p));
p.aifs = params->aifs;
p.cw_max = params->cwmax;