drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mld/mac80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mld/mac80211.c- Extension
.c- Size
- 84817 bytes
- Lines
- 2983
- 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
net/mac80211.hlinux/fips.hlinux/ip.hmld.hmac80211.hphy.hiface.hpower.hsta.hagg.hscan.hd3.htlc.hkey.hap.htx.hroc.hmlo.hstats.hiwl-nvm-parse.hftm-initiator.hlow_latency.hfw/api/scan.hfw/api/context.hfw/api/filter.hfw/api/sta.hfw/api/tdls.hfw/api/d3.hiwl-trans.h
Detected Declarations
struct iwl_mld_mc_iter_datafunction __bf_shffunction iwl_mld_hw_set_channelsfunction iwl_mld_hw_set_securityfunction iwl_mld_hw_set_antennasfunction iwl_mld_hw_set_pmfunction iwl_mac_hw_set_radiotapfunction iwl_mac_hw_set_flagsfunction iwl_mld_hw_set_nanfunction iwl_mac_hw_set_wiphyfunction iwl_mac_hw_set_miscfunction iwl_mld_hw_verify_preconditionsfunction iwl_mld_register_hwfunction iwl_mld_mac80211_txfunction iwl_mld_restart_cleanupfunction iwl_mld_mac80211_startfunction iwl_mld_mac80211_stopfunction iwl_mld_mac80211_configfunction iwl_mld_mac80211_add_interfacefunction iwl_mld_mac80211_remove_interfacefunction iwl_mld_mac80211_change_interfacefunction iwl_mld_mc_iface_iteratorfunction iwl_mld_recalc_multicast_filterfunction iwl_mld_mac80211_prepare_multicastfunction netdev_hw_addr_list_for_eachfunction iwl_mld_mac80211_configure_filterfunction iwl_mld_mac80211_wake_tx_queuefunction iwl_mld_teardown_tdls_peersfunction iwl_mld_add_chanctxfunction iwl_mld_remove_chanctxfunction iwl_mld_update_link_npca_puncturingfunction for_each_active_interfacefunction for_each_vif_active_linkfunction iwl_mld_change_chanctxfunction iwl_mld_chandef_get_primary_80function iwl_mld_can_activate_linkfunction iwl_mld_assign_vif_chanctxfunction assignedfunction iwl_mld_unassign_vif_chanctxfunction iwl_mld_mac80211_set_rts_thresholdfunction iwl_mld_link_changed_mappingfunction iwl_mld_mac80211_link_info_changed_stafunction iwl_mld_update_mu_groupsfunction iwl_mld_mac80211_link_info_changedfunction iwl_mld_mac80211_vif_cfg_changedfunction iwl_mld_mac80211_hw_scanfunction iwl_mld_mac80211_cancel_hw_scanfunction ieee80211_scan_completed
Annotated Snippet
struct iwl_mld_mc_iter_data {
struct iwl_mld *mld;
int port_id;
};
static void iwl_mld_mc_iface_iterator(void *data, u8 *mac,
struct ieee80211_vif *vif)
{
struct iwl_mld_mc_iter_data *mc_data = data;
struct iwl_mld *mld = mc_data->mld;
struct iwl_mcast_filter_cmd *cmd = mld->mcast_filter_cmd;
struct iwl_host_cmd hcmd = {
.id = MCAST_FILTER_CMD,
.dataflags[0] = IWL_HCMD_DFL_NOCOPY,
};
int ret, len;
/* If we don't have free ports, mcast frames will be dropped */
if (WARN_ON_ONCE(mc_data->port_id >= MAX_PORT_ID_NUM))
return;
if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc)
return;
cmd->port_id = mc_data->port_id++;
ether_addr_copy(cmd->bssid, vif->bss_conf.bssid);
len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4);
hcmd.len[0] = len;
hcmd.data[0] = cmd;
ret = iwl_mld_send_cmd(mld, &hcmd);
if (ret)
IWL_ERR(mld, "mcast filter cmd error. ret=%d\n", ret);
}
void iwl_mld_recalc_multicast_filter(struct iwl_mld *mld)
{
struct iwl_mld_mc_iter_data iter_data = {
.mld = mld,
};
if (WARN_ON_ONCE(!mld->mcast_filter_cmd))
return;
ieee80211_iterate_active_interfaces(mld->hw,
IEEE80211_IFACE_ITER_NORMAL,
iwl_mld_mc_iface_iterator,
&iter_data);
}
static u64
iwl_mld_mac80211_prepare_multicast(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list)
{
struct iwl_mld *mld = IWL_MAC80211_GET_MLD(hw);
struct iwl_mcast_filter_cmd *cmd;
struct netdev_hw_addr *addr;
int addr_count = netdev_hw_addr_list_count(mc_list);
bool pass_all = addr_count > MAX_MCAST_FILTERING_ADDRESSES;
int len;
if (pass_all)
addr_count = 0;
/* len must be a multiple of 4 */
len = roundup(sizeof(*cmd) + addr_count * ETH_ALEN, 4);
cmd = kzalloc(len, GFP_ATOMIC);
if (!cmd)
return 0;
if (pass_all) {
cmd->pass_all = 1;
goto out;
}
netdev_hw_addr_list_for_each(addr, mc_list) {
IWL_DEBUG_MAC80211(mld, "mcast addr (%d): %pM\n",
cmd->count, addr->addr);
ether_addr_copy(&cmd->addr_list[cmd->count * ETH_ALEN],
addr->addr);
cmd->count++;
}
out:
return (u64)(unsigned long)cmd;
}
static
void iwl_mld_mac80211_configure_filter(struct ieee80211_hw *hw,
Annotation
- Immediate include surface: `net/mac80211.h`, `linux/fips.h`, `linux/ip.h`, `mld.h`, `mac80211.h`, `phy.h`, `iface.h`, `power.h`.
- Detected declarations: `struct iwl_mld_mc_iter_data`, `function __bf_shf`, `function iwl_mld_hw_set_channels`, `function iwl_mld_hw_set_security`, `function iwl_mld_hw_set_antennas`, `function iwl_mld_hw_set_pm`, `function iwl_mac_hw_set_radiotap`, `function iwl_mac_hw_set_flags`, `function iwl_mld_hw_set_nan`, `function iwl_mac_hw_set_wiphy`.
- 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.