Commit Graph

36 Commits

Author SHA1 Message Date
Arend van Spriel 79d7c4e8da 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>
2013-01-07 15:16:56 -05:00
Arend van Spriel 5e8149f503 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>
2012-12-10 15:33:06 -05:00
Hante Meuleman b87e2c4825 brcmfmac: code cleanup
Removing obsolete functions and prototypes. Moving (and renaming)
defines to place with similar definitions. Removing unnecessary
includes.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-16 14:29:05 -05:00
Arend van Spriel 5c36b99add brcmfmac: rework firmware event handling code
Handling of firmware event has been reworked into a seperate
code file. The change is needed as firmware event can be received
in interrupt context. Decoupling of the event handling has been
lowered to allow event processing to sleep.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-16 14:28:45 -05:00
Hante Meuleman 80e0fa8920 brcmfmac: remove obsolete function brcmf_c_mkiovar
the refactored firmware interface layer made this function obsolete.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-14 14:55:52 -05:00
Hante Meuleman c697be5a58 brcmfmac: fix pkt_filter sizeof calculation.
sizeof calculation in setting pkt_filter was incorrect. This
patch fixes that and removes related defines which have become
obsolete.

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>
2012-11-14 14:55:48 -05:00
Hante Meuleman 0af29bf7c1 brcmfmac: use fwil for default configuration setup.
modify the setup code to use the refactored firmware interface layer.

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>
2012-10-29 15:28:31 -04:00
Arend van Spriel 1ed9baf0f1 brcmfmac: rework driver initialization in brcmf_bus_start()
In brcmf_bus_start() a number of settings are sent to the device. For
this functions are used that bypass the common firmware interface.
By reordering the code in brcmf_bus_start() this bypass can be removed.

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>
2012-10-29 15:28:23 -04:00
Arend van Spriel 1d4fd8d78f brcmfmac: extend struct brcmf_if with bssidx field
When the firmware notifies the driver about adding a new interface
it also provides an index for the bss associated with this interface.
This index will be needed for upcoming features like peer-to-peer.
By adding this index in struct brcmf_if it is easy to obtain as this
will be associated with the net_device private data.

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>
2012-10-29 15:28:22 -04:00
Hante Meuleman 348a130ceb brcmfmac: remove redundant function brcmf_c_mkiovar_bsscfg
function brcmf_c_mkiovar_bsscfg became redundant with refactoring
of firmware interface layer.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Signed-off-by: Hante Meuleman <meuleman@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-29 15:28:19 -04:00
Arend van Spriel c5b057b55f brcmfmac: remove 'always false' condition from brcmf_c_mkiovar_bsscfg
The parameter buflen is unsigned so the condition buflen < 0 is
always false. The patch fixes the if statement checking the buffer
length.

Reported-by: Dan Carpenter <dan.carpenter@oracle.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: Franky Lin <frankyl@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-10-19 16:20:03 -04:00
John W. Linville e4d680c706 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2012-10-01 07:39:36 -04:00
David S. Miller a248afdc1b Merge branch 'for-davem' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next
John W. Linville says:

====================
Here is another batch of updates intended for 3.7...

Highlights include an hci_connect re-write in Bluetooth, HCI/LLC
layer separation in NFC, removal of the raw pn544 NFC driver, NFC LLCP
raw sockets support, improved IBSS auth frame handling in mac80211,
full-MAC AP mode notification support in mac80211, a lot of attention
paid to brcmfmac, and the usual level of updates to iwlwifi, ath9k,
mwifiex, and rt2x00, and various other updates.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-30 02:30:16 -04:00
David S. Miller 6a06e5e1bb Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts:
	drivers/net/team/team.c
	drivers/net/usb/qmi_wwan.c
	net/batman-adv/bat_iv_ogm.c
	net/ipv4/fib_frontend.c
	net/ipv4/route.c
	net/l2tp/l2tp_netlink.c

The team, fib_frontend, route, and l2tp_netlink conflicts were simply
overlapping changes.

qmi_wwan and bat_iv_ogm were of the "use HEAD" variety.

With help from Antonio Quartulli.

Signed-off-by: David S. Miller <davem@davemloft.net>
2012-09-28 14:40:49 -04:00
Hante Meuleman f09d0c02b6 brcmfmac: use different fw api for encryption,auth. config
This patch changes the commands being used to configure
encryption and authentication. These new methods are needed
for when p2p and hostap support are added.

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>
2012-09-28 13:54:07 -04:00
Hante Meuleman 30c52bcf5c brcmfmac: fix debug printout of event data.
Some events result in printing of the buffer when debug is
enabled. This printing was not very efficient. Changed to
macro so it comes out nice and clean without filling log buffer.

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>
2012-09-24 15:02:05 -04:00
Arend van Spriel 4f6e1cafe2 brcmfmac: add parameter check in brcmf_c_mkiovar()
This patch assures data is only appended in output buffer when
data is not NULL and datalen is not zero.

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>
2012-09-24 14:59:09 -04:00
Hante Meuleman e756af5b30 brcmfmac: add e-scan support.
This patch adds e-scan support (currently i-scan is in use). E-scan
is a more powerful and memory efficient method for scanning. E-scan
will be the default scan method and eventually, i-scan support will
be removed. The scan methods do not make any difference to the end-user.

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>
2012-09-12 14:19:16 -04:00
Hante Meuleman e020a83d09 brcmfmac: Fix big endian host configuration data.
Fixes big endian host configuration parameters.

Cc: stable <stable@vger.kernel.org>
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>
2012-09-12 14:15:31 -04:00
Franky Lin c3d2bc35e5 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>
2012-06-27 15:23:17 -04:00
Franky Lin bbfd6a66ff 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>
2012-06-27 15:23:17 -04:00
Franky Lin 135e4c6184 brcmfmac: add support for bus specific data command
brcmfmac need to support data command setting for dongle's bus
core. A list must be placed at brcmf_bus structure before calling
brcmf_bus_start in order to be sent by brcmf_c_preinit_dcmds.

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>
2012-06-27 15:23:17 -04:00
Franky Lin 3338084ab3 brcm80211: fmac: postpone dongle RF enabling.
BRCMF_C_UP is the command that asks the firmware to enable RF of
dongle. Some firmware initialization steps must be performed during
RF is down. Postpone BRCMF_C_UP firing until brcmf_netdev_open get
called to ensure firmware have enough time to finish
initialization.

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>
2012-04-13 14:32:53 -04:00
Joe Perches 02f77195db 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>
2012-01-24 14:21:14 -05:00
Joe Perches 18aad4f8e1 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>
2012-01-24 14:21:14 -05:00
Joe Perches 8ae746543c 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>
2012-01-24 14:21:13 -05:00
Franky Lin 6e3c712807 brcm80211: fmac: move sdio related macros to sdio_host.h
dhd_bus.h will be used as the shared header file for common layer
and bus layer. It should not contain any sdio specific macros.
This patch moves them to sdio_host.h 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>
2011-12-19 14:40:46 -05:00
Franky Lin b63487ed3d 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>
2011-12-19 14:40:44 -05:00
Franky Lin 55a63bcc4c 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>
2011-12-19 14:40:43 -05:00
Franky Lin 1ae00421e7 brcm80211: fmac: remove oneline proto block functions
brcmf_os_proto_block and brcmf_os_proto_unblock are oneline
functions handling proto_block mutex. Place the mutex interface
call inline 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>
2011-12-19 14:40:42 -05:00
Franky Lin d08b6a3759 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>
2011-12-19 14:40:42 -05:00
Franky Lin 4f96bf1910 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>
2011-11-28 14:43:37 -05:00
Franky Lin 15d45b6fbd 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>
2011-11-08 15:54:24 -05:00
Alwin Beukers 53a2277d2a brcm80211: moved function brcmu_mkiovar
Moved the brcmu_mkiovar function into fmac, adjusting the
name 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>
2011-10-14 14:48:19 -04:00
Arend van Spriel f7264adb9a brcm80211: add endian annotation to packet filter structures
The packet filter structures were byte copied and transferred over the
host bus to the device. As such they are little endian and have been
annotated accordingly.

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>
2011-10-14 14:48:17 -04:00
Arend van Spriel 5b435de0d7 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>
2011-10-11 15:55:30 -04:00