]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Allow old r-o-c offchannel TX to be tested
authorJouni Malinen <j@w1.fi>
Sat, 1 Mar 2014 20:24:55 +0000 (22:24 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 2 Mar 2014 08:35:34 +0000 (10:35 +0200)
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 <j@w1.fi>
src/drivers/driver_nl80211.c

index 42578b61ea339bcf26f0a6d5db542e05dfa39235..c5091705c409e75fa219687a0fe6046be879a5ae 100644 (file)
@@ -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;
 }