GitHub/mt8127/android_kernel_alcatel_ttab.git
11 years agonl80211: add packet offset information for wowlan pattern
Amitkumar Karwar [Tue, 12 Feb 2013 20:16:26 +0000 (12:16 -0800)]
nl80211: add packet offset information for wowlan pattern

If user knows the location of a wowlan pattern to be matched in
Rx packet, he can provide an offset with the pattern. This will
help drivers to ignore initial bytes and match the pattern
efficiently.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
[refactor pattern sending]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: allow driver to be stateless wrt. SMSP requests
Emmanuel Grumbach [Sun, 10 Feb 2013 13:55:20 +0000 (15:55 +0200)]
mac80211: allow driver to be stateless wrt. SMSP requests

Bail out if no update is made to the SMPS state. This
allows the driver to avoid duplicating the state.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agonl80211: minor correction in sample wowlan mask calculation
Amitkumar Karwar [Tue, 12 Feb 2013 07:56:40 +0000 (23:56 -0800)]
nl80211: minor correction in sample wowlan mask calculation

The match 00:xx:00:00:xx:00:00:00:00:xx:xx:xx (where xx indicates
"don't care") should be represented by a pattern of twelve zero
bytes, and a mask of "0xed,0x01", not "0xed,0x07".

mask_len = (pat_len + 7) / 8 = (12 + 7) / 8 = 2
Hence the mask will be of 2 bytes.
Replace each valid byte in pattern by 1 and don't care byte by 0:
10110111 1000 (0000)

1st byte of pattern corresponds to lower order bit in first byte
of mask. And 9th byte of pattern corresponds to lower order bit
in second byte of mask. With this logic the mask will be
11101101 00000001 = 0xed 0x01

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: Add flushes before going off-channel
Seth Forshee [Mon, 11 Feb 2013 17:21:08 +0000 (11:21 -0600)]
mac80211: Add flushes before going off-channel

We've got a couple of races when enabling powersave with an AP for
off-channel operation. The first is fairly simple. If we go off-channel
before the nullfunc frame to enable PS is transmitted then it may not be
received by the AP. Add a flush after enabling off-channel PS to prevent
this from happening.

The second race is a bit more subtle. If the driver supports QoS and has
frames queued when the nullfunc frame is queued, those frames may get
transmitted after the nullfunc frame. If PM is not set then the AP is
being told that we've exited PS before we go off-channel and may try to
deliver frames. To prevent this, add a flush after stopping the queues
but before passing the nullfunc frame to the driver.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: Fix tx queue handling during scans
Seth Forshee [Mon, 11 Feb 2013 17:21:07 +0000 (11:21 -0600)]
mac80211: Fix tx queue handling during scans

Scans currently work by stopping the netdev tx queues but leaving the
mac80211 queues active. This stops the flow of incoming packets while
still allowing mac80211 to transmit nullfunc and probe request frames to
facilitate scanning. However, the driver may try to wake the mac80211
queues while in this state, which will also wake the netdev queues.

To prevent this, add a new queue stop reason,
IEEE80211_QUEUE_STOP_REASON_OFFCHANNEL, to be used when stopping the tx
queues for off-channel operation. This prevents the netdev queues from
waking when a driver wakes the mac80211 queues.

This also stops all frames from being transmitted, even those meant to
be sent off-channel. Add a new tx control flag,
IEEE80211_TX_CTL_OFFCHAN_TX_OK, which allows frames to be transmitted
when the queues are stopped only for the off-channel stop reason. Update
all locations transmitting off-channel frames to use this flag.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: remove the sampling bypass check for the lowest rate
Felix Fietkau [Mon, 11 Feb 2013 13:36:04 +0000 (14:36 +0100)]
mac80211/minstrel_ht: remove the sampling bypass check for the lowest rate

It's more of an unnecessary micro-optimization and it prevents switching
from long-GI to short-GI in HT20/single-stream for the lowest rate

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211/minstrel_ht: show the number of retries for each rate in debugfs
Felix Fietkau [Mon, 11 Feb 2013 13:36:03 +0000 (14:36 +0100)]
mac80211/minstrel_ht: show the number of retries for each rate in debugfs

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove unused code to mark AP station authenticated
Johannes Berg [Thu, 7 Feb 2013 16:19:08 +0000 (17:19 +0100)]
mac80211: remove unused code to mark AP station authenticated

When we get to association, the AP station already exists and
is marked authenticated, so moving it into IEEE80211_STA_AUTH
again is a NOP, remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: simplify idle handling
Johannes Berg [Wed, 6 Feb 2013 23:14:51 +0000 (00:14 +0100)]
mac80211: simplify idle handling

Now that we have channel contexts, idle is (pretty
much) equivalent to not having a channel context.
Change the code to use this relation so that there
no longer is a need for a lot of idle recalculate
calls everywhere.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove IEEE80211_HW_SCAN_WHILE_IDLE
Johannes Berg [Wed, 6 Feb 2013 22:57:57 +0000 (23:57 +0100)]
mac80211: remove IEEE80211_HW_SCAN_WHILE_IDLE

There are only a few drivers that use HW scan, and
all of those don't need a non-idle transition before
starting the scan -- some don't even care about idle
at all. Remove the flag and code associated with it.

The only driver that really actually needed this is
wl1251 and it can just do it itself in the hw_scan
callback -- implement that.

Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: remove dynamic PS driver interface
Johannes Berg [Wed, 6 Feb 2013 22:07:41 +0000 (23:07 +0100)]
mac80211: remove dynamic PS driver interface

The functions were added for some sort of Bluetooth
coexistence, but aren't used, so remove them again.

Reviewed-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: introduce beacon-only timing data
Johannes Berg [Tue, 5 Feb 2013 16:48:40 +0000 (17:48 +0100)]
mac80211: introduce beacon-only timing data

In order to be able to predict the next DTIM TBTT
in the driver, add the ability to use timing data
from beacons only with the new hardware flag
IEEE80211_HW_TIMING_BEACON_ONLY and the BSS info
value sync_dtim_count which is only valid if the
timing data came from a beacon. The data can only
come from a beacon, and if no beacon was received
before association it is updated later together
with the DTIM count notification.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: move TSF into IEs
Johannes Berg [Tue, 5 Feb 2013 15:54:31 +0000 (16:54 +0100)]
cfg80211: move TSF into IEs

While technically the TSF isn't an IE, it can be
necessary to distinguish between the TSF from a
beacon and a probe response, in particular in
order to know the next DTIM TBTT, as not all APs
are spec compliant wrt. TSF==0 being a DTIM TBTT
and thus the DTIM count needs to be taken into
account as well.

To allow this, move the TSF into the IE struct
so it can be known whence it came.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: remove scan ies NULL check
Johannes Berg [Tue, 5 Feb 2013 15:51:29 +0000 (16:51 +0100)]
cfg80211: remove scan ies NULL check

There's no way scan BSS IEs can be NULL as even
if the allocation fails the frame is discarded.
Remove some code checking for this and document
that it is always non-NULL.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: add vif debugfs driver callbacks
Alexander Bondar [Sat, 22 Dec 2012 08:43:33 +0000 (10:43 +0200)]
mac80211: add vif debugfs driver callbacks

Add debugfs driver callbacks so drivers can add
debugfs entries for interfaces. Note that they
_must_ remove the entries again as add/remove in
the driver doesn't correspond to add/remove in
debugfs; the former is up/down while the latter
is netdev create/destroy.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: track hidden SSID networks properly
Johannes Berg [Fri, 1 Feb 2013 01:06:18 +0000 (02:06 +0100)]
cfg80211: track hidden SSID networks properly

Currently, cfg80211 will copy beacon IEs from a previously
received hidden SSID beacon to a probe response entry, if
that entry is created after the beacon entry. However, if
it is the other way around, or if the beacon is updated,
such changes aren't propagated.

Fix this by tracking the relation between the probe
response and beacon BSS structs in this case.

In case drivers have private data stored in a BSS struct
and need access to such data from a beacon entry, cfg80211
now provides the hidden_beacon_bss pointer from the probe
response entry to the beacon entry.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: explicitly copy channels to VLANs where needed
Johannes Berg [Fri, 8 Feb 2013 11:07:44 +0000 (12:07 +0100)]
mac80211: explicitly copy channels to VLANs where needed

Currently the code assigns channel contexts to VLANs
(for use by the TX/RX code) when the AP master gets
its channel context assigned. This works fine, but
in the upcoming radar detection work the VLANs don't
require a channel context (during radar detection)
and assigning one to them anyway causes issues with
locking and also inconsistencies -- a VLAN interface
that is added before radar detection would get the
channel context, while one added during it wouldn't.

Fix these issues moving the channel context copying
to a new explicit operation that will not be used
in the radar detection code.

Acked-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix chandef tracing bug
Johannes Berg [Fri, 8 Feb 2013 20:29:59 +0000 (21:29 +0100)]
mac80211: fix chandef tracing bug

The chandef tracing writes center_freq1 twice, so
that it is always 0 (no driver supports 80+80 yet)
and leaves center_freq2 unset. Fix this mistake.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix AP beacon loss messages
Johannes Berg [Fri, 8 Feb 2013 21:59:00 +0000 (22:59 +0100)]
mac80211: fix AP beacon loss messages

The messages currently refer to probe request probes,
but on some devices null data packets will be used
instead. Make the messages more generic.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: protect rx-path with spinlock
Christian Lamparter [Mon, 4 Feb 2013 17:44:44 +0000 (17:44 +0000)]
mac80211: protect rx-path with spinlock

This patch fixes the problem which was discussed in
"mac80211: Fix PN corruption in case of multiple
virtual interface" [1].

Amit Shakya reported a serious issue with my patch:
mac80211: serialize rx path workers" [2]:

In case, ieee80211_rx_handlers processing is going on
for skbs received on one vif and at the same time, rx
aggregation reorder timer expires on another vif then
sta_rx_agg_reorder_timer_expired is invoked and it will
push skbs into the single queue (local->rx_skb_queue).

ieee80211_rx_handlers in the while loop assumes that
the skbs are for the same sdata and sta. This assumption
doesn't hold good in this scenario and the PN gets
corrupted by PN received in other vif's skb, causing
traffic to stop due to PN mismatch."

[1] Message-Id: http://mid.gmane.org/201302041844.44436.chunkeey@googlemail.com
[2] Commit-Id: 24a8fdad35835e8d71f7

Reported-by: Amit Shakya <amit.shakya@stericsson.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: Add the DS Params for mesh to every band
Emanuel Taube [Wed, 6 Feb 2013 13:17:17 +0000 (14:17 +0100)]
mac80211: Add the DS Params for mesh to every band

There seems to be no reason, why it has to be limited to 2.4 GHz.

Signed-off-by: Emanuel Taube <emanuel.taube@gmail.com>
[remove 'local' variable]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: fix mesh sta teardown
Thomas Pedersen [Wed, 6 Feb 2013 18:17:21 +0000 (10:17 -0800)]
mac80211: fix mesh sta teardown

The patch "mac80211: clean up mesh sta allocation warning"
moved some mesh initialization into a path which is only
called when the kernel handles peering. This causes a hang
when mac80211 tries to clean up a userspace-allocated
station entry and delete a timer which has never been
initialized.

To avoid this, only do any mesh sta peering teardown if
the kernel is actually handling it.

The same is true when quiescing before suspend.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: fix kernel-doc
Johannes Berg [Fri, 8 Feb 2013 08:06:36 +0000 (09:06 +0100)]
wireless: fix kernel-doc

Fix most kernel-doc warnings, for some reason it
seems to have issues with __aligned, don't remove
the documentation entries it considers to be in
excess due to that.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: pass wiphy to cfg80211_ref_bss/put_bss
Johannes Berg [Fri, 1 Feb 2013 00:49:58 +0000 (01:49 +0100)]
cfg80211: pass wiphy to cfg80211_ref_bss/put_bss

This prepares for using the spinlock instead of krefs
which is needed in the next patch to track the refs
of combined BSSes correctly.

Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: fix radar check for P2P_DEVICE
Ilan Peer [Sun, 3 Feb 2013 06:28:27 +0000 (08:28 +0200)]
cfg80211: fix radar check for P2P_DEVICE

Radar is not required for P2P_DEVICE interfaces.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: Fix memory leak
Larry Finger [Mon, 4 Feb 2013 21:33:44 +0000 (15:33 -0600)]
cfg80211: Fix memory leak

When a driver requests a specific regulatory domain after cfg80211 already
has one, a struct ieee80211_regdomain is leaked.

Reported-by: Larry Finger <Larry.Finger@lwfinger.net>
Tested-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agoMerge remote-tracking branch 'wireless-next/master' into HEAD
Johannes Berg [Mon, 11 Feb 2013 17:44:25 +0000 (18:44 +0100)]
Merge remote-tracking branch 'wireless-next/master' into HEAD

11 years agortlwifi: rtl8192cu: Add new USB ID
Larry Finger [Fri, 8 Feb 2013 18:28:18 +0000 (12:28 -0600)]
rtlwifi: rtl8192cu: Add new USB ID

A new model of the RTL8188CUS has appeared.

Reported-and-tested-by: Thomas Rosenkrantz <tom.rosary@googlemail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Add tx p2p off-channel support.
Hante Meuleman [Fri, 8 Feb 2013 14:54:02 +0000 (15:54 +0100)]
brcmfmac: Add tx p2p off-channel support.

With this patch off-channel action frames can be transmitted. This
is needed for p2p when two devices need to find each other while
using different social channels.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Create netdev before returning from add_virtual_intf.
Hante Meuleman [Fri, 8 Feb 2013 14:54:01 +0000 (15:54 +0100)]
brcmfmac: Create netdev before returning from add_virtual_intf.

Currently netdev gets created possibly after returning from
add_virtual_intf. This is because add_if is handled asynch. This
is wrong and netdev should be up before returning.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Cleanup of unused defines.
Hante Meuleman [Fri, 8 Feb 2013 14:54:00 +0000 (15:54 +0100)]
brcmfmac: Cleanup of unused defines.

Remove some unused defines and comments. Also use same define
for IE length.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Fix rtnl_lock lockup when registering netdev.
Hante Meuleman [Fri, 8 Feb 2013 14:53:59 +0000 (15:53 +0100)]
brcmfmac: Fix rtnl_lock lockup when registering netdev.

When adding a virtual interface cfg80211 already has taken the
rtnl_lock. So when the netdevice is being registered the
register_netdevice should be used instead of register_netdev.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Remove sleep on del_station.
Hante Meuleman [Fri, 8 Feb 2013 14:53:58 +0000 (15:53 +0100)]
brcmfmac: Remove sleep on del_station.

Currently there is a sleep after disconnect on del_station. This
timeout is not needed (anymore) and is causing problems with p2p
setup, because remote side disconnects then supplicant will do
del_station and while it waits the 400ms remote side will already
reconnect and that is something supplicant cant handle.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Update netdev configuration in wiphy for p2p.
Hante Meuleman [Fri, 8 Feb 2013 14:53:57 +0000 (15:53 +0100)]
brcmfmac: Update netdev configuration in wiphy for p2p.

Wiphy object holds information about possible netdev
combinations which can be supported. This needs updating for
p2p device. Also p2p device netdev has wrong 80211 iftype.
Limit the change interface support to match the netdev
configuration/combination possibilities.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Reject change vif for p2p if.
Hante Meuleman [Fri, 8 Feb 2013 14:53:56 +0000 (15:53 +0100)]
brcmfmac: Reject change vif for p2p if.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Ignore E_ADD_IF for ifidx 0.
Hante Meuleman [Fri, 8 Feb 2013 14:53:55 +0000 (15:53 +0100)]
brcmfmac: Ignore E_ADD_IF for ifidx 0.

All interfaces for ifidx is 0 are created ahead and therefor
double registrations for not only bssidx 0, but ifidx 0 should
be ignored in brcfm_add_if.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Put printing action frames code under debug flag.
Hante Meuleman [Fri, 8 Feb 2013 14:53:54 +0000 (15:53 +0100)]
brcmfmac: Put printing action frames code under debug flag.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Use role from wdev on AP commands and fix stop_ap.
Hante Meuleman [Fri, 8 Feb 2013 14:53:53 +0000 (15:53 +0100)]
brcmfmac: Use role from wdev on AP commands and fix stop_ap.

Use the stored role in wdev struct to determine AP/GO role. This
simplifies code. Fix stop_ap for GO role.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Create p2p0 netdev via module variable.
Hante Meuleman [Fri, 8 Feb 2013 14:53:52 +0000 (15:53 +0100)]
brcmfmac: Create p2p0 netdev via module variable.

Add module variable with which a p2p0 netdev can be created. This
netdev can be used by wpa-supplicant to configure and set up the
p2p client/GO.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: change function signatures
Arend van Spriel [Fri, 8 Feb 2013 14:53:51 +0000 (15:53 +0100)]
brcmfmac: change function signatures

cfg80211 api change needs to be applied. this change will be squashed
with introducing commit:

commit 68751daec95b07a74b18aa22b2f9c196991dbe81
Author: Hante Meuleman <meuleman@broadcom.com>
Date:   Mon Nov 26 12:21:27 2012 +0100

    brcmfmac: add support for P2P listen mode.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Use real cookie value for p2p remain on channel.
Hante Meuleman [Fri, 8 Feb 2013 14:53:50 +0000 (15:53 +0100)]
brcmfmac: Use real cookie value for p2p remain on channel.

In some rare situations the wpa_supplicant can lock up on a remain
on channel command. Use actual cookies for the remain on channel
related commands and allow for additional remain on channel while
still having one set.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: P2P action frame tx.
Hante Meuleman [Fri, 8 Feb 2013 14:53:49 +0000 (15:53 +0100)]
brcmfmac: P2P action frame tx.

With this patch it is possible to send action frames.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Add handling of receiving P2P action frames.
Hante Meuleman [Fri, 8 Feb 2013 14:53:48 +0000 (15:53 +0100)]
brcmfmac: Add handling of receiving P2P action frames.

Once wpa_supplicant has registered for P2P action frames all received
action frames for the device are passed up to cfg80211.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Update AP mode for GO creation.
Hante Meuleman [Fri, 8 Feb 2013 14:53:47 +0000 (15:53 +0100)]
brcmfmac: Update AP mode for GO creation.

With this update it is possible to create an P2P go. Handle the
p2p go role in creation and the update beacon from cfg80211. Also
store primary bss in global struct. Needed to map cfg device
back to primary device.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Update connect setup/handling routines for multiple bss.
Hante Meuleman [Fri, 8 Feb 2013 14:53:46 +0000 (15:53 +0100)]
brcmfmac: Update connect setup/handling routines for multiple bss.

In preparation of p2p connections update the sta connect setup and
handling routines. Use join iovar and bsscfg commands where
applicable. Handle assoc ind per bsscfg (vif) and generalize
vndr ie setup to support assoc IEs and support all setup types,
e.g. sta, ap and p2p.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Fix bug mgmt_rx_register
Hante Meuleman [Fri, 8 Feb 2013 14:53:45 +0000 (15:53 +0100)]
brcmfmac: Fix bug mgmt_rx_register

Mask is OR-ed with value in case of deregister. Should
be AND-ed.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add p2p change vif routines.
Hante Meuleman [Fri, 8 Feb 2013 14:53:44 +0000 (15:53 +0100)]
brcmfmac: add p2p change vif routines.

Add support for changing existing interface into p2p go
interface.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: update p2p add and delete vif routines.
Hante Meuleman [Fri, 8 Feb 2013 14:53:43 +0000 (15:53 +0100)]
brcmfmac: update p2p add and delete vif routines.

Improve exception handling. Store and removed created vif
in cfg.p2p.bss array. Fix big endian bug. Fix msec jiffies bug.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: update escan for multiple bss and simplify.
Hante Meuleman [Fri, 8 Feb 2013 14:53:42 +0000 (15:53 +0100)]
brcmfmac: update escan for multiple bss and simplify.

Add support for scanning on non primary netdev (p2p) and
simplify the p2p scanning preparation.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: implement support for deleting virtual interfaces
Arend van Spriel [Fri, 8 Feb 2013 14:53:41 +0000 (15:53 +0100)]
brcmfmac: implement support for deleting virtual interfaces

Deletion of the virtual interface was not fully supported so
adding it now. Tested using p2p_connect command in wpa_supplicant.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix generation of the p2p related mac addresses
Arend van Spriel [Fri, 8 Feb 2013 14:53:40 +0000 (15:53 +0100)]
brcmfmac: fix generation of the p2p related mac addresses

The driver determines the P2P interface address and device
address from the primary mac address. However, the function
used an invalid input. This caused a mac address mismatch
between firmware and driver. This was hidden because the
brcmf_if_add() function corrected the error upon receiving
the IF_ADD event from firmware.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix compiler warning on printf format
Arend van Spriel [Fri, 8 Feb 2013 14:53:39 +0000 (15:53 +0100)]
brcmfmac: fix compiler warning on printf format

On 64-bit target a warning was given when using %d to print
sizeof() value:

  CC [M]  drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.o
brcm80211/brcmfmac/wl_cfg80211.c: In function 'brcmf_alloc_vif':
brcm80211/brcmfmac/wl_cfg80211.c:3884:2: error: format '%d' expects
argument of type 'int', but argument 3 has type 'long unsigned int'
[-Werror=format]

Fixed using %zu instead.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add support for P2P listen mode.
Hante Meuleman [Fri, 8 Feb 2013 14:53:38 +0000 (15:53 +0100)]
brcmfmac: add support for P2P listen mode.

With this patch a device can be put in p2p listen mode and becomes
visible for other p2p devices (via p2p_find).

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add support for creating P2P client/GO interface
Arend van Spriel [Fri, 8 Feb 2013 14:53:37 +0000 (15:53 +0100)]
brcmfmac: add support for creating P2P client/GO interface

This patch allow the creation of P2P client and group owner
virtual interfaces in the driver.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add peer-to-peer group discovery support
Arend van Spriel [Fri, 8 Feb 2013 14:53:36 +0000 (15:53 +0100)]
brcmfmac: add peer-to-peer group discovery support

First part for P2P support. It is a variation on the existing
scanning functionality and is used to discover peer-to-peer
group owners and/or peer-to-peer devices in listen state.

Tested with wpa_cli/wpa_supplicant v2.0-devel.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove unnecessary locking in trap info processing
Piotr Haber [Fri, 8 Feb 2013 11:06:35 +0000 (12:06 +0100)]
brcmfmac: remove unnecessary locking in trap info processing

Locking host access in trap info processing
is not needed as bus access functions do it on
their own.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: turn clocks on when reading shared info
Piotr Haber [Fri, 8 Feb 2013 11:06:34 +0000 (12:06 +0100)]
brcmfmac: turn clocks on when reading shared info

Make sure backplane clocks are on while reading crash data.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix mmc host locking issue
Piotr Haber [Fri, 8 Feb 2013 11:06:33 +0000 (12:06 +0100)]
brcmfmac: fix mmc host locking issue

fix wrong locking in crash info processing

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Check null pointer on brcmf_dev_reset.
Hante Meuleman [Fri, 8 Feb 2013 11:06:32 +0000 (12:06 +0100)]
brcmfmac: Check null pointer on brcmf_dev_reset.

When unloading it is possible that drvr is not null, but iflist[0]
is. So check iflist[0] pointer before using it.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: use brcmf_if::bssidx as index in interface list
Hante Meuleman [Fri, 8 Feb 2013 11:06:31 +0000 (12:06 +0100)]
brcmfmac: use brcmf_if::bssidx as index in interface list

Upon receiving an IF event from the firmware the interface
was created and stored on a list using the interface index.
With upcoming P2P feature the firmware will send a IF event
in which two interfaces have the same interface index. To
uniquely locate them on the list the bss index is now used.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwl8k: Remove unnecessary alloc/OOM messages
Joe Perches [Thu, 7 Feb 2013 20:37:47 +0000 (12:37 -0800)]
mwl8k: Remove unnecessary alloc/OOM messages

alloc failures already get standardized OOM
messages and a dump_stack.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: avoid 512 byte stack variable
Tim Gardner [Thu, 7 Feb 2013 20:28:09 +0000 (13:28 -0700)]
brcmsmac: avoid 512 byte stack variable

Dynamically allocate the probe response template which
avoids potential stack corruption. Observed with smatch:

drivers/net/wireless/brcm80211/brcmsmac/main.c:7412 brcms_c_bss_update_probe_resp()
 warn: 'prb_resp' puts 512 bytes on stack

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Seth Forshee <seth.forshee@canonical.com>
Cc: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list@broadcom.com
Cc: netdev@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: fix u16 overflow warning
Tim Gardner [Thu, 7 Feb 2013 19:35:35 +0000 (12:35 -0700)]
brcmsmac: fix u16 overflow warning

DOT11_MIN_BEACON_PERIOD and DOT11_MAX_BEACON_PERIOD are
superfluous. The only invalid beacon period is 0. Comparing
a 16 bit quantity to 0xffff also causes a compile warning:

drivers/net/wireless/brcm80211/brcmsmac/main.c:5560 brcms_c_set_beacon_period()
 warn: impossible condition '(period > 65535) => (0-65535 > 65535)'

Observed from smatch analysis.

Cc: Brett Rudley <brudley@broadcom.com>
Cc: Arend van Spriel <arend@broadcom.com>
Cc: "Franky (Zhenhui) Lin" <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Cc: Seth Forshee <seth.forshee@canonical.com>
Cc: Hauke Mehrtens <hauke@hauke-m.de>
Cc: linux-wireless@vger.kernel.org
Cc: brcm80211-dev-list@broadcom.com
Cc: netdev@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoNET: ath5k, check ath5k_eeprom_mode_from_channel retval
Jiri Slaby [Thu, 7 Feb 2013 13:44:40 +0000 (14:44 +0100)]
NET: ath5k, check ath5k_eeprom_mode_from_channel retval

It can, if invalid argument given, return a negative value. In that
case we would access arrays out-of-bounds and such. Check the value
and yell loudly if that happened as it would be a bug in the
implementation. (Instead of silently corrupting memory.)

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Nick Kossifidis <mickflemm@gmail.com>
Cc: "Luis R. Rodriguez" <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id
Larry Finger [Wed, 6 Feb 2013 18:54:17 +0000 (12:54 -0600)]
rtlwifi: rtl8192cu: Fix NULL dereference BUG when using new_id

When the new_id entry in /sysfs is used for a foreign USB device, rtlwifi
BUGS with a NULL pointer dereference because the per-driver configuration
data is not available. The probe function has been restructured as
suggested by Ben Hutchings <bhutchings@solarflare.com>.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix problem connecting to AP without security
Arend van Spriel [Wed, 6 Feb 2013 17:40:47 +0000 (18:40 +0100)]
brcmfmac: fix problem connecting to AP without security

The bcm43236 device showed having an issue connection to an AP without
security when auth_type was set to automatic. For this particular device
a workaround is made by selecting open-system. This problem does not
occur when using wpa_supplicant as it will not use auth type automatic.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add function to retrieve chip information
Arend van Spriel [Wed, 6 Feb 2013 17:40:46 +0000 (18:40 +0100)]
brcmfmac: add function to retrieve chip information

Added function to obtain chip information for chip specific
code.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: add chip information to the bus interface
Arend van Spriel [Wed, 6 Feb 2013 17:40:45 +0000 (18:40 +0100)]
brcmfmac: add chip information to the bus interface

Extend the bus interface with chip identifier and revision. This
will be used when certain devices need special handling in the
driver.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Use single function for channel to chanspec.
Hante Meuleman [Wed, 6 Feb 2013 17:40:44 +0000 (18:40 +0100)]
brcmfmac: Use single function for channel to chanspec.

Simplify code by using single function for converting channel to
chanspec. No need to set 40MHz flags, as they are not needed for
correct working in FW.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Cleanup function brcmf_notifiy_connect_status_ap.
Hante Meuleman [Wed, 6 Feb 2013 17:40:43 +0000 (18:40 +0100)]
brcmfmac: Cleanup function brcmf_notifiy_connect_status_ap.

Clean up function, removing some unnecessary code and
initialisation.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Update tracelogging for multiple netdevs.
Hante Meuleman [Wed, 6 Feb 2013 17:40:42 +0000 (18:40 +0100)]
brcmfmac: Update tracelogging for multiple netdevs.

When supporting multiple netdevs it is usefull to log idx in netdev
related functions. This will be used for features like P2P.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Track statistics per ifp.
Hante Meuleman [Wed, 6 Feb 2013 17:40:41 +0000 (18:40 +0100)]
brcmfmac: Track statistics per ifp.

Statistics were tracked by bus driver while it is to be tracked
per ifp/netdev.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Add logging for FIL int set/get cmds.
Hante Meuleman [Wed, 6 Feb 2013 17:40:40 +0000 (18:40 +0100)]
brcmfmac: Add logging for FIL int set/get cmds.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Track pending 8021x frames per ifp.
Hante Meuleman [Wed, 6 Feb 2013 17:40:39 +0000 (18:40 +0100)]
brcmfmac: Track pending 8021x frames per ifp.

Pending 8021x frames were tracked per dongle. This should be
done per ifp.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Use struct brcmf_if in brcmf_configure_opensecurity.
Hante Meuleman [Wed, 6 Feb 2013 17:40:38 +0000 (18:40 +0100)]
brcmfmac: Use struct brcmf_if in brcmf_configure_opensecurity.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Remove copy mac address from drvr at netdev up.
Hante Meuleman [Wed, 6 Feb 2013 17:40:37 +0000 (18:40 +0100)]
brcmfmac: Remove copy mac address from drvr at netdev up.

At netdev up the mac address from drvr is copied to netdev mac
address. This is incorrect and mac address was already set by
brcmf_net_attach by copying it from ifp.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Remove drvr_up from bus interface.
Hante Meuleman [Wed, 6 Feb 2013 17:40:36 +0000 (18:40 +0100)]
brcmfmac: Remove drvr_up from bus interface.

The tracking of up/down status in bus interface is unnecessary.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agop54usb: corrected USB ID for T-Com Sinus 154 data II
Tomasz Guszkowski [Tue, 5 Feb 2013 21:10:31 +0000 (22:10 +0100)]
p54usb: corrected USB ID for T-Com Sinus 154 data II

Corrected USB ID for T-Com Sinus 154 data II. ISL3887-based. The
device was tested in managed mode with no security, WEP 128
bit and WPA-PSK (TKIP) with firmware 2.13.1.0.lm87.arm (md5sum:
7d676323ac60d6e1a3b6d61e8c528248). It works.

Signed-off-by: Tomasz Guszkowski <tsg@o2.pl>
Cc: <stable@vger.kernel.org>
Acked-By: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwl8k: add single band 88W8366 PCI device IDs
Jonas Gorski [Tue, 5 Feb 2013 15:59:17 +0000 (16:59 +0100)]
mwl8k: add single band 88W8366 PCI device IDs

Add PCI deviceIDs for single band versions of 88W8366, found e.g. in
simultaneous dual band routers based on kirkwood.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agonet: wireless/rtlwifi: fix uninitialized variable issue
Cong Ding [Mon, 4 Feb 2013 21:43:22 +0000 (22:43 +0100)]
net: wireless/rtlwifi: fix uninitialized variable issue

The use of variable packet_beacon might be uninitialized in the two files,
which is same as this patch:
https://patchwork.kernel.org/patch/2006711/

Signed-off-by: Cong Ding <dinggnu@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowireless: rt2x00: rt2800usb add Sweex ids
Xose Vazquez Perez [Sat, 2 Feb 2013 02:33:44 +0000 (03:33 +0100)]
wireless: rt2x00: rt2800usb add Sweex ids

Info coming from Sweex Windows driver and wikidevi.com
0x177f,0x0163 Sweex LW163 RT3370 1x1, int. antenna
0x177f,0x0164 Sweex LW164 RT8070 1x1, Nano dongle
0x177f,0x0165 Sweex LW165 RT3370 1x1, ext. antenna
0x177f,0x0324 Sweex LW324 RT3072 2x2  with 32Mb NOR flash, autoinstall

Cc: Ivo van Doorn <IvDoorn@gmail.com>
Cc: Gertjan van Wingerde <gwingerde@gmail.com>
Cc: Helmut Schaa <helmut.schaa@googlemail.com>
Cc: John W. Linville <linville@tuxdriver.com>
Cc: users@rt2x00.serialmonkey.com
Cc: linux-wireless@vger.kernel.org
Signed-off-by: Xose Vazquez Perez <xose.vazquez@gmail.com>
Acked-by: Gertjan van Wingerde <gwingerde@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoNFC: llcp: integer underflow in nfc_llcp_set_remote_gb()
Dan Carpenter [Thu, 31 Jan 2013 08:16:46 +0000 (11:16 +0300)]
NFC: llcp: integer underflow in nfc_llcp_set_remote_gb()

If gb_len is less than 3 it would cause an integer underflow and
possibly memory corruption in nfc_llcp_parse_gb_tlv().

I removed the old test for gb_len == 0.  I also removed the test for
->remote_gb == NULL.  It's not possible for ->remote_gb to be NULL and
we have already dereferenced ->remote_gb_len so it's too late to test.

The old test return -ENODEV but my test returns -EINVAL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.9-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Fri, 8 Feb 2013 19:42:37 +0000 (14:42 -0500)]
Merge tag 'nfc-next-3.9-2' of git://git./linux/kernel/git/sameo/nfc-next

Samuel says:

"This is the 2nd NFC pull request.

With this one we have a new NFC driver for Inside Secure microread and a few
pn533 fixes.
Microread is an HCI based NFC IP and the driver we're pushing supports tags
R/W, and NFC p2p. It's supported over the i2c and MEI busses."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca...
John W. Linville [Fri, 8 Feb 2013 19:41:45 +0000 (14:41 -0500)]
Merge branch 'for-linville' of git://git./linux/kernel/git/luca/wl12xx

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Fri, 8 Feb 2013 19:23:51 +0000 (14:23 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

Fixed-up drivers/net/wireless/iwlwifi/mvm/mac80211.c to change change
IEEE80211_HW_NEED_DTIM_PERIOD to IEEE80211_HW_NEED_DTIM_BEFORE_ASSOC
as requested by Johannes Berg. -- JWL

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoNFC: pn533: Fix target polling mode
Thierry Escande [Tue, 5 Feb 2013 09:08:35 +0000 (10:08 +0100)]
NFC: pn533: Fix target polling mode

Remove unneeded bitwise OR operator on uninitialized sk_buff data

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: microread: Add MEI physical layer
Samuel Ortiz [Mon, 14 Jan 2013 19:35:22 +0000 (20:35 +0100)]
NFC: microread: Add MEI physical layer

On some peculiar worlds, microreads are found hidden behind MEIs and needs
to be accessed through the ME bus.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agowlcore: fix wrong remote rates when starting STA role
Luciano Coelho [Thu, 7 Feb 2013 09:35:33 +0000 (11:35 +0200)]
wlcore: fix wrong remote rates when starting STA role

In wl18xx, we use a new ACX command in order to set the remote
supported rates, once we know it (ie. after association).  The wl12xx
firmware doesn't support changing the rates after the STA is started,
so we need to use all supported rates.

Commit 530abe19 (wlcore: add ACX_PEER_CAP command) broke that by using
wlvif->rate_set when starting the STA role.

Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowl18xx: add new phy configuration parameters for telec support
Victor Goldenshtein [Thu, 27 Dec 2012 13:49:47 +0000 (15:49 +0200)]
wl18xx: add new phy configuration parameters for telec support

Add back-off settings to the wl18xx_mac_and_phy_params.  We had an
empty space where the new parameters are added, so this change doesn't
affect backwards-compatibility with older firmwares.

Update WL18XX_CONF_VERSION accordingly.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: don't hide real error code when booting fails
Luciano Coelho [Wed, 30 Jan 2013 08:53:14 +0000 (10:53 +0200)]
wlcore: don't hide real error code when booting fails

There's no need to hide the actual error that was reported when
booting fails.  For instance, on I/O error, we were returing
-EINVALID, which doesn't make sense at all.

Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: move wl12xx_platform_data up and make it truly optional
Luciano Coelho [Fri, 25 Jan 2013 10:05:34 +0000 (12:05 +0200)]
wlcore: move wl12xx_platform_data up and make it truly optional

The platform data is used not only by wlcore-based drivers, but also
by wl1251.  Move it up in the directory hierarchy to reflect this.

Additionally, make it truly optional.  At the moment, disabling
platform data while wl1251_sdio or wlcore_sdio are enabled doesn't
work, but it will be necessary when device tree support is
implemented.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
11 years agowlcore: use PLATFORM_DEVID_AUTO for plat dev creation to avoid conflicts
Luciano Coelho [Wed, 23 Jan 2013 14:40:37 +0000 (16:40 +0200)]
wlcore: use PLATFORM_DEVID_AUTO for plat dev creation to avoid conflicts

The platform devices can be created by both wlcore_sdio and
wlcore_spi.  Theoretically, if both are connected to the same board,
there will be a conflict.

Reported-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: use wl12xx_platform_data pointer from wlcore_pdev_data
Luciano Coelho [Wed, 23 Jan 2013 14:40:36 +0000 (16:40 +0200)]
wlcore: use wl12xx_platform_data pointer from wlcore_pdev_data

Just a small cleanup to use the pointer provided by wlcore_pdev_data
instead of using a separate pointer then copying.

Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agowlcore: remove if_ops from platform_data
Luciano Coelho [Fri, 25 Jan 2013 09:57:48 +0000 (11:57 +0200)]
wlcore: remove if_ops from platform_data

We can't pass pointers from the platform data to the modules, because
with DT it cannot be done.  Those pointers are not set by the board
files anyway.  It's the bus modules that set them, so they can be
safely removed from the platform data without changing any board
files.

Create a new structure that the bus modules pass to wlcore.  This
structure contains the if_ops pointers and a pointer to the actual
platform data.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
11 years agowlcore: remove unused set_power method
Luciano Coelho [Wed, 23 Jan 2013 14:40:34 +0000 (16:40 +0200)]
wlcore: remove unused set_power method

There is no platform-specific set_power method anymore.  Power setting
is done in the bus modules (wlcore_sdio and wlcore_spi).

Signed-off-by: Luciano Coelho <coelho@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
11 years agowlcore: use single-role version when verifying the PLT firmware
Luciano Coelho [Wed, 12 Dec 2012 08:14:22 +0000 (10:14 +0200)]
wlcore: use single-role version when verifying the PLT firmware

The PLT firmware used by wl12xx for calibration always has the same
version number as the single-role firmware.

Currntly the driver rejects the PLT firmware since anything that is
not single-role uses the multi-role version.  Fix this by using the
single-role version for everything except multi-role.

Signed-off-by: Luciano Coelho <coelho@ti.com>
11 years agomac80211: stop plink timer only on mesh interfaces
Thomas Pedersen [Mon, 4 Feb 2013 22:12:41 +0000 (14:12 -0800)]
mac80211: stop plink timer only on mesh interfaces

Since mesh_plink_quiesce() would unconditionally delete
the plink timer, and the timer initialization was recently
moved into the mesh code path, suspending with a non-mesh
interface now causes a crash. Fix this by only deleting
the plink timer for mesh interfaces.

Reported-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Tested-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomac80211: mesh power save basics
Marco Porsch [Wed, 30 Jan 2013 17:14:08 +0000 (18:14 +0100)]
mac80211: mesh power save basics

Add routines to
- maintain a PS mode for each peer and a non-peer PS mode
- indicate own PS mode in transmitted frames
- track neighbor STAs power modes
- buffer frames when neighbors are in PS mode
- add TIM and Awake Window IE to beacons
- release frames in Mesh Peer Service Periods

Add local_pm to sta_info to represent the link-specific power
mode at this station towards the remote station. When a peer
link is established, use the default power mode stored in mesh
config. Update the PS status if the peering status of a neighbor
changes.
Maintain a mesh power mode for non-peer mesh STAs. Set the
non-peer power mode to active mode during peering. Authenticated
mesh peering is currently not working when either node is
configured to be in power save mode.

Indicate the current power mode in transmitted frames. Use QoS
Nulls to indicate mesh power mode transitions.
For performance reasons, calls to the function setting the frame
flags are placed in HWMP routing routines, as there the STA
pointer is already available.

Add peer_pm to sta_info to represent the peer's link-specific
power mode towards the local station. Add nonpeer_pm to
represent the peer's power mode towards all non-peer stations.
Track power modes based on received frames.

Add the ps_data structure to ieee80211_if_mesh (for TIM map, PS
neighbor counter and group-addressed frame buffer).

Set WLAN_STA_PS flag for STA in PS mode to use the unicast frame
buffering routines in the tx path. Update num_sta_ps to buffer
and release group-addressed frames after DTIM beacons.

Announce the awake window duration in beacons if in light or
deep sleep mode towards any peer or non-peer. Create a TIM IE
similarly to AP mode and add it to mesh beacons. Parse received
Awake Window IEs and check TIM IEs for buffered frames.

Release frames towards peers in mesh Peer Service Periods. Use
the corresponding trigger frames and monitor the MPSP status.
Append a QoS Null as trigger frame if neccessary to properly end
the MPSP. Currently, in HT channels MPSPs behave imperfectly and
show large delay spikes and frame losses.

Signed-off-by: Marco Porsch <marco@cozybit.com>
Signed-off-by: Ivan Bezyazychnyy <ivan.bezyazychnyy@gmail.com>
Signed-off-by: Mike Krinkin <krinkin.m.u@gmail.com>
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: wrap BSS kref
Johannes Berg [Fri, 1 Feb 2013 00:34:36 +0000 (01:34 +0100)]
cfg80211: wrap BSS kref

Add inline wrappers for the BSS struct krefs
to be able to extend them easily later.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agocfg80211: remove a local variable
Johannes Berg [Fri, 1 Feb 2013 00:19:48 +0000 (01:19 +0100)]
cfg80211: remove a local variable

This local variable is only used once, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>