platform/kernel/linux-amlogic.git
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Tue, 12 Feb 2013 16:06:52 +0000 (11:06 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

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 agoath6kl: provide 64-bit per-station byte counters
Vladimir Kondratiev [Tue, 5 Feb 2013 09:44:48 +0000 (11:44 +0200)]
ath6kl: provide 64-bit per-station byte counters

Internally, 64-bit byte counters maintained for per-station
statistics. Tell to the netlink that full 64-bit value provided

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowlcore: remove newly introduced alloc/OOM messages
Luciano Coelho [Mon, 11 Feb 2013 08:21:18 +0000 (10:21 +0200)]
wlcore: remove newly introduced alloc/OOM messages

In commit 0d2e7a5c (wireless: Remove unnecessary alloc/OOM messages,
alloc cleanups) OOM messages after alloc were removed from the wlcore
modules.

Commit afb43e6d (wlcore: remove if_ops from platform_data)
reintroduced a couple of those.  This patch removes them.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Reviewed-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agowireless: rt2x00: rt2800usb add "unknown" devices
Xose Vazquez Perez [Sat, 9 Feb 2013 03:14:35 +0000 (04:14 +0100)]
wireless: rt2x00: rt2800usb add "unknown" devices

0x06f8, 0xe036 Hercules  Wireless Dual Band 600 USB Key HWNUm-600
0x0b05, 0x17a7 ASUS      USB-N10H 150Mbps 11n Wireless USB dongle
0x0df6, 0x0069 Sitecom   Wireless Dualband Network Adapter 300N X5 WLA-5000
0x0df6, 0x006f Sitecom   WiFi USB adapter N600 WLA-5100
0x13d3, 0x3340 AzureWave 802.11n USB Wireless LAN Card
0x13d3, 0x3399 AzureWave 802.11n USB Wireless LAN Card
0x13d3, 0x3400 AzureWave 802.11n USB Wireless LAN Card
0x13d3, 0x3401 AzureWave 802.11n USB Wireless LAN Card
0x1740, 0x0600 EnGenius  Dual-Band Wireless Media Adapter
0x1740, 0x0602 EnGenius  802.11 a/b/g/n Wireless USB Adapter
0x177f, 0x0254 Sweex     LW054 Wireless 54G Adapter USB
0xf201, 0x5370 TP-LINK   54Mbps Wireless USB Adapter

no RF3053, and I believe no RT5572.

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>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: add PCIe8897 support
Avinash Patil [Sat, 9 Feb 2013 02:18:09 +0000 (18:18 -0800)]
mwifiex: add PCIe8897 support

This patch adds PCIe8897 support to mwifiex.
In PCIe8897 PFU (pre-fetch unit) is enabled by default.
This patch adds support to accommodate this feaure as well.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Frank Huang <frankh@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: define generic data type for PCIe ring buffers
Avinash Patil [Sat, 9 Feb 2013 02:18:08 +0000 (18:18 -0800)]
mwifiex: define generic data type for PCIe ring buffers

This patch defines PCIe ring buffer array pointer as void instead
of mwifiex_pcie_buf_desc. This will enable us to use same pointers
for ring operations instead of new structures if buffer descriptor
structure changes.

Also split out event buffer descriptor structure from struct
mwifiex_pcie_buf_desc. For PCIe8766 TX/RX buffer descriptor is
same as evevt buffer descriptor. Newer chips could use different
TX/RX buffer descriptor while event descriptor remains the same.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: separate ring initialization and ring creation routines
Avinash Patil [Sat, 9 Feb 2013 02:18:07 +0000 (18:18 -0800)]
mwifiex: separate ring initialization and ring creation routines

This patch separates PCIe ring initialization from ring creation
routines. This modularizes ring creation(TXBD, RXBD and event
rings) functions.

Readability has been improved while moving the code around.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: store card specific data in PCI device table entry
Avinash Patil [Sat, 9 Feb 2013 02:18:06 +0000 (18:18 -0800)]
mwifiex: store card specific data in PCI device table entry

This patch adds support for storing PCIe device specific data
into driver_data structure of pci_device_id. When a device with
known device_id is probed, we use this driver_data to populate
card specific structres in driver.
This enables to remove device specific defines for scratch
registers, firmware name, FW download block size, etc. from
source code.

This will make addition of support for new chipsets a lot easier.

Signed-off-by: Avinash Patil <patila@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix IBSS joiner mode
Sujith Manoharan [Mon, 4 Feb 2013 10:08:24 +0000 (15:38 +0530)]
ath9k: Fix IBSS joiner mode

On joining an existing IBSS network, beaconing has to start
only after a TSF sync has happened by receiving a beacon from
the BSS. In creator mode, beaconing can start immediately after
a HW reset has been done.

Now that mac80211 notifies the driver of the mode type (creator/joiner)
via ieee80211_bss_conf->ibss_creator, make use of it to properly setup
the HW beacon timers.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Fix ATH9K_HW_CAP_HT usage
Sujith Manoharan [Mon, 4 Feb 2013 10:08:23 +0000 (15:38 +0530)]
ath9k: Fix ATH9K_HW_CAP_HT usage

There are a few places where the station's HT capabilities
should be checked instead of ATH9K_HW_CAP_HT, which is a global
feature for the driver. Fix this.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.9-3' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Mon, 11 Feb 2013 20:30:47 +0000 (15:30 -0500)]
Merge tag 'nfc-next-3.9-3' of git://git./linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"This 3rd NFC pull request for 3.9 contains a fix for the microread MEI
physical layer support, as the MEI bus API changed.

From the MEI code, we now pass the MEI id back to the driver probe routine,
and we also pass a name and a MEI id table through the mei_bus_driver
structure. A few renames as well like e.g. mei_bus_driver to mei_driver or
mei_bus_client to mei_device in order to be closer to the driver model
practices."

Signed-off-by: John W. Linville <linville@tuxdriver.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 agoNFC: microread: Fix mei physical layer
Samuel Ortiz [Mon, 11 Feb 2013 09:30:04 +0000 (10:30 +0100)]
NFC: microread: Fix mei physical layer

The MEI bus API changed according to the latest comments from the char-misc
maintainers, and this patch fixes the microread mei physical layer code
according to those changes:
We pass the MEI id back to the probe routine, and the mei_driver takes a
table of MEI ids instead of one static id.
Also, mei_bus_driver got renamed to mei_driver, mei_bus_client to
mei_device, and mei_bus_set/get_clientdata to mei_set/get_clientdata.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
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>