Commit graph

988 commits

Author SHA1 Message Date
John W. Linville
235f939228 Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
Conflicts:
	net/ieee802154/6lowpan.c
2014-01-10 10:59:40 -05:00
Arend van Spriel
11e69c36ee 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>
2014-01-09 10:56:38 -05:00
Arend van Spriel
6e08d757b7 mmc: add SDIO identifiers for Broadcom WLAN devices
The SDIO identifier for Broadcom WLAN devices were defined in the
brcmfmac SDIO driver. Moving the definitions in MMC header file
seems common sense.

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>
2014-01-06 15:48:06 -05:00
Arend van Spriel
9df4d542fc brcmfmac: use custom destructor callback for all netdevice interfaces
The destructor for net devices was set to free_netdev() to get rid
of it and the private data. The private data refers to a brcmf_if
instance, but indirectly it also refers to brcmf_cfg80211_vif which
holds the wdev. This is freed as well by using a new custom destructor
called brcmf_cfg80211_free_netdev().

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>
2014-01-06 15:48:06 -05:00
Arend van Spriel
e14799514d brcmfmac: call brcmf_cfg80211_detach() after removal of interfaces
Instead of calling brcmf_cfg80211_detach() in brcmf_del_if() when
deleting the primary interface, call it in brcmf_detach() after
deleting all interfaces.

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>
2014-01-06 15:48:05 -05:00
Arend van Spriel
427dec5fc8 brcmfmac: move wiphy_unregister() call to brcmf_cfg80211_detach()
The wiphy_unregister() call was done in brcmf_free_vif() when the
last interface was being removed. This is not the obvious place to
do that. This patch moves it to the brcmf_cfg80211_detach(). This
removes the need to keep count of interfaces.

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>
2014-01-06 15:48:04 -05:00
Arend van Spriel
43dffbc6be brcmfmac: inform cfg80211 when changing the CONNECTED state
Upon unload of the brcmfmac driver it gave a kernel warning because
cfg80211 still believed to be connected to an AP. The brcmfmac had
already transitioned to disconnected state during unload. This patch
adds informing cfg80211 about this transition. This will get rid of
warning from cfg80211 seen upon module unload:

 ------------[ cut here ]------------
 WARNING: CPU: 3 PID: 24303 at net/wireless/core.c:952
	cfg80211_netdev_notifier_call+0x193/0x640 [cfg80211]()
 Modules linked in: brcmfmac(O-) brcmutil(O) cfg80211(O) ... [last unloaded: bcma]
 CPU: 3 PID: 24303 Comm: rmmod Tainted: G        W  O 3.13.0-rc4-wl-testing-x64-00002-gb472b6d-dirty #1
 Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011
  00000000000003b8 ffff8800b211faf8 ffffffff815a7fcd 0000000000000007
  0000000000000000 ffff8800b211fb38 ffffffff8104819c ffff880000000000
  ffff8800c889d008 ffff8800b2000220 ffff8800c889a000 ffff8800c889d018
 Call Trace:
  [<ffffffff815a7fcd>] dump_stack+0x46/0x58
  [<ffffffff8104819c>] warn_slowpath_common+0x8c/0xc0
  [<ffffffff810481ea>] warn_slowpath_null+0x1a/0x20
  [<ffffffffa173fd83>] cfg80211_netdev_notifier_call+0x193/0x640 [cfg80211]
  [<ffffffff81521ca8>] ? arp_ifdown+0x18/0x20
  [<ffffffff8152d75a>] ? fib_disable_ip+0x3a/0x50
  [<ffffffff815b143d>] notifier_call_chain+0x4d/0x70
  [<ffffffff8106d6e6>] raw_notifier_call_chain+0x16/0x20
  [<ffffffff814b9ae0>] call_netdevice_notifiers_info+0x40/0x70
  [<ffffffff814b9b26>] call_netdevice_notifiers+0x16/0x20
  [<ffffffff814bb59d>] rollback_registered_many+0x17d/0x280
  [<ffffffff814bb74d>] rollback_registered+0x2d/0x40
  [<ffffffff814bb7c8>] unregister_netdevice_queue+0x68/0xd0
  [<ffffffff814bb9c0>] unregister_netdev+0x20/0x30
  [<ffffffffa180069e>] brcmf_del_if+0xce/0x180 [brcmfmac]
  [<ffffffffa1800b3c>] brcmf_detach+0x6c/0xe0 [brcmfmac]

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>
2014-01-06 15:48:04 -05:00
Arend van Spriel
76a4c6817c 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>
2014-01-06 15:48:03 -05:00
Arend van Spriel
d6ae2c51be 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>
2014-01-06 15:48:03 -05:00
Arend van Spriel
3bd44d991f 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>
2014-01-06 15:48:02 -05:00
Arend van Spriel
af35f55f94 brcmfmac: add sdio drive strength programming for bcm4334 chipset
The table for BCM4334 SDIO drive strength programming was missing
from the driver. Adding it with this patch set.

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>
2014-01-06 15:48:02 -05:00
Arend van Spriel
2375d9701b brcmfmac: correct reporting HT40 support in wiphy htcap
Using 'iw phy' only showed HT20 support in the HT capabilities info.
This patch determines support for HT40 using a firmware query that
is supposed to work for all supported devices.

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>
2014-01-06 15:48:01 -05:00
Arend van Spriel
fad1322850 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>
2014-01-06 15:48:00 -05:00
Arend van Spriel
bfad4a048c 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>
2014-01-06 15:48:00 -05:00
Hante Meuleman
d453399229 brcmfmac: Limit control message length from host to device.
An control request or set message length is restricted to
ETH frame length for the buffer from host to device. This
is limitation is imposed by the firmware.

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>
2014-01-06 15:47:59 -05:00
Hante Meuleman
75b39dd240 brcmfmac: Remove some obsolete definitions and variables.
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>
2014-01-06 15:47:59 -05:00
Arend van Spriel
71c60cf2e9 brcmfmac: rework SDIO register access functions
The logic in the SDIO register access functions was hard to
read and contained a lot of conditional code path. This rework
attempts to clean it up.

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>
2014-01-06 15:47:58 -05:00
Josh Triplett
4ad77ac92d net: wireless: brcm80211: Drop debug version with build date/time
The kernel already has this information, and individual drivers
shouldn't duplicate that.  This also eliminates the use of __DATE__ and
__TIME__, which make the build non-deterministic.

Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2014-01-03 15:36:56 -05:00
John W. Linville
55d1cad2ef Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2014-01-03 15:25:15 -05:00
John W. Linville
ad86c55bac Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem 2014-01-01 15:39:56 -05:00
dingtianhong
692e5167b4 wireless: slight optimization of addr compare
Use possibly more efficient ether_addr_equal or
ether_addr_equal_unaligned instead of memcmp.

Cc: John W. Linville <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Weilong Chen <chenweilong@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:35 -05:00
Kyeyoon Park
fa9ffc7456 cfg80211: Add support for QoS mapping
This allows QoS mapping from external networks to be implemented as
defined in IEEE Std 802.11-2012, 10.24.9. APs can use this to advertise
DSCP ranges and exceptions for mapping frames to a specific UP over
Wi-Fi.

The payload of the QoS Map Set element (IEEE Std 802.11-2012, 8.4.2.97)
is sent to the driver through the new NL80211_ATTR_QOS_MAP attribute to
configure the local behavior either on the AP (based on local
configuration) or on a station (based on information received from the
AP).

Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-12-19 16:29:22 +01:00
Arend van Spriel
36c4e7e4aa brcmfmac: clarify struct brcmf_sdio_dev::func[0] reference
The struct brcmf_sdio_dev contains array of sdio functions that
are used in the driver. However, during probe func[0] entry was
assigned to the function 1 reference. This was corrected upon
doing the actual I/O access. This patch makes it more clear by
creating the func[0] entry properly and use it as is during
I/O access.

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>
2013-12-18 15:23:00 -05:00
Arend van Spriel
9fbe2a6dc7 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>
2013-12-18 15:22:59 -05:00
Arend van Spriel
82d7f3c10c 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>
2013-12-18 15:22:57 -05:00
Hante Meuleman
7b8a466e7c brcmfmac: Combine protocol push hdr and bus txdata.
For the transmission of data a protocol push hdr is performed
followed by a bus txdata call. For the new protocol msgbuf this
is not workable. Since they are already "loosely" coupled for
bcdc protocol they are combined. This means that txdata will
go "through" the protocol layer and a seperate protocol push
hdr will not be needed anymore.

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>
2013-12-18 15:22:55 -05:00
Hante Meuleman
943258b6a3 brcmfmac: Add definition of new protocol layer msgbuf.
A new protocol layer msgbuf will be added in the future. This
change makes it possible to select the desired layer by the
bus driver. USB and SDIO will select BCDC. At the moment
nothing is being done with this information.

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>
2013-12-18 15:22:53 -05:00
Hante Meuleman
9ecf51c583 brcmfmac: Fix hex dump for FWIL.
The debug function brcmf_dbg_hex_dump API got changed and the
information string should preferably contain a \n at the end
of the string. Update the FWIL so debug output looks better.

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>
2013-12-18 15:22:51 -05:00
Hante Meuleman
8141083c48 brcmfmac: Move common BCDC code in single function.
The BCDC functions query_dcmd and set_dcmd both create a msgbuf to
be sent to dongle this code is very similar and for optimisation
best put in a 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>
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>
2013-12-18 15:22:50 -05:00
Arend van Spriel
a7cdd821e3 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>
2013-12-18 15:22:48 -05:00
Arend van Spriel
a39be27b49 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>
2013-12-18 15:22:46 -05:00
Arend van Spriel
6043033c31 brcmfmac: remove brcmf_sdio_wdtimer_enable() function
Instead of using the brcmf_sdio_wdtimer_enable() function
call brcmf_sdbrcm_wd_timer() directly.

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>
2013-12-18 15:22:44 -05:00
Arend van Spriel
964ec1cfeb 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>
2013-12-18 15:22:42 -05:00
Arend van Spriel
4744d16402 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>
2013-12-18 15:22:41 -05:00
Arend van Spriel
1cee05e384 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>
2013-12-18 15:22:39 -05:00
Arend van Spriel
71370eb87b 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>
2013-12-18 15:22:37 -05:00
Arend van Spriel
463c30b3f9 brcmfmac: remove unused struct brcmf_sdio_dev::func_cis_ptr attribute
During the SDIO probe the func_cis_ptr attribute in struct brcmf_sdio_dev
is being determined, but it is never used after that. Removing it also
obsoletes two functions in bcmsdh.c.

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>
2013-12-18 15:22:35 -05:00
Arend van Spriel
e49b06ba66 brcmfmac: remove unnecessary function prototypes
With the merge of bcmsdh.c and bcmsdh_mmc.c several function prototypes
are no longer necessary and can be removed. Consequence is reordering
some of the 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>
2013-12-18 15:22:33 -05:00
Arend van Spriel
e2dc9eea53 brcmfmac: combine bcmsdh source files into one
The driver has four files specific to SDIO host interface handling.
This commit reduces that by merging two closely related source files.

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>
2013-12-18 15:22:28 -05:00
Arend van Spriel
4d5504ec54 brcmfmac: add missing curly braces in brcmf_fws_txstatus_suppressed()
The 0-day testing from Fenguang Wu issued the following warning:

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next.git master
head:   4b074b0762
commit: 1e86d69662
    [33/59] brcmfmac: Update fwsignal to fix out of order tx.

>> drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c:1393:2-56:
    code aligned with following code on line 1394

vim +1393 drivers/net/wireless/brcm80211/brcmfmac/fwsignal.c

84bcc0c3  1387 	}
84bcc0c3  1388
84bcc0c3  1389 	entry->generation = genbit;
84bcc0c3  1390
2747e5f7  1391 	ret = brcmf_proto_hdrpull(fws->drvr, false, &ifidx, skb);
2747e5f7  1392 	if (ret == 0)
1e86d696 @1393 		brcmf_skb_htod_tag_set_field(skb, GENERATION, ..
1e86d696 @1394 		brcmf_skbcb(skb)->htod_seq = seq;
1e86d696  1395 		if (brcmf_skb_htod_seq_get_field(skb, FROMFW)) {
1e86d696  1396 			brcmf_skb_htod_seq_set_field(skb, ..
1e86d696  1397 			brcmf_skb_htod_seq_set_field(skb, ..

This warning is valid and the if statement needs curly braces here.

Reported-by: Fengguang Wu <fengguang.wu@intel.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-12-18 15:18:20 -05:00
John W. Linville
e08fd975bf Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless
Conflicts:
	drivers/net/wireless/brcm80211/Kconfig
	net/mac80211/util.c
2013-12-06 09:50:45 -05:00
Hauke Mehrtens
cb500a7c29 brcmsmac: remove dependency on CRC8 and CRC_CCITT
There is no code in brcmsmac that uses a function from CRC8 or
CRC_CCITT any more. Building brcmsmac with these two disabled works
without any problems. This was probably only used by the bus code which
was replaced by bcma some time ago.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 14:56:29 -05:00
Luis R. Rodriguez
685cc47174 brcm80211: fix usage of freq_reg_info()
freq_reg_info() expects KHz and not MHz, fix this. In
this case we'll now be getting the no-ir flags cleared
on channels for any channel when the country IE trusts
that channel.

@@
struct ieee80211_channel *ch;
struct wiphy *wiphy;
const struct ieee80211_reg_rule *rule;
@@

-rule = freq_reg_info(wiphy, ch->center_freq);
+rule = freq_reg_info(wiphy, MHZ_TO_KHZ(ch->center_freq));

Generated-by: Coccinelle SmPL
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Peter Senna Tschudin <peter.senna@gmail.com>
Cc: Seth Forshee <seth.forshee@canonical.com>
Cc: Arend van Spriel <arend@broadcom.com>
Reported-by: Mihir Shete <smihir@qti.qualcomm.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
2013-12-05 14:54:49 -05:00
John W. Linville
4b074b0762 Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next 2013-12-02 14:25:38 -05:00
Arend van Spriel
7d68849f40 brcmfmac: expose chip information through debugfs
Adding the debugfs file <debugfs_mnt>/brcmfmac/<devid>/chipinfo
which contains the chip number and revision.

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-12-02 14:25:26 -05:00
Arend van Spriel
01376a07bc brcmfmac: move firmware event related defines to fweh.h
The dhd.h file contained a number of definitions that are
related to events received from the firmware. Those are
processed and dispatched in the driver by fweh. Hence the
definitions are moved to its include file.

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-12-02 14:25:25 -05:00
Arend van Spriel
b881879dea brcmfmac: remove some unused definitions
Removing WLC_PHY_TYPE and some BRCMF_E_.* definitions as these
are not used in the driver sources.

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-12-02 14:25:25 -05:00
Hante Meuleman
aec87ce2f3 brcmfmac: Use consistent naming for BCDC.
The BCDC protocol layer is using a mix of naming of CDC, BDC and
BCDC. Use the name BCDC consistenly over all functions, defines
and variables. This patch does not change code functionality.

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>
2013-12-02 14:25:25 -05:00
Arend van Spriel
5ca85216b1 brcmfmac: move firmware command code definitions
Move the command codes to the firmware interface module as
that makes a bit more sense.

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-12-02 14:25:24 -05:00
Arend van Spriel
6f5838a48a brcmfmac: move firmware related structures to fwil_types.h
The firmware control interface is provided by fwil source file, but
a number of structures used to communicate with the firmware still
resided in dhd.h. The patch moves them to fwil_types.h.

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-12-02 14:25:24 -05:00