aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/wl12xx
Commit message (Collapse)AuthorAgeFilesLines
* wl12xx: Check buffer bound when processing nvs dataPontus Fuchs2012-01-121-0/+14
| | | | | | | | | | | | | | commit f6efe96edd9c41c624c8f4ddbc4930c1a2d8f1e1 upstream. An nvs with malformed contents could cause the processing of the calibration data to read beyond the end of the buffer. Prevent this from happening by adding bound checking. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* wl12xx: Validate FEM index from ini file and FWPontus Fuchs2012-01-121-0/+22
| | | | | | | | | | | | | commit 2131d3c2f99b081806fdae7662c92fe6acda52af upstream. Check for out of bound FEM index to prevent reading beyond ini memory end. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Reviewed-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* wl12xx: fix forced passive scansLuciano Coelho2011-11-111-6/+13
| | | | | | | | | | | | | | | commit 6cd9d21a0c1e2648c07c32c66bb25795ad3208aa upstream. We were using incorrect max and min dwell times during forced passive scans because we were still using the active scan states to scan (passively) the channels that were not marked as passive. Instead of doing passive scans in active states, we now skip active states and scan for all channels in passive states. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* wl12xx: fix oops in sched_scan when forcing a passive scanLuciano Coelho2011-05-311-3/+8
| | | | | | | | | | | | | | | | Fix kernel oops when trying to use passive scheduled scans. The reason was that in passive scans there are no SSIDs, so there was a NULL pointer dereference. To solve the problem, we now check the number of SSIDs provided in the sched_scan request and only access the list if there's one or more (ie. passive scan is not forced). We also force all the channels to be passive by adding the IEEE80211_CHAN_PASSIVE_SCAN flag locally before the checks in the wl1271_scan_get_sched_scan_channels() function. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: add separate config value for DFS dwell time on sched scanLuciano Coelho2011-05-313-2/+9
| | | | | | | | | | | | | 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>
* wl12xx: fix DFS channels handling in scheduled scanLuciano Coelho2011-05-312-11/+23
| | | | | | | | | | | | | DFS channels were never getting included in the scheduled scans, because they always contain the passive flag as well and the call was asking for DFS and active channels. Fix this by ignoring the passive flag when collecting DFS channels. Also, move the DFS channels in the channel list before the 5GHz active channels (this was implemented in the FW differently than specified). Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: fix passive and radar channel generation for scheduled scanLuciano Coelho2011-05-311-2/+2
| | | | | | | | | | We were comparing bitwise AND results with a boolean, so when the boolean was set to true, it was not matching as it should. Fix this by booleanizing the bitwise AND results with !!. Signed-off-by: Luciano Coelho <coelho@ti.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wl12xx: fix compilation error when CONFIG_PM is not setLuciano Coelho2011-05-182-0/+8
| | | | | | | | | | | | | | | | 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>
* Merge branch 'master' of ↵John W. Linville2011-05-1620-294/+1578
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6 into for-davem Conflicts: drivers/net/wireless/iwlwifi/iwl-agn-tx.c net/mac80211/sta_info.h
| * wl12xx: enter/exit psm on wowlan suspend/resumeEliad Peller2011-05-134-0/+91
| | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx_sdio: declare support for NL80211_WOW_TRIGGER_ANYTHING triggerEliad Peller2011-05-131-0/+8
| | | | | | | | | | | | | | | | | | Since wowlan requires the ability to stay awake while the host is suspended, declare support for NL80211_WOW_TRIGGER_ANYTHING if the MMC_PM_KEEP_POWER capability is being supported. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: prevent scheduling while suspending (WoW enabled)Eliad Peller2011-05-133-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx_sdio: set MMC_PM_KEEP_POWER flag on suspendEliad Peller2011-05-131-1/+28
| | | | | | | | | | | | | | | | | | | | | | if a wow trigger was configured, set the MMC_PM_KEEP_POWER flag on suspend, so our power will be kept while the system is suspended. We needed to set this flag on each suspend attempt (when we want to keep power) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: declare suspend/resume callbacks (for wowlan)Eliad Peller2011-05-132-0/+25
| | | | | | | | | | | | | | | | 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>
| * wl12xx_sdio: set interrupt as wake_up interruptEliad Peller2011-05-131-0/+3
| | | | | | | | | | | | | | | | set the sdio interrupt as wake_up interrupt, so we will be able to wake up the suspended system (Wake-On-Wireless) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: remove unused flag WL1271_FLAG_IDLE_REQUESTEDLuciano Coelho2011-05-131-1/+0
| | | | | | | | | | | | This flag is not used anymore, remove it from the list. Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: prevent sched_scan when not idle or not in station modeLuciano Coelho2011-05-131-0/+6
| | | | | | | | | | | | | | | | The current firmware only supports scheduled scan in station mode and when idle. To prevent the firmware from crashing, return -EOPNOTSUPP when sched_scan start is called in an invalid state. Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: export scheduled scan state in debugfsLuciano Coelho2011-05-131-0/+1
| | | | | | | | | | | | Add the sched_scanning value to the driver_status debugfs entry. Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: implement scheduled scan driver operations and reportingLuciano Coelho2011-05-134-1/+83
| | | | | | | | | | | | | | This patch adds the mac80211 operations for scheduled scan and the scheduled scan results reporting. Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: add scheduled scan structures and commandsLuciano Coelho2011-05-132-0/+347
| | | | | | | | | | | | | | Add firmware command structures, definitions and code to to configure, start and stop scheduled scans. Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: listen to scheduled scan eventsLuciano Coelho2011-05-132-1/+13
| | | | | | | | | | | | | | | | Subscribe and listen to PERIODIC_SCAN_REPORT_EVENT_ID and PERIODIC_SCAN_COMPLETE_EVENT_ID in preparation for the scheduled scan implementation. Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: add configuration values for scheduled scanLuciano Coelho2011-05-132-0/+30
| | | | | | | | | | | | | | Add the structures and values for driver-configured scheduled scan parameters. Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: add IEEE80211_HW_SPECTRUM_MGMT bit to the hw flagsShahar Levi2011-05-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: Don't filter beacons that include changed HT IEsShahar Levi2011-05-131-2/+6
| | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: simplify wl1271_ssid_set()Eliad Peller2011-05-131-11/+15
| | | | | | | | | | | | | | | | | | | | 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>
| * Revert "wl12xx: support FW TX inactivity triggers"Luciano Coelho2011-05-0210-125/+17
| | | | | | | | | | | | | | | | | | This reverts commit 47684808fd89d6809c0886e06f8ac324252499d8. Conflicts: drivers/net/wireless/wl12xx/conf.h drivers/net/wireless/wl12xx/main.c
| * wl12xx: export driver state to debugfsArik Nemtsov2011-05-021-0/+87
| | | | | | | | | | | | | | | | | | 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". Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: fix race condition during recovery in AP modeArik Nemtsov2011-05-023-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: add debugfs entry for starting recoveryArik Nemtsov2011-05-021-0/+20
| | | | | | | | | | | | | | | | This entry is useful for debugging the driver state machine during recovery. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: AP-mode - reconfigure templates after basic rates changeArik Nemtsov2011-05-023-1/+11
| | | | | | | | | | | | | | | | 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>
| * wl12xx: AP-mode - overhaul rate policy configurationArik Nemtsov2011-05-025-85/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: print firmware program counter during recoveryArik Nemtsov2011-05-021-1/+2
| | | | | | | | | | | | | | | | | | 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>
| * wl12xx: schedule recovery on command timeoutArik Nemtsov2011-05-021-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: AP-mode - disable beacon filtering on start upArik Nemtsov2011-05-023-1/+42
| | | | | | | | | | | | | | | | New AP-mode FWs filter external beacons by default. Disable this filtering on start up so we can properly configure ERP protection. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: use wiphy values for setting rts, frag thresholds on initArik Nemtsov2011-05-024-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: add BT-coexistance for APArik Nemtsov2011-05-025-17/+146
| | | | | | | | | | | | | | | | 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>
| * wl12xx: strict_stroul introduced converted to kstrtoulLuciano Coelho2011-05-021-2/+2
| | | | | | | | | | | | | | One new patch applied added a couple of new strict_strtoul calls. Converted those to kstroul(). Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: do not set queue_mapping directlyHauke Mehrtens2011-05-021-1/+1
| | | | | | | | | | | | | | | | 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>
| * wl12xx: discard corrupted packets in RXArik Nemtsov2011-05-021-7/+26
| | | | | | | | | | | | | | | | | | | | | | When packets arrive with a RX descriptor indicating corruption, discard them. In general white-list the RX descriptor status to prevent rouge data from being sent up. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: implement the tx_frames_pending mac80211 callbackArik Nemtsov2011-05-021-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: Enable dynamic memory for 127xIdo Yariv2011-05-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: Restart TX when TX descriptors are availableIdo Yariv2011-05-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: Modify memory configuration for 128x/APIdo Yariv2011-05-021-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: add debugfs entries for dtim_interval and beacon_intervalEliad Peller2011-05-021-0/+132
| | | | | | | | | | | | | | | | | | | | When configuring ACX_WAKE_UP_CONDITIONS (before entering psm), we tell the firmware to wake up once in N DTIMs/beacons. Allow control of this value via debugfs (for debugging purposes). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: Update Power Save Exit Retries PacketsShahar Levi2011-05-021-1/+1
| | | | | | | | | | | | | | | | | | 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>
| * wl12xx: FM WLAN coexistenceShahar Levi2011-05-025-0/+137
| | | | | | | | | | | | | | | | | | 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>
| * wl12xx: configure rates when working in ibss modeEliad Peller2011-05-022-0/+25
| | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: avoid redundant join on interface reconfigurationEliad Peller2011-05-021-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * wl12xx: print actual rx packet size (without padding)Eliad Peller2011-05-021-1/+2
| | | | | | | | | | | | | | | | | | When debugging, reduce the padding size from each rx packet, to get the actual packet size (so comparing it against a cap file will be easier) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
| * wl12xx: Set correct REF CLK and TCXO CLK values to the FWShahar Levi2011-05-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | 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>