Skip to content

Commit 370f51d

Browse files
Tamizh chelvamjmberg-intel
authored andcommitted
mac80211: Add api to support configuring TID specific configuration
Implement drv_set_tid_config api to allow TID specific configuration and drv_reset_tid_config api to reset peer specific TID configuration. This per-TID onfiguration will be applied for all the connected stations when MAC is NULL. Signed-off-by: Tamizh chelvam <tamizhr@codeaurora.org> Link: https://lore.kernel.org/r/1579506687-18296-7-git-send-email-tamizhr@codeaurora.org Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent 04f7d14 commit 370f51d

3 files changed

Lines changed: 93 additions & 0 deletions

File tree

‎include/net/mac80211.h‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3776,6 +3776,9 @@ enum ieee80211_reconfig_type {
37763776
*
37773777
* @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep)
37783778
* @abort_pmsr: abort peer measurement (this call can sleep)
3779+
* @set_tid_config: Apply TID specific configurations. This callback may sleep.
3780+
* @reset_tid_config: Reset TID specific configuration for the peer.
3781+
* This callback may sleep.
37793782
*/
37803783
struct ieee80211_ops {
37813784
void (*tx)(struct ieee80211_hw *hw,
@@ -4080,6 +4083,13 @@ struct ieee80211_ops {
40804083
struct cfg80211_pmsr_request *request);
40814084
void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
40824085
struct cfg80211_pmsr_request *request);
4086+
int (*set_tid_config)(struct ieee80211_hw *hw,
4087+
struct ieee80211_vif *vif,
4088+
struct ieee80211_sta *sta,
4089+
struct cfg80211_tid_config *tid_conf);
4090+
int (*reset_tid_config)(struct ieee80211_hw *hw,
4091+
struct ieee80211_vif *vif,
4092+
struct ieee80211_sta *sta, u8 tids);
40834093
};
40844094

40854095
/**

‎net/mac80211/cfg.c‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3886,6 +3886,60 @@ ieee80211_abort_pmsr(struct wiphy *wiphy, struct wireless_dev *dev,
38863886
return drv_abort_pmsr(local, sdata, request);
38873887
}
38883888

3889+
static int ieee80211_set_tid_config(struct wiphy *wiphy,
3890+
struct net_device *dev,
3891+
struct cfg80211_tid_config *tid_conf)
3892+
{
3893+
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
3894+
struct sta_info *sta;
3895+
int ret;
3896+
3897+
if (!sdata->local->ops->set_tid_config)
3898+
return -EOPNOTSUPP;
3899+
3900+
if (!tid_conf->peer)
3901+
return drv_set_tid_config(sdata->local, sdata, NULL, tid_conf);
3902+
3903+
mutex_lock(&sdata->local->sta_mtx);
3904+
sta = sta_info_get_bss(sdata, tid_conf->peer);
3905+
if (!sta) {
3906+
mutex_unlock(&sdata->local->sta_mtx);
3907+
return -ENOENT;
3908+
}
3909+
3910+
ret = drv_set_tid_config(sdata->local, sdata, &sta->sta, tid_conf);
3911+
mutex_unlock(&sdata->local->sta_mtx);
3912+
3913+
return ret;
3914+
}
3915+
3916+
static int ieee80211_reset_tid_config(struct wiphy *wiphy,
3917+
struct net_device *dev,
3918+
const u8 *peer, u8 tid)
3919+
{
3920+
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
3921+
struct sta_info *sta;
3922+
int ret;
3923+
3924+
if (!sdata->local->ops->reset_tid_config)
3925+
return -EOPNOTSUPP;
3926+
3927+
if (!peer)
3928+
return drv_reset_tid_config(sdata->local, sdata, NULL, tid);
3929+
3930+
mutex_lock(&sdata->local->sta_mtx);
3931+
sta = sta_info_get_bss(sdata, peer);
3932+
if (!sta) {
3933+
mutex_unlock(&sdata->local->sta_mtx);
3934+
return -ENOENT;
3935+
}
3936+
3937+
ret = drv_reset_tid_config(sdata->local, sdata, &sta->sta, tid);
3938+
mutex_unlock(&sdata->local->sta_mtx);
3939+
3940+
return ret;
3941+
}
3942+
38893943
const struct cfg80211_ops mac80211_config_ops = {
38903944
.add_virtual_intf = ieee80211_add_iface,
38913945
.del_virtual_intf = ieee80211_del_iface,
@@ -3986,4 +4040,6 @@ const struct cfg80211_ops mac80211_config_ops = {
39864040
.start_pmsr = ieee80211_start_pmsr,
39874041
.abort_pmsr = ieee80211_abort_pmsr,
39884042
.probe_mesh_link = ieee80211_probe_mesh_link,
4043+
.set_tid_config = ieee80211_set_tid_config,
4044+
.reset_tid_config = ieee80211_reset_tid_config,
39894045
};

‎net/mac80211/driver-ops.h‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1358,4 +1358,31 @@ static inline void drv_del_nan_func(struct ieee80211_local *local,
13581358
trace_drv_return_void(local);
13591359
}
13601360

1361+
static inline int drv_set_tid_config(struct ieee80211_local *local,
1362+
struct ieee80211_sub_if_data *sdata,
1363+
struct ieee80211_sta *sta,
1364+
struct cfg80211_tid_config *tid_conf)
1365+
{
1366+
int ret;
1367+
1368+
might_sleep();
1369+
ret = local->ops->set_tid_config(&local->hw, &sdata->vif, sta,
1370+
tid_conf);
1371+
trace_drv_return_int(local, ret);
1372+
1373+
return ret;
1374+
}
1375+
1376+
static inline int drv_reset_tid_config(struct ieee80211_local *local,
1377+
struct ieee80211_sub_if_data *sdata,
1378+
struct ieee80211_sta *sta, u8 tid)
1379+
{
1380+
int ret;
1381+
1382+
might_sleep();
1383+
ret = local->ops->reset_tid_config(&local->hw, &sdata->vif, sta, tid);
1384+
trace_drv_return_int(local, ret);
1385+
1386+
return ret;
1387+
}
13611388
#endif /* __MAC80211_DRIVER_OPS */

0 commit comments

Comments
 (0)