drivers/net/macvtap.c
Source file repositories/reference/linux-study-clean/drivers/net/macvtap.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/macvtap.c- Extension
.c- Size
- 6464 bytes
- Lines
- 257
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/if_macvlan.hlinux/if_tap.hlinux/if_vlan.hlinux/interrupt.hlinux/nsproxy.hlinux/compat.hlinux/if_tun.hlinux/module.hlinux/skbuff.hlinux/cache.hlinux/sched/signal.hlinux/types.hlinux/slab.hlinux/wait.hlinux/cdev.hlinux/idr.hlinux/fs.hlinux/uio.hnet/net_namespace.hnet/rtnetlink.hnet/sock.hlinux/virtio_net.hlinux/skb_array.h
Detected Declarations
struct macvtap_devfunction macvtap_count_tx_droppedfunction macvtap_count_rx_droppedfunction macvtap_update_featuresfunction macvtap_newlinkfunction macvtap_dellinkfunction macvtap_setupfunction macvtap_device_eventfunction macvtap_initfunction macvtap_exitmodule init macvtap_init
Annotated Snippet
module_init(macvtap_init);
static void __exit macvtap_exit(void)
{
rtnl_link_unregister(&macvtap_link_ops);
unregister_netdevice_notifier(&macvtap_notifier_block);
class_unregister(&macvtap_class);
tap_destroy_cdev(macvtap_major, &macvtap_cdev);
}
module_exit(macvtap_exit);
MODULE_ALIAS_RTNL_LINK("macvtap");
MODULE_DESCRIPTION("MAC-VLAN based tap driver");
MODULE_AUTHOR("Arnd Bergmann <arnd@arndb.de>");
MODULE_LICENSE("GPL");
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/if_macvlan.h`, `linux/if_tap.h`, `linux/if_vlan.h`, `linux/interrupt.h`, `linux/nsproxy.h`, `linux/compat.h`, `linux/if_tun.h`.
- Detected declarations: `struct macvtap_dev`, `function macvtap_count_tx_dropped`, `function macvtap_count_rx_dropped`, `function macvtap_update_features`, `function macvtap_newlink`, `function macvtap_dellink`, `function macvtap_setup`, `function macvtap_device_event`, `function macvtap_init`, `function macvtap_exit`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.