Johannes Berg [Mon, 6 Jun 2011 16:41:15 +0000 (09:41 -0700)]
iwlagn: don't check ucode subtype
The ucode subtypes keep changing, and there's no
particular reason to be checking them (other than
a paranoid sanity check). Since the numbers are
also in conflict between different ucode images
now, simply don't check them any more and rely on
the images being built correctly.
Also, to indicate that, rename the constants and
the enum, moving it to a different file.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Larry Finger [Fri, 10 Jun 2011 16:05:23 +0000 (11:05 -0500)]
rtlwifi: Fix warnings on parisc arch
In "Build regressions/improvements in v3.0-rc2", Geert Uytterhoeven
reports a number of warnings that occur for parisc builds of rtlwifi
and dependents.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers: bcma: export bcma_core_disable() function
In the brcm80211 driver we disable the 80211 core when the driver is
'down'. The bcma_core_disable() function exactly does the same as
our implementation so exporting this function makes sense.
Cc: linux-wireless@vger.kernel.org Cc: Rafal Milecki <zajec5@gmail.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1) Avoid global adapter pointer usage
a) in sdio.c by moving some code from mwifiex_cleanup_module() to
mwifiex_sdio_remove().
b) in main.c by passing an extra parameter to few functions.
2) Add new variable "user_rmmod" to identify if mwifiex_sdio_remove()
callback function is called in card removal or rmmod context. These
code changes are adapted from Libertas driver.
3) Remove unnecessary NULL pointer check for "func" pointer in
mwifiex_sdio_remove().
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Recover from statistics code was added during 6xxx devices development,
I don't think is needed on old devices. Also it is suspicious to cause
random, unreproducible microcode errors and hangs. So remove it.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel Drake [Tue, 7 Jun 2011 17:15:57 +0000 (18:15 +0100)]
libertas: add sd8686 reset_card support
At http://dev.laptop.org/ticket/10748 we are seeing a case of the
libertas firmware randomly stopping responding to commands after
resume. Careful monitoring of communications indicates a firmware or
hardware bug, which has been reported to Marvell.
Work around this issue by adding a reset_card method; this is
automatically called when command timeouts are detected and provides an
instant recovery to this situation.
Signed-off-by: Daniel Drake <dsd@laptop.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Vincent Zweije [Tue, 7 Jun 2011 14:37:09 +0000 (16:37 +0200)]
networking: fix warning about unused label wake_up
Function ieee80211_reconfig in net/mac80211/util.c contains label wake_up
which is defined unconditionally, but only used with CONFIG_PM. Gcc
warns about this when CONFIG_PM is not defined.
This patch makes the label's definition dependent on CONFIG_PM too,
eliminating the warning.
Paul Stewart [Wed, 8 Jun 2011 12:52:52 +0000 (05:52 -0700)]
cfg80211: Ignore downstream DEAUTH for authtry_bsses
Downsteram DEAUTH messages do not refer to a current authentication
attempt -- AUTH responses do. Therefore we should not allow DEAUTH
from an AP to void state for an AUTH attempt in progress.
Signed-off-by: Paul Stewart <pstew@chromium.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Mike McCormack [Mon, 6 Jun 2011 14:12:42 +0000 (23:12 +0900)]
rtlwifi: Resubmit skbs with bad CRC early
Once we realize a bad packet was received, don't
waste time unmapping it, freeing it, then allocation
a new skb and mapping it, just resubmit the existing
skb.
Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Eliad Peller [Mon, 6 Jun 2011 09:59:29 +0000 (12:59 +0300)]
mac80211: add ieee80211_get_operstate() function
Add ieee80211_get_operstate() function to get the operstate
of the netdevice.
This is needed for drivers that need to know when the interface
is IF_OPER_UP (e.g. wl12xx), and block notifiers can't be used
(e.g. because the interface is already IF_OPER_UP, like after
resuming from suspend)
Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
shutdown should wait for SCO link to be properly disconnected before
detroying the socket, otherwise an application using the socket may
assume link is properly disconnected before it really happens which
can be a problem when e.g synchronizing profile switch.
Signed-off-by: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Enabling DEBUG_STRICT_USER_COPY_CHECKS causes the following
warning:
In function 'copy_from_user',
inlined from 'rfcomm_sock_setsockopt' at
net/bluetooth/rfcomm/sock.c:705:
arch/x86/include/asm/uaccess_64.h:65:
warning: call to 'copy_from_user_overflow' declared with
attribute warning: copy_from_user() buffer size is not provably
correct
presumably due to buf_size being signed causing GCC to fail to
see that buf_size can't become negative.
Cc: Marcel Holtmann <marcel@holtmann.org> Cc: Gustavo F. Padovan <padovan@profusion.mobi> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Mat Martineau [Fri, 3 Jun 2011 23:21:07 +0000 (16:21 -0700)]
Bluetooth: Restore accidentally-deleted line
When code was moved from l2cap_core.c to l2cap_sock.c in commit 6de0702b5b93da0ef097aa092b4597fbc024ebba, one line was dropped
from the old __l2cap_sock_close() implementation. This sk_state
change should still be in l2cap_chan_close().
Signed-off-by: Mat Martineau <mathewm@codeaurora.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
If the link key is secure (authenticated or combination 16 digit)
the sec_level will be always BT_SECURITY_HIGH. Therefore, instead
of checking the link key type simply check the sec_level on the link.
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Jaikumar Ganesh [Tue, 24 May 2011 01:06:04 +0000 (18:06 -0700)]
Bluetooth: Add BT_POWER L2CAP socket option.
Add BT_POWER socket option used to control the power
characteristics of the underlying ACL link. When the remote end
has put the link in sniff mode and the host stack wants to send
data we need need to explicitly exit sniff mode to work well with
certain devices (For example, A2DP on Plantronics Voyager 855).
However, this causes problems with HID devices.
Hence, moving into active mode when sending data, irrespective
of who set the sniff mode has been made as a socket option. By
default, we will move into active mode. HID devices can set the
L2CAP socket option to prevent this from happening.
Currently, this has been implemented for L2CAP sockets. This has been
tested with incoming and outgoing L2CAP sockets for HID and A2DP.
Based on discussions on linux-bluetooth and patches submitted by
Andrei Emeltchenko.
Signed-off-by: Jaikumar Ganesh <jaikumar@google.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:57 +0000 (14:20 -0300)]
Bluetooth: Set 'peer_addr_type' in hci_le_connect()
Set the 'peer_addr_type' field of the LE Create Connection command
sent in hci_le_connect().
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:56 +0000 (14:20 -0300)]
Bluetooth: Check advertising cache in hci_connect()
When connecting to a LE device, we need to check the advertising
cache in order to know the address type of that device.
If its advertising entry is not found, the connection is not
established and hci_connect() returns error.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:55 +0000 (14:20 -0300)]
Bluetooth: Remove useless check in hci_connect()
There is no need to check the connection's state since hci_conn_add()
has just created a new connection and its state has been set properly.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Acked-by: Ville Tervo <ville.tervo@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Tue, 31 May 2011 17:20:54 +0000 (14:20 -0300)]
Bluetooth: Add 'dst_type' field to struct hci_conn
This patch adds a new field (dst_type) to the struct hci_conn which
holds the type of the destination address (bdaddr_t dst). This
approach is needed in order to use the struct hci_conn as an
abstraction of LE connections in HCI Layer. For non-LE this field
is ignored.
This patch also set properly the 'dst_type' field after initializing
LE hci_conn structures.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Legacy devices don't re-authenticate the link properly if a link key
already exists. Thus, don't update sec_level for this case even if
hci_auth_complete_evt indicates success. Otherwise the sec_level will
not reflect a real security on the link.
Signed-off-by: Waldemar Rymarkiewicz <waldemar.rymarkiewicz@tieto.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Thu, 26 May 2011 19:23:53 +0000 (16:23 -0300)]
Bluetooth: Advertising entries lifetime
This patch adds a timer to clear 'adv_entries' after three minutes.
After some amount of time, the advertising entries cached during
the last LE scan should be considered expired and they should be
removed from the advertising cache.
It was chosen a three minutes timeout as an initial attempt. This
value might change in future.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Thu, 26 May 2011 19:23:51 +0000 (16:23 -0300)]
Bluetooth: Add Advertising Report Meta Event handler
This patch adds a function to handle LE Advertising Report Meta
Events.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Anderson Briglia <anderson.briglia@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Andre Guedes [Thu, 26 May 2011 19:23:50 +0000 (16:23 -0300)]
Bluetooth: LE advertising cache
This patch implements the LE advertising cache. It stores sensitive
information (bdaddr and bdaddr_type so far) gathered from LE
advertising report events.
Only advertising entries from connectables devices are added to the
cache.
Signed-off-by: Andre Guedes <andre.guedes@openbossa.org> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Bluetooth: Remove export of l2cap_chan_clear_timer()
The call to l2cap_chan_clear_timer() is not really needed in l2cap_sock.c.
This patch also adds a call to l2cap_chan_clear_timer() to the only place
in __l2cap_sock_close() that wasn't calling it. It's safe call it there
because l2cap_chan_clear_timer() check first for timer_peding().
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This move all the sending logic to l2cap_core.c, but we still have a
socket dependence there, struct msghdr. It will be removed in some of the
further commits.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
This is actually __l2cap_sock_close() renamed to __l2cap_chan_close().
At a first look it may not make sense, but with the further cleanups that
will come it will.
Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Ruiyi Zhang [Fri, 13 May 2011 05:07:52 +0000 (13:07 +0800)]
Bluetooth: Allow unsegmented SDU retries on sock_queue_rcv_skb failure
In L2CAP_SDU_UNSEGMENTED case, if sock_queue_rcv_skb returns error,
l2cap_ertm_reassembly_sdu should not return 0 so as to insert the
skb into BUSY_QUEUE for later retries.
Signed-off-by: Ruiyi Zhang <Ruiyi.Zhang@Atheros.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
We use priv->mutex to avoid race conditions between chswitch_done()
and mac_channel_switch(), when marking channel switch in
progress. But chswitch_done() can be called in atomic context
from rx_csa() or with mutex already taken from commit_rxon().
To fix remove mutex from chswitch_done() and use atomic bitops
for marking channel switch pending.
Cc: stable@kernel.org # 2.6.39+ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 8 Jun 2011 11:27:29 +0000 (13:27 +0200)]
mac80211: fix IBSS teardown race
Ignacy reports that sometimes after leaving an IBSS
joining a new one didn't work because there still
were stations on the list. He fixed it by flushing
stations when attempting to join a new IBSS, but
this shouldn't be happening in the first case. When
I looked into it I saw a race condition in teardown
that could cause stations to be added after flush,
and thus cause this situation. Ignacy confirms that
after applying my patch he hasn't seen this happen
again.
Reported-by: Ignacy Gawedzki <i@lri.fr> Debugged-by: Ignacy Gawedzki <i@lri.fr> Tested-by: Ignacy Gawedzki <i@lri.fr> Cc: stable@kernel.org Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 27 May 2011 15:40:24 +0000 (08:40 -0700)]
iwlagn: send tx power command if defer cause by RXON not match
During channge channel, tx power will not send to uCode, the tx power command
should send after scan complete. but should also can send after RXON command.
Stable fix identified by Stanislaw Gruszka <sgruszka@redhat.com>.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Cc: stable@kernel.org [2.6.38+] Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: disable transmission buffer aggregation for AMSDU packets
Padding per MSDU will affect the length of next packet and hence
the exact length of next packet is uncertain here.
Also, aggregation of transmission buffer, while downloading the
data to the card, wont gain much on the AMSDU packets as the AMSDU
packets utilizes the transmission buffer space to the maximum
(adapter->tx_buf_size).
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mwifiex: adding check for enough space before padding
All MSDUs, except the last one in an AMSDU, should end up at 4
bytes boundary. There is need to check if enough skb_tailroom
space exists before padding the skb.
Also re-arranging code for better readablity.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Use less indentions and remove uneeded irq-save flags.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Shahar Levi [Sun, 22 May 2011 13:10:21 +0000 (16:10 +0300)]
mac80211: Stop BA session event from device
Some devices support BT/WLAN co-existence algorigthms.
In order not to harm the system performance and user experience, the device
requests not to allow any RX BA session and tear down existing RX BA sessions
based on system constraints such as periodic BT activity that needs to limit
WLAN activity (eg.SCO or A2DP).
In such cases, the intention is to limit the duration of the RX PPDU and
therefore prevent the peer device to use A-MPDU aggregation.
Adding ieee80211_stop_rx_ba_session() callback
that can be used by the driver to stop existing BA sessions.
Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luciano Coelho [Tue, 7 Jun 2011 17:42:26 +0000 (20:42 +0300)]
nl80211: fix overflow in ssid_len
When one of the SSID's length passed in a scan or sched_scan request
is larger than 255, there will be an overflow in the u8 that is used
to store the length before checking. This causes the check to fail
and we overrun the buffer when copying the SSID.
Fix this by checking the nl80211 attribute length before copying it to
the struct.
Signed-off-by: Mike McCormack <mikem@ring3k.org> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Mike McCormack [Mon, 30 May 2011 23:50:24 +0000 (08:50 +0900)]
rtlwifi: Fix logic in rx_interrupt
Should pass along packet if there's no CRC and no hardware error.
Signed-off-by: Mike McCormack <mikem@ring3k.org> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The mac80211 maintainer raised complaints about abuse of the CSA stop
reason, and about whether this patch actually serves its intended
purpose at all.
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Setting tx power can be deferred during scan or changing channel.
If after that correct tx power settings will not be sent to device,
we can observe transmission problems and timeouts. Force to send
tx power settings also after partial rxon change, to assure device
always be configured with up-to-date settings.
iwlagn: use cts-to-self protection on 5000 adapters series
This patch fixes 802.11n stability and performance regression we have
since 2.6.35. It boost performance on my 5GHz N-only network from about
5MB/s to 8MB/s. Similar percentage boost can be observed on 2.4 GHz.
These are test results of 5x downloading of approximately 700MB iso
image:
This was achieved with NetworkManager configured to do not perform
periodical scans, by configuring constant BSSID. With periodical scans,
after some time, performance downgrade to unpatched driver level, like
in example below:
However patch still make better here, since similar test on unpatched
driver make link disconnects with below messages after some time:
wlan1: authenticate with 00:23:69:35:d1:3f (try 1)
wlan1: authenticate with 00:23:69:35:d1:3f (try 2)
wlan1: authenticate with 00:23:69:35:d1:3f (try 3)
wlan1: authentication with 00:23:69:35:d1:3f timed out
On 2.6.35 kernel patch helps against connection hangs with messages:
iwlagn 0000:20:00.0: queue 10 stuck 3 time. Fw reload.
iwlagn 0000:20:00.0: On demand firmware reload
iwlagn 0000:20:00.0: Stopping AGG while state not ON or starting
Cc: stable@kernel.org # 2.6.35+ Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Wey-Yi Guy [Fri, 3 Jun 2011 14:54:13 +0000 (07:54 -0700)]
iwlagn: set smps mode after assoc for 1000 device
For some timing reason, 1000 device having problem to kick-in to aggregation
without sending rxon assoc command. This is a W/A until find the real reason
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Greg Dietsche [Fri, 3 Jun 2011 02:06:08 +0000 (21:06 -0500)]
iwlegacy: return -EINVAL instead of -1
Cleanup the code to return -EINVAL instead of -1 Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu> Signed-off-by: John W. Linville <linville@tuxdriver.com>