History

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.

Tamizh chelvam committed 6 years ago

Commit 370f51d1 parent 04f7d143 files · +93 −0Browse files

Unified · Split

3 files
  1. include/net/mac80211.h +10 −0
  2. net/mac80211/cfg.c +56 −0
  3. net/mac80211/driver-ops.h +27 −0
include/net/mac80211.h+10−0
@@ -3776,6 +3776,9 @@ enum ieee80211_reconfig_type { · 3775 unmodified lines
3776 *3776 *
3777 * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep)3777 * @start_pmsr: start peer measurement (e.g. FTM) (this call can sleep)
3778 * @abort_pmsr: abort peer measurement (this call can sleep)3778 * @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.
3779 */3782 */
3780struct ieee80211_ops {3783struct ieee80211_ops {
3781 void (*tx)(struct ieee80211_hw *hw,3784 void (*tx)(struct ieee80211_hw *hw,
@@ -4080,6 +4083,13 @@ struct ieee80211_ops { · 298 unmodified lines
4080 struct cfg80211_pmsr_request *request);4083 struct cfg80211_pmsr_request *request);
4081 void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,4084 void (*abort_pmsr)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
4082 struct cfg80211_pmsr_request *request);4085 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);
4083};4093};
4084 4094
4085/**4095/**
net/mac80211/cfg.c+56−0
@@ -3886,6 +3886,60 @@ ieee80211_abort_pmsr(struct wiphy *wiphy, struct wireless_dev *dev, · 3885 unmodified lines
3886 return drv_abort_pmsr(local, sdata, request);3886 return drv_abort_pmsr(local, sdata, request);
3887}3887}
3888 3888
3889static 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
3916static 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
3889const struct cfg80211_ops mac80211_config_ops = {3943const struct cfg80211_ops mac80211_config_ops = {
3890 .add_virtual_intf = ieee80211_add_iface,3944 .add_virtual_intf = ieee80211_add_iface,
3891 .del_virtual_intf = ieee80211_del_iface,3945 .del_virtual_intf = ieee80211_del_iface,
@@ -3986,4 +4040,6 @@ const struct cfg80211_ops mac80211_config_ops = { · 94 unmodified lines
3986 .start_pmsr = ieee80211_start_pmsr,4040 .start_pmsr = ieee80211_start_pmsr,
3987 .abort_pmsr = ieee80211_abort_pmsr,4041 .abort_pmsr = ieee80211_abort_pmsr,
3988 .probe_mesh_link = ieee80211_probe_mesh_link,4042 .probe_mesh_link = ieee80211_probe_mesh_link,
4043 .set_tid_config = ieee80211_set_tid_config,
4044 .reset_tid_config = ieee80211_reset_tid_config,
3989};4045};
net/mac80211/driver-ops.h+27−0
@@ -1358,4 +1358,31 @@ static inline void drv_del_nan_func(struct ieee80211_local *local, · 1357 unmodified lines
1358 trace_drv_return_void(local);1358 trace_drv_return_void(local);
1359}1359}
1360 1360
1361static 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
1376static 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}
1361#endif /* __MAC80211_DRIVER_OPS */1388#endif /* __MAC80211_DRIVER_OPS */