summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mac80211_hwsim.c
AgeCommit message (Collapse)Author
2013-08-26mac80211_hwsim: fix error return code in init_mac80211_hwsim()Wei Yongjun
Fix to return -ENOMEM in the netdev alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-08-12mac80211: add vif to testmode cmdDavid Spinadel
Pass the wdev from cfg80211 on to the driver as the vif if given and it's valid for the driver. Signed-off-by: David Spinadel <david.spinadel@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-16mac80211_hwsim: claim active monitor supportJohannes Berg
It seems to actually work this way already, so we may need to do some work to make monitor interfaces be _not_ active in hwsim instead. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-16mac80211_hwsim: claim uAPSD supportJohannes Berg
Since mac80211 does everything, we can just claim it. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-07-16mac80211_hwsim: use ieee80211_free_txskbJohannes Berg
These are only strange error cases, so it's not really all that important, but the driver really should use ieee80211_free_txskb() instead of just dev_kfree_skb(). Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-05-16mac80211_hwsim: correctly register the platform driverSasha Levin
Not registering a platform_driver would make us access garbage when the platform callbacks under driver_register() kicks in. Signed-off-by: Sasha Levin <sasha.levin@oracle.com> Tested-By: Martin Pitt <martin.pitt@ubuntu.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-04-22mac80211_hwsim: handle IEEE80211_HW_SUPPORTS_RC_TABLEKarl Beldan
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-04-16mac80211_hwsim: handle VHT rates in rx_statusKarl Beldan
Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-04-10mac80211_hwsim: Register and bind to driverMartin Pitt
Properly register our mac80211_hwsim_driver, attach it to the platform bus. Bind newly created hwsim devices to that driver, so that our wlan devices get a proper "driver" sysfs attribute. This makes mac80211_hwsim interfaces work with NetworkManager. Signed-off-by: Martin Pitt <martin.pitt@ubuntu.com> [fix an old and a new message to not be line-broken, also fix the driver_register error path] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-04-08mac80211_hwsim: advertise VHT support also when channels == 1Karl Beldan
Drivers can now advertise VHT support even if they don't use channel contexts. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-03-25mac80211: Use a cfg80211_chan_def in ieee80211_hw_conf_chanKarl Beldan
Drivers that don't use chanctxes cannot perform VHT association because they still use a "backward compatibility" pair of {ieee80211_channel, nl80211_channel_type} in ieee80211_conf and ieee80211_local. Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> [fix kernel-doc] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-03-18mac80211_hwsim: assign CAB queue properly on interface type changeJohannes Berg
When an interface change type, the CAB queue must be reassigned, do this in hwsim to avoid warnings/crashes. Reported-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-03-18mac80211: pass queue bitmap to flush operationJohannes Berg
There are a number of situations in which mac80211 only really needs to flush queues for one virtual interface, and in fact during this frames might be transmitted on other virtual interfaces. Calculate and pass a queue bitmap to the driver so it knows which queues to flush. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-03-06mac80211: Allow drivers to differentiate between ROC typesIlan Peer
Some devices can handle remain on channel requests differently based on the request type/priority. Add support to differentiate between different ROC types, i.e., indicate that the ROC is required for sending managment frames. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-02-15mac80211_hwsim: ask mac80211 to reserve space for chanctx.drv_privKarl Beldan
Otherwise memory corruption occurs when using channel contexts (ATM when param 'channel' > 1). Signed-off-by: Karl Beldan <karl.beldan@rivierawaves.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-11mac80211_hwsim: fix beacon timestamp and mactimeThomas Pedersen
Set the beacon timestamp once during "transmission" so the monitor interface also gets a timestamped beacon. Also use a common base between TX timestamp and RX mactime. This eliminates "TX" path delay, which shows up as a constant error in Toffset. Get the global TSF once before iterating over all RX HWs, so they all set a mactime with the same time base. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-01-04mac80211_hwsim: fix beacon timingThomas Pedersen
A beacon period starts at TSF time 0. Spoof this by rounding the starting beacon time to a multiple of the beacon interval, and keep TBTT aligned on TSF adjustment. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-04mac80211_hwsim: hrtimer beaconThomas Pedersen
For testing various timing-sensitive protocols (power save, MBCA, etc.), a beacon accuracy of jiffies is not sufficient. A tasklet_hrtimer is used for the beacon since it runs the callback in soft-IRQ context with hrtimer resolution. Also handle BSS_CHANGED_BEACON_ENABLED for hwsim. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> [simplify timer container_of] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-04mac80211_hwsim: fix tsf adjustmentThomas Pedersen
Make hwsim TSF offset adjustments cumulative and relative to the fake PHY TSF. Now adding 1000us, then adding -1000us doesn't result in a tsf_offset of -1000. Also the beacon timestamp can now correctly be expressed as (tsf + data->tsf_offset), which will be done in a later patch. Signed-off-by: Thomas Pedersen <thomas@cozybit.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211: split TX aggregation stop actionJohannes Berg
When TX aggregation is stopped, there are a few different cases: - connection with the peer was dropped - session stop was requested locally - session stop was requested by the peer - connection was dropped while a session is stopping The behaviour in these cases should be different, if the connection is dropped then the driver should drop all frames, otherwise the frames may continue to be transmitted, aggregated in the case of a locally requested session stop or unaggregated in the case of the peer requesting session stop. Split these different cases so that the driver can act accordingly; however, treat local and remote stop the same way and ask the driver to not send frames as aggregated packets any more. In the case of connection drop, the stop callback the driver is otherwise supposed to call is no longer required. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-01-03mac80211_hwsim: allow testing paged RXJohannes Berg
Paged RX, i.e. SKBs with (some of) the data in pages instead of the SKB header data (skb->data) can behave differently in the stack and cause other bugs. To make debugging easier add an option to hwsim to test with such SKBs. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-12-06wireless: fix VHT max AMPDU exponent definitionJohannes Berg
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 Berg
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 Berg
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 Berg
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 Berg
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 Berg
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 Peller
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 Berg
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 Pedersen
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 Berg
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 Berg
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 Berg
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 ↵John W. Linville
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>
2012-09-10netlink: Rename pid to portid to avoid confusionEric W. Biederman
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 Berg
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 Berg
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 ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Conflicts: drivers/net/wireless/mac80211_hwsim.c
2012-08-20mac80211_hwsim: add support for P2P DeviceJohannes Berg
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 Huehn
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 & ↵Thomas Huehn
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>
2012-07-20Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2012-07-17mac80211_hwsim: fix race condition with sta/vif pointersThomas Huehn
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 ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2012-07-06mac80211_hwsim: add testmode code to stop/wake queuesJohannes Berg
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 Berg
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 ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem Conflicts: drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
2012-06-28net: Use NLMSG_DEFAULT_SIZE in combination with nlmsg_new()Thomas Graf
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. Linville
2012-06-25mac80211_hwsim: fix smatch/sparse complaintsJohannes Berg
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>