drivers/net/wireless/intel/iwlwifi/mei/net.c
Source file repositories/reference/linux-study-clean/drivers/net/wireless/intel/iwlwifi/mei/net.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireless/intel/iwlwifi/mei/net.c- Extension
.c- Size
- 10725 bytes
- Lines
- 413
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
uapi/linux/if_ether.huapi/linux/if_arp.huapi/linux/icmp.hlinux/etherdevice.hlinux/netdevice.hlinux/skbuff.hlinux/ieee80211.hnet/cfg80211.hnet/ip.hlinux/if_arp.hlinux/icmp.hlinux/udp.hlinux/ip.hlinux/mm.hinternal.hsap.hiwl-mei.h
Detected Declarations
function Copyrightfunction iwl_mei_rx_filter_arpfunction iwl_mei_rx_filter_tcp_udpfunction iwl_mei_rx_filter_ipv4function iwl_mei_rx_filter_ipv6function iwl_mei_rx_pass_to_csmefunction iwl_mei_rx_filterfunction iwl_mei_tx_copy_to_csmeexport iwl_mei_tx_copy_to_csme
Annotated Snippet
if (filt->flags & SAP_ETH_FILTER_STOP) {
*pass_to_csme = true;
return true;
}
return false;
}
/* MCAST frames that don't match layer 2 filters are not sent to ME */
*pass_to_csme = false;
return true;
}
/*
* Returns true iff the frame should be passed to CSME in which case
* rx_handler_res is set.
*/
static bool iwl_mei_rx_filter_arp(struct sk_buff *skb,
const struct iwl_sap_oob_filters *filters,
rx_handler_result_t *rx_handler_res)
{
const struct iwl_sap_ipv4_filter *filt = &filters->ipv4_filter;
const struct arphdr *arp;
const __be32 *target_ip;
u32 flags = le32_to_cpu(filt->flags);
if (!pskb_may_pull(skb, arp_hdr_len(skb->dev)))
return false;
arp = arp_hdr(skb);
/* Handle only IPv4 over ethernet ARP frames */
if (arp->ar_hrd != htons(ARPHRD_ETHER) ||
arp->ar_pro != htons(ETH_P_IP))
return false;
/*
* After the ARP header, we have:
* src MAC address - 6 bytes
* src IP address - 4 bytes
* target MAC addess - 6 bytes
*/
target_ip = (const void *)((const u8 *)(arp + 1) +
ETH_ALEN + sizeof(__be32) + ETH_ALEN);
/*
* ARP request is forwarded to ME only if IP address match in the
* ARP request's target ip field.
*/
if (arp->ar_op == htons(ARPOP_REQUEST) &&
(filt->flags & cpu_to_le32(SAP_IPV4_FILTER_ARP_REQ_PASS)) &&
(filt->ipv4_addr == 0 || filt->ipv4_addr == *target_ip)) {
if (flags & SAP_IPV4_FILTER_ARP_REQ_COPY)
*rx_handler_res = RX_HANDLER_PASS;
else
*rx_handler_res = RX_HANDLER_CONSUMED;
return true;
}
/* ARP reply is always forwarded to ME regardless of the IP */
if (flags & SAP_IPV4_FILTER_ARP_RESP_PASS &&
arp->ar_op == htons(ARPOP_REPLY)) {
if (flags & SAP_IPV4_FILTER_ARP_RESP_COPY)
*rx_handler_res = RX_HANDLER_PASS;
else
*rx_handler_res = RX_HANDLER_CONSUMED;
return true;
}
return false;
}
static bool
iwl_mei_rx_filter_tcp_udp(struct sk_buff *skb, bool ip_match,
const struct iwl_sap_oob_filters *filters,
rx_handler_result_t *rx_handler_res)
{
const struct iwl_sap_flex_filter *filt;
for (filt = &filters->flex_filters[0];
filt < &filters->flex_filters[0] + ARRAY_SIZE(filters->flex_filters);
filt++) {
if (!(filt->flags & SAP_FLEX_FILTER_ENABLED))
break;
/*
* We are required to have a match on the IP level and we didn't
Annotation
- Immediate include surface: `uapi/linux/if_ether.h`, `uapi/linux/if_arp.h`, `uapi/linux/icmp.h`, `linux/etherdevice.h`, `linux/netdevice.h`, `linux/skbuff.h`, `linux/ieee80211.h`, `net/cfg80211.h`.
- Detected declarations: `function Copyright`, `function iwl_mei_rx_filter_arp`, `function iwl_mei_rx_filter_tcp_udp`, `function iwl_mei_rx_filter_ipv4`, `function iwl_mei_rx_filter_ipv6`, `function iwl_mei_rx_pass_to_csme`, `function iwl_mei_rx_filter`, `function iwl_mei_tx_copy_to_csme`, `export iwl_mei_tx_copy_to_csme`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.