drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/ftm-initiator.c- Extension
.c- Size
- 38876 bytes
- Lines
- 1464
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/math64.hnet/cfg80211.hmvm.hiwl-io.hiwl-prph.hconstants.h
Detected Declarations
struct iwl_mvm_loc_entrystruct iwl_mvm_smooth_entrystruct iwl_mvm_ftm_pasn_entrystruct iwl_mvm_ftm_iter_dataenum iwl_mvm_pasn_flagsfunction iwl_mvm_ftm_resetfunction list_for_each_entry_safefunction iwl_mvm_ftm_restartfunction iwl_mvm_ftm_initiator_smooth_configfunction iwl_mvm_ftm_initiator_smooth_stopfunction list_for_each_entry_safefunction iwl_ftm_range_request_status_to_errfunction iwl_mvm_ftm_cmd_v5function iwl_mvm_ftm_cmd_commonfunction iwl_mvm_ftm_cmd_v8function iwl_mvm_ftm_target_chandef_v1function iwl_mvm_ftm_target_chandef_v2function iwl_mvm_ftm_put_target_v2function cpu_to_le32function iwl_mvm_ftm_put_target_commonfunction iwl_mvm_ftm_put_target_v3function iwl_mvm_ftm_put_target_v4function iwl_mvm_ftm_set_stafunction for_each_vif_active_linkfunction iwl_mvm_ftm_put_targetfunction iwl_mvm_ftm_send_cmdfunction iwl_mvm_ftm_start_v5function iwl_mvm_ftm_start_v7function iwl_mvm_ftm_start_v8function iwl_mvm_ftm_start_v9function iterfunction iwl_mvm_ftm_set_secured_rangingfunction list_for_each_entryfunction iwl_mvm_ftm_put_target_v7function iwl_mvm_ftm_start_v11function iwl_mvm_ftm_set_ndp_paramsfunction iwl_mvm_ftm_put_target_v8function iwl_mvm_ftm_start_v12function iwl_mvm_ftm_start_v13function iwl_mvm_ftm_put_target_v10function iwl_mvm_ftm_start_v14function iwl_mvm_ftm_startfunction iwl_mvm_ftm_abortfunction iwl_mvm_ftm_find_peerfunction iwl_mvm_ftm_get_host_timefunction iwl_mvm_ftm_get_lci_civicfunction list_for_each_entryfunction iwl_mvm_ftm_range_resp_valid
Annotated Snippet
struct iwl_mvm_loc_entry {
struct list_head list;
u8 addr[ETH_ALEN];
u8 lci_len, civic_len;
u8 buf[];
};
struct iwl_mvm_smooth_entry {
struct list_head list;
u8 addr[ETH_ALEN];
s64 rtt_avg;
u64 host_time;
};
enum iwl_mvm_pasn_flags {
IWL_MVM_PASN_FLAG_HAS_HLTK = BIT(0),
};
struct iwl_mvm_ftm_pasn_entry {
struct list_head list;
u8 addr[ETH_ALEN];
u8 hltk[HLTK_11AZ_LEN];
u8 tk[TK_11AZ_LEN];
u8 cipher;
u8 tx_pn[IEEE80211_CCMP_PN_LEN];
u8 rx_pn[IEEE80211_CCMP_PN_LEN];
u32 flags;
};
struct iwl_mvm_ftm_iter_data {
u8 *cipher;
u8 *bssid;
u8 *tk;
};
static void iwl_mvm_ftm_reset(struct iwl_mvm *mvm)
{
struct iwl_mvm_loc_entry *e, *t;
mvm->ftm_initiator.req = NULL;
mvm->ftm_initiator.req_wdev = NULL;
memset(mvm->ftm_initiator.responses, 0,
sizeof(mvm->ftm_initiator.responses));
list_for_each_entry_safe(e, t, &mvm->ftm_initiator.loc_list, list) {
list_del(&e->list);
kfree(e);
}
}
void iwl_mvm_ftm_restart(struct iwl_mvm *mvm)
{
struct cfg80211_pmsr_result result = {
.status = NL80211_PMSR_STATUS_FAILURE,
.final = 1,
.host_time = ktime_get_boottime_ns(),
.type = NL80211_PMSR_TYPE_FTM,
};
int i;
lockdep_assert_held(&mvm->mutex);
if (!mvm->ftm_initiator.req)
return;
for (i = 0; i < mvm->ftm_initiator.req->n_peers; i++) {
memcpy(result.addr, mvm->ftm_initiator.req->peers[i].addr,
ETH_ALEN);
result.ftm.burst_index = mvm->ftm_initiator.responses[i];
cfg80211_pmsr_report(mvm->ftm_initiator.req_wdev,
mvm->ftm_initiator.req,
&result, GFP_KERNEL);
}
cfg80211_pmsr_complete(mvm->ftm_initiator.req_wdev,
mvm->ftm_initiator.req, GFP_KERNEL);
iwl_mvm_ftm_reset(mvm);
}
void iwl_mvm_ftm_initiator_smooth_config(struct iwl_mvm *mvm)
{
INIT_LIST_HEAD(&mvm->ftm_initiator.smooth.resp);
IWL_DEBUG_INFO(mvm,
"enable=%u, alpha=%u, age_jiffies=%u, thresh=(%u:%u)\n",
IWL_MVM_FTM_INITIATOR_ENABLE_SMOOTH,
IWL_MVM_FTM_INITIATOR_SMOOTH_ALPHA,
IWL_MVM_FTM_INITIATOR_SMOOTH_AGE_SEC * HZ,
IWL_MVM_FTM_INITIATOR_SMOOTH_OVERSHOOT,
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/math64.h`, `net/cfg80211.h`, `mvm.h`, `iwl-io.h`, `iwl-prph.h`, `constants.h`.
- Detected declarations: `struct iwl_mvm_loc_entry`, `struct iwl_mvm_smooth_entry`, `struct iwl_mvm_ftm_pasn_entry`, `struct iwl_mvm_ftm_iter_data`, `enum iwl_mvm_pasn_flags`, `function iwl_mvm_ftm_reset`, `function list_for_each_entry_safe`, `function iwl_mvm_ftm_restart`, `function iwl_mvm_ftm_initiator_smooth_config`, `function iwl_mvm_ftm_initiator_smooth_stop`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.