summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
AgeCommit message (Collapse)Author
2024-04-25Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netJakub Kicinski
Cross-merge networking fixes after downstream PR. Conflicts: drivers/net/ethernet/ti/icssg/icssg_prueth.c net/mac80211/chan.c 89884459a0b9 ("wifi: mac80211: fix idle calculation with multi-link") 87f5500285fb ("wifi: mac80211: simplify ieee80211_assign_link_chanctx()") https://lore.kernel.org/all/20240422105623.7b1fbda2@canb.auug.org.au/ net/unix/garbage.c 1971d13ffa84 ("af_unix: Suppress false-positive lockdep splat for spin_lock() in __unix_gc().") 4090fa373f0e ("af_unix: Replace garbage collection algorithm.") drivers/net/ethernet/ti/icssg/icssg_prueth.c drivers/net/ethernet/ti/icssg/icssg_common.c 4dcd0e83ea1d ("net: ti: icssg-prueth: Fix signedness bug in prueth_init_rx_chns()") e2dc7bfd677f ("net: ti: icssg-prueth: Move common functions into a separate file") No adjacent changes. Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-04-17wifi: iwlwifi: mvm: remove old PASN station when adding a new oneAvraham Stern
If a PASN station is added, and an old PASN station already exists for the same mac address, remove the old station before adding the new one. Keeping the old station caueses old security context to be used in measurements. Fixes: 0739a7d70e00 ("iwlwifi: mvm: initiator: add option for adding a PASN responder") Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240415114847.ef3544a416f2.I4e8c7c8ca22737f4f908ae5cd4fc0b920c703dd3@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-03-25wifi: iwlwifi: mvm: add debugfs for forcing unprotected ranging requestAvraham Stern
Add an option to force sending unprotected ranging request even if the station is associated to the responder or a PASN keys are configured. This is used for testing. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240319100755.8523150148ec.I7ab6c547513717e69ec385f72a8f43ea00bd9e0a@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2024-02-02wifi: iwlwifi: mvm: Fix FTM initiator flagsIlan Peer
When secure LTF is used MFP must also be set. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Reviewed-by: Avraham Stern <avraham.stern@intel.com> Reviewed-by: Gregory Greenman <gregory.greenman@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://msgid.link/20240129211905.6cad71069e87.I7f9fd5239cfd2244f155f88419980e6e91d00ff2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-06-14wifi: iwlwifi: mvm: FTM initiator MLO supportAvraham Stern
When checking if the initiator is associated to the responder, iterate over all active links. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230612184434.1737f26e9cf7.I8f140ca55094da1d73c387fc036394fb2c148c85@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-05-16wifi: iwlwifi: mvm: fix access to fw_id_to_mac_idGregory Greenman
RCU protected fw_id_to_mac_id can be initialized with either an error code or NULL. Thus, after dereferencing need to check the value with IS_ERR_OR_NULL() and not only that it is not NULL. Fix it. Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230514120631.ec5f2880e81c.Ifa8c0f451df2835bde800f5c3670cc46238a3bd8@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-04-14wifi: iwlwifi: mvm: make HLTK configuration for PASN station optionalAvraham Stern
When secure LTF is not used, the HLTK is not derived during the PASN authentication. Make the HLTK optional when adding a PASN station. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230413213309.a57f7f3b59bd.Ifa88afb51a2516156153ac321d81556e295036c2@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-03-30wifi: iwlwifi: mvm: vif preparation for MLOGregory Greenman
In MLO, some fields of iwl_mvm_vif should be defined in the context of a link. Define a separate structure for these fields and add a deflink object to hold it as part of iwl_mvm_vif. Non-MLO legacy code will use only deflink object while MLO related code will use the corresponding link from the link array. It follows the strategy applied in mac80211 for introducing MLO changes. The below spatch takes care of updating all driver code to access fields separated into MLD specific data structure via deflink (need to convert all references to the fields listed in var to deflink.var and also to take care of calls like iwl_mvm_vif_from_mac80211(vif)->field). @iwl_mld_vif@ struct iwl_mvm_vif *v; struct ieee80211_vif *vv; identifier fn; identifier var = {bssid, ap_sta_id, bcast_sta, mcast_sta, beacon_stats, smps_requests, probe_resp_data, he_ru_2mhz_block, cab_queue, phy_ctxt, queue_params}; @@ ( v-> - var + deflink.var | fn(vv)-> - var + deflink.var ) Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20230328104948.4896576f0a9f.Ifaf0187c96b9fe52b24bd629331165831a877691@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2023-01-30wifi: iwlwifi: mvm: remove h from printk format specifierTom Rix
This change fixes the checkpatch warning described in this commit commit cbacb5ab0aa0 ("docs: printk-formats: Stop encouraging use of unnecessary %h[xudi] and %hh[xudi]") Standard integer promotion is already done and %hx and %hhx is useless so do not encourage the use of %hh[xudi] or %h[xudi]. Signed-off-by: Tom Rix <trix@redhat.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Link: https://lore.kernel.org/r/20230127002430.a25158d58fd7.Ibfe217f12a63c1d5349218e74c4b802c70c13c7c@changeid Signed-off-by: Gregory Greenman <gregory.greenman@intel.com>
2022-12-07wifi: iwlwifi: mvm: replace usage of found with dedicated list iterator variableJakob Koschel
To move the list iterator variable into the list_for_each_entry_*() macro in the future it should be avoided to use the list iterator variable after the loop body. To *never* use the list iterator variable after the loop it was concluded to use a separate iterator variable instead of a found boolean [1]. This removes the need to use a found variable and simply checking if the variable was set, can determine if the break/goto was hit. While at it, stop using the unnecessary _safe() variant. [1] https://lore.kernel.org/all/CAHk-=wgRr_D8CB-D9Kg-c=EHreAsk5SqXPwr9Y7k9sA6cWXJ6w@mail.gmail.com/ Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com> [change to not use _safe variant] Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Gregory Greenman <gregory.greenman@intel.com> Link: https://lore.kernel.org/r/20221205102808.e4882dc35543.I32b2b945ba234de72ee119fc20f5b8be02b6a3f2@changeid
2022-07-27wifi: iwlwifi: mvm: fix clang -Wformat warningsJustin Stitt
When building with Clang we encounter these warnings: | drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1108:47: error: | format specifies type 'unsigned char' but the argument has type 's16' | (aka 'short') [-Werror,-Wformat] IWL_DEBUG_INFO(mvm, "\tburst index: | %hhu\n", res->ftm.burst_index); - | drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1111:47: error: | format specifies type 'unsigned char' but the argument has type 's32' | (aka 'int') [-Werror,-Wformat] IWL_DEBUG_INFO(mvm, "\trssi spread: | %hhu\n", res->ftm.rssi_spread); The previous format specifier `%hhu` describes a u8 but our arguments are wider than this which means bits are potentially being lost. Variadic functions (printf-like) undergo default argument promotion. Documentation/core-api/printk-formats.rst specifically recommends using the promoted-to-type's format flag. As per C11 6.3.1.1: (https://www.open-std.org/jtc1/sc22/wg14/www/docs/n1548.pdf) `If an int can represent all values of the original type ..., the value is converted to an int; otherwise, it is converted to an unsigned int. These are called the integer promotions.` Thus it makes sense to change `%hhu` to `%d` for both instances of the warning. Link: https://github.com/ClangBuiltLinux/linux/issues/378 Signed-off-by: Justin Stitt <justinstitt@google.com> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220711222919.2043613-1-justinstitt@google.com
2022-06-20wifi: mac80211: move interface config to new structJohannes Berg
We'll use bss_conf for per-link configuration later, so move out all the non-link-specific data out into a new struct ieee80211_vif_cfg used in the vif. Some adjustments were done with the following spatch: @@ expression sdata; struct ieee80211_vif *vifp; identifier var = { assoc, ibss_joined, aid, arp_addr_list, arp_addr_cnt, ssid, ssid_len, s1g, ibss_creator }; @@ ( -sdata->vif.bss_conf.var +sdata->vif.cfg.var | -vifp->bss_conf.var +vifp->cfg.var ) @bss_conf@ struct ieee80211_bss_conf *bss_conf; identifier var = { assoc, ibss_joined, aid, arp_addr_list, arp_addr_cnt, ssid, ssid_len, s1g, ibss_creator }; @@ -bss_conf->var +vif_cfg->var (though more manual fixups were needed, e.g. replacing "vif_cfg->" by "vif->cfg." in many files.) Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-02-18iwlwifi: make iwl_fw_lookup_cmd_ver() take a cmd_idJohannes Berg
Instead of taking the group/command separately, make the function take a combined command ID. In many cases, this allows us to pass an existing command ID (e.g. cmd.id), or introduce a new variable for it, so that we don't use the command ID twice. This way, we can also use LONG_GROUP implicitly, so we don't need to spell that out for many commands. Apart from mvm.h, fw/img.{c,h} changes and some copyright and indentation updates, this was done with spatch: @@ identifier cmd; expression fw, G, C, def; @@ struct iwl_host_cmd cmd = { .id = WIDE_ID(G, C), ... }; ... -iwl_fw_lookup_cmd_ver(fw, G, C, def) +iwl_fw_lookup_cmd_ver(fw, cmd.id, def) @@ identifier cmd; expression fw, C, def; @@ struct iwl_host_cmd cmd = { .id = C, ... }; ... -iwl_fw_lookup_cmd_ver(fw, \(IWL_ALWAYS_LONG_GROUP\|LONG_GROUP\), C, def) +iwl_fw_lookup_cmd_ver(fw, cmd.id, def) @@ identifier func; expression fw, G, C, mvm, flags, cmd, size, def; type rettype; @@ rettype func(...) { +u32 cmd_id = WIDE_ID(G, C); ... -iwl_fw_lookup_cmd_ver(fw, G, C, def) +iwl_fw_lookup_cmd_ver(fw, cmd_id, def) ... -iwl_mvm_send_cmd_pdu(mvm, WIDE_ID(G, C), flags, cmd, size) +iwl_mvm_send_cmd_pdu(mvm, cmd_id, flags, cmd, size) ... } @@ identifier func; expression fw, G, C, mvm, flags, cmd, size, def; type rettype; @@ rettype func(...) { +u32 cmd_id = C; ... -iwl_fw_lookup_cmd_ver(fw, \(IWL_ALWAYS_LONG_GROUP\|LONG_GROUP\), C, def) +iwl_fw_lookup_cmd_ver(fw, cmd_id, def) ... -iwl_mvm_send_cmd_pdu(mvm, C, flags, cmd, size) +iwl_mvm_send_cmd_pdu(mvm, cmd_id, flags, cmd, size) ... } @@ expression fw, C, def; @@ -iwl_fw_lookup_cmd_ver(fw, \(IWL_ALWAYS_LONG_GROUP\|LONG_GROUP\), C, def) +iwl_fw_lookup_cmd_ver(fw, C, def) @@ expression fw, C, G, def; @@ -iwl_fw_lookup_cmd_ver(fw, G, C, def) +iwl_fw_lookup_cmd_ver(fw, WIDE_ID(G, C), def) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220128153014.c4ac213cef5c.I6fd9a4fcbcf16ef3a3ae20a2b08ee54ebe06f96f@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-02-18iwlwifi: prefer WIDE_ID() over iwl_cmd_id()Johannes Berg
The order of arguments for iwl_cmd_id() is confusing, and the version is always 0 and thus a useless argument. Prefer the WIDE_ID() macro (which needs to be a macro due to use in switch cases etc.) over the iwl_cmd_id() function. Obviously done with spatch: @@ expression G, C; @@ -iwl_cmd_id(C, G, 0) +WIDE_ID(G, C) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220128153014.cc4f9d1a2e9b.Ieb023cd773ea22e819d1ef1c37ae857ecc1a839d@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2022-01-09iwlwifi: mvm: Use div_s64 instead of do_div in iwl_mvm_ftm_rtt_smoothing()Nathan Chancellor
When building ARCH=arm allmodconfig: drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c: In function ‘iwl_mvm_ftm_rtt_smoothing’: ./include/asm-generic/div64.h:222:35: error: comparison of distinct pointer types lacks a cast [-Werror] 222 | (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ | ^~ drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:1070:9: note: in expansion of macro ‘do_div’ 1070 | do_div(rtt_avg, 100); | ^~~~~~ do_div() has to be used with an unsigned 64-bit integer dividend but rtt_avg is a signed 64-bit integer. div_s64() expects a signed 64-bit integer dividend and signed 32-bit divisor, which fits this scenario, so use that function here to fix the warning. Fixes: 8b0f92549f2c ("iwlwifi: mvm: fix 32-bit build in FTM") Signed-off-by: Nathan Chancellor <nathan@kernel.org> Link: https://lore.kernel.org/r/20211227191757.2354329-1-nathan@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-12-21iwlwifi: mvm: set protected flag only for NDP rangingAvraham Stern
Don't use protected ranging negotiation for FTM ranging as responders that support only FTM ranging don't expect the FTM request to be protected. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Fixes: 517a5eb9fab2 ("iwlwifi: mvm: when associated with PMF, use protected NDP ranging negotiation") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211219132536.f50ed0e3c6b3.Ibff247ee9d4e6e0a1a2d08a3c8a4bbb37e6829dd@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-12-21iwlwifi: mvm: fix 32-bit build in FTMJohannes Berg
On a 32-bit build, the division here needs to be done using do_div(), otherwise the compiler will try to call a function that doesn't exist, thus failing to build. Fixes: b68bd2e3143a ("iwlwifi: mvm: Add FTM initiator RTT smoothing logic") Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211219111352.e56cbf614a4d.Ib98004ccd2c7a55fd883a8ea7eebd810f406dec6@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-10-22iwlwifi: mvm: Support new version of ranging response notificationMiri Korenblit
As part of the new rate_n_flags, FW added a new version for LOCATION_RANGE_RSP_NTFY, and it's internal structure - LOCATION_RANGE_RSP_AP_ETRY_NTFY. Add support for this. Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211017123741.c5c6c863631e.I4b493f4eeabbfa1dc965ae012b72fc57de7d5f4f@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-10-22iwlwifi: mvm: add support for 160Mhz in ranging measurementsAvraham Stern
Add support for 160Mhz bandwidth in ranging measurements for initiator and responder. Advertise 160Mhz in the supported bandwidths for ranging. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20211017113927.32a13ac0f4d4.I883492648518cc5067a2f91b7ecf8bfa55f6876a@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-08-26iwlwifi: mvm: add support for range request command version 13Avraham Stern
This version adds the following configuration options: 1. Set the BSS color for NDP ranging 2. Set the minimum and maximum time between measurements for non trigger based NDP ranging. 3. Terminate the session in case the responder requests LMR feedback. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210826224715.9dcd5210b7e5.I76f6977cde852de0f251344e279ad85076eef8d6@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-06-22iwlwifi: mvm: support LMR feedbackAvraham Stern
If the LMR feedback is set in the ranging request, set the corresponding flag in the fw command. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210617100544.0c00dd724f5c.I8283b95c26f4226deaea42e7be35aa9d41eb7580@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-06-22iwlwifi: mvm: pass the clock type to iwl_mvm_get_sync_time()Luca Coelho
Allow the caller to pass the clock type to iwl_mvm_get_sync_time() so callers with different needs can decide whether to use boottime or realtime. Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210612142637.093f6660e69b.Ifd2328ac2130269f729c9c1bceec44ba01d79e88@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-04-14iwlwifi: mvm: when associated with PMF, use protected NDP ranging negotiationAvraham Stern
When associated to the resonder with PMF, request to protect the NDP ranging negotiation with PMF. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210331121101.e7982c72e12b.Ib6db362d01a31132c638e194d49476cd8e3ff430@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2021-04-14iwlwifi: mvm: support range request command version 12Avraham Stern
Version 12 adds configuration of NDP ranging parameters: - max number of LTF repetitions - max number of spatial streams - max total LTFs Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20210330162204.2c30c376c5cf.I01460f7277594ee7c98a8e1fe5447c59e70bf073@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-12-10iwlwifi: mvm: add size checks for range response notificationAvraham Stern
The range response notification has several versions. Check the notification size according to the expected notification version. Notifications with incorrect size will be ignored. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20201209231352.ee57c3214d05.I810d7de33fb08001ef1a2e24714d5b68932e088e@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-12-10iwlwifi: use SPDX tagsJohannes Berg
Use SPDX tags instead of the long copyright notices. Also cleanup some duplicate copyright notices and combine the years where possible. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20201210000603.481bcb512a6f.I8146abe5a637079e7336209f23cb26af98b12b31@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-10-01iwlwifi: mvm: initiator: add option for adding a PASN responderAvraham Stern
Add an option for adding a PASN responder, specifying the HLTK and TK (if not associated). When a receiving a range request for a PASN responder, the driver will ask for a secured measurement with the specified HLTK and TK. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200930161256.28c5f5266000.I2d58b72ff92c47ac33a6aacc27fbf3790b6dfc51@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-10-01iwlwifi: mvm: Add FTM initiator RTT smoothing logicIlan Peer
The overcome instabilities in the RTT results add smoothing logic to the reported results. In short, the smoothing logic tracks the RTT average of each responder for a period of time, and in case a new RTT results is found to be a spur, the tracked RTT average is reported instead of the current RTT measurement. Smooth logic debug configuration using iwl-dbg-cfg.ini: - MVM_FTM_INITIATOR_ENABLE_SMOOTH: Set to 1 to enable smoothing logic (default=0). - MVM_FTM_INITIATOR_SMOOTH_ALPHA: A value between 0 - 100, defining the weight of the current RTT results vs. the RTT average tracked based on the previous results. A value of 100 means use only the current RTT results. - MVM_FTM_INITIATOR_SMOOTH_AGE_SEC: The maximal time in seconds in which the RTT average tracked based on previous results is considered valid. - MVM_FTM_INITIATOR_SMOOTH_UNDERSHOOT: if the current RTT is positive and below the RTT average by at least this value, report the average RTT instead of the current one. In units of picoseconds. - MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT: if the current RTT is positive and above the RTT average by at least this value, report the average RTT instead of the current one. In units of picoseconds. Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200930161256.48a9cec2081b.Iaec1e29f738232adfe9e2ea8e9eb9b6ff0323ae1@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-10-01iwlwifi: mvm: add support for range request command ver 11Avraham Stern
Version 11 of the range request command adds support for setting the PN for secure ranging. For now, this is not yet supported. The same functions that are used for version 9 and 10 are also used for version 11 as the common part is the same. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200928121852.6f9ed4140e8c.I046e0d9f6dfaafda9794e5eb2ee1f02fcad2851a@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-10-01iwlwifi: fw: add default value for iwl_fw_lookup_cmd_verMordechay Goodstein
For new APIs this avoids checking every return if it's IWL_FW_CMD_VER_UNKNOWN (99) or it's lower than the new API value Done with spatch: -iwl_fw_lookup_cmd_ver(E1, E2, E3) +iwl_fw_lookup_cmd_ver(E1, E2, E3, IWL_FW_CMD_VER_UNKNOWN) Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200928121852.70bec6eb8008.I6ea78553801d33f7ed10fcd2e4be4ba781fe469a@changeid Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-05-29iwlwifi: mvm: add support for range request version 10Avraham Stern
Range request version 10 keeps the same command size as version 9 but uses 2 reserved fields for the responder beacon interval and station id (if exists). For now, since the beacon interval of unassoc APs is unknown, use a value of 100 TUs which is a common value for many APs. While at it, remove the definition for CCMP_256 cipher, since this is not supported. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200529092401.b7ccdad0805f.I59ea7f773caed85a66c61401066ae169008442e6@changeid
2020-05-08iwlwifi: mvm: add support for range request command version 9Avraham Stern
This version adds support for per responder calibrations. Currently the driver will use a single value for all responders and bandwidths. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200424182644.5ce74a87009c.I9079332b21eef490bbdbf8d7d66e35d7d0c7882b@changeid
2020-04-24iwlwifi: move API version lookup to common codeMordechay Goodstein
The API version lookup is parsed from a TLV and should be in shared code make make it reusable across all opmodes. Also change the function names from mvm to fw, since this is not mvm-specific anymore. Additionally, since this function is not just a single line of code, it shouldn't be inline. Convert them to actual functions. Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20200421133326.cf94672dfcdb.I5ede9cc25ee8de7b8d2b5c574f917a18971da734@changeid
2020-03-27iwlwifi: mvm: add support for non EDCA based measurementsAvraham Stern
Add support for requesting trigger-based / non trigger-based measurements. Change-Id: Ib4d0c471da9c50d9981541a7f5926db384a0f7ce Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2020-02-03iwlwifi: mvm: avoid use after free for pmsr requestAvraham Stern
When a FTM request is aborted, the driver sends the abort command to the fw and waits for a response. When the response arrives, the driver calls cfg80211_pmsr_complete() for that request. However, cfg80211 frees the requested data immediately after sending the abort command, so this may lead to use after free. Fix it by clearing the request data in the driver when the abort command arrives and ignoring the fw notification that will come afterwards. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Fixes: fc36ffda3267 ("iwlwifi: mvm: support FTM initiator") Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-12-23iwlwifi: mvm: add support for location range request version 8Avraham Stern
The new API requires the driver to set the frame format (legacy, HT, VHT etc.) to be used for the measurement. The new API also supports 11az and secured measurement, but these are not supported by the driver for now. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-06-22timekeeping: Use proper clock specifier names in functionsJason A. Donenfeld
This makes boot uniformly boottime and tai uniformly clocktai, to address the remaining oversights. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Link: https://lkml.kernel.org/r/20190621203249.3909-2-Jason@zx2c4.com
2019-04-29iwlwifi: mvm: report FTM start time TSF when applicableAvraham Stern
When the interface that is requesting an FTM measurement is connected to a BSS, it is possible that the FTM request was originated by an RRM request from the AP. In this case the station needs to report the measurement start time in terms of the TSF of the AP. Since there is no indication in the FTM request itself if the TSF is needed, always report the TSF if the station is associated. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-04-19iwlwifi: mvm: support rtt confidence indicationAvraham Stern
The range response notification API has changed to add a value that indicates the confidence of the rtt result. Support the new API and print the rtt confidence for debug. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-03-07iwlwifi: fix 64-bit divisionArnd Bergmann
do_div() expects unsigned operands and otherwise triggers a warning like: drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c:465:2: error: comparison of distinct pointer types ('typeof ((rtt_avg)) *' (aka 'long long *') and 'uint64_t *' (aka 'unsigned long long *')) [-Werror,-Wcompare-distinct-pointer-types] do_div(rtt_avg, 6666); ^~~~~~~~~~~~~~~~~~~~~ include/asm-generic/div64.h:222:28: note: expanded from macro 'do_div' (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ ~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~~~ 1 error generated. Change the do_div() to the simpler div_s64() that can handle negative inputs correctly. Fixes: 937b10c0de68 ("iwlwifi: mvm: add debug prints for FTM") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-02-14iwlwifi: mvm: add debug prints for FTMAvraham Stern
Add debug prints for FTM results info. These prints are used by tests automation. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-14iwlwifi: mvm: add support for new FTM fw APIAvraham Stern
The FTM new API uses API TLV bit 15. The driver mistakenly uses this bit for beacon filter API, although no TLV was assigned for the beacon filter API. For now, make beacon filter use bit 16 instead (not set by the fw anyway). Once a TLV is assigned to the beacon filter API it should be updated. Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-02-14iwlwifi: mvm: support FTM initiatorJohannes Berg
Add support for FTM initiator, i.e. peer measurements with FTM if the firmware supports FTM. Additionally, add two defines we depend on in include/linux/ieee80211.h. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Avraham Stern <avraham.stern@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>