Arik Nemtsov [Wed, 6 Jun 2012 08:25:02 +0000 (11:25 +0300)]
mac80211: stop Rx during HW reconfig
While HW reconfig is in progress, drop all incoming Rx. This prevents
incoming packets from changing the internal state of the driver or
calling callbacks of the low level driver while it is in inconsistent
state.
Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
As defined in section 13.10.9.3 Case D (802.11-2012), this
control variable is used to limit the mesh STA to send only
one PREQ to a root mesh STA within this interval of time
(in TUs). The default value for this variable is set to
2000 TUs. However, for current implementation, the maximum
configurable of dot11MeshHWMPconfirmationInterval is
restricted by dot11MeshHWMPactivePathTimeout.
Chun-Yeow Yeoh [Wed, 13 Jun 2012 18:06:09 +0000 (02:06 +0800)]
mac80211: invoke the timer only with correct dot11MeshHWMPRootMode value
mesh_path_root_timer is invoked once the dot11MeshHWMPRootMode
is larger than 1. This patch also adds the backward compatible
to the previous setting on dot11MeshHWMPRootMode. If the user
configures as follow, it will still trigger the proactive RANN
with Gate Announcement.
iw mesh0 set mesh_param mesh_hwmp_rootmode 1
iw mesh0 set mesh_param mesh_gate_announcements 1
similar to the following setting:
iw mesh0 set mesh_param mesh_hwmp_rootmode 4
iw mesh0 set mesh_param mesh_gate_announcements 1
Chun-Yeow Yeoh [Wed, 13 Jun 2012 18:06:07 +0000 (02:06 +0800)]
mac80211: implement the proactive PREQ generation
Generate the proactive PREQ element as defined in
Sec. 13.10.9.3 (Case C) of IEEE Std. 802.11-2012
based on the selection of dot11MeshHWMPRootMode as follow:
dot11MeshHWMPRootMode (2) is proactivePREQnoPREP
dot11MeshHWMPRootMode (3) is proactivePREQwithPREP
The proactive PREQ is generated based on the interval
defined by dot11MeshHWMProotInterval.
With this change, proactive RANN element is now generated
if the dot11MeshHWMPRootMode is set to (4) instead of (1).
Pontus Fuchs [Tue, 12 Jun 2012 12:13:19 +0000 (14:13 +0200)]
mac80211: Disallow changing chan type on monitor when CHAN_MODE_FIXED
If you add a monitor interface in parallel to a normal interface
mac80211 will let you to change the channel type on the monitor
interface even if you are connected. Add an explicit check to
disallow this.
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com>
[fix typo in commit log, use sdata instead of netdev] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Johannes Berg [Mon, 11 Jun 2012 15:09:41 +0000 (17:09 +0200)]
mac80211: allow cancelling dependent ROCs
In my redesign of remain-on-channel I forgot
that an item could be cancelled when it's a
dependent item that is part of another item.
Allow cancelling such items by removing them
from the dependents list.
Note that when we cancel the main item, all
its dependents are also cancelled. It would
be possible to not do that, but would need
tricks to promote an item from dependent to
top-level and is tricky in the HW ROC case.
Reported-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Ilan pointed out to me that ieee80211_start_next_roc()
already calls ieee80211_run_deferred_scan() if the list
of ROC items is empty, so there's no need to call it
again after calling ieee80211_start_next_roc().
Reported-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
CC drivers/net/wireless/ti/wl18xx/main.o
drivers/net/wireless/ti/wl18xx/main.c: In function ‘wl18xx_conf_init’:
drivers/net/wireless/ti/wl18xx/main.c:1024:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat]
drivers/net/wireless/ti/wl18xx/main.c:1024:3: warning: format ‘%d’ expects argument of type ‘int’, but argument 3 has type ‘size_t’ [-Wformat]
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arik Nemtsov [Tue, 29 May 2012 09:44:12 +0000 (12:44 +0300)]
wl18xx: clean up phy module parameters
Give all wl18xx phy module paramters -1 as a default value, indicating
the paramter was not set. Add previous default values to the default
18xx priv conf structure.
Remove the board_type field from wl18xx priv. The field with the same
name inside the phy conf is good enough for our purposes.
Arik Nemtsov [Tue, 29 May 2012 09:40:50 +0000 (12:40 +0300)]
wl18xx: align wl18xx_conf_phy with FW variant and remove it
wl18xx_conf_phy represents part of the FW native wl18xx_mac_and_phy_params
structure. Remove it and replace the phy part of the wl18xx conf with the
FW bound structure. This allows us to set/override all members.
Increment the wlconf version to ensure compatibility with the new
structure
Luciano Coelho [Thu, 7 Jun 2012 20:39:28 +0000 (23:39 +0300)]
wl18xx: read configuration structure from a binary file
Instead of using the hardcoded configuration structure, try to read it
from a "firmware" file called wl18xx-conf.bin. If the file doesn't
exist, fall back to the hardcoded version. If the file exists but is
illegal, bail out.
Luciano Coelho [Thu, 7 Jun 2012 20:39:25 +0000 (23:39 +0300)]
wlcore: use u8 instead of enum for bcn_filt_mode
Since we will export the conf structure as a file, we need to use well
defined types. Instead of using enum, whose size may vary, use u8 for
bcn_filt_mode instead.
Luciano Coelho [Thu, 7 Jun 2012 20:39:24 +0000 (23:39 +0300)]
wlcore/wl18xx/wl12xx: use u8 instead of bool for host_fast_wakeup_support
The conf structure is going to be exported to a file, so we should use
only well defined types. bool is not well defined and may vary from
platform to platform, so change the host_fast_wakeup_support type to
u8 instead.
Luciano Coelho [Thu, 7 Jun 2012 20:39:22 +0000 (23:39 +0300)]
wl18xx: add support to clear FW statistics
This patch calls ACX_CLEAR_STATISTICS to clear the firmware
statistics. The trigger is a new debugfs file called
clear_fw_statistics in the fw_stats directory.
Eyal Shapira [Thu, 7 Jun 2012 20:39:21 +0000 (23:39 +0300)]
wlcore: add debugfs control over rx interrupt pacing
Add control over several conf fields which combined
control the rx interrupt pacing mechanism, that is avoiding
getting an interrupt following a single frame rx but instead
have the FW trigger the interrupt only after a certain
amount of frames received or a timeout.
Eyal Shapira [Thu, 7 Jun 2012 20:39:20 +0000 (23:39 +0300)]
wlcore: add support macros to easily add conf debugfs entries
The current debugfs code contains too much code duplication
of bolierplate code. Add some macro magic to avoid this and
enable adding new debugfs entries by using just a few lines.
Ido Reis [Sun, 13 May 2012 11:53:40 +0000 (14:53 +0300)]
wl18xx: pad only last frame in aggregration buffer for PG2
In PG2 only the last frame in the aggregate buffer should be
aligned to the sdio block size. This frame's header msb should be
set to 0, while in all the previous frames in the aggregation
buffer, this bit should be set to 1.
[Add a HW op for setting the frame ctrl bit only for 18xx. Other minor
cleanups - Arik]
[Make the pre_pkt_send operation optional -- Luca]
Ido Reis [Mon, 23 Apr 2012 14:35:25 +0000 (17:35 +0300)]
wl18xx: PG2.0 HW Watch dog interrupt support
In PG2, the HW watchdog interrupt occupies bit0 of the event vector, and
the SW watchdog is relocated to bit9. We perform the relocation
globally, as there's only one watchdog bit on previous platforms (bit0).
[Only mask in the new bit9 for platforms supporting it. This avoids
spurious events on other platforms - Arik]
Johannes Berg [Tue, 5 Jun 2012 12:28:42 +0000 (14:28 +0200)]
mac80211: unify SW/offload remain-on-channel
Redesign all the off-channel code, getting rid of
the generic off-channel work concept, replacing
it with a simple remain-on-channel list.
This fixes a number of small issues with the ROC
implementation:
* offloaded remain-on-channel couldn't be queued,
now we can queue it as well, if needed
* in iwlwifi (the only user) offloaded ROC is
mutually exclusive with scanning, use the new
queue to handle that case -- I expect that it
will later depend on a HW flag
The bigger issue though is that there's a bad bug
in the current implementation: if we get a mgmt
TX request while HW roc is active, and this new
request has a wait time, we actually schedule a
software ROC instead since we can't guarantee the
existing offloaded ROC will still be that long.
To fix this, the queuing mechanism was needed.
The queuing mechanism for offloaded ROC isn't yet
optimal, ideally we should add API to have the HW
extend the ROC if needed. We could add that later
but for now use a software implementation.
Overall, this unifies the behaviour between the
offloaded and software-implemented case as much
as possible.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Tue, 5 Jun 2012 12:28:40 +0000 (14:28 +0200)]
mac80211: do remain-on-channel while idle
The IDLE handling in HW off-channel is broken right
now since we turn off IDLE only when the off-channel
period already started. Therefore, all drivers that
use it today (only iwlwifi!) must support off-channel
while idle, so playing with idle isn't needed at all.
Off-channel in general, since it's no longer used for
authentication/association, shouldn't affect PS, so
also remove that logic.
Also document a small caveat for reporting TX status
from off-channel frames in HW remain-on-channel.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
After a chip reset, the beacon timers have to re-programmed
correctly for a station in associated state. Use the PS flags
to ensure that this is done after a TSF sync happens, otherwise
the driver ends up using incorrect values for TBTT/DTIM in
powersave mode.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
When a fatal interrupt is received or it is detected that the baseband
has hung, the chip has to be reset immediately. Otherwise, we end up
processing spurious interrupts. Ensure that we bail out properly in
the ISR when the reset work hasn't completed yet.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Currently, there is no synchronization between the reset
work and the tx-poll work. Fix this and make sure that we
bail out properly if a reset work is in progress.
* Cleanup the PLL WAR and enable it for AR9340 too and
use a helper for restarting work/timers after a reset.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
When BT FTP/PAN transmits while WLAN is idle, the one of 9462 chain
often picks up BT's tx signal and starts receiving. If the current
weight is set to be higher than BT tx, BT tx will be aborted and this
also degrades BT performance. Hence lower WLAN rx priority in this
case only when there are no WLAN traffic.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Program MCI related power registers only if MCI interrupts
are enabled. This could help to reduce power consumptions when
WLAN alone is enabled in BT coex chips.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
When the chip is waking up from sleep state, the cycle counters
might have incorrect readings. So it is better not to update those
readings with software counters.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
The chain index to perform IQ calibration is counted to number of valid
tx chains and then used for indexing chain specific registers. If the
chainmask is set to 0x2 (i.e chain 1 only), still it accesses chain 0
registers for chain 1. So use real chain index instead sequential one.
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211's IEEE80211_CONF_OFFCHANNEL can be used directly
to track offchannel state. Also pass the correct boolean
value to ath9k_hw_startpcureceive().
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
MCI has to be handled only when BTCOEX is actually enabled.
Check for this condition before calling MCI related functions
from various reset/calibration call-sites.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
ASPM has to be disabled when BTCOEX is in use, do this properly
by calling the bus-specific ASPM init routine after the
BTCOEX scheme has been determined.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Instead of cluttering ath9k_init_device() with 'ath_softc'
specific initialization code, use ath9k_init_softc() to
setup driver-specific work routines, timers etc.
Signed-off-by: Sujith Manoharan <c_manoha@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Arik Nemtsov [Sun, 3 Jun 2012 20:31:56 +0000 (23:31 +0300)]
mac80211: add stations after AP start on reconfig
When performing a HW restart for an AP mode interface, add stations back
only after the AP is beaconing. This mimics the normal flow of STA
addition on AP.
Some devices (wlcore) do not support adding stations before beaconing,
so this has the added benefit of making recovery work for them.
Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Fri, 1 Jun 2012 10:50:54 +0000 (12:50 +0200)]
cfg80211: validate remain-on-channel time better
The remain-on-channel time validation shouldn't
depend on the value of HZ, as it does now with
the check against jiffies, since then you might
use a value that works on one system but not on
another. Fix it by checking against a minimum
that's fixed.
Also add validation of the wait duration for a
management frame TX since this also translates
into remain-on-channel internally.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Hauke Mehrtens [Thu, 31 May 2012 20:38:22 +0000 (22:38 +0200)]
ssb: recognize ARM Cortex M3
I found this core on a BCM4322, a PCI card in the Linksys WRT610N V1.
This core is not used by the driver, this patch just makes ssb show the
correct name.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Pontus Fuchs [Thu, 31 May 2012 10:34:47 +0000 (12:34 +0200)]
mac80211: Clear wowlan flag when drv_suspend returns failure
drv_resume can get called without a prior call to drv_suspend.
Consider the following steps:
1. Suspend is started but driver's drv_suspend returns error.
2. Suspend is aborted. local->wowlan flag is left set.
3. Interface is removed.
4. Suspend again. This time open_count is 0 so drv_suspend is
not called and local->wowlan not cleared.
5. On resume ieee80211_reconfig will call drv_resume since
local->wowlan is set.
Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
mac80211: configure 11b/g channel access rules for legacy APs
For each EDCA TX queue change default settings (in STA mode) to conform
old 802.11b/g channel access rules. This is needed for drivers that do
not have QoS enable/disable "switch" (like rt2x00) to make them work
properly with legacy APs.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Similar like other drivers, do not configure group keys to the hardware
(on Ad-Hoc mode) to make IBSS RSN work.
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Alex Hung [Wed, 23 May 2012 06:11:52 +0000 (14:11 +0800)]
rfkill: Add the capability to switch all devices of all type in __rfkill_switch_all().
__rfkill_switch_all() switches the state of devices of a given type; however,
it does not switch devices of all type (RFKILL_TYPE_ALL). As a result, it
ignores the keycode "KEY_RFKILL" from another module, i.e. eeepc-wmi.
This fix is to make __rfkill_switch_all() to be able to switch not only
devices of a given type but also all devices.
Signed-off-by: Alex Hung <alex.hung@canonical.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Johannes Berg [Wed, 6 Jun 2012 06:18:22 +0000 (08:18 +0200)]
cfg80211: clarify set_channel APIs
Now that we've removed all uses of the set_channel
API except for the monitor channel and in libertas,
clarify this. Split the libertas mesh use into a
new libertas_set_mesh_channel() operation, just to
keep backward compatibility, and rename the normal
set_channel() to set_monitor_channel().
Also describe the desired set_monitor_channel()
semantics more clearly.
Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
wlcore: set channels 12-14 as pactive for sched scan
Introduce “pactive” scan mode – which instructs the fw to
perform a passive scan until an activity/energy is detected
on these channels, once energy detected the channel becomes
active.
Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
Yoni Divinsky [Wed, 16 May 2012 08:34:17 +0000 (11:34 +0300)]
wlcore: add role_id to all the sched_scan commands
Due to a need by the firmware when working in multirole
the role id needs to be added to the structs of the
following commands:
CMD_CONNECTION_SCAN_CFG, CMD_CONNECTION_SCAN_SSID_CFG,
CMD_START_PERIODIC_SCAN, CMD_STOP_PERIODIC_SCAN
Eliad Peller [Tue, 15 May 2012 13:35:20 +0000 (16:35 +0300)]
wl12xx/wl18xx: add erp protection IE to the beacon filter
We have to reconfigure the fw when erp protection should
be enabled/disabled. Pass beacons containing changes
in the ERP protection IE, so we could analyze them.
Yoni Divinsky [Wed, 16 May 2012 08:34:18 +0000 (11:34 +0300)]
wlcore: do not send stop fwlog cmd if fw is hanged
If the driver received a watchdog interrupt then the
assumption is that the fw is hanged. Avoid sending
the stop fwlog command in case of a watchdog recovey
to avoid waiting for the 2 seconds timeout of the command.
Arik Nemtsov [Fri, 18 May 2012 04:46:40 +0000 (07:46 +0300)]
wlcore/wl12xx/wl18xx: implement op_set_key per HW arch
The 12xx set_key just calls the common wlcore_set_key function, in order
to program the keys into the FW.
The 18xx variant changes the spare block count when a GEM or TKIP
key is set. Also modify the get_spare_blocks HW op for 18xx to return
the correct numbers of spare blocks, according to what is currently
set in FW.
Arik Nemtsov [Fri, 18 May 2012 04:46:38 +0000 (07:46 +0300)]
wlcore: add stop reason bitmap for waking/starting queues
Allow the driver to wake/stop the queues for multiple reasons. A queue
is started when no stop-reasons exist.
Convert all wake/stop queue calls to use the new API.
Before, a stopped queue was almost synonymous a high-watermark on Tx.
Remove a bit of code in wl12xx_tx_reset() that relied on it.
Internal packets arriving from mac80211 are also discarded when a queue
is stopped. A notable exception to this is the watermark reason, which
is a "soft"-stop reason. We allow traffic to gradually come to a halt,
but we don't mind spurious packets here and there. This is merely a flow
regulation mechanism.
Based on a similar patch by Eliad Peller <eliadWizery.com>.
Arik Nemtsov [Fri, 18 May 2012 04:46:37 +0000 (07:46 +0300)]
wlcore/wl12xx/wl18xx: handle spare blocks spacial cases per arch
Add a HW op for getting spare blocks.
12xx cards require 2 spare blocks for GEM encrypted SKBs, regardless
of VIFs or keys programmed into the FW.
18xx cards require 2 spare blocks when there are any connected TKIP or
GEM VIFs. For now always return 2 spare blocks, as this works with all
networks. The special case TKIP/GEM functionality is added at a later
patch.
Arik Nemtsov [Fri, 18 May 2012 04:46:36 +0000 (07:46 +0300)]
wlcore/wl12xx/wl18xx: introduce quirk to remove TKIP header space
18xx chips do not require extra space in the TKIP header. Introduce a
new HW quirk to allow us to make this feature arch-specific. 12xx chip
will now have this quirk.