aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/wmi.c
Commit message (Collapse)AuthorAge
* cfg80211: allow passing frame type to cfg80211_inform_bss()Johannes Berg2014-08-26
| | | | | | | | | | | | | When using the cfg80211_inform_bss[_width]() functions drivers cannot currently indicate whether the data was received in a beacon or probe response. Fix that by passing a new enum that indicates such (or unknown). For good measure, use it in ath6kl. Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> [ath6kl] Acked-by: Arend van Spriel <arend@broadcom.com> [brcmfmac] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: remove @gfp parameter from cfg80211_rx_mgmt()Vladimir Kondratiev2014-08-26
| | | | | | | | | | | | | | In the cfg80211_rx_mgmt(), parameter @gfp was used for the memory allocation. But, memory get allocated under spin_lock_bh(), this implies atomic context. So, one can't use GFP_KERNEL, only variants with no __GFP_WAIT. Actually, in all occurrences GFP_ATOMIC is used (wil6210 use GFP_KERNEL by mistake), and it should be this way or warning triggered in the memory allocation code. Remove @gfp parameter as no actual choice exist, and use hard coded GFP_ATOMIC for memory allocation. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath6kl: add support wmi rate tables with mcs15Jessica Wu2014-07-14
| | | | | | | | Some of the firmware versions support rate tables up to mcs15, add support for that. Signed-off-by: Jessica Wu <wjessica@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: convert ar6004 hardware flags to firmware feature flagsKalle Valo2014-07-14
| | | | | | | | | | | | | The functionality defined through these flags were actually firmware features which can change between firmware versions. To make it possible to support different firmware versions with the same driver, convert the flags to firmware feature flags. For backwards compatibility support for old ar6004 firmware FW API 3 or smaller images we forcefully set the feature bits in the driver. Starting from FW API 5 the firmware image needs to set them. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-nextJohn W. Linville2014-05-22
|\
| * cfg80211: constify more pointers in the cfg80211 APIJohannes Berg2014-05-19
| | | | | | | | | | | | | | | | | | | | This also propagates through the drivers. The orinoco driver uses the cfg80211 API structs for internal bookkeeping, and so needs a (void *) cast that removes the const - but that's OK because it allocates those pointers. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | ath6kl: use braces on both arms of if statementKalle Valo2014-03-13
| | | | | | | | | | | | | | | | Fixes checkpatch warning: CHECK: braces {} should be used on all arms of this statement Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: fix blank lines before and after bracesKalle Valo2014-03-13
|/ | | | | | | | | Fixes checkpatch warnings: CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Blank lines aren't necessary before a close brace '}' Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath: remove camel case from struct reg_dmn_pair_mappingKalle Valo2014-02-14
| | | | | | | | Fixes a checkpatch warning in ath10k: drivers/net/wireless/ath/ath10k/mac.c:1636: WARNING: Avoid CamelCase: <regpair->regDmnEnum> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* cfg80211: in bitrate_mask, rename mcs to ht_mcsJanusz Dziedzic2013-12-05
| | | | | | | | | Rename NL80211_TXRATE_MCS to NL80211_TXRATE_HT and also rename mcs to ht_mcs in struct cfg80211_bitrate_mask. Signed-off-by: Janusz Dziedzic <janusz.dziedzic@tieto.com> [reword commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* cfg80211: add flags to cfg80211_rx_mgmt()Vladimir Kondratiev2013-08-23
| | | | | | | | | | Add flags intended to report various auxiliary information and introduce the NL80211_RXMGMT_FLAG_ANSWERED flag to report that the frame was already answered by the device. Signed-off-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com> [REPLIED->ANSWERED, reword commit message] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath6kl: add an extra band check to ath6kl_wmi_beginscan_cmd()Kalle Valo2013-03-18
| | | | | | | | | | Dan reported that smatch found a possible issue in ath6kl_wmi_beginscan_cmd() where we might access sc->supp_rates beyond the end. It shouldn't happen as ar->wiphy->bands always have just the first two bands set, but add an extra check just to be sure. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: add tracing support and tracing points for wmi packetsKalle Valo2013-03-18
| | | | | | | Add basic tracing infrastructure support to ath6kl and which can be enabled with CONFIG_ATH6KL_TRACING. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* Merge branch 'for-linville' of git://github.com/kvalo/ath6klJohn W. Linville2013-02-15
|\
| * ath6kl: Parse beacon interval from userspaceMohammed Shafi Shajakhan2012-11-27
| | | | | | | | | | | | | | | | | | | | | | Parse beacon interval from userspace to firmware. Incase the firmware does not supports it, just print a warning message and continue with AP settings. Cc: Sumathi Mandipati <sumathi@qca.qualcomm.com> Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * ath6kl: remove unnecessary check for NULL skbMohammed Shafi Shajakhan2012-11-27
| | | | | | | | | | | | | | | | dev_kfree_skb kernel API itself takes for checking for NULL skb, so an explicit check is not required. Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | cfg80211: pass wiphy to cfg80211_ref_bss/put_bssJohannes Berg2013-02-11
| | | | | | | | | | | | | | | | | | This prepares for using the spinlock instead of krefs which is needed in the next patch to track the refs of combined BSSes correctly. Acked-by: Bing Zhao <bzhao@marvell.com> [mwifiex] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | Merge branch 'for-john' of ↵John W. Linville2012-11-26
|\ \ | |/ |/| | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
| * cfg80211: remove remain-on-channel channel typeJohannes Berg2012-11-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As mwifiex (and mac80211 in the software case) are the only drivers actually implementing remain-on-channel with channel type, userspace can't be relying on it. This is the case, as it's used only for P2P operations right now. Rather than adding a flag to tell userspace whether or not it can actually rely on it, simplify all the code by removing the ability to use different channel types. Leave only the validation of the attribute, so that if we extend it again later (with the needed capability flag), it can't break userspace sending invalid data. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | ath6kl: Rename ATH6KL_HW_FLAG_64BIT_RATESMohammed Shafi Shajakhan2012-10-24
| | | | | | | | | | | | | | | | | | | | Rename ATH6KL_HW_FLAG_64BIT_RATES to ATH6KL_HW_64BIT_RATES. This seemed to be necessary to add/use new hardware flags without exceeding 80 lines. We shall be adding new hw flags dropping the FLAG term. Signed-off-by: Mohammed Shafi Shajakhan <mohammed@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: Check for valid rate table indexRaja Mani2012-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | There are 28 items defined in rate table array 'wmi_rate_tbl'. The rate table index (reply->rate_index) in ath6kl_wmi_bitrate_reply_rx() func is not checked for the valid max limit index before accessing rate table array. There may be some incidents to get memory crashes without safe max check. Fix this. Found this on code review. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: Avoid null ptr dereference while printing reg domain pairRaja Mani2012-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | Return value of ath6kl_get_regpair() is stored in 'regpair' in ath6kl_wmi_regdomain_event() func and it's directly accessed in the debug prints without checking for NULL value. There are situation to get NULL pointer as a return value from ath6kl_get_regpair() func. Fix this. Found this on code review. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: Add support to detect fw error through heart beatVasanthakumar Thiagarajan2012-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support to detect fw error condition by sending periodic message (heart beat challenge) to firmware. Upon reception of the message, fw would send a response event to driver. When there are no reponses from fw for about 5 cmd driver would trigger the recovery logic assuming that fw has gone into an error state. Capable fw will advertise this capability through ATH6KL_FW_CAPABILITY_HEART_BEAT_POLL bit. This feature is disabled by default, can be enabled through a modparam (heart_beat_poll). This modparam also confiures the polling interval in msecs. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: fix link speed when using sgiDengke Qiu2012-10-24
| | | | | | | | | | | | | | | | | | | | | | | | The MSB of rate index from FW is used for sgi. But the ath6kl_wmi_get_rate doesn't handle it. The access to wmi_rate_tbl array may be out of range if sgi is 1. This may cause the return value of ath6kl_wmi_get_rate() function is incorrect link rate. We add sgi adjustment to avoid such case. kvalo: change patch title Signed-off-by: Dengke Qiu <dqiu@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: rework scheduled scanThomas Pedersen2012-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch reflects changes in the firmware scheduled scan implementation to behave better in cases with multiple concurrent vifs. Major changes: - scheduled scan filters and state are now programmed per-vif. - decouple scheduled scan from host sleep. To maintain graceful failure with old firmwares, a new firmware capability bit is introduced: ATH6KL_FW_CAPABILITY_SCHED_SCAN_V2. ath6kl simply won't advertise scheduled scan to cfg80211 if the SCHED_SCAN_V2 is not supported. Since firmwares from here on out won't support the previous implicit API for scheduled scan (set WoW filters and host sleep), bump the firmware API to protect old drivers. Unfortunately, due to firmware RAM constraints ath6kl still cannot expect a scan complete event at the end of a scheduled scan results cycle, so the sched_scan_timer is retained. Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: Fix potential skb double free in ath6kl_wmi_sync_point()Vasanthakumar Thiagarajan2012-10-24
| | | | | | | | | | | | | | | | | | | | | | skb given to ath6kl_control_tx() is owned by ath6kl_control_tx(). Calling function should not free the skb for error cases. This is found during code review. kvalo: fix a checkpatch warning in ath6kl_wmi_cmd_send() Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: fix incorrect use of IEEE80211_NUM_BANDSKalle Valo2012-10-24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ath6kl was incorrectly assuming that IEEE80211_NUM_BANDS will always be 2 and used that also in the firmware WMI interface definitions. But after the support for 60 GHz was added to cfg80211 IEEE80211_NUM_BANDS changed to 3 and this can cause all sort of problems, possibly even memory corruption. I only found this during code review and didn't notice any bugs, but I'm sure there are a few lurking somewhere. To fix this rename unused A_NUM_BANDS to ATH6KL_NUM_BANDS, which is always defined to be 2, and use that in WMI. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: add support for changing contry codeKalle Valo2012-10-24
| | | | | | | | | | | | | | | | | | To make it possible to change the country code from user space via nl80211 add handler for reg_notifier. The feature is only enabled when built time option CONFIG_ATH6KL_REGDOMAIN is enabled, which again depends on CFG80211_CERTIFICATION_ONUS for certication purposes. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: refactor wmi scan commandKalle Valo2012-10-24
| | | | | | | | | | | | | | | | ATH6KL_FW_CAPABILITY_STA_P2PDEV_DUPLEX was checked in cfg80211.c which is a bit awkward when adding more callsites to the scan functions. Refactor the code to wmi.c so that it's transparent to the callers. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: move ath6kl_wmi_startscan_cmd()Kalle Valo2012-10-24
| | | | | | | | | | | | | | | | To make it easier to refactor the scan commands move ath6kl_wmi_startscan_cmd() before the beginscan function. No functional changes. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: support TX error rate notificationThomas Pedersen2012-10-24
| | | | | | | | | | | | | | | | | | The ath6kl firmware can monitor a connection and report when a certain TX failure threshold is crossed. Support this configuration and event reporting on compatible firmwares. Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | ath6kl: support rssi threshold for sched scanThomas Pedersen2012-10-24
|/ | | | | | | | The ath6kl firmware can filter scan results based on rssi. This is useful to limit hosts wakeups on scheduled scans. Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* cfg80211: use wdev in mgmt-tx/ROC APIsJohannes Berg2012-07-09
| | | | | | | | | | | The management frame and remain-on-channel APIs will be needed in the P2P device abstraction, so move them over to the new wdev-based APIs. Userspace can still use both the interface index and wdev identifier for them so it's backward compatible, but for the P2P Device wdev it will be able to use the wdev identifier only. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* ath6kl: support changing dtim period on AP modeEtay Luz2012-06-11
| | | | | | | | | | This patch adds support for dtim_period configuration in beacon. kvalo: add a comment about ignoring the error, use vif_idx, add \n to the warning message Signed-off-by: Etay Luz <eluz@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: Remove unneeded memset in roam related config funcRaja Mani2012-05-29
| | | | | | | | | | | No need to clear requested memory after allocating new SKB with help of ath6kl_wmi_get_new_buf(). This clear part is already taken care in ath6kl_wmi_get_new_buf(). Found this on code review. Signed-off-by: Raja Mani <rmani@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: Add support for setting tx rateset.Bala Shanmugam2012-05-24
| | | | | | | | | | | | Tx legacy and mcs rateset can configured using iw for 2.4 and 5 bands. Add support for the same in driver. kvalo: add an enum for the hw flags and rename the flag accordingly, rename ath6kl_cfg80211_set_bitrate_mask() to a shorter version to make it easier to indent Signed-off-by: Bala Shanmugam <bkamatch@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: enable enhanced bmiss detectionThomas Pedersen2012-05-16
| | | | | | | | | | | | | Enable enhanced bmiss detection if the firmware supports it. This feature is only enabled on some firmwares since it comes with a power cost. Also add a few missing command ids to keep the enums straight. kvalo: fix a compiler with ath6kl_err(), add few empty lines Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: Use correct max-scan-SSIDs limitJouni Malinen2012-05-11
| | | | | | | | | | | | The currently used firmware images support 16 SSIDs in the scan request (indexes 0..15), so update the host driver to use the same limit to allow some more SSIDs to be scanned per request. In addition, change the max-index to max-SSIDs to make it easier to understand the implementation and fix couple of off-by-one checks that could limit the maximum number of entries too strictly. Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl_sdio: Fix the EAPOL out of order issueVivek Natarajan2012-05-04
| | | | | | | | | | | | | Send the EAPOL and management frames in the same AC_VO queue. The issue happens when the AP supports QOS, the management frames are sent to AC_VO queue and EAP frame goes to AC_BE queue. Even though the EAP frame is queued before the DEAUTH management frame, as they are queued on different h/w queues, order of delivery between these frames cannot be controlled. This fixes the connection failure seen in P2P case. Signed-off-by: Vivek Natarajan <nataraja@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: check for sband existence when creating scan cmdThomas Pedersen2012-04-25
| | | | | | | | | | | | The patch "ath6kl: support fw reporting phy capabilities" gave the firmware the ability to disable certain wiphy supported bands. Check if this is the case in ath6kl_wmi_beginscan_cmd to avoid dereferencing a NULL pointer. kvalo: change the patch so that there's no code between declarations Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: include in.h explicitlyLuis R. Rodriguez2012-04-25
| | | | | | | Do not assume anyone before us includes it for us. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: support fw reporting phy capabilitiesThomas Pedersen2012-04-23
| | | | | | | | | | Currently the supported bands are just hard coded in the driver. However, the ath6kl FW will include its 11n and band capabilites in a WMI_READY event. Handle this and report capabilites to cfg80211 accordingly. Signed-off-by: Thomas Pedersen <c_tpeder@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: merge split format strings into oneKalle Valo2012-04-16
| | | | | | | | Found by checkpatch: WARNING: quoted string split across lines Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: Fix 4-way handshake failure in AP and P2P GO modeVasanthakumar Thiagarajan2012-04-09
| | | | | | | | | | | | | | RSN capability field of RSN IE which is generated (which is what really advertised in beacon/probe response) differs from the one generated in wpa_supplicant. This inconsistency in rsn IE results in 4-way handshake failure. To fix this, configure rsn capability used in wpa_supplicant in firmware using a new wmi command, WMI_SET_IE_CMDID. There is a bit (ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE) in fw_capabilities to advertise this support to driver. Signed-off-by: Subramania Sharma <sharmat@qca.qualcomm.com> Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: Configure htcap in fw based on the channel type in AP modeVasanthakumar Thiagarajan2012-04-09
| | | | | | | | | | This patch disables HT in start_ap if the type of the channel on which the AP mode is going to be operating is non-HT. HT is enabled with default ht cap setting if the operating channel is going to be 11n. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* ath6kl: Configure inactivity timeout in fwVasanthakumar Thiagarajan2012-03-26
| | | | | | | | | | | | | Configure the inactivity timeout passed in start_ap() to firmware. This capability is advertised only when fw supports it, there is a new bit (ATH6KL_FW_CAPABILITY_INACTIVITY_TIMEOUT) in firmware capability ie for driver to learn fw's capability. After the fw finds out the station is inactive, it will probe the station with null func frames. By default, the timeout is 10 secs. Signed-off-by: Vasanthakumar Thiagarajan <vthiagar@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* Merge remote branch 'wireless-next/master' into ath6kl-nextKalle Valo2012-03-26
|\
| * Merge branch 'for-linville' of git://github.com/kvalo/ath6klJohn W. Linville2012-03-13
| |\
| * | cfg80211/mac80211: report signal strength for mgmt framesJohannes Berg2012-03-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the signal strength (in dBm only for now) to frames that are received via nl80211's various frame APIs. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | | ath6kl: add debug log for AP MLME operationsAarthi Thiruvengadam2012-03-20
| |/ |/| | | | | | | | | | | | | This is useful during debugging to check if disconnect commands were issued by the host. Signed-off-by: Aarthi Thiruvengadam <athiruve@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>