GitHub/moto-9609/android_kernel_motorola_exynos9610.git
12 years agobcma: fix typo - reading number of slave wrappers
Rafał Miłecki [Wed, 11 Jul 2012 06:37:23 +0000 (08:37 +0200)]
bcma: fix typo - reading number of slave wrappers

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: support alternative (BCM4706) ChipCommon core id
Rafał Miłecki [Tue, 10 Jul 2012 21:45:49 +0000 (23:45 +0200)]
bcma: support alternative (BCM4706) ChipCommon core id

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: restructure info->control.sta handling as it is goning to be removed soon.
Thomas Huehn [Tue, 10 Jul 2012 12:01:37 +0000 (14:01 +0200)]
brcmsmac: restructure info->control.sta handling as it is goning to be removed soon.

brcmsmac uses info->control.sta while doing ampdu aggregation. This patch
changes the usage of the structure info->control.sta, as it is going to be
removed soon from struct ieee80211_tx_info. This patch is a pre-requisit in
order to add transmission power control (TPC) to the mac80211 subsystem.

Suggested-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: do not disable hardware while wow is enabled
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:27:11 +0000 (14:57 +0530)]
ath9k: do not disable hardware while wow is enabled

Hardware needs to be AWAKE and should maintain association
with the AP to process WoW triggers any time

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Add WoW related mac80211 callbacks
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:26:52 +0000 (14:56 +0530)]
ath9k: Add WoW related mac80211 callbacks

add suspend/resume/set_wakeup callbacks to the driver

*suspend

- bail out only if all the conditions for configuring WoW.
  is fine, currently multivif case is not handled
- check for associated state.
- map wow triggers from user space data.
- add deauth/disassoc pattern and user defined pattern,
  for the later a list is maintained.
- store the interrupt mask before suspend, enabled beacon
  miss interrupt for WoW.
- configure WoW in the hardware by calling ath9k_hw_wow_enable.

*resume

- restore the interrupts based on the interrupt mask
  stored before suspend.
- call ath9k_hw_wow_wakeup to configure/restore the hardware.
- after wow wakeup clear away WoW events and query the
  WoW wakeup reason from the status register

*set_wakeup

- to call 'device_set_wakeup_enable' from cfg80211/mac80211
  when wow is configured and as per Rafael/Johannnes the
  right way to do so rather in the driver suspend/resume
  call back

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath: Add Wake-on-Wireless debug mask
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:26:34 +0000 (14:56 +0530)]
ath: Add Wake-on-Wireless debug mask

to help the developers and users to debug/know
whats happening with WoW

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: Add hardware code for WoW
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:26:15 +0000 (14:56 +0530)]
ath9k_hw: Add hardware code for WoW

add a new file wow.c which takes care of the hardware code
for WoW.

*program the descriptors and data words to periodically
send Keep Alive Frames.
*program the user defined patterns/masks and pattern length
in the hardware registers.
*'ath9k_hw_wow_enable' is called during the drivers suspend
callback which takes care of the following
- tracking wow event mask (to suppress spurious
  wow events)
- properly configure suspend/resume WAR registers
- configure PCIE PM control register
- configure MAC WoW registers and their timeouts
- enabling wow configuration like magic packet,
  user patterns based on users configuration
- configuring timeouts for KAL, beacon miss,
  aifs, slot time, backoff
- create Keep Alive Pattern ('KAL')
*'ath9k_hw_wow_wakeup' is called during the drivers resume
callback which takes care of the following
- primary task is to find the reason for wakeup
  from the wow status register
- configure/restore AR_PCIE_PM_CTRL register
- clear all WoW events
- configure/restore suspend/resume WAR registers

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: INI changes for WoW for AR9002 chipsets
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:25:54 +0000 (14:55 +0530)]
ath9k_hw: INI changes for WoW for AR9002 chipsets

for AR9002 family of chipsets and for WoW sleep, we reprogram
the SerDes so that the PLL and CHK REQ are both enabled. this
uses more power but in certain cases this is required as otherwise
WoW sleep is unstable and chip may disappear.

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: advertise supported WoW flags to upper layer
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:25:35 +0000 (14:55 +0530)]
ath9k: advertise supported WoW flags to upper layer

currently the code supports WoW triggers due to
*magic packet
*user defined patterns
*deauth and disassoc patterns
*disconnect - beacon miss, last beacon received timeout,
no ack for keeep alive frames.

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: advertise WoW support for capable chipsets
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:25:17 +0000 (14:55 +0530)]
ath9k_hw: advertise WoW support for capable chipsets

support WoW for all chipsets starting from AR9280, AR9285, AR9287,
AR9380, AR9382, AR9485, AR9462. Really all hardware may not support
WoW even though the flag is set and the WoW working depends on
your laptop, BIOS apart from the hardware.

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: Add WoW hardware capability flags
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:24:53 +0000 (14:54 +0530)]
ath9k_hw: Add WoW hardware capability flags

have seperate wow capability flags for
*basic wow support
*device capable of matching exact user defined pattern
or de-authentication/disassoc pattern
*device such AR9280 requires first four bytes for
all sort of patterns

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k: Add definitions and structures to support WoW
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:24:34 +0000 (14:54 +0530)]
ath9k: Add definitions and structures to support WoW

*add structures, macros and variables for WoW, so that the driver
can make use of it.
*maintain a list for user enabled patterns and masks
*track pattern slots for the hardware limitation on the
maximum number of patterns that can be stored.
*track interrupts enabled before WoW suspend, so
that can be reconfigured after resume
*have macros to parse user defined wow configurations to
hardware code

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: Add register definitions for WoW support
Mohammed Shafi Shajakhan [Tue, 10 Jul 2012 09:24:06 +0000 (14:54 +0530)]
ath9k_hw: Add register definitions for WoW support

*MAC WoW registers

back-off shift, MAC interrupt enable, magic packet enable,
pattern match enable, aifs, slot wait period, keep alive
frame failure count, beacon fail enable, beacon timeout,
keep alive timeout, auto keep alive disable,
keep alive fail disable and their corresponding
status registers. keep alive frame delay,
pattern end/byte offsets, transmit buffers for
keep alive frames and storing the user patterns

*Power Management Control registers

pme_d3cold_vaux, host_pme_enable, aux_pwr_detect,
power_state_mask, wow_pme_clear

Cc: Senthil Balasubramanian <senthilb@qca.qualcomm.com>
Cc: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Cc: vadivel@qca.qualcomm.com
Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi...
John W. Linville [Thu, 12 Jul 2012 19:21:48 +0000 (15:21 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/iwlwifi/iwlwifi-next

12 years agoMerge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
John W. Linville [Thu, 12 Jul 2012 19:21:05 +0000 (15:21 -0400)]
Merge branch 'for-john' of git://git./linux/kernel/git/jberg/mac80211-next

Conflicts:
drivers/net/wireless/iwmc3200wifi/cfg80211.c
drivers/net/wireless/mwifiex/cfg80211.c

12 years agoiwlwifi: don't use stack memory for kmem cache name
Johannes Berg [Thu, 12 Jul 2012 11:56:28 +0000 (13:56 +0200)]
iwlwifi: don't use stack memory for kmem cache name

Since the kmem cache API doesn't internally allocate
the name but just points to the name that was passed
in we can't use stack memory for it. Move the name
into the transport struct.

Reported-by: Stanislaw Gruszka <sgruszka@redhat.com>
Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: iterate the virtual monitor interface
Johannes Berg [Wed, 11 Jul 2012 14:38:09 +0000 (16:38 +0200)]
mac80211: iterate the virtual monitor interface

If the virtual monitor interface is requested
by the driver, it should also be iterated over
when the driver wants to iterate all active
interfaces.

To allow that protect it with the iflist_mtx.

Change-Id: I58ac5de2f4ce93d12c5a98ecd2859f60158d5d69
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agocfg80211: fix locking and lockdep complaints
Johannes Berg [Tue, 10 Jul 2012 17:39:02 +0000 (19:39 +0200)]
cfg80211: fix locking and lockdep complaints

To call cfg80211_get_chan_state() we need to lock
the wdev, so we need to lock the wdev_iter mutex
in cfg80211_can_use_iftype_chan(). This needs to
use nested locking for lockdep.

Also, cfg80211_get_chan_state() doesn't actually
use the rdev, so remove that completely including
the lock assertion that isn't needed.

Reported-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agominstrel_ht: enable frame aggregation for fixed rate
Sylvain Roger Rieunier [Mon, 9 Jul 2012 17:25:09 +0000 (19:25 +0200)]
minstrel_ht: enable frame aggregation for fixed rate

When sample_idx is set to a value other than -1 it activates
the IEEE80211_TX_CTL_RATE_CTRL_PROBE flag which disables
frame aggregation. To allow frame aggregation during fixed
rate it is necessary to set max_tp_rate, max_tp_rate2 and
max_prob_rate instead of sample_idx.

Signed-off-by: Sylvain Roger Rieunier <sylvain.roger.rieunier@gmail.com>
[reword commit message a bit]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: tx: do not drop non-robust mgmt to non-MFP stas.
Nicolas Cavallari [Wed, 4 Jul 2012 16:10:08 +0000 (18:10 +0200)]
mac80211: tx: do not drop non-robust mgmt to non-MFP stas.

When drop_unencrypted is enabled and MFP is disabled,
non-robust management frames for not-yet associated STA are dropped.
This isn't visible as many management frames sent from the kernel
have TX_INTFL_DONT_ENCRYPT set and management frames injected
from a monitor vif have TX_CTL_INJECTED so aren't dropped.
But management frames sent from userspace via NL80211_CMD_FRAME
do not have this flag set, so are dropped.

This patch make it always accept non-robust management frames.

Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: restructure key selection
Johannes Berg [Wed, 4 Jul 2012 16:10:07 +0000 (18:10 +0200)]
mac80211: restructure key selection

The "no key" case in key selection that decides
whether to drop the frame or not is impossible
to understand, restructure the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
[cavallar@lri.fr: removed blank line and restructured action frame clause]
Signed-off-by: Nicolas Cavallari <cavallar@lri.fr>
12 years agomac80211: add time synchronisation with BSS for assoc
Johannes Berg [Tue, 22 May 2012 20:13:05 +0000 (22:13 +0200)]
mac80211: add time synchronisation with BSS for assoc

Some drivers (iwlegacy, iwlwifi and rt2x00) today use the
bss_conf.last_tsf value. By itself though that value is
completely worthless since it may be ancient. What really
is needed is synchronisation between some device time and
the TSF.

To clarify this, rename bss_conf.last_tsf to sync_tsf and
add sync_device_ts which is obtained from rx_status which
gets a new field device_timestamp for this purpose. This
is intentionally not using the mactime field since that
is used for other things and in IBSS is expected to sync
with the IBSS's TSF which isn't necessarily true for the
device timestamp.

Also, since we have the information and it's useful even
before the connection has been established, give all the
timing details to the driver before authenticating.

Reviewed-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: optimize ieee80211_rx_status struct layout
Johannes Berg [Thu, 5 Jul 2012 11:14:18 +0000 (13:14 +0200)]
mac80211: optimize ieee80211_rx_status struct layout

We waste a lot of space in this struct because it uses
int values where smaller ones would be sufficient. The
upcoming A-MPDU information needs some space, optimize
the struct now.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: redesign scan RX
Johannes Berg [Fri, 6 Jul 2012 20:19:27 +0000 (22:19 +0200)]
mac80211: redesign scan RX

Scan receive is rather inefficient when there are
multiple virtual interfaces. We iterate all of the
virtual interfaces and then notify cfg80211 about
each beacon many times.

Redesign scan RX to happen before everything else.
Then we can also get rid of IEEE80211_RX_IN_SCAN
since we don't have to accept frames into the RX
handlers for scanning or scheduled scanning any
more. Overall, this simplifies the code.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: track scheduled scan virtual interface
Johannes Berg [Fri, 6 Jul 2012 19:55:11 +0000 (21:55 +0200)]
mac80211: track scheduled scan virtual interface

Instead of tracking whether or not we're in a
scheduled scan, track the virtual interface
(sdata) in an RCU-protected pointer to make it
usable from RX to check the MAC address.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: make scan_sdata pointer usable with RCU
Johannes Berg [Fri, 6 Jul 2012 19:39:28 +0000 (21:39 +0200)]
mac80211: make scan_sdata pointer usable with RCU

Making the scan_sdata pointer usable with RCU makes
it possible to dereference it in the RX path to see
if a received frame actually matches the interface
that is scanning. This is just preparations, making
the pointer __rcu.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agomac80211: fix invalid band deref building preq IEs
Arik Nemtsov [Mon, 9 Jul 2012 16:57:28 +0000 (19:57 +0300)]
mac80211: fix invalid band deref building preq IEs

The function building probe-request IEs does not validate the band is
supported before dereferencing it. This can result in a panic when
all bands are traversed, as done during sched-scan start.

Warn when this happens and return an empty probe request. Also fix
sched-scan to not waste memory on unsupported bands.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agonl80211: move scan API to wdev
Johannes Berg [Mon, 18 Jun 2012 17:17:03 +0000 (19:17 +0200)]
nl80211: move scan API to wdev

The new P2P Device will have to be able to scan for
P2P search, so move scanning to use struct wireless_dev
instead of struct net_device.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agonl80211: send interface after creation
Johannes Berg [Fri, 15 Jun 2012 22:05:37 +0000 (00:05 +0200)]
nl80211: send interface after creation

After a new virtual interface is created, reply
to userspace with a message detailing it so it
knows the new wdev identifier.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agocfg80211: use wireless_dev for interface management
Johannes Berg [Fri, 15 Jun 2012 22:00:26 +0000 (00:00 +0200)]
cfg80211: use wireless_dev for interface management

In order to be able to create P2P Device wdevs, move
the virtual interface management over to wireless_dev
structures.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
12 years agoath5k: replace modparam_all_channels with CONFIG_ATH5K_TEST_CHANNELS
Luis R. Rodriguez [Fri, 6 Jul 2012 22:21:51 +0000 (15:21 -0700)]
ath5k: replace modparam_all_channels with CONFIG_ATH5K_TEST_CHANNELS

This stashes away this feature from standard kernel builds.

Signed-off-by: Luis R. Rodriguez <mcgrof@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoiwmc3200top: remove driver for unavailable hardware
John W. Linville [Tue, 10 Jul 2012 20:27:29 +0000 (16:27 -0400)]
iwmc3200top: remove driver for unavailable hardware

This hardware never became available to normal humans.  Leaving this
driver imposes unwelcome maintenance costs for no clear benefit.

Cc: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
Cc: Samuel Ortiz <samuel.ortiz@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoi2400m: remove SDIO device support
John W. Linville [Tue, 10 Jul 2012 20:27:28 +0000 (16:27 -0400)]
i2400m: remove SDIO device support

SDIO support in this driver was intended to support the iwmc3200
device.  This hardware never became available to normal humans.
Leaving this driver imposes unwelcome maintenance costs for no clear
benefit.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Inaky Perez-Gonzalez <inaky.perez-gonzalez@intel.com>
12 years agobcma: add PMU clock support for BCM4706
Hauke Mehrtens [Mon, 9 Jul 2012 20:03:10 +0000 (22:03 +0200)]
bcma: add PMU clock support for BCM4706

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Tested-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobcma: fix CC driver compilation on MIPS
Rafał Miłecki [Mon, 9 Jul 2012 17:34:59 +0000 (19:34 +0200)]
bcma: fix CC driver compilation on MIPS

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00: remove unused argument
Stanislaw Gruszka [Mon, 9 Jul 2012 15:24:50 +0000 (17:24 +0200)]
rt2x00: remove unused argument

Data pointer on rt2x00queue_for_each_entry() is never used - remove it.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2800lib: merge same defines
Stanislaw Gruszka [Mon, 9 Jul 2012 12:41:48 +0000 (14:41 +0200)]
rt2800lib: merge same defines

Merge 3290 and 5390 POWER_BOUND and FREQ_OFFSET_BOUND defines.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agort2x00pci: small 3290 changes cleanup
Stanislaw Gruszka [Mon, 9 Jul 2012 12:41:47 +0000 (14:41 +0200)]
rt2x00pci: small 3290 changes cleanup

Fix indention and remove unnecessary brackets and compares.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocarl9170: fix HT peer BA session corruption
Christian Lamparter [Sat, 7 Jul 2012 19:13:59 +0000 (21:13 +0200)]
carl9170: fix HT peer BA session corruption

This patch adds an alternative tx status path
for BlockAck Requests as the hardware doesn't
recognize that a BlockAck Requests is usually
acked with a BlockAck and not a legacy ACK.

Without this patch, the stack would constantly
resent old and stale BARs. So, depending on the
receiver stack, this could lead to:

 - "stuck" ba sessions and package loss, as the
   stale BAR would reset the sequence each time.

 - lots of reorder releases.

 - ...

Reported-by: Sean Patrick Santos <quantheory@gmail.com>
Reported-by: Mikołaj Kuligowski <mikolaj.q@wp.pl>
Reported-by: Per-Erik Westerberg <per-erik.westerberg@bredband.net>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agocarl9170: import 1.9.6 firmware headers
Christian Lamparter [Sat, 7 Jul 2012 16:01:53 +0000 (18:01 +0200)]
carl9170: import 1.9.6 firmware headers

Import new headers from my firmware branch:
<https://github.com/chunkeey/carl9170fw>

visit our wiki at:
<http://wireless.kernel.org/en/users/Drivers/carl9170.fw>

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agoath9k_hw: remove debugging masks from AR_MCI_INTERRUPT_RX_MSG_DEFAULT
Rajkumar Manoharan [Sun, 8 Jul 2012 07:23:16 +0000 (12:53 +0530)]
ath9k_hw: remove debugging masks from AR_MCI_INTERRUPT_RX_MSG_DEFAULT

Remove the CONT_* and LNA_* messages from
AR_MCI_INTERRUPT_RX_MSG_DEFAULT. Those MCI rx messages only
meant for debugging purpose. Including them in default rx_msg
series could raise huge amount of MCI interrupts when BT traffic
is going on. And also it increases power consumption when WLAN
is scanning.

Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: handle non PCI devices in the phy code
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:21 +0000 (15:16 +0200)]
brcmsmac: handle non PCI devices in the phy code

Some code in write_{radio,radio}_reg() should just be run if this is a
pci based device. Add the condition again which was removed in commit:
commit 821e4e93172e4f7d5ac1eade04665c3dc5049c4a
Author: Roland Vossen <rvossen@broadcom.com>
Date:   Mon Aug 8 15:58:58 2011 +0200

    staging: brcm80211: removed unused bus code from softmac

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>
12 years agobrcmsmac: fix read in write_phy_reg
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:20 +0000 (15:16 +0200)]
brcmsmac: fix read in write_phy_reg

This reverts a unintended change mad in commit.
commit 4b006b11ca18995677c5f1cd03cc9c42fbe80693
Author: Arend van Spriel <arend@broadcom.com>
Date:   Thu Dec 8 15:06:54 2011 -0800

    brcm80211: smac: use bcma functions for register access in phy code

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: extend brcms_c_chipmatch() to also handle non PCIe devices
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:19 +0000 (15:16 +0200)]
brcmsmac: extend brcms_c_chipmatch() to also handle non PCIe devices

Now brcms_c_chipmatch() is also able to handle non PCI devices and also
does some checking for SoC if they are supported by brcmsmac.

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>
12 years agobrcmsmac: fix DMA on SoCs
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:18 +0000 (15:16 +0200)]
brcmsmac: fix DMA on SoCs

These extra offsets are only needed by PCIe devices and not when
running on an SoC.

This partly reverts commit:
commit 821e4e93172e4f7d5ac1eade04665c3dc5049c4a
Author: Roland Vossen <rvossen@broadcom.com>
Date:   Mon Aug 8 15:58:58 2011 +0200

    staging: brcm80211: removed unused bus code from softmac

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>
12 years agobrcmsmac: extend xmtfifo_sz array
Hauke Mehrtens [Mon, 2 Jul 2012 18:15:51 +0000 (20:15 +0200)]
brcmsmac: extend xmtfifo_sz array

The xmtfifo_sz array contains the queue sizes for the different core
revs. This array missed the sizes for the core rev 17 and 28. This
patch extends the array to also include these sizes and adds a warning
if no queue size is stored in the array for the given core rev.

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>
12 years agobrcmsmac: add some workarounds for other chips again
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:16 +0000 (15:16 +0200)]
brcmsmac: add some workarounds for other chips again

This adds some workarounds for the BCM4716, BCM47162, BCM5357 to the
phy code again. This patch reverts parts of the following patch.

commit c2c724977f95135f397fe0cb45f3c041d26b91e1
Author: Arend van Spriel <arend@broadcom.com>
Date:   Wed Jun 29 16:46:35 2011 -0700

    staging: brcm80211: remove unsupported chipset code from brcmsmac phy

The BCM4716 is working for me with an other firmware and I am working
on adding support for the other chips.

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>
12 years agobrcmsmac: add a conditions for core rev 17 again
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:15 +0000 (15:16 +0200)]
brcmsmac: add a conditions for core rev 17 again

This reverts some changes made in this commit:
commit 7234592364e2efe8b4ac1040c99b1d7ef01cf502
Author: Roland Vossen <rvossen@broadcom.com>
Date:   Mon Feb 14 12:16:45 2011 +0100

    staging: brcm80211: removal of inactive d11 code

The bcm4716 has a rev 17 wireless core and this condition is needed.

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>
12 years agobrcmsmac: remove some unnessessacry casts and void pointer
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:14 +0000 (15:16 +0200)]
brcmsmac: remove some unnessessacry casts and void pointer

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: use chip and package id constants from bcma
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:13 +0000 (15:16 +0200)]
brcmsmac: use chip and package id constants from bcma

This patch depends on addin the chip IDs to bcma done in this commit in
my pending patch series for bcma.
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Sun Jun 3 18:17:57 2012 +0200

    bcma: add constants for chip ids

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: use core id constants from bcma
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:12 +0000 (15:16 +0200)]
brcmsmac: use core id constants from bcma

This patch depends on adding the IDs to bcma done in
this commit in my pending patch series for bcma.
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Sun Jun 3 18:17:57 2012 +0200

    bcma: add constants for chip ids

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: remove some redundant chip common workarounds
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:11 +0000 (15:16 +0200)]
brcmsmac: remove some redundant chip common workarounds

The removed workarounds are already performed in bcma_pmu_workarounds()
and bcma_core_chipcommon_init()

This patch depends on the completion of the workarounds in bcma done in
this commit in my pending patch series for bcma.
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Mon Jun 4 00:20:26 2012 +0200

    bcma: complete workaround for BCMA43224 and BCM4313

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: remove si_pmu_spuravoid_pllupdate()
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:10 +0000 (15:16 +0200)]
brcmsmac: remove si_pmu_spuravoid_pllupdate()

si_pmu_spuravoid_pllupdate() is now replaced by
bcma_pmu_spuravoid_pllupdate() which does the same thing, but supports
more chips.

This function is in my pending patch series for bcma.
Author: Hauke Mehrtens <hauke@hauke-m.de>
Date:   Mon Jun 4 01:31:32 2012 +0200

    bcma: add bcma_pmu_spuravoid_pllupdate()

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: remove si_pmu_init() and si_pmu_res_init()
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:09 +0000 (15:16 +0200)]
brcmsmac: remove si_pmu_init() and si_pmu_res_init()

This is already done by bcma_pmu_init() and bcma_pmu_resources_init() in bcma.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: remove ai_findcore()
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:08 +0000 (15:16 +0200)]
brcmsmac: remove ai_findcore()

bcma also stores a pointer to the chipcommon core in its struct,
brcmsmac should use it and not search for the core by its own.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: use container_of instead of cast
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:07 +0000 (15:16 +0200)]
brcmsmac: use container_of instead of cast

Now "struct si_pub pub" does not have to be the first member in struct
si_info any more, if it is the resulting code after compilation should
be the same.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: remove ai_get_buscore{type,rev}()
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:06 +0000 (15:16 +0200)]
brcmsmac: remove ai_get_buscore{type,rev}()

These two functions are not used any more.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: remove PCI_FORCEHT() macro
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:05 +0000 (15:16 +0200)]
brcmsmac: remove PCI_FORCEHT() macro

The BCM4716 is a SoC and does not have a PCI client interface, so this
condition is never true.

Acked-by: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
12 years agobrcmsmac: remove PCIE() macro
Hauke Mehrtens [Sat, 30 Jun 2012 13:16:04 +0000 (15:16 +0200)]
brcmsmac: remove PCIE() macro

Instead of checking if there is a PCIe core on the bus, better check if
hosttype is PCIe.

In the original submission to staging PCIE() checked, if the bustype is
PCI and the buscore is a PCIe core. Now we assume that all cores bcma
supports are PCIe based, so we just have to check if the bustype is PCI.

The old code bcmsmac currently uses searches for a PCIe core on the bus
and if there is one assumes that this is the buscore, which is wrong.
Some SoCs have a PCIe core operating in host mode and this is not the
bus core. The old code also caused a null pointer in
ai_get_buscoretype() and ai_get_buscorerev() if buscore was not set
because there was no PCIe core on the bus.

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>
12 years agoiwmc3200wifi: remove driver for unavailable hardware
John W. Linville [Tue, 26 Jun 2012 19:10:12 +0000 (15:10 -0400)]
iwmc3200wifi: remove driver for unavailable hardware

This hardware never became available to normal humans.  Leaving this
driver imposes unwelcome maintenance costs for no clear benefit.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agowlcore: fix a couple small memory leaks
Dan Carpenter [Sat, 30 Jun 2012 12:07:55 +0000 (15:07 +0300)]
wlcore: fix a couple small memory leaks

We should free "chunk" here before returning the error code.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: determine AP extra rates correctly
Arik Nemtsov [Thu, 5 Jul 2012 12:23:02 +0000 (15:23 +0300)]
wlcore: determine AP extra rates correctly

Don't use the ht_mode module parameter for determining AP supported
rates. We can rely on channel type, since HT40 won't be enabled if our
HT cap doesn't support it.

Enable MIMO only if there enough antennas, and rely on per-peer rate
limitation to prevent IOPs.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: check ssid length against the correct element
Eliad Peller [Tue, 3 Jul 2012 12:51:20 +0000 (15:51 +0300)]
wlcore: check ssid length against the correct element

commit 587cc28 ("wlcore: compare ssid_len before comparing
ssids") introduced a new bug - the ssid length from the
request struct was compared against the ssid length of
another request, instead the one of the cmd.

This might cause the sched scan request to fail
(with -EINVAL) in many cases.

Signed-off-by: Eliad Peller <eliad@wizery.com>
12 years agowl12xx/wl18xx: use a dynamic PS timeout of 1.5sec
Arik Nemtsov [Tue, 3 Jul 2012 08:34:43 +0000 (11:34 +0300)]
wl12xx/wl18xx: use a dynamic PS timeout of 1.5sec

It seems some parties have bad user experience when smaller values
are used. This should have little implications for power consumption,
since traffic is bursty in nature.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: define number of supported bands internally
Arik Nemtsov [Tue, 3 Jul 2012 06:11:03 +0000 (09:11 +0300)]
wlcore: define number of supported bands internally

Avoid using the IEEE80211_NUM_BANDS constant for arrays sizes etc, as
this can contain bands unsupported by the driver (e.g. 60Ghz). Use an
internal constant to determine the number of bands.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: don't set SDIO_FAILED flag when driver state is off
Arik Nemtsov [Tue, 3 Jul 2012 06:00:18 +0000 (09:00 +0300)]
wlcore: don't set SDIO_FAILED flag when driver state is off

If some IO read/write fails while the FW is not loaded, a recovery
will not take place. This means the SDIO_FAILED flag will stay in place
forever and prevent further read/writes.

This can happen if a check for STATE_OFF was forgotten in some routine.

Take this opportunity to rename the flag to IO_FAILED, since we support
other buses as well.

Reported-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: change the wait for event mechanism
Yoni Divinsky [Wed, 27 Jun 2012 18:35:47 +0000 (21:35 +0300)]
wlcore: change the wait for event mechanism

wlcore needs to wait for certain events for example
for roc complete event. Usually the events are received
from the FW very fast, therefore wlcore can poll with
a short delay and if after a second the event was
not received yet poll with a long (1-5 msec) delay.

This implementation is similar to the sending of
commands to the FW.

Empirically the change reduced the wait for roc event
from ~10-40msec to 100s of usecs.

[replace udelay/msleep with usleep_range - Arik]

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: Prevent processing of work items during op_stop
Ido Yariv [Tue, 26 Jun 2012 18:08:58 +0000 (21:08 +0300)]
wlcore: Prevent processing of work items during op_stop

The interrupt line is disabled in op_stop using disable_irq. Since
pending interrupts are synchronized, the mutex has to be released before
disabling the interrupt to avoid a deadlock with the interrupt handler.

In addition, the internal state of the driver is only set to 'off'
after the interrupt is disabled. Otherwise, if an interrupt fires after
the state is set but before the interrupt line is disabled, the
interrupt handler will not be able to acknowledge the interrupt
resulting in an interrupt storm.

The driver's operations might be called during recovery. If these
acquire the mutex after it was released by op_stop, but before the
driver's state is changed, they may queue new work items instead of just
failing. This is especially problematic in the case of scans, in which a
new scan may be scheduled after all scan requests were cancelled.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
12 years agowlcore: implement .flush callback
Eliad Peller [Mon, 25 Jun 2012 10:52:33 +0000 (13:52 +0300)]
wlcore: implement .flush callback

implement the .flush() callback by simply calling wl1271_tx_flush().

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowl12xx/wlcore: increase FW filename version
Luciano Coelho [Wed, 27 Jun 2012 12:21:10 +0000 (15:21 +0300)]
wl12xx/wlcore: increase FW filename version

We have some API changes and new features in the new firmwares that
are not compatible with older drivers.  Increase the version of the FW
filenames for wl12xx to 5.

Additionally, remove the duplicate definitions from wlcore_i.h and
remove the MODULE_FIRMWARE macro calls from the SDIO and SPI modules,
since they're irrelevant there.

Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: add probe request templates for sched and one-shot scans
Yoni Divinsky [Wed, 27 Jun 2012 10:01:44 +0000 (13:01 +0300)]
wlcore: add probe request templates for sched and one-shot scans

The driver configures the firmware template for probe requests during
the scan process.  If the same template is used for one-shot and sched
scans they will override each other when running scans simultaneously.

This fix works only on firmwares later than X.3.9.2.112 for single
role and X.3.9.2.23 for multi-role.

[Some cleaning-up and renaming of the quirk to something smaller --
Luca.]

Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: always clear recovery flag during recovery_work
Arik Nemtsov [Mon, 25 Jun 2012 19:26:20 +0000 (22:26 +0300)]
wlcore: always clear recovery flag during recovery_work

If recovery is called when the FW is off, we should clear the recovery
flag. Otherwise we risk booting the driver in permanent pending-recovery
state.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: avoid debug prints during intended FW recovery
Arik Nemtsov [Mon, 25 Jun 2012 19:26:19 +0000 (22:26 +0300)]
wlcore: avoid debug prints during intended FW recovery

Don't read the FW panic log or print other debug data when recovery is
intended (i.e. FW type switch). This takes valuable time and can be
confusing to the user.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: remove recover cmd from testmode
Arik Nemtsov [Mon, 25 Jun 2012 19:26:18 +0000 (22:26 +0300)]
wlcore: remove recover cmd from testmode

This command is buggy (doesn't take the mutex) and unused. Instead, the
"start_recovery" file is used for the same purpose. Remove the code but
keep the command constant to avoid breaking the testmode ABI.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: don't stop tx queue via watermark if already stopped
Arik Nemtsov [Mon, 25 Jun 2012 19:26:17 +0000 (22:26 +0300)]
wlcore: don't stop tx queue via watermark if already stopped

If a Tx queue is currently stopped because of our Tx watermark flow
control, don't stop it again. This causes a warning to appear.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore/wl12xx/wl18xx: check min FW version
Arik Nemtsov [Mon, 25 Jun 2012 14:46:40 +0000 (17:46 +0300)]
wlcore/wl12xx/wl18xx: check min FW version

Refuse to boot if the FW version is too old. The minimum version is set
per chip, with the option of setting it per PG in the future.

When boot fails because of an old FW, display a helpful message.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agowlcore: enable sched scan while connected
Victor Goldenshtein [Thu, 14 Jun 2012 06:47:40 +0000 (09:47 +0300)]
wlcore: enable sched scan while connected

New wl12xx firmware supports scheduled scans also while connected.
Stop blocking sched scan requests when connected and add a quirk to
block in hardware that don't support it (currently wl18xx doesn't).

This requires FW version 6/7.3.10.2.112 for single-role and
6/7.5.6.0.25 for multi-role.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
12 years agoNFC: Check for llcp_sock and its device from llcp_sock_getname
Samuel Ortiz [Thu, 5 Jul 2012 15:43:08 +0000 (17:43 +0200)]
NFC: Check for llcp_sock and its device from llcp_sock_getname

They both can potentially be NULL.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add ISO 14443 type B protocol
Samuel Ortiz [Tue, 3 Jul 2012 22:14:04 +0000 (00:14 +0200)]
NFC: Add ISO 14443 type B protocol

Some devices (e.g. Sony's PaSoRi) can not do type B polling, so we have
to make a distinction between ISO14443 type A and B poll modes.

Cc: Eric Lapuyade <eric.lapuyade@intel.com>
Cc: Ilan Elias <ilane@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Use communicate thru only for PaSoRi when trying to read Felica tags
Samuel Ortiz [Tue, 3 Jul 2012 21:45:26 +0000 (23:45 +0200)]
NFC: Use communicate thru only for PaSoRi when trying to read Felica tags

Otherwise DATA_EXCHANGE seems to be just fine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add initial Sony RC-S360 support to pn533
Samuel Ortiz [Mon, 2 Jul 2012 18:04:01 +0000 (20:04 +0200)]
NFC: Add initial Sony RC-S360 support to pn533

Sony RC-S360 is also known as the Sony PaSoRi contactless reader.
Only type 2, 3 and 4 tag reading is supported at the moment.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Dereference LLCP bind socket address after checking for it to be NULL
Samuel Ortiz [Fri, 29 Jun 2012 10:03:55 +0000 (12:03 +0200)]
NFC: Dereference LLCP bind socket address after checking for it to be NULL

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Do not return EBUSY when stopping a poll that's already stopped
Samuel Ortiz [Thu, 28 Jun 2012 14:41:57 +0000 (16:41 +0200)]
NFC: Do not return EBUSY when stopping a poll that's already stopped

We check for the polling flag before checking if the netlink PID caller
match.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Remove warning from nfc_llcp_local_put
Samuel Ortiz [Wed, 27 Jun 2012 10:23:48 +0000 (12:23 +0200)]
NFC: Remove warning from nfc_llcp_local_put

The socket local pointer can be NULL when a socket is created but never
bound or connected.

Reported-by: Sasha Levin <levinsasha928@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Handle LLCP Disconnected Mode frames
Samuel Ortiz [Tue, 26 Jun 2012 14:13:29 +0000 (16:13 +0200)]
NFC: Handle LLCP Disconnected Mode frames

When receiving such frame, the sockets waiting for a connection to finish
should be woken up. Connecting to an unbound LLCP service will trigger a
DM as a response.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: LLCP late binding
Samuel Ortiz [Mon, 25 Jun 2012 13:46:28 +0000 (15:46 +0200)]
NFC: LLCP late binding

With the LLCP 16 local SAPs we can potentially quickly run out of source
SAPs for non well known services.
With the so called late binding we will reserve an SAP only when we actually
get a client connection for a local service. The SAP will be released once
the last client is gone, leaving it available to other services.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Forbid SSAP binding to a not well known LLCP service
Samuel Ortiz [Fri, 22 Jun 2012 15:15:20 +0000 (17:15 +0200)]
NFC: Forbid SSAP binding to a not well known LLCP service

With not Well Known Services there is no guarantees as to which
SSAP the server will be listening on, so there is no reason to
support binding to a specific source SAP.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Forbid LLCP service name reusing
Samuel Ortiz [Fri, 22 Jun 2012 13:32:20 +0000 (15:32 +0200)]
NFC: Forbid LLCP service name reusing

This patch fixes a typo and return the correct error when trying to
bind 2 sockets to the same service name.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Release LLCP SAP when the owner is released
Samuel Ortiz [Fri, 22 Jun 2012 12:48:11 +0000 (14:48 +0200)]
NFC: Release LLCP SAP when the owner is released

The LLCP SAP should only be freed when the socket owning it is released.
As long as the socket is alive, the SAP should be reserved in order to
e.g. send the right wks array when bringing the MAC up.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Close listening LLCP sockets when the device is gone
Samuel Ortiz [Fri, 22 Jun 2012 12:40:34 +0000 (14:40 +0200)]
NFC: Close listening LLCP sockets when the device is gone

When the MAC link goes down, we should only keep the bound sockets
alive. They will be closed by sock_release or when the underlying
NFC device is moving away.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Build LLCP general bytes upon request
Samuel Ortiz [Fri, 22 Jun 2012 00:04:53 +0000 (02:04 +0200)]
NFC: Build LLCP general bytes upon request

Drivers will need them before starting a poll or when being activated
as targets. Mostly WKS can have changed between device registration and
then so we need to re-build the whole array.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Fix LLCP getname socket op
Samuel Ortiz [Thu, 21 Jun 2012 15:41:42 +0000 (17:41 +0200)]
NFC: Fix LLCP getname socket op

Set the right target index and use a better socket declaration routine.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Update LLCP socket target index when getting a connection
Samuel Ortiz [Mon, 18 Jun 2012 19:38:09 +0000 (21:38 +0200)]
NFC: Update LLCP socket target index when getting a connection

Getting a valid CONNECT means we have a valid target index.

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add netlink module alias for NFC
Samuel Ortiz [Tue, 12 Jun 2012 14:54:16 +0000 (16:54 +0200)]
NFC: Add netlink module alias for NFC

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Add modules alias for NFC sockets
Samuel Ortiz [Mon, 11 Jun 2012 22:35:50 +0000 (00:35 +0200)]
NFC: Add modules alias for NFC sockets

Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Allow HCI driver to pre-open pipes to some gates
Eric Lapuyade [Tue, 5 Jun 2012 12:42:11 +0000 (14:42 +0200)]
NFC: Allow HCI driver to pre-open pipes to some gates

Some NFC chips will statically create and open pipes for both standard
and proprietary gates. The driver can now pass this information to HCI
such that HCI will not attempt to create and open them, but will instead
directly use the passed pipe ids.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: update PN544 HCI driver state when opened/closed
Eric Lapuyade [Wed, 30 May 2012 16:13:06 +0000 (18:13 +0200)]
NFC: update PN544 HCI driver state when opened/closed

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: Error management documentation
Eric Lapuyade [Thu, 3 May 2012 09:49:30 +0000 (11:49 +0200)]
NFC: Error management documentation

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: nfc_driver_failure() implementation
Eric Lapuyade [Mon, 11 Jun 2012 13:52:38 +0000 (15:52 +0200)]
NFC: nfc_driver_failure() implementation

If the device is polling we sent a 0 target found event.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
12 years agoNFC: nfc_targets_found() should accept zero target found
Eric Lapuyade [Thu, 3 May 2012 14:33:32 +0000 (16:33 +0200)]
NFC: nfc_targets_found() should accept zero target found

The semantics for a zero target found event is that the polling operation
could not complete.

Signed-off-by: Eric Lapuyade <eric.lapuyade@intel.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>