Commit graph

261278 commits

Author SHA1 Message Date
Javier Cardona 699403dbd4 {nl,mac}80211: add missing root mode meshconf entries
This fix allows userspace to mark a meshif as a root node.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24 13:59:43 -04:00
Javier Cardona 5ee68e5b39 mac80211: mesh gate implementation
In this implementation, a mesh gate is a root node with a certain bit
set in its RANN flags. The mpath to this root node is marked as a path
to a gate, and added to our list of known gates for this if_mesh. Once a
path discovery process fails, we forward the unresolved frames to a
known gate. Thanks to Luis Rodriguez for refactoring and bug fix help.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24 13:59:42 -04:00
Javier Cardona 00e3f25c85 mac80211: fix mesh path flushing
Previously, mpaths were never flushed since the mpath is not active once
we call this function.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24 13:59:42 -04:00
Javier Cardona a6965c44e9 mac80211: mesh locking fixes
mesh_queue_preq is invoked invoked from both user (work queue) and
softirq (timer) context, so the _bh version of spinlock needs to be
used. Also, the mpath->state_lock should be softirq safe as well.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24 13:59:42 -04:00
Javier Cardona 86d7f9f35d mac80211: fix mpath timer NULL function
If we have an mpath whose timer has not been initialized, don't try to
delete it.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24 13:59:42 -04:00
Javier Cardona 7646887a53 mac80211: improve mpath debugging
make hwmp_dbg print the relevant sdata->name by default and improve
formatting. Also add mpath_dbg macro for debugging of mesh path
operations.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-24 13:59:41 -04:00
Rafał Miłecki 87a8c8cb20 b43: HT-PHY: allow writing longer tables with a single call
Sometimes we need to write table which is 2-10 elements long. It's
easier to create such a function instead of defining array every time.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-23 16:14:19 -04:00
Rafał Miłecki 98f8dc72ac b43: HT-PHY: init: add missing small-tables writes
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:02 -04:00
Stefan Assmann b5be7e4c8f rtlwifi: add module parameter to set global debug level
No need to recompile the module anymore to set the debug level.

Signed-off-by: Stefan Assmann <sassmann@kpanic.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki a4042bb093 b43: HT-PHY: init: add some AFE (Analog Frontend) operation
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki 357e24d2d0 b43: HT-PHY: init: add missing PHY mask/set ops
MMIO hacks were used to trick ndis&wl. For example following:
 phy_read(0x0280) -> 0xffff
phy_write(0x0280) <- 0xff3e
***
 phy_read(0x0280) -> 0x0000
phy_write(0x0280) <- 0x003e
was translated to mask 0xff00 and set 0x3e.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki b50583484a b43: HT-PHY: init: init BPHY and upload 0x1a table
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki 19240f36cf b43: HT-PHY: init: copy tables and reset CCA
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki f457f1842d b43: HT-PHY: init: implement few simple PHY writes
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:01 -04:00
Rafał Miłecki 15222b582d b43: HT-PHY: init: zero EXTG registers
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:00 -04:00
Nishant Sarmukadam a63d7e67fc mwl8k: Traffic to clients gets affected when one client leaves a cyrpto bss
When a client disassociates from a crypto enabled bss, data traffic to
other clients connected to the bss is stalled. This was due to a boolean
variable used to keep track if HW crypto is enabled i.e. if set key has
been called to add a key.  This flag was being reset every time delete
key was called e.g when a station leaves the bss. Once the flag is
reset, rx status flags were not being set for connected clients which
disrupts traffic to these clients. Fix this issue by not resetting the
flag since we do not need to reset this flag during the life time of the
bss.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:00 -04:00
Thomas Pedersen 25d49e4d63 mac80211: update mesh path selection frame format
Make mesh path selection frames Mesh Action category, remove outdated
Mesh Path Selection category and defines, use updated reason codes, add
mesh_action_is_path_sel for readability, and update/correct path
selection IEs.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:00 -04:00
Thomas Pedersen 36c704fded ieee80211: add mesh action codes
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:00 -04:00
Thomas Pedersen 8db098507c mac80211: update mesh peering frame format
This patch updates the mesh peering frames to the format specified in
the recently ratified 802.11s standard. Several changes took place to
make this happen:

	- Change RX path to handle new self-protected frames
	- Add new Peering management IE
	- Remove old Peer Link IE
	- Remove old plink_action field in ieee80211_mgmt header

These changes by themselves would either break peering, or work by
coincidence, so squash them all into this patch.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:00 -04:00
Thomas Pedersen 54ef656b05 mac80211: update mesh peering frame codes
Have the mesh peering frames use the self-protected action and reason codes
specified in 802.11s and defined in ieee80211.h. Remove the local enums.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:46:00 -04:00
Thomas Pedersen 6709a6d96e ieee80211: introduce Self Protected Action codes
802.11s introduces a new action frame category, add action codes as well
as an entry in ieee80211_mgmt.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:59 -04:00
Thomas Pedersen 082ebb0c25 mac80211: fix mesh beacon format
Correct ordering of IEs in the mesh beacon while removing unneeded IEs
from mesh peering frames. Set privacy bit in capability info if security
is enabled. Add utility functions to aid in construction
of IEs and reduce code duplication.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:59 -04:00
Rafał Miłecki f6a3e99da8 b43: make forcing clock common (HT-PHY also uses that)
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:59 -04:00
Rafał Miłecki 6a461c23e7 b43: include HT-PHY in some common code
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:59 -04:00
Rafał Miłecki 984e5befba bcma: implement BCM4331 workaround for external PA lines
We need to disable ext. PA lines for reading SPROM. It's disabled by
default, but this patch allows using bcma after loading wl, which leaves
workaround enabled.

Cc: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:59 -04:00
Rafał Miłecki 17030f48e3 b43: support new RX header, noticed to be used in 598.314+ fw
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:59 -04:00
Rafał Miłecki 5d85290556 b43: support new TX header, noticed to be used by 598.314+ fw
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:58 -04:00
Rafał Miłecki efe0249b0f b43: use enum for firmware header format
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:58 -04:00
Rafał Miłecki 2391b7e8d4 b43: rename TX header formats
Replace "old" and "new" with number of the first firmware known to use
the given format.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:58 -04:00
Helmut Schaa e69deded2b mac80211: Tear down BA session on BAR tx failure
As described at [1] some STAs (i.e. Intel 5100 Windows) can end up
correctly BlockAcking incoming frames without delivering them to user
space if a AMPDU subframe got lost and we don't flush the receipients
reorder buffer with a BlockAckReq. This in turn results in stuck
connections.

According to 802.11n-2009 it is not necessary to send a BAR to flush
the recepients RX reorder buffer but we still do that to be polite.

However, assume the following frame exchange:

AP -> STA, AMPDU (failed)
AP -> STA, BAR (failed)

The client in question then ends up in the same situation and won't
deliver frames to userspace anymore since we weren't able to flush
its reorder buffer.

This is not a hypothetical situation but I was able to observe this
exact behavior during a stress test between a rt2800pci AP and a Intel
5100 Windows client.

In order to work around this issue just tear down the BA session as
soon as a BAR failed to be TX'ed.

[1] http://comments.gmane.org/gmane.linux.kernel.wireless.general/66867

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:58 -04:00
Helmut Schaa c1407b6cb2 wireless: Introduce defines for BAR TID_INFO & MULTI_TID fields
While at it also fix the indention of the other IEEE80211_BAR_CTRL_ defines.

Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:58 -04:00
Felix Fietkau 2a190322d4 b43: reload phy and bss settings after core restarts
b43_op_config and b43_op_bss_info_changed apply many settings by directly
writing to hardware registers. These settings are lost as soon as the core
is restarted and the initvals are reloaded. This was discovered because
restarting hostapd led to the beacon interval getting set to ~33s (see
https://dev.openwrt.org/ticket/8033 for more information).

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:57 -04:00
Stanislaw Gruszka 69ce674bfa ath9k: do btcoex ASPM disabling at initialization time
Disable ASPM in pci ->probe on upstream (device) and downstream
(PCIe port) component. According to e1000e driver authors this is
required. I did not find that requirement in PCIe spec, but it seems
to be logical for me.

This need to be fixed for CONFIG_PCIEASPM, that will be done later ...

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:57 -04:00
Stanislaw Gruszka 3b9cf1be8c ath9k: merge common ->config_pci_powersave() checks
Move common checks into wrapper function. Since ASPM can be only enabled
on PCIe devices ->is_pciexpress check is unneeded.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:57 -04:00
Stanislaw Gruszka 84c87dc86e ath9k: remove ->config_pci_powersave() redundant argument
We always call ->config_pci_powersave() with both restore and power_off
arguments equal to 0 or both equal to 1, so merge them into one
argument.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-22 14:45:57 -04:00
Kalle Valo af2bf4b4ee staging: remove ath6kl
ath6kl is now in drivers/net/wireless/ath so the staging driver
is not supported anymore and should be removed.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Greg KH <gregkh@suse.de>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-13 14:48:06 -04:00
Amitkumar Karwar 7c6fa2a843 mwifiex: use cfg80211 dynamic scan table and cfg80211_get_bss API
Instead of maintaining static scan table in driver, scan list is sent
to cfg80211 stack (after parsing each scan command response).
In assoc handler (for infra and ibss network) requested BSS information
is retrieved using cfg80211_get_bss() API.

With the changes above some redundant code are removed.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:45:05 -04:00
Felix Fietkau 9af73cf7f3 ath9k: avoid sending a-mpdu packets to sleeping stations
If the driver gets a tx status report for an A-MPDU sent to a station that
just went to sleep, that leaves a race condition where this tx status can
trigger another A-MPDU transmission.
To fix this, check if the station is sleeping before queueing the tid.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:45:04 -04:00
Jouni Malinen 9946ecfb51 nl80211/cfg80211: Add extra IE configuration to AP mode setup
The NL80211_CMD_NEW_BEACON command is, in practice, requesting AP mode
operations to be started. Add new attributes to provide extra IEs
(e.g., WPS IE, P2P IE) for drivers that build Beacon, Probe Response,
and (Re)Association Response frames internally (likely in firmware).

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:45:04 -04:00
Jouni Malinen 5fb628e910 nl80211/cfg80211: Add crypto settings into NEW_BEACON
This removes need from drivers to parse the beacon tail/head data
to figure out what crypto settings are to be used in AP mode in case
the Beacon and Probe Response frames are fully constructed in the
driver/firmware.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:45:04 -04:00
Jouni Malinen 32e9de846b nl80211/cfg80211: Allow SSID to be specified in new beacon command
This makes it easier for drivers that generate Beacon and Probe Response
frames internally (in firmware most likely) in AP mode.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:45:03 -04:00
Yogesh Ashok Powar 0879fa44b5 cfg80211/mac80211: move information element parsing logic to cfg80211
Moving the parsing logic for retrieving the information elements
stored in management frames, e.g. beacons or probe responses,
and making it available to other cfg80211 drivers.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:45:03 -04:00
Marek Lindner f3d4505de5 ath9k: remove eeprom txgain override for minor version < 19
ath9k_hw_4k_get_eeprom() overrides the eeprom value for txgain if the
minor version is not 19 or above with a value of 0.
ar9002_hw_init_mode_gain_regs() relies on this information to
determine whether this is a high power wifi card or not. The override
caused the driver to always use the 'normal' power tables even for
high power devices if their minor version was not high enough. Thus
leading to reduced power output.

This isn't needed for the AR9285; the check originated with the
AR9280 setup code which requires the EEPROM version check.

Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Acked-by: Adrian Chadd <adrian@freebsd.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-12 13:45:02 -04:00
Jouni Malinen f612cedfe1 nl80211/cfg80211: Make addition of new sinfo fields safer
Add a comment pointing out the use of enum station_info_flags for
all new struct station_info fields. In addition, memset the sinfo
buffer to zero before use on all paths in the current tree to avoid
leaving uninitialized pointers in the data.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-11 14:23:06 -04:00
Felix Fietkau 040bdf713d cfg80211: fix a crash in nl80211_send_station
mac80211 leaves sinfo->assoc_req_ies uninitialized, causing a random
pointer memory access in nl80211_send_station.
Instead of checking if the pointer is null, use sinfo->filled, like
the rest of the fields.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-11 14:23:06 -04:00
Mohammed Shafi Shajakhan 6a6767b046 ath9k: remove obselete comments
the comments are obselete as the virtual wiphy support was removed from
the driver

Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-10 14:07:43 -04:00
Mohammed Shafi Shajakhan 32359e30a6 ath9k: optimize rate control statistics
for the ease of debugging, we display only the rate control statistics
for currently operating mode and bandwidth

Cc: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com>
Cc: "Balasubramanian, senthilkumar" <senthilb@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-10 14:07:43 -04:00
Javier Cardona 1b1de7aa99 mac80211: fix erroneous clearing of MESH_PATH_SN_VALID flag
When a PREQ or PREP is received from an intermediate node, it contains
useful information for path selection but it doesn't include the
originator's sequence number.   Therefore, when updating the mesh path
to that intermediate node, we should not set the MESH_PATH_SN_VALID
flag.  BUT, if the flag is set, it should not be unset as we might have
received a valid sequence number for that intermediate node in the past.

This issue was reported, fixed and tested by Ya Bo (游波) and Pedro
Larbig (ASPj).

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-10 14:07:43 -04:00
Mohammed Shafi Shajakhan 9f3a35df3d ath9k_htc: minor clean-up
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-10 14:07:42 -04:00
Eliad Peller f785d83a19 mac80211: clear sta.drv_priv on reconfiguration
drivers might assume sta.drv_priv is clear while
the sta is added, so clear it on reconfinguration.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-08-10 14:07:42 -04:00