summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/wl12xx/main.c
AgeCommit message (Collapse)Author
2012-04-12wireless/wl12xx/wl1251: move TI WLAN modules to a common ti subdirectoryLuciano Coelho
Move wl12xx and wl1251 modules into a new drivers/net/wireless/ti directory. Add a TI WLAN Kconfig option and Makefile to support this change. Signed-off-by: Luciano Coelho <coelho@ti.com> Cc: John W. Linville <linville@tuxdriver.com>
2012-04-10wl12xx: adaptive sched scan dwell timesEyal Shapira
Set the dwell times for sched scan according to the number of probe requests which are going to be transmitted. This should fix the too short dwell time problem which prevented some of the probe requests from being transmitted in cases of high number of SSIDs (10+) to be actively sched scanned. However, in the common case of having up to 1-2 SSIDs that require active scan, the dwell time would be kept to a minimum which should conserve power. This is important as sched scan also runs periodically while the host is suspended and there's great importance to keep power consumption as low as possible. Signed-off-by: Eyal Shapira <eyal@wizery.com> [fixed a couple of new strict checkpatch warnings] Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-10wl12xx: fix a memory leak of probereq template upon recoveryEyal Shapira
wlvif->probereq is zeroed when adding an interface but the skb pointed to isn't freed when the interface is removed. This would lead to a mem leak on every recovery. Fix it by freeing the skb when removing the interface. Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-10wl12xx: free ap keys only in ap modeEliad Peller
The ap keys should be freed only when removing ap role (otherwise, some arbitrary data might get freed). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-10wl12xx: fix DMA-API-related warningsMircea Gherzan
On the PandaBoard (omap_hsmmc + wl12xx_sdio) with DMA_API_DEBUG: WARNING: at lib/dma-debug.c:930 check_for_stack.part.8+0x7c/0xe0() omap_hsmmc omap_hsmmc.4: DMA-API: device driver maps memory fromstack Signed-off-by: Mircea Gherzan <mgherzan@gmail.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-10wl12xx: fix race between suspend/resume and recoveryEyal Shapira
The iteration on the wlvif list in wl1271_op_resume/suspend was perfomed before locking wl->mutex which would lead to a kernel panic in case a recovery was queued at the same time and would delete the wlvifs from the list. Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-10wl12xx: set do_join on BSS_CHANGED_ASSOCEliad Peller
wl12xx sets the do_join flag (which later starts the sta role) when the bssid was changed and the sta is associated. However, this no longer happens after the "mac80211: remove spurious BSSID change flag" patch. Fix it by setting the do_join flag on BSS_CHANGED_ASSOC (for IBSS, do_join is already set on BSS_CHANGED_IBSS) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-09wireless: rename ht_info to ht_operationJohannes Berg
Since some of the HT code pre-dates 802.11n-2009 some names are wrong. The one that bothers me most is that "HT operation" is called "HT information" in our code and that causes confusion. Rename "HT information" to "HT operation" and also the control_chan field to primary_chan to match the name used in the spec. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-03-08wl12xx: implement SW Tx watchdogArik Nemtsov
Track freed FW blocks during Tx. If no blocks were freed during a predefined timeout, initiate a HW recovery. This helps in situations when the FW watchdog fails. Don't trigger recovery during activities that can temporarily stop Tx. This includes: - scanning - buffering packets for sleeping stations (AP role) - ROC on any role Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: print the tx packet lenEliad Peller
Add the packet length to the tx debug print. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: avoid bug_on_recovery during fw switchEliad Peller
Add a flag to indicate we initiated a recovery work on purpose, in order to avoid triggering BUG() (when the bug_on_recovery module param was set). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: configure the correct beacon_intervalEliad Peller
We didn't update the beacon interval on association (or on a change notification when working as sta), so the default interval (100ms) was always used. Update the beacon interval according to the bss_conf before starting the sta role (on association). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: don't allow scanning while device is in ROCEliad Peller
return EBUSY on scan when there is any role in ROC (not necessarily the one we are going to use) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: don't handle change_channel while associatedEliad Peller
Currently, CHANGE_CHANNEL indication while associated is considered as roaming attempt. However, with the new auth/assoc redesign, we no longer have to handle this case, so remove it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: set correct vif type in change_interface callbackEliad Peller
In some cases, the wrong vif type was set in the change_interface callback (P2P_CLIENT/P2P_GO instead of STA/AP) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: set authorized AP on sta_state notificationEliad Peller
wl12xx currently looks for AP authorization by registering a netdev notifier and waiting for the IF_OPER_UP notification, which is quite cumbersome. Use the newly introduced sta_state callback (waiting for assoc -> auth notification) instead, in order to simplify it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: implement sta_state callbackEliad Peller
Implement sta_state callback instead of the sta_add/remove callbacks. Update the fw regarding peer state and ht caps only after the station was authorized. Otherwise, the fw might try establishing BA session before the sta is authorized. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: consider bss_conf->idle instead of hw->conf.flagsEliad Peller
On disassociation, check only whether the current vif is idle, instead of checking whether the device is idle. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-03-05wl12xx: don't start dev role on ibss vifsEliad Peller
device role is used for scanning and sending packets before connection. however, since we don't need to send packets before ibss creation, there is no need to start the device on idle-off. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-28wl12xx: increase dynamic PS timeout to 200msArik Nemtsov
This ensures the user won't encounter lag associated with getting in and out of PSM when the card is in use. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-28wl12xx: flush Tx during suspend and 802.11h chan switchArik Nemtsov
Flush our Tx queues before suspending or changing the channel due to a channel_switch element in the AP beacon. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-28wl12xx: reset link Tx queues when freeing itArik Nemtsov
Before, the link was first freed (invalidating it in the map), and later on vif removal, all valid wlvif-related links were reset. Since these links were already invalid, we failed to reset them. The bug was made worse by op_stop, which set the tx_queue_count to 0 arbitrarily. This resulted in a negative tx_queue_count in some scenarios. Fix this by resetting the Tx-queues of a link when freeing it. Add a WARN_ON and reset all link Tx-queues in op_stop, to avoid a negative tx_queue_count. [changed WARN_ON to WARN_ON_ONCE -- Luca] Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: remove some dead code in wl1271_plt_init()Dan Carpenter
"ret" has already been checked at this point, and we don't need to check it again. This was left around from a previous patch 49d750ca14 "wl12xx: 1281/1283 support - New radio structs and functions". Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: delete wl->vif (and allow multiple vifs)Eliad Peller
Delete the global wl->vif (and the checks on it), so multiple vifs could be added. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: enter forced-psm on fw changeEliad Peller
Enter forced psm when changing fw, in order to make the sta a bit more disconnection-persistent. (DPM doesn't know about the incoming recovery, so it won't enter psm by itself) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: dynamically change fw according to number of active rolesEliad Peller
wl12xx uses different fw for single-role and multi-role scenarios (due to lack of space, some of the fw advanced features are disabled in the multi-role fw). Add checks on add_interfae and remove_interface in order to determine whether a fw switch is needed (and initiate recovery in this case). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: Use a dedicated fw for PLTEliad Peller
A special PLT firmware is used for calibration. Add multiple fw support by introducing a new fw_type member, representing the currently saved fw (the actual fw state can be determined by wl->state). Signed-off-by: Gery Kahn <geryk@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: use split scan for normal scanEyal Shapira
Split scan allows the FW to schedule other activities during a scan which may be a long operation. This is achieved by setting a trigger TID to ANY_TID and a scan trigger timeout other than 0. The default one is set to 50ms. Signed-off-by: Eyal Shapira <eyal@wizey.com> Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: increase max probe-req template size to WL1271_CMD_TEMPL_MAX_SIZEIdo Reis
Increase max scan IEs to allow big probe-req frames Report a correct max-length for the scan IEs we can support, according to the now larger size of the probe-req template. Signed-off-by: Ido Reis <idor@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: declare support for hw scan while idleEliad Peller
By allowing hw scan while idle, we no longer need the redundant ROC/CROC that are done on idle off/on, which helps simplifying the state machine of the driver. This way, we can also allow scanning while there is an ongoing sched scan (otherwise, we won't be able to ROC on idle-off) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: configure arp filtering only after associationEliad Peller
We have to configure arp filtering only after the role was started, so move the BSS_CHANGED_ARP_FILTER handling after the join. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: Revert "wl12xx: disable auto-arp"Eliad Peller
This reverts commit e5e2f24b3eec67a7a35d43654a997f98ca21aff2. The encryption consideration on auto-arp configuration, along with a fw fix, seem to resolve the crashes that occured when auto-arp was enabled, so we can re-enable it now. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: consider encryption and QoS in auto arp templateEliad Peller
When configuring the arp response template, and encryption is enabled, we should add some space and set the protected flag bit in the fc. In order to track the encryption type, set wlvif->encryption_type when setting an encryption key, and reconfigure the arp response. Clear this field on wl1271_join, as keys have to be re-configured anyway after a join command. Similarly, track whether QoS is configured. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: add forced_ps modeEyal Shapira
For certain WiFi certification tests forcing PS is necessary. Since DPS is now enabled in the FW and this can't be achieved by using netlatency this required a new config option. Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: Set different wake up conditions in case of suspendEyal Shapira
Added ability to set different wake up conditions for suspend/resume. Set default values to wake up every 3 DTIMs while suspended and every 1 DTIM while resumed Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: add new coex paramsEliad Peller
new params were added to the coex params. Add them with default value of 0. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: Set IEEE80211_TX_RC_SHORT_GI if short GI was used onPontus Fuchs
New FW reports usage of short GI as a rate class index. Check for this rate and set the IEEE80211_TX_RC_SHORT_GI if used. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: change WLVIF_FLAG_PSM name and remove WLVIF_FLAG_PSM_REQUESTEDEyal Shapira
WLVIF_FLAG_PSM turned to WLVIF_FLAG_IN_AUTO_PS which marks that this vif is in AUTO PS. WLVIF_FLAG_PSM_REQUESTED is not required as mac80211 calls op_config with CONF_PS after association. wl12xx_config_vif() handling of CONF_PS was simplified and cleaned up. Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: remove 2 unused parameters in wl1271_ps_set_mode()Eyal Shapira
cleanup 2 unused parameters of wl1271_ps_set_mode Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: add support for HW dynamic PSEyal Shapira
FW now supports dynamic PS so we don't need to use mac80211 support. FW will go to PSM after a specified timeout with no Rx/Tx traffic. - Changed FW API to include new PS mode (AUTO_MODE) and including timeout parameter - The default PS mode would be dynamic PS - Default timeout is 100ms (same as it used to be in mac80211) - Avoid using mac80211 APIs to disable/enable dynamic PS as we're not using mac80211 PS control anymore. - COEX is handled by the FW while in dynamic PS so removed handling of SOFT_GEMINI Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: remove PS management codeEyal Shapira
Removal of PS management code from the driver as PS is handled by the FW (dynamic PS) Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: fw api change - update cmd/acx/event enumsEliad Peller
Update enums/structs to the new fw api. Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: fw api change - add role_id to tsf_infoEliad Peller
The ACX_TSF_INFO command now takes role_id as param. change the struct accordingly, and pass the wlvif to the wl1271_acx_tsf_info() function. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: use dev_role_id for scansEliad Peller
Use device role for scans when the sta is not associated. sched_scan is used only when the sta is not associated, and thus should use the dev role (instead of sta role). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: fw api change - add role_id to set_templateEliad Peller
The set_template commands now takes the role_id as parameter. Usually, we'll use the vif's main role_id. However, sometimes we'll want to use wlvif->dev_role_id instead of wlvif->role_id, so pass the wanted role_id as param. Update WL127X_FW_NAME/WL128X_FW_NAME. (This commit starts a series of fw update patches, and changes the start() callback to return an error in order to prevent the use of the driver during the transition. This change will be reverted in the last patch of series) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: check bss_conf->assoc on CHANGED_BSSIDEliad Peller
with the new auth/assoc redesign, we get CHANGED_BSSID indication before CHANGED_ASSOC indication, while our CHANGED_BSSID handling block assumes we are already associated. Fix it by checking we are either in ibss mode, or already associated. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: fix typo in fwlog module param descriptionLuciano Coelho
Fix a copy and paste bug in the MODULE_PARAM_DESC for fwlog. Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: use two MAC addresses based on the NVS or from fuse ROMLuciano Coelho
Add support for two MAC addresses. If the NVS has a valid MAC address, that takes precedence and we use two sequential address starting from the one specified. If the NVS doesn't contain a valid MAC address (ie. if it is set to 00:00:00:00:00:00), we check if the HW PG version in use has the BD_ADDR written in the fuse ROM. If it does, we read it and derive the two subsequent addresses for WLAN. During production, 3 addresses are reserved per device. The first for Bluetooth (burnt in the fuse ROM) and the following two for WLAN. This patch has some code by Igal and Arik (squashed from internal patches). Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: read chip ID and HW PG version during probeLuciano Coelho
In order to read the MAC addresses from the fuse ROM, we need to know the chip ID and the HW PG version. We need to know the MAC address during probe, because that's when we register our HW with mac80211. To prepare for that, this patch reads the chip ID and HW PG version during probe instead of doing it at boot time. We power the chip on briefly in order to do that. Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-02-15wl12xx: cancel delayed elp work and clear flags when stopping PLTLuciano Coelho
In some cases a race condition can happen if we don't cancel any pending ELP work before stopping PLT. With this commit we cancel ELP work and clear the wl->flags bitmask. Also clean up the wl elements after powering off. Signed-off-by: Luciano Coelho <coelho@ti.com>