platform/adaptation/renesas_rcar/renesas_kernel.git
10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Fri, 16 Aug 2013 18:48:40 +0000 (14:48 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

10 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Fri, 16 Aug 2013 18:24:51 +0000 (14:24 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

10 years agort2x00: rt2800pci: fix AUX_CTRL register setup for RT3090/3390/3593/5592
Gabor Juhos [Fri, 16 Aug 2013 08:23:30 +0000 (10:23 +0200)]
rt2x00: rt2800pci: fix AUX_CTRL register setup for RT3090/3390/3593/5592

The 2011_1007_RT5390_RT5392_Linux_STA_V2.5.0.3_DPO
driver enables PCIe wakeup for these chips as well.
Do the same in rt2x00.

References:
  rt28xx_init in common/rtmp_init_intf.c
  RTMPInitPCIeLinkCtrlValue in os/linux/rt_rbus_pci_drv.c

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800lib: introduce rt2800_get_txwi_rxwi_size helper
Gabor Juhos [Fri, 16 Aug 2013 08:23:29 +0000 (10:23 +0200)]
rt2x00: rt2800lib: introduce rt2800_get_txwi_rxwi_size helper

The rt2800pci driver uses the same [RT]XWI size
for all chipsets, however some chips requires
different values.

The size of the [RT]XWI structures is a constant
value for a given chipset and it does not depend
on the underlying interface. Add a helper function
which returns the correct values for the actual
chipset and use the new helper both in the rt2800usb
and in the rt2800pci drivers. This ensures that both
drivers are using the correct values.

Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: enable CSA functionality in ath9k
Simon Wunderlich [Wed, 14 Aug 2013 06:01:38 +0000 (08:01 +0200)]
ath9k: enable CSA functionality in ath9k

CSA is only enabled for one interface, but the same limitation applies
for mac80211 too. It checks whether the beacon has been sent (different
approaches for non-EDMA-enabled and EDMA-enabled devices), and completes
the channel switch after that.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath5k: enable support for 5 MHz and 10 MHz channels
Simon Wunderlich [Wed, 14 Aug 2013 06:01:37 +0000 (08:01 +0200)]
ath5k: enable support for 5 MHz and 10 MHz channels

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath5k: set 5/10 MHz supported channels and fix duration
Simon Wunderlich [Wed, 14 Aug 2013 06:01:36 +0000 (08:01 +0200)]
ath5k: set 5/10 MHz supported channels and fix duration

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath5k: report 5/10 MHz channels
Simon Wunderlich [Wed, 14 Aug 2013 06:01:35 +0000 (08:01 +0200)]
ath5k: report 5/10 MHz channels

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: announce that ath9k supports 5/10 MHz
Simon Wunderlich [Wed, 14 Aug 2013 06:01:34 +0000 (08:01 +0200)]
ath9k: announce that ath9k supports 5/10 MHz

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: set 5/10 MHz supported channels and fix bitrate
Simon Wunderlich [Wed, 14 Aug 2013 06:01:33 +0000 (08:01 +0200)]
ath9k: set 5/10 MHz supported channels and fix bitrate

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: report 5/10 MHz channels
Simon Wunderlich [Wed, 14 Aug 2013 06:01:32 +0000 (08:01 +0200)]
ath9k: report 5/10 MHz channels

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: use chandef instead of channel_type
Simon Wunderlich [Fri, 16 Aug 2013 08:46:04 +0000 (10:46 +0200)]
ath9k: use chandef instead of channel_type

To enable support for 5/10 MHz, some internal functions must be
converted from using the (old) channel_type to chandef. This is a good
chance to change all remaining occurences.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: always use SIFS times from OFDM for 5/10 MHz
Simon Wunderlich [Wed, 14 Aug 2013 06:01:30 +0000 (08:01 +0200)]
ath9k: always use SIFS times from OFDM for 5/10 MHz

5/10 MHz channels should always use SIFS times as defined in IEEE
802.11-2012 18.4.4 (OFDM PHY characteristics). This makes it compatible
to ath5k, which does the same.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomac80211: add APIs to allow keeping connections after WoWLAN
Johannes Berg [Wed, 7 Aug 2013 18:11:55 +0000 (20:11 +0200)]
mac80211: add APIs to allow keeping connections after WoWLAN

In order to be able to (securely) keep connections alive after
the system was suspended for WoWLAN, we need some additional
APIs. We already have API (ieee80211_gtk_rekey_notify) to tell
wpa_supplicant about the new replay counter if GTK rekeying
was done by the device while the host was asleep, but that's
not sufficient.

If GTK rekeying wasn't done, we need to tell the host about
sequence counters for the GTK (and PTK regardless of rekeying)
that was used while asleep, add ieee80211_set_key_rx_seq() for
that.

If GTK rekeying was done, then we need to be able to disable
the old keys (with ieee80211_remove_key()) and allocate the
new GTK key(s) in mac80211 (with ieee80211_gtk_rekey_add()).

If protocol offload (e.g. ARP) is implemented, then also the
TX sequence counter for the PTK must be updated, using the new
ieee80211_set_key_tx_seq() function.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: move ibss presp generation in own function
Simon Wunderlich [Fri, 9 Aug 2013 14:35:17 +0000 (16:35 +0200)]
mac80211: move ibss presp generation in own function

Channel Switch will later require to generate beacons without setting
them immediately. Therefore split the presp generation in an own
function. Splitting the original very long function might be a good idea
anyway.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: perform power save processing before decryption
Johan Almbladh [Wed, 14 Aug 2013 13:29:46 +0000 (15:29 +0200)]
mac80211: perform power save processing before decryption

This patch decouples the power save processing from the frame decryption
by running the decrypt rx handler after sta_process. In the case where
the decryption failed for some reason, the stack used to not process
the PM and MOREDATA bits for that frame. The stack now always performs
power save processing regardless of the decryption result. That means that
encrypted data frames and NULLFUNC frames are now handled in the same way
regarding power save processing, making the stack more robust.

Signed-off-by: Johan Almbladh <ja@anyfi.net>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: Add PBW snoozing enablement
Alexander Bondar [Sun, 4 Aug 2013 14:52:23 +0000 (17:52 +0300)]
iwlwifi: mvm: Add PBW snoozing enablement

The Performance Based Window snooze mechanism is based on uAPSD and is
used in low-medium traffic scenarios, in order to provide better power
performance while insuring low latency and jitter for the incoming traffic.
This patch enables PBW snoozing in case uAPSD is enabled and all ACs are
uAPSD trigger and delivery enabled.

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: Implement CQM offloading
Andrei Otcheretianski [Sun, 21 Jul 2013 14:23:59 +0000 (17:23 +0300)]
iwlwifi: mvm: Implement CQM offloading

Use beacon statistics notification to track RSSI.
Notify mac80211 when the tresholds are crossed.
The roaming treshold is configured to be
equal to cqm_thold. If the beacon filtering command
is not supported by fw fall back and use mac80211
mechanism.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: return -ENOMEM instead of NULL when OOM in iwl_drv_start()
Luciano Coelho [Tue, 13 Aug 2013 07:34:55 +0000 (10:34 +0300)]
iwlwifi: return -ENOMEM instead of NULL when OOM in iwl_drv_start()

The callers of iwl_drv_start() are probe functions.  If a probe
function returns 0, it means it succeeded.  So if NULL was returned by
iwl_drv_start(), it would be considered as a success.

Fix this by returning -ENOMEM if the driver struct allocation fails in
iwl_drv_start().

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: Kconfig: fix help texts wrt 7260 and 3160 devices
Luciano Coelho [Mon, 12 Aug 2013 18:58:36 +0000 (21:58 +0300)]
iwlwifi: Kconfig: fix help texts wrt 7260 and 3160 devices

Fix the help texts to properly reflect the 7260 and 3160 devices
support.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: use a macro for default probe length
Luciano Coelho [Mon, 12 Aug 2013 16:30:21 +0000 (19:30 +0300)]
iwlwifi: use a macro for default probe length

Instead of assigning the default max probe length to 200 in the main
code, create a macro for consistency and clarity.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: refactor resume from WoWLAN code
Johannes Berg [Tue, 6 Aug 2013 16:28:26 +0000 (18:28 +0200)]
iwlwifi: mvm: refactor resume from WoWLAN code

To be able to add more logic to the resume code, refactor it a bit,
moving some status checking/reporting logic into a new function.
The locking becomes a bit odd (one of the new functions now unlocks
the mutex) but this will be required to call new mac80211 APIs in
there later.

Reviewed-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: remove unused param of rs_dbgfs_set_mcs
Eyal Shapira [Mon, 29 Jul 2013 14:08:48 +0000 (17:08 +0300)]
iwlwifi: mvm: remove unused param of rs_dbgfs_set_mcs

clean it up

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agobrcmsmac: Fix WARNING caused by lack of calls to dma_mapping_error()
John W. Linville [Fri, 9 Aug 2013 17:36:21 +0000 (13:36 -0400)]
brcmsmac: Fix WARNING caused by lack of calls to dma_mapping_error()

The driver fails to check the results of DMA mapping in twp places,
which results in the following warning:

[   28.078515] ------------[ cut here ]------------
[   28.078529] WARNING: at lib/dma-debug.c:937 check_unmap+0x47e/0x930()
[   28.078533] bcma-pci-bridge 0000:0e:00.0: DMA-API: device driver failed to check map error[device address=0x00000000b5d60d6c] [size=1876 bytes] [mapped as
 single]
[   28.078536] Modules linked in: bnep bluetooth vboxpci(O) vboxnetadp(O) vboxnetflt(O) vboxdrv(O) ipv6 b43 brcmsmac rtl8192cu rtl8192c_common rtlwifi mac802
11 brcmutil cfg80211 snd_hda_codec_conexant rng_core snd_hda_intel kvm_amd snd_hda_codec ssb kvm mmc_core snd_pcm snd_seq snd_timer snd_seq_device snd k8temp
 cordic joydev serio_raw hwmon sr_mod sg pcmcia pcmcia_core soundcore cdrom i2c_nforce2 i2c_core forcedeth bcma snd_page_alloc autofs4 ext4 jbd2 mbcache crc1
6 scsi_dh_alua scsi_dh_hp_sw scsi_dh_rdac scsi_dh_emc scsi_dh ata_generic pata_amd
[   28.078602] CPU: 1 PID: 2570 Comm: NetworkManager Tainted: G           O 3.10.0-rc7-wl+ #42
[   28.078605] Hardware name: Hewlett-Packard HP Pavilion dv2700 Notebook PC/30D6, BIOS F.27 11/27/2008
[   28.078607]  0000000000000009 ffff8800bbb03ad8 ffffffff8144f898 ffff8800bbb03b18
[   28.078612]  ffffffff8103e1eb 0000000000000002 ffff8800b719f480 ffff8800b7b9c010
[   28.078617]  ffffffff824204c0 ffffffff81754d57 0000000000000754 ffff8800bbb03b78
[   28.078622] Call Trace:
[   28.078624]  <IRQ>  [<ffffffff8144f898>] dump_stack+0x19/0x1b
[   28.078634]  [<ffffffff8103e1eb>] warn_slowpath_common+0x6b/0xa0
[   28.078638]  [<ffffffff8103e2c1>] warn_slowpath_fmt+0x41/0x50
[   28.078650]  [<ffffffff8122d7ae>] check_unmap+0x47e/0x930
[   28.078655]  [<ffffffff8122de4c>] debug_dma_unmap_page+0x5c/0x70
[   28.078679]  [<ffffffffa04a808c>] dma64_getnextrxp+0x10c/0x190 [brcmsmac]
[   28.078691]  [<ffffffffa04a9042>] dma_rx+0x62/0x240 [brcmsmac]
[   28.078707]  [<ffffffffa0479101>] brcms_c_dpc+0x211/0x9d0 [brcmsmac]
[   28.078717]  [<ffffffffa046d927>] ? brcms_dpc+0x27/0xf0 [brcmsmac]
[   28.078731]  [<ffffffffa046d947>] brcms_dpc+0x47/0xf0 [brcmsmac]
[   28.078736]  [<ffffffff81047dcc>] tasklet_action+0x6c/0xf0
--snip--
[   28.078974]  [<ffffffff813891bd>] SyS_sendmsg+0xd/0x20
[   28.078979]  [<ffffffff81455c24>] tracesys+0xdd/0xe2
[   28.078982] ---[ end trace 6164d1a08148e9c8 ]---
[   28.078984] Mapped at:
[   28.078985]  [<ffffffff8122c8fd>] debug_dma_map_page+0x9d/0x150
[   28.078989]  [<ffffffffa04a9322>] dma_rxfill+0x102/0x3d0 [brcmsmac]
[   28.079001]  [<ffffffffa047a13d>] brcms_c_init+0x87d/0x1100 [brcmsmac]
[   28.079010]  [<ffffffffa046d851>] brcms_init+0x21/0x30 [brcmsmac]
[   28.079018]  [<ffffffffa04786e0>] brcms_c_up+0x150/0x430 [brcmsmac]

As the patch adds a new failure mechanism to dma_rxfill(). When I changed the
comment at the start of the routine to add that information, I also polished
the wording.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Cc: Brett Rudley <brudley@broadcom.com>
Cc: Franky (Zhenhui) Lin <frankyl@broadcom.com>
Cc: Hante Meuleman <meuleman@broadcom.com>
Cc: brcm80211-dev-list@broadcom.com
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: sparse warnings: cast to restricted type
Mark Schulte [Wed, 31 Jul 2013 07:08:27 +0000 (00:08 -0700)]
rtlwifi: sparse warnings: cast to restricted type

Adding type casts to suppress sparse warnings:
 * warning: cast to restricted __le32/__le16

Signed-off-by: Mark Schulte <schultetwin@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use lockless variant to initialize RX fifo
Sujith Manoharan [Wed, 14 Aug 2013 15:45:57 +0000 (21:15 +0530)]
ath9k: Use lockless variant to initialize RX fifo

Since the rx_fifo queue is accessed only using the various
lockless SKB queue routines, there is no need to initialize
the lock and __skb_queue_head_init() can be used.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Optimize LNA check
Sujith Manoharan [Wed, 14 Aug 2013 15:45:56 +0000 (21:15 +0530)]
ath9k: Optimize LNA check

The documentation for antenna diversity says:

"The decision of diversity is done at 802.11 preamble. So, for
11G/11B, for every MAC packet hardware will do a decision. But in
11N with aggregation, the decision is made only at the preamble and
all other MPDUs will use the same LNA as the first MPDU."

Make use of rs_firstaggr to avoid needlessly scanning for LNA
changes.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Identify first subframe in an A-MPDU
Sujith Manoharan [Wed, 14 Aug 2013 15:45:55 +0000 (21:15 +0530)]
ath9k: Identify first subframe in an A-MPDU

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Handle invalid RSSI
Sujith Manoharan [Wed, 14 Aug 2013 15:45:54 +0000 (21:15 +0530)]
ath9k: Handle invalid RSSI

The combined RSSI can be invalid which is indicated by
the value -128. Use RX_FLAG_NO_SIGNAL_VAL for such cases.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove unused function argument
Sujith Manoharan [Wed, 14 Aug 2013 03:41:22 +0000 (09:11 +0530)]
ath9k: Remove unused function argument

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix error condition for corrupt descriptors
Sujith Manoharan [Wed, 14 Aug 2013 03:41:21 +0000 (09:11 +0530)]
ath9k: Fix error condition for corrupt descriptors

In case a descriptor has the "done" bit clear and the
next descriptor has it set, we drop both of them. If
the packet that is received after these two packets
is dropped for some reason, "discard_next" will not cleared.
Fix this.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Handle corrupt descriptors properly
Sujith Manoharan [Wed, 14 Aug 2013 03:41:20 +0000 (09:11 +0530)]
ath9k: Handle corrupt descriptors properly

The MIC/PHYERR/CRC error bits are valid only for
the last desc. for chained packets. Check this early
in the preprocess() routine and bail out.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Move the RX poll check to preprocess()
Sujith Manoharan [Wed, 14 Aug 2013 03:41:19 +0000 (09:11 +0530)]
ath9k: Move the RX poll check to preprocess()

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix RX beacon processing
Sujith Manoharan [Wed, 14 Aug 2013 03:41:18 +0000 (09:11 +0530)]
ath9k: Fix RX beacon processing

Make sure that chained descriptors are handled correctly
before the packet is parsed to determine if it is a beacon.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix RX packet counter
Sujith Manoharan [Wed, 14 Aug 2013 03:41:17 +0000 (09:11 +0530)]
ath9k: Fix RX packet counter

Handle chained descriptors and increment the RX counter
only for valid packets. Since this is used only by MCI,
use CONFIG_ATH9K_BTCOEX_SUPPORT.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix RX debug statistics
Sujith Manoharan [Wed, 14 Aug 2013 03:41:16 +0000 (09:11 +0530)]
ath9k: Fix RX debug statistics

The various error bits that ath_debug_stat_rx()
checks are valid only for the last descriptor for
a chained packet, handle this correctly.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix PHY error processing
Sujith Manoharan [Wed, 14 Aug 2013 03:41:15 +0000 (09:11 +0530)]
ath9k: Fix PHY error processing

Parse the PHY error details only for the last fragment
in case descriptors are chained.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Reorder some functions
Sujith Manoharan [Wed, 14 Aug 2013 03:41:14 +0000 (09:11 +0530)]
ath9k: Reorder some functions

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix TSF processing
Sujith Manoharan [Wed, 14 Aug 2013 03:41:13 +0000 (09:11 +0530)]
ath9k: Fix TSF processing

There is no need to calculate the mactime for chained
descriptor packets, so make sure that this is done
only for the last fragment of valid packets.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix RX crypto processing
Sujith Manoharan [Wed, 14 Aug 2013 03:41:12 +0000 (09:11 +0530)]
ath9k: Fix RX crypto processing

The keymiss events are valid only in the last descriptor
of a packet. Fix this by making sure that we return
early in case of chained descriptors.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Discard invalid frames early
Sujith Manoharan [Wed, 14 Aug 2013 03:41:11 +0000 (09:11 +0530)]
ath9k: Discard invalid frames early

Frames with invalid or zero length can be discarded
early, there is no need to check the crypto bits.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix phy error handling for DFS
Sujith Manoharan [Wed, 14 Aug 2013 03:41:10 +0000 (09:11 +0530)]
ath9k: Fix phy error handling for DFS

Since the DFS code appears to process the phy errors
ATH9K_PHYERR_RADAR and ATH9K_PHYERR_FALSE_RADAR_EXT,
check for the correct phyerr status in the main RX
tasklet routine.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use a subroutine to check for "mybeacon"
Sujith Manoharan [Wed, 14 Aug 2013 03:41:09 +0000 (09:11 +0530)]
ath9k: Use a subroutine to check for "mybeacon"

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k_htc: do not use bulk on EP3 and EP4
Oleksij Rempel [Tue, 13 Aug 2013 19:10:19 +0000 (21:10 +0200)]
ath9k_htc: do not use bulk on EP3 and EP4

If usb auto suspend is enabled or system run in to suspend/resume
cycle, ath9k-htc adapter will stop to response. It is reproducible on xhci HCs.

Host part of problem:
XHCI do timing calculation based on Transfer Type and bInterval,
immediately after device was detected. Ath9k-htc try to overwrite
this parameters on module probe and some changes in FW,
since we do not initiate usb reset from the driver this changes
are not took to account. So, before any kind of suspend or reset,
host controller will operate with old parameters. Only after suspend/resume
and if interface id stay unchanged, new parameters will by applied. Host
will send bulk data with no intervals (?), which will cause
overflow on FIFO of EP4.

Firmware part of problem:
By default, ath9k-htc adapters configured with EP3 and EP4
as interrupt endpoints. Current firmware will try to overwrite
ConfigDescriptor to make EP3 and EP4 bulk. FIFO for this endpoints
stay not reconfigured, so under the hood it is still Int EP.

This patch is revert of 4a0e8ecca4ee commit which trying to
reduce CPU usage on some systems. Since it will produce more bug
as fixes, we will need to find other way to fix it.

here is comment from kernel source which has some more explanation:
* Some buggy high speed devices have bulk endpoints using
* maxpacket sizes other than 512.  High speed HCDs may not
* be able to handle that particular bug, so let's warn...

in our case EP3 and EP4 have maxpacket sizes = 64!!!

Signed-off-by: Oleksij Rempel <linux@rempel-privat.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowil6210: let IP stack re-check HW TCP/UDP csum errors
Vladimir Kondratiev [Tue, 13 Aug 2013 12:25:32 +0000 (15:25 +0300)]
wil6210: let IP stack re-check HW TCP/UDP csum errors

Fix for TCP iperf from Windows to Linux stall after about 1sec

Hardware reports false errors in some situations:

Microsoft IP stack, in violation of RFC 1624, set TCP checksum that should be 0x0
as 0xffff. hardware report Rx csum error. If HW csum absolutely trusted,
this frame can be never received, as re-transmitted one will have same csum problem.
In addition, it mess up block ack reorder buffer, as if packet dropped, it is not score boarded
there.

Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: reset buffer stale flag in ath_tx_get_tid_subframe
Felix Fietkau [Tue, 13 Aug 2013 10:33:30 +0000 (12:33 +0200)]
ath9k: reset buffer stale flag in ath_tx_get_tid_subframe

If that flag stays set for a buffer that already ran through the tx path
once, it might cause issues in tx completion processing. Better clear it
early to ensure that this does not happen

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: simplify ath_tid_drain
Felix Fietkau [Tue, 13 Aug 2013 10:33:29 +0000 (12:33 +0200)]
ath9k: simplify ath_tid_drain

ath_tid_drain is only called when a station entry is being removed, so
there is no point in still tracking BAW state. Remove some unnecessary
code and a bogus TODO comment related to this.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: avoid accessing MRC registers on single-chain devices
Felix Fietkau [Tue, 13 Aug 2013 10:33:28 +0000 (12:33 +0200)]
ath9k: avoid accessing MRC registers on single-chain devices

They are not implemented, and accessing them might trigger errors

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: simplify debugfs chainmask handling
Felix Fietkau [Tue, 13 Aug 2013 10:33:27 +0000 (12:33 +0200)]
ath9k: simplify debugfs chainmask handling

Writing to that file is unnecessary and quirky, the antenna API should
be used instead. Use debugfs_create_u8 to allow reading the values.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: remove ath9k_sta_remove_debugfs
Felix Fietkau [Tue, 13 Aug 2013 10:33:26 +0000 (12:33 +0200)]
ath9k: remove ath9k_sta_remove_debugfs

mac80211 uses debugfs_remove_recursive, so there's no need for the
driver to do an explicit cleanup of its sta debugfs entry.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: shrink a few data structures by reordering fields
Felix Fietkau [Sat, 10 Aug 2013 13:59:16 +0000 (15:59 +0200)]
ath9k: shrink a few data structures by reordering fields

Also reduce the size of a few fields where possible

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: fix rx descriptor related race condition
Felix Fietkau [Sat, 10 Aug 2013 13:59:15 +0000 (15:59 +0200)]
ath9k: fix rx descriptor related race condition

Similar to a race condition that exists in the tx path, the hardware
might re-read the 'next' pointer of a descriptor of the last completed
frame. This only affects non-EDMA (pre-AR93xx) devices.

To deal with this race, defer clearing and re-linking a completed rx
descriptor until the next one has been processed.

Cc: stable@vger.kernel.org
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agobrcmfmac: use configurable sdio bus header length for tx packet
Franky Lin [Sat, 10 Aug 2013 10:27:29 +0000 (12:27 +0200)]
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>
10 years agobrcmfmac: streamline sdio bus header code
Franky Lin [Sat, 10 Aug 2013 10:27:28 +0000 (12:27 +0200)]
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>
10 years agobrcmfmac: remove align from brcmf_bus structure
Franky Lin [Sat, 10 Aug 2013 10:27:27 +0000 (12:27 +0200)]
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>
10 years agobrcmfmac: abstract tx packet processing functions
Franky Lin [Sat, 10 Aug 2013 10:27:26 +0000 (12:27 +0200)]
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>
10 years agobrcmfmac: add support for manual TDLS operations
Arend van Spriel [Sat, 10 Aug 2013 10:27:25 +0000 (12:27 +0200)]
brcmfmac: add support for manual TDLS operations

Implement the .tdls_oper() callback and indicate TDLS support
in the wiphy flags.

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>
10 years agobrcmfmac: ignore IF event if firmware indicates it
Arend van Spriel [Sat, 10 Aug 2013 10:27:24 +0000 (12:27 +0200)]
brcmfmac: ignore IF event if firmware indicates it

Not every IF event from the firmware needs to result in a
related interface, netdev or wdev, on the host. This is
indicated in the event message. Handle that flag and effectively
ignore the firmware event.

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>
10 years agobrcmfmac: no fws locking outside fws module.
Hante Meuleman [Sat, 10 Aug 2013 10:27:23 +0000 (12:27 +0200)]
brcmfmac: no fws locking outside fws module.

FWS uses locking to protect its data while being called from
various entries. On bus_txdata the lock was kept resulting in
unnecessary long locking, but also creating possibility for
deadlock. This update changes the locking to release lock when
bus_txdata is called.

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>
10 years agobrcmfmac: always use worker thread for tx data.
Hante Meuleman [Sat, 10 Aug 2013 10:27:22 +0000 (12:27 +0200)]
brcmfmac: always use worker thread for tx data.

When fw signalling is disabled tx is sent immediately. Using
queues and worker thread allows usb to do synchronous autopm. This
patch makes fws use queues and worker thread even if signalling is
not supported by FW or not enabled.

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>
10 years agobrcmfmac: add AMPDU reordering functionality
Arend van Spriel [Sat, 10 Aug 2013 10:27:21 +0000 (12:27 +0200)]
brcmfmac: add AMPDU reordering functionality

This feature moves the responsibility of collecting all MPDUs in an
AMPDU session in the correct order from the firmware to the host
driver. This reduces buffer requirement on the firmware side.

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>
10 years agobrcmfmac: .txdata() bus callback should not call brcmf_txcomplete()
Arend van Spriel [Sat, 10 Aug 2013 10:27:20 +0000 (12:27 +0200)]
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>
10 years agobrcmfmac: use irq safe spinlock in brcmf_sdbrcm_txdata()
Arend van Spriel [Sat, 10 Aug 2013 10:27:19 +0000 (12:27 +0200)]
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>
10 years agoMerge tag 'nfc-next-3.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo...
John W. Linville [Thu, 15 Aug 2013 19:55:10 +0000 (15:55 -0400)]
Merge tag 'nfc-next-3.12-1' of git://git./linux/kernel/git/sameo/nfc-next

Samuel Ortiz <sameo@linux.intel.com> says:

"This is the first NFC pull request for the 3.12 release.

With this one we have:

- A few pn533 improvements and minor fixes. Testing our pn533 driver
  against Google's NCI stack triggered a few issues that we fixed now.
  We also added Tx fragmentation support to this driver.

- More NFC secure element handling. We added a GET_SE netlink command
  for getting all the discovered secure elements, and we defined 2
  additional secure element netlink event (transaction and connectivity).
  We also fixed a couple of typos and copy-paste bugs from the secure
  element handling code.

- Firmware download support for the pn544 driver. This chipset can enter a
  special mode where it's waiting for firmware blobs to replace the
  already flashed one. We now support that mode."

Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'for-linville' of git://github.com/kvalo/ath
John W. Linville [Thu, 15 Aug 2013 19:54:06 +0000 (15:54 -0400)]
Merge branch 'for-linville' of git://github.com/kvalo/ath

10 years agonet: rfkill: Do not ignore errors from regulator_enable()
Luis Henriques [Wed, 14 Aug 2013 22:10:06 +0000 (23:10 +0100)]
net: rfkill: Do not ignore errors from regulator_enable()

Function regulator_enable() may return an error that has to be checked.
This patch changes function rfkill_regulator_set_block() so that it checks
for the return code.  Also, rfkill_data->reg_enabled is set to 'true' only
if there is no error.

This fixes the following compilation warning:

net/rfkill/rfkill-regulator.c:43:20: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result]

Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoNFC: Update secure element state
Arron Wang [Tue, 30 Jul 2013 12:40:05 +0000 (14:40 +0200)]
NFC: Update secure element state

The secure element state was not updated from the enable/disable ops,
leaving the SE state to disabled for ever.

Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: Fix secure element state check
Arron Wang [Tue, 30 Jul 2013 12:35:35 +0000 (14:35 +0200)]
NFC: Fix secure element state check

Another typo from the initial commit where we check for the secure
element type field instead of its state when enabling or disabling it.

Signed-off-by: Arron Wang <arron.wang@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: hci: Fix enable/disable confusion
Dan Carpenter [Mon, 17 Jun 2013 22:48:26 +0000 (01:48 +0300)]
NFC: hci: Fix enable/disable confusion

There is a cut and paste bug so we enable a second time instead of
disabling.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn544: i2c: Add firmware download implementation for pn544
Eric Lapuyade [Fri, 19 Jul 2013 12:59:45 +0000 (14:59 +0200)]
NFC: pn544: i2c: Add firmware download implementation for pn544

The pn544 can enter a firmware update mode where firmware blobs can be
pushed through the i2c line and flashed on the target.
A special command allows to verify that blobs are correctly flashed and
this is what we do for every downloaded firmware blob.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn544: Add firmware operations hci ops
Eric Lapuyade [Fri, 19 Jul 2013 12:58:39 +0000 (14:58 +0200)]
NFC: pn544: Add firmware operations hci ops

The firmware operation callback is passed by the physical layer to the
hci driver during probe. All the driver does is to store it and call it
when the fw_upload hci ops is invoked.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: netlink: Add result of firmware operation to completion event
Eric Lapuyade [Fri, 19 Jul 2013 12:57:55 +0000 (14:57 +0200)]
NFC: netlink: Add result of firmware operation to completion event

Result is added as an NFC_ATTR_FIRMWARE_DOWNLOAD_STATUS attribute
containing the standard errno positive value of the completion result.
This event will be sent when the firmare download operation is done and
will contain the operation result.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn544: i2c: Add firmware download mode power-on support
Eric Lapuyade [Fri, 19 Jul 2013 12:57:13 +0000 (14:57 +0200)]
NFC: pn544: i2c: Add firmware download mode power-on support

This is in preparation for pn544-i2c firmware download feature, where we
need to know if we're in regular or firmware upload mode.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: Move nfc_fw_download_done() definition from private to public
Eric Lapuyade [Fri, 19 Jul 2013 12:56:08 +0000 (14:56 +0200)]
NFC: Move nfc_fw_download_done() definition from private to public

This API must be called by NFC drivers, and its prototype was
incorrectly placed.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Add some polling entropy
Samuel Ortiz [Wed, 3 Jul 2013 13:14:17 +0000 (15:14 +0200)]
NFC: pn533: Add some polling entropy

By not always starting the polling loop from the same modulation, we
avoid entering infinite loops where devices exporting 2 targets (on 2
different modulations) get the same target activated over and over.
If this target is not readable (e.g. a wallet emulating a tag), we will
stay in an error loop for ever.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Add delay between each poll frame
Samuel Ortiz [Wed, 3 Jul 2013 12:50:36 +0000 (14:50 +0200)]
NFC: pn533: Add delay between each poll frame

It seems that some pn533 firmwares go belly up when being asked to send
poll frames too frequently. Adding a 10ms delay between each of them
calm the chip down and prevent it from crashing.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: Add a GET_SE netlink API
Samuel Ortiz [Wed, 24 Jul 2013 16:10:50 +0000 (18:10 +0200)]
NFC: Add a GET_SE netlink API

In order to fetch the discovered secure elements from an NFC controller,
we need to send a netlink command that will dump the list of available
SEs from NFC.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: Fix SE discovery failure warning condition
Samuel Ortiz [Wed, 24 Jul 2013 12:49:22 +0000 (14:49 +0200)]
NFC: Fix SE discovery failure warning condition

This is a typo coming from the initial implementation. se_discover fails
when it returns something different than zero and we should only display
a warning in that case.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Store the correct frame size (normal vs ext)
Olivier Guiter [Thu, 13 Jun 2013 13:43:29 +0000 (13:43 +0000)]
NFC: pn533: Store the correct frame size (normal vs ext)

The extended information frame are sent by PN533 to exchange frames
larger than 255 bytes. These extended frame are very close from the
standard ones except for the header size length. On each incoming
frame, we set the correct header length, and we do that only for the
standard pn533 chipsets as the acr122 does not seem to support extended
frames properly.

Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Split large Tx frames in chunks
Olivier Guiter [Thu, 13 Jun 2013 13:43:28 +0000 (13:43 +0000)]
NFC: pn533: Split large Tx frames in chunks

On sending large frames (size > 262), we split it in multiple chunks and
send them asynchronously with MI bit.

Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Add extended information frame decoding support
Olivier Guiter [Thu, 13 Jun 2013 13:43:27 +0000 (15:43 +0200)]
NFC: pn533: Add extended information frame decoding support

Extended Information frames are slightly different from standard frames
as they can (theorically) handle datas up tu 64kB. PN533 firmware only
supports packet data up to 265 (incl. TFI byte)
This kind of frame are used when the pn533 wants to exchange more than
255 bytes, and this patch handles the reception of such frames.

Signed-off-by: Olivier Guiter <olivier.guiter@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Enable AUTO RFCA
Samuel Ortiz [Mon, 1 Jul 2013 15:26:58 +0000 (17:26 +0200)]
NFC: pn533: Enable AUTO RFCA

The AUTO RFCA bit forbids the pn533 chipset to turn its radio on
whenever an external field is present.
Without this bit set, some devices seems to get over flood by the
pn533 rf field and thus become hardly detectable.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Unconditionaly select the highest p2p bit rate
Samuel Ortiz [Mon, 1 Jul 2013 08:58:12 +0000 (10:58 +0200)]
NFC: pn533: Unconditionaly select the highest p2p bit rate

p2p devices must be able to support 424 kbps, so we should always select
that bitrate in initiator mode.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Request System code from SENSF_REQ
Samuel Ortiz [Fri, 28 Jun 2013 13:43:19 +0000 (15:43 +0200)]
NFC: pn533: Request System code from SENSF_REQ

Some devices are getting confused when not being asked for their system
code with type F.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Fix the pn533 polling loop
Samuel Ortiz [Wed, 26 Jun 2013 16:16:21 +0000 (18:16 +0200)]
NFC: pn533: Fix the pn533 polling loop

By turning the radio off after each failed polling try, we dramatically
improve the pn533 polling loop efficiency.
Without this fix, all Android phones running the broadcom NFC stack are
almost never detected.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: pn533: Fix hardware busy loop when establishing the LLCP link
Samuel Ortiz [Wed, 26 Jun 2013 15:53:09 +0000 (17:53 +0200)]
NFC: pn533: Fix hardware busy loop when establishing the LLCP link

By using the standard setting for the regular pn533 dongles, we no
longer wait for ever for an ATR_RES. Without this, a failing ATR_REQ
will put the hardware into a busy loop, constantly waiting for an
ATR_RES.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: Define secure element connectivity and transaction events
Samuel Ortiz [Tue, 25 Jun 2013 14:22:08 +0000 (16:22 +0200)]
NFC: Define secure element connectivity and transaction events

The SE_CONNECTIVITY event is for an SE to request connection to e.g. a
modem. The SE_TRANSACTION one is sent when an application running on a
specific SE wants to notify the host CPU about the end of a transaction.
Those events respectively map to the EVT_CONNECTIVITY and the
EVT_TRANSACTION HCI events.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: Document secure element addition/removal netlink events
Samuel Ortiz [Tue, 25 Jun 2013 10:42:54 +0000 (12:42 +0200)]
NFC: Document secure element addition/removal netlink events

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoMAINTAINERS: Change the NFC subsystem status to Supported
Samuel Ortiz [Mon, 24 Jun 2013 12:39:35 +0000 (14:39 +0200)]
MAINTAINERS: Change the NFC subsystem status to Supported

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agoNFC: Fix missing static declarations
Thierry Escande [Mon, 24 Jun 2013 10:02:28 +0000 (12:02 +0200)]
NFC: Fix missing static declarations

This patch fixes 3 sparse warnings:
nfcsim.c:63:25: sparse: symbol 'wq' was not declared.
nfcsim.c:484:12: sparse: symbol 'nfcsim_init' was not declared.
nfcsim.c:525:13: sparse: symbol 'nfcsim_exit' was not declared.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Thierry Escande <thierry.escande@linux.intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
10 years agomwifiex: fix build error when CONFIG_PM is not set
Bing Zhao [Sat, 10 Aug 2013 04:09:06 +0000 (21:09 -0700)]
mwifiex: fix build error when CONFIG_PM is not set

config: make ARCH=m68k allmodconfig

All error/warnings:

   drivers/net/wireless/mwifiex/cfg80211.c: In function
       'mwifiex_fill_coalesce_rule_info':
>> drivers/net/wireless/mwifiex/cfg80211.c:2493:3: error: implicit
       declaration of function 'mwifiex_is_pattern_supported'
       [-Werror=implicit-function-declaration]
   drivers/net/wireless/mwifiex/cfg80211.c: At top level:
   drivers/net/wireless/mwifiex/cfg80211.c:2537:12: warning:
       'mwifiex_cfg80211_set_coalesce' defined but not used
       [-Wunused-function]
   cc1: some warnings being treated as errors

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomac80211: ibss - do not scan if not needed when creating an IBSS
Antonio Quartulli [Fri, 9 Aug 2013 16:58:32 +0000 (18:58 +0200)]
mac80211: ibss - do not scan if not needed when creating an IBSS

In some cases mac80211 will scan before creating an IBSS
even if bssid and frequency have been forced by the user.
This is not needed and leads only to a delay in the IBSS
establishment phase.

Immediately create the cell if both bssid and frequency
(and fixed_freq is set) have been specified.

Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: remove MIMO3 from rate scale code
Eyal Shapira [Sun, 28 Jul 2013 23:02:45 +0000 (23:02 +0000)]
iwlwifi: mvm: remove MIMO3 from rate scale code

Current and future chips supported by mvm will only have a maximum
of 2 antennas so all the MIMO3 related code and states can be dropped.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: Add basic uAPSD client support
Alexander Bondar [Sun, 7 Apr 2013 11:08:59 +0000 (14:08 +0300)]
iwlwifi: mvm: Add basic uAPSD client support

Implement basic uAPSD client support adding the following:

- Advertise uAPSD support in HW capabilities
- Set all ACs trigger- and delivery-enabled
- Set max SP length to 2 buffered frames
- Assign QNDP with the highest TID with no mandatory admission
  control required
- Set uAPSD related parameters in Power Table command

Signed-off-by: Alexander Bondar <alexander.bondar@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: don't clear tbl->win mistakenly
Eliad Peller [Wed, 17 Jul 2013 06:16:30 +0000 (09:16 +0300)]
iwlwifi: mvm: don't clear tbl->win mistakenly

rs_get_tbl_info_from_mcs() mistakenly clears
the rate histories window, overriding its initialization
values (i.e. filling it with 0, instead of -1).

Signed-off-by: Eliad Peller <eliad@wizery.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: remove unused fields of iwl_rs_rate_info
Eyal Shapira [Sun, 4 Aug 2013 10:10:31 +0000 (13:10 +0300)]
iwlwifi: mvm: remove unused fields of iwl_rs_rate_info

Some more cleanups of unused fields and their initializations.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: pcie: returning positive instead of negative
Dan Carpenter [Sat, 10 Aug 2013 23:03:21 +0000 (02:03 +0300)]
iwlwifi: pcie: returning positive instead of negative

There is a missing '-' character here so we return positive 'ENOMEM'
instead of negative.  The caller doesn't care.  All non-zero returns
are translated to '-ENOMEM' in iwl_pcie_nic_init().

This is just a cleanup.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: remove rate_scale_data debugfs entry
Eyal Shapira [Sun, 4 Aug 2013 09:40:37 +0000 (12:40 +0300)]
iwlwifi: mvm: remove rate_scale_data debugfs entry

This isn't very informative and can be deduced from rate_scale_table.
Remove as a preparation for dropping iwl_rs_rate_info.ieee.

Signed-off-by: Eyal Shapira <eyal@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: pcie: don't swallow error codes in iwl_trans_pcie_alloc()
Luciano Coelho [Sat, 10 Aug 2013 13:35:45 +0000 (16:35 +0300)]
iwlwifi: pcie: don't swallow error codes in iwl_trans_pcie_alloc()

The iwl_trans_pcie_alloc() function doesn't pass up error codes
returned from functions it calls, swallowing them and returning NULL
in all failure cases.  The caller checks if the return value is NULL
and returns -ENOMEM.  This is not correct, because in certain cases
the failure was not due to an OOM situation.

To fix this, modify the iwl_trans_pcie_alloc() function to use
ERR_PTR() to return error codes and clean up the error handling code
a bit.

Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoiwlwifi: mvm: add support to the new FW time event API
Eytan Lifshitz [Wed, 7 Aug 2013 16:36:42 +0000 (19:36 +0300)]
iwlwifi: mvm: add support to the new FW time event API

The time event firmware API will change, add the support for that.
Use the new API throughout and convert to the old where needed.

Signed-off-by: Eytan Lifshitz <eytan.lifshitz@intel.com>
Reviewed-by: Guy Cohen <guy.cohen@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>