Arend van Spriel [Tue, 20 Aug 2013 14:00:35 +0000 (16:00 +0200)]
brcmsmac: cosmetic change in phy_lcn.c
Cleaning up some code fragments reducing indentation and uncluttering
some lines. Apart from whitespace there are no actual code changes
made.
Cc: Jonas Gorski <jogo@openwrt.org> Tested-by: David Herrmann <dh.herrmann@gmail.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The Network Manager attempts to use all 3 interfaces above without
filtering the managed interface type. As the result, 3 identical
interfaces are displayed under network manager. If user happens to
click on an entry under which its interface is uap0 or p2p0, the
association will fail.
Work around it by removing the creation of AP and P2P interfaces
at driver loading time. These interfaces can be added with 'iw' or
other applications manually when they are needed.
Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: Avinash Patil <patila@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Sat, 17 Aug 2013 12:09:33 +0000 (14:09 +0200)]
rt2x00: rt2800lib: adjust frequency offset for RF3053
Along with other chipsets, the Ralink driver uses the
frequency adjustment code for RF3053 as well. Remove
the bogus place-holder comment from the RF3053 specific
channel configuration function and call the frequency
adjustment function instead
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RT3593_ChipSwitchChannel function in chips/rt3593.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Sat, 17 Aug 2013 12:09:31 +0000 (14:09 +0200)]
rt2x00: rt2800lib: use step-by-step frequency offset adjustment on MMIO devices
According to the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver, the RFCSR17 register can't be programmed in
one step on devices which are using the frequency
offset adjustment code.
Update the code to use step-by-step adjustment.
Reference:
RT30xxWriteRFRegister function in common/rt_rf.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Sat, 17 Aug 2013 12:09:30 +0000 (14:09 +0200)]
rt2x00: rt2800lib: use a MCU command for frequency adjustment on USB devices
According to the Ralink driver, there is an MCU
command which can be used to send the frequency
offset value directly to the USB device without
going through the RFCSR writing sequence.
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RTMPAdjustFrequencyOffset function in common/rt_rf.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Sat, 17 Aug 2013 12:09:29 +0000 (14:09 +0200)]
rt2x00: rt2800lib: optimize frequency offset adjustment
Don't write the new value into the register if it is
the same as the old value to avoid unncessary USB bus
traffic with USB devices. The change also saves a few
cycle on MMIO based devices.
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RTMPAdjustFrequencyOffset function in common/rt_rf.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Sat, 17 Aug 2013 12:09:28 +0000 (14:09 +0200)]
rt2x00: rt2800lib: fix frequency offset boundary calculation
The current code in the 'rt2800_adjust_freq_offset'
function limits the device specific frequency offset
value to FREQ_BOUND but ignores the fact that the
uppermost bit is not part of the frequency offset
value. As the result, the driver always uses the
FREQ_BOUND value if the uppermost bit is set.
Update the code to use the correct source value
for calculating the boundary.
Based on the DPO_RT5572_LinuxSTA_2.6.0.1_20120629
driver.
Reference:
RTMPAdjustFrequencyOffset function in common/rt_rf.c
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Fri, 16 Aug 2013 22:15:50 +0000 (00:15 +0200)]
rt2x00: rt2800lib: pass beacon index to rt2800_clear_beacon_register
Instead of precomputing the beacon base in
each caller, pass the beacon index to the
'rt2800_clear_beacon_register' function
and compute the beacon base in there.
This allows to simplify the caller functions
a bit.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Gabor Juhos [Fri, 16 Aug 2013 22:15:49 +0000 (00:15 +0200)]
rt2x00: rt2800: rename HW_BEACON_OFFSET macro
The name of the HW_BEACON_OFFSET macro is a
bit confusing. It returns with one of the
HW_BEACON_BASE* values, so rename the macro
to HW_BEACON_BASE to reflect that.
The patch contains no functional changes.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Frédéric Dalleau [Mon, 19 Aug 2013 12:24:03 +0000 (14:24 +0200)]
Bluetooth: Add SCO connection fallback
When initiating a transparent eSCO connection, make use of T2 settings
at first try. T2 is the recommended settings from HFP 1.6 WideBand
Speech. Upon connection failure, try T1 settings.
When CVSD is requested and eSCO is supported, try to establish eSCO
connection using S3 settings. If it fails, fallback in sequence to S2,
S1, D1, D0 settings.
To know which setting should be used, conn->attempt is used. It
indicates the currently ongoing SCO connection attempt and can be used
as the index for the fallback settings table.
These setting and the fallback order are described in Bluetooth HFP 1.6
specification p. 101.
Frédéric Dalleau [Mon, 19 Aug 2013 12:24:02 +0000 (14:24 +0200)]
Bluetooth: Handle specific error for SCO connection fallback
Synchronous Connection Complete event can return error "Connection
Rejected due to Limited resources (0x10)".
Handling this error is required for SCO connection fallback. This error
happens when the server tried to accept the connection but failed to
negotiate settings.
This error code has been verified experimentally by sending a T2 request
to a T1 only SCO listener.
Frédéric Dalleau [Mon, 19 Aug 2013 12:24:01 +0000 (14:24 +0200)]
Bluetooth: Prevent transparent SCO on older devices
Older Bluetooth devices may not support Setup Synchronous Connection or
SCO transparent data. This is indicated by the corresponding LMP feature
bits. It is not possible to know if the adapter support these features
before setting BT_VOICE option since the socket is not bound to an
adapter. An adapter can also be added after the socket is created. The
socket can be bound to an address before adapter is plugged in.
Thus, on a such adapters, if user request BT_VOICE_TRANSPARENT, outgoing
connections fail on connect() and returns -EOPNOTSUPP. Incoming
connections do not fail. However, they should only be allowed depending
on what was specified in Write_Voice_Settings command.
EOPNOTSUPP is choosen because connect() system call is failing after
selecting route but before any connection attempt.
Frédéric Dalleau [Mon, 19 Aug 2013 12:24:00 +0000 (14:24 +0200)]
Bluetooth: Add constants and macro declaration for transparent data
This patch defines constants and macro for transparent data LMP
features. It refers to Bluetooth Core V4.0 specification, Part C, Chap
3.3 which defines LMP feature mask.
Frédéric Dalleau [Mon, 19 Aug 2013 12:23:59 +0000 (14:23 +0200)]
Bluetooth: Parameters for outgoing SCO connections
In order to establish a transparent SCO connection, the correct settings
must be specified in the Setup Synchronous Connection request. For that,
a setting field is added to ACL connection data to set up the desired
parameters. The patch also removes usage of hdev->voice_setting in CVSD
connection and makes use of T2 parameters for transparent data.
Frédéric Dalleau [Mon, 19 Aug 2013 12:23:58 +0000 (14:23 +0200)]
Bluetooth: Use voice setting in deferred SCO connection request
When an incoming eSCO connection is requested, check the selected voice
setting and reply appropriately. Voice setting should have been
negotiated previously. For example, in case of HFP, the codec is
negotiated using AT commands on the RFCOMM channel. This patch only
changes replies for socket with deferred setup enabled.
Frédéric Dalleau [Mon, 19 Aug 2013 12:23:57 +0000 (14:23 +0200)]
Bluetooth: Add constants for SCO airmode
This patch defines constants for SCO airmode from SCO voice setting. It
refers to Bluetooth Core V4.0 specification, Part E, Chap 6.12 which
describe SCO voice setting format.
Frédéric Dalleau [Mon, 19 Aug 2013 12:23:56 +0000 (14:23 +0200)]
Bluetooth: Add Bluetooth socket voice option
This patch extends the current Bluetooth socket options with BT_VOICE.
This is intended to choose voice data type at runtime. It only applies
to SCO sockets. Incoming connections shall be setup during deferred
setup. Outgoing connections shall be setup before connect(). The desired
setting is stored in the SCO socket info. This patch declares needed
members, modifies getsockopt() and setsockopt().
Frédéric Dalleau [Mon, 19 Aug 2013 12:23:55 +0000 (14:23 +0200)]
Bluetooth: Remove unused mask parameter in sco_conn_defer_accept
From Bluetooth Core v4.0 specification, 7.1.8 Accept Connection Request
Command "When accepting synchronous connection request, the Role
parameter is not used and will be ignored by the BR/EDR Controller."
Frédéric Dalleau [Mon, 19 Aug 2013 12:23:54 +0000 (14:23 +0200)]
Bluetooth: Use hci_connect_sco directly
hci_connect is a super function for connecting hci protocols. But the
voice_setting parameter (introduced in subsequent patches) is only
needed by SCO and security requirements are not needed for SCO channels.
Thus, it makes sense to have a separate function for SCO.
Bluetooth: Purge the dlc->tx_queue to avoid circular dependency
In rfcomm_tty_cleanup we purge the dlc->tx_queue which may contain
socket buffers referencing the tty_port and thus preventing the tty_port
destruction.
The tty_port can be released in two cases: when we get a HUP in the
functions rfcomm_tty_hangup() and rfcomm_dev_state_change(). Or when the
user releases the device in rfcomm_release_dev().
In these cases we set the flag RFCOMM_TTY_RELEASED so that no other
function can get a reference to the tty_port.
The use of !test_and_set_bit(RFCOMM_TTY_RELEASED) ensures that the
'initial' tty_port reference is only dropped once.
The rfcomm_dev_del function is removed becase it isn't used anymore.
Bluetooth: Implement .activate, .shutdown and .carrier_raised methods
Implement .activate, .shutdown and .carrier_raised methods of tty_port
to manage the dlc, moving the code from rfcomm_tty_install() and
rfcomm_tty_cleanup() functions.
At the same time the tty .open()/.close() and .hangup() methods are
changed to use the tty_port helpers that properly call the
aforementioned tty_port methods.
Bluetooth: Move the tty initialization and cleanup out of open/close
Move the tty_struct initialization from rfcomm_tty_open() to
rfcomm_tty_install() and do the same for the cleanup moving the code from
rfcomm_tty_close() to rfcomm_tty_cleanup().
Add also extra error handling in rfcomm_tty_install() because, unlike
.open()/.close(), .cleanup() is not called if .install() fails.
Bluetooth: Remove the device from the list in the destructor
The current code removes the device from the device list in several
places. Do it only in the destructor instead and in the error path of
rfcomm_add_dev() if the device couldn't be initialized.
In net/bluetooth/rfcomm/tty.c the struct tty_struct is used without
taking references. This may lead to a use-after-free of the rfcomm tty.
Fix this by taking references properly, using the tty_port_* helpers
when possible.
The raw assignments of dev->port.tty in rfcomm_tty_open/close are
addressed in the later commit 'rfcomm: Implement .activate, .shutdown
and .carrier_raised methods'.
Marcel Holtmann [Tue, 13 Aug 2013 17:00:54 +0000 (10:00 -0700)]
Bluetooth: Set different event mask for LE-only controllers
In case of a Low Energy only controller it makes no sense to configure
the full BR/EDR event mask. It will just enable events that can not be
send anyway and there is no guarantee that such a controller will accept
this value.
Use event mask 0x90 0xe8 0x04 0x02 0x00 0x80 0x00 0x20 for LE-only
controllers which enables the following events:
Disconnection Complete
Encryption Change
Read Remote Version Information Complete
Command Complete
Command Status
Hardware Error
Number of Completed Packets
Data Buffer Overflow
Encryption Key Refresh Complete
LE Meta
This is according to Core Specification, Part E, Section 3.
Johan Hedberg [Thu, 8 Aug 2013 11:53:56 +0000 (14:53 +0300)]
Bluetooth: Fix getting SCO socket options in deferred state
When a socket is in deferred state there does actually exist an
underlying connection even though the connection state is not yet
BT_CONNECTED. In the deferred state it should therefore be allowed to
get socket options that usually depend on a connection, such as
SCO_OPTIONS and SCO_CONNINFO.
This patch fixes the behavior of some user space code that behaves as
follows without it:
$ sudo tools/btiotest -i 00:1B:DC:xx:xx:xx -d -s
accept=2 reject=-1 discon=-1 defer=1 sec=0 update_sec=0 prio=0 voice=0x0000
Listening for SCO connections
bt_io_get(OPT_DEST): getsockopt(SCO_OPTIONS): Transport endpoint is not connected (107)
Accepting connection
Successfully connected to 60:D8:19:xx:xx:xx. handle=43, class=000000
The conditions that the patch updates the if-statements to is taken from
similar code in l2cap_sock.c which correctly handles the deferred state.
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk>
The rt2800pci driver uses the same [RT]XWI size
for all chipsets, however some chips requires
different values.
The size of the [RT]XWI structures is a constant
value for a given chipset and it does not depend
on the underlying interface. Add a helper function
which returns the correct values for the actual
chipset and use the new helper both in the rt2800usb
and in the rt2800pci drivers. This ensures that both
drivers are using the correct values.
Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:38 +0000 (08:01 +0200)]
ath9k: enable CSA functionality in ath9k
CSA is only enabled for one interface, but the same limitation applies
for mac80211 too. It checks whether the beacon has been sent (different
approaches for non-EDMA-enabled and EDMA-enabled devices), and completes
the channel switch after that.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:37 +0000 (08:01 +0200)]
ath5k: enable support for 5 MHz and 10 MHz channels
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:36 +0000 (08:01 +0200)]
ath5k: set 5/10 MHz supported channels and fix duration
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:35 +0000 (08:01 +0200)]
ath5k: report 5/10 MHz channels
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:34 +0000 (08:01 +0200)]
ath9k: announce that ath9k supports 5/10 MHz
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:33 +0000 (08:01 +0200)]
ath9k: set 5/10 MHz supported channels and fix bitrate
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:32 +0000 (08:01 +0200)]
ath9k: report 5/10 MHz channels
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Fri, 16 Aug 2013 08:46:04 +0000 (10:46 +0200)]
ath9k: use chandef instead of channel_type
To enable support for 5/10 MHz, some internal functions must be
converted from using the (old) channel_type to chandef. This is a good
chance to change all remaining occurences.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Simon Wunderlich [Wed, 14 Aug 2013 06:01:30 +0000 (08:01 +0200)]
ath9k: always use SIFS times from OFDM for 5/10 MHz
5/10 MHz channels should always use SIFS times as defined in IEEE
802.11-2012 18.4.4 (OFDM PHY characteristics). This makes it compatible
to ath5k, which does the same.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 7 Aug 2013 18:11:55 +0000 (20:11 +0200)]
mac80211: add APIs to allow keeping connections after WoWLAN
In order to be able to (securely) keep connections alive after
the system was suspended for WoWLAN, we need some additional
APIs. We already have API (ieee80211_gtk_rekey_notify) to tell
wpa_supplicant about the new replay counter if GTK rekeying
was done by the device while the host was asleep, but that's
not sufficient.
If GTK rekeying wasn't done, we need to tell the host about
sequence counters for the GTK (and PTK regardless of rekeying)
that was used while asleep, add ieee80211_set_key_rx_seq() for
that.
If GTK rekeying was done, then we need to be able to disable
the old keys (with ieee80211_remove_key()) and allocate the
new GTK key(s) in mac80211 (with ieee80211_gtk_rekey_add()).
If protocol offload (e.g. ARP) is implemented, then also the
TX sequence counter for the PTK must be updated, using the new
ieee80211_set_key_tx_seq() function.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
mac80211: move ibss presp generation in own function
Channel Switch will later require to generate beacons without setting
them immediately. Therefore split the presp generation in an own
function. Splitting the original very long function might be a good idea
anyway.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johan Almbladh [Wed, 14 Aug 2013 13:29:46 +0000 (15:29 +0200)]
mac80211: perform power save processing before decryption
This patch decouples the power save processing from the frame decryption
by running the decrypt rx handler after sta_process. In the case where
the decryption failed for some reason, the stack used to not process
the PM and MOREDATA bits for that frame. The stack now always performs
power save processing regardless of the decryption result. That means that
encrypted data frames and NULLFUNC frames are now handled in the same way
regarding power save processing, making the stack more robust.
Signed-off-by: Johan Almbladh <ja@anyfi.net> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
The Performance Based Window snooze mechanism is based on uAPSD and is
used in low-medium traffic scenarios, in order to provide better power
performance while insuring low latency and jitter for the incoming traffic.
This patch enables PBW snoozing in case uAPSD is enabled and all ACs are
uAPSD trigger and delivery enabled.
Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Use beacon statistics notification to track RSSI.
Notify mac80211 when the tresholds are crossed.
The roaming treshold is configured to be
equal to cqm_thold. If the beacon filtering command
is not supported by fw fall back and use mac80211
mechanism.
Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Luciano Coelho [Tue, 13 Aug 2013 07:34:55 +0000 (10:34 +0300)]
iwlwifi: return -ENOMEM instead of NULL when OOM in iwl_drv_start()
The callers of iwl_drv_start() are probe functions. If a probe
function returns 0, it means it succeeded. So if NULL was returned by
iwl_drv_start(), it would be considered as a success.
Fix this by returning -ENOMEM if the driver struct allocation fails in
iwl_drv_start().
Signed-off-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Tue, 6 Aug 2013 16:28:26 +0000 (18:28 +0200)]
iwlwifi: mvm: refactor resume from WoWLAN code
To be able to add more logic to the resume code, refactor it a bit,
moving some status checking/reporting logic into a new function.
The locking becomes a bit odd (one of the new functions now unlocks
the mutex) but this will be required to call new mac80211 APIs in
there later.
Reviewed-by: Luciano Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
As the patch adds a new failure mechanism to dma_rxfill(). When I changed the
comment at the start of the routine to add that information, I also polished
the wording.
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Cc: Stable <stable@vger.kernel.org> Cc: Brett Rudley <brudley@broadcom.com> Cc: Franky (Zhenhui) Lin <frankyl@broadcom.com> Cc: Hante Meuleman <meuleman@broadcom.com> Cc: brcm80211-dev-list@broadcom.com Acked-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Mark Schulte [Wed, 31 Jul 2013 07:08:27 +0000 (00:08 -0700)]
rtlwifi: sparse warnings: cast to restricted type
Adding type casts to suppress sparse warnings:
* warning: cast to restricted __le32/__le16
Signed-off-by: Mark Schulte <schultetwin@gmail.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Wed, 14 Aug 2013 15:45:57 +0000 (21:15 +0530)]
ath9k: Use lockless variant to initialize RX fifo
Since the rx_fifo queue is accessed only using the various
lockless SKB queue routines, there is no need to initialize
the lock and __skb_queue_head_init() can be used.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Wed, 14 Aug 2013 15:45:56 +0000 (21:15 +0530)]
ath9k: Optimize LNA check
The documentation for antenna diversity says:
"The decision of diversity is done at 802.11 preamble. So, for
11G/11B, for every MAC packet hardware will do a decision. But in
11N with aggregation, the decision is made only at the preamble and
all other MPDUs will use the same LNA as the first MPDU."
Make use of rs_firstaggr to avoid needlessly scanning for LNA
changes.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Wed, 14 Aug 2013 03:41:21 +0000 (09:11 +0530)]
ath9k: Fix error condition for corrupt descriptors
In case a descriptor has the "done" bit clear and the
next descriptor has it set, we drop both of them. If
the packet that is received after these two packets
is dropped for some reason, "discard_next" will not cleared.
Fix this.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Sujith Manoharan [Wed, 14 Aug 2013 03:41:10 +0000 (09:11 +0530)]
ath9k: Fix phy error handling for DFS
Since the DFS code appears to process the phy errors
ATH9K_PHYERR_RADAR and ATH9K_PHYERR_FALSE_RADAR_EXT,
check for the correct phyerr status in the main RX
tasklet routine.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Oleksij Rempel [Tue, 13 Aug 2013 19:10:19 +0000 (21:10 +0200)]
ath9k_htc: do not use bulk on EP3 and EP4
If usb auto suspend is enabled or system run in to suspend/resume
cycle, ath9k-htc adapter will stop to response. It is reproducible on xhci HCs.
Host part of problem:
XHCI do timing calculation based on Transfer Type and bInterval,
immediately after device was detected. Ath9k-htc try to overwrite
this parameters on module probe and some changes in FW,
since we do not initiate usb reset from the driver this changes
are not took to account. So, before any kind of suspend or reset,
host controller will operate with old parameters. Only after suspend/resume
and if interface id stay unchanged, new parameters will by applied. Host
will send bulk data with no intervals (?), which will cause
overflow on FIFO of EP4.
Firmware part of problem:
By default, ath9k-htc adapters configured with EP3 and EP4
as interrupt endpoints. Current firmware will try to overwrite
ConfigDescriptor to make EP3 and EP4 bulk. FIFO for this endpoints
stay not reconfigured, so under the hood it is still Int EP.
This patch is revert of 4a0e8ecca4ee commit which trying to
reduce CPU usage on some systems. Since it will produce more bug
as fixes, we will need to find other way to fix it.
here is comment from kernel source which has some more explanation:
* Some buggy high speed devices have bulk endpoints using
* maxpacket sizes other than 512. High speed HCDs may not
* be able to handle that particular bug, so let's warn...
in our case EP3 and EP4 have maxpacket sizes = 64!!!
Signed-off-by: Oleksij Rempel <linux@rempel-privat.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
wil6210: let IP stack re-check HW TCP/UDP csum errors
Fix for TCP iperf from Windows to Linux stall after about 1sec
Hardware reports false errors in some situations:
Microsoft IP stack, in violation of RFC 1624, set TCP checksum that should be 0x0
as 0xffff. hardware report Rx csum error. If HW csum absolutely trusted,
this frame can be never received, as re-transmitted one will have same csum problem.
In addition, it mess up block ack reorder buffer, as if packet dropped, it is not score boarded
there.
Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 13 Aug 2013 10:33:30 +0000 (12:33 +0200)]
ath9k: reset buffer stale flag in ath_tx_get_tid_subframe
If that flag stays set for a buffer that already ran through the tx path
once, it might cause issues in tx completion processing. Better clear it
early to ensure that this does not happen
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Tue, 13 Aug 2013 10:33:29 +0000 (12:33 +0200)]
ath9k: simplify ath_tid_drain
ath_tid_drain is only called when a station entry is being removed, so
there is no point in still tracking BAW state. Remove some unnecessary
code and a bogus TODO comment related to this.
Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Felix Fietkau [Sat, 10 Aug 2013 13:59:15 +0000 (15:59 +0200)]
ath9k: fix rx descriptor related race condition
Similar to a race condition that exists in the tx path, the hardware
might re-read the 'next' pointer of a descriptor of the last completed
frame. This only affects non-EDMA (pre-AR93xx) devices.
To deal with this race, defer clearing and re-linking a completed rx
descriptor until the next one has been processed.
Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Franky Lin [Sat, 10 Aug 2013 10:27:29 +0000 (12:27 +0200)]
brcmfmac: use configurable sdio bus header length for tx packet
Host tx glomming require an extended hardware sdio bus header to store
information for dongle. Introduce a variable in struct brcmf_sdio to replace
macro SDPCM_HDRLEN
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Franky Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Sat, 10 Aug 2013 10:27:24 +0000 (12:27 +0200)]
brcmfmac: ignore IF event if firmware indicates it
Not every IF event from the firmware needs to result in a
related interface, netdev or wdev, on the host. This is
indicated in the event message. Handle that flag and effectively
ignore the firmware event.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hante Meuleman [Sat, 10 Aug 2013 10:27:23 +0000 (12:27 +0200)]
brcmfmac: no fws locking outside fws module.
FWS uses locking to protect its data while being called from
various entries. On bus_txdata the lock was kept resulting in
unnecessary long locking, but also creating possibility for
deadlock. This update changes the locking to release lock when
bus_txdata is called.
Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hante Meuleman [Sat, 10 Aug 2013 10:27:22 +0000 (12:27 +0200)]
brcmfmac: always use worker thread for tx data.
When fw signalling is disabled tx is sent immediately. Using
queues and worker thread allows usb to do synchronous autopm. This
patch makes fws use queues and worker thread even if signalling is
not supported by FW or not enabled.
Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Sat, 10 Aug 2013 10:27:21 +0000 (12:27 +0200)]
brcmfmac: add AMPDU reordering functionality
This feature moves the responsibility of collecting all MPDUs in an
AMPDU session in the correct order from the firmware to the host
driver. This reduces buffer requirement on the firmware side.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Sat, 10 Aug 2013 10:27:20 +0000 (12:27 +0200)]
brcmfmac: .txdata() bus callback should not call brcmf_txcomplete()
With firmware-signalling the packet handed to the bus specific driver
layer should not be discarded with brcmf_txcomplete() in the failure
path. Instead only an error is returned and the caller decides what
to do with the packet.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arend van Spriel [Sat, 10 Aug 2013 10:27:19 +0000 (12:27 +0200)]
brcmfmac: use irq safe spinlock in brcmf_sdbrcm_txdata()
Firmware-signalling needs transmit to firmware to be atomic and
uses a spinlock with irq disabled. Therefor, brcmf_sdbrcm_txdata()
should not use spin_unlock_bh() as it would enable the interrupts.
Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Thu, 15 Aug 2013 19:55:10 +0000 (15:55 -0400)]
Merge tag 'nfc-next-3.12-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/nfc-next
Samuel Ortiz <sameo@linux.intel.com> says:
"This is the first NFC pull request for the 3.12 release.
With this one we have:
- A few pn533 improvements and minor fixes. Testing our pn533 driver
against Google's NCI stack triggered a few issues that we fixed now.
We also added Tx fragmentation support to this driver.
- More NFC secure element handling. We added a GET_SE netlink command
for getting all the discovered secure elements, and we defined 2
additional secure element netlink event (transaction and connectivity).
We also fixed a couple of typos and copy-paste bugs from the secure
element handling code.
- Firmware download support for the pn544 driver. This chipset can enter a
special mode where it's waiting for firmware blobs to replace the
already flashed one. We now support that mode."
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Luis Henriques [Wed, 14 Aug 2013 22:10:06 +0000 (23:10 +0100)]
net: rfkill: Do not ignore errors from regulator_enable()
Function regulator_enable() may return an error that has to be checked.
This patch changes function rfkill_regulator_set_block() so that it checks
for the return code. Also, rfkill_data->reg_enabled is set to 'true' only
if there is no error.
This fixes the following compilation warning:
net/rfkill/rfkill-regulator.c:43:20: warning: ignoring return value of 'regulator_enable', declared with attribute warn_unused_result [-Wunused-result]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>