summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wlcore
AgeCommit message (Collapse)Author
2012-12-06wlcore/wl18xx/wl12xx: remove __dev* attributesBill Pemberton
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Cc: Luciano Coelho <coelho@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
2012-11-30mac80211: remove probe response temporary buffer allocationJohannes Berg
Instead of allocating a temporary buffer to build IEs build them right into the SKB. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-26mac80211: convert to channel definition structJohannes Berg
Convert mac80211 (and where necessary, some drivers a little bit) to the new channel definition struct. This will allow extending mac80211 for VHT, which is currently restricted to channel contexts since there are no drivers using that which makes it easier. As I also don't care about VHT for drivers not using the channel context API, I won't convert the previous API to VHT support. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-11-09mac80211: clarify interface iteration and make it configurableJohannes Berg
During hardware restart, all interfaces are iterated even though they haven't been re-added to the driver, document this behaviour. The same also happens during resume, which is even more confusing since all of the interfaces were previously removed from the driver. Make this optional so drivers relying on the current behaviour can still use it, but to let drivers that don't want this behaviour disable it. Also convert all API users, keeping the old semantics except in hwsim, where the new normal ones are desired. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-09-27wlcore: protect wlcore_op_set_key with mutexEliad Peller
wlcore_op_set_key() calls wl18xx_set_key(), which in turn executes some of his function calls without acquiring wl->mutex and making sure the fw is awake. Adding mutex_lock()/ps_elp_wakeup() calls is not enough, as wl18xx_set_key() calls wl1271_tx_flush() which can't be called while the mutex is taken. Add the required calls to wlcore_op_set_key, but limit the queues_stop and flushing to the only encryption types in which a spare block might be needed (GEM and TKIP). [Arik - move state != ON check] Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: decrease elp timeoutEliad Peller
The current elp timeout (the same as the dynamic ps timeout - 1500ms) is too high. Usually, wl1271_ps_elp_sleep() get called right after tx/rx, which is fine, but some command might get sent even when there is no traffic (e.g. ht changes triggered by beacon frames), and leaving the device awake for 1500ms in this case is redundant. Use a timeout of 30ms. The fw won't enter elp anyway before the dynamic-ps timeout was expired as well (and it entered ps successfully). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: Load the NVS file asynchronouslyIdo Yariv
The NVS file is loaded by the device's probe callback with the help of request_firmware(). Since request_firmware() relies on udevd, the modules cannot be loaded before hotplug events are handled. Fix this by loading the NVS file asynchronously and continue initialization only after the firmware request is over. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: Refactor probeIdo Yariv
Move most of the device-specific probe functionality into setup(), a new op. By doing this, wlcore_probe will be the first to request a firmware from userspace, making it easier to load the NVS file asynchronously. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: Allow memory access when the FW crashesIdo Yariv
When the no_recovery flag is used, the recovery work will not restart the FW and the state will not be set to 'on'. To enable post-mortem analysis, allow memory access in the 'restarting' state. Also, since the FW might not be operational, don't fail the read/write operations if elp_wakeup fails. Reported-by: Arkady Miasnikov <a-miasnikov@ti.com> Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: use dynamic keep-alive template idsEliad Peller
Currently, all the (station) roles use the same keep-alive template id (0). However, the klv template ids shouldn't be shared by different roles. Implement a simple klv_templates bitmap, and let each role allocate its own klv template id on role initialization. [Arik - remove invalidation of KLV template when getting into "idle". This is already handled in unjoin] Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: invalidate keep-alive template on disconnectionEliad Peller
Previously, invalidation of the keep-alive template was done when going idle. However, while removing the idle-handling we didn't move the keep-alive template invalidation to another place. This finally resulted in fw error when trying to use the keep-alive template by another role. (Note that we still have an error here - each role should have its unique keep-alive template id, while currently they all use CMD_TEMPL_KLV_IDX_NULL_DATA (0). This only works now because we don't support concurrent connected stations yet) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: Don't recover during bootIdo Yariv
While recursive recovery is avoided during shutdown, a new recovery may be queued when the FW boots. The recovery work will then try to stop an already stopped hardware, which will most likely result in a kernel panic. Fix this by verifying that wl->state is on before queueing a new recovery. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore/wl18xx: add phy_fw_version_str to debugfs driver_stateYair Shapira
add phy_fw_version_str to debugfs driver_state file. information is taken during boot and stored in wl->chip.phy_fw_ver_str. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: spi: use private max-buf-size limitArik Nemtsov
Limit SPI transmissions to the wl12xx max buffer size, as only 12xx was tested with SPI. This allows us to remove the global aggregation buffer constant. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: allow up to 3 running STA interfaces in combinationsArik Nemtsov
This allows us to have a p2p-management interface (in STA mode), as we as a group dedicated interface. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: lazy-enable device rolesEliad Peller
Enable device roles just before starting it. This way, a single device role should be enough for all vifs, as we can't use concurrent device roles (which require ROC) anyway. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: always use wlvif->role_id for scansEliad Peller
enabled (but not-started) sta role should be good enough for scanning (both normal and scheduled), so use it instead of the device_role. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: make debug prints work without dynamic debugArik Nemtsov
Make debug prints operational when dynamic debug is not defined. This allows better debugging in production environments. Change the driver prefix to "wlcore" while were at it. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore/wl18xx/wl12xx: allow up to 3 mac addressesArik Nemtsov
Allow 3 native mac addresses on 18xx. On 12xx allow 2 native mac addresses and set the LAA bit to create a third mac address. This enabled operation with a separate group interface. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: resume() only if sta is associatedEliad Peller
mac80211's resume() callback might get called even if the sta is not associated (but only up). The resume sequence in this case results in configuring the wake-up conditions of a non-started role, which causes fw assertion. Fix it by bailing out if the STA is not connected (like we do on suspend()). Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: configure wowlan regardless of wakeup conditionsEyal Shapira
wowlan filters should be configured in any case in suspend/resume. This shouldn't be dependent on whether wakeup conditions are the same for suspend and resume states. Only the FW command to reconfigure wakeup conditions should be avoided in such a case. Reported-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore/wl18xx/wl12xx: aggregation buffer size setIgal Chernobelsky
Aggregation buffer size is set separately per 18xx/12xx chip family. For 18xx aggragation buffer is set to 13 pages to utilize all the available tx/rx descriptors for aggregation. [Arik - remove redundant parts from the patch] Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: tx_flush - optimize flow and force Tx during the flushArik Nemtsov
Force Tx during the flush if there are packets pending in the driver. This actually solves a bug where we would get called from the mac80211 wq context, which would prevent tx_work from getting queued, even when the mutex is unlocked. Don't stop the queues needlessly if there's nothing to flush. Use a larger delay when sleeping to give the driver a chance to flush and avoid cpu busy looping. Re-arrange the loop so the last iteration is not wasted. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: make Tx flush timings more verboseArik Nemtsov
Print how much time a flush took. This will help debug the time it takes to switch between channels. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: allow only the lowest OFDM rate for p2p setup framesArik Nemtsov
The IEEE80211_TX_CTL_NO_CCK_RATE flag is only set for mgmt packets transmitted during p2p connection setup. Make sure to use the lowest OFDM rate guarantee the peer always hears us. Change the p2p rate policy to contain only the 6mpbs rate to acheive this effect. Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: AP mode - send non-data packets with basic ratesArik Nemtsov
This solves interoperability issues with peer that don't seem to "hear" management packets transmitted in higher rates. Based on a previous patch by Igal Chernobelsky. Cc: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: cancel recovery_work on stop() instead of remove_interface()Eliad Peller
recovery_work should be cancelled when stopping the device, not when removing an interface (this is probably a leftover from the single-role days) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: Prevent interaction with HW after recovery is queuedIdo Yariv
When a function requests to recover, it would normally abort and will not send any additional commands to the HW. However, other threads may not be aware of the failure and could try to communicate with the HW after a recovery was queued, but before the recovery work began. Fix this by introducing an intermediate state which is set when recovery is queued, and modify all state checks accordingly. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: consider single fw caseEliad Peller
When a single fw is being used for both single-role and multi-role cases (e.g. 18xx), wl->mr_fw_name is NULL, which results in NULL dereference while trying to load the multi-role fw. In this case, always use the single-role fw, and avoid redundant fw switch by checking for this case in wl12xx_need_fw_change() as well. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: Declare MODULE_FIRMWARE usageTim Gardner
Declare any firmware that might be used by this driver. If all drivers declare their firmware usage, then a sufficiently complete list of firmware files can then be used to pare down the external linux-firmware package to just the files in actual use. Cc: Luciano Coelho <coelho@ti.com> Cc: linux-wireless@vger.kernel.org Cc: netdev@vger.kernel.org Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-07-31mac80211: move TX station pointer and restructure TXThomas Huehn
Remove the control.sta pointer from ieee80211_tx_info to free up sufficient space in the TX skb control buffer for the upcoming Transmit Power Control (TPC). Instead, the pointer is now on the stack in a new control struct that is passed as a function parameter to the drivers' tx method. Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de> Signed-off-by: Alina Friedrichsen <x-alina@gmx.net> Signed-off-by: Felix Fietkau <nbd@openwrt.org> [reworded commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-07-31wlcore: op_tx: pass sta explicitly when inferring frame hlidArik Nemtsov
avoid using the skb CB for getting the appropriate sta. Signed-off-by: Arik Nemtsov <arik@wizery.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-07-31wlcore: don't get the hlid from a queued skbArik Nemtsov
There was a bug hiding here since the hlid was sometimes inferred from the sta, which might be invalid at this point. Instead, propagate the hlid from the skb-queue where we got the skb in the first place. Signed-off-by: Arik Nemtsov <arik@wizery.com> Acked-by: Luciano Coelho <coelho@ti.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2012-07-20Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2012-07-18wlcore: increase command completion timeoutLuciano Coelho
In some rare cases, the CMD_ROC completion may take over 1 second. The timeout had earlier been increased to 1000ms (from 750ms), but it is still not enoug. Increase it to 1500ms. Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore: wait for command completion event when sending CMD_ROLE_STOPLuciano Coelho
We need to wait for the command completion event when we send the CMD_ROLE_STOP event otherwise we may try to send CMD_ROLE_START too soon and get out-of-sync with the firmware. In some cases, the firmware may not send the event, so we wait for the event or for the timeout, whichever comes first. This patch is based on an earlier version by Eliad. Cc: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore: make usage of nla_put clearerYair Shapira
handle errors of nla_put() inside the if(nla_put...) {} This makes the code simpler and clearer because: we take advantage from the fact that we have only one nla_put in our routines (so no real need for goto label). this avoids ugly goto forward followed by goto backward. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore/wl12xx: calibrator fem detect implementationYair Shapira
this completes the calibrator based fem detect logic in driver: driver starts (by calibrator) in plt_mode PLT_FEM_DETECT wlcore inits and starts plt on wl12xx wl12xx fetches fem number from firmware and stores it in wl->fem_manuf wl12xx immediatly returns (doesn't start radio, etc...) wlcore returns the fem_manuf to calibrator using WL1271_TM_ATTR_DATA plt_mode is stopped Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore: add plt_mode including new PLT_FEM_DETECTYair Shapira
add wl->plt_mode that is used to indicate different plt working modes: this will be used to implement calibrator side auto fem detection where driver asks firmware to detect the wlan fem radio type and returns it to calibrator. this is not implemented yet and plt_modes: PLT_ON and PLT_FEM_DETECT currently behave the same. Signed-off-by: Yair Shapira <yair.shapira@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore: use basic rates for non-data packetsEliad Peller
After the latest mac80211 changes, the sta has the ap's sta pointer even before association. This cause the auth and assoc frames to be sent with the standard ap's rates, rather than the basic rates. Change the tx rate policy logic to use the regular ap rates only for data packets (so control and mgmt packets will be sent with basic rates) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore: don't issue SLEEP_AUTH command during recoveryArik Nemtsov
During interface removal, don't adjust sleep_auth if we are during recovery. Since the FW is potentially dead we shouldn't talk to it. Reported-by: Yossi Wortzel <yossiw@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore: send EAPOLs using minimum basic rate for all rolesIgal Chernobelsky
Send EAPOLs using minimum basic rate for AP, STA, p2p GO and Client. The patch fixes p2p connection issue with Realtek device in p2p certification test 5.1.13 (DEVUT reinvokes Persistent Group). Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-18wlcore: don't re-configure wakeup conditions if not neededEyal Shapira
suspend and resume callbacks configure wakeup conditions to the FW which may be different between suspend and resume. This feature is currently not utilized as both in suspend and resume FW wakeup every 1 DTIM. Avoid waking up the chip and doing the FW command unless there's an actual difference in the wakeup conditions. Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-12Merge branch 'master' of ↵John W. Linville
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next into for-davem
2012-07-10wlcore: fix a couple small memory leaksDan Carpenter
We should free "chunk" here before returning the error code. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10wlcore: check ssid length against the correct elementEliad Peller
commit 587cc28 ("wlcore: compare ssid_len before comparing ssids") introduced a new bug - the ssid length from the request struct was compared against the ssid length of another request, instead the one of the cmd. This might cause the sched scan request to fail (with -EINVAL) in many cases. Signed-off-by: Eliad Peller <eliad@wizery.com>
2012-07-10wlcore: define number of supported bands internallyArik Nemtsov
Avoid using the IEEE80211_NUM_BANDS constant for arrays sizes etc, as this can contain bands unsupported by the driver (e.g. 60Ghz). Use an internal constant to determine the number of bands. Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-07-10wlcore: don't set SDIO_FAILED flag when driver state is offArik Nemtsov
If some IO read/write fails while the FW is not loaded, a recovery will not take place. This means the SDIO_FAILED flag will stay in place forever and prevent further read/writes. This can happen if a check for STATE_OFF was forgotten in some routine. Take this opportunity to rename the flag to IO_FAILED, since we support other buses as well. Reported-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-07-10wlcore: change the wait for event mechanismYoni Divinsky
wlcore needs to wait for certain events for example for roc complete event. Usually the events are received from the FW very fast, therefore wlcore can poll with a short delay and if after a second the event was not received yet poll with a long (1-5 msec) delay. This implementation is similar to the sending of commands to the FW. Empirically the change reduced the wait for roc event from ~10-40msec to 100s of usecs. [replace udelay/msleep with usleep_range - Arik] Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>
2012-07-10wlcore: Prevent processing of work items during op_stopIdo Yariv
The interrupt line is disabled in op_stop using disable_irq. Since pending interrupts are synchronized, the mutex has to be released before disabling the interrupt to avoid a deadlock with the interrupt handler. In addition, the internal state of the driver is only set to 'off' after the interrupt is disabled. Otherwise, if an interrupt fires after the state is set but before the interrupt line is disabled, the interrupt handler will not be able to acknowledge the interrupt resulting in an interrupt storm. The driver's operations might be called during recovery. If these acquire the mutex after it was released by op_stop, but before the driver's state is changed, they may queue new work items instead of just failing. This is especially problematic in the case of scans, in which a new scan may be scheduled after all scan requests were cancelled. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com>