Nick Kossifidis [Fri, 3 Dec 2010 04:09:38 +0000 (06:09 +0200)]
ath5k: Fix reporting of RX dma stop failure
* Correctly report failure to stop RX DMA
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Fri, 3 Dec 2010 04:07:13 +0000 (06:07 +0200)]
ath5k: Disable ANI during reset
* Stop ANI durring reset to prevent false PHY error reports
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Fri, 3 Dec 2010 04:05:19 +0000 (06:05 +0200)]
ath5k: Always free tx buffers before reset
* Always free tx buffers before reset, since we also empty hw queues.
If we don't and a queue gets stuck, we'll never decrease txq_len and sw
will keep thinking the queue is still stuck even after reset.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Fri, 3 Dec 2010 04:03:00 +0000 (06:03 +0200)]
ath5k: Always write tx powertable on hw
* By skipping tx power table calibration we also skip setting
tx power table on hw. Make sure we always write tx power table
on hw since it gets cleared on reset.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 20:01:08 +0000 (21:01 +0100)]
mac80211: speed up AP probing using nullfunc frames
If the nullfunc frame used to probe the AP was not acked, there is no point
in waiting for the probe timeout, so advance to the next try (or disconnect)
immediately.
If we do reach the probe timeout without having received a tx status, the
connection is probably really bad and worth disconnecting.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 20:01:07 +0000 (21:01 +0100)]
mac80211: remove a redundant check
ieee80211_is_nullfunc() implies ieee80211_is_data()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Thu, 2 Dec 2010 10:50:37 +0000 (19:50 +0900)]
lib: Improve EWMA efficiency by using bitshifts
Using bitshifts instead of division and multiplication should improve
performance. That requires weight and factor to be powers of two, but i think
this is something we can live with.
Thanks to Peter Zijlstra for the improved formula!
Signed-off-by: Bruno Randolf <br1@einfach.org>
--
v2: use log2.h functions
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Thu, 2 Dec 2010 10:12:31 +0000 (19:12 +0900)]
ath5k: Use EWMA factor of 1024 instead of 1000
This prepares the only place which uses the EWMA library so far for the
performance improved implementation coming up, which requires factor and
weight to be a power of two.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Wed, 1 Dec 2010 17:37:55 +0000 (09:37 -0800)]
MAINTAINERS: Add ATH GENERIC UTILITIES
This file pattern is not currently shown as maintained
by atheros. Perhaps it should be?
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Wed, 1 Dec 2010 15:34:45 +0000 (16:34 +0100)]
mac80211: Update last_tx_rate only for data frames
The last_tx_rate field was also updated for non-data frames that are
often sent with a lower rate (for example management frames at 1 Mbps).
This is confusing when the data rate is actually much higher.
Hence, only update the last_tx_rate field with tx rate information
gathered from last data frames.
If the rate control algorithm filled in txrc.reported_rate we don't need
to verify this information.
Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Mon, 6 Dec 2010 20:52:27 +0000 (15:52 -0500)]
Merge branch 'wireless-next-2.6' of git://git./linux/kernel/git/iwlwifi/iwlwifi-2.6
John W. Linville [Thu, 2 Dec 2010 20:46:37 +0000 (15:46 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/linville/wireless-2.6
Conflicts:
drivers/net/wireless/ath/ath9k/ar9003_eeprom.c
Felix Fietkau [Thu, 2 Dec 2010 09:27:21 +0000 (10:27 +0100)]
ath5k: Fix reset and interrupts for AHB type of devices.
On WiSoc we cannot access mac register before it is resetted.
It will crash hardware otherwise.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:27:16 +0000 (10:27 +0100)]
ath5k: Add AHB bus support.
AHB specific functions are now in ahb.c file. AHB bus is
compiled in when CONFIG_ATHEROS_AR231X is set in kernel.
All other platforms will use PCI bus.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:27:11 +0000 (10:27 +0100)]
ath5k: Add initial registers values for radio RF2317 chip.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:27:06 +0000 (10:27 +0100)]
ath5k: Add a function to read chipset's MAC revision
Add bus dependent revision read function which is used to
determine chipset's MAC before hardware is initialized.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:27:06 +0000 (10:27 +0100)]
ath5k: Check if pci pdev struct is initialized in common functions.
To be able to support other busses than PCI check if pci device
structure is initialized.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:27:01 +0000 (10:27 +0100)]
ath5k: Use generic eeprom read from common ath_bus_opts struct.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:27:01 +0000 (10:27 +0100)]
ath5k: Move PCI bus functions to separate file.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:26:56 +0000 (10:26 +0100)]
ath5k: Introduce ath5k_init_softc function as in ath9k
Split pci initialization into hardware specific
functions and softc structure initialization.
Make function naming similar to ones ath9k.
Introduce ath_bus_opts in ath5k for later
AHB bus integration.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Thu, 2 Dec 2010 09:26:51 +0000 (10:26 +0100)]
ath5k: Use Generic DMA for later support of AHB bus.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: Wojciech Dubowik <Wojciech.Dubowik@neratec.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Thu, 2 Dec 2010 20:17:46 +0000 (15:17 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth-next-2.6
Andy Shevchenko [Thu, 2 Dec 2010 12:45:07 +0000 (14:45 +0200)]
wireless: ray_cs: use '%pm' format option to print MAC
Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Bruno Randolf [Thu, 2 Dec 2010 07:23:12 +0000 (16:23 +0900)]
cfg80211: Add documentation for antenna ops
The last patch with the same title was for mac80211 ops, accidentally.
Signed-off-by: Bruno Randolf <br1@einfach.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:35 +0000 (09:43 +0100)]
mac80211: publish SMPS docs
Create a new chapter about SMPS in the
driver API part of the mac80211 book and
populate it with the existing docs.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:34 +0000 (09:43 +0100)]
mac80211: document station handling
Add some existing documentation about station
handling to a new chapter about advanced APIs.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:33 +0000 (09:43 +0100)]
mac80211: publish interface iteration docs
Publish the documentation for the interface
iteration functions in the right section of
the book.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:32 +0000 (09:43 +0100)]
mac80211: document aggregation
Include the aggregation documentation in the
docbook, split up by public and internal docs.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:31 +0000 (09:43 +0100)]
mac80211: publish some rate control docs
Add an API chapter to the rate control part of
the mac80211 book and populate it with some
existing documentation.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:30 +0000 (09:43 +0100)]
mac80211: publish some misc docs
There isn't a clear TX documentation yet, so
put these into the misc section for now.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:29 +0000 (09:43 +0100)]
mac80211: publish docs for _ni functions
Put them along with their "regular" versions for
now, we should write more docs in the future.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:28 +0000 (09:43 +0100)]
mac80211: document workqueue
Create a new chapter for the mac80211 workqueue
that contains the documentation written for it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 1 Dec 2010 08:43:27 +0000 (09:43 +0100)]
cfg80211: include CQM packet loss docs
Just include them in the list of functions,
there aren't any more detailed docs (yet).
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Wed, 1 Dec 2010 07:00:09 +0000 (12:30 +0530)]
ath9k_htc: Remove unused structures
Signed-off-by: Sujith Manoharan <Sujith.Manoharan@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Tue, 30 Nov 2010 21:42:08 +0000 (13:42 -0800)]
wireless: Remove unnecessary casts of usb_get_intfdata
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Tue, 30 Nov 2010 21:33:16 +0000 (22:33 +0100)]
b43: N-PHY: fix code path on PHY init
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Tue, 30 Nov 2010 21:33:15 +0000 (22:33 +0100)]
b43: N-PHY: use defines for RSSI types
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Tue, 30 Nov 2010 21:33:14 +0000 (22:33 +0100)]
b43: N-PHY: fix RSSI selection
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Joe Perches [Tue, 30 Nov 2010 20:19:11 +0000 (12:19 -0800)]
ath9k: hif_usb: Reduce indent 1 column
Invert test and return early.
Move variable declarations to local scope.
Don't initialize variables to 0 unnecessarily.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ben Greear [Mon, 29 Nov 2010 22:13:22 +0000 (14:13 -0800)]
ath9k: Move debugfs under ieee80211/[phyname]/ath9k/
This fixes debugfs problems when a phy is renamed,
and is able to remove a bit of code that is no longer
needed.
Signed-off-by: Ben Greear <greearb@candelatech.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Sun, 28 Nov 2010 11:59:45 +0000 (12:59 +0100)]
b43: N-PHY: fix RSSI calibration
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Sun, 28 Nov 2010 11:59:44 +0000 (12:59 +0100)]
b43: N-PHY: initialize perical variable, add missing call to CCA reset
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Sun, 28 Nov 2010 11:59:43 +0000 (12:59 +0100)]
b43: N-PHY: implement very basic TX power control management
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Sun, 28 Nov 2010 11:59:42 +0000 (12:59 +0100)]
b43: N-PHY: swap values for radio registers 0x3b and 0x3c
Specs were updated plus we become wl compatible.
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hauke Mehrtens [Sun, 28 Nov 2010 11:22:52 +0000 (12:22 +0100)]
ssb: Add sysfs attributes to ssb devices
Make it possible to read out the attributes, till now only show on
dmesg, through sysfs.
This patch was some time in OpenWrt.
Signed-off-by: Bernhard Loos <bernhardloos@googlemail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Rafał Miłecki [Sun, 28 Nov 2010 09:39:35 +0000 (10:39 +0100)]
ssb: extract indexes for power tables
Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
Acked-by: Michael Buesch <mb@bu3sch.de>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Thu, 2 Dec 2010 19:10:58 +0000 (14:10 -0500)]
Revert "ath9k: Fix STA disconnect issue due to received MIC failed bcast frames"
This reverts commit
916448e77f6bcaaa7f13c3de0c3851783ae2bfd0.
"As far as I can tell, either of these patches breaks multiple VIF
scenarios. I'm not sure exactly why, but I had to revert this to
get any of my interfaces to associate."
-- Ben Greear <greearb@candelatech.com>
http://marc.info/?l=linux-wireless&m=
129123368719339&w=2
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 1 Dec 2010 18:07:47 +0000 (19:07 +0100)]
ath9k_hw: fix more bitfield related endian issues
A few LNA control related flags were also specified as a bitfields, however
for some strange reason they were written in big-endian order this time.
Fix this by using flags instead.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Wed, 1 Dec 2010 18:07:46 +0000 (19:07 +0100)]
ath9k_hw: fix endian issues with CTLs on AR9003
Parsing data using bitfields is messy, because it makes endian handling
much harder. AR9002 and earlier got it right, AR9003 got it wrong.
This might lead to either using too high or too low tx power values,
depending on frequency and eeprom settings.
Fix it by getting rid of the CTL related bitfields entirely and use
masks instead.
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Vasanthakumar Thiagarajan [Wed, 1 Dec 2010 07:24:09 +0000 (23:24 -0800)]
ath9k: Fix bug in reading input gpio state for ar9003
The register which gives input gpio state is 0x404c for ar9003,
currently 0x4048 is wrongly used. This will disable RF and make
it unusable on some of AR9003.
Cc:stable@kernel.org
Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Thu, 2 Dec 2010 19:00:51 +0000 (14:00 -0500)]
Merge branch 'master' of git://git./linux/kernel/git/padovan/bluetooth-2.6
Wey-Yi Guy [Fri, 26 Nov 2010 21:24:19 +0000 (13:24 -0800)]
iwlagn: name change for bt_ch_announce module parameter
Change the module parameter name to bt_ch_inhibition from
bt_ch_announce to better describe the functionality
In order to allow Bluetooth to activate a smart AFH mechanism
and to maximize its available bandwidth the WiFi will request
BT Core to inhibit its activity in channels that interfere
with WiFi activity (and vice versa) if bt_ch_inhibition is enabled
Set module parameter "bt_ch_inhibition=0" will disable the channel
inhibition function
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Wey-Yi Guy [Fri, 26 Nov 2010 19:09:42 +0000 (11:09 -0800)]
iwlwifi: check for STATUS_EXIT_PENDING when send RXON command
If driver is on the way down, there is no need to send
RXON to uCode, check the condition before continuous the process.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Wey-Yi Guy [Thu, 18 Nov 2010 19:41:48 +0000 (11:41 -0800)]
iwlagn: remove structure name reference to gen2
Give the corresponding name for .cfg data structure
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Grumbach, Emmanuel [Thu, 18 Nov 2010 11:47:38 +0000 (03:47 -0800)]
iwlagn: Enable PCI L1 ACTIVE state after uCode has been loaded
PCI L1 Active needs to be disabled while loading the uCode so that the bus
doesn't go to sleep. The enablement of L1 Active should be done after
the uCode has sent the ALIVE response. The enablement of L1 Active was
missing.
Enabling L1 Active allows to save power if the BIOS / bus driver allows
it.
I measured the power consumption while not associated and
idle/associated:
L1 Active disabled: 39 mA = 130mW
L1 Active enabled: 6 mA = 20 mW
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Wey-Yi Guy [Wed, 17 Nov 2010 22:17:53 +0000 (14:17 -0800)]
iwlagn: fix race condition when reprogram sta
During reprogram stations, do not send link quality command.
uCode will crash if receive link quality command for invalid station
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Andrei Emeltchenko [Wed, 1 Dec 2010 14:58:26 +0000 (16:58 +0200)]
Bluetooth: clean up legal text
Remove extra spaces from legal text so that legal stuff looks
the same for all bluetooth code.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Wed, 1 Dec 2010 14:58:25 +0000 (16:58 +0200)]
Bluetooth: clean up hci code
Do not use assignment in IF condition, remove extra spaces,
fixing typos, simplify code.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Wed, 1 Dec 2010 14:58:24 +0000 (16:58 +0200)]
Bluetooth: clean up l2cap code
Do not initialize static vars to zero, macros with complex values
shall be enclosed with (), remove unneeded braces.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Wed, 1 Dec 2010 14:58:23 +0000 (16:58 +0200)]
Bluetooth: clean up rfcomm code
Remove extra spaces, assignments in if statement, zeroing static
variables, extra braces. Fix includes.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Wed, 1 Dec 2010 14:58:22 +0000 (16:58 +0200)]
Bluetooth: clean up sco code
Do not use assignments in IF condition, remove extra spaces
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Anderson Lizardo [Mon, 29 Nov 2010 16:15:50 +0000 (12:15 -0400)]
Bluetooth: Fix error handling for l2cap_init()
create_singlethread_workqueue() may fail with errors such as -ENOMEM. If
this happens, the return value is not set to a negative value and the
module load will succeed. It will then crash on module unload because of
a destroy_workqueue() call on a NULL pointer.
Additionally, the _busy_wq workqueue is not being destroyed if any
errors happen on l2cap_init().
Signed-off-by: Anderson Lizardo <anderson.lizardo@openbossa.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 1 Nov 2010 18:43:53 +0000 (18:43 +0000)]
Bluetooth: Get rid of __rfcomm_get_sock_by_channel()
rfcomm_get_sock_by_channel() was the only user of this function, so I merged
both into rfcomm_get_sock_by_channel(). The socket lock now should be hold
outside of rfcomm_get_sock_by_channel() once we hold and release it inside the
same function now.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Mon, 1 Nov 2010 18:43:53 +0000 (18:43 +0000)]
Bluetooth: Get rid of __l2cap_get_sock_by_psm()
l2cap_get_sock_by_psm() was the only user of this function, so I merged
both into l2cap_get_sock_by_psm(). The socket lock now should be hold
outside of l2cap_get_sock_by_psm() once we hold and release it inside the
same function now.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Mon, 22 Nov 2010 11:21:37 +0000 (13:21 +0200)]
Bluetooth: do not use assignment in if condition
Fix checkpatch errors like:
"ERROR: do not use assignment in if condition"
Simplify code and fix one long line.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Wed, 3 Nov 2010 10:32:45 +0000 (12:32 +0200)]
Bluetooth: timer check sk is not owned before freeing
In timer context we might delete l2cap channel used by krfcommd.
The check makes sure that sk is not owned. If sk is owned we
restart timer for HZ/5.
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andrei Emeltchenko [Wed, 3 Nov 2010 10:32:44 +0000 (12:32 +0200)]
Bluetooth: Check sk is not owned before freeing l2cap_conn
Check that socket sk is not locked in user process before removing
l2cap connection handler.
lock_sock and release_sock do not hold a normal spinlock directly but
instead hold the owner field. This means bh_lock_sock can still execute
even if the socket is "locked". More info can be found here:
http://www.linuxfoundation.org/collaborate/workgroups/networking/socketlocks
krfcommd kernel thread may be preempted with l2cap tasklet which remove
l2cap_conn structure. If krfcommd is in process of sending of RFCOMM reply
(like "RFCOMM UA" reply to "RFCOMM DISC") then kernel crash happens.
...
[ 694.175933] Unable to handle kernel NULL pointer dereference at virtual address
00000000
[ 694.184936] pgd =
c0004000
[ 694.187683] [
00000000] *pgd=
00000000
[ 694.191711] Internal error: Oops: 5 [#1] PREEMPT
[ 694.196350] last sysfs file: /sys/devices/platform/hci_h4p/firmware/hci_h4p/loading
[ 694.260375] CPU: 0 Not tainted (2.6.32.10 #1)
[ 694.265106] PC is at l2cap_sock_sendmsg+0x43c/0x73c [l2cap]
[ 694.270721] LR is at 0xd7017303
...
[ 694.525085] Backtrace:
[ 694.527587] [<
bf266be0>] (l2cap_sock_sendmsg+0x0/0x73c [l2cap]) from [<
c02f2cc8>] (sock_sendmsg+0xb8/0xd8)
[ 694.537292] [<
c02f2c10>] (sock_sendmsg+0x0/0xd8) from [<
c02f3044>] (kernel_sendmsg+0x48/0x80)
Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@nokia.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vasiliy Kulikov [Sat, 30 Oct 2010 14:26:31 +0000 (18:26 +0400)]
Bluetooth: hidp: fix information leak to userland
Structure hidp_conninfo is copied to userland with version, product,
vendor and name fields unitialized if both session->input and session->hid
are NULL. It leads to leaking of contents of kernel stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vasiliy Kulikov [Sat, 30 Oct 2010 14:26:26 +0000 (18:26 +0400)]
Bluetooth: cmtp: fix information leak to userland
Structure cmtp_conninfo is copied to userland with some padding fields
unitialized. It leads to leaking of contents of kernel stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Vasiliy Kulikov [Sat, 30 Oct 2010 14:26:21 +0000 (18:26 +0400)]
Bluetooth: bnep: fix information leak to userland
Structure bnep_conninfo is copied to userland with the field "device"
that has the last elements unitialized. It leads to leaking of
contents of kernel stack memory.
Signed-off-by: Vasiliy Kulikov <segooon@gmail.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 18 Nov 2010 20:22:29 +0000 (22:22 +0200)]
Bluetooth: Automate remote name requests
In Bluetooth there are no automatic updates of remote device names when
they get changed on the remote side. Instead, it is a good idea to do a
manual name request when a new connection gets created (for whatever
reason) since at this point it is very cheap (no costly baseband
connection creation needed just for the sake of the name request).
So far userspace has been responsible for this extra name request but
tighter control is needed in order not to flood Bluetooth controllers
with two many commands during connection creation. It has been shown
that some controllers simply fail to function correctly if they get too
many (almost) simultaneous commands during connection creation. The
simplest way to acheive better control of these commands is to move
their sending completely to the kernel side.
This patch inserts name requests into the sequence of events that the
kernel performs during connection creation. It does this after the
remote features have been successfully requested and before any pending
authentication requests are performed. The code will work sub-optimally
with userspace versions that still do the name requesting themselves (it
shouldn't break anything though) so it is recommended to combine this
with a userspace software version that doesn't have automated name
requests.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 18 Nov 2010 20:22:28 +0000 (22:22 +0200)]
Bluetooth: Create a unified authentication request function
This patch adds a single function that's responsible for requesting
authentication for outgoing connections. This is preparation for the
next patch which will add automated name requests and thereby move the
authentication requests to a different location.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Wed, 10 Nov 2010 15:11:51 +0000 (17:11 +0200)]
Bluetooth: Simplify remote features callback function logic
The current remote and remote extended features event callbacks logic
can be made simpler by using a label and goto statements instead of the
current multiple levels of nested if statements.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Gustavo F. Padovan [Wed, 1 Dec 2010 23:04:09 +0000 (21:04 -0200)]
Merge git://git./linux/kernel/git/padovan/bluetooth-2.6 into test
Bala Shanmugam [Fri, 26 Nov 2010 12:05:46 +0000 (17:35 +0530)]
Bluetooth: Add new PID for Atheros 3011
Atheros 3011 has small sflash firmware and needs to be
blacklisted in transport driver to load actual firmware
in DFU driver.
Signed-off-by: Bala Shanmugam <sbalashanmugam@atheros.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Stefan Seyfried [Tue, 30 Nov 2010 20:49:08 +0000 (21:49 +0100)]
Bluetooth: Fix log spamming in btusb due to autosuspend
If a device is autosuspended an inability to resubmit URBs is
to be expected. Check the error code and only log real errors.
(Now that autosuspend is default enabled for btusb, those log
messages were happening all the time e.g. with a BT mouse)
Signed-off-by: Stefan Seyfried <seife+kernel@b1-systems.com>
Signed-off-by: Oliver Neukum <oneukum@suse.de>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Stanislaw Gruszka [Tue, 30 Nov 2010 14:33:40 +0000 (15:33 +0100)]
iwlagn: fix microcode error on 4965
Commit
dbbf1755b09eef8ff6dd21c8dafe1606f051ce12 "iwlwifi: use
antenna information in EEPROM" caused 4965 device breakage with
"Microcode SW error detected. Restarting 0x82000000." message.
This patch reverts 4965 part of that commit.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Helmut Schaa [Tue, 30 Nov 2010 11:19:34 +0000 (12:19 +0100)]
mac80211: Minor optimization in ieee80211_rx_h_data
Remove a superfluous ieee80211_is_data check as that was checked a few
lines before already and we wont't get here for non-data frames at all.
Second, the frame was already converted to 802.3 header format and
reading the fc and addr1 fields was only possible because the 802.3
header is short enough and didn't overwrite the relevant parts of the
802.11 header. Make the code more obvious by checking the ethernet
header's h_dest field.
Furthermore reorder the conditions to reduce the number of checks
when dynamic powersave is not needed (AP mode for example).
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Stezenbach [Tue, 30 Nov 2010 15:49:23 +0000 (16:49 +0100)]
mac80211/rt2x00: add ieee80211_tx_status_ni()
All rt2x00 drivers except rt2800pci call ieee80211_tx_status() from
a workqueue, which causes "NOHZ: local_softirq_pending 08" messages.
To fix it, add ieee80211_tx_status_ni() similar to ieee80211_rx_ni()
which can be called from process context, and call it from
rt2x00lib_txdone(). For the rt2800pci special case a driver
flag is introduced.
Signed-off-by: Johannes Stezenbach <js@sig21.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:53:28 +0000 (21:53 +0200)]
ath5k: Set turbo bit on rf bank 2
* A diff between rfbuffer settings of turbo and non-turbo
modes indicates there is a bit on bank 2 related to turbo operation
(it's set on turbo modes). This bit is present on all radios except
RF5413 that seems to have a completely different bank 2. Also
since 2317 has the same rf-registers locations with 2425 and
since the bit exists on 2317 I assume it also exists on 2425/2417).
So in case we use turbo mode (40MHz) enable it on bank modification.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:51:38 +0000 (21:51 +0200)]
ath5k: Clean up turbo mode initvals/rfregs
* Clean up what's left of turbo mode, since we handle all
register modifications (rfbuffer comes next) on code there
is no need to have duplicated arrays.
* Rename change_channel to skip_pcu on initvals.c as we did
on reset.c
Signed-off-by: Nick Kossifidis <micklfemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:49:53 +0000 (21:49 +0200)]
ath5k: Cleanup turbo channel flags
* Clean up CHANNEL_T(URBO), use AR5K_BWMODE_40MHZ instead
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:48:32 +0000 (21:48 +0200)]
ath5k: Use correct clock when setting ofdm timings
* Use correct clock value when setting OFDM timings on
non-default bwmodes.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:45:21 +0000 (21:45 +0200)]
ath5k: Skip tx power setting on AR5210 for now
* Don't return -EINVAL when trying to set tx power
on RF5110 because AR5210 reset will fail. We need to
add support for RF5110 and AR5210 eeprom in the future
but for now just skip it.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:44:02 +0000 (21:44 +0200)]
ath5k: Tweak phy activate to rx start delay based on bwmode
* Tweak phy activation -> rx delay for different bwmodes
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:42:22 +0000 (21:42 +0200)]
ath5k: No need to save/restore staid flags on reset
* Since we set antenna flags on phy init and ack bitrate
mode on pcu init, there is no need to save/restore sta_id
flags on ath5k_hw_reset. Also we don't need to re-set our
mac address because it's not affected by resets.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:39:28 +0000 (21:39 +0200)]
ath5k: Support synth-only channel change for AR2413/AR5413
* Add synth-only channel change for AR2413/5413. When we call
ath5k_reset with a channel ath5k_hw_reset will first try to
set channel on PHY while PHY is running instead of doing a normal
full reset. To do this phy_init has to change to implement this
functionality.
* Clean up change_channel flag, what it really did was skip PCU
registers when setting initvals. This is done because on reset
PCU registers are not affected (except the registers we set
in pcu init and -due to hw problems- TSF). Use a new skip_pcu
flag that's not misleading instead. In the future we might use
that to also skip PCU reset and save us the TSF etc problems
(needs testing because standard practice is to reset everything).
* Use fast channel change only when setting channel, and set skip_pcu
to false only on init. When we reset the card due to DMA or PHY
problems skip pcu but never do a fast channel change.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:37:30 +0000 (21:37 +0200)]
ath5k: Skip powertable setting when we are on the same channel
* Only set power table if we are changing channel/mode
there is no need to recalculate and reset the power table
all the time.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:33:22 +0000 (21:33 +0200)]
ath5k: Update PLL programming for turbo/half/quarter
* Set correct PLL settings for each bwmode
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:28:15 +0000 (21:28 +0200)]
ath5k: Update spur mitigation filter for turbo/half/quarter
* Add spur mitigation filter support for half/quarter and turbo.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:26:13 +0000 (21:26 +0200)]
ath5k: Tweak power detector delays on RF5111/RF5112
* Tweak power detector delays on AR5111/AR5112 when
using half/quarter modes.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:24:54 +0000 (21:24 +0200)]
ath5k: Always set IFS intervals on reset
* Make sure we always set IFS timings even if no
coverage class is set. If we don't we'll miss the
needed changes for different bwmodes.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:21:50 +0000 (21:21 +0200)]
ath5k: Use turbo flag on DCU
* Set AR5K_DCU_GBL_IFS_MISC_TURBO_MODE flag on DCU when operating
on 40MHz
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:19:45 +0000 (21:19 +0200)]
ath5k: Set all IFS intervals, not just slot time
* Replace set_slot_time with set_ifs_intervals that also sets
the various inter-frame space intervals based on current bwmode.
* Clean up AR5210 mess from reset_tx_queue, AR5210 only has one
data queue and we set IFS intervals for that queue on set_ifs_intervals
so there is nothing left to do for 5210 on reset_tx_queue.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:12:23 +0000 (21:12 +0200)]
ath5k: Extend rate_duration
* Extend ieee80211_generic_frame_duration to support the various
bwmodes.
* Better document what's going on with ack bitrates and update
write_rate_duration to support the standard ack bitrates (when
we don't set the high bit).
* Get rid of set_ack_bitrate_high and introduce a flag on ath5k_hw
for this (we only called the function on init anyway so there is no
difference).
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:09:11 +0000 (21:09 +0200)]
ath5k: Extend get_default_sifs/slot_time
* Extend get_default_sifs/slot_time to include timings for turbo
half and quarter rate modes.
* AR5210 code for now uses timings already on core clock units
instead of usecs so rename them (we 'll clean it up later).
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:07:04 +0000 (21:07 +0200)]
ath5k: Move tx retries setting outside reset_tx_queue
* Move setting of tx retry limits on a separate function
(we 'll clean up this AR5210 mess later)
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:04:43 +0000 (21:04 +0200)]
ath5k: Increase PHY settling parameters for turo mode
* On turbo mode increase PHY settling times, note that
we only increase switch settling time on AR5212 as indicated
by initvals.
* A few cleanups: Move frame control settings for AR5210 from
reset_tx_queue to tweak_initvals and remove phy_scal settings
from tweak_initvals (we tweak them alread on set_sleep_clock).
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:02:20 +0000 (21:02 +0200)]
ath5k: Small cleanup on tweak_initvals
* Now that we properly set rx/tx latencies for AR5311 remove
that old buggy part of code left inside ath5k_hw_tweak_initval_settings
that was never executed (you can't have an RF5112 radio on a mac older
than AR5212). Also use a magic value for 5311 PHY_SCAL value.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Nick Kossifidis [Tue, 23 Nov 2010 19:00:37 +0000 (21:00 +0200)]
ath5k: Put core clock initialization on a new function
* Handle all usec parameters in one function. It's much cleaner
this way.
Signed-off-by: Nick Kossifidis <mickflemm@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>