OSDN Git Service

mac80211_hwsim: allow setting iftype support
authorJames Prestwood <james.prestwood@linux.intel.com>
Wed, 17 Oct 2018 19:33:06 +0000 (12:33 -0700)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 9 Nov 2018 10:33:40 +0000 (11:33 +0100)
commit99e3a44bac37ff033af711ec2ee8e48b6fabcad3
tree4d728067b4f3e6aa780e849f9b442b07d90e2a69
parent2f98abb17dd57b9c3ebdf6741ae2726ed360d902
mac80211_hwsim: allow setting iftype support

The mac80211_hwsim driver hard codes its supported interface types. For
testing purposes it would be valuable to allow changing these supported
types in order to simulate actual drivers than support a limited set of
iftypes. A new attribute was added to allow this:

- HWSIM_ATTR_IFTYPE_SUPPORT
A u32 bit field of supported NL80211_IFTYPE_* bits

This will only enable/disable iftypes that mac80211_hwsim already
supports.

In order to accomplish this, the ieee80211_iface_limit structure needed
to be built dynamically to only include limit rules for iftypes that
the user requested to enable.

Signed-off-by: James Prestwood <james.prestwood@linux.intel.com>
[fix some indentation, add netlink error string]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/mac80211_hwsim.h