summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/main.c
AgeCommit message (Collapse)Author
2011-08-23wl12xx: add max_sched_scan_ssids value to the hw descriptionLuciano Coelho
After commit 5a865ba, we require a separate value to indicate the number of supported SSIDs in scheduled scans. This patch adds a proper value to the wl12xx driver. This fixes a regression in 3.1-rc3 where scheduled scans were not working properly with the wl12xx driver. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-07-08wl12xx: start/stop queues according to global per-AC countersArik Nemtsov
Split tx_queue_count to count per-AC skb's queued, instead of relying on the skb-queue len. The skb queues used were only valid in STA-mode, as AP-mode uses per-link queues. This fixes a major regression in AP-mode, caused by the patch "wl12xx: implement Tx watermarks per AC". With that patch applied, we effectively had no regulation of Tx queues in AP-mode. Therefore a sustained high rate of Tx could cause exhaustion of the skb memory pool. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: always initialize AP-mode max power levelArik Nemtsov
Sometimes we only get the Tx power level via op->config when the FW is off. Record the received power level when this happens and use it to initialize the firmware during boot. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: initialize max_power levels for 11a channelsArik Nemtsov
Set the maximum FW supported power levels for 11a channels. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: implement cancel_hw_scan() callbackEliad Peller
After implementing cancel_hw_scan(), there is no more need to flush scan_complete_work on suspend. scan_complete_work enqueues a new scan_work, that might lead to the following warning (if the device was already suspended): WARNING: at drivers/mmc/core/core.c:169 mmc_wait_for_req+0x1ac/0x2c8() Backtrace: [<c004b50c>] (dump_backtrace+0x0/0x110) [<c04fda50>] (dump_stack+0x0/0x1c) [<c008f700>] (warn_slowpath_common+0x0/0x6c) [<c008f76c>] (warn_slowpath_null+0x0/0x2c) [<c034b058>] (mmc_wait_for_req+0x0/0x2c8) [<c034f804>] (mmc_io_rw_extended+0x0/0x1e4) [<c0350b5c>] (sdio_io_rw_ext_helper+0x0/0x1ac) [<c0350e00>] (sdio_memcpy_fromio+0x0/0x2c) [<bf194464>] (wl1271_sdio_raw_read+0x0/0x1bc [wl12xx_sdio]) [<bf15ac14>] (wl1271_cmd_wait_for_event_or_timeout+0x0/0x19c [wl12xx]) [<bf15adb0>] (wl1271_cmd_wait_for_event+0x0/0x30 [wl12xx]) [<bf15b7dc>] (wl1271_cmd_disconnect+0x0/0x14c [wl12xx]) [<bf158fd0>] (wl1271_unjoin+0x0/0x48 [wl12xx]) [<bf159070>] (wl1271_op_config+0x0/0x490 [wl12xx]) [<bf105084>] (ieee80211_hw_config+0x0/0x14c [mac80211]) [<bf113120>] (ieee80211_recalc_idle+0x0/0x4c [mac80211]) [<bf109a70>] (__ieee80211_scan_completed+0x0/0x1ac [mac80211]) [<bf109fd4>] (ieee80211_scan_work+0x0/0x484 [mac80211]) [<c00a197c>] (worker_thread+0x0/0x1e8) [<c00a5874>] (kthread+0x0/0x90) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: configure suspend/resume only if associated/startedEliad Peller
Configure the device (to wowlan) only if the sta/ap is associated/started. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: implement Tx watermarks per ACArik Nemtsov
Each AC is stopped when its queue is filled up to the high watermark, and restarted when its queue it lower than the low watermark. This ensures congested ACs are not able to starve other ACs. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: schedule TX packets according to FW occupancyArik Nemtsov
When selecting packets for transmission, prefer the ACs that are least occupied in the FW. When packets for multiple ACs are present in the FW, it decides which to transmit according to WMM QoS parameters. With these changes, lower priority ACs should not be starved when higher priority traffic is present. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: AP mode - support FW TX inactivity triggersArik Nemtsov
In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events. Both are reported to the upper layers as a TX failure in the offending stations. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-07-05wl12xx: fix Tx security sequence number handlingOz Krakowski
Do not reset the security sequence number when issuing a join command or interface is removed. Instead, reset the counter only during the unjoin command. Added the notion of counter wrap-around to the LSB number in wl1271_tx_complete_packet. Added post recovery padding to adjust for potential security number progress during the recovery process by the firmware and avoid potential interop issues in encrypted networks. Signed-off-by: Oz Krakowski <ozk@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: Support routing FW logs to the hostIdo Yariv
A recently added feature to the firmware enables the driver to retrieve firmware logs via the host bus (SDIO or SPI). There are two modes of operation: 1. On-demand: The FW collects its log in an internal ring buffer. This buffer can later be read, for example, upon recovery. 2. Continuous: The FW pushes the FW logs as special packets in the RX path. Reading the internal ring buffer does not involve the FW. Thus, as long as the HW is not in ELP, it should be possible to read the logs, even if the FW crashes. A sysfs binary file named "fwlog" was added to support this feature, letting a monitor process read the FW messages. The log is transferred from the FW only when available, so the reading process might block. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: Avoid recovery while one is already in progressIdo Yariv
During recovery work commands sent to the FW could fail and schedule additional recovery work. Since the chip is going to be powered off, avoid recursive recoveries. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: Check for FW quirks as soon as the FW bootsIdo Yariv
The FW initialization might depend on the FW revision, so check for any FW quirks right after booting it. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: use freezable workqueue for netstack_workEliad Peller
When resuming (after wowlan), we want the rx packets (which is usually the wake-up packet itself) to be passed to mac80211 only after the resume notifier was completed, and mac80211 is up and running (otherwise, the packets will be dropped). By enqueueing the netstack_work to a freezable workqueue, we can guarantee the rx processing to occur only after mac80211 was resumed. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: use _ni version of ieee80211_tx_statusEliad Peller
wl1271_flush_deferred_work(), which calls ieee80211_rx() and ieee80211_tx_status(), is called from a process context. hence, use ieee80211_tx_status_ni() instead of ieee80211_tx_status(). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: check the vif's operstate after joinEliad Peller
When resuming while connected (without wowlan), the interface is already IF_OPER_UP, so we won't get the notifier callback, and hence never complete the association (from wl12xx perspective) This situation, among other potential problems, prevents the station from entering psm. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: enable/disable beacon filtering on ap suspend/resumeEliad Peller
Beacon filtering needs to be enabled so AP won't wake up by by every received beacon. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: clear wl->wow_enabled on resumeEliad Peller
We set wl->wow_enabled on every suspend(), so we need to clear it on every resume(). (we can't rely on setting wl->wow_enabled=false in suspend(), as it being called only when wowlan triggers are configured) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: don't check wow param on suspend/resumeEliad Peller
Since mac80211 calls suspend/resume only when wowlan triggers exist, there is no need to check for triggers existance in the callbacks as well. Add a WARN_ON() to verify it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: Add Support for Low Power DRPw (LPD) ModeShahar Levi
The Low Power DRPw (LPD) mode contains several optimizations that designed to reduce power consumption. The purpose is to save current consumption in RX and Listen mode. LPD setting apply only for wl127x AP mode (not wl128x) Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: fix erroneous commit (cb5ae0)Eliad Peller
Due to rebase error, the patch for commit cb5ae0 ("wl12xx: configure rates when working in ibss mode") was wrong - a blob was added into the wrong function. fix it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: add automatic rx streaming triggersEliad Peller
When rx_streaming.interval is non-zero, use automatic rx streaming. Enable rx streaming on the each rx/tx packet, and disable it rx_streaming.duration msecs later. When rx_streaming.always=0 (default), rx streaming is enabled only when there is a coex operation. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-27wl12xx: add support for rx streamingEliad Peller
wl12xx supports the "rx streaming" feature: When in ps mode, and @timeout msecs have been passed since the last rx/tx, it issues trigger packets (QoS-null/PS-Poll packets, according to the ac type) in const intervals (in order to reduce the rx time). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-06-07wl12xx: Stop BA session event from deviceShahar Levi
Adding new event that close RX BA session in case of periodic BT activity limiting WLAN activity. Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-31wl12xx: add separate config value for DFS dwell time on sched scanLuciano Coelho
Use a different value for DFS dwell time when performing a scheduled scan. Previously we were using the same value as for normal passive scans. This adds some flexibility between these two different types of passive scan. For now we use 150 TUs for DFS channel dwell time. This may need to be fine-tuned in the future. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2011-05-18wl12xx: fix compilation error when CONFIG_PM is not setLuciano Coelho
There was a compilation error when PM is not enabled: CC [M] drivers/net/wireless/wl12xx/main.o drivers/net/wireless/wl12xx/main.c:3653: error: unknown field 'suspend' specified in initializer drivers/net/wireless/wl12xx/main.c:3653: warning: initialization from incompatible pointer type drivers/net/wireless/wl12xx/main.c:3654: error: unknown field 'resume' specified in initializer drivers/net/wireless/wl12xx/main.c:3654: warning: initialization from incompatible pointer type Fix this by adding #ifdef's in the appropriate places. Cc: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-05-13wl12xx: enter/exit psm on wowlan suspend/resumeEliad Peller
When operating as station, enter psm before suspending the device into wowlan state. Add a new completion event to signal when psm was entered successfully. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13wl12xx: prevent scheduling while suspending (WoW enabled)Eliad Peller
When WoW is enabled, the interface will stay up and the chip will be powered on, so we have to flush/cancel any remaining work, and prevent the irq handler from scheduling a new work until the system is resumed. Add 2 new flags: * WL1271_FLAG_SUSPENDED - the system is (about to be) suspended. * WL1271_FLAG_PENDING_WORK - there is a pending irq work which should be scheduled when the system is being resumed. In order to wake-up the system while getting an irq, we initialize the device as wakeup device, and calling pm_wakeup_event() upon getting the interrupt (while the system is about to be suspended) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13wl12xx: declare suspend/resume callbacks (for wowlan)Eliad Peller
Additionally, add wow_enabled field to wl, to indicate whether wowlan was configured. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13wl12xx: implement scheduled scan driver operations and reportingLuciano Coelho
This patch adds the mac80211 operations for scheduled scan and the scheduled scan results reporting. Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13wl12xx: add configuration values for scheduled scanLuciano Coelho
Add the structures and values for driver-configured scheduled scan parameters. Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13wl12xx: add IEEE80211_HW_SPECTRUM_MGMT bit to the hw flagsShahar Levi
Set the spectrum management bit in the hw flags so that mac80211 will set the WLAN_CAPABILITY_SPECTRUM_MGMT bit in association requests (which in practice means that we support 802.11h spectrum management). [Reworded the commit log -- Luca.] Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13wl12xx: Don't filter beacons that include changed HT IEsShahar Levi
This patch adds a beacon filter rule to pass up the beacons that contain changed HT information elements. These beacons need to be passed to mac80211 so that it can act on such changes. [Reworded commit log -- Luca.] Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-13wl12xx: simplify wl1271_ssid_set()Eliad Peller
Simplify wl1271_ssid_set by re-using cfg80211_find_ie instead of reimplementing it. Additionally, add a length check to prevent a potential buffer overflow. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02Revert "wl12xx: support FW TX inactivity triggers"Luciano Coelho
This reverts commit 47684808fd89d6809c0886e06f8ac324252499d8. Conflicts: drivers/net/wireless/wl12xx/conf.h drivers/net/wireless/wl12xx/main.c
2011-05-02wl12xx: fix race condition during recovery in AP modeArik Nemtsov
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. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: AP-mode - reconfigure templates after basic rates changeArik Nemtsov
When there's a change in the basic rates of the AP, reconfigure relevant templates with the new rates. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: AP-mode - overhaul rate policy configurationArik Nemtsov
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. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: print firmware program counter during recoveryArik Nemtsov
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. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: use wiphy values for setting rts, frag thresholds on initArik Nemtsov
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. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: add BT-coexistance for APArik Nemtsov
Initialize AP specific BT coexitance parameters to default values and enable them in AP mode. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: do not set queue_mapping directlyHauke Mehrtens
It is preferred to use the setter that to set queue_mapping directly. This also helps backporting in compat-wireless. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: implement the tx_frames_pending mac80211 callbackArik Nemtsov
Frames are considered pending when they reside in the driver TX queue or already queued in the FW. This notion of "pending" is appropriate for power save considerations in STA mode, but not necessarily in other modes (for instance P2P-GO). [Fixed a sparse warning about missing "static" in a function declaration -- Luca] Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: Enable dynamic memory for 127xIdo Yariv
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. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: Update Power Save Exit Retries PacketsShahar Levi
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>
2011-05-02wl12xx: FM WLAN coexistenceShahar Levi
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>
2011-05-02wl12xx: configure rates when working in ibss modeEliad Peller
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. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: avoid redundant join on interface reconfigurationEliad Peller
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) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-05-02wl12xx: Set End-of-transaction Flag at Wl127x AP ModeShahar Levi
End-of-transaction flag should be set when working with wl127x chip on AP mode. Thanks Ido Yariv <ido@wizery.com> for the guidance with that. Signed-off-by: Shahar Levi <shahar_levi@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2011-04-28wl12xx: support FW TX inactivity triggersArik Nemtsov
In AP mode we register for the MAX_TX_RETRY and INACTIVE_STA events. Both are reported to the upper layers as a TX failure in the offending stations. In STA mode we register only for the MAX_TX_RETRY event. A TX failure is interpreted as a loss of connection. Support for IEEE80211_HW_REPORTS_TX_ACK_STATUS has been removed to avoid the inherent race condition of a mac80211 TX failure counter in addition to the FW counter. This patch depends on "mac80211: allow low level driver to report packet loss" Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>