summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
Commit message (Collapse)AuthorAgeFilesLines
* mac80211: remove probe response temporary buffer allocationJohannes Berg2012-11-301-1/+6
| | | | | | | Instead of allocating a temporary buffer to build IEs build them right into the SKB. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: remove printing scan configJohannes Berg2012-11-261-6/+0
| | | | | | | | The frequencies will be printed when actually doing the scan, and the IEs can be captured on the hwsim0 monitor. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: advertise VHT supportJohannes Berg2012-11-261-0/+28
| | | | | | | | If the number of channels is > 1, which means that hwsim will use mac80211 channel contexts, it can also advertise VHT support. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: convert to channel definition structJohannes Berg2012-11-261-14/+19
| | | | | | | | | | | | | | Convert mac80211 (and where necessary, some drivers a little bit) to the new channel definition struct. This will allow extending mac80211 for VHT, which is currently restricted to channel contexts since there are no drivers using that which makes it easier. As I also don't care about VHT for drivers not using the channel context API, I won't convert the previous API to VHT support. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: remove remain-on-channel channel typeJohannes Berg2012-11-261-1/+0
| | | | | | | | | | | | | | | | | As mwifiex (and mac80211 in the software case) are the only drivers actually implementing remain-on-channel with channel type, userspace can't be relying on it. This is the case, as it's used only for P2P operations right now. Rather than adding a flag to tell userspace whether or not it can actually rely on it, simplify all the code by removing the ability to use different channel types. Leave only the validation of the attribute, so that if we extend it again later (with the needed capability flag), it can't break userspace sending invalid data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: make remain_on_channel() op pass vif paramEliad Peller2012-11-191-0/+1
| | | | | | | | | | | | | Drivers (e.g. wl12xx) might need to know the vif to roc on (mainly in order to configure the rx filters correctly). Add the vif to the op params, and update the current users (iwlwifi) to use the new api. Signed-off-by: Eliad Peller <eliad@wizery.com> [fix hwsim] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: support radiotap vendor namespace RX dataJohannes Berg2012-11-191-1/+32
| | | | | | | | | | | | | | | | In some cases, in particular for experimentation, it can be useful to be able to add vendor namespace data to received frames in addition to the normal radiotap data. Allow doing this through mac80211 by adding fields to the RX status descriptor that describe the data while the data itself is prepended to the frame. Also add some example code to hwsim, but don't enable it because it doesn't use a proper OUI identifier. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: support RX_FLAG_MACTIME_ENDThomas Pedersen2012-11-131-1/+1
| | | | | | | | | | | Allow drivers to indicate their mactime is at RX completion and adjust for this in mac80211. Also rename the existing RX_FLAG_MACTIME_MPDU to RX_FLAG_MACTIME_START to clarify its intent. Based on similar code by Johannes Berg. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> [fix docs, atheros drivers] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211: clarify interface iteration and make it configurableJohannes Berg2012-11-091-3/+8
| | | | | | | | | | | | | | | | During hardware restart, all interfaces are iterated even though they haven't been re-added to the driver, document this behaviour. The same also happens during resume, which is even more confusing since all of the interfaces were previously removed from the driver. Make this optional so drivers relying on the current behaviour can still use it, but to let drivers that don't want this behaviour disable it. Also convert all API users, keeping the old semantics except in hwsim, where the new normal ones are desired. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: print per interface TX powerJohannes Berg2012-10-301-0/+3
| | | | | | | Just for debugging, print the interface TX power whenever it changes. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* mac80211_hwsim: allow using channel contextsJohannes Berg2012-10-301-100/+390
| | | | | | | | | | | | | | | | | | | | To use mac80211_hwsim for testing channel contexts it has to support them, and for that it has to support hw scan and hw-remain-on-channel. Since it's pure software, the off-channel activities are really not off-channel but listening and sending on a second channel. Also, the multi-channel isn't really doing TDM, it's just on both channels at the same time. For testing purposes, you can specify the number of concurrent channels with a module parameter, it is set to one by default. When set to two or more, the userspace API for wmediumd is disabled as it has no provisions for multi-channel yet. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge branch 'master' of ↵John W. Linville2012-09-281-4/+1
|\ | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: net/nfc/netlink.c Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mac80211_hwsim: move module_init/exitJohannes Berg2012-09-061-4/+1
| | | | | | | | | | | | | | These should be with the functions so move the module_init/exit statements. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * Merge remote-tracking branch 'mac80211/master' into mac80211-nextJohannes Berg2012-09-061-5/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull in mac80211.git to let the next patch apply without conflicts, also resolving a hwsim conflict. Conflicts: drivers/net/wireless/mac80211_hwsim.c Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | | netlink: Rename pid to portid to avoid confusionEric W. Biederman2012-09-101-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is a frequent mistake to confuse the netlink port identifier with a process identifier. Try to reduce this confusion by renaming fields that hold port identifiers portid instead of pid. I have carefully avoided changing the structures exported to userspace to avoid changing the userspace API. I have successfully built an allyesconfig kernel with this change. Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com> Acked-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | | Merge branch 'for-john' of ↵John W. Linville2012-08-211-2/+6
|\ \ \ | |/ / | | / | |/ |/| | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: drivers/net/wireless/mac80211_hwsim.c
| * mac80211_hwsim: add support for P2P DeviceJohannes Berg2012-08-201-1/+3
| | | | | | | | | | | | | | Advertise support for P2P Device in hwsim to be able to test it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211: move TX station pointer and restructure TXThomas Huehn2012-07-311-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove the control.sta pointer from ieee80211_tx_info to free up sufficient space in the TX skb control buffer for the upcoming Transmit Power Control (TPC). Instead, the pointer is now on the stack in a new control struct that is passed as a function parameter to the drivers' tx method. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: Felix Fietkau <nbd@openwrt.org> [reworded commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | mac80211_hwsim: fix possible race condition in usage of info->control.sta & ↵Thomas Huehn2012-07-261-5/+0
|/ | | | | | | | | | control.vif info->control.sta and control.vif may only be dereferenced during the drv_tx call otherwise could lead to use-after-free bugs. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2012-07-201-5/+0
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
| * mac80211_hwsim: fix race condition with sta/vif pointersThomas Huehn2012-07-171-5/+0
| | | | | | | | | | | | | | | | | | | | info->control.sta and control.vif may only be dereferenced during the drv_tx call otherwise could lead to use-after-free bugs. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> [reword commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | Merge branch 'master' of ↵John W. Linville2012-07-121-2/+10
|\ \ | |/ | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
| * mac80211_hwsim: add testmode code to stop/wake queuesJohannes Berg2012-07-061-0/+8
| | | | | | | | | | | | | | This was useful for debugging the queue stop/wake issues and is pretty small so let's just put it in. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
| * mac80211_hwsim: fix NUM_BANDS usageJohannes Berg2012-07-031-2/+2
| | | | | | | | | | | | | | | | | | Due to the recent change of NUM_BANDS from 2 to 3 hwsim broke. Fix the code by using the right constant but don't support bands other than 2.4 and 5 GHz. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | Merge branch 'master' of ↵John W. Linville2012-06-291-6/+4
|\ \ | |/ | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
| * Merge branch 'for-john' of git://git.sipsolutions.net/mac80211-nextJohn W. Linville2012-06-261-6/+4
| |\
| | * mac80211_hwsim: fix smatch/sparse complaintsJohannes Berg2012-06-251-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code is fine in both cases as-is, but we can write it slightly differently to fix smatch/sparse complaints: * compare the skb pointer (which we use as a cookie) by casting the skb to unsigned long rather than the cookie to a pointer (fixes "different address spaces") * when transmitting, data->channel must be assigned, don't check it (fixes "dereferenced before check") Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | | net: Use NLMSG_DEFAULT_SIZE in combination with nlmsg_new()Thomas Graf2012-06-281-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using NLMSG_GOODSIZE results in multiple pages being used as nlmsg_new() will automatically add the size of the netlink header to the payload thus exceeding the page limit. NLMSG_DEFAULT_SIZE takes this into account. Signed-off-by: Thomas Graf <tgraf@suug.ch> Cc: Jiri Pirko <jpirko@redhat.com> Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com> Cc: Sergey Lapin <slapin@ossfans.org> Cc: Johannes Berg <johannes@sipsolutions.net> Cc: Lauro Ramos Venancio <lauro.venancio@openbossa.org> Cc: Aloisio Almeida Jr <aloisio.almeida@openbossa.org> Cc: Samuel Ortiz <sameo@linux.intel.com> Reviewed-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | mac80211_hwsim: Set IEEE80211_STAT_ACK flag when userspace indicates that ↵Qasim Javed2012-06-081-0/+1
|/ | | | | | | | | | | | | the frame has been acknowledged. The station fail average is not updated correctly since the IEEE80211_STAT_ACK flag is not set when using wmediumd with mac80211_hwsim. Set this flag when wmediumd indicates that the frame was successfully transmitted (eventually). Signed-off-by: Qasim Javed <qasimj@gmail.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211_hwsim: advertise interface combinationsJohannes Berg2012-06-041-0/+21
| | | | | | | | | | Enforcing interface combinations broke uses of hwsim with multiple virtual interfaces. Advertise that all combinations are possible to fix this. Reported-by: Nirav Shah <nirav.j2.shah@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211_hwsim: Fix rate control by correctly reporting transmission countsJavier Cardona2012-05-151-0/+5
| | | | | | | | | | | | | | Drivers need to report the number of transmission attempts for each rate as well as to terminate the rate array with -1. The in-kernel datapath of hwsim simulates a perfect medium, therefore the driver only needs to report that the first transmission attempt was sucessfully completed at the most favorable rate. Rate control is working again for this driver. Tested mesh mode with minstrel. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2012-04-181-0/+1
|\ | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-testmode.c include/net/nfc/nfc.h net/nfc/netlink.c net/wireless/nl80211.c
| * mac80211_hwsim: fixup for tsf settingJavier Cardona2012-04-161-0/+1
| | | | | | | | | | | | | | Last patch I sent failed to take into account the offset of each phy. Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | Merge branch 'master' into for-davemJohn W. Linville2012-04-121-15/+17
|\ \ | |/ | | | | | | | | Conflicts: drivers/net/wireless/iwlwifi/iwl-testmode.c net/wireless/nl80211.c
| * mac80211: add explicit monitor interface if neededJohannes Berg2012-04-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The queue mapping redesign that I'm planning to do will break pure injection unless we handle monitor interfaces explicitly. One possible option would be to have the driver tell mac80211 about monitor mode queues etc., but that would duplicate the API since we already need to have queue assignments handled per virtual interface. So in order to solve this, have a virtual monitor interface that is added whenever all active vifs are monitors. We could also use the state of one of the monitor interfaces, but managing that would be complicated, so allocate separate state. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mac80211_hwsim: Fill timestamp beacon at the time it is transmittedJavier Cardona2012-04-101-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | Generate more acurate tsf values in hwsim by setting the tsf value on trasmitted beacons immediately before they are moved to the rx path. Also, adjust the beacon timestamp to be the time at which the first byte of the timestamp is transmitted. With these changes the observed tsf offset between two hwsim/mesh peers is 0 (unless the offset is modified via debugfs) Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
| * mac80211: don't always advertise remain-on-channelJohannes Berg2012-04-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not all devices are really capable of implementing remain-on-channel, even if it is implemented in SW, as they can't necessarily deal with channel changes while associated. Remove the WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL and add it only if either the driver has remain_on_channel implemented in the driver/device. Also add it to all drivers that advertise P2P right now since those definitely have to have it working. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | mac80211_hwsim: Stop using NLA_PUT*().David S. Miller2012-04-021-9/+15
|/ | | | | | | These macros contain a hidden goto, and are thus extremely error prone and make code hard to audit. Signed-off-by: David S. Miller <davem@davemloft.net>
* mac80211_hwsim: Fix set mactime on receiver hwsim radioAshok Nagarajan2012-03-121-1/+2
| | | | | | | | | The patch "mac80211_hwsim: Add tsf to beacons, probe responses and radiotap header" was setting the mactime on wrong hwsim radio. This patch fixes it. Signed-off-by: Ashok Nagarajan <ashok@cozybit.com> Signed-off-by: Javier Cardona <javier@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: Modify tsf via debugfs in mesh interfacesJavier Cardona2012-03-061-0/+18
| | | | | | Signed-off-by: Javier Cardona <javier@cozybit.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211_hwsim: Add tsf to beacons, probe responses and radiotap header.Javier Cardona2012-03-061-1/+26
| | | | | | | | | | Generate a tsf from internal kernel clock. Prepare the path for having different tsf offsets on each phy. This will be useful for testing mesh synchronization algorithms. Signed-off-by: Javier Cardona <javier@cozybit.com> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211_hwsim: correctly line up a multiline printkAntonio Quartulli2012-02-271-1/+1
| | | | | | | The second line of a printk statement must line up to the opening bracket. Signed-off-by: Antonio Quartulli <ordex@autistici.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wireless: Fix typo in mac80211_hwsim.cMasanari Iida2012-02-271-4/+4
| | | | | | | | Correct spelling "occured" to "occurred" in drivers/net/wireless/mac80211_hwsim.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net: fix assignment of 0/1 to bool variables.Rusty Russell2011-12-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | DaveM said: Please, this kind of stuff rots forever and not using bool properly drives me crazy. Joe Perches <joe@perches.com> gave me the spatch script: @@ bool b; @@ -b = 0 +b = false @@ bool b; @@ -b = 1 +b = true I merely installed coccinelle, read the documentation and took credit. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: David S. Miller <davem@davemloft.net>
* mac80211_hwsim: fix wmediumd_pidJohannes Berg2011-12-161-11/+10
| | | | | | | | | | | Fix a few minor issues with wmediumd_pid: a) make static b) use u32 to match the snd_pid type c) use ACCESS_ONCE since we don't lock it d) don't explicitly initialize to 0 Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2011-11-221-0/+1
|\ | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux Conflicts: drivers/net/wireless/iwlegacy/iwl-debugfs.c drivers/net/wireless/iwlegacy/iwl-rx.c drivers/net/wireless/iwlegacy/iwl-scan.c drivers/net/wireless/iwlegacy/iwl-tx.c include/net/bluetooth/bluetooth.h
| * drivers/net: Add module.h to drivers who were implicitly using itPaul Gortmaker2011-10-311-0/+1
| | | | | | | | | | | | | | | | The device.h header was including module.h, making it present for most of these drivers. But we want to clean that up. Call out the include of module.h in the modular network drivers. Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
* | mac80211_hwsim: Claim support for TDLSJouni Malinen2011-11-081-0/+2
|/ | | | | Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211: pass vif param to conf_tx() callbackEliad Peller2011-10-031-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | tx params should be configured per interface. add ieee80211_vif param to the conf_tx callback, and change all the drivers that use this callback. The following spatch was used: @rule1@ struct ieee80211_ops ops; identifier conf_tx_op; @@ ops.conf_tx = conf_tx_op; @rule2@ identifier rule1.conf_tx_op; identifier hw, queue, params; @@ conf_tx_op ( - struct ieee80211_hw *hw, + struct ieee80211_hw *hw, struct ieee80211_vif *vif, u16 queue, const struct ieee80211_tx_queue_params *params) {...} Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* mac80211_hwsim: Fix RX status reporting for HTJouni Malinen2011-08-101-0/+6
| | | | | | | | | | RX_FLAG_HT must be included when reporting MCS rates. Without this, mac80211 ended up dropping any frame sent at MCS index 12 or higher and that resulted in oddly random looking errors in mac80211_hwsim tests. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud