Commit Graph

23232 Commits

Author SHA1 Message Date
Guodong Xu
32677b2584 wlcore: align reg_ch_conf_last[] to 64bit
Align fields reg_ch_conf_last and reg_ch_conf_pending of
struct wl1271{} to 64bit.

Without this, on 64bit ARM, wlcore_set_pending_regdomain_ch() fails at
the point it calls set_bit(ch_bit_idx, (long*)wl->reg_ch_conf_pending);
Here is the error message while doing iw wlan0 scan or connect:

[   10.666857] wlcore: IRQ work
[   10.670046] wlcore: intr: 0x40 (fw_rx_counter = 1, drv_rx_counter = 0, tx_results_counter = 0)
[   10.678697] wlcore: WL1271_ACX_INTR_DATA
[   10.682810] Unhandled fault: alignment fault (0x96000021) at 0xffffffc037a817f4
[   10.690139] Internal error: : 96000021 [#1] PREEMPT SMP
[   10.695366] Modules linked in:
[   10.698437] CPU: 3 PID: 894 Comm: irq/60-wl18xx Tainted: G        W       4.2.0-rc6-linaro-hikey #2
[   10.707501] Hardware name: HiKey Development Board (DT)
[   10.712733] task: ffffffc03a9d1680 ti: ffffffc039e18000 task.ti: ffffffc039e18000
[   10.720239] PC is at set_bit+0x14/0x30
[   10.724002] LR is at wlcore_set_pending_regdomain_ch+0x40/0x4c

Signed-off-by: Guodong Xu <guodong.xu@linaro.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:44:27 +03:00
Jan Kaisrlik
862a336c83 ath9k: Add support for OCB mode
The patch adds support for "outside the context of a BSS"(OCB) mode
to ath9k driver and extends debugfs files by OCB ralated information.

This patch was tested on AR9380-AL1A cards.

Signed-off-by: Jan Kaisrlik <kaisrja1@fel.cvut.cz>
Cc: Michal Sojka <sojkam1@fel.cvut.cz>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:39:22 +03:00
Hiroaki KAWAI
c452d944be carl9170: fix bad rssi reading
Fix rssi calculation error which was introduced in otus to ar9170
porting.

Signed-off-by: Hiroaki KAWAI <hiroaki.kawai@gmail.com>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:38:20 +03:00
Geoff Levand
76ea6fdbeb net/wireless/wl18xx: Add missing MODULE_FIRMWARE
Fixes the output of 'modinfo --field firmware'.

Signed-off-by: Geoff Levand <geoff@infradead.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:35:16 +03:00
Miaoqing Pan
61d36370e2 ath9k: enable hw manual peak calibration for QCA9561
This patch fix https://lists.openwrt.org/pipermail/openwrt-devel/
2015-August/034979.html. As the peak detect calibration is set
incorrectly.

Signed-off-by: Miaoqing Pan <miaoqing@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:34:09 +03:00
Joe Perches
36925e52c5 mwifiex: Make mwifiex_dbg a function, reduce object size
The mwifiex_dbg macro has two tests that could be consolidated
into a function reducing overall object size ~10KB (~4%).

So convert the macro into a function.

$ size drivers/net/wireless/mwifiex/built-in.o* (x86-64 defconfig)
   text	   data	    bss	    dec	    hex	filename
 233102	   8628	   4809	 246539	  3c30b	drivers/net/wireless/mwifiex/built-in.o.new
 243949	   8628	   4809	 257386	  3ed6a	drivers/net/wireless/mwifiex/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:32:46 +03:00
Hante Meuleman
07fe2e38c7 brcmfmac: Reset PCIE devices after recognition.
When PCIE type devices are being FW reloaded without being properly
reset then the device ends up in a locked state, requiring the
device to be completely powered down. This patch adds a reset
through watchdog at the moment the device (cores) has been
recognized. This will solve warm reboot issues.

Cc: Rafal Milecki <zajec5@gmail.com>
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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:31:15 +03:00
Arend van Spriel
95ef12394a brcmfmac: introduce brcmf_net_detach() function
In case of error during brcmf_bus_start() the network interfaces were
freed using free_netdev(). However, the interfaces may have additional
memory allocated which is not freed. The netdev has destructor set to
brcmf_cfg80211_free_netdev() which frees the additional memory if
allocated and call free_netdev(). The brcmf_net_detach() either calls
brcmf_cfg80211_free_netdev() directly or uses unregister_netdev() when
struct net_device::reg_state indicates the netdev was registered.

Reported-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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:52 +03:00
Arend van Spriel
c67d41ba6f brcmfmac: change prototype for brcmf_fws_hdrpull()
Instead of passing ifidx and drvr just pass struct brcmf_if pointer
which holds both parameters.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:50 +03:00
Arend van Spriel
03cca20a6e brcmfmac: remove ifidx parameter from brcmf_fws_txstatus_suppressed()
The brcmf_fws_txstatus_suppressed() function prototype specifies an
ifidx parameter which is not used within the function implementation.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:46 +03:00
Arend van Spriel
9d6c1dc4f9 brcmfmac: add dedicated debug level for firmware console logging
Both PCIe and SDIO devices have the possibility to log the firmware
console output in kernel log. For PCIe it is logged when PCIE debug
level is enabled. For SDIO it is logged when user specifies a non-zero
console interval through debugfs. This patch tries to make it a
bit more consistent. The firmware console output is only logged when
FWCON debug level is enabled.

Reviewed-by: Hante Meuleman <meuleman@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: Pontus Fuchs <pontusf@broadcom.com>
Signed-off-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:44 +03:00
Arend van Spriel
291da87b69 brcmfmac: add mapping for interface index to bsscfg index
Because the P2P Device interface in firmware uses the same interface
index as the primary interface we use the bsscfg index as index in the
struct brcmf_pub::iflist. However, in the data path we get the interface
index and not the bsscfg index. So we need a mapping of interface index
to bsscfg index, which can be determined upon handle adding the interface.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:43 +03:00
Arend van Spriel
054e68add6 brcmfmac: pass struct brcmf_if instance in brcmf_txfinalize()
Most call sites of brcmf_txfinalize already have struct brcmf_if
instance so pass that to brcmf_txfinalize() as the function
needs it anyway.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:41 +03:00
Arend van Spriel
46f3b6ee48 brcmfmac: use brcmf_get_ifp() to map ifidx to struct brcmf_if instance
The knowledge on how to map the interface index to a struct brcmf_if
instance is in brcmf_get_ifp() so use that function when only the
interface index is known instead of accessing brcmf_pub::iflist
directly.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:40 +03:00
Arend van Spriel
ddddfed2f9 brcmfmac: correct detection of p2pdev interface event
The p2pdev interface is setup in firmware resulting in a interface
event. This event has role and no-if flag. When role is p2p client
and no-if flag is set it indicates that this is the p2pdev interface.
This info is used in handling the event and adding interface in the
driver.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:38 +03:00
Arend van Spriel
1c626cf472 brcmfmac: only call brcmf_cfg80211_detach() when attach was successful
In brcmf_bus_start() the function brcmf_cfg80211_attach() is called which
may fail. If this happens we should not call brcmf_cfg80211_detach() in
the failure path as it will result in NULL pointer dereference:

  brcmf_fweh_activate_events: Set event_msgs error (-5)
  brcmf_bus_start: failed: -5
  brcmf_sdio_firmware_callback: dongle is not responding
  BUG: unable to handle kernel NULL pointer dereference at 0000000000000068
  IP: [<ffffffff811e8f08>] kernfs_find_ns+0x18/0xd0
  PGD 0
  Oops: 0000 [#1] SMP
  Modules linked in: brcmfmac(O) brcmutil(O) cfg80211 auth_rpcgss
  CPU: 1 PID: 45 Comm: kworker/1:1 Tainted: G           O
  Hardware name: Dell Inc. Latitude E6410/07XJP9, BIOS A07 02/15/2011
  Workqueue: events request_firmware_work_func
  task: ffff880036c09ac0 ti: ffff880036dd4000 task.ti: ffff880036dd4000
  RIP: 0010:[<ffffffff811e8f08>]  [<ffffffff811e8f08>] kernfs_find_ns+0x18/0xd0
  RSP: 0018:ffff880036dd7a28  EFLAGS: 00010246
  RAX: ffff880036c09ac0 RBX: 0000000000000000 RCX: 000000007fffffff
  RDX: 0000000000000000 RSI: ffffffff816578b9 RDI: 0000000000000000
  RBP: ffff880036dd7a48 R08: 0000000000000000 R09: ffff880036c0b340
  R10: 00000000000002ec R11: ffff880036dd7b08 R12: ffffffff816578b9
  R13: 0000000000000000 R14: ffffffff816578b9 R15: ffff8800c6c87000
  FS:  0000000000000000(0000) GS:ffff88012bc40000(0000) knlGS:0000000000000000
  CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
  CR2: 0000000000000068 CR3: 0000000001a0b000 CR4: 00000000000006e0
  Stack:
   0000000000000000 ffffffff816578b9 0000000000000000 ffff8800c0d003c8
   ffff880036dd7a78 ffffffff811e8ff5 0000000ffffffff1 ffffffff81a9b060
   ffff8800c789f880 ffff8800c0d00000 ffff880036dd7a98 ffffffff811ebe0d
  Call Trace:
   [<ffffffff811e8ff5>] kernfs_find_and_get_ns+0x35/0x60
   [<ffffffff811ebe0d>] sysfs_unmerge_group+0x1d/0x60
   [<ffffffff81404ef2>] dpm_sysfs_remove+0x22/0x60
   [<ffffffff813f9db9>] device_del+0x49/0x240
   [<ffffffff815da768>] rfkill_unregister+0x58/0xc0
   [<ffffffffa06bd91b>] wiphy_unregister+0xab/0x2f0 [cfg80211]
   [<ffffffffa0742fe3>] brcmf_cfg80211_detach+0x23/0x50 [brcmfmac]
   [<ffffffffa074d986>] brcmf_detach+0x86/0xe0 [brcmfmac]
   [<ffffffffa0757de8>] brcmf_sdio_remove+0x48/0x120 [brcmfmac]
   [<ffffffffa0758ed9>] brcmf_sdiod_remove+0x29/0xd0 [brcmfmac]
   [<ffffffffa0759031>] brcmf_ops_sdio_remove+0xb1/0x110 [brcmfmac]
   [<ffffffffa001c267>] sdio_bus_remove+0x37/0x100 [mmc_core]
   [<ffffffff813fe026>] __device_release_driver+0x96/0x130
   [<ffffffff813fe0e3>] device_release_driver+0x23/0x30
   [<ffffffffa0754bc8>] brcmf_sdio_firmware_callback+0x2a8/0x5d0 [brcmfmac]
   [<ffffffffa074deaf>] brcmf_fw_request_nvram_done+0x15f/0x5e0 [brcmfmac]
   [<ffffffff8140142f>] ? devres_add+0x3f/0x50
   [<ffffffff810642b5>] ? usermodehelper_read_unlock+0x15/0x20
   [<ffffffff81400000>] ? platform_match+0x70/0xa0
   [<ffffffff8140f400>] request_firmware_work_func+0x30/0x60
   [<ffffffff8106828c>] process_one_work+0x14c/0x3d0
   [<ffffffff8106862a>] worker_thread+0x11a/0x450
   [<ffffffff81068510>] ? process_one_work+0x3d0/0x3d0
   [<ffffffff8106d692>] kthread+0xd2/0xf0
   [<ffffffff8106d5c0>] ? kthread_create_on_node+0x180/0x180
   [<ffffffff815ed35f>] ret_from_fork+0x3f/0x70
   [<ffffffff8106d5c0>] ? kthread_create_on_node+0x180/0x180
  Code: e9 40 fe ff ff 48 89 d8 eb 87 66 0f 1f 84 00 00 00 00 00 66 66 66 66
	90 55 48 89 e5 41 56 49 89 f6 41 55 49 89 d5 31 d2 41 54 53 <0f> b7
	47 68 48 8b 5f 48 66 c1 e8 05 83 e0 01 4d 85 ed 0f b6 c8
  RIP  [<ffffffff811e8f08>] kernfs_find_ns+0x18/0xd0
   RSP <ffff880036dd7a28>
  CR2: 0000000000000068
  ---[ end trace 87d6ec0d3fe46740 ]---

Reported-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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:37 +03:00
Arend van Spriel
ee6e3a3414 brcmfmac: change parameters for brcmf_remove_interface()
Just pass the interface to be removed, ie. the struct brcmf_if instance.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:32 +03:00
Arend van Spriel
796cfb65e3 brcmfmac: make brcmf_proto_hdrpull() return struct brcmf_if instance
Avoid spreading the ifidx in the driver, but have it return the
struct brcmf_if instance.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:30 +03:00
Arend van Spriel
75effb03ee brcmfmac: consolidate ifp lookup in driver core
In rx path the firmware provide an interface index which is used to
map to a struct brcmf_if instance. However, this involves some trick
that is done in two places. This is changed by having driver core
providing brcmf_get_ifp() function.

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: Kalle Valo <kvalo@codeaurora.org>
2015-09-29 10:28:27 +03:00
Kalle Valo
8f6c5b079c * some debugfs improvements;
* fix signedness in beacon statistics;
 * deinline some functions to reduce size when device tracing is enabled;
 * filter beacons out in AP mode when no stations are associated;
 * deprecate firmwares version -12;
 * fix a runtime PM vs. legacy suspend race;
 * one-liner fix for a ToF bug;
 * clean-ups in the rx code;
 * small debugging improvement;
 * fix WoWLAN with new firmware versions;
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJWAGfdAAoJEKFHnKIaPMX6K+cP/1QSMKT7GULl6qZ6cNx3kb//
 exoxdXVp/10YTPvNWrvO1Pv73I75wpVrtn11yzizAel/6hARkeC/z5c+C57u+7Cl
 +tKtrGtrMd7GHIQU5/DZC0zSD70HYOdj5EfY58lNZvLItw4XaEUZCWBwTGkIUDpe
 bd+AcUN83m5PtP8cq73LbLUqnhMAQUy3nZMiqVYsxGQR6hwgDOiaHaaP2qmJAx/Q
 fASQe4xwOOyOTGn5r37AVLfk96URMMmKJBi4fgRCP2aw5+5MiI3x/lj6ctwr20+D
 2oGUyKAUrYtf/e8wvauuVxsC8Zp/n/pO4gaJOXlxrWH0TdZ+NNr3i1vvvaIA3p+6
 eh5KmC4htEDr7IR1CE7bzwj97HHSCLQFCGAQhtINIFiqmI3Ii1S0Gq51JhSpc+RR
 D+2bNuv/5Ca4hJgFBTTwqCnwaMx/K7pcNOEE4Z8M5sSLcNLquRu2OoWfqj5p5IfC
 rzmFNhLIxl4YzoyKzr2CeUqR1yEC9WmB9yitCEPJqxI0lm7UgYAiKwfxzO372B2a
 aPM3FSihlLJBICEUvNwFbImoQ1EDD2DYObtMw9ulHqw+h00kpkO3YuLnHXmDTePg
 WzT/yYfQZ+IJJwms+EAsmx2iOb33aeby1d+iNJ6M6Lnuz1xkxTT1yn2gq3/Z+Q0h
 i6IydQ1o+9mm1trfE0Uf
 =XkqB
 -----END PGP SIGNATURE-----

Merge tag 'iwlwifi-next-for-kalle-2015-09-21' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/iwlwifi-next

* some debugfs improvements;
* fix signedness in beacon statistics;
* deinline some functions to reduce size when device tracing is enabled;
* filter beacons out in AP mode when no stations are associated;
* deprecate firmwares version -12;
* fix a runtime PM vs. legacy suspend race;
* one-liner fix for a ToF bug;
* clean-ups in the rx code;
* small debugging improvement;
* fix WoWLAN with new firmware versions;
2015-09-26 21:25:18 +03:00
Eliad Peller
7c014e35a0 iwlwifi: mvm: add debug print for d0i3 exit indication
In order to verify d0i3 flow, add debug print to indicate
d0i3 exit was completed (right after tx was re-enabled),
along with the wakeup reasons.

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:46 +03:00
Eliad Peller
183edd8484 iwlwifi: mvm: configure wowlan configuration only if connected
Recent fw version added assert to make sure wowlan configuration
is configured only when a station is connected.

Change the driver behavior to pass this configuration only
if we indeed have ap station id (i.e. connected).

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:45 +03:00
Johannes Berg
ee6dbb2937 iwlwifi: mvm: move RX API into its own file
The RX API is currently mixed up into the general fw-api.h
file, but we're going to need to extend it significantly in
the future, so move it to its own file.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:45 +03:00
Johannes Berg
2df5328e78 iwlwifi: mvm: remove some unused defines from RX API
Remove some unused values from the RX API; these were used
with older firmware API that didn't have the RX energy API,
support for which was removed a long time ago.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:45 +03:00
Johannes Berg
abfd794c59 iwlwifi: mvm: remove pointless cfg_phy_cnt length check
Since the driver can never configure the data here, this field
will always be reported as 0 by the firmware. Even if this was
not the case, however, it wouldn't matter since the extra data
would be added beyond the end of the phy_info structure we use
in the driver, so wouldn't harm anything in this code either.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:44 +03:00
Johannes Berg
7f89a58efc iwlwifi: mvm: remove useless debug message from RX
This message is useless - it's in the good case that always
happens so enabling it doesn't really help. Just remove it.
There are other ways to debug this (e.g. tracing) so there's
no need to add a message in the bad case.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:44 +03:00
Johannes Berg
da583fdfec iwlwifi: mvm: make sure AP is operating for ToF
It's possible for an AP interface to be UP but not actually
operating (i.e. not beaconing etc.) - in this case it can't
actually do ToF, so check for it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:43 +03:00
Emmanuel Grumbach
38d5f66f06 iwlwifi: mvm: remove IWL_UCODE_TLV_API_STATS_V10 TLV flag
This flag is set in all supported firmwares.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:43 +03:00
Emmanuel Grumbach
9d43fa4b4a iwlwifi: mvm: remove IWL_UCODE_TLV_API_ASYNC_DTM TLV flag
This flag is set in all supported firmwares.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:42 +03:00
Emmanuel Grumbach
eb991c5ec1 iwlwifi: mvm: remove IWL_UCODE_TLV_API_SINGLE_SCAN_EBS TLV flag
All the supported firmwares have this flag set.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:42 +03:00
Emmanuel Grumbach
4d31eed13f iwlwifi: mvm: remove IWL_UCODE_TLV_API_TX_POWER_DEV TLV flag
All the supported firmwares use the new API.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:42 +03:00
Emmanuel Grumbach
89ced540eb iwlwifi: mvm: remove IWL_UCODE_TLV_API_HDC_PHASE_0 TLV flag
All the supported firwmares support the new API.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2015-09-21 18:08:34 +03:00
Oleksij Rempel
e904cf6fe2 ath9k_htc: introduce support for different fw versions
Current kernel support only one fw name with theoretically only one
fw version located in “firmware/htc_[9271|7010].fw”. Which is ok so far we
have only one fw version (1.3). After we realised new fw 1.4, we faced
compatibility problem which was decided to solve by firmware name and
location:
- new firmware is located now in
	firmware/ath9k_htc/htc_[9271|7010]-1.4.0.fw
- old version 1.3 should be on old place, so old kernel have no issues
	with it.
- new kernels including this patch should be able to try different
	supported (min..max) fw version.
- new kernel should be able to support old fw location too. At least for
	now.

At same time this patch will add new module option which should allow user
to play with development  fw version without replacing stable one. If user
will set “ath9k_htc use_dev_fw=1” module will try to find
firmware/ath9k_htc/htc_[9271|7010]-1.dev.0.fw first and if it fails, use
stable version: for example...1.4.0.fw.

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2015-09-18 10:40:14 +03:00
Andy Shevchenko
a202fbbf56 drivers/net/wireless/ath/wil6210: use seq_hex_dump() to dump buffers
Instead of custom approach let's use recently introduced seq_hex_dump()
helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: Joe Perches <joe@perches.com>
Cc: Tadeusz Struk <tadeusz.struk@intel.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Ingo Tuchscherer <ingo.tuchscherer@de.ibm.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-09-10 13:29:01 -07:00
Linus Torvalds
dd5cdb48ed Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
 "Another merge window, another set of networking changes.  I've heard
  rumblings that the lightweight tunnels infrastructure has been voted
  networking change of the year.  But what do I know?

   1) Add conntrack support to openvswitch, from Joe Stringer.

   2) Initial support for VRF (Virtual Routing and Forwarding), which
      allows the segmentation of routing paths without using multiple
      devices.  There are some semantic kinks to work out still, but
      this is a reasonably strong foundation.  From David Ahern.

   3) Remove spinlock fro act_bpf fast path, from Alexei Starovoitov.

   4) Ignore route nexthops with a link down state in ipv6, just like
      ipv4.  From Andy Gospodarek.

   5) Remove spinlock from fast path of act_gact and act_mirred, from
      Eric Dumazet.

   6) Document the DSA layer, from Florian Fainelli.

   7) Add netconsole support to bcmgenet, systemport, and DSA.  Also
      from Florian Fainelli.

   8) Add Mellanox Switch Driver and core infrastructure, from Jiri
      Pirko.

   9) Add support for "light weight tunnels", which allow for
      encapsulation and decapsulation without bearing the overhead of a
      full blown netdevice.  From Thomas Graf, Jiri Benc, and a cast of
      others.

  10) Add Identifier Locator Addressing support for ipv6, from Tom
      Herbert.

  11) Support fragmented SKBs in iwlwifi, from Johannes Berg.

  12) Allow perf PMUs to be accessed from eBPF programs, from Kaixu Xia.

  13) Add BQL support to 3c59x driver, from Loganaden Velvindron.

  14) Stop using a zero TX queue length to mean that a device shouldn't
      have a qdisc attached, use an explicit flag instead.  From Phil
      Sutter.

  15) Use generic geneve netdevice infrastructure in openvswitch, from
      Pravin B Shelar.

  16) Add infrastructure to avoid re-forwarding a packet in software
      that was already forwarded by a hardware switch.  From Scott
      Feldman.

  17) Allow AF_PACKET fanout function to be implemented in a bpf
      program, from Willem de Bruijn"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1458 commits)
  netfilter: nf_conntrack: make nf_ct_zone_dflt built-in
  netfilter: nf_dup{4, 6}: fix build error when nf_conntrack disabled
  net: fec: clear receive interrupts before processing a packet
  ipv6: fix exthdrs offload registration in out_rt path
  xen-netback: add support for multicast control
  bgmac: Update fixed_phy_register()
  sock, diag: fix panic in sock_diag_put_filterinfo
  flow_dissector: Use 'const' where possible.
  flow_dissector: Fix function argument ordering dependency
  ixgbe: Resolve "initialized field overwritten" warnings
  ixgbe: Remove bimodal SR-IOV disabling
  ixgbe: Add support for reporting 2.5G link speed
  ixgbe: fix bounds checking in ixgbe_setup_tc for 82598
  ixgbe: support for ethtool set_rxfh
  ixgbe: Avoid needless PHY access on copper phys
  ixgbe: cleanup to use cached mask value
  ixgbe: Remove second instance of lan_id variable
  ixgbe: use kzalloc for allocating one thing
  flow: Move __get_hash_from_flowi{4,6} into flow_dissector.c
  ixgbe: Remove unused PCI bus types
  ...
2015-09-03 08:08:17 -07:00
Linus Torvalds
089b669506 Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
Pull trivial tree updates from Jiri Kosina:
 "The usual stuff from trivial tree for 4.3 (kerneldoc updates, printk()
  fixes, Documentation and MAINTAINERS updates)"

* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (28 commits)
  MAINTAINERS: update my e-mail address
  mod_devicetable: add space before */
  scsi: a100u2w: trivial typo in printk
  i2c: Fix typo in i2c-bfin-twi.c
  treewide: fix typos in comment blocks
  Doc: fix trivial typo in SubmittingPatches
  proportions: Spelling s/consitent/consistent/
  dm: Spelling s/consitent/consistent/
  aic7xxx: Fix typo in error message
  pcmcia: Fix typo in locking documentation
  scsi/arcmsr: Fix typos in error log
  drm/nouveau/gr: Fix typo in nv10.c
  [SCSI] Fix printk typos in drivers/scsi
  staging: comedi: Grammar s/Enable support a/Enable support for a/
  Btrfs: Spelling s/consitent/consistent/
  README: GTK+ is a acronym
  ASoC: omap: Fix typo in config option description
  mm: tlb.c: Fix error message
  ntfs: super.c: Fix error log
  fix typo in Documentation/SubmittingPatches
  ...
2015-09-01 18:46:42 -07:00
Liad Kaufman
79f6828062 iwlwifi: mvm: remove SCD_QUEUE_CONFIG TLV flag
We don't support firmwares that don't use the new API.
This also allows to use all the SCD queues, so increase
the reported number of queues to 31.

Signed-off-by: Liad Kaufman <liad.kaufman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:36 +03:00
Emmanuel Grumbach
3c1f84a174 iwlwifi: mvm: don't load -12.ucode anymore
-13.ucode has been published long ago. Deprecate old
versions of the firmware.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:36 +03:00
Johannes Berg
cfe417bc47 iwlwifi: mvm: don't NUL-terminate low-latency debugfs file
There's obviously no reason to write a NUL-terminating byte into
the debugfs file. Apparently nobody tried to use this from a tool
that doesn't strip NUL bytes though, so we never noticed. Fix it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:35 +03:00
Luciano Coelho
cf8c3cff3f iwlwifi: mvm: make sure d0i3 exit work runs before suspending
If we are in d0i3 when entering suspend, we leave d0i3 so that
mac80211 can call us to remove connections or whatever before going to
suspend.  We do this by calling pm_runtime_resume() early in the slave
transport flow and reactivating it later, when the wiphy suspend flow
runs.

The problem is that we queue a work in order to leave d0i3.  If this
work hasn't run yet when the wiphy suspend flow is called, we have a
race and entering d0i3 fails (because we're still holding the
IWL_MVM_REF_EXIT_WORK reference).

To solve this, simply flush the d0i3_exit_work at the beginning of the
iwl_mvm_suspend() function.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:34 +03:00
Gregory Greenman
9493908095 iwlwifi: mvm: don't ask for beacons when AP vif and no assoc sta
When in AP mode, we need beacons from other APs for HT protection.
However, when there's no any associated station we will not do
any Tx and thus don't really need beacons. On the other hand, these
beacons will cause a lot of unnecessary wakeups which increase our
power consumption. Handle this by asking FW to pass beacons only when
there's at least one associated station.

Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:34 +03:00
Emmanuel Grumbach
a73a2cea92 iwlwifi: Deinline iwl_{read,write}(8,32}
With CONFIG_IWLWIFI_DEVICE_TRACING=y, these functions are rather large,
too big for inlining.

With this .config: http://busybox.net/~vda/kernel_config,
after uninlining these functions have sizes and callsite counts
as follows:

iwl_read32  475 bytes, 51 callsites
iwl_write32 477 bytes, 90 callsites
iwl_write8  493 bytes, 3 callsites

Reduction in size is about 74,000 bytes:

    text     data      bss       dec     hex filename
90758147 17226024 36659200 144643371 89f152b vmlinux0
90687995 17221928 36659200 144569123 89df323 vmlinux.after

Reported-by: Denys Vlasenko <dvlasenk@redhat.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:33 +03:00
Emmanuel Grumbach
e50460192e iwlwifi: mvm: add debugfs hook to send ECHO_CMD to the firmware
ECHO_CMD is a simple command that can be sent to the
firmware just to check that it is alive.
This command is useful for debug purpose, provide a debugfs
hook to send it.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:32 +03:00
Sara Sharon
62e004fe94 iwlwifi: mvm: fix statistics variables type
When receiving statistics notification there is a field of average energy.
This is defines as signed 8 bit, while FW refers to it as unsigned.
when the energy is higher than 127 this causes in iwl_mvm_stat_iterator
a wrong computation of the signal
     int sig = -stats->general.beacon_filter_average_energy;
resulting in incorrect CQM event (change from low to high).

While at it - update the rest of the fields to the correct type.

Signed-off-by: Sara Sharon <sara.sharon@intel.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:32 +03:00
Luciano Coelho
dbb04b0d29 iwlwifi: mvm: remove netdetect debugfs entry
This debugfs entry was implemented just as a proof-of-concept before
the full support for netdetect via cfg80211/mac80211 was implemented.
Now that we have a proper way to enable netdetect from userspace, this
entry is redundant and should be removed to avoid unnecessary
maintenance work.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2015-08-28 13:26:31 +03:00
Kalle Valo
0ba3ac03c1 Merge ath-next from ath.git
Major changes in ath10k:

* add spectral scan support for qca99x0
* add qca6164 support
2015-08-26 12:40:23 +03:00
Raja Mani
ee92a2099f ath10k: fix compilation warnings in wmi phyerr pull function
Below compilation warnings are observed in gcc version 4.8.2.
Even though it's not seen in bit older gcc versions (for ex, 4.7.3),
It's good to fix it by changing format specifier from %d to
%zd in wmi pull phyerr functions.

wmi.c: In function 'ath10k_wmi_op_pull_phyerr_ev':
wmi.c:3567:8: warning: format '%d' expects argument of type 'int',
              but argument 4 has type 'long unsigned int' [-Wformat=]
              left_len, sizeof(*phyerr));
                        ^
wmi.c: In function 'ath10k_wmi_10_4_op_pull_phyerr_ev':
wmi.c:3612:8: warning: format '%d' expects argument of type 'int',
	      but argument 4 has type 'long unsigned int' [-Wformat=]
              left_len, sizeof(*phyerr));
                        ^
Fixes: 991adf71a6 ("ath10k: refactor phyerr event handlers")
Fixes: 2b0a2e0d7c ("ath10k: handle 10.4 firmware phyerr event")
Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26 12:33:52 +03:00
Michal Kazior
36582e5d4d ath10k: add qca6164 support
This adds additional 0x0041 PCI Device ID
definition to ath10k for QCA6164 which is a 1
spatial stream sibling of the QCA6174 (which is 2
spatial stream chip).

The QCA6164 needs a dedicated board.bin file which
is different than the one used for QCA6174. If the
board.bin is wrong the device will crash early
while trying to boot firmware. The register dump
will look like this:

 ath10k_pci 0000:02:00.0: firmware register dump:
 ath10k_pci 0000:02:00.0: [00]: 0x05010000 0x000015B3 0x000A012D 0x00955B31
 ...

Note the value 0x000A012D.

Special credit goes to Alan Liu
<alanliu@qca.qualcomm.com> for providing support
help which enabled me to come up with this patch.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26 12:07:23 +03:00
Raja Mani
4535edbd42 ath10k: add spectral scan support for 10.4 fw
To enable/configure spectral scan parameters in 10.4 firmware, existing
wmi spectral related functions can be reused. Link those functions in
10.4 wmi ops table.

In addition, adjust bin size (only when size is 68 bytes) before reporting
bin samples to user space. The background for this adjustment is that
qca99x0 reports bin size as 68 bytes (64 bytes + 4 bytes) in report
mode 2. First 64 bytes carries in-band tones (-32 to +31) and last 4 byte
carries band edge detection data (+32) mainly used in radar detection
purpose. Additional last 4 bytes are stripped to make bin size valid one.

This bin size adjustment will happen only for qca99x0, all other chipsets
will report proper bin sizes (64/128) without extra 4 bytes being added
at the end. The changes are validated in qca99x0 using 10.4 firmware.

Signed-off-by: Raja Mani <rmani@qti.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26 11:09:12 +03:00
Michal Kazior
5e55e3cbd1 ath10k: fix dma_mapping_error() handling
The function returns 1 when DMA mapping fails. The
driver would return bogus values and could
possibly confuse itself if DMA failed.

Fixes: 767d34fc67 ("ath10k: remove DMA mapping wrappers")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
2015-08-26 11:04:44 +03:00