[go: nahoru, domu]

History log of /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
Revision Date Author Comments
59dfdd92288e55bed374309a9944c3a95b4e13c9 12-Oct-2014 Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se> brcmfmac: dhd_sdio.c: Cleaning up missing null-terminate in conjunction with strncpy

Replacing strncpy with strlcpy to avoid strings that lacks null terminate.
And changed from using strncat to strlcat to simplify code.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
46de06839b4936cc5fd4e6638b8fbf8437bce29e 30-Jul-2014 Daniel Kim <dekim@broadcom.com> brcmfmac: Do not use strcpy and strcat

Commit "c1b2053 brcmfmac: Make firmware path a module parameter"
introduced use of strcpy and strcat. The strcpy and strcat require
using null terminated strings and can cause out-of-bounds memory
access and subsequent corruption. This patch replaces these by
strncpy and strncat respectively to assure array boundaries are
not crossed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c1b20532ef395f23c2d24bc9c7f772a45e0420c7 12-Jul-2014 Daniel Kim <dekim@broadcom.com> brcmfmac: Make firmware path a module parameter

This patch makes firmware path a module parameter so that firmware and
nvram files can be loaded from the specified path.

Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
82d957e09d4f0ff8091ca67e39b51ec6bdc672b1 12-Jul-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: rework debugfs functions in the driver

Reworked the debugfs functions in the driver making it easier for
other driver parts to add a debugfs entry and keeping the information
they want to expose in debugfs private, ie. not in a header.

This is accomplished by providing the function brcmf_debugfs_add_entry()
in which the caller provides a read function in which they provide the
content. The debugfs function will take care of creating the debugfs
entry and cleaning up upon removal.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1b1e4e9e3abca01b7be6400db879ca8c475a2c96 12-Jul-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: make use of seq_file API for debugfs entries

The use of seq_file simplifies the debugfs code. Simpler is
better.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5779ae6a5559252adabc5b5e807381dc7a16f1ff 12-Jul-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Cleanup used device IDs.

This patch cleans up used broadcom IDs, device IDs for all the
bus layers and uses consistent naming for all IDs.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
7dd3abc14f94bc1226aaa5075c73928d6b1d544c 27-May-2014 Daniel Kim <dekim@broadcom.com> brcmfmac: Increase max buffer size for receiving control message from dongle

The max buffer size for receiving control message from dongle needs to be
increased considering possible block padding. Otherwise some big control
message can't be received due to buffer overrun check.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bd0e1b1d380efe713a612c91417b948e7ebea58d 27-May-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: use asynchronous firmware request in SDIO

This patch adds use of asynchronous firmware request to
the driver SDIO layer.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4faf28b7b471b97be35f29dade653d271c1951cc 27-May-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: call brcmf_detach() unconditional in sdio .remove() callback

The function brcmf_detach() checks whether it needs to do his stuff
or can return immediately. No need to have the same check in the
calling code.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
dabedab98317e8915eefd8485921fb571b26cdd1 27-May-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: rename nvram.[ch] for upcoming firmware handling functions

The firmware processing will be modified to use asynchronous request
firmware api. In preparation this patch is simple rename of source
and header file to which the functionality will be added.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
f33d7a914125423e357693f972512fa9c94fd3aa 27-May-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: remove .init() callback for internal bus interface

The .init() callback was the first function called by the common
bus function brcmf_bus_start(). Given that it is not really
necessary and the bus layer can call it before calling the
brcmf_bus_start() function.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
58e9df462fd70a1862378beb46b312f1f6bca94f 20-Mar-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: reinit watchdog completion after handling watchdog

The watchdog thread waits on completion that is set from a timer. As
the completion is count based this could mean that on a busy system
the watchdog is handled multiple times with a very short interval.
This is not the intended behaviour. After handling the watchdog it
should wait for the next timer expiry. This is accomplished by
reinitializing the completion.

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: John W. Linville <linville@tuxdriver.com>
8a385ba542dd6d20e3067d486f5f75ff71baa4db 15-Mar-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: assure active clock request upon entering SLEEP state

When the SDIO driver goes in low power state it must assure that
a clock request in ChipCLKCSR is set. Otherwise waking up the
device can fail. The register is read and if necessary the ALP
clock will be requested.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fed7ec44e7ef647c1b1584164fe172963731f26d 15-Mar-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Protect tx seq number for data and control

SDIO tx uses a sequence number which is common for data
and control. This requires that access to this sequence number
is protected. A mutex was used to achieve this, but it also
required the reordering of code for tx control.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
a797ca1eadeef7f4fdba2ab5d143d56cc3ec5da3 15-Mar-2014 Franky Lin <frankyl@broadcom.com> brcmfmac: add BCM4354 SDIO interface support

BCM4354 is an a/b/g/n/ac 2x2 WiFi chip. This patch adds support for it through
SDIO interface.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2dc3a8e0b6e10c77798a4f6f711ce66334eda1c4 06-Mar-2014 Dave Jones <davej@redhat.com> brcmfmac: fix skb leak in brcmf_sdio_txpkt_prep_sg error path.

Commit 1eb4301867 (brcmfmac: fix txglomming scatter-gather packet transfers)
added an allocation of an skb via brcmu_pkt_buf_get_skb() but forgot to
free it on one of the error paths.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Dave Jones<davej@fedoraproject.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5cbb9c285bdcc14ee381120dab7e23a81060f1c0 06-Mar-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Use atomic functions for intstatus update.

The intstatus in sdio code can be updated from different
threads. To protect intstatus access, atomic functions are
used. One of them is set_bit, but this function is not
guaranteed atomic on all platforms. The loop was replaced
with local created OR function.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
561e722201e41e304936b8a2aaa282c46ad4f393 06-Mar-2014 Arend van Spriel <arend@broadcom.com> Revert "brcmfmac: Use atomic functions for intstatus update."

This reverts commit c98db0bec72ac7ef127119c1ed962d6f56802b12.

The function atomic_set_mask() is not architecture independent
so it can not be used in the driver as is.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
af1fa210f4fc6e304b859b386a3c8a266b1110ab 27-Feb-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: use pre-allocated scatter-gather table for txglomming

Instead of allocating a scatter-gather table for every transmit
reuse a pre-allocated table. The transmit path will be faster by
taking out this allocation.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
81c7883c46fddd53b7a98c3659ffae21189ae4ab 25-Feb-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Put frame sdio tx error handling in sub function.

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>
c98db0bec72ac7ef127119c1ed962d6f56802b12 26-Feb-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Use atomic functions for intstatus update.

The intstatus in sdio code can be updated from different
threads. To protect intstatus access, atomic functions are
used. The loop was replaced using atomic_set_mask().

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
b6a8cf2cd8f1d17c850db0f591e3d349d417b40a 25-Feb-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Small cleanup of redundant code.

In time some of the code got redundant, without being noticed.
This patch does not change any functionality, just removes
redundant code.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
6f6c195b95136e0b2972b3c5213f6cd876c4fa8f 25-Feb-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Remove immediate sleep support from SDIO.

Immediate sleep support is an aggressive power saving option
that has not been enabled in brcmfmac and is removed to
simplify code.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
71abdc00d54bb48ad2df4f9710ac661cf3aed30d 25-Feb-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Minimize SDIO dpc scheduling.

SDIO dpc scheduling is done (repeated) when counter is set. This
counter gets decreased when dpc is finished. It is more efficient
to set counter to 0 before the dpc is actullay run. This will
minimize the frequency with which dpc is executed.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
47ab4cd893f565a1093f316ec95babfa181e722a 25-Feb-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Correct header debug dump for sdio tx hdrs.

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>
44ff5660e5cf5ccb739e77a19d2ecf1144cf9e36 25-Feb-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: remove unused variable data_len from brcmf_sdio_bus_txdata()

The local variable data_len is assigned but never used so get rid
of it.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5aa9f0ea18f3d5ec329a619b0bc54e214e02bc33 25-Feb-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: fix use of skb control buffer in SDIO driver part

The SDIO driver has a 16-bit field defined in the skbuff control buffer.
However, it is accessed as a u32 overwriting other control info. Another
issue is that the field is not initialized for networking packets, but
the control buffer content is unspecified as other networking layers can
use it.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1eb43018673e735ea9cd756970f4e71ca01a5f21 20-Feb-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: fix txglomming scatter-gather packet transfers

The driver concatenates multiple packets in one MMC transfer. For
scatter-gather to work the total length need to be multiple of 512
bytes. A pre-allocated buffer was used to add padding to accomplish
that. However, the length was not properly set and it was freed after
the first transfer causing a crash.

Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
82030d6df3856896e6a7c912347fe547eaf61738 29-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: remove TRACE level debug message from brcmf_sdio_bus_sleep()

The function brcmf_sdio_bus_sleep() function is called rather
frequently, which fills the log when TRACE level is enabled. Reduced
the level to SDIO.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cb7cf7be9eba76f3cd6258906074c72084570c84 29-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: make chip related functions host interface independent

This patch make several chip related functions host interface
independent by defining callback interface struct brcmf_buscore_ops.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e0c180ecf181aa157df28313c82d3b7449b5df65 29-Jan-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: on sdio remove first detach bus then stop worker.

Currently the function sdio_remove will first destroy the datawork
workqueue and then detach the bus. This can create the situation
where work gets added on non-existing work queue resulting in panic.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
f9951c13349ac1553ab1e0962dc3f877e4841037 29-Jan-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: simplify sdio code download routine.

brcmf_sdio_download_code_file is using a loop to send small blobs
of data. This is unnecessarily complex and was simplified with this
patch.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@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>
20c9c9bc144c8a7df04259fa98fd0597b2f85cc2 29-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: rename sdio_chip.[ch]

Just renaming the file. This file will contain chip related functions
that are independent of the host interface type.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
65d80d0b80960f9bc35d1067a1a297efc60cc014 29-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: move SDIO specific functions

The chip related functions will be made agnostic of the host
interface. However, some functions in the source file are
rather SDIO specific so better move it to the SDIO specific
source file.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
0801e6c5d8224a27abb7afc920676782efdd5922 29-Jan-2014 Daniel Kim <dekim@broadcom.com> brcmfmac: enable firmware console logging functionality

Address of rte console was not initialized and so console logging
functionality didn't kick in. This patch fixes it and makes console
polling interval a debugfs variable.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Daniel Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bb350711ecb86568468b497d0ecd5c3fd7b45b1b 13-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: handle SDIO card removal

When removing the card the driver still tries to access registers
in the device. This patch adds another state for the bus that
indicates the device is no longer reachable. This avoids errors
accessing it while cleaning up the driver.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
9cf218fc333406764275eab9b0e47f5c39929e79 13-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: rename chip and core related structures

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3355650c61c4e3d56deadb601762b09ed8a30939 13-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: rework firmware download code

The firmware download code has been restructured so the reset vector
does not need to be stored in a structure, but keep it on the stack
to be passed to exit download function.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Daniel (Deognyoun) Kim <dekim@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
53036261033abdab7323a4a896a9bde84d2c2f17 13-Jan-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: update core reset and disable routines.

The original core reset and disable routines do not work always
on running system. These routines were updated to properly reset
a core. When module is unloaded the device is put into download
state where all necessary cores have been reset. This will make
sure the device is in idle mode after module unload.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
a74d036f98280b0de312f842ad09c26de56f27c5 13-Jan-2014 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Create common nvram parsing routines.

New bus layers like pcie require nvram parsing routines which are
the same routines as being used by sdio. Make these routines common
in the new file nvram.c. Update sdio to use these routines and
simplify the nvram upload process. Also add memory validation check
for downloaded firmware and nvram in debug mode.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
11e69c36eefd625db543a109789358be14d4cd5c 08-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: add support for bcm43362 device

This patch adds support for the bcm43362 1x1 11n chipset. This
chipset is used in AP6210 wifi module found on Cubieboard [1].

[1] http://cubieboard.org/

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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>
76a4c6817c28dbc91fab8c366a177fa7215b2811 06-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: only disable clock when brcmf_sdio_bus_init() fails

The condition to disable the clock at the end of brcmf_sdio_bus_init()
was wrong as the bus state is updated by the calling function. Hence,
the clock was always disabled after brcmf_sdio_bus_init() which was
not the intended behaviour.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d6ae2c51becb5b901cbaf321e24a6362b14e4cdc 06-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: enable watchdog when bus initialization is complete

Change condition in brcmf_sdio_wd_timer() function to program
watchdog only when in BRCMF_BUS_DATA state. This avoids watchdog
being active during initialization. During initialization the
SDIO save&restore capability is determined which affect the
bus sleep mechanism used in watchdog thread.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3bd44d991f1906ee71807e07b388d9d2d94b7f7a 06-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: correct detection of save&restore device capability

The detection of the save&restore capability in brcmf_sdio_sr_capable()
is only valid for certain chipsets. This patch should cover it for all
chipsets currently supported.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fad132285081c1c37b57be5ff74e23edbf9b1864 06-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: cleanup helper functions in sdio probe path

Moving code from helper functions to the calling function
as it makes code easier to read.

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: John W. Linville <linville@tuxdriver.com>
bfad4a048c44c37ce4c606ad3f6a745607d515e9 06-Jan-2014 Arend van Spriel <arend@broadcom.com> brcmfmac: cleanup helper functions in sdio remove path

Two helper functions in the sdio remove path were very thin and
only used once. So its code is moved to the calling function.

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>
9fbe2a6dc71d85e166eea43842a55af3d62a4d7b 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: remove brcmf_sdio_disconnect() function

Instead of calling brcmf_sdio_disconnect() expose brcmf_sdio_remove()
and call it directly.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
82d7f3c10cf41c681e4577bcbc070454e5774960 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: use consistent function names in dhd_sdio.c

Functions in dhd_sdio.c that are called with struct brcmf_sdio
instance are renamed consistently with brcmf_sdio_ prefix.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
a7cdd821e37fa5809ce1fb3793ab0e0e7e6e9d75 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: reduce function parameters in sdio send/receive calls

The SDIO send and receive functions in bcmsdh.c are always called
with the same parameters. For the driver there is no use-case
to call them otherwise so remove those parameters from function
prototypes.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
a39be27b49e309bb790bea93a2595732f93e5fcb 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: use consistent function names in bcmsdh.c

Functions in bcmsdh.c that are called with struct brcmf_sdio_dev
instance are renamed consistently with brcmf_sdiod_ prefix. Also
removing brcmf_sdioh_attach/detach() functions and merge it with
brcmf_sdiod_probe/remove().

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
964ec1cfeb8f30b50e341216f25e9170ac921ffe 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: get rid of some void pointer parameters

In sdio code a couple of functions use a void pointer as argument
type although it should be struct brcmf_sdio. Changing the functions
to have proper type checking.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4744d16402e3557dc98359effaec3371e78a9bc3 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: remove regs parameter from sdio probe functions

The chip recognition requires a base address that was provided
to it during the probe. However, the address is a fixed define
value so it is unnecessary to pass through the probe functions.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
1cee05e38479efc11f1e7178b49108369c6f059e 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: remove brcmf_sdio_regrw_helper() from header file

Make brcmf_sdio_regrw_helper() static removing its use outside of
the bcmsdh.c source file.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
71370eb87b4815d4cb4c901b85386b4e7b72c578 12-Dec-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: use sdio functions to enable/disable F2

Instead of catching CCCR_IOEx register in F0 write access to
determine whether F2 state needs to change do it with direct
call to sdio_[enable/disable]_func().

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
9b2d2f2a890847277371d953e2751c4224efa273 29-Nov-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: use platform specific alignment in SDIO

The SDIO part of the brcmfmac driver uses a static define BRCMF_SDALIGN
to align buffers used for SDIO transfers. This patch replaces it by
using alignment derived from the platform specific data.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
e217d1c8bfbd97316f5a1d3845587284cc137291 29-Nov-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: determine alignment values during probe

The alignment values were being determined for each transmit
and receive depending on platform data. Instead determine
these once during the probe.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
8da9d2c86888257c7874687467e9519405aa87d5 29-Nov-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: add host tx glomming support

New WiFi full dongle supports receiving chained packets in one command
through the SDIO bus. This patch adds the support on the host side to
send chained packets.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bed89b64bcbc73a078028f04f64bc955a87ec8ad 29-Nov-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: add firmware and nvram file name for bcm4339

Add firmware/nvram file name for bcm4339 so fmac can actually be functional with
the chip.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4b776961a0d2099c684f4c2256896cb64e4fa9e7 29-Nov-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: support hardware extension header in trace_brcmf_sdpcm_hdr()

The SDPCM header can be traced, but it used a fixed header size. With
txglom feature the SDPCM header will have additional 8 bytes of hardware
extension header so SDIO core can properly handle the txglom packet.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
cf4582875a77c13adf8fec79b8ab3896d2b38e97 29-Nov-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: replace dongle command list with .preinit() callback

The bus-specific interface allowed a list of dongle commands to be
provided to the common driver part. However, upcoming functionality
requires a more dynamic behaviour. Hence the list is replaced
by a new callback function so the bus-specific driver part can
implement this behaviour.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
8dee77bab2eda24b48bfb8aecf5ac1370e424416 29-Nov-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: add separate function for passing bus tx overhead

The common driver needs the packet overhead for the bus in order
to reserve headroom for sk_buffs. For the SDIO driver this depends
on firmware features so it is not possible to provide it in the
brcmf_attach() call.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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>
a413e39a38573f8738911cfb51a4cd3f3873deda 15-Oct-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: fix brcmf_sdcard_recv_chain() for host without sg support

If the SDIO host controller does not support scatter-gather the glom
superframe must be transfered from the device and the data for each
packet in the queue must be extracted from it.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
a64304f0a2cae8ce9ff71baecbad821613229cfe 15-Oct-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: fix brcmf_sdio_txpkt_prep() for host without sg support

When running on a host controller that does not support scatter-gather
transfers the function brcmf_sdio_txpkt_prep() should not add tail
padding buffers.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
76584ece258dd71066b536fe8636e64537d21011 15-Oct-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: add tracepoint for capturing the SDPCM header

Having the SDPCM header information in the traces is a valuable
piece of information.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
05f3820b2e2e391bbc4434448c10f08387f209aa 25-Sep-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: rework rx path bus interface

The brcmfmac has common and bus specific part. The rx function api
was using sk_buff_head. Changed to sk_buff instead.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f2c44fe7c83eeee6ca8828d9b3d0b4c205a7bc1b 25-Sep-2013 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Use fw filename and nvram based of devid for sdio.

SDIO firmware download routines uses one name for firmware file
and nvram file for all sdio devices. This is not user friendly.
Use fw filename and nvram filename based upon chip id and revision.

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
5491c11c67f2c83c95fa9a26172bc1994580aed7 25-Sep-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: reserve memory for bus layer in sk_buff::cb

Bus layer need to share sk_buff::cb with firmware signal feature. Reserve
necessary memory so they won't overwrite each other.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
706478cba544584a1f8d515646f8d677d096395e 10-Aug-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: use configurable sdio bus header length for tx packet

Host tx glomming require an extended hardware sdio bus header to store
information for dongle. Introduce a variable in struct brcmf_sdio to replace
macro SDPCM_HDRLEN

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6bc52319c2c688fdcbb203a4917576ca4cd4d51e 10-Aug-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: streamline sdio bus header code

Streamlining sdio bus specific header related code as preparation for host
tx glomming

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cb7f79682a9289634094e2c3b5180611635332f5 10-Aug-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: remove align from brcmf_bus structure

remove align from brcmf_bus since it is only used by sdio bus layer internally

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b05e92545d9582be15699e4a33d0f93ac00b37dd 10-Aug-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: abstract tx packet processing functions

Abstract brcmf_sdio_txpkt_prep and brcmf_sdio_txpkt_postp as a preparation
of chained tx packets for host side tx glomming.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
04779fddeff723cf5afe529e4ed67fc86f25ba37 10-Aug-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: .txdata() bus callback should not call brcmf_txcomplete()

With firmware-signalling the packet handed to the bus specific driver
layer should not be discarded with brcmf_txcomplete() in the failure
path. Instead only an error is returned and the caller decides what
to do with the packet.

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: John W. Linville <linville@tuxdriver.com>
4061f895088a2825b15312947aedb8574e2d8de5 10-Aug-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: use irq safe spinlock in brcmf_sdbrcm_txdata()

Firmware-signalling needs transmit to firmware to be atomic and
uses a spinlock with irq disabled. Therefor, brcmf_sdbrcm_txdata()
should not use spin_unlock_bh() as it would enable the interrupts.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
354b75bfdbef02739af39acdbf804549c4626816 18-Jun-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: add sdio sg list support

Add scatter gather list support for better rx glom performance.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
16035d51b3e49e6e90b2e324feb437ed7893b045 18-Jun-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: remove redundant chip ID check in dhd_sdio

There is an ID table registered to SDIO stack which consists of all SDIO devices
supported by brcmfmac. It is not necessary to have an extra check.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fccfe93036312f3ad35d37c2ca960f104c6e7f21 18-Jun-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: simplify dpc handling using atomic operations

Instead of allocating an empty list item and queue that for
the dpc data worker to dequeue an atomic counter is used.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
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: John W. Linville <linville@tuxdriver.com>
df50f756966cc07addaae5449a6fd45a17bdb06c 06-Jun-2013 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Take bus flowcontrol at credit mgmt into account.

On bus flow control (no more host bus resources to send packets
to device) the netif flow control was toggled, however credit
management should also take this status into account. Since there
are multiple sources handling this flow control necessary spinlocks
were added to protect flow control related data/states.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
668761ac01d6f5a36b8e5a24d4e154550e2c4c3b 12-Apr-2013 Hante Meuleman <meuleman@broadcom.com> brcmfmac: define and use platform specific data for SDIO.

This patch adds support for platform specific data for SDIO
fullmac devices. Currently OOB interrupts are configured by Kconfig
BRCMFMAC_SDIO_OOB but that is now determined dynamically by checking
availibility of platform data.

Cc: Hauke Mehrtens <hauke@hauke-m.de>
Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
369508c5656db290f09b32d213effeea6c1431b8 11-Apr-2013 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Add 43143 SDIO support.

Added sdio device id to list of supported devices. 43143 is a new
802.11n single stream device.

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>
6a1c74834c0b1412c6ba34de347ee7a038f2ecd2 11-Apr-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: add BCM4335 sdio interface support

BCM4335 is an a/b/g/n/ac WiFi chip that supports up to 80MHz channel. This patch
adds support for this chip through SDIO interface.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1e9ab4dd258ecbb0f1c377fd4dbe227cdb93d9bd 11-Apr-2013 Piotr Haber <phaber@broadcom.com> brcmfmac: setup SDIO reset behavior

Set device in a manner that SDIO I/O card reset
will lead to WLAN backplane and PMU state reset.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
1640f28f6b839637d9b82a3c4a19120601e59c66 11-Apr-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: add support for dongle ARM CR4 core

Newer WiFi chip use ARM CR4 core to achieve higher performance. Add necessary
code for host driver in order to support CR4 core.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
069eddd9267204163325a9dc0bd1cdaeca30f6ae 11-Apr-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: move chip download state code to sdio_chip.c

enter/exit download state routine is going to diverge with new ARM core
introduced. Move corresponding code to sdio_chip.c for new ARM core support.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ba540b01a9837ea106a7ca614a23eb4ac194da9c 11-Apr-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: aggregate dongle ram access interface

For fullmac chips host driver can access to dongle RAM through SDIO function 1.
Introduce brcmf_sdio_ramrw and place it at bcmsdh.c with other interface
functions.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4a3da9906bbf37f6b0d44ddb753d3198e73c3c6d 11-Apr-2013 Piotr Haber <phaber@broadcom.com> brcmfmac: support save&restore firmware feature

Save & restore is an advanced power saving feature,
supported only on selected devices.
SR operation is almost completely transparent to the driver.
Support for it is hardware and firmware dependent.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
40c1c24982b8c65ff97aa9d0b554e21a9e972272 05-Apr-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: add hexadecimal trace of message payload

Adds a trace function used in brcmf_dbg_hex_dump() which adds the
raw binary data to the trace. It requires trace-cmd plugin to see
this data.

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>
86dcd937c1f0023a2337f7c14e237f718d00e300 05-Apr-2013 Piotr Haber <phaber@broadcom.com> brcmfmac: firmware shared data version fix

Firware shared data structure is backward compatible for fields
we are interested in.
Allow reading of shared data in case of version mismatch.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@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>
baa9e60927331c3324fccf4c39485e857d8472eb 05-Apr-2013 Piotr Haber <phaber@broadcom.com> brcmfmac: read firmware console without trap indication

Firmware console output can be read also when there was
no trap indication.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@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>
c3203374bea328af54843bd72f9306e6c7832db4 03-Apr-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: add dedicated log level for low-level sdio debugging

The low-level sdio code has a large number of trace and info messages
that are mostly useful looking into bus specific issues. For tracing
higher-level driver functions it is better to have a dedicated level
for low-level sdio debugging.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Change-Id: Ia424ff18d9033b97aeffc248358e50c51805e815
Reviewed-on: http://lb-bun-88.bun.broadcom.com:8080/74
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e2432b6787a15e0b3c255a017d16033ba30204c0 03-Apr-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: add optional bus callback definition for tx queue cleanup

Add a callback to obtain packet queue from the bus-specific code
used to cleanup packet buffers from firmware-signalling code.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@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>
aeecc574a428a116936cadcea06b47cffad16ba1 03-Apr-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: use skb_cow() in brcmf_sdbrcm_txpkt() to assure alignment

In brcmf_sdbrcm_txpkt() a new packet is allocated and used to transmit
to firmware freeing up the original packet. However, that packet is
still referenced in firmware-signalling so this would result in a
double free. Using skb_cow() avoids this as the packet reference is
unchanged.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a04278096c14922bf7c701afe5c0c648d427a14d 03-Apr-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: minor optimization of brcmf_sdbrcm_txpkt() function

When taking care of packet alignment to 64-byte boundary padding may
be added between SDPCM header and CDC data. It clear both SDPCM header
space and padding space. Changed it to only clear padding space. In
filling the SDPCM header it uses unaligned access to set SDPCM software
header, but preceding code assures it is properly aligned.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Change-Id: Iad22f277f3496440ba4d2db771205714774570ac
Reviewed-on: http://lb-bun-88.bun.broadcom.com:8080/76
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a886f7f4e4d4fcc2ce153b67d1fe69377fd7ede3 03-Apr-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: correct success flag passed by brcmf_sdbrcm_txpkt()

The function brcmf_sdbrcm_txpkt() calls brcmf_txcomplete() with
a parameter success. For this parameter it passes ret != 0, but
that condition is true upon failure.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
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>
3eaa956c5b18b9c955ae5a4e6e6909cae23f38e0 02-Apr-2013 Franky Lin <frankyl@broadcom.com> brcmfmac: do not proceed if fail to download nvram to dongle

Nvram contains critical initialization parameter for firmware to run. Host
driver should not proceed if nvram fails to be downloaded to dongle.

Reviewed-by: Piotr Haber <phaber@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7f4bceecf0b4fb3190af47a775e48782952196a2 03-Mar-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: release transmit packet in brcmf_txcomplete()

In the bus-specific driver code each call to brcmf_txcomplete() is
following by a free of that packet. This patch moves that free to
the brcmf_txcomplete() function.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Piotr Haber <phaber@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
349e7104ff662eeacca1fffbb480c287562c45a1 03-Mar-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: add support for TLV based firmware signalling

The firmware and host can exchange signals which are carried within
the data packets. These are TLV based signals that are inserted
before the actual data, ie. ethernet frame.

This commit adds the new source module for this feature and enables
RSSI signals from firmware.

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: John W. Linville <linville@tuxdriver.com>
14f8dc49532f765968ff37c3b99edbeb99004ace 07-Feb-2013 Joe Perches <joe@perches.com> drivers: net: Remove remaining alloc/OOM messages

alloc failures already get standardized OOM
messages and a dump_stack.

For the affected mallocs around these OOM messages:

Converted kmallocs with multiplies to kmalloc_array.
Converted a kmalloc/memcpy to kmemdup.
Removed now unused stack variables.
Removed unnecessary parentheses.
Neatened alignment.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
0bc9a8cb24f9a1fa556c081cd9d9edc89121a636 08-Feb-2013 Piotr Haber <phaber@broadcom.com> 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>
bd16e3555fb61a6f3792c6efec5b63697e051e42 08-Feb-2013 Piotr Haber <phaber@broadcom.com> 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>
b55de97ffd920e2bb1104eca272688f1be7329c2 08-Feb-2013 Piotr Haber <phaber@broadcom.com> 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>
75d907d3ee835f8759fe291023aa609dccebe504 06-Feb-2013 Arend van Spriel <arend@broadcom.com> 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>
b1a2a41126fc582a3d5613aa2d3e632b2eb1a2c4 06-Feb-2013 Hante Meuleman <meuleman@broadcom.com> 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>
05dde977bfe35a5c9816763fa9c26732e10b8a5b 06-Feb-2013 Hante Meuleman <meuleman@broadcom.com> 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>
a43af515f6252e62604a1bfc139d43fa43ef5b6f 02-Jan-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: remove brcmf_proto_hdrpull() from bus interface

The use of the function brcmf_proto_hdrpull() is moved to the
common part of the driver and consequently it can be removed
from the bus interface.

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: John W. Linville <linville@tuxdriver.com>
3aa7aad2b2da32dd897900ab3eb62348a54d2dc1 02-Jan-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: remove rx helper function from bus interface

The bus interface provided a wrapper function to pass a single
packet to the common driver part filling a skb queue with one
packet. For clarity the caller now sets up the skb queue and
call the rx bus interface function.

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: John W. Linville <linville@tuxdriver.com>
79d7c4e8da4ac3cfa98e8e622a17baaeb3c9d29d 02-Jan-2013 Arend van Spriel <arend@broadcom.com> brcmfmac: define pr_fmt in one place

Several source files (but not all) define the pr_fmt() macro in exactly
the same way. Instead this commit defines it in a header file so driver
logging is consistent.

Cc: Joe Perches <joe@perches.com>
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: John W. Linville <linville@tuxdriver.com>
5e8149f5036afe2d94b5fafc9ff752283804a752 07-Dec-2012 Arend van Spriel <arend@broadcom.com> brcmfmac: error messages should not be suppressed

The call to brcmf_dbg(ERROR, ...) only resulted in a log message
when compiled with -DDEBUG. Error messages are valuable for resolving
issues so this patch replaces it with brcmf_err(...) so they always
end up in the log.

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: John W. Linville <linville@tuxdriver.com>
d9cb2596503d937ccf68b83d3aff1056765a6b1e 05-Dec-2012 Arend van Spriel <arend@broadcom.com> brcmfmac: rework bus interface

Rework the bus interface between common driver part and bus-specific
driver part. It prepares for adding tracing in bus-specific callback
functions.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@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>
2def5c10d2f8f81c8089b2c1b63fdc278e7d86f0 15-Nov-2012 Hante Meuleman <meuleman@broadcom.com> 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>
37ac5780e08e4e3ce67e8355e52d71324e9c11cd 15-Nov-2012 Hante Meuleman <meuleman@broadcom.com> 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>
1799ddf18597da5aa1319b089736aafd05481774 15-Nov-2012 Hante Meuleman <meuleman@broadcom.com> 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>
105105891980e639a012bbc9fbce1fc8a63ec38d 06-Nov-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: change return type of brcmf_sdio_hdparser

Use int instead of bool as the return type of function
brcmf_sdio_hdparser to explicitly describe error returns.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fd67dc834a62abeadee07d454093475fbcdc0897 06-Nov-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: remove brcmf_sdbrcm_wait_for_event

brcmf_sdbrcm_wait_for_event is now a one line function and only
used by brcmf_sdbrcm_bus_txctl. Intergrate the function call
wait_event_interruptible_timeout into brcmf_sdbrcm_bus_txctl.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
38b0b0ddee3270106d740e8df42a5b52beed502b 06-Nov-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: protect consecutive SDIO access with sdio_claim_host

Semaphore sdsem is used to protect consecutive memory access
through SDIO bus. Same functionality is provided by sdio_claim_host/
sdio_release_host interface as well. Replace sdsem with
sdio_claim_host.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7cdf57d34c017e5c4c48069ae46e7cb87979435a 06-Nov-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: decrease the range of SDIO access lock

Semaphore sdsem which protects consecutive SDIO bus access is used
to lock down unnecessary wide range. Decrease the locking range
provides the capability of parallel processing.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
dd43a01c5cdb811adeb09e6a2d2788f8aa0d0969 06-Nov-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: use dynamically allocated control frame buffer

Rxbuf in SDIO interface is used in normal frame and control frame
read. Use dynamically allocated buffer in control frame read path
for post processing to avoid conflicts.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9d7d6f95bda1fdc10847996ab849b5dd065bf047 22-Oct-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: streamline header parse code of sdio glom read

Use brcmf_sdio_hdparser to handle header of super frame and sub
frame in glomming frame read.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4754fceeb9a6cd04e5d51659a8309e9e623a09a6 19-Sep-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: streamline SDIO read frame routine

SDIO read non-glomming frame routine handles first frame and
follow up frame read separately. But they share a lot of common
code. This patch abstracts a brcmf_sdio_hdparser function and
optimize the code flow for better readability and future
optimization.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4531603a7acb1463ec0b466dcfedc6682e7a1718 13-Sep-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: clear status for in-band interrupt in brcmf_sdbrcm_isr

SDIO in-band interrupt is level sensitive according to SDIO standard.
When the register interrupt handler gets called by SDIO stack it is
running in non interrupt context and expected to clear the interrupt
from the dongle. Therefore in-band and out-of-band interrupt need to
be handled differently.

Cc: Wei Ni <wni@nvidia.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>

Reported-by: Wei Ni <wni@nvidia.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Tested-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
7057fd00da45c31a5a927a742d0f43efe4470173 13-Sep-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: raise SDIO host lock to higher level

Use SDIO host lock to protect the entire communication process
of register access or data read/write rather than function calls
to MMC/SDIO stack only. This can help to avoid unintentional
memory access and unexpected interruption.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
03d5c360dcbcb62cfc45caaca163cce8e10f00d6 13-Sep-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: streamline SDIO dpc

Streamline SDIO dpc by removing some unnecessary code path.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
f1e68c2e0a7af39907355e300dbbc76fcebc7fc8 13-Sep-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: convert SDIO dpc implementation to workqueue

Switch SDIO dpc implementation from kernel thread to workqueue for
better performance and compatibility.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1d38227371d8db7d58b4f870192dd944f73f4352 13-Sep-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: use atomic variable for interrupt pending flag

Interrupt pending flag used in SDIO bus layer could be used in
multiple processes in different context. Use atomic_t make sure
every interrupt is handled.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
86761fcbea8a779b0aa2af120173cd4ef7edd72f 13-Sep-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: remove obsolete sdio bus sleep mechanism

Remove sdio bus sleep mechanism since it is never invoked.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
90d03ff71b52ba1d9d53f18c07d89566ba0263b4 11-Sep-2012 Hante Meuleman <meuleman@broadcom.com> brcmfmac: Stop all net if queues on tx flow halt.

When tx flow is to be blocked due to host interface throttle then
all net if queues should be stopped.

Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
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>
4a1c02ce7f44895d7556735fefbaa7966ddbcb07 30-Aug-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: add BCM43241 sdio interface driver support

BCM43241 is an 11abg and 2x2 11n Wifi/BT/FM combo chip that
supports 40MHz channel width. This patch intends to enable
the driver support for the chip through SDIO bus interface.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9bd02c6b9e6219829929111c46ef007c7a76865f 26-Jun-2012 Arend van Spriel <arend@broadcom.com> brcmfmac: fix sparse warning introduced with checkdied patch

The commit "brcmfmac: introduce checkdied debugfs functionality"
also introduced a sparse warning:

..../brcmfmac/dhd_sdio.c:3147:45: sparse: cast to restricted __le32

This patch fixes this sparse warning.

Reported-by: Fengguang Wu <wfg@linux.intel.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>
85a4a1c3bc42e7ab7027f94984be04e41a7cc496 26-Jun-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: add BCM4334 support

BCM4334 is a dualband a/b/g/n WiFi chip support 20MHz/40MHz
channels. This patch adds support for its SDIO interface.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6d4ef68086f54713b6c9dda478b8e3f749acb3ba 26-Jun-2012 Arend van Spriel <arend@broadcom.com> brcmfmac: reduce allocations needed during nvram data download

The nvram data is preprocessed before being sent to the device
and just before sending an additional allocation was done that
assured word alignment of the data. This has moved to the
preprocessing step to reduce allocations and subsequent copying
of the nvram data.

Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d610cde30b009ac3dbcd1ae5d7d55fa4c7d066fa 26-Jun-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: use firmware data buffer directly for nvram

The nvram file could be parsed directly in the data buffer in the
firmware structure passed by request_firmware function. This patch
gets rid of the redundant memcpy.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c3d2bc35e53dc0dcb85f4f4f06486ecd99143615 26-Jun-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: move glom alignment setting to SDIO bus layer

txglomming alignment is a SDIO bus specific feature. It is more
appropriate to place it in SDIO bus layer instead of common layer.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bbfd6a66ff69e3e1850bead3e30031e303581cb1 26-Jun-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: restrict dongle txglom disable to old SDIO core

txglomming is a firmware feature for sdio bus interface. For SDIO
device cores newer than revision 11, the default setting of
firmware should be used instead of disabling it from the host side.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8dc01811da1119d6a5e595b5200b788c6603d3b2 21-Jun-2012 Arend van Spriel <arend@broadcom.com> brcmfmac: make inclusion of vmalloc.h explicit fixing linux-next build

This patch fixes problem detected in linux-next build for powerpc
allyesconfig. The error message below is no longer observed:

CC drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.o
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c: In function 'brcmf_sdio_dump_console':
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:3085: error: implicit declaration of function 'vzalloc'
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:3085: warning: assignment makes pointer from integer without a cast
drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c:3113: error: implicit declaration of function 'vfree'
make[2]: *** [drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.o] Error 1

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4fc0d0160d59689a90cebcdc9c269ac1d8c6d161 14-Jun-2012 Arend van Spriel <arend@broadcom.com> brcmfmac: introduce checkdied debugfs functionality

The checkdied functionality provides useful information for analyzing
firmware crashes. By exposing this information to a debugfs file users
can easily provide its content in bug reports. The functionality is
available only when CONFIG_BRCMDBG is selected.

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>
80969836a7ddde326d3f289d234e9e2d9ed27272 09-Jun-2012 Arend van Spriel <arend@broadcom.com> brcmfmac: expose sdio internal counters in debugfs

The structure brcmf_sdio contains a number of counters that are useful
for debugging. These were not available in user-space. This patch
exposes them in debugfs under the filename 'counters'.

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>
2c208890c6d4e16076c6664137703ec813e8fa6c 04-Jun-2012 Joe Perches <joe@perches.com> wireless: Remove casts to same type

Adding casts of objects to the same type is unnecessary
and confusing for a human reader.

For example, this cast:

int y;
int *p = (int *)&y;

I used the coccinelle script below to find and remove these
unnecessary casts. I manually removed the conversions this
script produces of casts with __force, __iomem and __user.

@@
type T;
T *p;
@@

- (T *)p
+ p

Neatened the mwifiex_deauthenticate_infra function which
was doing odd things with array pointers and not using
is_zero_ether_addr.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
5c15c23a7be8b5c353d8e90ecf5bbd578c040a8a 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: remove function brcmf_sdcard_regfail

The new interface brcmf_sdio_regr/w provides result of access
attempts. It is no longer necessary to use dedicated variable
and function to provide enquiry for failure.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
586927505019573312e8478bd644ad1e9fc46432 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: remove redundant retries for SDIO core register access

The new brcmf_sdio_regrl/regwl interface has already performed
retries on failed attempts. It is no longer necessary to have the
retry mechanism in r_sdreg32/w_sdreg32.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e13ce26bd53296fdf2c78836ce7b880df75c6e6e 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: replace brcmf_sdcard_reg_write with brcmf_sdio_regwl

Use the newly introduced brcmf_sdio_regwl to replace
brcmf_sdcard_reg_write as part of the SDIO WiFi dongle register
access interface clean up.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
79ae39570f82f96e2d899c100e32409129c6d62f 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: replace brcmf_sdcard_reg_read with brcmf_sdio_regrl

Use the newly introduced brcmf_sdio_regrl to replace
brcmf_sdcard_reg_read as part of the SDIO WiFi dongle register
access interface clean up.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3bba829f63ad776be487005c3a106531a27806f5 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: replace brcmf_sdcard_cfg_write with brcmf_sdio_regwb

Use the newly introduced brcmf_sdio_regwb to replace
brcmf_sdcard_cfg_write as part of the SDIO WiFi dongle register
access interface clean up.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
45db339cd2b138fba993013b5d73049fd3384e44 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: replace brcmf_sdcard_cfg_read with brcmf_sdio_regrb

Use the newly introduced brcmf_sdio_regrb to replace
brcmf_sdcard_cfg_read as part of the SDIO WiFi dongle register
access interface clean up.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ce454e88289b54b0ccb8341007137f4df77123fd 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: remove unused parameter of brcmf_sdcard_reg_write

The size parameter for brcmf_sdcard_reg_write is always 4. Remove it
to make the code cleaner.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
abb7fbb4a727f8bd446658a061a039674c907aec 05-May-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: remove unused parameter of brcmf_sdcard_reg_read

The size parameter for brcmf_sdcard_reg_read is always 4. Remove it
to make the code neat.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ba89bf1961bb991a5c6415bd8408a8cb61ee46dc 28-Apr-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: add out of band interrupt support

Some sdio host controllers do not support real in band interrupt.
Software polling mode as a replacement is not fast enough for
high throughput and new features. Also some in band interrupts
do not support host wake up on embedded platform even when they
are real physical interrupts. Therefore out of band (oob)
interrupt mechanism is implemented for these scenarios.

To provide oob irq number and flags used for irq registration in
brcmfmac, a platform device contains irq resource must be
registered in board specific code.

Here is an example of platform device structure:
struct resource brcmf_sdio_res[] = {
{
.start = GPIO_BRCMF_SDIO_OOB_NUM,
.end = GPIO_BRCMF_SDIO_OOB_NUM,
.flags = IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL,
}
};
struct platform_device brcmf_sdio_device = {
.name = "brcmf_sdio_pd",
.id = -1,
.num_resources = ARRAY_SIZE(brcmf_sdio_res),
.resource = brcmf_sdio_res,
};

Reviewed-by: pieter-paul giesberts <pieterpg@broadcom.com>
Reviewed-by: arend van spriel <arend@broadcom.com>
Signed-off-by: franky lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e2f93cc3218853a3c00bd7c9f923bec65aaf9103 28-Apr-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: postpone interrupt register function

For out of band interrupt which is going to be introduced shortly,
the interrupt register function must be called after firmware is
downloaded. This patch moves it from brcmf_sdbrcm_probe to
brcmf_sdbrcm_bus_init.

Reviewed-by: pieter-paul giesberts <pieterpg@broadcom.com>
Reviewed-by: arend van spriel <arend@broadcom.com>
Signed-off-by: franky lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d9126e0c420b1ced6a2482aeda8380bca7fbebb0 28-Apr-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: check bus state for status

Bus state should be the correct flag for bus status. Use it instead
of result from previous function call for backplane clock switch.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cf04317227d0c53d931a0b963e7ac6f7f0125e8a 30-Apr-2012 Franky Lin <frankyl@broadcom.com> brcmfmac: fix a double spin_unlock_irqrestore issue in dpc

dpc_tl_lock is not acquired in the error handle code for bus down.
But it's unlocked using spin_unlock_irqrestore after finishing task
list walk down. Grab the lock before breaking the loop to avoid a
double unlock.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b948a85c1f26d48395de8c6c7e392f008f1be666 23-Apr-2012 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: fix missing completion events issue

dpc takes care of all data packets transmissions for sdio function
2. It is possible that it misses some completion events when the
traffic is heavy or it's running on a slow cpu. A linked list is
introduced to make sure dpc is invoked whenever needed.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
474a64c80e2979bbc290a7eccf76e5694cbd5fee 11-Apr-2012 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: register primary net device with device mac address

The primary net device was registered with a primary mac address and
upon IFUP it was set to match the actual mac address from the device.
This patch changes that and moves the brcmf_add_if() call to the common
part of the driver.

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>
52e1409f72d629644b496db80c119e04ebabad90 09-Feb-2012 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: make sdio firmware filename specific

The sdio driver part uses firmware name brcmfmac.bin. With addition
of usb this name is too generic. This patch renames the filename
to brcmfmac-sdio.bin.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@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>
1bb1f38462bcf58cf98d8f7bedf2bfefd394f940 09-Feb-2012 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: update bus state in common driver part

The bus state is updated in the sdio bus init function, but it is
better to do it when the brcmf_bus_start() function is completed
successfully. The brcmf_netdev_open() function will return -EAGAIN
until the state is updated instead of calling brcmf_bus_start() to
avoid reentering that function.

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>
c0e89f084b5089acdfdda1cb45c88896fa0f5139 09-Feb-2012 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: only return success in brcmf_sdbrcm_bus_init() when true

The function brcmf_sdbrcm_bus_init() always returned success except for
firmware download failure. However, also when enabling SDIO function 2
is failing the function should return failure. This patch fixes that.

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>
0a332e4678e4e4f0030f10827980c72d32300274 09-Feb-2012 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: use specific types in struct brcmf_bus

The fields bus_priv and drvr are defined as void pointer. It is
preferred to have specific types for compiler type checking. To
prepare for other bus types the bus_priv field is defined as a
union containing the sdio bus private structure reference.

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>
23677ce3172fcb93522a1df077d21019e73ee1e3 09-Feb-2012 Joe Perches <joe@perches.com> drivers/net: Remove boolean comparisons to true/false

Booleans should not be compared to true or false
but be directly tested or tested with !.

Done via cocci script:

@@
bool t;
@@
- t == true
+ t
@@
bool t;
@@
- t != true
+ !t
@@
bool t;
@@
- t == false
+ !t
@@
bool t;
@@
- t != false
+ t

Signed-off-by: Joe Perches <joe@perches.com>
Reviewed-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
02f77195db6ce252d5488b6d48d8edc1c5e2aa30 15-Jan-2012 Joe Perches <joe@perches.com> brcm80211: Use pr_fmt and pr_<level>

Convert printks to pr_<level>
Prefix logging with pr_fmt.
Use ##__VA_ARGS__ in some WL_ logging macros.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
18aad4f8e11530fd7e41d0faea0752c3a0ce799c 15-Jan-2012 Joe Perches <joe@perches.com> brcm80211: Convert printk(KERN_DEBUG to pr_debug

Use pr_debug to allow dynamic debugging to work.

Move an #endif to allow brcmf_dbg_hex_dump
to be outside the #if/#endif block.
Move a const char* declaration to be inside a
pr_debug so the function doesn't need a #if/#endif
block.
Don't use temporaries in debugging functions so
the code can be optimized away.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8fb1eb8b221f1cf81128b7f681b5a5112bfcd3a2 15-Jan-2012 Joe Perches <joe@perches.com> brcmfmac: Remove useless #ifdef DEBUG

This doesn't do anything anymore.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
1e02382979dd422e3b1bdb45545a0699497e3692 15-Jan-2012 Joe Perches <joe@perches.com> brcm80211: Add and use brcmX_dbg_dump_hex

Reduce the number of #ifdef DEBUG uses by
adding a dbg_hex_dump routine which has the
appropriate #ifdef DEBUG test.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8ae746543c8370fd04c28aaf8f185c1687b0e694 15-Jan-2012 Joe Perches <joe@perches.com> brcm80211: Use normal DEBUG define

Current CONFIG_BRCMDBG flag when enabled does not
necessarily enable proper pr_debug output when
DEBUG is not also enabled.

Remove BCMDBG define and just use DEBUG instead.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c40701eacbaebcfe3fb6fac8ef3da653021c212c 08-Jan-2012 Jesper Juhl <jj@chaosbits.net> brcm80211: Don't leak 'vbuffer' in brcmf_sdbrcm_write_vars()

If the memory allocation 'nvram_ularray = kmalloc(varsize,
GFP_ATOMIC);' fails we'll leak the memory allocated to 'vbuffer' when
we return -ENOMEM from the function.

This patch resolves the leak by kfree()'ing the allocated memory
before the return.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
54a86cc596cea4f1bc84a53f326fa27583af1633 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: exclude unnecessary header files

This patch removes some headers files include lines from sdio layer
code. This is part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
382a9e0f31235e4efd63977646da5c84e73febf7 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move idle macros to dhd_sdio.c

The idle macros are only used by dhd_sdio.c. It's more appropriate
to place them in dhd_sdio.c instead of dhd.h.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fcf094f414f9e9c088f6c2aa9e19a59f7b41e1f5 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: abstract ctrl frames interface function pointers

Abstract bus layer brcmf_bus_txctl/brcmf_bus_rxctl function
pointers for common layer. This patch is part of the fullmac bus
interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b9692d17e842fadb8c18faf24f550db80886763e 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: abstract bus_txdata interface function pointer

Abstract bus layer brcmf_bus_txdata function pointer for common
layer. This patch is part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
99a0b8ff9105d9b78e7e4e6aaa077264707e4e1c 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: abstract bus_init interface function pointer

Abstract bus layer brcmf_bus_init function pointer for common
layer. This patch is part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a9ffda88be7416b8336f644806c2b3ed3ce08b26 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: abstract bus_stop interface function pointer

Common layer should use interface function pointer stored in
brcmf_bus to invoke corresponding interface function in bus layer.
This patch is part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2447ffb0bdf89d14c9a9503e33b32b73d3040fee 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: stop referencing brcmf_sdio in common layer

brcmf_sdio is the data structure for sdio bus layer. Stop
referencing brcmf_sdio from common layer. This patch is part of
the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
712ac5b37a3348cac4e040c551a6ca6186d33682 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: stop referencing brcmf_pub in bus layer

brcmf_pub is the data structure for common layer. Since brcmf_bus
should be the only structure shared by common layer and bus layer,
stop referencing brcmf_pub from bus layer. This patch is part of
the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c8bf34849f92c5894a3d7e12573d3789d7851f23 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move tx flow ctrl flag to bus layer

txoff is the flow control flag for transmit used in sdio layer.
Move it to bus layer data structure brcmf_sdio. Also flag
management code is moved out of brcmf_txflowcontrol(). This is
part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9c1a043ae688151444578f15208233143526bb88 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move packet realloc stats to struct brcmf_bus

tx_realloc is used by both common layer and bus layer. This patch
moves it to interface structure brcmf_bus as part of the fullmac
bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
719f2733baa1e6a6a782c5109bfe054431db4259 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move dongle statistics to struct brcmf_bus

Dongle statistics are shared data between common layer and bus
layer. This patch places them in bus interface structure brcmf_bus
as part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4033927cb891863ffdd689554051e205d74675bf 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: remove duplicate statistics from driver data structure

Some dongle statistics are stored in two places and synced when net
device status inquired. There is no need to do it this way any more.
Direct all usage to dongle stats structure in order to increase
readability.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
3fb1d8d2dad35f5094350c175b778b78df894284 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move driver up status to struct brcmf_bus

Driver up/down status to network interface need to be shared by
common layer and bus layer. Move it to bus interface structure
brcmf_bus as part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b01a6b3ca714e2bb86ee387aee487c7360363c93 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move maxctl to struct brcmf_bus

maxctl is the max size of rxctl request from protocol layer to bus
layer. Move it to bus interface structure brcmf_bus. This is part
of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
28a1a3bdaf4cce5ee8e473c332e2f371888341bb 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move sdio used statistics to struct brcmf_sdio

Some statistics only used by sdio modules. Move them to sdio layer
private structure brcmf_sdio. This is part of the fullmac bus
interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d5625ee66f82162acb7189c1974e688ebc178cf3 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function proto_hdrpull parameter

Change parameter to device pointer for bus layer interface function
brcmf_proto_hdrpull This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
228bb43d5d82549c43eee29e12d7632d4df4e4df 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function rx_frame parameter

Change parameter to device pointer for bus layer interface function
brcmf_rx_frame. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b63487ed3d7d8bc08c966eac0543e8f3f70b7fb4 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function brcmf_c_prec_enq parameter

Change parameter to device pointer for bus layer interface function
brcmf_c_prec_enq. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c995788f4761f175f811cbeabb2f88ab8565ec1e 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function txcomplete parameter

Change parameter to device pointer for bus layer interface function
brcmf_txcomplete. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2b4590569ead15fb88a83c1d8a07e3ca5507f4c6 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function txflowcontrol parameter

Change parameter to device pointer for bus layer interface function
brcmf_txflowcontrol. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5f947ad942a72e7f96942da97d719dd62037dbc2 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function brcmf_detach parameter

Change parameter to device pointer for bus layer interface function
brcmf_detach. This is part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ed683c986f6fff6b9d9fe2adc8b11e0b0be7c085 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function bus_start parameter

Change parameter to device pointer for bus layer interface function
brcmf_bus_start. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
55a63bcc4cdeabf76f7e42a76d0c59dbe37d0d64 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function add_if parameter

Change parameter to device pointer for bus layer interface function
brcmf_add_if. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d08b6a3759818eed78057a8bafebc630dbe9a9ba 17-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: unify common layer driver data structure

No need to split data structure for common layer into brcmf_pub and
brcmf_info. Absorb brcmf_info into brcmf_pub to increase code
readability.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ce2d7d7e8fd88191f5d1c92a8b33aeb0cb12ea34 09-Dec-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: add bcm4330 support

This patch adds support for bcm4330 chip which has a SDIO device
id 0x4330. All basic functionalities of bcm4330 are supported by
brcmfmac after this patch.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
94c2fb82bd7c9055bec8e410c387befce33d1299 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function bus_stop parameter

Change parameter to device pointer for bus layer interface function
brcmf_sdbrcm_bus_stop. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
c0a7962ae72c9ebf42f623719a46c8f472f44067 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: remove function brcmf_bus_get_device

brcmf_bus_get_device is no longer necessary. Use dongle device pointer
saved in brcmf_pub directly. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
fa20b91143c616d402f1ed61f27693477279d0c6 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function bus_init parameter

Change parameter to device pointer for bus layer interface function
brcmf_sdbrcm_bus_init. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
bf347bb9768ab0da028a0d9f92142df738211deb 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function bus_txdata parameter

Change parameter to device pointer for bus layer interface function
brcmf_sdbrcm_bus_txdata. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
47a1ce78d544b9fb3b776a62de3c084cf0020fda 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function bus_txctl parameter

Change paramter to device pointer for bus layer interface function
brcmf_sdbrcm_bus_txctl. This is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
532cdd3b99b7a89fdc128c2b58abea780f3bbb4d 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change function bus_rxctl parameter

brcmf_sdbrcm_bus_rxctl acts as an interface function of bus layer.
Change parameter from struct brcmf_sdio to device pointer in order to
provide a more compatible interface for different bus layers. This
is part of the fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
cad2b26b1010d0694d2f08d408486451b9f919d2 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: stop using brcmf_pub in brcmf_sdbrcm_bus_watchdog

structure brcmf_pub contains context for generic layer and should
not be used in brcmf_sdbrcm_bus_watchdog. This patch is part of
fullmac bus interface refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8d169aa00d0356f915e84dbdf6c9be381cce34a4 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move busstate to struct brcmf_bus

busstate keeps track of the bus (USB/SDIO) status and is used by
both generic layer and bus layer. Move it to brcmf_bus helps to clean
up the interface. This patch is part of fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e92eedf4e080fc0bd98e892cb9d31d2163ae8b29 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: rename structure brcmf_bus to brcmf_sdio

Rename sdio bus structure brcmf_bus to brcmf_sdio for preparation
of USB bus support. This patch is part of the fullmac bus interface
refactoring.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4175b88bd22022a60de175f94fdb303bed087eb9 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: remove unused parameter of brcmf_sdbrcm_probe

bus_no, slot, func and bustype are no longer needed by brcmf_sdbrcm_probe.
This patch removes them.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
4f96bf1910491e3d8e41915239080422e9810662 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: remove function brcmf_c_init

brcmf_c_init only init brcmf_msg_level used for debug. It's no longer
needed as brcmf_msg_level doesn't cause trouble to multiple instances.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
8dd939cade92647a7c87db5ae895a6e120258320 23-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: change firmware/nvram name to be more generic

The nvram file contains info for firmware which varies with different
hardware designs. Use more common firmware/nvram file names instead
of those in Linux firmware repository to avoid misunderstanding.

Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5adfeb632c52a6c15e98fa6465bdade6fff915d9 23-Nov-2011 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: separate receiving skb chain from other receive path

In the receive path the buffer used to store the receive data from the
device can be a chain of sk_buff. It has been separated to allow the
use of skb queues.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@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>
0b45bf74f91e781b74bfadb8bb08ef341b6befd3 23-Nov-2011 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: cleanup receive path using proper skb_queue functions

In the receive path there was still code using the next pointer to
access all packets in skb_queue. This patch fixes that.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@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>
99b72cde632b67603f4c7f18e8ff23a57b484478 10-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: remove PCMCIA core related code

all the devices supported or will be supported by brcmfmac
do not have a PCMCIA bus core. So remove the corresponding code.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
046808daf9f6b8c5275861330d4f8c2e6cfe3c31 10-Nov-2011 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: add function to free the glom skb queue

In several places in dhd_sdio.c a skb packet queue was being emptied
and the packets freed. This warrants to have a function in place to
do this.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
9a95e60e0610bb8ec39c74d2c8546514a76428df 10-Nov-2011 Arend van Spriel <arend@broadcom.com> brcm80211: util: move brcmu_pkttotlen() function to brcmfmac

The functions brcmu_pkttotlen() is only used in brcmfmac driver
so it has been moved there. It also does not use the sk_buff
next pointer anymore but walks a skb queue to determine the total
length.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Alwin Beukers <alwin@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d77e70ff5ace175f19447a1965691a794c27de24 10-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: add resetcore function for bcm4330 chip

This patch is part of the series of adding new backplane support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
086a2e0a63eef367dab9b4499ba0cfe3a309ec94 10-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: add coredisable function for bcm4330 chip

This patch is part of the series of adding new backplane support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
6ca687d9461b25ce2339ba1809ec13ef459d4661 10-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: add iscoreup function for bcm4330 chip

New type of backplane interconnect support is needed
for bcm4330

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
99ba15cd75ed22e4ae86804ca2982a724e8102c2 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: optimize chip core info management

Prepare for adding backplane interconnect type support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e12afb6c5d13ebff64d4a2feb97cce0c2d7e1128 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move chip drive strength related code to sdio_chip.c

This patch is part of the abstracting chip backplane handle code
series.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a8a6c04586233e12551552c292797cb56b31dade 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move chip detach function to sdio_chip.c

This patch is part of the abstracting chip backplane handle code
series.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2bc78e10d841f81ea7a2b25bc0481ea4af06437e 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move chip reset core function to sdio_chip.c

This patch is part of the abstracting chip backplane handle code
series.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
454d2a8816d6bc6594d3d475392290623af63656 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: abstract chip core revision function

Prepare for adding backplane interconnect type support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
d8f64a425b3a79e7d276e438ad7246c916a4b195 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: abstract chip iscoreup function

Prepare for adding backplane interconnect type support

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a97e4fc5ae4b00187b25a8216a61b2105efa9c60 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: chip attach code flow clean up

Merged brcmf_sdbrcm_chip_attach into brcmf_sdio_chip_attach
for better readability.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
98ce903519b4874673e75ba80657c4114b933bac 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: remove duplicate regiter set in chip attach path

Same register writes have been done in brcmf_sdbrcm_probe_init
which is earlier in the same code path.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
960908dceabf40d7335170d26dbf13f63b240c67 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move dongle gpio reset code to chip attach function

This patch is part of the abstracting chip backplane handle code
series.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
966414da2d5a0c957d331e3f06255ec2277acb65 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: disable dongle arm core in bus core setup function

This will provide a better code flow that fits the logic

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2d4a9af172814b76bf2ad5da2213ea42d111893b 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move core disable function to sdio_chip.c

This patch is part of the abstracting chip backplane handle code
series.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
e63ac6b888eed345f5b93751649515d6436abed2 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move bus core prep code to sdio_chip.c

This patch is part of abstracting chip backplane handle code
series.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
a83369b6e1e7285edd5217601a0618b9a43bdc4b 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: move chip recognition function to sdio_chip.c

Currently backplane handle code is scatterd around dhd_sdio.c which
is not good for maintenance and adding new backplane interconnect
type support. This patch and the follow up patches are going to
abstract all chip backplane control code specific for sdio bus
into this new sdio_chip.c

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
718897eb3f90a47a56acb504762d521388a3231c 04-Nov-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: remove unnecessary 4329 chip specific code

4329 with chiprev 0 can not be found on any product. The code can
be removed.

Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
15d45b6fbd01ecebc5a77b1e06ae7ebffad8018a 21-Oct-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: use brcmf_add_if for all net devices

Use brcmf_add_if for primary and virtual net device interfaces. This
is part of the net device interface clean up for fullmac.

Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
ece960eae81c604aa14a1bf431eda34f4fe71c0c 21-Oct-2011 Franky Lin <frankyl@broadcom.com> brcm80211: fmac: allow wd timer to be disabled when bus down

Watchdog timer should be able to be stopped even firmware is not
loaded.

Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-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>
b83db862ffb871e3131e5d2160c741b288eea9aa 19-Oct-2011 Arend van Spriel <arend@broadcom.com> brcm80211: fmac: use sk_buff list for handling frames in receive path

The functions in the receive patch of the fullmac now use sk_buff
list and skb_queue_xx() functions instead of dealing with list pointers
in the sk_buff directly.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
20e5ca16397648811a9e1ad531360c843e005a57 18-Oct-2011 Arend van Spriel <arend@broadcom.com> brcm80211: util: move brcmu_pktfrombuf() function to brcmfmac

The function brcmu_pktfrombuf was only used in the brcmfmac source
and has been moved there. It has been refactored to match its use.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Roland Vossen <rvossen@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>
b7a57e762ecf5d9971549ab3f9eb66b559840e72 12-Oct-2011 Stephen Rothwell <sfr@canb.auug.org.au> net: wireless: brcm80210: include module.h

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
b0551fb7e01d76165367ce77ddfcb80009b31427 12-Oct-2011 Alwin Beukers <alwin@broadcom.com> brcm80211: moved function brcmu_chipname

Moved the brcmu_chipname function into the only file using it.
The function name was adjusted accordingly.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Roland Vossen <rvossen@broadcom.com>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
5b435de0d786869c95d1962121af0d7df2542009 05-Oct-2011 Arend van Spriel <arend@broadcom.com> net: wireless: add brcm80211 drivers

Add the brcm80211 tree to drivers/net/wireless, and disable the version that's
in drivers/staging. This version includes the sources currently in staging,
plus any changes that have been sent out for review.

Sources in staging will be deleted in a followup patch.

Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>