firefly-linux-kernel-4.4.55.git
13 years agoairo: correct proc entry creation interfaces
Alexey Dobriyan [Fri, 13 May 2011 21:12:48 +0000 (00:12 +0300)]
airo: correct proc entry creation interfaces

* use proc_mkdir_mode() instead of create_proc_entry(S_IFDIR|...),
  export proc_mkdir_mode() for that, oh well.
* don't supply S_IFREG to proc_create_data(), it's unnecessary

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agop54usb: add zoom 4410 usbid
Christian Lamparter [Fri, 13 May 2011 19:47:23 +0000 (21:47 +0200)]
p54usb: add zoom 4410 usbid

Cc: <stable@kernel.org>
Reported-by: Mark Davis <marked86@gmail.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'wireless-next-2.6' of git://git.kernel.org/pub/scm/linux/kernel/git...
John W. Linville [Mon, 16 May 2011 18:21:02 +0000 (14:21 -0400)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6

13 years agomwifiex: use ieee80211_amsdu_to_8023s routine
Yogesh Ashok Powar [Fri, 13 May 2011 18:22:32 +0000 (11:22 -0700)]
mwifiex: use ieee80211_amsdu_to_8023s routine

mwifiex was using its own implementation of converting 802.11n
AMSDU to 802.3s.  This patch removes mwifiex specific
implementation and uses existing ieee80211_amsdu_to_8023s
routine.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: make stripping of 802.11 header optional from AMSDU
Yogesh Ashok Powar [Fri, 13 May 2011 18:22:31 +0000 (11:22 -0700)]
cfg80211: make stripping of 802.11 header optional from AMSDU

Currently the devices that have already stripped IEEE 802.11
header from the AMSDU SKB can not use ieee80211_amsdu_to_8023s
routine. This patch enhances ieee80211_amsdu_to_8023s() API by
changing mandatory removing of IEEE 802.11 header from AMSDU
to optional.

Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: Move peer link state definition to nl80211
Javier Cardona [Fri, 13 May 2011 17:45:43 +0000 (10:45 -0700)]
nl80211: Move peer link state definition to nl80211

These definitions need to be exposed now that we can set the peer link
states via NL80211_ATTR_STA_PLINK_STATE.  They were already being
(opaquely) reported by NL80211_STA_INFO_PLINK_STATE.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: make npending frames check as bool
Mohammed Shafi Shajakhan [Fri, 13 May 2011 15:29:42 +0000 (20:59 +0530)]
ath9k: make npending frames check as bool

we are not doing anything by tracking the number of pending frames.
bail out when we first find a pending frame in any one of the 10 queues.

Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: make sure main_rssi is positive
Mohammed Shafi Shajakhan [Fri, 13 May 2011 15:01:40 +0000 (20:31 +0530)]
ath9k: make sure main_rssi is positive

some times the rssi control descriptor for the main antenna may be
negative like that of alternate antenna, hence before  incrementing
packet counts/rssi of main/alternate antenna make sure both main_rssi
and alt_rssi are positive only. this avoids wrong selection of antenna
due to diversity

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: configure fast_div_bias based on diversity group
Mohammed Shafi Shajakhan [Fri, 13 May 2011 15:01:23 +0000 (20:31 +0530)]
ath9k: configure fast_div_bias based on diversity group

configure fast diversity bias based on the antenna diversity group and
based on main/alt LNA configurations. also configure main antenna and
alternate antenna to gain-table 0 for diversity group 2(AR9485)

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: Implement an API to swap main/ALT LNA's
Mohammed Shafi Shajakhan [Fri, 13 May 2011 15:01:09 +0000 (20:31 +0530)]
ath9k: Implement an API to swap main/ALT LNA's

for the diversity group 2(AR9485) we swap the LNA's of main/ALT antenna
based on alternate antenna's rssi average in comparision with main
antenna's rssi, while for AR9285(antenna diversity group 0)we still
follow the older method of looking at the packet count in alternate
antenna

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: define antenna diversity group
Mohammed Shafi Shajakhan [Fri, 13 May 2011 15:00:56 +0000 (20:30 +0530)]
ath9k_hw: define antenna diversity group

AR9285 belongs to diversity group 0 and AR9485 belongs to diversity
group 2. Based on the diversity group we configure certain antenna
diversity paramaters such as lna1_lna2_delta and fast diversity
bias values. For AR9485 we have some gain table parameter which
selects the gain table 0/1 for main and alternate antenna

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: define modules to get/set Antenna diversity paramaters
Mohammed Shafi Shajakhan [Fri, 13 May 2011 15:00:41 +0000 (20:30 +0530)]
ath9k_hw: define modules to get/set Antenna diversity paramaters

these are the two important modules that will be called by the antenna
diversity algorithm module in the rx. this will continuosly configure
the hardware based on the current diversity status obtained
from the algorithm

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: config diversity based on eeprom contents
Mohammed Shafi Shajakhan [Fri, 13 May 2011 15:00:27 +0000 (20:30 +0530)]
ath9k_hw: config diversity based on eeprom contents

* enable LNA-diversity, fast-diversity for AR9485 based  on
  the value read from EEPROM content
* if antenna diversity/combining is supported, set LNA1 for the main
  antenna and LNA2 for the alternate antenna based on the new diversity
  algorithm

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Cc: Luis Rodriguez <Luis.Rodriguez@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: define registers/macros to support Antenna diversity
Mohammed Shafi Shajakhan [Fri, 13 May 2011 14:59:53 +0000 (20:29 +0530)]
ath9k_hw: define registers/macros to support Antenna diversity

define few registers and macros to configure/enable Antenna diversity
parameters in AR9485

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: enable Antenna diversity for AR9485
Mohammed Shafi Shajakhan [Fri, 13 May 2011 14:59:31 +0000 (20:29 +0530)]
ath9k_hw: enable Antenna diversity for AR9485

read antenna diversity and combining information from the EEPROM.
Enable antenna diversity/combining feature only when both LNA
diversity and fast diversity are supported

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Tested-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: make antenna diversity modules chip specific
Mohammed Shafi Shajakhan [Fri, 13 May 2011 14:59:04 +0000 (20:29 +0530)]
ath9k_hw: make antenna diversity modules chip specific

this is necessary to support Antenna diversity and combining in new chip
sets such as AR9485, previously Antenna diversity support is available
only in AR9285

Cc: Gabriel Tseng <Gabriel.Tseng@Atheros.com>
Cc: Senthilkumar Balasubramanian <Senthilkumar.Balasubramanian@Atheros.com>
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonet/rfkill/core.c: Avoid leaving freed data in a list
Julia Lawall [Fri, 13 May 2011 13:52:10 +0000 (15:52 +0200)]
net/rfkill/core.c: Avoid leaving freed data in a list

The list_for_each_entry loop can fail, in which case the list element is
not removed from the list rfkill_fds.  Since this list is not accessed by
the loop, the addition of &data->list into the list is just moved after the
loop.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
expression E,E1,E2;
identifier l;
@@

*list_add(&E->l,E1);
... when != E1
    when != list_del(&E->l)
    when != list_del_init(&E->l)
    when != E = E2
*kfree(E);// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: sparse RCU annotations
Johannes Berg [Fri, 13 May 2011 12:15:49 +0000 (14:15 +0200)]
mac80211: sparse RCU annotations

This adds sparse RCU annotations to most of
mac80211, only the mesh code remains to be
done.

Due the the previous patches, the annotations
are pretty simple. The only thing that this
actually changes is removing the RCU usage of
key->sta in debugfs since this pointer isn't
actually an RCU-managed pointer (it only has
a single assignment done before the key even
goes live). As that is otherwise harmless, I
decided to make it part of this patch.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix TX a-MPDU locking
Johannes Berg [Fri, 13 May 2011 11:35:40 +0000 (13:35 +0200)]
mac80211: fix TX a-MPDU locking

During my quest to make mac80211 not have any RCU
warnings from sparse, I came across the a-MPDU code
again and it wasn't quite clear why it isn't racy.
So instead of assigning the tid_tx array with just
the spinlock held in ieee80211_start_tx_ba_session
use a separate temporary array protected only by
the spinlock and protect all assignments to the
"live" array by both the spinlock and the mutex so
that other code is easily verified to be correct.

Due to pointer assignment atomicity I don't think
this is a real issue, but I'm not sure, especially
on Alpha the current code might be problematic.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: advertise possible interface combinations
Johannes Berg [Fri, 13 May 2011 08:58:57 +0000 (10:58 +0200)]
cfg80211: advertise possible interface combinations

Add the ability to advertise interface combinations in nl80211.
This allows the driver to indicate what the combinations are
that it supports. "Combinations" of just a single interface are
implicit, as previously. Note that cfg80211 will enforce that
the restrictions are met, but not for all drivers yet (once all
drivers are updated, we can remove the flag and enforce for all).

When no combinations are actually supported, an empty list will
be exported so that userspace can know if the kernel exported
this info or not (although it isn't clear to me what tools using
the info should do if the kernel didn't export it).

Since some interface types are purely virtual/software and don't
fit the restrictions, those are exposed in a new list of pure SW
types, not subject to restrictions. This mainly exists to handle
AP-VLAN and monitor interfaces in mac80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlwifi: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning
Stephen Boyd [Thu, 12 May 2011 23:50:05 +0000 (16:50 -0700)]
iwlwifi: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning

Enabling DEBUG_STRICT_USER_COPY_CHECKS causes the following
warning:

In file included from arch/x86/include/asm/uaccess.h:573,
                 from include/net/checksum.h:25,
                 from include/linux/skbuff.h:28,
                 from drivers/net/wireless/iwlwifi/iwl-agn-rs.c:28:
In function 'copy_from_user',
    inlined from 'rs_sta_dbgfs_scale_table_write' at
    drivers/net/wireless/iwlwifi/iwl-agn-rs.c:3099:
arch/x86/include/asm/uaccess_64.h:65:
warning: call to 'copy_from_user_overflow' declared with
attribute warning: copy_from_user() buffer size is not provably
correct

presumably due to buf_size being signed causing GCC to fail to
see that buf_size can't become negative.

Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlegacy: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning
Stephen Boyd [Thu, 12 May 2011 23:50:04 +0000 (16:50 -0700)]
iwlegacy: Silence DEBUG_STRICT_USER_COPY_CHECKS=y warning

Enabling DEBUG_STRICT_USER_COPY_CHECKS causes the following
warning:

In file included from arch/x86/include/asm/uaccess.h:573,
                 from include/net/checksum.h:25,
                 from include/linux/skbuff.h:28,
                 from drivers/net/wireless/iwlegacy/iwl-4965-rs.c:28:
In function 'copy_from_user',
    inlined from 'iwl4965_rs_sta_dbgfs_scale_table_write' at
    drivers/net/wireless/iwlegacy/iwl-4965-rs.c:2616:
arch/x86/include/asm/uaccess_64.h:65:
warning: call to 'copy_from_user_overflow' declared with
attribute warning: copy_from_user() buffer size is not provably
correct

presumably due to buf_size being signed causing GCC to fail to
see that buf_size can't become negative.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'for-linville' of git://git.kernel.org/pub/scm/linux/kernel/git/luca...
John W. Linville [Fri, 13 May 2011 19:18:35 +0000 (15:18 -0400)]
Merge branch 'for-linville' of git://git./linux/kernel/git/luca/wl12xx

13 years agossb: fix pcicore build breakage
John W. Linville [Fri, 13 May 2011 13:23:47 +0000 (09:23 -0400)]
ssb: fix pcicore build breakage

drivers/ssb/main.c:1336: error: 'SSB_PCICORE_BCAST_ADDR' undeclared (first use in this function)
drivers/ssb/main.c:1337: error: 'SSB_PCICORE_BCAST_DATA' undeclared (first use in this function)
drivers/ssb/main.c:1349: error: 'struct ssb_pcicore' has no member named 'dev'

Reported-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoiwlagn: remove unused old_assoc parameter
Wey-Yi Guy [Wed, 11 May 2011 15:33:55 +0000 (08:33 -0700)]
iwlagn: remove unused old_assoc parameter

old_assoc not used, remove it

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: change default beacon interval
Johannes Berg [Wed, 11 May 2011 15:17:20 +0000 (08:17 -0700)]
iwlagn: change default beacon interval

When the PAN context is active, but unused, it
may still block scans that take more dwell time
than its beacon interval (which is odd). Work
around this problem by using a default beacon
interval of 200 so scans will fit between.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: remove set but unused vars
Johannes Berg [Wed, 11 May 2011 10:29:25 +0000 (03:29 -0700)]
iwlagn: remove set but unused vars

gcc is warning that a few variables in rate
scaling are set but never otherwise used.
This pointed out a few simplifications.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: alwasy send RXON with disassociate falge before associate
Wey-Yi Guy [Sat, 7 May 2011 00:06:44 +0000 (17:06 -0700)]
iwlagn: alwasy send RXON with disassociate falge before associate

Before send the RXON command with associated flag set, always do disassociate
first to make sure uCode is in the correct state.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: clear STATUS_HCMD_ACTIVE bit if fail enqueue
Wey-Yi Guy [Sat, 7 May 2011 00:06:43 +0000 (17:06 -0700)]
iwlagn: clear STATUS_HCMD_ACTIVE bit if fail enqueue

If fail to enqueue host command, clear the STATUS_hcmD_ACTIVE bit

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: add testmode set fixed rate command
Wey-Yi Guy [Wed, 4 May 2011 01:05:13 +0000 (18:05 -0700)]
iwlagn: add testmode set fixed rate command

Add support in testmode for setting fixed rate

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: add eeprom command to testmode
Wey-Yi Guy [Wed, 4 May 2011 01:05:12 +0000 (18:05 -0700)]
iwlagn: add eeprom command to testmode

Add the capability to dump eeprom through testmode request

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: add testmode trace command
Wey-Yi Guy [Fri, 6 May 2011 17:21:28 +0000 (10:21 -0700)]
iwlagn: add testmode trace command

Adding testmode trace/debug capability

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: more ucode error log info
Wey-Yi Guy [Wed, 4 May 2011 23:56:52 +0000 (16:56 -0700)]
iwlagn: more ucode error log info

No functional changes, just logging more information when uCode crash, also
change change the format.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: support multiple TBs per command
Johannes Berg [Fri, 13 May 2011 18:57:40 +0000 (11:57 -0700)]
iwlagn: support multiple TBs per command

The current "huge" command handling is a bit
confusing, and very limited since only one
command may be huge at a time. Additionally,
we often copy data around quite pointlessly
since we could instead map the existing scan
buffer for example and use it directly.

This patch makes that possible. The first
change is that multiple buffers may be given
to each command (this change was prepared
earlier so callsites don't need to change).
Each of those can be mapped attached to a TB
in the TFD, and the command header can use a
TB (the first one) in the TFD as well.

Doing this allows getting rid of huge commands
in favour of mapping existing buffers. The
beacon transmission is also optimised to not
copy the SKB at all but use multiple TBs.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: remove unused pad argument
Johannes Berg [Wed, 4 May 2011 14:50:48 +0000 (07:50 -0700)]
iwlagn: remove unused pad argument

The pad argument to iwlagn_txq_free_tfd
isn't used, remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: clean up TXQ indirection
Johannes Berg [Wed, 4 May 2011 14:50:44 +0000 (07:50 -0700)]
iwlagn: clean up TXQ indirection

All of these functions no longer need to be
accessed indirectly since they're shared in
all AGN devices.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agoiwlagn: prepare for multi-TB commands
Johannes Berg [Wed, 4 May 2011 14:50:38 +0000 (07:50 -0700)]
iwlagn: prepare for multi-TB commands

In a subsequent patch, I want to make commands use
multiple TBs in a TFD. This is a simple change to
prepare the data structures for this, with as of
now still just a single TB supported.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
13 years agowl12xx: enter/exit psm on wowlan suspend/resume
Eliad Peller [Fri, 13 May 2011 08:57:13 +0000 (11:57 +0300)]
wl12xx: enter/exit psm on wowlan suspend/resume

When operating as station, enter psm before suspending
the device into wowlan state.

Add a new completion event to signal when psm was entered
successfully.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx_sdio: declare support for NL80211_WOW_TRIGGER_ANYTHING trigger
Eliad Peller [Fri, 13 May 2011 08:57:12 +0000 (11:57 +0300)]
wl12xx_sdio: declare support for NL80211_WOW_TRIGGER_ANYTHING trigger

Since wowlan requires the ability to stay awake while the host
is suspended, declare support for NL80211_WOW_TRIGGER_ANYTHING
if the MMC_PM_KEEP_POWER capability is being supported.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: prevent scheduling while suspending (WoW enabled)
Eliad Peller [Fri, 13 May 2011 08:57:11 +0000 (11:57 +0300)]
wl12xx: prevent scheduling while suspending (WoW enabled)

When WoW is enabled, the interface will stay up and the chip will
be powered on, so we have to flush/cancel any remaining work, and
prevent the irq handler from scheduling a new work until the system
is resumed.

Add 2 new flags:
* WL1271_FLAG_SUSPENDED - the system is (about to be) suspended.
* WL1271_FLAG_PENDING_WORK - there is a pending irq work which
   should be scheduled when the system is being resumed.

In order to wake-up the system while getting an irq, we initialize
the device as wakeup device, and calling pm_wakeup_event() upon
getting the interrupt (while the system is about to be suspended)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx_sdio: set MMC_PM_KEEP_POWER flag on suspend
Eliad Peller [Fri, 13 May 2011 08:57:10 +0000 (11:57 +0300)]
wl12xx_sdio: set MMC_PM_KEEP_POWER flag on suspend

if a wow trigger was configured, set the MMC_PM_KEEP_POWER flag
on suspend, so our power will be kept while the system is suspended.

We needed to set this flag on each suspend attempt (when we want
to keep power)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: declare suspend/resume callbacks (for wowlan)
Eliad Peller [Fri, 13 May 2011 08:57:09 +0000 (11:57 +0300)]
wl12xx: declare suspend/resume callbacks (for wowlan)

Additionally, add wow_enabled field to wl, to indicate
whether wowlan was configured.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx_sdio: set interrupt as wake_up interrupt
Eliad Peller [Fri, 13 May 2011 08:57:08 +0000 (11:57 +0300)]
wl12xx_sdio: set interrupt as wake_up interrupt

set the sdio interrupt as wake_up interrupt, so we will be able
to wake up the suspended system (Wake-On-Wireless)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: remove unused flag WL1271_FLAG_IDLE_REQUESTED
Luciano Coelho [Thu, 12 May 2011 13:50:41 +0000 (16:50 +0300)]
wl12xx: remove unused flag WL1271_FLAG_IDLE_REQUESTED

This flag is not used anymore, remove it from the list.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: prevent sched_scan when not idle or not in station mode
Luciano Coelho [Thu, 12 May 2011 14:07:55 +0000 (17:07 +0300)]
wl12xx: prevent sched_scan when not idle or not in station mode

The current firmware only supports scheduled scan in station mode and
when idle.  To prevent the firmware from crashing, return -EOPNOTSUPP
when sched_scan start is called in an invalid state.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: export scheduled scan state in debugfs
Luciano Coelho [Tue, 10 May 2011 11:47:45 +0000 (14:47 +0300)]
wl12xx: export scheduled scan state in debugfs

Add the sched_scanning value to the driver_status debugfs entry.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: implement scheduled scan driver operations and reporting
Luciano Coelho [Tue, 10 May 2011 11:46:02 +0000 (14:46 +0300)]
wl12xx: implement scheduled scan driver operations and reporting

This patch adds the mac80211 operations for scheduled scan and the
scheduled scan results reporting.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: add scheduled scan structures and commands
Luciano Coelho [Tue, 10 May 2011 11:38:59 +0000 (14:38 +0300)]
wl12xx: add scheduled scan structures and commands

Add firmware command structures, definitions and code to to configure,
start and stop scheduled scans.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: listen to scheduled scan events
Luciano Coelho [Tue, 10 May 2011 11:28:27 +0000 (14:28 +0300)]
wl12xx: listen to scheduled scan events

Subscribe and listen to PERIODIC_SCAN_REPORT_EVENT_ID and
PERIODIC_SCAN_COMPLETE_EVENT_ID in preparation for the scheduled scan
implementation.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: add configuration values for scheduled scan
Luciano Coelho [Tue, 10 May 2011 11:06:31 +0000 (14:06 +0300)]
wl12xx: add configuration values for scheduled scan

Add the structures and values for driver-configured scheduled scan
parameters.

Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: add IEEE80211_HW_SPECTRUM_MGMT bit to the hw flags
Shahar Levi [Wed, 11 May 2011 09:12:56 +0000 (12:12 +0300)]
wl12xx: add IEEE80211_HW_SPECTRUM_MGMT bit to the hw flags

Set the spectrum management bit in the hw flags so that mac80211 will
set the WLAN_CAPABILITY_SPECTRUM_MGMT bit in association requests
(which in practice means that we support 802.11h spectrum management).

[Reworded the commit log -- Luca.]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: Don't filter beacons that include changed HT IEs
Shahar Levi [Wed, 11 May 2011 08:14:22 +0000 (11:14 +0300)]
wl12xx: Don't filter beacons that include changed HT IEs

This patch adds a beacon filter rule to pass up the beacons that
contain changed HT information elements.  These beacons need to be
passed to mac80211 so that it can act on such changes.

[Reworded commit log -- Luca.]

Signed-off-by: Shahar Levi <shahar_levi@ti.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agowl12xx: simplify wl1271_ssid_set()
Eliad Peller [Sun, 1 May 2011 06:56:45 +0000 (09:56 +0300)]
wl12xx: simplify wl1271_ssid_set()

Simplify wl1271_ssid_set by re-using cfg80211_find_ie instead of
reimplementing it.

Additionally, add a length check to prevent a potential buffer overflow.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
13 years agomac80211: mesh: move some code to make it static
Johannes Berg [Thu, 12 May 2011 11:38:50 +0000 (13:38 +0200)]
mac80211: mesh: move some code to make it static

There's no need to have table functions in one
file and all users in another, move the functions
to the right file and make them static. Also move
a static variable to the beginning of the file to
make it easier to find.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/mac80211: avoid bounce back mac->cfg->mac on sched_scan_stopped
Luciano Coelho [Thu, 12 May 2011 13:28:29 +0000 (16:28 +0300)]
cfg80211/mac80211: avoid bounce back mac->cfg->mac on sched_scan_stopped

When sched_scan_stopped was called by the driver, mac80211 calls
cfg80211, which in turn was calling mac80211 back with a flag
"driver_initiated".  This flag was used so that mac80211 would do the
necessary cleanup but would not call the driver.  This was enough to
prevent the bounce back between the driver and mac80211, but not
between mac80211 and cfg80211.

To fix this, we now do the cleanup in mac80211 before calling
cfg80211.  To help with locking issues, the workqueue was moved from
cfg80211 to mac80211.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix a few RCU issues
Johannes Berg [Thu, 12 May 2011 13:11:37 +0000 (15:11 +0200)]
mac80211: fix a few RCU issues

A few configuration functions correctly do
rcu_read_lock() but don't correctly reference
some pointers protected by RCU. Fix that.

Cc: stable@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix another key non-race
Johannes Berg [Thu, 12 May 2011 13:07:15 +0000 (15:07 +0200)]
mac80211: fix another key non-race

The code here is only not racy because all the
places that assign the pointers it uses are
holding the sta_mtx as well as the key_mtx and
so can't race against this because this code
holds the sta_mtx. But that's not intuitive,
so fix it to hold the key_mtx.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: make key locking clearer
Johannes Berg [Thu, 12 May 2011 12:31:49 +0000 (14:31 +0200)]
mac80211: make key locking clearer

The code in ieee80211_del_key() doesn't acquire the
key_mtx properly when it dereferences the keys. It
turns out that isn't actually necessary since the
key_mtx itself seems to be redundant since all key
manipulations are done under the RTNL, but as long
as we have the key_mtx we should use it the right
way too.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: remove pointless mesh path timer RCU code
Johannes Berg [Thu, 12 May 2011 13:03:32 +0000 (15:03 +0200)]
mac80211: remove pointless mesh path timer RCU code

The code here to RCU-dereference a pointer that's
on the stack is totally pointless, RCU isn't magic
(like say Java's weak references are), so the code
can't work like whoever wrote it thought it might.

Remove it so readers don't get confused. Note that
it seems that a bug is there anyway: I don't see
any code that cancels the timer when a mesh path
struct is destroyed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: Fix STA connection issues with AR9380 (XB113).
Senthil Balasubramanian [Thu, 12 May 2011 10:54:28 +0000 (16:24 +0530)]
ath9k_hw: Fix STA connection issues with AR9380 (XB113).

XB113 (AR9380) 3x3 SB 5G only cards were failing to connect to APs
due to incorrect xpabiaslevel configuration. fix it.

Cc: stable@kernel.org
Cc: Ray Li <ray.li@greenwavereality.com>
Cc: Kathy Giori <kathy.giori@atheros.com>
Cc: Aeolus Yang <aeolus.yang@atheros.com>
Cc: compat@orbit-lab.org
Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwifiex: remove mwifiex_recv_complete function
Amitkumar Karwar [Thu, 12 May 2011 02:47:11 +0000 (19:47 -0700)]
mwifiex: remove mwifiex_recv_complete function

The function
- increments dropped rx_packet count if status code
  passed to it is "-1".
- frees SKB buffer.

But currently the function is being called with "0" status code.
This patch replaces above function by dev_kfree_skb_any() call.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agobcma: pci: trivial: correct amount of maximum retries
Rafał Miłecki [Wed, 11 May 2011 22:01:47 +0000 (00:01 +0200)]
bcma: pci: trivial: correct amount of maximum retries

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k_hw: fix dual band assumption for XB113
Luis R. Rodriguez [Wed, 11 May 2011 21:57:26 +0000 (14:57 -0700)]
ath9k_hw: fix dual band assumption for XB113

The XB113 cards are single band, 5 GHz-only, but the
default settings were configured to assume it was dual
band. Users of these cards then would see 2.4 GHz channels
but you would never get any scan results from these channels
given that the radio is not present.

Cc: stable@kernel.org
Cc: Fiona Cain <Fiona.Cain@atheros.com>
Cc: Ray Li <ray.li@greenwavereality.com>
Cc: Kathy Giori <kathy.giori@atheros.com>
Cc: Aeolus Yang <aeolus.yang@atheros.com>
Cc: Dan Friedman <dan.friedman@atheros.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: fix contention time computation in minstrel, minstrel_ht
Daniel Halperin [Wed, 11 May 2011 02:00:45 +0000 (19:00 -0700)]
mac80211: fix contention time computation in minstrel, minstrel_ht

When transmitting a frame, the transmitter waits a random number of
slots between 0 and cw. Thus, the contention time is (cw / 2) * t_slot
which we can represent instead as (cw * t_slot) >> 1. Also fix a few
other accounting bugs around contention time, and add comments.

Signed-off-by: Daniel Halperin <dhalperi@cs.washington.edu>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: restrict AP beacon intervals
Johannes Berg [Mon, 9 May 2011 16:41:15 +0000 (18:41 +0200)]
cfg80211: restrict AP beacon intervals

Multiple virtual AP interfaces can currently try
to use different beacon intervals, but that just
leads to problems since it won't actually be done
that way by drivers. Return an error in this case
to make sure it won't be done wrong.

Also, ignore attempts to change the DTIM period
or beacon interval during the lifetime of the BSS.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/padovan/blueto...
John W. Linville [Thu, 12 May 2011 18:06:10 +0000 (14:06 -0400)]
Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth-next-2.6

13 years agomac80211: Fix mesh-related build breakage...
Yogesh Ashok Powar [Thu, 12 May 2011 13:32:17 +0000 (09:32 -0400)]
mac80211: Fix mesh-related build breakage...

net/mac80211/cfg.c: In function ‘sta_apply_parameters’:
net/mac80211/cfg.c:746: error: ‘struct sta_info’ has no member named ‘plink_state’
make[1]: *** [net/mac80211/cfg.o] Error 1
make: *** [net/mac80211/mac80211.ko] Error 2

Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoBluetooth: Remove leftover debug messages
Gustavo F. Padovan [Wed, 11 May 2011 22:26:06 +0000 (19:26 -0300)]
Bluetooth: Remove leftover debug messages

They were added by me while testing and I forgot to remove.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agoBluetooth: Add support for disconnecting LE links via mgmt
Vinicius Costa Gomes [Fri, 6 May 2011 21:41:44 +0000 (18:41 -0300)]
Bluetooth: Add support for disconnecting LE links via mgmt

If we can't find a ACL link between the devices, we search
the connection list one second time looking for LE links.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agoBluetooth: Add support for sending connection events for LE links
Vinicius Costa Gomes [Fri, 6 May 2011 21:41:43 +0000 (18:41 -0300)]
Bluetooth: Add support for sending connection events for LE links

We need to be able for receive events notifying that the connection
was established, the connection attempt failed or that disconnection
happened.

Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
13 years agocfg80211/nl80211: add interval attribute for scheduled scans
Luciano Coelho [Wed, 11 May 2011 14:09:37 +0000 (17:09 +0300)]
cfg80211/nl80211: add interval attribute for scheduled scans

Introduce NL80211_ATTR_SCHED_SCAN_INTERVAL as a required attribute for
NL80211_CMD_START_SCHED_SCAN.  This value informs the driver at which
intervals the scheduled scan cycles should be executed.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add support for HW scheduled scan
Luciano Coelho [Wed, 11 May 2011 14:09:36 +0000 (17:09 +0300)]
mac80211: add support for HW scheduled scan

Implement support for HW scheduled scan.  The mac80211 code doesn't perform
scheduled scans itself, but calls the driver to start and stop scheduled
scans.

This patch also creates a trace event class to be used by drv_hw_scan
and the new drv_sched_scan_start and drv_sched_stop functions, in
order to avoid duplicate code.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211/nl80211: add support for scheduled scans
Luciano Coelho [Wed, 11 May 2011 14:09:35 +0000 (17:09 +0300)]
cfg80211/nl80211: add support for scheduled scans

Implement new functionality for scheduled scan offload.  With this feature we
can scan automatically at certain intervals.

The idea is that the hardware can perform scan automatically and filter on
desired results without waking up the host unnecessarily.

Add NL80211_CMD_START_SCHED_SCAN and NL80211_CMD_STOP_SCHED_SCAN
commands to the nl80211 interface.  When results are available they are
reported by NL80211_CMD_SCHED_SCAN_RESULTS events.  The userspace is
informed when the scheduled scan has stopped with a
NL80211_CMD_SCHED_SCAN_STOPPED event, which can be triggered either by
the driver or by a call to NL80211_CMD_STOP_SCHED_SCAN.

Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agolibertas: Add libertas_disablemesh module parameter to disable mesh interface
Sascha Silbe [Wed, 11 May 2011 12:52:34 +0000 (14:52 +0200)]
libertas: Add libertas_disablemesh module parameter to disable mesh interface

This allows individual users and deployments to disable mesh support at
runtime, i.e. without having to build and maintain a custom kernel.

Based on a patch by Paul Fox <pgf@laptop.org>.
Signed-off-by: Sascha Silbe <silbe@activitycentral.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwifiex: cleanup ioctl.h
Bing Zhao [Wed, 11 May 2011 03:47:36 +0000 (20:47 -0700)]
mwifiex: cleanup ioctl.h

Some structures and macros in ioctl.h are redundant or no longer
used.

Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomwifiex: remove redundant local structures
Amitkumar Karwar [Wed, 11 May 2011 03:47:35 +0000 (20:47 -0700)]
mwifiex: remove redundant local structures

Avoid use of local structure in the function if the structure is
already allocated by the caller and the structure pointer is passed.

Signed-off-by: Amitkumar Karwar <akarwar@marvell.com>
Signed-off-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: implement timeouts workaround
Rafał Miłecki [Wed, 11 May 2011 00:10:59 +0000 (02:10 +0200)]
b43: implement timeouts workaround

Documented in: <4DCA7E40.9070709@lwfinger.net>

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agossb: move ssb_commit_settings and export it
Rafał Miłecki [Wed, 11 May 2011 00:10:58 +0000 (02:10 +0200)]
ssb: move ssb_commit_settings and export it

Commiting settings is possible on devices without PCI core (but with CC
core). Export it for usage in drivers supporting other cores.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agobcma: add missing GPIO defines, use PULL register only when available
Rafał Miłecki [Wed, 11 May 2011 00:08:09 +0000 (02:08 +0200)]
bcma: add missing GPIO defines, use PULL register only when available

Similar patch was commited to ssb.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix a regression in PS frame filter handling
Felix Fietkau [Tue, 10 May 2011 18:52:22 +0000 (20:52 +0200)]
ath9k: fix a regression in PS frame filter handling

Only leave filtering enabled for AP or VLAN interfaces, clear the
destination mask for all other interfaces.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Reported-by: Ben Greear <greearb@candelatech.com>
Tested-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43: move MAC PHY clock controling function
Rafał Miłecki [Tue, 10 May 2011 14:05:33 +0000 (16:05 +0200)]
b43: move MAC PHY clock controling function

This is not N-PHY specific function, we partially duplicate code.

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agob43legacy: trivial: use TMSLOW def instead of magic value
Rafał Miłecki [Tue, 10 May 2011 13:53:16 +0000 (15:53 +0200)]
b43legacy: trivial: use TMSLOW def instead of magic value

Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: add a couple of trace event classes to reduce duplicated code
Luciano Coelho [Mon, 9 May 2011 11:40:06 +0000 (14:40 +0300)]
mac80211: add a couple of trace event classes to reduce duplicated code

The functions drv_add_interface() and drv_remove_interface() print out
the same values in the traces.  Combine the traces of these two
functions into one event class to remove some duplicate code.

Also add a new class for functions drv_set_frag_threshold() and
drv_set_rts_threshold().

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath5k: Fix lockup due to un-init spinlock.
Ben Greear [Fri, 6 May 2011 22:24:34 +0000 (15:24 -0700)]
ath5k: Fix lockup due to un-init spinlock.

This was introduced in 2.6.39-rc1 it seems.

Signed-off-by: Ben Greear <greearb@candelatech.com>
Tested-by: Sedat Dilek <sedat.dilek@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Only process mesh PREPs with equal seq number if metric is better.
Fabrice Deyber [Fri, 6 May 2011 22:11:51 +0000 (15:11 -0700)]
mac80211: Only process mesh PREPs with equal seq number if metric is better.

This fixes routing loops in PREP propagation and is in accordance with Draft
11, Section: 11C.9.8.4.

Signed-off-by: Fabrice Deyber <fabricedeyber@agilemesh.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoath9k: fix beaconing for mesh interfaces
Javier Cardona [Tue, 3 May 2011 23:57:19 +0000 (16:57 -0700)]
ath9k: fix beaconing for mesh interfaces

Mesh beaconing on ath9k was broken by this commit:

commit 4801416c76a3a355076d6d371c00270dfe332e1c
Author: Ben Greear <greearb@candelatech.com>
Date:   Sat Jan 15 19:13:48 2011 +0000

This patch assigns the right opmode when the device is used in mesh
mode.

Reported-by: Fabrice Deyber fabricedeyber@agilemesh.com
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: allow setting supported rates on mesh peers
Javier Cardona [Tue, 3 May 2011 23:57:18 +0000 (16:57 -0700)]
mac80211: allow setting supported rates on mesh peers

This is necessary for userspace managed stations.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Move call to mpp_path_lookup inside RCU-read section
Javier Cardona [Tue, 3 May 2011 23:57:17 +0000 (16:57 -0700)]
mac80211: Move call to mpp_path_lookup inside RCU-read section

PROVE_RCU caught that one:

[  431.214070] ===================================================
[  431.215341] [ INFO: suspicious rcu_dereference_check() usage. ]
[  431.215674] ---------------------------------------------------
[  431.216043] net/mac80211/mesh_pathtbl.c:184 invoked
rcu_dereference_check() without protection!

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Fix locking bug on mesh path table access
Javier Cardona [Tue, 3 May 2011 23:57:16 +0000 (16:57 -0700)]
mac80211: Fix locking bug on mesh path table access

The mesh and mpp path tables are accessed from softirq and workqueue
context so non-irq locking cannot be used.  Or at least that's what
PROVE_RCU seems to tell us here:

[  431.240946] =================================
[  431.241061] [ INFO: inconsistent lock state ]
[  431.241061] 2.6.39-rc3-wl+ #354
[  431.241061] ---------------------------------
[  431.241061] inconsistent {IN-SOFTIRQ-W} -> {SOFTIRQ-ON-W} usage.
[  431.241061] kworker/u:1/1423 [HC0[0]:SC0[0]:HE1:SE1] takes:
[  431.241061]  (&(&newtbl->hashwlock[i])->rlock){+.?...}, at:
[<c14671bf>] mesh_path_add+0x167/0x257

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Check size of a new mesh path table for changes since allocation.
Javier Cardona [Tue, 3 May 2011 23:57:15 +0000 (16:57 -0700)]
mac80211: Check size of a new mesh path table for changes since allocation.

Not sure if I'm chasing a ghost here, seems like the
mesh_path->size_order needs to be inside an RCU-read section to prevent
that value from changing between table allocation and copying.  We have
observed crashes that might be caused by this.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Self-protected management frames are not robust
Thomas Pedersen [Tue, 3 May 2011 23:57:14 +0000 (16:57 -0700)]
mac80211: Self-protected management frames are not robust

They may contain encrypted information elements (as AMPE frames do)
but they are not encrypted.

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: allow setting MFP flag for a meshif
Thomas Pedersen [Tue, 3 May 2011 23:57:13 +0000 (16:57 -0700)]
nl80211: allow setting MFP flag for a meshif

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: allow installing keys for a meshif
Thomas Pedersen [Tue, 3 May 2011 23:57:12 +0000 (16:57 -0700)]
nl80211: allow installing keys for a meshif

Signed-off-by: Thomas Pedersen <thomas@cozybit.com>
Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: Let userspace drive the peer link management states.
Javier Cardona [Tue, 3 May 2011 23:57:11 +0000 (16:57 -0700)]
nl80211: Let userspace drive the peer link management states.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agocfg80211: Use capability info to detect mesh beacons.
Javier Cardona [Wed, 4 May 2011 17:24:56 +0000 (10:24 -0700)]
cfg80211: Use capability info to detect mesh beacons.

Mesh beacons no longer use all-zeroes BSSID.  Beacon frames for MBSS,
infrastructure BSS, or IBSS are differentiated by the Capability
Information field in the Beacon frame.  A mesh STA sets the ESS and IBSS
subfields to 0 in transmitted Beacon or Probe Response management
frames.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoopen80211s: Stop using zero for address 3 in mesh plink mgmt frames
Javier Cardona [Tue, 3 May 2011 23:57:10 +0000 (16:57 -0700)]
open80211s: Stop using zero for address 3 in mesh plink mgmt frames

Previous versions of 11s draft used the all zeroes address.  Current
draft uses the same address as address 2.

Also, use the ANA-approved action category code for peer establishment frames.

Note: This breaks compatibility with previous mesh protocol instances.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Drop MESH_PLINK category and use new ANA-approved MESH_ACTION
Javier Cardona [Tue, 3 May 2011 23:57:09 +0000 (16:57 -0700)]
mac80211: Drop MESH_PLINK category and use new ANA-approved MESH_ACTION

Note: This breaks compatibility with previous mesh protocol instances.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agomac80211: Let userspace send action frames over mesh interfaces
Javier Cardona [Tue, 3 May 2011 23:57:08 +0000 (16:57 -0700)]
mac80211: Let userspace send action frames over mesh interfaces

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agonl80211: Introduce NL80211_MESH_SETUP_USERSPACE_AMPE
Javier Cardona [Tue, 3 May 2011 23:57:07 +0000 (16:57 -0700)]
nl80211: Introduce NL80211_MESH_SETUP_USERSPACE_AMPE

Introduce a new configuration option to support AMPE from userspace.

Prior to this series we only supported authentication in userspace: an
authentication daemon would authenticate peer candidates in userspace
and hand them over to the kernel.  From that point the mesh stack would
take over and establish a peer link (Mesh Peering Management).

These patches introduce support for Authenticated Mesh Peering Exchange
in userspace.  The userspace daemon implements the AMPE protocol and on
successfull completion create mesh peers and install encryption keys.

Signed-off-by: Javier Cardona <javier@cozybit.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
13 years agoBluetooth: Double check sec req for pre 2.1 device
Waldemar Rymarkiewicz [Fri, 6 May 2011 07:42:31 +0000 (09:42 +0200)]
Bluetooth: Double check sec req for pre 2.1 device

In case of pre v2.1 devices authentication request will return
success immediately if the link key already exists without any
authentication process.

That means, it's not possible to re-authenticate the link if you
already have combination key and for instance want to re-authenticate
to get the high security (use 16 digit pin).

Therefore, it's necessary to check security requirements on auth
complete event to prevent not enough secure connection.

Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>