summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wcn36xx/smd.c
Commit message (Collapse)AuthorAgeFilesLines
* soc: qcom: smd: Transition client drivers from smd to rpmsgBjorn Andersson2017-03-281-5/+5
| | | | | | | | | | | | | | | | By moving these client drivers to use RPMSG instead of the direct SMD API we can reuse them ontop of the newly added GLINK wire-protocol support found in the 820 and 835 Qualcomm platforms. As the new (RPMSG-based) and old SMD implementations are mutually exclusive we have to change all client drivers in one commit, to make sure we have a working system before and after this transition. Acked-by: Andy Gross <andy.gross@linaro.org> Acked-by: Kalle Valo <kvalo@codeaurora.org> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: David S. Miller <davem@davemloft.net>
* wcn36xx: Implement print_reg indicationBjorn Andersson2017-01-121-0/+30
| | | | | | | | | Some firmware versions sends a "print register indication", handle this by printing out the content. Cc: Nicolas Dechesne <ndec@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* wcn36xx: Implement firmware assisted scanBjorn Andersson2017-01-121-4/+4
| | | | | | | | | Using the software based channel scan mechanism from mac80211 keeps us offline for 10-15 second, we should instead issue a start_scan/end_scan on each channel reducing this time. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* wcn36xx: Transition driver to SMD clientBjorn Andersson2017-01-121-19/+12
| | | | | | | | | The wcn36xx wifi driver follows the life cycle of the WLAN_CTRL SMD channel, as such it should be a SMD client. This patch makes this transition, now that we have the necessary frameworks available. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* wcn36xx: Silence error about unsupported smd event 188Bjorn Andersson2016-07-081-0/+2
| | | | | | | | | Sometimes the firmware sends a HAL_DEL_BA_IND, the prima driver silently ignore this message so let's do the same to silence the error message. Cc: Nicolas Dechesne <nicolas.dechesne@linaro.org> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* wcn36xx: Fix up wcn36xx_smd_update_scan_params()Bjorn Andersson2016-07-081-6/+9
| | | | | | | | | Fix up the wcn36xx_smd_update_scan_params() to work with non-ancient versions of the firmware and support actually specifying the list of channels. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* wcn36xx: Change indication list lock to spinlockBjorn Andersson2016-07-081-6/+6
| | | | | | | | | In preparation for handling incoming messages from IRQ context, change the indication list lock to a spinlock Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* wcn36xx: Fold indication payload into message headerBjorn Andersson2016-07-081-9/+6
| | | | | | | | | Merge the two allocation instead of separately allocating room for the indication payload. Signed-off-by: Bjorn Andersson <bjorn.andersson@sonymobile.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* Merge ath-next from ath.gitKalle Valo2016-04-261-73/+151
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ath.git patches for 4.7. Major changes: ath10k * implement set_tsf() for 10.2.4 branch * remove rare MSI range support * remove deprecated firmware API 1 support ath9k * add module parameter to invert LED polarity wcn36xx * fixes to get the driver properly working on Dragonboard 410c
| * wcn36xx: Correct remove bss key response encodingBjorn Andersson2016-04-251-18/+1
| | | | | | | | | | | | | | | | | | | | | | The WCN36XX_HAL_RMV_BSSKEY_RSP carries a single u32 with "status", so we can use the standard status check function for decoding the result. This is the last user of the v2 status checker, so remove the struct and helper function. Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Use correct command struct for EXIT_BMPS_REQPontus Fuchs2016-04-251-1/+1
| | | | | | | | | | | | | | | | | | EXIT_BMPS_REQ was using the command struct for ENTER_BMPS_REQ. I spotted this when looking at command dumps. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Implement multicast filteringPontus Fuchs2016-04-251-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | Pass the multicast list to FW. This patch also adds a way to build the smd command in place. This is needed because the MC list command is too big for the stack. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> [bjorn: dropped FIF_PROMISC_IN_BSS usage] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Use allocated self sta index instead of hard codedPontus Fuchs2016-04-251-1/+1
| | | | | | | | | | | | Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Copy all members in config_sta v1 conversionPontus Fuchs2016-04-251-2/+17
| | | | | | | | | | | | | | | | | | | | When converting to version 1 of the config_sta struct not all members where copied. This fixes the problem of multicast frames not being delivered on an encrypted network. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Parse trigger_ba response properlyPontus Fuchs2016-04-251-2/+12
| | | | | | | | | | | | | | | | | | This message does not follow the canonical format and needs it's own parser. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Remove sta pointer in private vif structPontus Fuchs2016-04-251-13/+15
| | | | | | | | | | | | | | | | This does not work with multiple sta's in a vif. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Add helper macros to cast sta to privPontus Fuchs2016-04-251-6/+6
| | | | | | | | | | | | | | | | | | | | While poking at this I also change two related things. I rename one variable to make the names consistent. I also move one assignment of priv_sta to the declaration to save a few lines. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Use define for invalid index and fix typoPontus Fuchs2016-04-251-1/+1
| | | | | | | | | | | | Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Use consistent name for private vifPontus Fuchs2016-04-251-14/+14
| | | | | | | | | | | | | | | | | | Some code used priv_vif and some used vif_priv. Convert all to vif_priv for consistency. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Add helper macros to cast vif to private vif and vice versaPontus Fuchs2016-04-251-14/+10
| | | | | | | | | | | | | | | | Makes the code a little easier to read. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Pad TIM PVM if neededPontus Fuchs2016-04-251-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wcn36xx FW expects a fixed size TIM PVM in the beacon template. If supplied with a shorter than expected PVM it will overwrite the IE following the TIM. Squashed with fix from Jason Mobarak <jam@cozybit.com>: Patch "wcn36xx: Pad TIM PVM if needed" has caused a regression in mesh beaconing. The field tim_off is always 0 for mesh mode, and thus pvm_len (referring to the TIM length field) and pad are both incorrectly calculated. Thus, msg_body.beacon_length is incorrectly calculated for mesh mode. Fix this. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: Jason Mobarak <jam@cozybit.com> [bjorn: squashed in Jason's fixup] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
| * wcn36xx: Clean up wcn36xx_smd_send_beaconPontus Fuchs2016-04-251-7/+5
| | | | | | | | | | | | | | | | | | Needed for coming improvements. No functional changes. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> [bjorn: restored BEACON_TEMPLATE_SIZE define to 0x180] Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
* | cfg80211: remove enum ieee80211_bandJohannes Berg2016-04-121-2/+2
|/ | | | | | | | | This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* wcn36xx: use new response format for wcn3620 remove_bsskeyAndy Green2015-11-301-1/+2
| | | | | | | | On wcn3620, firmware response to remove_bsskey uses the new, larger "v2" format Signed-off-by: Andy Green <andy.green@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wcn36xx: use new response format for wcn3620 trigger_baAndy Green2015-11-301-1/+2
| | | | | | | | On wcn3620, firmware response to trigger_ba uses the new, larger "v2" format Signed-off-by: Andy Green <andy.green@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wcn36xx: handle new hal response formatAndy Green2015-11-301-0/+16
| | | | | | | | | | | | | wcn3620 has a new message structure for the reply to some hal commands. This patch adds the struct and helper routine that uses it if the chip is wcn3620, or falls back to the old helper routine. We don't know what to do with the candidate list he sends back, but we can at least accept and ignore it nicely instead of dying. Signed-off-by: Andy Green <andy.green@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wcn36xx: swallow two wcn3620 IND messagesAndy Green2015-11-301-0/+5
| | | | | | | | WCN3620 can asynchronously send two new kinds of indication message, since we can't handle them just accept them quietly. Signed-off-by: Andy Green <andy.green@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mac80211: remove short slot/short preamble incapable flagsJohannes Berg2015-06-021-3/+1
| | | | | | | | | | | | There are no drivers setting IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE or IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE, so any code using the two flags is dead; it's also exceedingly unlikely that any new driver could ever need to set these flags. The wcn36xx code is almost certainly broken, but this preserves the previous behaviour. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* Merge branch 'for-linus' of ↵Linus Torvalds2015-04-141-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial Pull trivial tree from Jiri Kosina: "Usual trivial tree updates. Nothing outstanding -- mostly printk() and comment fixes and unused identifier removals" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: goldfish: goldfish_tty_probe() is not using 'i' any more powerpc: Fix comment in smu.h qla2xxx: Fix printks in ql_log message lib: correct link to the original source for div64_u64 si2168, tda10071, m88ds3103: Fix firmware wording usb: storage: Fix printk in isd200_log_config() qla2xxx: Fix printk in qla25xx_setup_mode init/main: fix reset_device comment ipwireless: missing assignment goldfish: remove unreachable line of code coredump: Fix do_coredump() comment stacktrace.h: remove duplicate declaration task_struct smpboot.h: Remove unused function prototype treewide: Fix typo in printk messages treewide: Fix typo in printk messages mod_devicetable: fix comment for match_flags
| * treewide: Fix typo in printk messagesMasanari Iida2015-03-061-1/+1
| | | | | | | | | | | | | | | | This patch fix spelling typo in printk messages. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
* | wcn36xx: initialize device defaults on startBob Copeland2015-01-231-2/+71
|/ | | | | | | | | | | | Set up default configuration for the device when we call start. The defaults come from dumps from the prima driver for the same hardware. This fixes transmit A-MPDU; previously only one MPDU would be sent per A-MPDU due to missing MAX_MPDUS_IN_AMPDU setting. Signed-off-by: Bob Copeland <me@bobcopeland.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* wcn36xx: Use kmemdup instead of kmalloc + memcpyBenoit Taine2014-05-291-2/+1
| | | | | | | | This issue was reported by coccicheck using the semantic patch at scripts/coccinelle/api/memdup.cocci Signed-off-by: Benoit Taine <benoit.taine@lip6.fr> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Track dpu signature per staPontus Fuchs2014-02-131-2/+3
| | | | | | | | This fixes problems seen with multiple softap clients and reconnecting softap clients. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Rename wcn36xx_vif.ucast_dpu_signature to self_ucast_dpu_signPontus Fuchs2014-02-131-1/+1
| | | | | | | This is more line with the names of the other members Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Print FW capabilitiesPontus Fuchs2014-02-131-6/+3
| | | | | | | After fw caps exchange, print the FW's capabilities. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Cache nv to avoid request_firmware on resume pathPontus Fuchs2014-02-131-12/+10
| | | | | | | | | If wowlan if off mac80211 will stop / start the driver on suspend / resume. This causes problems on resume since request_firmware is called from start. Fix this by caching the nv. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Wait longer for SMD commands to completePontus Fuchs2014-02-131-1/+6
| | | | | | | | | | | | On some wcnss firmwares the start command can take up to 300ms to complete. Currently there is a 200ms timeout for SMD command to complete which causes the start to fail. Increase the timeout to 500ms. Also improve debug information regarding SMD command completion time. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Improve feature caps exchangePontus Fuchs2014-02-131-6/+9
| | | | | | | | | | * Response format is not in the canonical format. wcn36xx_smd_rsp_status_check cannot be used. * Save the FW caps in wcn36xx struct for later use. Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Fix copy paste error hal_exit_bmps -> hal_keep_alivePontus Fuchs2014-02-131-2/+2
| | | | | Signed-off-by: Pontus Fuchs <pontus.fuchs@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* net: wirelesse: wcn36xx: pull allocation outside of critical sectionMichal Nazarewicz2013-12-181-13/+19
| | | | | | | | | | | | | Commit [3469adb3: fix potential NULL pointer dereference] introduced a check of msg_ind allocation, but omitted allocation of msg_ind->msg. Moreover, it introduced two if statements, which looked a bit clunky. This commit moves allocation code outside of the critical section so there's no need to dance around mutex_unlock, and adds the missing allocation check. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: enable the beaconing in mesh modeChun-Yeow Yeoh2013-12-091-4/+8
| | | | | | | | | | Enable the beaconing in wnc36xx by tweaking the tim offset and force the use of AP-style beaconing. Otherwise, beaconing is not working. The tim offset is set to 256. Otherwise, this will overwrite mesh beacon submitted by mac80211. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@cozybit.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* Merge branch 'master' of ↵John W. Linville2013-12-061-6/+13
|\ | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless Conflicts: drivers/net/wireless/brcm80211/Kconfig net/mac80211/util.c
| * net: wireless: wcn36xx: fix potential NULL pointer dereferenceMichal Nazarewicz2013-12-021-6/+13
| | | | | | | | | | | | | | | | | | | | If kmalloc fails wcn36xx_smd_rsp_process will attempt to dereference a NULL pointer. There might be a better error recovery then just printing an error, but printing an error message is better then the current behaviour. Signed-off-by: Michal Nazarewicz <mina86@mina86.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | wcn36xx: fix typo errorChun-Yeow Yeoh2013-12-051-2/+2
| | | | | | | | | | Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* | wcn36xx: set self STA default HT parametersChun-Yeow Yeoh2013-12-051-0/+17
|/ | | | | | | | | | These default HT parameters are required for self STA entry. In example, set the HT capable of self STA entry for bss configuration in mesh allows the MCS rate to be used. Otherwise, only legacy rate will be used. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: missing unlocks on error pathsDan Carpenter2013-11-111-2/+4
| | | | | | | There are several places which are missing unlocks. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: Add missing unlock before returnWei Yongjun2013-11-111-1/+2
| | | | | | | | Add the missing unlock before return from function wcn36xx_smd_update_proberesp_tmpl() in the error handling case. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: John W. Linville <linville@tuxdriver.com>
* wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardwareEugene Krasnikov2013-10-101-0/+2126
This is a mac80211 driver for Qualcomm WCN3660/WCN3680 devices. So far WCN3660/WCN3680 is available only on MSM platform. Firmware can be found here: https://www.codeaurora.org/cgit/external/hisense/platform/vendor/qcom-opensource/wlan/prima/tree/firmware_bin?h=8130_CS Wiki page is available here: http://wireless.kernel.org/en/users/Drivers/wcn36xx A lot people made a contribution to this driver. Here is the list in alphabetical order: Eugene Krasnikov <k.eugene.e@gmail.com> Kalle Valo <kvalo@qca.qualcomm.com> Olof Johansson <dev@skyshaper.net> Pontus Fuchs <pontus.fuchs@gmail.com> Yanbo Li <yanbol@qti.qualcomm.com> Signed-off-by: Eugene Krasnikov <k.eugene.e@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
OpenPOWER on IntegriCloud