include/linux/etherdevice.h
Source file repositories/reference/linux-study-clean/include/linux/etherdevice.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/etherdevice.h- Extension
.h- Size
- 19874 bytes
- Lines
- 661
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/if_ether.hlinux/netdevice.hlinux/random.hlinux/crc32.hlinux/unaligned.hasm/bitsperlong.h
Detected Declarations
struct devicestruct fwnode_handlefunction is_link_local_ether_addrfunction is_zero_ether_addrfunction is_multicast_ether_addrfunction is_multicast_ether_addr_64bitsfunction is_local_ether_addrfunction is_broadcast_ether_addrfunction is_unicast_ether_addrfunction addressfunction eth_proto_is_802_3function addressfunction eth_broadcast_addrfunction eth_zero_addrfunction addressfunction eth_hw_addr_crcfunction ether_addr_copyfunction eth_hw_addr_setfunction attributesfunction ether_addr_equalfunction ether_addr_equal_64bitsfunction ether_addr_equal_unalignedfunction ether_addr_equal_maskedfunction ether_addr_is_ipv4_mcastfunction ether_addr_is_ipv6_mcastfunction ether_addr_is_ip_mcastfunction ether_addr_to_u64function u64_to_ether_addrfunction eth_addr_decfunction eth_addr_incfunction eth_addr_addfunction ether_addr_equal_64bitsfunction headerfunction eth_hw_addr_genfunction eth_skb_pkt_typefunction eth_skb_pad
Annotated Snippet
if (unlikely(is_multicast_ether_addr_64bits(eth->h_dest))) {
if (ether_addr_equal_64bits(eth->h_dest, dev->broadcast))
skb->pkt_type = PACKET_BROADCAST;
else
skb->pkt_type = PACKET_MULTICAST;
} else {
skb->pkt_type = PACKET_OTHERHOST;
}
}
}
static inline struct ethhdr *eth_skb_pull_mac(struct sk_buff *skb)
{
struct ethhdr *eth = (struct ethhdr *)skb->data;
skb_pull_inline(skb, ETH_HLEN);
return eth;
}
/**
* eth_skb_pad - Pad buffer to minimum number of octets for Ethernet frame
* @skb: Buffer to pad
*
* An Ethernet frame should have a minimum size of 60 bytes. This function
* takes short frames and pads them with zeros up to the 60 byte limit.
*/
static inline int eth_skb_pad(struct sk_buff *skb)
{
return skb_put_padto(skb, ETH_ZLEN);
}
#endif /* _LINUX_ETHERDEVICE_H */
Annotation
- Immediate include surface: `linux/if_ether.h`, `linux/netdevice.h`, `linux/random.h`, `linux/crc32.h`, `linux/unaligned.h`, `asm/bitsperlong.h`.
- Detected declarations: `struct device`, `struct fwnode_handle`, `function is_link_local_ether_addr`, `function is_zero_ether_addr`, `function is_multicast_ether_addr`, `function is_multicast_ether_addr_64bits`, `function is_local_ether_addr`, `function is_broadcast_ether_addr`, `function is_unicast_ether_addr`, `function address`.
- Atlas domain: Core OS / Core Kernel Interface.
- 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.