aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 7ede2407ef8d..b878a32e7a98 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -53,6 +53,10 @@ static bool paged_rx = false;
53module_param(paged_rx, bool, 0644); 53module_param(paged_rx, bool, 0644);
54MODULE_PARM_DESC(paged_rx, "Use paged SKBs for RX instead of linear ones"); 54MODULE_PARM_DESC(paged_rx, "Use paged SKBs for RX instead of linear ones");
55 55
56static bool rctbl = false;
57module_param(rctbl, bool, 0444);
58MODULE_PARM_DESC(rctbl, "Handle rate control table");
59
56/** 60/**
57 * enum hwsim_regtest - the type of regulatory tests we offer 61 * enum hwsim_regtest - the type of regulatory tests we offer
58 * 62 *
@@ -895,8 +899,12 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
895 if (control->sta) 899 if (control->sta)
896 hwsim_check_sta_magic(control->sta); 900 hwsim_check_sta_magic(control->sta);
897 901
898 txi->rate_driver_data[0] = channel; 902 if (rctbl)
903 ieee80211_get_tx_rates(txi->control.vif, control->sta, skb,
904 txi->control.rates,
905 ARRAY_SIZE(txi->control.rates));
899 906
907 txi->rate_driver_data[0] = channel;
900 mac80211_hwsim_monitor_rx(hw, skb, channel); 908 mac80211_hwsim_monitor_rx(hw, skb, channel);
901 909
902 /* wmediumd mode check */ 910 /* wmediumd mode check */
@@ -998,6 +1006,13 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
998{ 1006{
999 u32 _pid = ACCESS_ONCE(wmediumd_portid); 1007 u32 _pid = ACCESS_ONCE(wmediumd_portid);
1000 1008
1009 if (rctbl) {
1010 struct ieee80211_tx_info *txi = IEEE80211_SKB_CB(skb);
1011 ieee80211_get_tx_rates(txi->control.vif, NULL, skb,
1012 txi->control.rates,
1013 ARRAY_SIZE(txi->control.rates));
1014 }
1015
1001 mac80211_hwsim_monitor_rx(hw, skb, chan); 1016 mac80211_hwsim_monitor_rx(hw, skb, chan);
1002 1017
1003 if (_pid) 1018 if (_pid)
@@ -1028,6 +1043,11 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
1028 if (skb == NULL) 1043 if (skb == NULL)
1029 return; 1044 return;
1030 info = IEEE80211_SKB_CB(skb); 1045 info = IEEE80211_SKB_CB(skb);
1046 if (rctbl)
1047 ieee80211_get_tx_rates(vif, NULL, skb,
1048 info->control.rates,
1049 ARRAY_SIZE(info->control.rates));
1050
1031 txrate = ieee80211_get_tx_rate(hw, info); 1051 txrate = ieee80211_get_tx_rate(hw, info);
1032 1052
1033 mgmt = (struct ieee80211_mgmt *) skb->data; 1053 mgmt = (struct ieee80211_mgmt *) skb->data;
@@ -2285,6 +2305,8 @@ static int __init init_mac80211_hwsim(void)
2285 IEEE80211_HW_AMPDU_AGGREGATION | 2305 IEEE80211_HW_AMPDU_AGGREGATION |
2286 IEEE80211_HW_WANT_MONITOR_VIF | 2306 IEEE80211_HW_WANT_MONITOR_VIF |
2287 IEEE80211_HW_QUEUE_CONTROL; 2307 IEEE80211_HW_QUEUE_CONTROL;
2308 if (rctbl)
2309 hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE;
2288 2310
2289 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS | 2311 hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
2290 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL; 2312 WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;