drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c- Extension
.c- Size
- 183109 bytes
- Lines
- 6446
- 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/kernel.hlinux/fips.hlinux/slab.hlinux/skbuff.hlinux/netdevice.hlinux/etherdevice.hlinux/ip.hlinux/if_arp.hlinux/time.hnet/mac80211.hnet/ieee80211_radiotap.hnet/tcp.hiwl-drv.hiwl-op-mode.hiwl-io.hmvm.hsta.htime-event.hiwl-nvm-utils.hiwl-phy-db.htestmode.hfw/error-dump.hiwl-prph.hiwl-nvm-parse.htime-sync.h
Detected Declarations
struct iwl_mvm_mc_iter_datastruct iwl_mvm_he_obss_narrow_bw_ru_datastruct iwl_mvm_chanctx_usage_datafunction iwl_mvm_reset_phy_ctxtsfunction iwl_mvm_update_changed_regdomfunction iwl_mvm_init_fw_regdfunction iwl_mvm_op_get_antennafunction iwl_mvm_op_set_antennafunction iwl_mvm_mac_setup_registerfunction device_can_wakeupfunction iwl_mvm_tx_skbfunction iwl_mvm_mac_txfunction iwl_mvm_mac_itxq_xmitfunction iwl_mvm_mac_wake_tx_queuefunction iwl_mvm_ampdu_check_triggerfunction iwl_mvm_mac_ampdu_actionfunction iwl_mvm_cleanup_iteratorfunction for_each_mvm_vif_valid_linkfunction iwl_mvm_restart_cleanupfunction __iwl_mvm_mac_startfunction iwl_mvm_mac_startfunction iwl_mvm_restart_completefunction iwl_mvm_mac_reconfig_completefunction __iwl_mvm_mac_stopfunction iwl_mvm_mac_stopfunction iwl_mvm_set_tx_powerfunction iwl_mvm_post_csa_txfunction iwl_mvm_post_channel_switchfunction iwl_mvm_abort_channel_switchfunction iwl_mvm_channel_switch_disconnect_wkfunction iwl_mvm_chandef_get_primary_80function iwl_mvm_alloc_bcast_mcast_stafunction iwl_mvm_mac_init_mvmviffunction iwl_mvm_mac_add_interfacefunction configuredfunction iwl_mvm_prepare_mac_removalfunction iwl_mvm_mac_remove_interfacefunction iwl_mvm_prepare_mac_removalfunction iwl_mvm_mc_iface_iteratorfunction iwl_mvm_recalc_multicastfunction iwl_mvm_prepare_multicastfunction netdev_hw_addr_list_for_eachfunction iwl_mvm_configure_filterfunction iwl_mvm_config_iface_filterfunction iwl_mvm_update_mu_groupsfunction iwl_mvm_mu_mimo_iface_iteratorfunction iwl_mvm_mu_mimo_grp_notiffunction iwl_mvm_he_get_ppe_val
Annotated Snippet
struct iwl_mvm_mc_iter_data {
struct iwl_mvm *mvm;
int port_id;
};
static void iwl_mvm_mc_iface_iterator(void *_data, u8 *mac,
struct ieee80211_vif *vif)
{
struct iwl_mvm_mc_iter_data *data = _data;
struct iwl_mvm *mvm = data->mvm;
struct iwl_mcast_filter_cmd *cmd = mvm->mcast_filter_cmd;
struct iwl_host_cmd hcmd = {
.id = MCAST_FILTER_CMD,
.flags = CMD_ASYNC,
.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(data->port_id >= MAX_PORT_ID_NUM))
return;
if (vif->type != NL80211_IFTYPE_STATION ||
!vif->cfg.assoc)
return;
cmd->port_id = data->port_id++;
memcpy(cmd->bssid, vif->bss_conf.bssid, ETH_ALEN);
len = roundup(sizeof(*cmd) + cmd->count * ETH_ALEN, 4);
hcmd.len[0] = len;
hcmd.data[0] = cmd;
ret = iwl_mvm_send_cmd(mvm, &hcmd);
if (ret)
IWL_ERR(mvm, "mcast filter cmd error. ret=%d\n", ret);
}
static void iwl_mvm_recalc_multicast(struct iwl_mvm *mvm)
{
struct iwl_mvm_mc_iter_data iter_data = {
.mvm = mvm,
};
int ret;
lockdep_assert_held(&mvm->mutex);
if (WARN_ON_ONCE(!mvm->mcast_filter_cmd))
return;
ieee80211_iterate_active_interfaces_atomic(
mvm->hw, IEEE80211_IFACE_ITER_NORMAL,
iwl_mvm_mc_iface_iterator, &iter_data);
/*
* Send a (synchronous) ech command so that we wait for the
* multiple asynchronous MCAST_FILTER_CMD commands sent by
* the interface iterator. Otherwise, we might get here over
* and over again (by userspace just sending a lot of these)
* and the CPU can send them faster than the firmware can
* process them.
* Note that the CPU is still faster - but with this we'll
* actually send fewer commands overall because the CPU will
* not schedule the work in mac80211 as frequently if it's
* still running when rescheduled (possibly multiple times).
*/
ret = iwl_mvm_send_cmd_pdu(mvm, ECHO_CMD, 0, 0, NULL);
if (ret)
IWL_ERR(mvm, "Failed to synchronize multicast groups update\n");
}
u64 iwl_mvm_prepare_multicast(struct ieee80211_hw *hw,
struct netdev_hw_addr_list *mc_list)
{
struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
struct iwl_mcast_filter_cmd *cmd;
struct netdev_hw_addr *addr;
int addr_count;
bool pass_all;
int len;
addr_count = netdev_hw_addr_list_count(mc_list);
pass_all = addr_count > MAX_MCAST_FILTERING_ADDRESSES ||
IWL_MVM_FW_MCAST_FILTER_PASS_ALL;
if (pass_all)
addr_count = 0;
len = roundup(sizeof(*cmd) + addr_count * ETH_ALEN, 4);
cmd = kzalloc(len, GFP_ATOMIC);
if (!cmd)
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/fips.h`, `linux/slab.h`, `linux/skbuff.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/ip.h`, `linux/if_arp.h`.
- Detected declarations: `struct iwl_mvm_mc_iter_data`, `struct iwl_mvm_he_obss_narrow_bw_ru_data`, `struct iwl_mvm_chanctx_usage_data`, `function iwl_mvm_reset_phy_ctxts`, `function iwl_mvm_update_changed_regdom`, `function iwl_mvm_init_fw_regd`, `function iwl_mvm_op_get_antenna`, `function iwl_mvm_op_set_antenna`, `function iwl_mvm_mac_setup_register`, `function device_can_wakeup`.
- 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.