summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.h
Commit message (Collapse)AuthorAgeFilesLines
* mac80211_hwsim: allow configurable cipher typesJames Prestwood2018-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | | | The mac80211_hwsim driver does not specify supported cipher types, which in turn enables all ciphers to be supported in software. (see net/mac80211/main.c:ieee80211_init_cipher_suites). Allowing ciphers to be configurable is valuable for simulating older drivers that may not support all ciphers. This patch adds a new attribute: - HWSIM_ATTR_CIPHER_SUPPORT A u32 array/list of supported cipher types This only allows enabling/disabling cipher types listed in the (new) "hwsim_ciphers" array in mac80211_hwsim.c. Any unknown cipher type will result in -EINVAL. Signed-off-by: James Prestwood <james.prestwood@linux.intel.com> [fix some indentation, change to hwsim_known_ciphers(), add error messages, validate length better] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: allow setting iftype supportJames Prestwood2018-11-091-0/+2
| | | | | | | | | | | | | | | | | | | | | 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>
* mac80211_hwsim: add permanent mac address option for new radiosBenjamin Beichler2018-01-311-1/+8
| | | | | | | | | | | | | | | | | | If simulation needs predictable permanent mac addresses of hwsim wireless phy, this patch add the ability to create a new radio with a user defined permanent mac address. Allowed mac addresses needs to be locally administrated mac addresses (as also the former fixed 42:* and 02:* were). To do not break the operation with legacy software using hwsim, the new address is set twice. The problem here is, the netlink call backs use wiphy->addresses[1] as identification of a radio and not the proposed permanent address (wiphy->addresses[0]). This design decision is not documented in the kernel repo, therefore this patch simply reproduces this, but with the same address. Signed-off-by: Benjamin Beichler <benjamin.beichler@uni-rostock.de> [make pointer const] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: add hwsim_tx_rate_flags to netlink attributesBenjamin Beichler2018-01-151-1/+67
| | | | | | | | | | | For correct interpretation of a tx rate, the corresponding rate flags are needed (e.g. whether a HT-MCS rate or a legacy rate) and moreover for more correct simulation the other infos of the flags are important (like short-GI). Keeping compatibility, the flags are not integrated into the existing hwsim_tx_rate, but transmitted as an additional netlink attribute. Signed-off-by: Benjamin Beichler <benjamin.beichler@uni-rostock.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: fix command documentation indentationJohannes Berg2017-03-061-2/+2
| | | | Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* drivers/wireless: use nla_put_u64_64bit()Nicolas Dichtel2016-04-261-0/+1
| | | | | Signed-off-by: Nicolas Dichtel <nicolas.dichtel@6wind.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* mac80211-hwsim: Add HWSIM_CMD_GET_RADIO commandPatrik Flykt2014-11-191-0/+3
| | | | | | | | | | | | | | HWSIM_CMD_GET_RADIO returns information about a specific radio id or all of them in response to a dump. Create the netlink skb or use the one provided by the dump functionality. Use the existing attribute appending function to fill in the same attributes when creating a new hwsim radio. Save alpha2 and struct ieee80211_regdomain in the hwsim data or else they will be lost in the depths of regulatory infrastructure. Signed-off-by: Patrik Flykt <patrik.flykt@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211-hwsim: add frequency attribute to netlink pktsBen Greear2014-10-291-1/+3
| | | | | | | | | Add frequency attribute when sending to user-space over netlink socket. The frequency is currently ignored when receiving from user-space. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211-hwsim: Rename CREATE and DESTROY radio to NEW and DEL radioJukka Rissanen2014-10-291-5/+9
| | | | | | | | Using the name HWSIM_CMD_NEW_RADIO and HWSIM_CMD_DEL_RADIO is more fitting on how other pieces of the wireless system work. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211-hwsim: support creating wiphy w/out creating wlanXBen Greear2014-10-271-0/+2
| | | | | | | | Good for automated testing, where user can create wlan interfaces with specified names. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211-hwsim: support destroying radio by nameBen Greear2014-10-241-0/+2
| | | | | | | | | It is not always convenient to have to know the device-id, so allow deleting by name as well. Signed-off-by: Ben Greear <greearb@candelatech.com> [use wiphy_name() instead of dev_name()] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211-hwsim: Add support for HWSIM_ATTR_DESTROY_RADIO_ON_CLOSEJukka Rissanen2014-10-091-0/+3
| | | | | | | | | | | Add support for new attribute HWSIM_ATTR_DESTROY_RADIO_ON_CLOSE which can be set by the user space component. The attribute will cause the kernel to destroy all those radios that were created by a process if that process dies. The old behaviour i.e., radios are persistent is still the default. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: allow creation of single-channel radios with chanctxLuciano Coelho2014-02-111-0/+4
| | | | | | | | | | | Add a new HWSIM_ATTR_USE_CHANCTX attribute to the HWSIM_CMD_CREATE_RADIO command to allow the creation of radios with one channel that use channel contexts. If this attribute is not present, the behaviour is the same as before (ie. single channel radios don't use channel contexts and multi channel radios do). Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: make P2P-Device support optionalJohannes Berg2014-02-041-0/+2
| | | | | | | | | | When creating new devices, allow P2P-Device support to be turned off to be able to test default behaviour with and without the support. Also add a module parameter for the default setting. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: restore regulatory testing functionalityJohannes Berg2014-01-101-0/+7
| | | | | | | | Restore the original regulatory testing functionality and also make it more flexible by allowing the parameters to be specified when creating a dynamic radio. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: allow creating/destroying radios on the flyJohannes Berg2014-01-101-0/+11
| | | | | | | | | | | | | | | | Add new commands to the hwsim generic netlink family to allow creating and destroying radios on the fly. The number of channels a radio supports can be specified when it's created, if it isn't the module parameter will be used as default. This should be extended in the future to allow other parameters to be specified, e.g. * list of channels * interface combinations, particularly P2P_DEVICE support * regtest * and pretty much all other hardware capabilities Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim driver support userspace frame tx/rxJavier Lopez2011-06-011-0/+133
This patch adds to mac80211_hwsim the capability to send traffic via userspace. Frame exchange between kernel and user spaces is done through generic netlink communication protocol. A new generic netlink family MAC80211_HWSIM is proposed, this family contains three basic commands HWSIM_CMD_REGISTER, which is the command used to register a new traffic listener, HWSIM_CMD_FRAME, to exchange the frames from kernel to user and vice-versa, and HWSIM_CMD_TX_INFO_FRAME which returns from user all the information about retransmissions, rates, rx signal, and so on. How it works: Once the driver is loaded the MAC80211_HWSIM family will be registered. In the absence of userspace daemon, the driver itselfs implements a perfect wireless medium as it did in the past. When a daemon sends a HWSIM_CMD_REGISTER command, the module stores the application PID, and from this moment all frames will be sent to the registered daemon. The user space application will be in charge of process/forward all frames broadcast by any mac80211_hwsim radio. If the user application is stopped, the kernel module will detect the release of the socket and it will switch back to in-kernel perfect channel simulation. The userspace daemon must be waiting for incoming HWSIM_CMD_FRAME commands sent from kernel, for each HWSIM_CMD_FRAME command the application will try to broadcast this frame to all mac80211_hwsim radios, however the application may decide to forward/drop this frame. In the case of forwarding the frame, a new HWSIM_CMD_FRAME command will be created, all necessary attributes will be populated and the frame will be sent back to the kernel. Also after the frame broadcast phase, a HWSIM_CMD_TX_INFO_FRAME command will be sent from userspace to kernel, this command contains all the information regarding the transmission, such as number of tries, rates, ack signal, etc. You can find the actual implementation of wireless mediumd daemon (wmediumd) at: * Last version tarball: https://github.com/jlopex/cozybit/tarball/master * Or visiting my github tree: https://github.com/jlopex/cozybit/tree Signed-off-by: Javier Lopez <jlopex@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>