firefly-linux-kernel-4.4.55.git
10 years agomac80211: add explicit IBSS driver operations
Johannes Berg [Mon, 19 Aug 2013 16:48:41 +0000 (18:48 +0200)]
mac80211: add explicit IBSS driver operations

This can be useful for drivers if they have any failure cases
when joining an IBSS. Also move setting the queue parameters
to before this new call, in case the new driver op needs them
already.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoieee80211: fix vht cap definitions
Eliad Peller [Thu, 29 Aug 2013 12:03:14 +0000 (15:03 +0300)]
ieee80211: fix vht cap definitions

VHT_CAP_BEAMFORMER_ANTENNAS cap is actually defined in the draft as
VHT_CAP_BEAMFORMEE_STS_MAX, and its size is 3 bits long.

VHT_CAP_SOUNDING_DIMENSIONS is also 3 bits long.

Fix the definitions and change the cap masking accordingly.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: fix some snprintf misuses
Eliad Peller [Tue, 27 Aug 2013 09:40:15 +0000 (12:40 +0300)]
mac80211: fix some snprintf misuses

In some debugfs related functions snprintf was used
while scnprintf should have been used instead.

(blindly adding the return value of snprintf and supplying
it to the next snprintf might result in buffer overflow when
the input is too big)

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agowlcore: always register dummy hardirq
Arik Nemtsov [Tue, 17 Sep 2013 15:41:30 +0000 (18:41 +0300)]
wlcore: always register dummy hardirq

This keeps the kernel happy when using edge-irqs and requesting a
threaded irq.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowl18xx: print new RDL versions during boot
Victor Goldenshtein [Tue, 17 Sep 2013 15:41:29 +0000 (18:41 +0300)]
wl18xx: print new RDL versions during boot

Extract and print info for the new RDL 5, 6, 7 and 8.
Replace const struct with function which translates
the RDL number to string.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Barak Bercovitz <barak@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowl18xx: fix boot process in high temperature environment
Victor Goldenshtein [Tue, 17 Sep 2013 15:41:28 +0000 (18:41 +0300)]
wl18xx: fix boot process in high temperature environment

In addition to existing WCS PLL configuration add and enable
also the coex PLL during init phase. This fixes boot failures
due to silicon latchup in high temperature environment (>85c).

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Nadim Zubidat <nadimz@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: clarify and fix regulatory domain bit translation
Eliad Peller [Tue, 17 Sep 2013 15:41:27 +0000 (18:41 +0300)]
wlcore: clarify and fix regulatory domain bit translation

Channels 52-64 were mapped incorrectly.

Refactor and document wlcore_get_reg_conf_ch_idx() in
order to make it clear what's going on there.

While on it, fix the return value check to consider
0 as a valid return value as well (indicates channel 1).

Reported-by: Yaniv Machani <yanivma@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Ido Reis <idor@ti.com>
Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: remove unsupported channels
Eliad Peller [Tue, 17 Sep 2013 15:41:26 +0000 (18:41 +0300)]
wlcore: remove unsupported channels

The fw doesn't support channels 7,9,11 in 5ghz band,
so don't advertise supporting them.

Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: fix unsafe dereference of the wlvif
Victor Goldenshtein [Tue, 17 Sep 2013 15:41:25 +0000 (18:41 +0300)]
wlcore: fix unsafe dereference of the wlvif

wlvif could be passed as NULL from the wlcore_tx_work_locked()
to the wl1271_prepare_tx_frame() and to wl1271_skb_queue_head()
functions. This may lead to a Kernel panic, fix this by
validating that wlvif != NULL.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: cleanup scan debug prints
Victor Goldenshtein [Tue, 17 Sep 2013 15:41:24 +0000 (18:41 +0300)]
wlcore: cleanup scan debug prints

Remove scan debug dumps which are rarely used.
Make scan debug prints more clear and short.

Signed-off-by: Victor Goldenshtein <victorg@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: re-enable idle handling
Arik Nemtsov [Tue, 17 Sep 2013 15:41:23 +0000 (18:41 +0300)]
wlcore: re-enable idle handling

We need some stuff done on idle change, most notably we have to stop
sched-scanning. Take care of this by reintroducing idle handling.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: disable elp sleep while in plt mode
Yair Shapira [Tue, 17 Sep 2013 15:41:22 +0000 (18:41 +0300)]
wlcore: disable elp sleep while in plt mode

We now disable elp sleep during plt mode to allow normal operation of
plt tools such as calibrator.

Having elp_sleep enabled during plt mode is actually not required and
in fact it disrupt plt operations such as rx statistics etc.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: add new plt power-mode: CHIP_AWAKE
Yair Shapira [Tue, 17 Sep 2013 15:41:21 +0000 (18:41 +0300)]
wlcore: add new plt power-mode: CHIP_AWAKE

Under this mode the chip is powered on including sdio
but no FW is downloaded and run, interrupts are not enabled, etc...

This mode is intended to allow RTTT to bridge sdio as a transport
to the chip.

Driver only provides sdio access using the dev_mem debugfs file.

Some fixes done to the code that ensures that PLT mode and normal
driver power mode (ifconfig/add_interface) are mutually excluded.

Signed-off-by: Yair Shapira <yair.shapira@ti.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agowlcore: ROC on AP channel before auth reply
Arik Nemtsov [Tue, 17 Sep 2013 15:41:20 +0000 (18:41 +0300)]
wlcore: ROC on AP channel before auth reply

Start a ROC on the AP channel beforing sending the authentication reply
to a connecting STA. This ROC is held up to 1 second via a timer. If the
station is authorized and added by mac80211, the ROC is extended until
the station is fully authorized.
We make sure not to ROC twice when several stations are connecting in
parallel and to only release the ROC when both the pending-reply timer
and the STA-state callbacks do not require it.

Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Eliad Peller <eliad@wizery.com>
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
10 years agoMerge git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth
Gustavo Padovan [Fri, 27 Sep 2013 14:56:14 +0000 (11:56 -0300)]
Merge git://git./linux/kernel/git/bluetooth/bluetooth

Conflicts:
net/bluetooth/hci_core.c

10 years agort2x00: Fix rf register for RT3070
Kevin Lo [Wed, 18 Sep 2013 08:22:44 +0000 (16:22 +0800)]
rt2x00: Fix rf register for RT3070

Fix RT3070 chip RF initial value to be similar to the latest Ralink vendor
driver.

Tested on Asus N13 usb wifi dongle.

Signed-off-by: Kevin Lo <kevlo@kevlo.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: rtlwifi: Replace variable with a break
Peter Senna Tschudin [Sun, 22 Sep 2013 20:22:46 +0000 (22:22 +0200)]
wireless: rtlwifi: Replace variable with a break

This patch removes the variable continual, and change the while loop
to break when efuse_data == 0xFF.

Tested by compilation only.

CC: Joe Perches <joe@perches.com>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: remove duplicate declarations and macros in headers
Catalin Iacob [Sun, 22 Sep 2013 09:06:26 +0000 (11:06 +0200)]
rtlwifi: remove duplicate declarations and macros in headers

This patch brings no functional change.

There are still duplicate macros across the rtlwifi directory, for example
IQK_DELAY_TIME is defined multiple times, sometimes with different values,
this patch only removes duplicates within the same header file.

Signed-off-by: Catalin Iacob <iacobcatalin@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Remove incorrect diversity initialization
Sujith Manoharan [Mon, 16 Sep 2013 05:07:01 +0000 (10:37 +0530)]
ath9k: Remove incorrect diversity initialization

Fast antenna diversity is required only for single chain
chips and the diversity initialization is done in the
per-family board setup routines. Enabling of diversity
should be done based on the calibrated EEPROM/OTP data,
doing it for all chips is incorrect.

Remove the code that sets the fast_div bit for all cards, since
the documentation for the AR_PHY_CCK_DETECT register says:

reg 642: sig_detect_cck
enable_ant_fast_div : Only used for single chain chips.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Handle FATAL interrupts correctly
Sujith Manoharan [Mon, 16 Sep 2013 05:07:00 +0000 (10:37 +0530)]
ath9k: Handle FATAL interrupts correctly

When a FATAL interrupt is received, a full chip reset is
required, which is done in the main tasklet. But since
the reset routine is scheduled as a work item, make sure
that interrupts are not enabled in the tasklet before the
reset is done.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix NF calibration for single stream cards
Sujith Manoharan [Mon, 16 Sep 2013 05:06:59 +0000 (10:36 +0530)]
ath9k: Fix NF calibration for single stream cards

Rather than using the chip ID to read only chain-0 CCA
registers and avoid reading chain-1, use the RX chainmask
instead. There are some 1-stream PCI devices based on AR9287
such as TL-WN751ND. Improper NF calibration might result in
DMA errors/timeouts.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agortlwifi: rtl8192cu: Convert driver to use rtl_process_phyinfo()
Larry Finger [Fri, 13 Sep 2013 17:44:27 +0000 (12:44 -0500)]
rtlwifi: rtl8192cu: Convert driver to use rtl_process_phyinfo()

Remove routine _rtl92c_process_phyinfo() by using the equivalent routine
in driver rtlwifi.

This change also allows the removal of 5 additional routines from rtl8192cu.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: mark wmi_event_swba as __packed
Chris Metcalf [Fri, 13 Sep 2013 16:14:09 +0000 (12:14 -0400)]
ath9k: mark wmi_event_swba as __packed

The other structures in wmi.h are already marked this way.
Without this marking, we get an unaliged access panic in the tilegx kernel:

Starting stack dump of tid 0, pid 0 (swapper) on cpu 35 at cycle 198675113844
  frame 0: 0xfffffff7103ada90 ath9k_htc_swba+0x120/0x618 [ath9k_htc]
  frame 1: 0xfffffff7103a4b10 ath9k_wmi_event_tasklet+0x1b0/0x270 [ath9k_htc]
  frame 2: 0xfffffff700326570 tasklet_action+0x148/0x298
  [...]

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2x00: rt2800lib: fix band selection and LNA PE control for RT3593 PCIe cards
Gabor Juhos [Wed, 11 Sep 2013 17:56:45 +0000 (19:56 +0200)]
rt2x00: rt2800lib: fix band selection and LNA PE control for RT3593 PCIe cards

The band selection and PE control code for the
RT3593 chipsets only handles USB based devices
currently. Due to this limitation RT3593 based
PCIe cards are not working correctly.

On PCIe cards band selection is controlled via
GPIO #8 which is identical to the USB devices.
The LNA PE control is slightly different, all
LNA PEs are controlled by GPIO #4.

Update the code to configure the GPIO_CTRL register
correctly on PCIe devices.

Cc: Steven Liu <steven.liu@mediatek.com>
Cc: JasonYS Cheng <jasonys.cheng@mediatek.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix PeakDetect calibration for AR9462
Sujith Manoharan [Wed, 11 Sep 2013 11:06:32 +0000 (16:36 +0530)]
ath9k: Fix PeakDetect calibration for AR9462

Since HW PeakDetect calibration is turned on for AR9462,
various conditions have to be handled in the driver:

* Enable agc_cal when loading RTT fails.
* Disable SW PeakDetect calibration when RTT calibration is not enabled.
* Keep SW PeakDetect calibration result in driver.
* Update RTT table according to the saved value.
* Write RTT back after modifying SW RTT table.
* Enable local mode for PeakDetect calibration and restore values.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use bitops for calibration flags
Sujith Manoharan [Wed, 11 Sep 2013 11:06:31 +0000 (16:36 +0530)]
ath9k: Use bitops for calibration flags

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Handle abnormal NAV in AP mode
Sujith Manoharan [Wed, 11 Sep 2013 16:00:27 +0000 (21:30 +0530)]
ath9k: Handle abnormal NAV in AP mode

Beacon transmission would get stuck if the NAV is
an invalid value for some reason. Check and correct
the NAV value in the HW when this happens.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix issue with parsing malformed CFP IE
Sujith Manoharan [Wed, 11 Sep 2013 06:10:58 +0000 (11:40 +0530)]
ath9k: Fix issue with parsing malformed CFP IE

All QCA chips have the ability to parse the CF Parameter Set
IE in beacons. If the IE is malformed in the beacons from some
APs [1], the HW locks up. In AP mode, a beacon stuck would happen
and in client mode, a disconnection usually is the result.

To fix this issue, set the AR_PCU_MISC_MODE2_CFP_IGNORE to ignore
the CFP IE in beacons - this is applicable for all chips. For
AP mode, if this issue happens, the NAV is also corrupted and has
to be reset - this will be done in a subsequent patch.

[1] : http://msujith.org/ath9k/cfp/Malformed-CF-Param.png

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix calibration for AR9462
Sujith Manoharan [Wed, 11 Sep 2013 06:10:57 +0000 (11:40 +0530)]
ath9k: Fix calibration for AR9462

TX IQ calibration is disabled by default for AR9462, this
is done using the initvals (reg 0xa644).

But, to compensate for this, the AR_PHY_RX_DELAY register
should be set to the max allowed value when performing
calibration.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: rtl818x: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:32:19 +0000 (20:32 +0900)]
wireless: rtl818x: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: p54pci: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:30:49 +0000 (20:30 +0900)]
wireless: p54pci: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: orinoco: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:29:19 +0000 (20:29 +0900)]
wireless: orinoco: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: mwl8k: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:27:49 +0000 (20:27 +0900)]
wireless: mwl8k: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: ipw2x00: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:27:09 +0000 (20:27 +0900)]
wireless: ipw2x00: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: wil6210: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:26:13 +0000 (20:26 +0900)]
wireless: wil6210: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: ath10k: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:25:11 +0000 (20:25 +0900)]
wireless: ath10k: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: airo: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:23:50 +0000 (20:23 +0900)]
wireless: airo: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: adm8211: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:22:10 +0000 (20:22 +0900)]
wireless: adm8211: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: iwlegacy: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:19:41 +0000 (20:19 +0900)]
wireless: iwlegacy: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: rtlwifi: remove unnecessary pci_set_drvdata()
Jingoo Han [Tue, 10 Sep 2013 11:18:38 +0000 (20:18 +0900)]
wireless: rtlwifi: remove unnecessary pci_set_drvdata()

The driver core clears the driver data to NULL after device_release
or on probe failure. Thus, it is not needed to manually clear the
device driver data to NULL.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: wl12xx: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:58:32 +0000 (17:58 +0900)]
wireless: wl12xx: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: wlcore: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:57:57 +0000 (17:57 +0900)]
wireless: wlcore: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: wl1251: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:57:05 +0000 (17:57 +0900)]
wireless: wl1251: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: libertas: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:56:27 +0000 (17:56 +0900)]
wireless: libertas: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: cw1200: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:55:41 +0000 (17:55 +0900)]
wireless: cw1200: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: brcmfmac: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:54:47 +0000 (17:54 +0900)]
wireless: brcmfmac: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: ath9k: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:53:02 +0000 (17:53 +0900)]
wireless: ath9k: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agowireless: ath5k: use dev_get_platdata()
Jingoo Han [Tue, 10 Sep 2013 08:51:47 +0000 (17:51 +0900)]
wireless: ath5k: use dev_get_platdata()

Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agonet: ath9k: Use NULL instead of false
Sachin Kamat [Tue, 10 Sep 2013 06:20:36 +0000 (11:50 +0530)]
net: ath9k: Use NULL instead of false

The function returns a pointer. Hence return NULL instead of false.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoar5523: Add USB ID of D-Link WUA-2340 rev A1
Albert Pool [Mon, 9 Sep 2013 18:36:30 +0000 (20:36 +0200)]
ar5523: Add USB ID of D-Link WUA-2340 rev A1

Signed-off-by: Albert Pool <albertpool@solcon.nl>
Reported-by: Michael Landrum <landrummd@gmail.com>
Acked-by: Pontus Fuchs <pontus.fuchs@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agort2800: comment enable radio initialization sequence
Stanislaw Gruszka [Mon, 9 Sep 2013 10:37:38 +0000 (12:37 +0200)]
rt2800: comment enable radio initialization sequence

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agomwifiex: Remove casting the return value which is a void pointer
Jingoo Han [Mon, 9 Sep 2013 05:26:51 +0000 (14:26 +0900)]
mwifiex: Remove casting the return value which is a void pointer

Casting the return value which is a void pointer is redundant.
The conversion from void pointer to any other pointer type is
guaranteed by the C programming language.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Acked-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: replace snprintf() with scnprintf()
Zefir Kurtisi [Thu, 5 Sep 2013 12:11:57 +0000 (14:11 +0200)]
ath9k: replace snprintf() with scnprintf()

Whenever the return value of snprintf() is used to calculate
remaining buffer-space, we wanted to use sncprintf() instead.

Indentation is adapted where possible. Some lines exceed the
line width limit, either they did it already before, or
since they can not be broken reasonably well.

Signed-off-by: Zefir Kurtisi <zefir.kurtisi@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add DELL 1707 to supported card table
Sujith Manoharan [Thu, 5 Sep 2013 05:26:54 +0000 (10:56 +0530)]
ath9k: Add DELL 1707 to supported card table

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update AR9485 1.1 initvals
Sujith Manoharan [Tue, 3 Sep 2013 04:58:57 +0000 (10:28 +0530)]
ath9k: Update AR9485 1.1 initvals

* Remove duplicate array mappings.
* Fix ETSI CCA compliance.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add and use initvals for channel 14
Sujith Manoharan [Tue, 3 Sep 2013 04:58:56 +0000 (10:28 +0530)]
ath9k: Add and use initvals for channel 14

This is missing for AR9565.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix regulatory compliance for AR9462/AR9565
Sujith Manoharan [Tue, 3 Sep 2013 04:58:55 +0000 (10:28 +0530)]
ath9k: Fix regulatory compliance for AR9462/AR9565

Adjust the CCA values based on the regulatory domain
present in the EEPROM.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Identify WB335 Antenna configuration
Sujith Manoharan [Mon, 2 Sep 2013 08:29:06 +0000 (13:59 +0530)]
ath9k: Identify WB335 Antenna configuration

There are 2 types of WB335 cards, 1-antenna and 2-antenna.
Identify them based on PCI subsystem IDs, this will be used
for MCI/BTCOEX tweaks.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Identify CUS252 cards
Sujith Manoharan [Mon, 2 Sep 2013 08:29:05 +0000 (13:59 +0530)]
ath9k: Identify CUS252 cards

These cards are based on WB335/AR9565.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Enable antenna diversity for WB335
Sujith Manoharan [Mon, 2 Sep 2013 08:29:04 +0000 (13:59 +0530)]
ath9k: Enable antenna diversity for WB335

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Add support for AR9565 v1.0.1 LNA diversity
Sujith Manoharan [Mon, 2 Sep 2013 08:29:03 +0000 (13:59 +0530)]
ath9k: Add support for AR9565 v1.0.1 LNA diversity

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Use correct RX gain table for AR9565
Sujith Manoharan [Mon, 2 Sep 2013 08:29:02 +0000 (13:59 +0530)]
ath9k: Use correct RX gain table for AR9565

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Fix antenna diversity init for AR9565
Sujith Manoharan [Mon, 2 Sep 2013 08:29:01 +0000 (13:59 +0530)]
ath9k: Fix antenna diversity init for AR9565

Program the HW registers (AR_PHY_CCK_DETECT, AR_PHY_MC_GAIN_CTRL)
with the correct values for AR9565 to allow LNA combining.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Bypass EEPROM for diversity cap for AR9565
Sujith Manoharan [Mon, 2 Sep 2013 08:29:00 +0000 (13:59 +0530)]
ath9k: Bypass EEPROM for diversity cap for AR9565

Use a default antenna diversity value for AR9565 instead
of relying on the EEPROM/OTP programmed value.

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoath9k: Update initvals for AR9565 1.0
Sujith Manoharan [Mon, 2 Sep 2013 08:28:59 +0000 (13:58 +0530)]
ath9k: Update initvals for AR9565 1.0

Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
10 years agoMerge branch 'for-linville' of git://github.com/kvalo/ath
John W. Linville [Thu, 26 Sep 2013 18:54:17 +0000 (14:54 -0400)]
Merge branch 'for-linville' of git://github.com/kvalo/ath

10 years agoath10k: replenish HTT RX buffers in a tasklet
Michal Kazior [Tue, 24 Sep 2013 08:18:36 +0000 (10:18 +0200)]
ath10k: replenish HTT RX buffers in a tasklet

This starves FW RX ring buffer in case of
excessive RX. This prevents from CPU being
overwhelmed by RX indications/completions by
naturally forbiddin FW to submit more RX.

This fixes RX starvation on slow machines when
under heavy RX traffic.

kvalo: remove extra newline

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agonl80211: enable IBSS support for channel switch announcements
Simon Wunderlich [Wed, 28 Aug 2013 11:41:33 +0000 (13:41 +0200)]
nl80211: enable IBSS support for channel switch announcements

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: send a CSA action frame when changing channel
Simon Wunderlich [Wed, 28 Aug 2013 11:41:32 +0000 (13:41 +0200)]
mac80211: send a CSA action frame when changing channel

IBSS members may not immediately be able to send out their beacon when
performing CSA, therefore also send a CSA action frame.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: add support for CSA in IBSS mode
Simon Wunderlich [Wed, 28 Aug 2013 11:41:31 +0000 (13:41 +0200)]
mac80211: add support for CSA in IBSS mode

This function adds the channel switch announcement implementation for the
IBSS code. It is triggered by userspace (mac80211/cfg) or by external
channel switch announcement, which have to be adopted. Both CSAs in
beacons and action frames are supported. As for AP mode, the channel
switch is applied after some time. However in IBSS mode, the channel
switch IEs are generated in the kernel.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: split off ibss disconnect
Simon Wunderlich [Wed, 28 Aug 2013 11:41:30 +0000 (13:41 +0200)]
mac80211: split off ibss disconnect

IBSS CSA will require to disconnect if a channel switch fails, but
mac80211 should search and re-connect after this disconnect. To allow
such usage, split off the ibss disconnect process in a separate function
which only performs the disconnect without overwriting nl80211-supplied
parameters.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: split off channel switch parsing function
Simon Wunderlich [Wed, 28 Aug 2013 11:41:29 +0000 (13:41 +0200)]
mac80211: split off channel switch parsing function

The channel switch parsing function can be re-used for the IBSS code,
put the common part into an extra function.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
[also move/rename chandef_downgrade]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agocfg80211: export cfg80211_chandef_dfs_required
Simon Wunderlich [Wed, 28 Aug 2013 11:41:28 +0000 (13:41 +0200)]
cfg80211: export cfg80211_chandef_dfs_required

It will be used later by the IBSS CSA implementation of mac80211.

Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: do not override fixed_rate_idx in minstrel_ht_update_stats
Lorenzo Bianconi [Tue, 27 Aug 2013 14:59:47 +0000 (16:59 +0200)]
mac80211: do not override fixed_rate_idx in minstrel_ht_update_stats

Do not override max_tp_rate, max_tp_rate2 and max_prob_rate configured
according to fixed_rate in minstrel_ht_update_stats throughput computation

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: add fixed_rate management to minstrel rc
Lorenzo Bianconi [Tue, 27 Aug 2013 14:59:46 +0000 (16:59 +0200)]
mac80211: add fixed_rate management to minstrel rc

Add the capability to use a fixed modulation rate to minstrel rate controller

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi83@gmail.com>
Acked-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: change beacon/connection polling
Stanislaw Gruszka [Tue, 27 Aug 2013 09:36:35 +0000 (11:36 +0200)]
mac80211: change beacon/connection polling

Since when we detect beacon lost we do active AP probing (using nullfunc
frame or probe request) there is no need to have beacon polling. Flags
IEEE80211_STA_BEACON_POLL seems to be used just for historical reasons.

Change also make that after we start connection poll due to beacon loss,
next received beacon will abort the poll.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: Remove superfluous is_multicast_ether_addr() call
Sergey Ryazanov [Thu, 29 Aug 2013 21:35:09 +0000 (01:35 +0400)]
mac80211: Remove superfluous is_multicast_ether_addr() call

Remove superfluous call and use locally stored previous result.

Signed-off-by: Sergey Ryazanov <ryazanov.s.a@gmail.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: use ERR_CAST()
Johannes Berg [Wed, 28 Aug 2013 17:03:36 +0000 (19:03 +0200)]
mac80211: use ERR_CAST()

No need for ERR_PTR(PTR_ERR()) since there's ERR_CAST, use it.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agomac80211: add ieee80211_iterate_active_interfaces_rtnl()
Johannes Berg [Wed, 21 Aug 2013 20:07:20 +0000 (22:07 +0200)]
mac80211: add ieee80211_iterate_active_interfaces_rtnl()

If it is needed to disconnect multiple virtual interfaces after
(WoWLAN-) suspend, the most obvious approach would be to iterate
all interfaces by calling ieee80211_iterate_active_interfaces()
and then call ieee80211_resume_disconnect() for each one. This
is what the iwlmvm driver does.

Unfortunately, this causes a locking dependency from mac80211's
iflist_mtx to the key_mtx. This is problematic as the former is
intentionally never held while calling any driver operation to
allow drivers to iterate with their own locks held. The key_mtx
is held while installing a key into the driver though, so this
new lock dependency means drivers implementing the logic above
can no longer hold their own lock while iterating.

To fix this, add a new ieee80211_iterate_active_interfaces_rtnl()
function that iterates while the RTNL is already held. This is
true during suspend/resume, so that then the locking dependency
isn't introduced.

While at it, also refactor the various interface iterators and
keep only a single implementation called by the various cases.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
10 years agoath10k: align RX frames properly
Michal Kazior [Thu, 26 Sep 2013 07:12:24 +0000 (10:12 +0300)]
ath10k: align RX frames properly

Ethernet-like decapping mode leaves IP protocol
frame not aligned to 4-byte boundaries. This leads
to re-aligning in mac80211 which in turn leads to
poor CPU cache behaviour on some machines.

Since HW doesn't allow to change payload offset
properly the solution is to force HW to decap in
Native Wifi mode which always has 24-bytes long
802.11 header (even for QoS frames). This means IP
frame is properly aligned in this decap mode.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix Native Wifi decap mode RX
Michal Kazior [Thu, 26 Sep 2013 07:12:23 +0000 (10:12 +0300)]
ath10k: fix Native Wifi decap mode RX

NWifi decap mode always reports 802.11 Data
Frames, even when QoS Data Frames are actually
received.

This made mac80211 not report frame priority
properly (since there was no QoS Control field).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: cleanup RX decap handling
Michal Kazior [Thu, 26 Sep 2013 07:12:23 +0000 (10:12 +0300)]
ath10k: cleanup RX decap handling

Simplify decapping code and make it easier to
understand.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: document decap modes
Michal Kazior [Thu, 26 Sep 2013 07:12:23 +0000 (10:12 +0300)]
ath10k: document decap modes

Clarify how each decap mode works in one place.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: report A-MSDU subframes individually
Michal Kazior [Thu, 26 Sep 2013 07:12:22 +0000 (10:12 +0300)]
ath10k: report A-MSDU subframes individually

HW reports each A-MSDU subframe as a separate
sk_buff. It is impossible to configure it to
behave differently.

Until now ath10k was reconstructing A-MSDUs from
subframes which involved a lot of memory
operations. This proved to be a significant
contributor to degraded RX performance.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoBluetooth: Add new mgmt_set_advertising command
Johan Hedberg [Wed, 25 Sep 2013 10:26:10 +0000 (13:26 +0300)]
Bluetooth: Add new mgmt_set_advertising command

This patch adds a new mgmt command for enabling and disabling
LE advertising. The command depends on the LE setting being enabled
first and will return a "rejected" response otherwise. The patch also
adds safeguards so that there will ever only be one set_le or
set_advertising command pending per adapter.

The response handling and new_settings event sending is done in an
asynchronous request callback, meaning raw HCI access from user space to
enable advertising (e.g. hciconfig leadv) will not trigger the
new_settings event. This is intentional since trying to support mixed
raw HCI and mgmt access would mean adding extra state tracking or new
helper functions, essentially negating the benefit of using the
asynchronous request framework. The HCI_LE_ENABLED and HCI_LE_PERIPHERAL
flags however are updated correctly even with raw HCI access so this
will not completely break subsequent access over mgmt.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Add new mgmt setting for LE advertising
Johan Hedberg [Wed, 25 Sep 2013 10:26:09 +0000 (13:26 +0300)]
Bluetooth: Add new mgmt setting for LE advertising

This patch adds a new mgmt setting for LE advertising and hooks up the
necessary places in the mgmt code to operate on the HCI_LE_PERIPHERAL
flag (which corresponds to this setting). This patch does not yet add
any new command for enabling the setting - that is left for a subsequent
patch.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Use async request for LE enable/disable
Johan Hedberg [Wed, 25 Sep 2013 10:26:08 +0000 (13:26 +0300)]
Bluetooth: Use async request for LE enable/disable

This patch updates the code to use an asynchronous request for handling
the enabling and disabling of LE support. This refactoring is necessary
as a preparation for adding advertising support, since when LE is
disabled we should also disable advertising, and the cleanest way to do
this is to perform the two respective HCI commands in the same
asynchronous request.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Move mgmt response convenience functions to a better location
Johan Hedberg [Wed, 25 Sep 2013 10:26:07 +0000 (13:26 +0300)]
Bluetooth: Move mgmt response convenience functions to a better location

The settings_rsp and cmd_status_rsp functions can be useful for all mgmt
command handlers when asynchronous request callbacks are used. They will
e.g. be used by subsequent patches to change set_le to use an async
request as well as a new set_advertising command. Therefore, move them
higher up in the mgmt.c file to avoid unnecessary forward declarations
or mixing this trivial change with other patches.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Fix busy return for mgmt_set_powered in some cases
Johan Hedberg [Wed, 25 Sep 2013 10:26:06 +0000 (13:26 +0300)]
Bluetooth: Fix busy return for mgmt_set_powered in some cases

We should return a "busy" error always when there is another
mgmt_set_powered operation in progress. Previously when powering on
while the auto off timer was still set the code could have let two or
more pending power on commands to be queued. This patch fixes the issue
by moving the check for duplicate commands to an earlier point in the
set_powered handler.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Clean up socket locking in l2cap_sock_recvmsg
Johan Hedberg [Wed, 25 Sep 2013 10:26:05 +0000 (13:26 +0300)]
Bluetooth: Clean up socket locking in l2cap_sock_recvmsg

This patch cleans up the locking login in l2cap_sock_recvmsg by pairing
up each lock_sock call with a release_sock call. The function already
has a "done" label that handles releasing the socket and returning from
the function so the fix is rather simple.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Add clarifying comment to bt_sock_wait_state()
Johan Hedberg [Wed, 25 Sep 2013 10:26:04 +0000 (13:26 +0300)]
Bluetooth: Add clarifying comment to bt_sock_wait_state()

The bt_sock_wait_state requires the sk lock to be held (through
lock_sock) so document it clearly in the code.

Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: btusb: Add support for Belkin F8065bf
Ken O'Brien [Sat, 21 Sep 2013 18:14:43 +0000 (19:14 +0100)]
Bluetooth: btusb: Add support for Belkin F8065bf

Add generic rule on encountering Belkin bluetooth usb device F8065bf.

Relevant section from /sys/kernel/debug/usb/devices:

T:  Bus=03 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=12   MxCh= 0
D:  Ver= 2.00 Cls=ff(vend.) Sub=01 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=050d ProdID=065a Rev= 1.12
S:  Manufacturer=Broadcom Corp
S:  Product=BCM20702A0
S:  SerialNumber=0002723E2D29
C:* #Ifs= 4 Cfg#= 1 Atr=a0 MxPwr=100mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=81(I) Atr=03(Int.) MxPS=  16 Ivl=1ms
E:  Ad=82(I) Atr=02(Bulk) MxPS=  64 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS=  64 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   0 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   0 Ivl=1ms
I:  If#= 1 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=01 Prot=01 Driver=btusb
E:  Ad=83(I) Atr=01(Isoc) MxPS=   9 Ivl=1ms
E:  Ad=03(O) Atr=01(Isoc) MxPS=   9 Ivl=1ms

Signed-off-by: Ken O'Brien <kernel@kenobrien.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: Fix assignment of 0/1 to bool variables
Peter Senna Tschudin [Sun, 22 Sep 2013 18:44:10 +0000 (20:44 +0200)]
Bluetooth: Fix assignment of 0/1 to bool variables

Convert 0 to false and 1 to true when assigning values to bool
variables. Inspired by commit 3db1cd5c05f35fb43eb134df6f321de4e63141f2.

The simplified semantic patch that find this problem is as
follows (http://coccinelle.lip6.fr/):

@@
bool b;
@@
(
-b = 0
+b = false
|
-b = 1
+b = true
)

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoBluetooth: don't release the port in rfcomm_dev_state_change()
Gianluca Anzolin [Tue, 27 Aug 2013 16:28:46 +0000 (18:28 +0200)]
Bluetooth: don't release the port in rfcomm_dev_state_change()

When the dlc is closed, rfcomm_dev_state_change() tries to release the
port in the case it cannot get a reference to the tty. However this is
racy and not even needed.

Infact as Peter Hurley points out:

1. Only consider dlcs that are 'stolen' from a connected socket, ie.
   reused. Allocated dlcs cannot have been closed prior to port
   activate and so for these dlcs a tty reference will always be avail
   in rfcomm_dev_state_change() -- except for the conditions covered by
   #2b below.
2. If a tty was at some point previously created for this rfcomm, then
   either
   (a) the tty reference is still avail, so rfcomm_dev_state_change()
       will perform a hangup. So nothing to do, or,
   (b) the tty reference is no longer avail, and the tty_port will be
       destroyed by the last tty_port_put() in rfcomm_tty_cleanup.
       Again, no action required.
3. Prior to obtaining the dlc lock in rfcomm_dev_add(),
   rfcomm_dev_state_change() will not 'see' a rfcomm_dev so nothing to
   do here.
4. After releasing the dlc lock in rfcomm_dev_add(),
   rfcomm_dev_state_change() will 'see' an incomplete rfcomm_dev if a
   tty reference could not be obtained. Again, the best thing to do here
   is nothing. Any future attempted open() will block on
   rfcomm_dev_carrier_raised(). The unconnected device will exist until
   released by ioctl(RFCOMMRELEASEDEV).

The patch removes the aforementioned code and uses the
tty_port_tty_hangup() helper to hangup the tty.

Signed-off-by: Gianluca Anzolin <gianluca@sottospazio.it>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
10 years agoath10k: use msdu headroom to store txfrag
Michal Kazior [Wed, 18 Sep 2013 12:43:22 +0000 (14:43 +0200)]
ath10k: use msdu headroom to store txfrag

Instead of allocating sk_buff for a mere 16-byte
tx fragment list buffer use headroom of the
original msdu sk_buff.

This decreases CPU cache pressure and improves
performance.

Measured improvement on AP135 is 560mbps ->
590mbps of UDP TX briding traffic.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: cleanup HTT TX functions
Michal Kazior [Wed, 18 Sep 2013 12:43:21 +0000 (14:43 +0200)]
ath10k: cleanup HTT TX functions

Use a saner goto scheme for failure handling. Also
group operations more sensibly.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: decouple HTT TX completions
Michal Kazior [Wed, 18 Sep 2013 12:43:20 +0000 (14:43 +0200)]
ath10k: decouple HTT TX completions

Until now the all MSDU transfer related structures
were freed when all resources were unreferenced.

Now HTC transfer is freed independently and HTT
transfer is so too.

This yields a way more simpler ath10k_skb_cb and
should possibly enable parallel pipe processing
(which is now serialized in
ath10k_pci_process_ce routine).

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: avoid needless memset on TX path
Michal Kazior [Wed, 18 Sep 2013 12:43:19 +0000 (14:43 +0200)]
ath10k: avoid needless memset on TX path

This reduces number of memory accesses and
hopefully contributes to better performance in the
future.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: use num_pending_tx instead of msdu id bitmap
Michal Kazior [Wed, 18 Sep 2013 12:43:18 +0000 (14:43 +0200)]
ath10k: use num_pending_tx instead of msdu id bitmap

It's more efficient to simply check num_pending_tx
value instead of traversing whole bitmap of
msdu ids.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
10 years agoath10k: fix num_sends_allowed replenishing
Michal Kazior [Wed, 18 Sep 2013 13:22:17 +0000 (15:22 +0200)]
ath10k: fix num_sends_allowed replenishing

Commit e9bb0aa39 ("ath10k: delete struct ce_sendlist") broke
num_sends_allowed incrementing. num_sends_allowed
exceeded initial values and could overflow.

This code was supposed to replenish
num_sends_allowed for partial sendlist items (i.e.
before final sendlist item from a sendlist was
completed and could be processed by completion
handlers).

Fortunately it seems it did not cause any major breakage,
yet.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>