From 64abb725baad08277f85d25e4c98211cba6fb9a6 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 1 Mar 2014 22:24:55 +0200 Subject: [PATCH] nl80211: Allow old r-o-c offchannel TX to be tested no_offchannel_tx=1 driver parameter can now be used to force the older remain-on-channel -based offchannel TX design to be used with mac80211_hwsim. This can be used to increase test coverage with the hwsim test cases. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 42578b61e..c5091705c 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -301,6 +301,7 @@ struct wpa_driver_nl80211_data { unsigned int hostapd:1; unsigned int start_mode_ap:1; unsigned int start_iface_up:1; + unsigned int test_use_roc_tx:1; u64 remain_on_chan_cookie; u64 send_action_cookie; @@ -9926,7 +9927,8 @@ static int nl80211_send_frame_cmd(struct i802_bss *bss, NLA_PUT_U32(msg, NL80211_ATTR_WIPHY_FREQ, freq); if (wait) NLA_PUT_U32(msg, NL80211_ATTR_DURATION, wait); - if (offchanok && (drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX)) + if (offchanok && ((drv->capa.flags & WPA_DRIVER_FLAGS_OFFCHANNEL_TX) || + drv->test_use_roc_tx)) NLA_PUT_FLAG(msg, NL80211_ATTR_OFFCHANNEL_TX_OK); if (no_cck) NLA_PUT_FLAG(msg, NL80211_ATTR_TX_NO_CCK_RATE); @@ -10510,6 +10512,13 @@ static int nl80211_set_param(void *priv, const char *param) drv->capa.flags &= ~WPA_DRIVER_FLAGS_SME; } + if (os_strstr(param, "no_offchannel_tx=1")) { + struct i802_bss *bss = priv; + struct wpa_driver_nl80211_data *drv = bss->drv; + drv->capa.flags &= ~WPA_DRIVER_FLAGS_OFFCHANNEL_TX; + drv->test_use_roc_tx = 1; + } + return 0; }