platform/upstream/kernel-adaptation-pc.git
11 years agoMerge branch 'for-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/bluetoot...
John W. Linville [Wed, 21 Nov 2012 18:03:00 +0000 (13:03 -0500)]
Merge branch 'for-upstream' of git://git./linux/kernel/git/bluetooth/bluetooth-next

11 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
John W. Linville [Wed, 21 Nov 2012 17:57:56 +0000 (12:57 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless

Conflicts:
drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
drivers/net/wireless/iwlwifi/pcie/tx.c

11 years agobrcmfmac: include linux/vmalloc.h from usb.c
John W. Linville [Mon, 19 Nov 2012 16:04:28 +0000 (11:04 -0500)]
brcmfmac: include linux/vmalloc.h from usb.c

This avoids build failures on some architectures...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
11 years agobrcmfmac: check return from kzalloc in brcmf_fweh_process_event
John W. Linville [Mon, 19 Nov 2012 15:53:32 +0000 (10:53 -0500)]
brcmfmac: check return from kzalloc in brcmf_fweh_process_event

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
11 years agobrcmsmac: Remove some noisy and uninformative debug messages
Seth Forshee [Thu, 15 Nov 2012 14:08:12 +0000 (08:08 -0600)]
brcmsmac: Remove some noisy and uninformative debug messages

These messages clutter up the trace buffer without adding any useful
information.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add tracepoint for AMPDU session information
Seth Forshee [Thu, 15 Nov 2012 14:08:11 +0000 (08:08 -0600)]
brcmsmac: Add tracepoint for AMPDU session information

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add tracepoint for macintstatus
Seth Forshee [Thu, 15 Nov 2012 14:08:10 +0000 (08:08 -0600)]
brcmsmac: Add tracepoint for macintstatus

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Improve tx trace and debug support
Seth Forshee [Thu, 15 Nov 2012 14:08:09 +0000 (08:08 -0600)]
brcmsmac: Improve tx trace and debug support

Add the brcmsmac_tx trace system for tx debugging. Existing code to dump
tx status and descriptors are converted to using tracepoints, allowing
for more efficient collection and post-processing of this data. These
tracepoints are placed to collect data for all tx frames instead of only
on errors. Logging of tx errors is also improved.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_ht() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:08 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_ht() debug macro

Also convert relevant messages to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_dma() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:07 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_dma() debug macro

Also convert relevant messages to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_int() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:06 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_int() debug macro

Also convert relevant message to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add rx and tx debug macros
Seth Forshee [Thu, 15 Nov 2012 14:08:05 +0000 (08:08 -0600)]
brcmsmac: Add rx and tx debug macros

Also convert relevant messages over to use thses macros.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add brcms_dbg_mac80211() debug macro
Seth Forshee [Thu, 15 Nov 2012 14:08:04 +0000 (08:08 -0600)]
brcmsmac: Add brcms_dbg_mac80211() debug macro

This macro is used for messages related to the 802.11 MAC layer.
Relevant messages are also converted to use this macro.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Use debug macros for general error and debug statements
Seth Forshee [Thu, 15 Nov 2012 14:08:03 +0000 (08:08 -0600)]
brcmsmac: Use debug macros for general error and debug statements

Convert most uses of wiphy_* and pr_* for general error and debug
messages to use the internal debug macros instead. Most code used only
for initialization still use wiphy_err(), as well as some locations
which are executed too early to use the debug macros. Some debug
messages which are redundant or not useful are removed.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add support for writing debug messages to the trace buffer
Seth Forshee [Thu, 15 Nov 2012 14:08:02 +0000 (08:08 -0600)]
brcmsmac: Add support for writing debug messages to the trace buffer

Add a new brcmsmac_msg trace system to enable writing of debug messages
to the trace buffer, and add brcms_* macros for storing device debug
messages in the trace buffer in addition to the printk log buffer.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add module parameter for setting the debug level
Seth Forshee [Thu, 15 Nov 2012 14:08:01 +0000 (08:08 -0600)]
brcmsmac: Add module parameter for setting the debug level

The debug level can be set by passing debug=... to brcmsmac whenever
CONFIG_BRCMDBG is enabled.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcm80211: Convert log message levels to debug levels
Seth Forshee [Thu, 15 Nov 2012 14:08:00 +0000 (08:08 -0600)]
brcm80211: Convert log message levels to debug levels

In preparation for enhancements to debug and trace support, convert the
message levels to debug levels which will be used for enabling
categories of debug messages. The two message levels are little-used
anyway and are combined into the BRCM_DL_INFO debug level.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcm80211: Allow trace support to be enabled separately from debug
Seth Forshee [Thu, 15 Nov 2012 14:07:59 +0000 (08:07 -0600)]
brcm80211: Allow trace support to be enabled separately from debug

Since the runtime overhead of trace support is small when tracing is
disabled, users may be interested in turning on trace support while
leaving other debug features off. Add a new config option named
CONFIG_BRCM_TRACING for this purpose.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Reduce number of entries in tx DMA rings
Seth Forshee [Thu, 15 Nov 2012 14:07:58 +0000 (08:07 -0600)]
brcmsmac: Reduce number of entries in tx DMA rings

Currently up to 256 frames can be queued for each DMA ring. This is
excessive, and now that we have better flow control we can get by with
less. Experimentation has shown 64 to work well.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Use correct descriptor count when calculating next rx descriptor
Seth Forshee [Thu, 15 Nov 2012 14:07:57 +0000 (08:07 -0600)]
brcmsmac: Use correct descriptor count when calculating next rx descriptor

nextrxd() is calling txd(), which means that the tx descriptor count is
used to determine when to wrap for determining the next ring buffer
entry. This has worked so far since the driver has been using the same
number of rx and tx descriptors, but it's obviously going to be a
problem if different numbers of descriptors are used.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Remove internal tx queue
Seth Forshee [Thu, 15 Nov 2012 14:07:56 +0000 (08:07 -0600)]
brcmsmac: Remove internal tx queue

The brcmsmac internal tx buffering is problematic. The amount of
buffering is excessive (228 packets in addition to the 256 slots in each
DMA ring), and frames may be dropped due to a lack of flow control.

This patch reworks the transmit code path to remove the internal
buffering. Frames are immediately handed off to the DMA support rather
than passing through an intermediate queue. Non-aggregate frames are
queued immediately into the tx rings, and aggregate frames are queued
temporarily in an AMPDU session until ready for transmit.

Transmit flow control is also added to avoid dropping packets when the
tx rings are full. Conceptually this is a separate change, but it's
included in this commit because removing the tx queue without adding
flow control could cause significant problems.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Use IEEE 802.11 AC levels for pktq precedence levels
Seth Forshee [Thu, 15 Nov 2012 14:07:55 +0000 (08:07 -0600)]
brcmsmac: Use IEEE 802.11 AC levels for pktq precedence levels

The mac80211 tx queues and brcmsmac DMA fifos both map directly to AC
levels. Therefore it's much more straightforward to queue tx frames and
choose the tx fifo based on the mac80211 queue instead of mapping 802.1D
priority tags to precedence levels then back to AC levels. mac80211
already maps the 802.1D levels to the appropriate AC levels and queues
management frames at the maximum priority, so the results should be
identical.

One functional change resulting from this patch is that AMPDU retries no
longer get a priority boost to queue them ahead of packets with the same
priority already in the tx queue. This behavior will be restored (in
effect at least) in a later patch when the tx queue is removed.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Remove unimplemented flow control functions
Seth Forshee [Thu, 15 Nov 2012 14:07:54 +0000 (08:07 -0600)]
brcmsmac: Remove unimplemented flow control functions

Functions for flow control exist but remain unimplemented. Remove these
in advance of adding real flow control.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Add helper function for updating txavail count
Seth Forshee [Thu, 15 Nov 2012 14:07:53 +0000 (08:07 -0600)]
brcmsmac: Add helper function for updating txavail count

Use this helper function rather than open-coding the same calculation in
multiple places.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Don't weight AMPDU packets in txfifo
Seth Forshee [Thu, 15 Nov 2012 14:07:52 +0000 (08:07 -0600)]
brcmsmac: Don't weight AMPDU packets in txfifo

According to the comments this "reduces rate lag," but in reality the
only way this value is used is for determining whether or not any frames
remain to be transmitted. Therefore there's no reason for AMPDU packets
to receive any weighting.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmsmac: Introduce AMPDU sessions for assembling AMPDUs
Seth Forshee [Thu, 15 Nov 2012 14:07:51 +0000 (08:07 -0600)]
brcmsmac: Introduce AMPDU sessions for assembling AMPDUs

AMPDU session allows MPDUs to be temporarily queued until either a full
AMPDU has been collected or circumstances dictate that transmission
should start with a partial AMPDU. Packets are added to the session by
calling brcms_c_ampdu_add_frame(). brcms_c_ampdu_finalize() should be
called to fix up the tx headers in the first and last packet before
adding the packets to the DMA ring. brmcs_c_sendampdu() is converted to
using AMPDU sessions.

This patch has no real value on it's own, but is needed in preparation
for elimination of the tx packet queue from brcmsmac.

Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Daniel Wagner <wagi@monom.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-next-3.8-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Tue, 20 Nov 2012 18:22:03 +0000 (13:22 -0500)]
Merge tag 'nfc-next-3.8-2' of git://git./linux/kernel/git/sameo/nfc-3.0

Samuel says:

"This is the 2nd NFC pull request for 3.8.

With this one we have:

- A few HCI improvements in preparation for an upcoming HCI chipset support.
- A pn544 code cleanup after the old driver was removed.
- An LLCP improvement for notifying user space when one peer stops ACKing I
  frames."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoMerge tag 'nfc-fixes-3.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Tue, 20 Nov 2012 18:08:14 +0000 (13:08 -0500)]
Merge tag 'nfc-fixes-3.7-1' of git://git./linux/kernel/git/sameo/nfc-3.0

Samuel says:

"This is the first pull request for 3.7 NFC fixes.

We mostly have pn533 fixes here, 2 memory leaks and an early unlocking fix.
Moreover, we also have an LLCP adapter linked list insertion fix."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoBluetooth: Remove OOB data if device was discovered in band
Szymon Janc [Tue, 20 Nov 2012 10:38:54 +0000 (11:38 +0100)]
Bluetooth: Remove OOB data if device was discovered in band

OOB authentication mechanism should be used only if pairing process
has been activated by previous OOB information exchange (Core Spec
4.0 , vol. 1, Part A, 5.1.4.3). Stored OOB data for specific device
should be removed if that device was discovered in band later on.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Acked-by: Johan Hedberg <johan.hedberg@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: AMP: Set no FCS for incoming L2CAP chan
Andrei Emeltchenko [Tue, 20 Nov 2012 15:16:22 +0000 (17:16 +0200)]
Bluetooth: AMP: Set no FCS for incoming L2CAP chan

When receiving L2CAP Create Channel Request set the channel as
L2CAP_FCS_NONE. Then in "L2CAP Config req" following field will
be set: "FCS Option 0x00 (No FCS)". So by default High Speed
channels have no FCS.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Improve error message printing
Andrei Emeltchenko [Tue, 20 Nov 2012 15:16:21 +0000 (17:16 +0200)]
Bluetooth: Improve error message printing

Instead of printing:
"[ 7763.082007] Bluetooth: 2"
print something like:
"[ 7763.082007] Bluetooth: Trailing bytes: 2 in sframe"

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Set local_amp_id after getting Phylink Completed evt
Andrei Emeltchenko [Tue, 20 Nov 2012 15:16:20 +0000 (17:16 +0200)]
Bluetooth: Set local_amp_id after getting Phylink Completed evt

local_amp_id is used in l2cap_physical_cfm and shall be set up
before calling it.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Fix sending L2CAP Create Chan Req
Andrei Emeltchenko [Tue, 20 Nov 2012 15:16:19 +0000 (17:16 +0200)]
Bluetooth: Fix sending L2CAP Create Chan Req

When receiving Physical Link Completed event we need to create L2CAP
channel with L2CAP Create Chan Request. Current code was sending
this command only if connection was pending (which is probably
needed in channel move case). If channel is not moved but created
Create Chan should be sent for outgoing channel which is checked
with BT_CONNECT flag.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoNFC: Fix pn533 target mode memory leak
Thierry Escande [Thu, 15 Nov 2012 17:24:28 +0000 (18:24 +0100)]
NFC: Fix pn533 target mode memory leak

In target mode, sent sk_buff were not freed in pn533_tm_send_complete

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Fix mem leak in pn533_in_dep_link_up
Waldemar Rymarkiewicz [Thu, 11 Oct 2012 12:04:00 +0000 (14:04 +0200)]
NFC: pn533: Fix mem leak in pn533_in_dep_link_up

cmd is allocated in pn533_dep_link_up and passed as an arg to
pn533_send_cmd_frame_async together with a complete cb.

arg is passed to the cb and must be kfreed there.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Fix use after free
Szymon Janc [Mon, 29 Oct 2012 13:04:43 +0000 (14:04 +0100)]
NFC: pn533: Fix use after free

cmd was freed in pn533_dep_link_up regardless of
pn533_send_cmd_frame_async return code. Cmd is passed as argument to
pn533_in_dep_link_up_complete callback and should be freed there.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: pn533: Fix missing lock while operating on commands list
Szymon Janc [Thu, 25 Oct 2012 15:29:45 +0000 (17:29 +0200)]
NFC: pn533: Fix missing lock while operating on commands list

In pn533_wq_cmd command was removed from list without cmd_lock held
(race with pn533_send_cmd_frame_async) which could lead to list
corruption. Delete command from list before releasing lock.

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix nfc_llcp_local chained list insertion
Thierry Escande [Fri, 12 Oct 2012 13:25:43 +0000 (15:25 +0200)]
NFC: Fix nfc_llcp_local chained list insertion

list_add was called with swapped parameters

Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Queue a copy of the transmitted LLCP skb
Samuel Ortiz [Thu, 1 Nov 2012 22:36:07 +0000 (23:36 +0100)]
NFC: Queue a copy of the transmitted LLCP skb

Drivers are allowed to modify the sent skb and thus we need to make a copy
of it before passing it to the driver. Without this fix, LLCP Tx skbs were
not queued properly as the ptype check was failing due to e.g. the pn533
driver skb_pushing the Tx skb.

Reported-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Stop sending LLCP frames when tx queues are getting too deep
Samuel Ortiz [Thu, 1 Nov 2012 22:33:00 +0000 (23:33 +0100)]
NFC: Stop sending LLCP frames when tx queues are getting too deep

When the tx pending queues and/or the socket tx queue is getting too deep,
we have to let userspace know. We won't be queueing any more frames until
the congestion is fixed.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Copy user space buffer when sending UI frames
Samuel Ortiz [Mon, 29 Oct 2012 13:02:17 +0000 (14:02 +0100)]
NFC: Copy user space buffer when sending UI frames

Using the userspace IO vector directly is wrong, we should copy it from
user space first.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoMAINTAINERS: Add reference to pn544.h platform data header
Marcel Holtmann [Wed, 24 Oct 2012 18:45:38 +0000 (11:45 -0700)]
MAINTAINERS: Add reference to pn544.h platform data header

The platform data header for PN544 based NFC devices should
also be mentioned here.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Move pn544.h to linux/platform_data/
Marcel Holtmann [Wed, 24 Oct 2012 18:45:26 +0000 (11:45 -0700)]
NFC: Move pn544.h to linux/platform_data/

The pn544.h just provides the platform data struct and defines and
nothing else. So move it to to linux/platform_data/ now.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Remove unused details from pn544.h header file
Marcel Holtmann [Wed, 24 Oct 2012 18:45:12 +0000 (11:45 -0700)]
NFC: Remove unused details from pn544.h header file

The majority of the defines and structures from pn544.h are no
longer in use. So just remove them.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Export nfc_hci_sak_to_protocol()
Eric Lapuyade [Tue, 23 Oct 2012 09:37:43 +0000 (11:37 +0200)]
NFC: Export nfc_hci_sak_to_protocol()

Some HCI drivers will need it.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Export nfc_hci_result_to_errno as it can be needed by HCI drivers
Eric Lapuyade [Wed, 17 Oct 2012 14:50:10 +0000 (16:50 +0200)]
NFC: Export nfc_hci_result_to_errno as it can be needed by HCI drivers

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Dot not dispatch HCI event received on unopened pipe
Eric Lapuyade [Wed, 17 Oct 2012 14:49:12 +0000 (16:49 +0200)]
NFC: Dot not dispatch HCI event received on unopened pipe

A chip with pre-opened gates may send events on a gate that nobody
has opened in the handset host. Discard those events.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Ignore err when chip doesn't implement HW/SW info registers
Eric Lapuyade [Wed, 17 Oct 2012 14:48:21 +0000 (16:48 +0200)]
NFC: Ignore err when chip doesn't implement HW/SW info registers

NFC_HCI_ID_MGMT_VERSION_SW and NFC_HCI_ID_MGMT_VERSION_HW are optional
registers for gate NFC_HCI_ID_MGMT_GATE in standard HCI. When chip
doesn't implement, just leave all the information as zeros.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoNFC: Fix hci_connect_gate() when a pre-opened pipe is passed
Eric Lapuyade [Wed, 17 Oct 2012 14:47:13 +0000 (16:47 +0200)]
NFC: Fix hci_connect_gate() when a pre-opened pipe is passed

In some cases, pre-opened pipes don't stay open when a clear all pipes
command is sent. They stay created however. Therefore, one can never
assume that such a pipe is already open. As re-opening a pipe seems not
to be a problem, we do that now.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
11 years agoBluetooth: Increase HCI command tx timeout
Szymon Janc [Mon, 12 Nov 2012 10:01:05 +0000 (11:01 +0100)]
Bluetooth: Increase HCI command tx timeout

Read Local OOB Data command can take more than 1 second on some chips.
e.g. on CSR 0a12:0001 first call to Read Local OOB Data after reset
takes about 1300ms resulting in tx timeout error.

[27698.368655] Bluetooth: hci0 command 0x0c57 tx timeout

2012-10-31 15:53:36.178585 < HCI Command: Read Local OOB Data (0x03|0x0057) plen 0
2012-10-31 15:53:37.496996 > HCI Event: Command Complete (0x0e) plen 36
    Read Local OOB Data (0x03|0x0057) ncmd 1
    status 0x00
    hash 0x92219d9b447f2aa9dc12dda2ae7bae6a
    randomizer 0xb1948d0febe4ea38ce85c4e66313beba

Signed-off-by: Szymon Janc <szymon.janc@tieto.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add support for BCM20702A0 [0b05, 17b5]
Jeff Cook [Fri, 9 Nov 2012 23:39:48 +0000 (16:39 -0700)]
Bluetooth: Add support for BCM20702A0 [0b05, 17b5]

Vendor-specific ID for BCM20702A0.
Support for bluetooth over Asus Wi-Fi GO!, included with Asus P8Z77-V
Deluxe.

T:  Bus=07 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=0b05 ProdID=17b5 Rev=01.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM20702A0
S:  SerialNumber=94DBC98AC113
C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I:  If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=(none)
I:  If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
I:  If#= 3 Alt= 0 #EPs= 0 Cls=fe(app. ) Sub=01 Prot=01 Driver=(none)

Cc: stable@vger.kernel.org
Signed-off-by: Jeff Cook <jeff@deserettechnology.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: trivial: Use __constant for constants
Andrei Emeltchenko [Wed, 14 Nov 2012 15:39:32 +0000 (17:39 +0200)]
Bluetooth: trivial: Use __constant for constants

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Disable FCS only for new HS channels
Andrei Emeltchenko [Wed, 14 Nov 2012 15:39:31 +0000 (17:39 +0200)]
Bluetooth: Disable FCS only for new HS channels

Set chan->fcs to L2CAP_FCS_NONE only for new L2CAP channels
(not moved). Other side can still request to use FCS.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Refactor locking in amp_physical_cfm
Andrei Emeltchenko [Wed, 14 Nov 2012 15:39:30 +0000 (17:39 +0200)]
Bluetooth: Refactor locking in amp_physical_cfm

Remove locking from l2cap_physical_cfm and lock chan inside
amp_physical_cfm.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Remove unneeded local_amp_id initialization
Andrei Emeltchenko [Thu, 15 Nov 2012 16:14:55 +0000 (18:14 +0200)]
Bluetooth: Remove unneeded local_amp_id initialization

local_amp_id is already set in l2cap_connect() which is called several
lines above.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Use __l2cap_no_conn_pending helper
Andrei Emeltchenko [Thu, 15 Nov 2012 16:14:53 +0000 (18:14 +0200)]
Bluetooth: Use __l2cap_no_conn_pending helper

Use helper instead of test_bit. This is the only place left using
test CONF_CONNECT_PEND flag.

Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Mon, 19 Nov 2012 19:38:12 +0000 (14:38 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-fixes

11 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211
John W. Linville [Mon, 19 Nov 2012 19:37:43 +0000 (14:37 -0500)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211

11 years agoath9k: Fix BTCOEX debugfs file usage
Sujith Manoharan [Mon, 19 Nov 2012 08:54:46 +0000 (14:24 +0530)]
ath9k: Fix BTCOEX debugfs file usage

The debugfs file for dumping btcoex parameters unconditionally
assumes a MCI-based device. This will not work for older btcoex
chips. Fix this by branching out the routine into separate
functions.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Fix regression in device reset
Sujith Manoharan [Sat, 17 Nov 2012 15:50:50 +0000 (21:20 +0530)]
ath9k_hw: Fix regression in device reset

Commit "ath9k: improve suspend/resume reliability" broke ath9k_htc
and bringing up the device would hang indefinitely. Fix this.

Cc: stable@vger.kernel.org
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoBluetooth: Fix updating advertising state flags and data
Johan Hedberg [Thu, 8 Nov 2012 00:23:01 +0000 (01:23 +0100)]
Bluetooth: Fix updating advertising state flags and data

This patch adds a callback for the HCI_LE_Set_Advertise_Enable command.
The callback is responsible for updating the HCI_LE_PERIPHERAL flag
updating as well as updating the advertising data flags field to
indicate undirected connectable advertising.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Add support for setting LE advertising data
Johan Hedberg [Thu, 8 Nov 2012 00:23:00 +0000 (01:23 +0100)]
Bluetooth: Add support for setting LE advertising data

This patch adds support for setting basing LE advertising data. The
three elements supported for now are the advertising flags, the TX power
and the friendly name.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoBluetooth: Use proper invalid value for tx_power
Johan Hedberg [Thu, 8 Nov 2012 00:22:59 +0000 (01:22 +0100)]
Bluetooth: Use proper invalid value for tx_power

The core specification defines 127 as the "not available" value (well,
"reserved" for BR/EDR and "not available" for LE - but essentially the
same). Therefore, instead of testing for 0 (which is in fact a valid
value) we should be using this invalid value to test if the tx_power is
available.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
11 years agoiwlwifi: don't WARN when a non empty queue is disabled
Emmanuel Grumbach [Mon, 15 Oct 2012 15:57:36 +0000 (17:57 +0200)]
iwlwifi: don't WARN when a non empty queue is disabled

This can happen when we shut down suddenly an interface.

Cc: stable@vger.kernel.org
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agowireless: add back sysfs directory
Johannes Berg [Fri, 16 Nov 2012 19:46:19 +0000 (20:46 +0100)]
wireless: add back sysfs directory

commit 35b2a113cb0298d4f9a1263338b456094a414057 broke (at least)
Fedora's networking scripts, they check for the existence of the
wireless directory. As the files aren't used, add the directory
back and not the files. Also do it for both drivers based on the
old wireless extensions and cfg80211, regardless of whether the
compat code for wext is built into cfg80211 or not.

Cc: stable@vger.kernel.org [3.6]
Reported-by: Dave Airlie <airlied@gmail.com>
Reported-by: Bill Nottingham <notting@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 years agomwifiex: report error to MMC core if we cannot suspend
Bing Zhao [Thu, 15 Nov 2012 23:58:48 +0000 (15:58 -0800)]
mwifiex: report error to MMC core if we cannot suspend

When host_sleep_config command fails we should return error to
MMC core to indicate the failure for our device.

The misspelled variable is also removed as it's redundant.

Cc: "3.0+" <stable@vger.kernel.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: fix system hang issue in cmd timeout error case
Bing Zhao [Thu, 15 Nov 2012 23:58:47 +0000 (15:58 -0800)]
mwifiex: fix system hang issue in cmd timeout error case

Reported by Tim Shepard:
I was seeing sporadic failures (wedgeups), and the majority of those
failures I saw printed the printouts in mwifiex_cmd_timeout_func with
cmd = 0xe5 which is CMD_802_11_HS_CFG_ENH.  When this happens, two
minutes later I get notified that the rtcwake thread is blocked, like
this:
      INFO: task rtcwake:3495 blocked for more than 120 seconds.

To get the hung thread unblocked we wake up the cmd wait queue and
cancel the ioctl.

Cc: "3.4+" <stable@vger.kernel.org>
Reported-by: Tim Shepard <shep@laptop.org>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: rtl8192cu: Add new USB ID
Albert Pool [Tue, 30 Oct 2012 19:58:06 +0000 (20:58 +0100)]
rtlwifi: rtl8192cu: Add new USB ID

This is an ISY IWL 2000. Probably a clone of Belkin F7D1102 050d:1102.
Its FCC ID is the same.

Signed-off-by: Albert Pool <albertpool@solcon.nl>
Cc: stable@vger.kernel.org
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Program filter coefficients correctly
Sujith Manoharan [Tue, 13 Nov 2012 06:03:53 +0000 (11:33 +0530)]
ath9k_hw: Program filter coefficients correctly

2484 Mhz (Japan) usage requires filter coefficients to
be programmed in the CCK TX FIR registers. This is required
for AR9331, AR9485 and AR9462. Fix this and also remove
a few useless macros and a duplicate variable.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agolib80211: hide Kconfig symbol
Johannes Berg [Thu, 15 Nov 2012 23:06:20 +0000 (00:06 +0100)]
lib80211: hide Kconfig symbol

There's no need to ask the user about lib80211
since it will be selected by drivers requiring
it, hide it from Kconfig.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwifiex: don't select lib80211
Johannes Berg [Thu, 15 Nov 2012 23:05:20 +0000 (00:05 +0100)]
mwifiex: don't select lib80211

The driver doesn't use any lib80211 symbols
so it shouldn't select it in Kconfig.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agortlwifi: use eth_zero_addr() to assign zero address
Wei Yongjun [Thu, 15 Nov 2012 13:24:57 +0000 (21:24 +0800)]
rtlwifi: use eth_zero_addr() to assign zero address

Using eth_zero_addr() to assign zero address insetad of
memset() or an inefficient copy from a static array.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agonet/wireless: ipw2x00: remove unreachable code
Stanislav Yakovlev [Thu, 15 Nov 2012 03:07:47 +0000 (03:07 +0000)]
net/wireless: ipw2x00: remove unreachable code

Remove unnecessary if statements because libipw_set_geo always
returns success.  Also change function's return value from int
to void.

Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: code cleanup
Hante Meuleman [Thu, 15 Nov 2012 02:46:23 +0000 (18:46 -0800)]
brcmfmac: code cleanup

Removing obsolete functions and prototypes. Moving (and renaming)
defines to place with similar definitions. Removing unnecessary
includes.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: limit hex dump on fwil.
Hante Meuleman [Thu, 15 Nov 2012 02:46:22 +0000 (18:46 -0800)]
brcmfmac: limit hex dump on fwil.

When debug is turned on for fwil then the whole data buffer is
dumped. In some cases this gives excessive amount of debug. With
this patch the dumps are limited to 64 bytes.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: sdio module load fix.
Hante Meuleman [Thu, 15 Nov 2012 02:46:21 +0000 (18:46 -0800)]
brcmfmac: sdio module load fix.

On sdio module unload followed by load (without removing the
device) the access window should be moved back to enumeration
space. Force this by removing initialisation of sbwad during
probe.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: avoid usage of func->card->dev in sdio probe.
Hante Meuleman [Thu, 15 Nov 2012 02:46:20 +0000 (18:46 -0800)]
brcmfmac: avoid usage of func->card->dev in sdio probe.

brcmf_ops_sdio_probe used the private_date func->card->dev to
store device data of brcmfmac sdio. This is not a good place to
store the data. Use dev of func and use func->card->sdio_func
to group the functions the driver is using.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: sdio unload fix.
Hante Meuleman [Thu, 15 Nov 2012 02:46:19 +0000 (18:46 -0800)]
brcmfmac: sdio unload fix.

on sdio remove the bus_if should be configured for close, so
new data from higher layers will be blocked. Also the access
to bus_if in the watchdog should be checked for null pointer
access on sdio remove.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Handle mmc exceptions during init correct.
Hante Meuleman [Thu, 15 Nov 2012 02:46:18 +0000 (18:46 -0800)]
brcmfmac: Handle mmc exceptions during init correct.

when brcmf_sdbrcm_probe_attach results in error then cleanup
will result in null pointer access. In brcmf_sdbrcm_release and
in brcmf_ops_sdio_remove. This patch fixes order of init and
de-init.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: Any error should result in failure of probe.
Hante Meuleman [Thu, 15 Nov 2012 02:46:17 +0000 (18:46 -0800)]
brcmfmac: Any error should result in failure of probe.

In brcmf_sdbrcm_probe only error ELINK is seen as error. However
brcmf_bus_start can return many more error codes and all should
result in failed init of driver.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: restructure handling of IF event
Arend van Spriel [Thu, 15 Nov 2012 02:46:16 +0000 (18:46 -0800)]
brcmfmac: restructure handling of IF event

The IF event need special care. It can be either an ADD, DEL, or
CHANGE. For an ADD we need to call brcmf_add_if() before the
event handler call. Upon a DEL we need to call brcmf_del_if()
after the event handler call. CHANGE does not require special
attention.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: ignore IF event if it is a add for ifidx 0
Arend van Spriel [Thu, 15 Nov 2012 02:46:15 +0000 (18:46 -0800)]
brcmfmac: ignore IF event if it is a add for ifidx 0

Firmware fires IF event to add the primary interface but that
is already created in the driver.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix wrong usage of unaligned include file
Arend van Spriel [Thu, 15 Nov 2012 02:46:14 +0000 (18:46 -0800)]
brcmfmac: fix wrong usage of unaligned include file

Replaced <linux/unaligned/access_ok.h> by <asm/unaligned.h>
to make it work on ARM and other architectures.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix NULL pointer access in brcmf_fweh_detach()
Hante Meuleman [Thu, 15 Nov 2012 02:46:13 +0000 (18:46 -0800)]
brcmfmac: fix NULL pointer access in brcmf_fweh_detach()

brcmf_fweh_detach can be called while ifp is already NULL, due to
init error. Fix NULL pointer access by checking ifp.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: remove mac address validation from brcmf_net_attach()
Arend van Spriel [Thu, 15 Nov 2012 02:46:12 +0000 (18:46 -0800)]
brcmfmac: remove mac address validation from brcmf_net_attach()

The mac_addr field in ifp object is always valid so no need to
validate.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: change mac address parameter in brcmf_add_if()
Arend van Spriel [Thu, 15 Nov 2012 02:46:11 +0000 (18:46 -0800)]
brcmfmac: change mac address parameter in brcmf_add_if()

The function brcmf_add_if() is called with mac address set to NULL
for the primary interface. When handling IF ADD events the firmware
provides a address mask in the event to derive its mac address from
the primary mac address. Rename the parameter and use it as a mask.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: correct handling IF firmware event
Arend van Spriel [Thu, 15 Nov 2012 02:46:10 +0000 (18:46 -0800)]
brcmfmac: correct handling IF firmware event

Testing revealed the IF ADD event contains the interface
index of the new interface. This would result in a NULL
pointer access when handling the event.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: fix for multiple netdevice interface support
Arend van Spriel [Thu, 15 Nov 2012 02:46:09 +0000 (18:46 -0800)]
brcmfmac: fix for multiple netdevice interface support

virtual netdevice interface like P2P client and GO need
different callbacks for .open and .down. This patch adds
those.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: change parameter in brcmf_add_if() function
Arend van Spriel [Thu, 15 Nov 2012 02:46:08 +0000 (18:46 -0800)]
brcmfmac: change parameter in brcmf_add_if() function

The brcmf_add_if() function had a struct device as parameter
to accomodate the bus specific code to use this function. The
driver has been reworked so the bus specific code does not need
this function. Better replace the parameter with a more specific
driver object, ie. struct brcmf_pub.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: usb suspend/resume.
Hante Meuleman [Thu, 15 Nov 2012 02:46:07 +0000 (18:46 -0800)]
brcmfmac: usb suspend/resume.

Add support for usb suspend/resume.

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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: cleanup of usb firmware download routines
Hante Meuleman [Thu, 15 Nov 2012 02:46:06 +0000 (18:46 -0800)]
brcmfmac: cleanup of usb firmware download routines

Clean code related to firmware download routines. Remove obsolete
delay and increase delay after reset command.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agobrcmfmac: rework firmware event handling code
Arend van Spriel [Thu, 15 Nov 2012 02:46:05 +0000 (18:46 -0800)]
brcmfmac: rework firmware event handling code

Handling of firmware event has been reworked into a seperate
code file. The change is needed as firmware event can be received
in interrupt context. Decoupling of the event handling has been
lowered to allow event processing to sleep.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath5k: precedence error in ath5k_hw_nic_wakeup()
Dan Carpenter [Wed, 14 Nov 2012 08:23:07 +0000 (11:23 +0300)]
ath5k: precedence error in ath5k_hw_nic_wakeup()

'|' has higher precedence than ?:.  Since AR5K_PHY_TURBO_MODE is 0x1 and
"AR5K_PHY_TURBO_MODE | (ah->ah_radio == AR5K_RF2425)" is true then we
always set turbo to zero.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath5k: Use module_platform_driver macro for ahb.c
Syam Sidhardhan [Tue, 13 Nov 2012 15:39:50 +0000 (21:09 +0530)]
ath5k: Use module_platform_driver macro for ahb.c

Simplify the code by make use of module_platform_driver macro.

Signed-off-by: Syam Sidhardhan <s.syam@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: Remove unused workaround
Sujith Manoharan [Mon, 12 Nov 2012 05:26:44 +0000 (10:56 +0530)]
ath9k: Remove unused workaround

The workaround for ASPM/L0s is needed only for AR9485 1.0,
which was never sold and is not supported by ath9k.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Update AR9485 initvals
Sujith Manoharan [Mon, 12 Nov 2012 05:26:43 +0000 (10:56 +0530)]
ath9k_hw: Update AR9485 initvals

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k_hw: Fix wrong peak detector DC offset
Rajkumar Manoharan [Fri, 9 Nov 2012 09:21:30 +0000 (14:51 +0530)]
ath9k_hw: Fix wrong peak detector DC offset

An issue is reported in AR9462 & AR9565 that NF_cal_not_done is
not observed when HW peak detector calibration is disabled. At that
state, the HW is stuck at NF calibration which prevents tx output.
The root cause is wrong peak detector offset calibrated by HW. To
resolve this issue, peak detector calibration is done manually by SW
for AR9462 and AR9565.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agomwl8k: Send BASTREAM firmware commands per vif
Yogesh Ashok Powar [Thu, 8 Nov 2012 13:40:44 +0000 (19:10 +0530)]
mwl8k: Send BASTREAM firmware commands per vif

The firmware supports 8 macid's corresponding to 8 BSS that can be
created in an MBSS environment. Currently, BASTREAM commands were always
sent with macid 0. This macid is used to configure the hardware ampdu
registers with appropriate BSS address in an MBSS environment.
This mac address is used by the hardware for various ampdu related requirements
e.g. source address in BAR generation, BA interpretation e.t.c.
Using invalid macid results in this mac address not getting appropriately
configured in the hardware which results in issues during ampdu traffic.

Fix this by sending the BASTREAM commands with appropriate macid.

Signed-off-by: Nishant Sarmukadam <nishants@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agossb: fix SPROM offset
Piotr Haber [Thu, 8 Nov 2012 08:47:27 +0000 (09:47 +0100)]
ssb: fix SPROM offset

Offset for temperature compensation
values is wrong in ssb SPROMv8 map.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
11 years agoath9k: [DFS] add pulse width tolerance for ETSI
Zefir Kurtisi [Wed, 31 Oct 2012 11:23:01 +0000 (12:23 +0100)]
ath9k: [DFS] add pulse width tolerance for ETSI

Add 5% width tolerance for radar patterns defined by ETSI.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>