]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/log
mirror_ubuntu-jammy-kernel.git
14 years agoBluetooth: Remove __exit from rfcomm_cleanup_ttys()
Gustavo F. Padovan [Sat, 31 Jul 2010 22:57:05 +0000 (19:57 -0300)]
Bluetooth: Remove __exit from rfcomm_cleanup_ttys()

rfcomm_cleanup_ttys() is also called from rfcomm_init(), so it can't
have __exit.

Reported-by: Mat Martineau <mathewm@codeaurora.org>
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Use list_head for HCI blacklist head
David Miller [Sat, 31 Jul 2010 04:54:49 +0000 (21:54 -0700)]
Bluetooth: Use list_head for HCI blacklist head

The bdaddr in the list root is completely unused and just
taking up space.

Signed-off-by: David S. Miller <davem@davemloft.net>
Tested-by: Johan Hedberg <johan.hedberg@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agocfg80211: fix dev <-> wiphy typo
Christian Lamparter [Wed, 28 Jul 2010 23:28:46 +0000 (01:28 +0200)]
cfg80211: fix dev <-> wiphy typo

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: allow drivers to request DTIM period
Johannes Berg [Thu, 29 Jul 2010 14:08:55 +0000 (16:08 +0200)]
mac80211: allow drivers to request DTIM period

Some features require knowing the DTIM period
before associating. This implements the ability
to wait for a beacon in mac80211 before assoc
to provide this value. It is optional since
most likely not all drivers will need this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: fix scan abort
Stanislaw Gruszka [Thu, 29 Jul 2010 09:37:41 +0000 (11:37 +0200)]
iwlwifi: fix scan abort

Fix possible double priv->mutex lock introduced by commit
a69b03e941abae00380fc6bc1877fb797a1b31e6
"iwlwifi: cancel scan watchdog in iwl_bg_abort_scan" .
We can not call cancel_delayed_work_sync(&priv->scan_check) with
priv->mutex locked because workqueue function iwl_bg_scan_check()
take that lock internally.

We do not need to synchronize when canceling priv->scan_check work.
We can avoid races (sending double abort command or send no
command at all) using STATUS_SCAN_ABORT bit. Moreover
current iwl_bg_scan_check() code seems to be broken, as
we should not send abort commands when currently aborting.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
CC: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomwl8k: change maintenance status
Lennert Buytenhek [Wed, 28 Jul 2010 23:47:04 +0000 (01:47 +0200)]
mwl8k: change maintenance status

The 8366 AP support in particular is still rather incomplete, but
this is unlikely to be addressed any time soon.

Signed-off-by: Lennert Buytenhek <buytenh@wantstofly.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1271: update hw/fw version info in wiphy struct
John W. Linville [Wed, 28 Jul 2010 21:09:41 +0000 (17:09 -0400)]
wl1271: update hw/fw version info in wiphy struct

This makes the information available through ethtool...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
14 years agowl1251: update hw/fw version info in wiphy struct
John W. Linville [Wed, 28 Jul 2010 20:59:41 +0000 (16:59 -0400)]
wl1251: update hw/fw version info in wiphy struct

This makes the information available through ethtool...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
14 years agowl1271: add get_survey callback in order to get channel noise
John W. Linville [Wed, 28 Jul 2010 20:41:06 +0000 (16:41 -0400)]
wl1271: add get_survey callback in order to get channel noise

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
14 years agolibertas_tf: add get_survey callback in order to get channel noise
John W. Linville [Wed, 28 Jul 2010 19:03:42 +0000 (15:03 -0400)]
libertas_tf: add get_survey callback in order to get channel noise

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowl1251: add get_survey callback in order to get channel noise
John W. Linville [Wed, 28 Jul 2010 19:23:30 +0000 (15:23 -0400)]
wl1251: add get_survey callback in order to get channel noise

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Kalle Valo <kvalo@adurom.com>
14 years agoar9170: add get_survey callback in order to get channel noise
John W. Linville [Wed, 28 Jul 2010 18:47:49 +0000 (14:47 -0400)]
ar9170: add get_survey callback in order to get channel noise

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Christian Lamparter <chunkeey@googlemail.com>
14 years agomwl8k: add get_survey callback in order to get channel noise
John W. Linville [Wed, 28 Jul 2010 18:04:24 +0000 (14:04 -0400)]
mwl8k: add get_survey callback in order to get channel noise

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Lennert Buytenhek <buytenh@wantstofly.org>
14 years agoath9k: enable serialize_regmode for non-PCIE AR9160
John W. Linville [Wed, 28 Jul 2010 14:06:35 +0000 (10:06 -0400)]
ath9k: enable serialize_regmode for non-PCIE AR9160

https://bugzilla.kernel.org/show_bug.cgi?id=16476

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Acked-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Cc: stable@kernel.org
14 years agomac80211: inform drivers about the off-channel status on channel changes
Felix Fietkau [Wed, 28 Jul 2010 00:40:49 +0000 (02:40 +0200)]
mac80211: inform drivers about the off-channel status on channel changes

For some drivers it can be useful to know whether the channel they're
supposed to switch to is going to be used for short off-channel work or
scanning, or whether the hardware is expected to stay on it for a while
longer. This is important for various kinds of calibration work, which
takes longer to complete and should keep some persistent state, even if
the channel temporarily changes.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoRevert "mac80211: fix sw scan bracketing"
Luis R. Rodriguez [Tue, 27 Jul 2010 20:33:08 +0000 (16:33 -0400)]
Revert "mac80211: fix sw scan bracketing"

This reverts this commit. While in theory the change is
correct the patch does not address current assumptions made
by some drivers, one which is definitley affected is ath9k.

Prior to this change the scan complete callback would be
called after we returned to the home channel and configured
the hardware RX filters. After this change we call the scan
complete callback prior to both the hw config and the config
filter. At least for ath9k this breaks quite a few assumptions
on the callback, leading to disconnects to the AP after every scan
making the driver pretty useless on STA mode. The goal behind
this commit was to address the now understood spurious warnings
from ath9k and mac80211_hwsim on scanning on two wiphys at the
same time but we have now supressed these and will address this
issue in the next kernel release.

When fixing this for good next we must first review the other
driver's dependence on this logic and perhaps consider removal
of the scan complete callback all together.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove the two wiphys scanning at the same time message
Luis R. Rodriguez [Tue, 27 Jul 2010 20:33:06 +0000 (16:33 -0400)]
ath9k: remove the two wiphys scanning at the same time message

When issuing two consecutive scans you could often end up
getting in the logs:

"ath9k: Two wiphys trying to scan at the same time"

This message is due to a race in mac80211 but addressing
that race requires some more major changes on the driver
and perhaps optimizations on mac80211 like removing the
scan complete callback alltogether. Its too late to address
this this kernel release so supress the complaint and annotate
this needs fixing for later.

Cc: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211: Update of regulatory request initiator handling
Yuri Ershov [Tue, 29 Jun 2010 11:08:08 +0000 (15:08 +0400)]
cfg80211: Update of regulatory request initiator handling

In some cases there could be possible dereferencing freed pointer. The
update is intended to avoid this issue.

Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agonl80211: Fix memory leaks
Yuri Ershov [Tue, 29 Jun 2010 11:08:07 +0000 (15:08 +0400)]
nl80211: Fix memory leaks

In case of errors during message composing msg should be freed after canceling.

Signed-off-by: Yuri Kululin <ext-yuri.kululin@nokia.com>
Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Put some code under MESH macro
Yuri Ershov [Tue, 29 Jun 2010 11:08:06 +0000 (15:08 +0400)]
mac80211: Put some code under MESH macro

In the function ieee80211_subif_start_xmit the logic related with
meshdrlen is under CONFIG_MAC80211_MESH macro, but in one place it isn't.
This is some update for this

Signed-off-by: Yuri Ershov <ext-yuri.ershov@nokia.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluet...
John W. Linville [Wed, 28 Jul 2010 20:17:49 +0000 (16:17 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-next-2.6

14 years agoBluetooth: Fix kfree() => kfree_skb() in hci_ath.c
Dan Carpenter [Fri, 23 Jul 2010 10:11:04 +0000 (12:11 +0200)]
Bluetooth: Fix kfree() => kfree_skb() in hci_ath.c

sk_buffs have to be freed with kfree_skb() instead of kfree().

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Add __init and __exit marks to RFCOMM
Gustavo F. Padovan [Sat, 24 Jul 2010 05:04:45 +0000 (02:04 -0300)]
Bluetooth: Add __init and __exit marks to RFCOMM

Those annotation save memory and space on the binary. __init code is
discarded just after execute and __exit code is discarded if the module
is built into the kernel image or unload of modules is not allowed.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Add __init and __exit marks to UART drivers
Gustavo F. Padovan [Sat, 24 Jul 2010 05:04:44 +0000 (02:04 -0300)]
Bluetooth: Add __init and __exit marks to UART drivers

Those marks are useful to save space in the binary and in the memory.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Use hci_recv_stream_fragment() in UART driver
Gustavo F. Padovan [Sat, 24 Jul 2010 04:46:57 +0000 (01:46 -0300)]
Bluetooth: Use hci_recv_stream_fragment() in UART driver

Use the new hci_recv_stream_fragment() to reassembly incoming UART
streams.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Tested-by: Ville Tervo <ville.tervo@nokia.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Test 'count' value before enter the loop
Gustavo F. Padovan [Sat, 24 Jul 2010 04:34:54 +0000 (01:34 -0300)]
Bluetooth: Test 'count' value before enter the loop

Testing first we avoid enter the loop when count = 0.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Fix permission of hci_ath.c
Gustavo F. Padovan [Sat, 24 Jul 2010 04:06:05 +0000 (01:06 -0300)]
Bluetooth: Fix permission of hci_ath.c

.c file shall not have the 'x' permission.

Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agoBluetooth: Defer SCO setup if mode change is pending
Marcel Holtmann [Mon, 26 Jul 2010 14:06:00 +0000 (10:06 -0400)]
Bluetooth: Defer SCO setup if mode change is pending

Certain headsets such as the Motorola H350 will reject SCO and eSCO
connection requests while the ACL is transitioning from sniff mode
to active mode. Add synchronization so that SCO and eSCO connection
requests will wait until the ACL has fully transitioned to active mode.

< HCI Command: Exit Sniff Mode (0x02|0x0004) plen 2
    handle 12
> HCI Event: Command Status (0x0f) plen 4
    Exit Sniff Mode (0x02|0x0004) status 0x00 ncmd 1
< HCI Command:  Setup Synchronous Connection (0x01|0x0028) plen 17
    handle 12 voice setting 0x0040
> HCI Event: Command Status (0x0f) plen 4
    Setup Synchronous Connection (0x01|0x0028) status 0x00 ncmd 1
> HCI Event: Number of Completed Packets (0x13) plen 5
    handle 12 packets 1
> HCI Event: Mode Change (0x14) plen 6
    status 0x00 handle 12 mode 0x00 interval 0
    Mode: Active
> HCI Event: Synchronous Connect Complete (0x2c) plen 17
    status 0x10 handle 14 bdaddr 00:1A:0E:50:28:A4 type SCO
    Error: Connection Accept Timeout Exceeded

Signed-off-by: Ron Shaffer <rshaffer@codeaurora.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
14 years agowireless: Convert wiphy_debug macro to function
Joe Perches [Mon, 26 Jul 2010 21:40:00 +0000 (14:40 -0700)]
wireless: Convert wiphy_debug macro to function

Save a few bytes of text

(allyesconfig)
$ size drivers/net/wireless/built-in.o*
   text    data     bss     dec     hex filename
3924568  100548  871056 4896172  4ab5ac drivers/net/wireless/built-in.o.new
3926520  100548  871464 4898532  4abee4 drivers/net/wireless/built-in.o.old

$ size net/wireless/core.o*
   text    data     bss     dec     hex filename
  12843     216    3768   16827    41bb net/wireless/core.o.new
  12328     216    3656   16200    3f48 net/wireless/core.o

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless/at76c50x-usb.c: Neaten macros
Joe Perches [Mon, 26 Jul 2010 21:39:59 +0000 (14:39 -0700)]
drivers/net/wireless/at76c50x-usb.c: Neaten macros

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless: Use wiphy_<level>
Joe Perches [Mon, 26 Jul 2010 21:39:58 +0000 (14:39 -0700)]
drivers/net/wireless: Use wiphy_<level>

Standardize the logging macros used.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoinclude/net/cfg80211.h: Add wiphy_<level> printk equivalents
Joe Perches [Mon, 26 Jul 2010 21:39:57 +0000 (14:39 -0700)]
include/net/cfg80211.h: Add wiphy_<level> printk equivalents

Simplify logging messages for wiphy devices

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: remove unused cmd_pending waitq
Dan Williams [Tue, 27 Jul 2010 20:17:03 +0000 (13:17 -0700)]
libertas: remove unused cmd_pending waitq

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: rename lbs_get_cmd_ctrl_node() to lbs_get_free_cmd_node()
Dan Williams [Tue, 27 Jul 2010 20:16:24 +0000 (13:16 -0700)]
libertas: rename lbs_get_cmd_ctrl_node() to lbs_get_free_cmd_node()

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: kill unused lbs_prepare_and_send_command()
Dan Williams [Tue, 27 Jul 2010 20:15:45 +0000 (13:15 -0700)]
libertas: kill unused lbs_prepare_and_send_command()

Remove last bits of indirect command code.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: convert DEEP_SLEEP timer to a direct command
Dan Williams [Tue, 27 Jul 2010 20:15:01 +0000 (13:15 -0700)]
libertas: convert DEEP_SLEEP timer to a direct command

Other uses were already used direct command paths.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: convert PS_MODE to a direct command
Dan Williams [Tue, 27 Jul 2010 20:08:08 +0000 (13:08 -0700)]
libertas: convert PS_MODE to a direct command

Powersave looks like it got broken at some point but we'll fix that up
when the command submission stuff is more understandable, which this
series helps to do.  That said, this patch should not further break
powersave.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: remove unused indirect command response handler
Dan Williams [Tue, 27 Jul 2010 20:05:16 +0000 (13:05 -0700)]
libertas: remove unused indirect command response handler

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: convert CMD_FWT_ACCESS to a direct command
Dan Williams [Tue, 27 Jul 2010 20:03:46 +0000 (13:03 -0700)]
libertas: convert CMD_FWT_ACCESS to a direct command

Slightly different approach here since there are so many arguments to
the firmware command.  Just let the caller fill them in before pushing
the command to the firmware.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: convert Mesh Blinding Table access to a direct command
Dan Williams [Tue, 27 Jul 2010 20:01:47 +0000 (13:01 -0700)]
libertas: convert Mesh Blinding Table access to a direct command

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: convert register access to direct commands
Dan Williams [Tue, 27 Jul 2010 20:01:07 +0000 (13:01 -0700)]
libertas: convert register access to direct commands

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: convert LED_GPIO_CTRL to a direct command
Dan Williams [Tue, 27 Jul 2010 19:59:44 +0000 (12:59 -0700)]
libertas: convert LED_GPIO_CTRL to a direct command

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: remove Beacon Control
Dan Williams [Tue, 27 Jul 2010 19:58:08 +0000 (12:58 -0700)]
libertas: remove Beacon Control

For now; it's a pretty easy command to hook up and whenever OLPC
figures out how they want the userspace interface to look (ie,
not iwpriv commands) we can easily add it back in.  Since the
cfg80211 conversion it wasn't working anyway.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: remove unused Automatic Frequency Control command
Dan Williams [Tue, 27 Jul 2010 19:57:27 +0000 (12:57 -0700)]
libertas: remove unused Automatic Frequency Control command

It hasn't been hooked up to anything in a long time and it's not
even listed in any of the firmware documentation I have (and I
have v5.1, v8, v9, and v10).

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: remove unused indirect TPC_CFG command leftovers
Dan Williams [Tue, 27 Jul 2010 19:56:44 +0000 (12:56 -0700)]
libertas: remove unused indirect TPC_CFG command leftovers

These were no longer used but were left around; Transmit Power
Control is done through the lbs_set_tpc_cfg() function.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: convert 11D_DOMAIN_INFO to a direct command
Dan Williams [Tue, 27 Jul 2010 19:56:05 +0000 (12:56 -0700)]
libertas: convert 11D_DOMAIN_INFO to a direct command

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: clean up RSSI command
Dan Williams [Tue, 27 Jul 2010 19:55:21 +0000 (12:55 -0700)]
libertas: clean up RSSI command

Convert to a full direct command; previous code rolled a direct
command by hand but left the original indirect command code intact
but disabled.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: clean up MONITOR_MODE command
Dan Williams [Tue, 27 Jul 2010 19:54:34 +0000 (12:54 -0700)]
libertas: clean up MONITOR_MODE command

Convert to a full direct command; previous code rolled a direct
command by handle but left the original indirect command code
lying around.

Signed-off-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2500usb: disallow to set WEP key with non zero index
Stanislaw Gruszka [Tue, 27 Jul 2010 14:48:24 +0000 (10:48 -0400)]
rt2500usb: disallow to set WEP key with non zero index

On our hardware (050d:7050 Belkin Components F5D7050 Wireless G Adapter),
setting any WEP key with non zero index, cause rx frames corruption.

Note: perhaps (I did not check) this can be fixed differently - by using
hw_key_idx the same as true MAC key index. But according to the comment in
rt2x00mac_set_key():

"the hardware requires keys to be assigned in correct order (When key 1
is provided but key 0 is not, then the key is not found by the hardware
during RX)"

this will be quite problematic. Since WEP should not be used, disabling
hardware crypto offload for it will not hurt much. Beside static
one key WEP will still be offloaded.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2500usb: truly disable encryption when initialize
Stanislaw Gruszka [Tue, 27 Jul 2010 14:48:17 +0000 (10:48 -0400)]
rt2500usb: truly disable encryption when initialize

Without cipher part nullify of TXRX_CSR0 register we can receive
corrupted frames (removed IV or IVC), after reloading rt2500usb module
with nohwcrypt=1 option, if previous some keys were configured into
the hardware.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agort2500usb: write keys to proper registers
Stanislaw Gruszka [Tue, 27 Jul 2010 14:48:10 +0000 (10:48 -0400)]
rt2500usb: write keys to proper registers

Fix rt2500usb hardware encryption broken by commit
96b61bafe22b2f2abcc833d651739edb977f1b1e
"rt2x00: Clean up USB vendor request buffer functions"

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: remove unused base_index from rate table.
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:34 +0000 (19:16 +0530)]
ath9k: remove unused base_index from rate table.

base index is not used anymore and so remove it.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Fix incorrect user ratekbs of MCS15 ShortGI
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:33 +0000 (19:16 +0530)]
ath9k: Fix incorrect user ratekbs of MCS15 ShortGI

The user ratekbs of MCS15 ShortGI is incorrect and can not be lesser
than MCS15 rate. This incorrect rate may affect switching to higher
rates as the rate control algorithm always finds MCS15 is better
than MCS15 ShortGI and results in lower throughput. Fix this by
feeding the correct user ratekbs for MCS15 ShortGI rate.

This issue affects 3 stream case very badly as the 3 stream rates are
not used at all once we scale down to MCS15 from 3 stream rates.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Add three stream rate control support for AR938X.
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:32 +0000 (19:16 +0530)]
ath9k: Add three stream rate control support for AR938X.

This patch adds 3 stream rate control support for AR938X family
chipsets which supports 3 streams.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Introduce bit masks for valid and valid_single_stream.
Senthil Balasubramanian [Tue, 27 Jul 2010 13:46:31 +0000 (19:16 +0530)]
ath9k: Introduce bit masks for valid and valid_single_stream.

replace valid and valid_single_stream in rate table with bit masks
and reorganize the code so adding 3x3 rate control would be easier.

Signed-off-by: Senthil Balasubramanian <senthilkumar@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Fix key freeing to handle unlinked keys
Jouni Malinen [Mon, 26 Jul 2010 22:52:03 +0000 (15:52 -0700)]
mac80211: Fix key freeing to handle unlinked keys

Key locking simplification removed key->sdata != NULL verification from
ieee80211_key_free(). While that is fine for most use cases, there is one
path where this function can be called with an unlinked key (i.e.,
key->sdata == NULL && key->local == NULL). This results in a NULL pointer
dereference with the current implementation. This is known to happen at
least with FT protocol when wpa_supplicant tries to configure the key
before association.

Avoid the issue by passing in the local pointer to
ieee80211_key_free(). In addition, do not clear the key from hw_accel
or debugfs if it has not yet been added. At least the hw_accel one could
trigger another NULL pointer dereference.

Signed-off-by: Jouni Malinen <j@w1.fi>
Reviewed-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agop54: Added get_survey callback in order to get channel noise
John W. Linville [Mon, 3 May 2010 20:06:47 +0000 (16:06 -0400)]
p54: Added get_survey callback in order to get channel noise

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMerge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluet...
John W. Linville [Tue, 27 Jul 2010 15:59:19 +0000 (11:59 -0400)]
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/holtmann/bluetooth-next-2.6

Conflicts:
drivers/net/wireless/iwlwifi/iwl-commands.h

14 years agort2x00: Fix regression for rt2500pci
Ivo van Doorn [Sat, 24 Jul 2010 17:32:25 +0000 (19:32 +0200)]
rt2x00: Fix regression for rt2500pci

Since commit:
     commit f1aa4c541e98afa8b770a75ccaa8504d0bff44a7
     Author: Ivo van Doorn <ivdoorn@gmail.com>
     Date:   Tue Jun 29 21:38:55 2010 +0200

     rt2x00: Write the BSSID to register when interface is added

mananged mode in rt2500pci was broken, due to intf->bssid containing
random data rather then the expected 00:00:00:00:00:00

This is corrected by sending the BSSID to rt2x00lib_config_intf
only in AP mode where the bssid is set to a valid value.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Acked-by: Helmut Schaa <helmut.schaa@googlemail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: Don't set per-BSS QoS for monitor interfaces
Sujith [Fri, 23 Jul 2010 05:17:11 +0000 (10:47 +0530)]
mac80211: Don't set per-BSS QoS for monitor interfaces

In AP mode, there is no need to notify the driver about QoS
changes for the monitor interface that is created. The warning
in ieee80211_bss_info_change_notify() would be hit otherwise.

Signed-off-by: Sujith <Sujith.Manoharan@atheros.com>
Acked-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: simplify noisefloor calibration chainmask calculation
Felix Fietkau [Fri, 23 Jul 2010 02:31:56 +0000 (04:31 +0200)]
ath9k_hw: simplify noisefloor calibration chainmask calculation

The noisefloor array index always corresponds to the rx chain number it
belongs to (with an offset of 3 for the extension chain).

It's much simpler (and actually more correct) to directly use the
chainmask to calculate the bitmask for the noisefloor array, instead of
using these weird chip revision checks and hardcoded mask values.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: fix a small typo in the noisefloor calibration debug code
Felix Fietkau [Fri, 23 Jul 2010 02:12:19 +0000 (04:12 +0200)]
ath9k_hw: fix a small typo in the noisefloor calibration debug code

In the noisefloor array, the extension channel values start at index 3

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k_hw: fix invalid extension channel noisefloor readings in HT20
Felix Fietkau [Fri, 23 Jul 2010 02:07:48 +0000 (04:07 +0200)]
ath9k_hw: fix invalid extension channel noisefloor readings in HT20

When the hardware is configured in HT20 mode, noise floor readings for
the extension channel often return invalid values, which keep the
values in the NF history buffer at the hardware-specific maximum limit.
Fix this by discarding the extension channel values when in HT20 mode.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: fix yet another buffer leak in the tx aggregation code
Felix Fietkau [Fri, 23 Jul 2010 01:53:16 +0000 (03:53 +0200)]
ath9k: fix yet another buffer leak in the tx aggregation code

When an aggregation session is being cleaned up, while the tx status
for some frames is being processed, the TID is flushed and its buffers
are sent out.

Unfortunately that left the pending un-acked frames unprocessed, thus
leaking buffers. Fix this by reordering the code so that those frames
are processed first, before the TID is flushed.

Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Cc: stable@kernel.org
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix sta assignment
Johannes Berg [Thu, 22 Jul 2010 15:11:28 +0000 (17:11 +0200)]
mac80211: fix sta assignment

I just had the following:
WARNING: at drivers/net/wireless/iwlwifi/iwl-agn-tx.c:574 iwlagn_tx_skb+0x1576/0x15f0 [iwlagn]()
Call Trace:
 <IRQ>  [<ffffffff8105c5df>] warn_slowpath_common+0x7f/0xc0
 [<ffffffff8105c63a>] warn_slowpath_null+0x1a/0x20
 [<ffffffffa0290b46>] iwlagn_tx_skb+0x1576/0x15f0 [iwlagn]
 [<ffffffffa027076c>] iwl_mac_tx+0x5c/0x260 [iwlagn]
 [<ffffffffa01bdf5b>] __ieee80211_tx+0x10b/0x1a0 [mac80211]
 [<ffffffffa01bfb86>] ieee80211_tx_pending+0x186/0x2d0 [mac80211]
 [<ffffffff81062ea5>] tasklet_action+0x125/0x130
 [<ffffffff810634a6>] __do_softirq+0x106/0x270
 [<ffffffff8100c09c>] call_softirq+0x1c/0x30
iwlagn 0000:02:00.0: Attempting to modify non-existing station 107

Note that 107 == 0x6b which is slab poison.

The reason is that mac80211 passed a freed station
pointer to mac80211, because as it happened iwlwifi
reset itself while mac80211 was disconnecting from
the network.

It turns out that we do take care to look up the
station pointer in ieee80211_tx_pending_skb, but
then don't use it, which obviously is a bug. Fix
this by removing the ieee80211_tx_h_sta handler
and assigning the station pointer directly.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolibertas: precedence bug
Dan Carpenter [Thu, 22 Jul 2010 12:21:02 +0000 (14:21 +0200)]
libertas: precedence bug

Negate has precedence over comparison so the original test was always
false.  (Neither 0 nor 1 are equal to NL80211_IFTYPE_MONITOR).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Dan Williams <dcbw@redhat.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211: fix IBSS default management key
Johannes Berg [Thu, 22 Jul 2010 11:59:15 +0000 (13:59 +0200)]
cfg80211: fix IBSS default management key

When wireless extensions are used to control
an encrypted IBSS, we erroneously can try to
set the default management key. Fix this.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: remove bogus rcu_read_lock()
Johannes Berg [Thu, 22 Jul 2010 11:58:51 +0000 (13:58 +0200)]
mac80211: remove bogus rcu_read_lock()

Another remnant of the previous key locking scheme
needs to be removed -- this causes a warning
otherwise as ieee80211_set_default_mgmt_key will
acquire a mutex.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agowireless: remove unneeded variable from regulatory_hint_11d()
Dan Carpenter [Thu, 22 Jul 2010 11:26:50 +0000 (13:26 +0200)]
wireless: remove unneeded variable from regulatory_hint_11d()

The "rd" variable isn't needed any more since 4f366c5dabcb
"wireless: only use alpha2 regulatory information from country IE"

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: freeing the wrong variable
Dan Carpenter [Thu, 22 Jul 2010 11:14:19 +0000 (13:14 +0200)]
mac80211: freeing the wrong variable

The intent was to free "msp->ratelist" here.  "msp->sample_table" is
always NULL at this point.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: Fix inconsistency between txq->stopped and the actual queue state
Vasanthakumar Thiagarajan [Thu, 22 Jul 2010 09:24:11 +0000 (02:24 -0700)]
ath9k: Fix inconsistency between txq->stopped and the actual queue state

Sometimes txq state(txq->stopped) can be marked as started but the actual
queue may not be started (in ATH_WIPHY_SCAN state, for example). Fix this.

Signed-off-by: Vasanthakumar Thiagarajan <vasanth@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath5k: snprintf() returns largish values
Dan Carpenter [Thu, 22 Jul 2010 08:52:02 +0000 (10:52 +0200)]
ath5k: snprintf() returns largish values

snprintf() returns the number of characters that would have been written
(not counting the NUL character).  So we can't use it as the limiter to
simple_read_from_buffer() without capping it first at sizeof(buf).

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoath9k: snprintf() returns largish values
Dan Carpenter [Thu, 22 Jul 2010 08:50:28 +0000 (10:50 +0200)]
ath9k: snprintf() returns largish values

The snprintf() function returns the number of characters that would have
been written (not counting the NUL character on the end).  It could
potentially be larger than the size of the buffer.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agodrivers/net/wireless/wl12xx: Use kmemdup
Julia Lawall [Sat, 15 May 2010 21:16:39 +0000 (23:16 +0200)]
drivers/net/wireless/wl12xx: Use kmemdup

Use kmemdup when some other buffer is immediately copied into the
allocated region.

A simplified version of the semantic patch that makes this change is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@@
expression from,to,size,flag;
statement S;
@@

-  to = \(kmalloc\|kzalloc\)(size,flag);
+  to = kmemdup(from,size,flag);
   if (to==NULL || ...) S
-  memcpy(to, from, size);
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agolib80211: remove unused host_build_iv option
John W. Linville [Thu, 22 Jul 2010 20:31:48 +0000 (16:31 -0400)]
lib80211: remove unused host_build_iv option

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agominstrel: don't complain about feedback for unrequested rates
John W. Linville [Thu, 22 Jul 2010 19:43:13 +0000 (15:43 -0400)]
minstrel: don't complain about feedback for unrequested rates

"It's not problematic if minstrel gets feedback for rates that it
doesn't have in its list, it should just ignore it. - Felix"

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: Felix Fietkau <nbd@openwrt.org>
14 years agominstrel_ht: remove unnecessary NULL check in minstrel_ht_update_caps
John W. Linville [Thu, 22 Jul 2010 19:36:02 +0000 (15:36 -0400)]
minstrel_ht: remove unnecessary NULL check in minstrel_ht_update_caps

If sta is NULL, we will have problems long before we get here...

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Cc: Felix Fietkau <nbd@openwrt.org>
14 years agoiwlwifi: assume vif is NULL for internal scans and non-NULL otherwise
John W. Linville [Thu, 22 Jul 2010 19:24:56 +0000 (15:24 -0400)]
iwlwifi: assume vif is NULL for internal scans and non-NULL otherwise

The current practice of checking vif for NULL in one place but not
another seems to confuse some static checkers, smatch in particular.
Since vif will only be NULL in the case of internal scans, adjust the
checks accordingly.

Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMAINTAINERS: remove entry for wavelan
John W. Linville [Thu, 22 Jul 2010 18:45:02 +0000 (14:45 -0400)]
MAINTAINERS: remove entry for wavelan

The driver is already removed from drivers/staging.  The wireless
extensions part is not really valid anymore either, since wext got moved
and refactored, etc.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMAINTAINERS: orphan the zd1201 wireless driver
John W. Linville [Thu, 22 Jul 2010 18:41:08 +0000 (14:41 -0400)]
MAINTAINERS: orphan the zd1201 wireless driver

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMAINTAINERS: orphan the raylink wireless driver
John W. Linville [Thu, 22 Jul 2010 18:36:52 +0000 (14:36 -0400)]
MAINTAINERS: orphan the raylink wireless driver

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoMAINTAINERS: mark prism54 obsolete
John W. Linville [Thu, 22 Jul 2010 18:25:40 +0000 (14:25 -0400)]
MAINTAINERS: mark prism54 obsolete

The prism54 driver had an entry in feature-removal-schedule.txt and it
sees very little activity other than API-change "bombing runs".  The
mac80211-based p54 driver should be used instead.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agortl8180: silence "dubious: x | !y" sparse warning
John W. Linville [Wed, 21 Jul 2010 20:36:06 +0000 (16:36 -0400)]
rtl8180: silence "dubious: x | !y" sparse warning

  CHECK   drivers/net/wireless/rtl818x/rtl8180_rtl8225.c
drivers/net/wireless/rtl818x/rtl8180_rtl8225.c:53:33: warning: dubious: x | !y

The existing code is clever and works fine, but it's not worth even a
single line of Sparse warning SPAM...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agortl8180: improve signal reporting for actual rtl8180 hardware
John W. Linville [Wed, 21 Jul 2010 20:26:40 +0000 (16:26 -0400)]
rtl8180: improve signal reporting for actual rtl8180 hardware

Adapted from Realtek-provided driver...

Signed-off-by: John W. Linville <linville@tuxdriver.com>
Tested-by: Pauli Nieminen <suokkos@gmail.com>
14 years agowl1251: fix sparse-generated warnings
John W. Linville [Wed, 21 Jul 2010 16:25:10 +0000 (12:25 -0400)]
wl1251: fix sparse-generated warnings

  CHECK   drivers/net/wireless/wl12xx/wl1251_tx.c
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    expected unsigned short [unsigned] [usertype] frag_threshold
drivers/net/wireless/wl12xx/wl1251_tx.c:118:32:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    expected unsigned short [unsigned] [usertype] length
drivers/net/wireless/wl12xx/wl1251_tx.c:164:24:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    expected unsigned short [unsigned] [usertype] rate
drivers/net/wireless/wl12xx/wl1251_tx.c:166:22:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    expected unsigned int [unsigned] [usertype] expiry_time
drivers/net/wireless/wl12xx/wl1251_tx.c:167:29:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43: warning: incorrect type in argument 1 (different base types)
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    expected restricted __le16 [usertype] fc
drivers/net/wireless/wl12xx/wl1251_tx.c:200:43:    got unsigned short [unsigned] [assigned] [usertype] fc
  CHECK   drivers/net/wireless/wl12xx/wl1251_cmd.c
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    expected unsigned int [unsigned] [usertype] rx_config_options
drivers/net/wireless/wl12xx/wl1251_cmd.c:428:39:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    expected unsigned int [unsigned] [usertype] rx_filter_options
drivers/net/wireless/wl12xx/wl1251_cmd.c:429:39:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    expected unsigned short [unsigned] [usertype] tx_rate
drivers/net/wireless/wl12xx/wl1251_cmd.c:435:29:    got restricted __le16 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    expected unsigned int [unsigned] [usertype] min_duration
drivers/net/wireless/wl12xx/wl1251_cmd.c:439:47:    got restricted __le32 [usertype] <noident>
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47: warning: incorrect type in assignment (different base types)
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    expected unsigned int [unsigned] [usertype] max_duration
drivers/net/wireless/wl12xx/wl1251_cmd.c:441:47:    got restricted __le32 [usertype] <noident>
  CHECK   drivers/net/wireless/wl12xx/wl1251_boot.c
drivers/net/wireless/wl12xx/wl1251_boot.c:228:22: warning: symbol 'interrupt' shadows an earlier one
/home/linville/git/wireless-next-2.6/arch/x86/include/asm/hw_irq.h:132:13: originally declared here

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlagn: use __packed on new structure definitions
John W. Linville [Mon, 26 Jul 2010 19:04:12 +0000 (15:04 -0400)]
iwlagn: use __packed on new structure definitions

"iwlagn: add statistic notification structure for WiFi/BT devices" added
several new '__attribute__ ((packed))' lines.  Change them to the
generic __packed.

Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agoiwlwifi: remove spurious semicolons
Johannes Berg [Thu, 15 Jul 2010 18:48:21 +0000 (11:48 -0700)]
iwlwifi: remove spurious semicolons

defines shouldn't be terminated with a
semicolon, the code using them should
supply it. Luckily these are not used
in a context where it matters.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlwifi: reduce beacon fill conditions
Johannes Berg [Thu, 15 Jul 2010 12:59:07 +0000 (05:59 -0700)]
iwlwifi: reduce beacon fill conditions

Since the ibss_beacon variable will only be
filled in the appropriate modes, there's no
reason to be checking the mode again.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlwifi: read multiple MAC addresses
Wey-Yi Guy [Thu, 15 Jul 2010 12:58:30 +0000 (05:58 -0700)]
iwlwifi: read multiple MAC addresses

Some devices may have multiple MAC
addresses in their EEPROM, read them
and advertise them to cfg80211.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
14 years agoiwlwifi: make iwl_mac_beacon_update static
Johannes Berg [Thu, 15 Jul 2010 12:57:48 +0000 (05:57 -0700)]
iwlwifi: make iwl_mac_beacon_update static

This function is only needed in the same
file it is defined in, i.e. iwl-core.c

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlagn: fix firmware loading TLV error path
Johannes Berg [Wed, 14 Jul 2010 16:34:50 +0000 (09:34 -0700)]
iwlagn: fix firmware loading TLV error path

gcc complains about the firmware loading:

iwl-agn.c: In function ‘iwlagn_load_firmware’:
iwl-agn.c:1860: warning: ‘tlv_len’ may be used uninitialized in this function
iwl-agn.c:1861: warning: ‘tlv_type’ may be used uninitialized in this function
iwl-agn.c:1862: warning: ‘tlv_data’ may be used uninitialized in this function

This is almost correct but we do do break out of the TLV
parsing loop when setting ret. However, the code is hard
to follow, and clearly even the compiler is having issues
with it too.

Additionally, however, the current code is wrong. If there
is a TLV length check error, the code will report
invalid TLV after parsing: ...
because "len" will still be non-zero as we broke out of
the loop.

So to remove the warning and fix that issue, make the code
easier to read by doing length checking with an error label.
As a result, we can completely remove the "ret" variable.

Also, while at it, remove the "fixed_tlv_size" variable
since each TLV type has its own specified length, it just
happens that we have only variable length, flags (0 length)
and u32 TLVs right now. It should still be checked with more
explicit length checks to make it easier to understand.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlwifi: add TLV to specify the size of phy calibration table
Wey-Yi Guy [Wed, 14 Jul 2010 00:13:15 +0000 (17:13 -0700)]
iwlwifi: add TLV to specify the size of phy calibration table

Different devices have different size of phy calibration table; add
new TLV to specify the size. If the TLV is not part of uCode header, the
default table size will be used to make sure the backward
compatibilities.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlagn: add bluetooth stats to debugfs
Wey-Yi Guy [Wed, 14 Jul 2010 15:09:55 +0000 (08:09 -0700)]
iwlagn: add bluetooth stats to debugfs

For WiFi/BT combo devices, add bluetooth statistics counter
read function to debugfs.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlagn: Add support for bluetooth statistics notification
Wey-Yi Guy [Wed, 14 Jul 2010 15:08:57 +0000 (08:08 -0700)]
iwlagn: Add support for bluetooth statistics notification

WiFi/BT combo devices has different statistics notification
structure, adding the support here to make sure the structure
align correctly.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlagn: add .cfg flag to idenfity the need for bt statistics
Wey-Yi Guy [Wed, 14 Jul 2010 15:08:05 +0000 (08:08 -0700)]
iwlagn: add .cfg flag to idenfity the need for bt statistics

Only WiFi/BT combo devices need to use bluetooth version of statistics
notification; adding the flag in .cfg file to indicate the need for
using different data structure.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agoiwlagn: add statistic notification structure for WiFi/BT devices
Wey-Yi Guy [Wed, 14 Jul 2010 15:07:27 +0000 (08:07 -0700)]
iwlagn: add statistic notification structure for WiFi/BT devices

If its WiFi/BT combo device, the statistics notification sent by
uCode will include the additional BT related statistics counters.

Adding new data structure to support the new layout.

Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
14 years agomac80211: proper IBSS locking
Johannes Berg [Wed, 21 Jul 2010 09:30:27 +0000 (11:30 +0200)]
mac80211: proper IBSS locking

IBSS has never had locking, instead relying on some
memory barriers etc. That's hard to get right, and
I think we had it wrong too until the previous patch.
Since this is not performance sensitive, it doesn't
make sense to have the maintenance overhead of that,
so add proper locking.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: fix IBSS lockdep complaint
Johannes Berg [Wed, 21 Jul 2010 08:52:40 +0000 (10:52 +0200)]
mac80211: fix IBSS lockdep complaint

Bob reported a lockdep complaint originating in
the mac80211 IBSS code due to the common work
struct patch. The reason is that the IBSS and
station mode code have different locking orders
for the cfg80211 wdev lock and the work struct
(where "locking" implies running/canceling).

Fix this by simply not canceling the work in
the IBSS code, it is not necessary since when
the REQ_RUN bit is cleared, the work will run
without effect if it runs. When the interface
is set down, it is flushed anyway, so there's
no concern about it running after memory has
been invalidated either.

This fixes
https://bugzilla.kernel.org/show_bug.cgi?id=16419

Additionally, looking into this I noticed that
there's a small window while the IBSS is torn
down in which the work may be rescheduled and
the REQ_RUN bit be set again after leave() has
cleared it when a scan finishes at exactly the
same time. Avoid that by setting the ssid_len
to zero before clearing REQ_RUN which signals
to the scan finish code that this interface is
not active.

Reported-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agomac80211: refuse shared key auth when WEP is unavailable
Johannes Berg [Wed, 21 Jul 2010 08:09:25 +0000 (10:09 +0200)]
mac80211: refuse shared key auth when WEP is unavailable

When WEP is not available, we should reject shared
key authentication because it could never succeed.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
14 years agocfg80211: fix race between sysfs and cfg80211
Maxime Bizon [Wed, 21 Jul 2010 15:21:38 +0000 (17:21 +0200)]
cfg80211: fix race between sysfs and cfg80211

device_add() is called before adding the phy to the cfg80211 device
list.

So if a userspace program uses sysfs uevents to detect new phy
devices, and queries nl80211 to get phy info, it can get ENODEV even
though the phy exists in sysfs.

An easy workaround is to hold the cfg80211 mutex until the phy is
present in sysfs/cfg80211/debugfs.

Signed-off-by: Maxime Bizon <mbizon@freebox.fr>
Signed-off-by: John W. Linville <linville@tuxdriver.com>