drivers/net/wireless/intel/iwlwifi/mld/ftm-initiator.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/ftm-initiator.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mld/ftm-initiator.c- Extension
.c- Size
- 13508 bytes
- Lines
- 462
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/math64.hnet/cfg80211.hmld.hiface.hphy.hiwl-io.hiwl-prph.hconstants.hfw/api/location.hftm-initiator.h
Detected Declarations
function Copyrightfunction iwl_mld_ftm_set_target_chandeffunction cpu_to_le32function iwl_mld_ftm_set_stafunction iwl_mld_ftm_set_targetfunction iwl_mld_ftm_startfunction iwl_mld_ftm_resetfunction iwl_mld_ftm_range_resp_validfunction iwl_mld_ftm_find_peerfunction iwl_mld_debug_range_respfunction iwl_mld_handle_ftm_resp_notiffunction iwl_mld_ftm_restart_cleanup
Annotated Snippet
if (req->peers[i].report_ap_tsf) {
struct iwl_mld_vif *mld_vif =
iwl_mld_vif_from_mac80211(vif);
cmd->tsf_mac_id = cpu_to_le32(mld_vif->fw_id);
return;
}
}
} else {
eth_broadcast_addr(cmd->range_req_bssid);
}
/* Don't report AP's TSF */
cmd->tsf_mac_id = cpu_to_le32(0xff);
}
static int
iwl_mld_ftm_set_target_chandef(struct iwl_mld *mld,
struct cfg80211_pmsr_request_peer *peer,
struct iwl_tof_range_req_ap_entry *target)
{
u32 freq = peer->chandef.chan->center_freq;
target->channel_num = ieee80211_frequency_to_channel(freq);
switch (peer->chandef.width) {
case NL80211_CHAN_WIDTH_20_NOHT:
target->format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_LEGACY,
IWL_LOCATION_FMT_BW_FORMAT);
target->format_bw |= u8_encode_bits(IWL_LOCATION_BW_20MHZ,
IWL_LOCATION_FMT_BW_BANDWIDTH);
break;
case NL80211_CHAN_WIDTH_20:
target->format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_HT,
IWL_LOCATION_FMT_BW_FORMAT);
target->format_bw |= u8_encode_bits(IWL_LOCATION_BW_20MHZ,
IWL_LOCATION_FMT_BW_BANDWIDTH);
break;
case NL80211_CHAN_WIDTH_40:
target->format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_HT,
IWL_LOCATION_FMT_BW_FORMAT);
target->format_bw |= u8_encode_bits(IWL_LOCATION_BW_40MHZ,
IWL_LOCATION_FMT_BW_BANDWIDTH);
break;
case NL80211_CHAN_WIDTH_80:
target->format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_VHT,
IWL_LOCATION_FMT_BW_FORMAT);
target->format_bw |= u8_encode_bits(IWL_LOCATION_BW_80MHZ,
IWL_LOCATION_FMT_BW_BANDWIDTH);
break;
case NL80211_CHAN_WIDTH_160:
target->format_bw = u8_encode_bits(IWL_LOCATION_FRAME_FORMAT_HE,
IWL_LOCATION_FMT_BW_FORMAT);
target->format_bw |= u8_encode_bits(IWL_LOCATION_BW_160MHZ,
IWL_LOCATION_FMT_BW_BANDWIDTH);
break;
default:
IWL_ERR(mld, "Unsupported BW in FTM request (%d)\n",
peer->chandef.width);
return -EINVAL;
}
/* non EDCA based measurement must use HE preamble */
if (peer->ftm.trigger_based || peer->ftm.non_trigger_based)
target->format_bw |= IWL_LOCATION_FRAME_FORMAT_HE;
target->ctrl_ch_position =
(peer->chandef.width > NL80211_CHAN_WIDTH_20) ?
iwl_mld_get_fw_ctrl_pos(&peer->chandef) : 0;
target->band = iwl_mld_nl80211_band_to_fw(peer->chandef.chan->band);
return 0;
}
#define FTM_SET_FLAG(flag) (target->initiator_ap_flags |= \
cpu_to_le32(IWL_INITIATOR_AP_FLAGS_##flag))
static void
iwl_mld_ftm_set_target_flags(struct iwl_mld *mld,
struct cfg80211_pmsr_request_peer *peer,
struct iwl_tof_range_req_ap_entry *target)
{
target->initiator_ap_flags = cpu_to_le32(0);
if (peer->ftm.asap)
FTM_SET_FLAG(ASAP);
if (peer->ftm.request_lci)
FTM_SET_FLAG(LCI_REQUEST);
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/math64.h`, `net/cfg80211.h`, `mld.h`, `iface.h`, `phy.h`, `iwl-io.h`, `iwl-prph.h`.
- Detected declarations: `function Copyright`, `function iwl_mld_ftm_set_target_chandef`, `function cpu_to_le32`, `function iwl_mld_ftm_set_sta`, `function iwl_mld_ftm_set_target`, `function iwl_mld_ftm_start`, `function iwl_mld_ftm_reset`, `function iwl_mld_ftm_range_resp_valid`, `function iwl_mld_ftm_find_peer`, `function iwl_mld_debug_range_resp`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.