aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2012-12-06wireless: fix VHT max AMPDU exponent definitionJohannes Berg1-1/+1
This is really a 3-bit field, not a single bit, so declare a mask and shift. Also fix hwsim, it advertises the maximum possible. While at it reindent all the defines using tabs instead of spaces. Change-Id: I7cd81c0d72f76deb5010aba5bfa3dd312006e898 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-30mac80211: remove probe response temporary buffer allocationJohannes Berg1-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>
2012-11-26mac80211_hwsim: remove printing scan configJohannes Berg1-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>
2012-11-26mac80211_hwsim: advertise VHT supportJohannes Berg1-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>
2012-11-26mac80211: convert to channel definition structJohannes Berg1-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>
2012-11-26cfg80211: remove remain-on-channel channel typeJohannes Berg1-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>
2012-11-19mac80211: make remain_on_channel() op pass vif paramEliad Peller1-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>
2012-11-19mac80211: support radiotap vendor namespace RX dataJohannes Berg1-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>
2012-11-13mac80211: support RX_FLAG_MACTIME_ENDThomas Pedersen1-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>
2012-11-09mac80211: clarify interface iteration and make it configurableJohannes Berg1-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>
2012-10-30mac80211_hwsim: print per interface TX powerJohannes Berg1-0/+3
Just for debugging, print the interface TX power whenever it changes. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-10-30mac80211_hwsim: allow using channel contextsJohannes Berg1-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>
2012-09-28Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville1-4/+1
Conflicts: net/nfc/netlink.c Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-09-10netlink: Rename pid to portid to avoid confusionEric W. Biederman1-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>
2012-09-06mac80211_hwsim: move module_init/exitJohannes Berg1-4/+1
These should be with the functions so move the module_init/exit statements. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-09-06Merge remote-tracking branch 'mac80211/master' into mac80211-nextJohannes Berg1-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>
2012-08-21Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-nextJohn W. Linville1-2/+6
Conflicts: drivers/net/wireless/mac80211_hwsim.c
2012-08-20mac80211_hwsim: add support for P2P DeviceJohannes Berg1-1/+3
Advertise support for P2P Device in hwsim to be able to test it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-07-31mac80211: move TX station pointer and restructure TXThomas Huehn1-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>
2012-07-26mac80211_hwsim: fix possible race condition in usage of info->control.sta & control.vifThomas Huehn1-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> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-07-20Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville1-5/+0
2012-07-17mac80211_hwsim: fix race condition with sta/vif pointersThomas Huehn1-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>
2012-07-12Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville1-2/+10
2012-07-06mac80211_hwsim: add testmode code to stop/wake queuesJohannes Berg1-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>
2012-07-03mac80211_hwsim: fix NUM_BANDS usageJohannes Berg1-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>
2012-06-29Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville1-6/+4
Conflicts: drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
2012-06-28net: Use NLMSG_DEFAULT_SIZE in combination with nlmsg_new()Thomas Graf1-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>
2012-06-26Merge branch 'for-john' of git://git.sipsolutions.net/mac80211-nextJohn W. Linville1-6/+4
2012-06-25mac80211_hwsim: fix smatch/sparse complaintsJohannes Berg1-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>
2012-06-08mac80211_hwsim: Set IEEE80211_STAT_ACK flag when userspace indicates that the frame has been acknowledged.Qasim Javed1-0/+1
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>
2012-06-04mac80211_hwsim: advertise interface combinationsJohannes Berg1-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>
2012-05-15mac80211_hwsim: Fix rate control by correctly reporting transmission countsJavier Cardona1-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>
2012-04-18Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davemJohn W. Linville1-0/+1
Conflicts: drivers/net/wireless/iwlwifi/iwl-testmode.c include/net/nfc/nfc.h net/nfc/netlink.c net/wireless/nl80211.c
2012-04-16mac80211_hwsim: fixup for tsf settingJavier Cardona1-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>
2012-04-12Merge branch 'master' into for-davemJohn W. Linville1-15/+17
Conflicts: drivers/net/wireless/iwlwifi/iwl-testmode.c net/wireless/nl80211.c
2012-04-11mac80211: add explicit monitor interface if neededJohannes Berg1-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>
2012-04-10mac80211_hwsim: Fill timestamp beacon at the time it is transmittedJavier Cardona1-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>
2012-04-10mac80211: don't always advertise remain-on-channelJohannes Berg1-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>
2012-04-02mac80211_hwsim: Stop using NLA_PUT*().David S. Miller1-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>
2012-03-12mac80211_hwsim: Fix set mactime on receiver hwsim radioAshok Nagarajan1-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>
2012-03-06mac80211: Modify tsf via debugfs in mesh interfacesJavier Cardona1-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>
2012-03-06mac80211_hwsim: Add tsf to beacons, probe responses and radiotap header.Javier Cardona1-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>
2012-02-27mac80211_hwsim: correctly line up a multiline printkAntonio Quartulli1-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>
2012-02-27wireless: Fix typo in mac80211_hwsim.cMasanari Iida1-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>
2011-12-19net: fix assignment of 0/1 to bool variables.Rusty Russell1-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>
2011-12-16mac80211_hwsim: fix wmediumd_pidJohannes Berg1-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>
2011-11-22Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linuxJohn W. Linville1-0/+1
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
2011-11-08mac80211_hwsim: Claim support for TDLSJouni Malinen1-0/+2
Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-10-31drivers/net: Add module.h to drivers who were implicitly using itPaul Gortmaker1-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>
2011-10-03mac80211: pass vif param to conf_tx() callbackEliad Peller1-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>