2017-09-19 11:56:33

by Ramon Fontes

[permalink] [raw]
Subject: [PATCH] mac80211_hwsim: enabling WDS

Hi,

I'm developing an wireless emulator
(https://github.com/intrig-unicamp/mininet-wifi) which relies on
mac80211_hwsim for loading virtual wireless interfaces. In order to
get access points wirelessly connected I was think to enable WDS (in
addition to the well known mesh mode).

Then, I went through mac80211_hwsim and I noticed that I could make it
work with BIT(NL80211_IFTYPE_WDS) in mac80211_hwsim. That said, I
thought to submit this patch.

ps. I'm not an expert in Linux Kernel and I don't know if something
else have to be done. It just worked applying this patch.

---
drivers/net/wireless/mac80211_hwsim.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/mac80211_hwsim.c
b/drivers/net/wireless/mac80211_hwsim.c
index 6467ffac9811e..1f8229e545190 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -453,6 +453,7 @@ static const struct ieee80211_iface_limit
hwsim_if_limits[] = {
BIT(NL80211_IFTYPE_MESH_POINT) |
#endif
BIT(NL80211_IFTYPE_AP) |
+ BIT(NL80211_IFTYPE_WDS) |
BIT(NL80211_IFTYPE_P2P_GO) },
/* must be last, see hwsim_if_comb */
{ .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) }
@@ -2562,6 +2563,7 @@ static int mac80211_hwsim_new_radio(struct
genl_info *info,
hw->offchannel_tx_hw_queue = 4;
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_AP) |
+ BIT(NL80211_IFTYPE_WDS) |
BIT(NL80211_IFTYPE_P2P_CLIENT) |
BIT(NL80211_IFTYPE_P2P_GO) |
BIT(NL80211_IFTYPE_ADHOC) |


2017-09-19 15:58:45

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211_hwsim: enabling WDS

Hi,

> I'm developing an wireless emulator
> (https://github.com/intrig-unicamp/mininet-wifi) which relies on
> mac80211_hwsim for loading virtual wireless interfaces. In order to
> get access points wirelessly connected I was think to enable WDS (in
> addition to the well known mesh mode).

Why would you want to have WDS? IMHO if you really want to do it over
wifi it makes more sense to use 4-addr AP/client. That at least gives
you a reasonable configuration one might use in the real world - WDS
can't negotiate HT/VHT for example, making it pretty much useless these
days.

> Then, I went through mac80211_hwsim and I noticed that I could make
> it work with BIT(NL80211_IFTYPE_WDS) in mac80211_hwsim. That said, I
> thought to submit this patch.
>
> ps. I'm not an expert in Linux Kernel and I don't know if something
> else have to be done. It just worked applying this patch.

It may work in hwsim, but I don't really want to encourage such usage.

I'd even argue that we should just remove support for this from the
kernel entirely, but that will probably not happen.

johannes