Chaoming Li [Tue, 3 May 2011 14:48:15 +0000 (09:48 -0500)]
rtlwifi: rtl8192se: Merge hardware routines
Merge routines hw.c and hw.h for RTL8192SE.
Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Chaoming Li [Tue, 3 May 2011 14:48:05 +0000 (09:48 -0500)]
rtlwifi: rtl8192se: Merge firmware routines
Merge routines fw.c and fw.h for RTL8192SE. In addition, make changes
to rtlwifi/wifi.h to support RTL8192SE.
Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Chaoming Li [Tue, 3 May 2011 14:47:45 +0000 (09:47 -0500)]
rtlwifi: rtl8192se: Merge def.h
Introduce routine def.h for rtl8192se.
Signed-off-by: Chaoming_Li <chaoming_li@realsil.com.cn> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211: Postpond ps timer if tx is stopped by others
Whenever the driver's queue depth reaches the max, the queues are
stopped by the driver till the driver can accept the frames.
At the mean time dynamic_ps_timer can be expired due to not
receiving packet from upper layer which could restart the transmission
at the end of ps work. Due to the mismatch with driver state,
mac80211 is unneccesarity buffering all the frames till the driver
wakes up the queue.
Check whether there is no transmit or the tx queues were stopped by some
reasons. If any of the queue was stopped, the postpond ps timer and
do not restart netif_tx.
Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arik Nemtsov [Tue, 3 May 2011 08:53:07 +0000 (11:53 +0300)]
mac80211: set TID of internal mgmt packets to 7
The queue mapping of internal mgmt packets is set to VO. Set the TID
value to match the queue mapping. Otherwise drivers that only look at
the TID might get confused.
Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
when aggregation protection mode is enabled the hardware needs
to send RTS/CTS for each HT frame. Currently its disabled so
remove the unused call backs.
Signed-off-by: Mohammed Shafi Shajakhan <mshajakhan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Daniel Drake [Mon, 2 May 2011 20:38:16 +0000 (21:38 +0100)]
libertas: remove tx_timeout handler
As described at http://marc.info/?l=linux-netdev&m=130428493104730&w=2
libertas frequently generates spurious tx timeouts, because the tx
queue is brought down for extended periods during scanning. The net
layer takes a look and incorrectly assumes the queue has been down for
several seconds, and generates a tx_timeout.
One way to fix this is to bump the trans_start counter while scanning
so that the network layer knows that the device is still alive, but
I think the tx_timeout handler is implemented wrongly here and not of
any real use, so I vote to remove it.
As explained at http://marc.info/?l=linux-wireless&m=130430311115755&w=2
the watchdog is primarily meant to deal with lockup on the hardware TX
path (detected by the tx queue being stopped for an extended period of
time), but this is unlikely to happen with libertas. In this case, the tx
queue is stopped only while waiting for lbs_thread to send the queued frame
to the driver, and lbs_thread wakes up the queue immediately after, even
if the frame could not be sent correctly.
So, the only hardware-related possibility that this catches is if
hw_host_to_card hangs - this is something I have never seen. And if it
were to happen, nothing done by lbs_tx_timeout would actually wake up
lbs_thread any quicker than otherwise.
Removing this oddly-behaving spuriously-firing tx_timeout handler should
fix an occasional kernel crash during resume
(http://dev.laptop.org/ticket/10748)
Signed-off-by: Daniel Drake <dsd@laptop.org> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
netif_tx_start_all_queues is used to allow the upper layer
to transmit frames but it does not restart transmission.
To restart the trasmission use netif_tx_wake_all_queues.
Not doing so, sometimes stalls the transmission and the
application has to be restarted to proceed further.
This issue was originally found while sending udp traffic
in higer bandwidth in open environment without bgscan.
Cc: stable@kernel.org Signed-off-by: Rajkumar Manoharan <rmanoharan@atheros.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211: Fix a warning due to skipping tailroom reservation for IV
The devices that require IV generation in software need tailroom
reservation for ICVs used in TKIP or WEP encryptions.
Currently, decision to skip the tailroom reservation in the tx
path was taken only on whether driver wants MMIC to be generated
in software or not. Following patch appends IV generation check for
such decisions and fixes the following warning.
Ivo van Doorn [Sat, 30 Apr 2011 15:18:18 +0000 (17:18 +0200)]
rt2x00: Add autowake support for USB hardware
The USB drivers don't support automatically waking up when in powersaving mode,
add a work object which will wakeup the device in time to receive the next beacon.
Based on that beacon, we either go back into powersaving mode, or we remain awake
to receive the buffered frames for our station.
Some part of the code, especially rt2x00lib_find_ie and rt2x00lib_rxdone_check_ps
are inspired on the code from carl9170.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
rt2x00: Introduce capability flag for Bluetooth co-existence.
Use flag instead of re-reading the eeprom every time.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
In rt2800lib.c the rt2800_init_eeprom function the same eeprom
words were read multiple times, due to inefficient ordering of the
eeprom checks.
Reorder the checks so that each EEPROM word only has to be read once.
Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Sat, 30 Apr 2011 15:14:49 +0000 (17:14 +0200)]
rt2x00: Fix optimize register access for rt2800pci
The patch
rt2x00: Optimize register access in rt2800pci
from Helmut Schaa missed one register call, namely
the rt2800_register_multiwrite which should be changed
to rt2x00pci_register_multiwrite.
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>
Ivo van Doorn [Sat, 30 Apr 2011 15:14:23 +0000 (17:14 +0200)]
rt2x00: Optimize TX_STA_FIFO register reading
Add recycling functionality to rt2x00usb_register_read_async.
When the callback function returns true, resubmit the urb to
read the register again.
This optimizes the rt2800usb driver when multiple TX status reports
are pending in the register, because now we don't need to allocate
the rt2x00_async_read_data and urb structure each time.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Ivo van Doorn [Sat, 30 Apr 2011 15:13:46 +0000 (17:13 +0200)]
rt2x00: Reduce tx status reading timeout
When no TX status was available, the default timeout
of 20ms is a bit high. The frame is highly likely already
send out, so the TX status should be available within
only a few milliseconds.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Currently, mac80211 handles MIC failures differently
depending on whenever they are detected by the stack's
own software crypto or when are handed down from the
driver.
This patch tries to unify both by moving the special
branch out of mac80211 rx hotpath and into into the
software crypto part. This has the advantage that we
can run a few more sanity checks on the data and verify
if the key type was TKIP. This is very handy because
several devices generate false postive MIC failure
reports. Like carl9170, ath9k and wl12xx:
<http://www.spinics.net/lists/linux-wireless/msg68494.html>
"mac80211: report MIC failure for truncated packets in AP mode"
Cc: Luciano Coelho <coelho@ti.com> Cc: Arik Nemtsov <arik@wizery.com> Signed-off-by: Christian Lamparter <chunkeey@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
By reading the "driver_state" debugfs value we get all the important
state information from the wl12xx driver. This helps testing and
debugging, particularly in situations where the driver seems "stuck".
wl12xx: fix race condition during recovery in AP mode
When operating as AP, the TX queues are not stopped when we start
recovery. mac80211 is notified only after the fact. When there is
pending TX, it will be queued even after the FW is down. This leads to
situations where the TX queues are stopped (because of the TX-watermark
mechanism), and are never woken up when we return from recovery.
Fix this by explicitly stopping the TX queues when before initiating
recovery.
Use the minimal rate configured in the basic rates set as the AP
broadcast and multicast rate. The minimal rate is used to ensure weak
links can still communicate.
When the basic rates contains at least one OFDM rate, configure all
unicast TX rates to OFDM only.
Unify rate configuration on initialization and on change notification
into a single function.
wl12xx: print firmware program counter during recovery
When performing recovery, print the firmware version and program
counter (by reading the SCR_PAD4 register). The value of the firmware
program counter during assert can be useful for debugging.
We use a long timeout (2 seconds) when sending commands to the FW.
When a command times out, it means the FW is stuck, and we should
commence recovery.
This should make recovery times shorter as we'll recover on the first
timeout indication.
wl12xx: use wiphy values for setting rts, frag thresholds on init
Use the wiphy RTS and fragmentation thresholds for initializing the FW
when possible. This mitigates a bug where previously set values are
forgotten after interface down/up.
Add checks before settings these values to ensure they are valid. Use
default values when invalid thresholds are configured.
Update the default RTS threshold to the maximum value given by the
specification.
The FW can dynamically manage its internal TX & RX memory pools, moving
blocks from one pool to another when necessary. This can significantly
improve performance. Currently this feature is enabled only for 128x.
Enable dynamic memory for 127x as well. Other parameters in the memory
configuration structure may need to be fine tuned, as the optimal values
for these may change once dynamic memory is enabled.
wl12xx: Restart TX when TX descriptors are available
The driver stops sending TX packets when either there aren't enough
memory blocks, or it runs out of TX descriptors. The driver continues to
send packets to the FW only when more memory blocks are available.
The FW might free TX descriptors without freeing the corresponding
memory blocks, especially when dynamic memory is enabled. In cases where
memory blocks are not freed at all, the driver will keep waiting for
more memory blocks indefinitely.
Fix this by clearing the WL1271_FLAG_FW_TX_BUSY flag when there are
available TX descriptors.
The 128x/AP firmware does not yet support dynamic memory. Temporarily,
the memory configuration for the 127x was used both for 127x/AP as well
as 128x/AP. Since the two chips don't have the same number of memory
blocks, TP was significantly degraded.
This hasn't been fine tuned yet, but using the base 128x numbers
(without dynamic memory) seems to yield much better results (around 30%
more). Additional fine tuning will be required in the future.
Shahar Levi [Wed, 13 Apr 2011 11:52:50 +0000 (14:52 +0300)]
wl12xx: Update Power Save Exit Retries Packets
Reducing the retries of sending PS exit packets to the peer AP.
That fix is to avoid sending unrealizable number of PS exit packets
in case of ap lost.
Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Shahar Levi [Mon, 11 Apr 2011 12:41:46 +0000 (15:41 +0300)]
wl12xx: FM WLAN coexistence
Add support to FM WLAN coexistence (STA only). Some WiFi harmonics
may interfere with FM operation, to avoid this problem special
coexistence techniques are activated around some FM frequencies.
Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
When working in ibss mode, we don't configure rate policy per station
(as we use the same link for multiple stations), so currently the
1mb/s rate is being used.
Instead, configure the firmware to use the whole 11b rates by default.
wl12xx: avoid redundant join on interface reconfiguration
ieee80211_reconfig() sets most of the "changed" flags regardless
of the actual change (e.g. BSS_CHANGED_ASSOC will be set even if
the interface is still not associated). in this case the driver
will issue some unneeded commands.
Since the driver relies solely on the BSS_CHANGED_ASSOC flag,
without checking if there was an actual change, it will end up
issuing unjoin() and dummy_join() commands, although it was
never associated and should just remain idle.
Avoid it by checking the actual state change, in addition to the
"changed" flag.
(there seem to be more redundant configuration commands being
issued, but they shouldn't harm)
Shahar Levi [Sun, 3 Apr 2011 10:54:54 +0000 (13:54 +0300)]
wl12xx: Set correct REF CLK and TCXO CLK values to the FW
Fix mismatch between the REF CLK and TCXO CLK information that is
set in the platform data and the NVS, so we override what comes
from the NVS and replace it with what comes from the platform data.
[Small fix in a comment -- Luca]
Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
The elp_work is being enqueued on wl1271_ps_elp_sleep, but doesn't get
cancelled on wl1271_ps_elp_wakeup. This might cause immediate entrance
to elp when the wl->mutex is being released, rather than using the delayed
enqueueing optimization.
Cancel elp_work on wakeup request, and add a new WL1271_FLAG_ELP_REQUESTED
flag to further synchronize the elp actions.
[Fixed a couple of typos in some comments -- Luca]
commit d05c806 ("wl12xx: rearrange some ELP wake_up/sleep calls")
introduced a bug in which wl1271_ps_elp_wakeup() was called instead
of wl1271_ps_elp_sleep() after completing the tx work.
Johannes Berg [Wed, 27 Apr 2011 12:19:34 +0000 (05:19 -0700)]
iwlagn: prefer BSS context
If an interface type changes from a type that is
only supported on the PAN context (e.g. P2P GO)
to a type that is supported on the BSS context,
and the BSS context is not in use, then we need
to use the BSS context instead of changing the
device type within the context. To achieve this,
refuse the type change, which causes a down/up
cycle that will allocate the BSS context for the
interface.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Thu, 21 Apr 2011 17:57:23 +0000 (10:57 -0700)]
iwlagn: improve RXON checking
The current RXON checking doesn't verify that
the channel is valid (or at least non-zero),
so add that. Also, add a WARN() so we get a
stacktrace, and capture a bitmask of errors
in order to capture all necessary information
in the warning itself (in case the previous
messages are snipped off.)
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Thu, 21 Apr 2011 14:09:43 +0000 (07:09 -0700)]
iwlagn: remove spectrum measurement header
This header file isn't used, and if we ever need
these definitions they shouldn't be added to a
driver but rather to the common 802.11 include
file that has all frame definitions. Thus, just
remove it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Don Fry [Wed, 20 Apr 2011 22:25:14 +0000 (15:25 -0700)]
iwlagn: semaphore and calib cleanup
All agn devices use the same eeprom semaphore and calib version routines.
Delete the indirection and move the semaphore routines to where they are
used and make static.
Signed-off-by: Don Fry <donald.h.fry@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Wed, 20 Apr 2011 16:10:39 +0000 (09:10 -0700)]
iwlagn: use proper good CRC threshold behaviour
New microcode versions use the good CRC threshold
field differently, as a flag, and in that case we
should set it to 1/0 instead of 1/65535 for an
active/passive scan.
The new behaviour is advertised by the uCode with
a feature flag.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Tue, 19 Apr 2011 14:45:16 +0000 (07:45 -0700)]
iwlagn: refactor restart
The WoWLAN resume code will have to essentially
do a restart, but without going through the work
struct. To support that, refactor the restart by
splitting out the preparation code into a new
function.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Tue, 19 Apr 2011 14:42:03 +0000 (07:42 -0700)]
iwlagn: introduce silent grabbing of NIC access
There are a few cases like the WoWLAN support
I'm writing that require attempting to access
the NIC when it is known that it might not be
accessible, e.g. after the system woke up and
the platform might have reset the device.
To avoid messages in this case, introduce the
new function iwl_grab_nic_access_silent(), it
will only return an error status.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Johannes Berg [Tue, 19 Apr 2011 14:38:23 +0000 (07:38 -0700)]
iwlagn: avoid hangs when restarting device
If a device error happens while the uCode is
being loaded or initialised, we will attempt
to restart the device (which will likely fail
again, but that's not the issue here). During
this new restart, we turn off the device, but
as the uCode failed to initialise it already
is turned off. As a consequence, grabbing NIC
access will fail and cause excessive messages
and hangs.
To fix this issue, introduce a new status bit
and only attempt to reprogram the device when
it isn't already disabled.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
mwl8k: Reducing extra_tx_headroom for tx optimization in AP mode
The tx_headroom required for mwl8k driver is 32 bytes and it
can use the space for 802.11 header received from mac80211.
mwl8k considers the smallest 802.11 frame (CTS2self of 10
bytes) that can be received from mac80211 to compute the
extra_tx_headroom as 22 (32 - 10) bytes.
When the wireless interface is part of bridge, this
extra_tx_headroom requirement results in a memcpy in
mac80211 (in function pskb_expand_head) for all the data
frames needing L2 forwarding/bridging, when NET_SKB_PAD is
defined as 32. This patch reduces the extra_tx_headroom by
8 bytes so that memcpy of data frames in mac80211 is
avoided in this case.
The resize will be required in driver for frames with 802.11
header size of less than 18 bytes.
Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Pradeep Nemavat <pnemavat@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Check status bits with mutex taken, because when we wait for mutex
unlock, status can change. Patch should also make remaining sync
commands be send with priv->mutex taken. That will prevent execute
these commands when we are currently reset firmware, what could
possibly cause troubles.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
We mark command as huge by using meta->flags from other (non huge) command,
but flags can be possibly overridden, when non huge command is enqueued,
what can lead to:
WARNING: at lib/dma-debug.c:696 dma_debug_device_change+0x1a3/0x1f0()
DMA-API: device driver has pending DMA allocations while released from device [count=1]
To fix introduce additional CMD_MAPPED to mark command as mapped and
serialize iwl_enqueue_hcmd() with iwl_tx_cmd_complete() using
hcmd_lock. Serialization will also fix possible race conditions,
because q->read_ptr, q->write_ptr are modified/used in parallel.
Do not change callback, I did (and fixed) that mistake in iwlagn.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
iwlwifi: do not set tx power when channel is changing
we set device tx power during initialization to priv->tx_power_next,
which itself is initialized to minimum power. That changed
default behaviour of driver. Previously we initialized device to
transmit at maximum available power by default. Patch change again
to previous behaviour and cleanup tx power initialization.
Fortunately this is not critical fix, as mac80211 layer setup
tx power lately to 14dB, hence device does not operate at minimal
transmit power all the time.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Fri, 29 Apr 2011 19:09:39 +0000 (15:09 -0400)]
p54: avoid uninitialized variable warning for freq
CC [M] drivers/net/wireless/p54/eeprom.o
drivers/net/wireless/p54/eeprom.c: In function ‘p54_parse_rssical’:
drivers/net/wireless/p54/eeprom.c:494:8: warning: ‘freq’ may be used uninitialized in this function
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Fri, 29 Apr 2011 19:04:58 +0000 (15:04 -0400)]
mwifiex: fix copy-n-paste 'thinko' for tsf_val
CC [M] drivers/net/wireless/mwifiex/join.o
drivers/net/wireless/mwifiex/join.c: In function ‘mwifiex_cmd_802_11_associate’:
drivers/net/wireless/mwifiex/join.c:119:8: warning: ‘tsf_val’ may be used uninitialized in this function
drivers/net/wireless/mwifiex/join.c:103:12: note: ‘tsf_val’ was declared here
Looks like a copy-n-paste error, identical lines are a few lines below
the ones removed, with an actual memcpy to tsf_val in between...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Fri, 29 Apr 2011 18:54:27 +0000 (14:54 -0400)]
b43: avoid uninitialized variable warnings in phy_n
CC [M] drivers/net/wireless/b43/phy_n.o
drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_set_channel’:
drivers/net/wireless/b43/phy_n.c:3848:47: warning: ‘tabent_r2’ may be used uninitialized in this function
drivers/net/wireless/b43/phy_n.c:3849:47: warning: ‘tabent_r3’ may be used uninitialized in this function
drivers/net/wireless/b43/phy_n.c: In function ‘b43_nphy_poll_rssi.clone.14’:
drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$7’ may be used uninitialized in this function
drivers/net/wireless/b43/phy_n.c:2270:6: warning: ‘save_regs_phy$8’ may be used uninitialized in this function
FWIW, the usage of these variables is goverened by checks that match
their initializations. So, I think these are actually false warnings.
Still, I would rather avoid the warning SPAM...
Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Fri, 29 Apr 2011 18:35:14 +0000 (14:35 -0400)]
ath5k: fix uninitialized var warning for txf2txs
CC [M] drivers/net/wireless/ath/ath5k/reset.o
drivers/net/wireless/ath/ath5k/reset.c: In function ‘ath5k_hw_init_core_clock’:
drivers/net/wireless/ath/ath5k/reset.c:100:51: warning: ‘txf2txs’ may be used uninitialized in this function
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johan Hedberg [Thu, 28 Apr 2011 18:29:04 +0000 (11:29 -0700)]
Bluetooth: Fix updating conn->auth_type in hci_io_capa_request_evt
In some circumstances hci_get_auth_req will return a value different
from the current conn->auth_type. In these cases update conn->auth_type
so that when a user confirm request comes it doesn't falsely trigger
auto-accept.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 28 Apr 2011 18:29:03 +0000 (11:29 -0700)]
Bluetooth: Add store_hint parameter to mgmt_new_key
Even for keys that shouldn't be stored some use cases require the
knowledge of a new key having been created so that the conclusion of a
successful pairing can be made. Therefore, always send the mgmt_new_key
event but add a store_hint parameter to it to indicate to user space
whether the key should be stored or not.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 28 Apr 2011 18:29:01 +0000 (11:29 -0700)]
Bluetooth: Fix connection key type updating for buggy controllers
If a controller generates a changed combination key as its first key the
connection key type will not be correctly set. In these situations make
sure the update the connection key type when such a buggy controller is
detected.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 28 Apr 2011 18:29:00 +0000 (11:29 -0700)]
Bluetooth: Fix old_key_type logic for non-persistent keys
Even if there's no previous key stored the connection might still be
secured with a non-persistent key and in that case the key type in the
hci_conn struct should be checked.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 28 Apr 2011 18:28:59 +0000 (11:28 -0700)]
Bluetooth: Fix link key persistent storage criteria
Link keys should only be stored if very specific criteria of the
authentication process are fulfilled. This patch essentially copies the
criteria that user space has so far been using to the kernel side so
that the management interface works properly.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 28 Apr 2011 18:28:56 +0000 (11:28 -0700)]
Bluetooth: Add confirm_hint parameter to user confirmation requests
When accepting a pairing request which fulfills the SSP auto-accept
criteria we need to push the request all the way to the user for
confirmation. This patch adds a new hint to the user_confirm_request
management event so user space can know when to show a numeric
comparison dialog and when to show a simple yes/no confirmation dialog.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 28 Apr 2011 18:28:54 +0000 (11:28 -0700)]
Bluetooth: Add variable SSP auto-accept delay support
Some test systems require an arbitrary delay to the auto-accept test
cases for Secure Simple Pairing in order for the tests to pass.
Previously when this was handled in user space it was worked around by
code modifications and recompilation, but now that it's on the kernel
side it's more convenient if there's a debugfs interface for it.
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Johan Hedberg [Thu, 28 Apr 2011 18:28:53 +0000 (11:28 -0700)]
Bluetooth: Add automated SSP user confirmation responses
This patch adds automated negative and positive (auto-accept) responses
for Secure Simple Pairing user confirmation requests. The responses are
only sent if the HCI_MGMT flag is set in order not to confuse older user
space versions (without management interface support).
Signed-off-by: Johan Hedberg <johan.hedberg@nokia.com> Signed-off-by: Gustavo F. Padovan <padovan@profusion.mobi>
Since timestamp in beacon buffer keeps changing all the time,
the memcmp check in mwifiex_save_curr_bcn() is redundant.
Remove that memcmp check and also avoid freeing and allocation
of buffer if required beacon buffer size is same as previous one.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
1) Initialise HT capabilities in cfg80211 properly.
2) Cfg80211 stack may modify "sband->ht_cap" to disable
40Mhz operation in 2.4GHz band (after recent patch
"cfg80211: module_param to disable HT40 in 2.4GHz band")
Therefore read "sband->ht_cap" instead of an adapter variable
"hw_dot_11n_dev_cap" to get HT capabilities.
Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
John W. Linville [Wed, 27 Apr 2011 19:04:28 +0000 (15:04 -0400)]
mwl8k: replace rateinfo bitfields with mask and shift macros
AFAICT, this driver is claiming that 24 bits of rate info fit into a
16-bit field in the Tx descriptor. Anyway, the use of bitfields is
frowned-upon for a variety of well-documented reasons...
Signed-off-by: John W. Linville <linville@tuxdriver.com>