drivers/net/wireguard/device.h
Source file repositories/reference/linux-study-clean/drivers/net/wireguard/device.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/wireguard/device.h- Extension
.h- Size
- 1549 bytes
- Lines
- 63
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
noise.hallowedips.hpeerlookup.hcookie.hlinux/types.hlinux/netdevice.hlinux/workqueue.hlinux/mutex.hlinux/net.hlinux/ptr_ring.h
Detected Declarations
struct wg_devicestruct multicore_workerstruct crypt_queuestruct prev_queuestruct wg_device
Annotated Snippet
struct multicore_worker {
void *ptr;
struct work_struct work;
};
struct crypt_queue {
struct ptr_ring ring;
struct multicore_worker __percpu *worker;
int last_cpu;
};
struct prev_queue {
struct sk_buff *head, *tail, *peeked;
struct { struct sk_buff *next, *prev; } empty; // Match first 2 members of struct sk_buff.
atomic_t count;
};
struct wg_device {
struct net_device *dev;
struct crypt_queue encrypt_queue, decrypt_queue, handshake_queue;
struct sock __rcu *sock4, *sock6;
struct net __rcu *creating_net;
struct noise_static_identity static_identity;
struct workqueue_struct *packet_crypt_wq,*handshake_receive_wq, *handshake_send_wq;
struct cookie_checker cookie_checker;
struct pubkey_hashtable *peer_hashtable;
struct index_hashtable *index_hashtable;
struct allowedips peer_allowedips;
struct mutex device_update_lock, socket_update_lock;
struct list_head device_list, peer_list;
atomic_t handshake_queue_len;
unsigned int num_peers, device_update_gen;
u32 fwmark;
u16 incoming_port;
};
int wg_device_init(void);
void wg_device_uninit(void);
#endif /* _WG_DEVICE_H */
Annotation
- Immediate include surface: `noise.h`, `allowedips.h`, `peerlookup.h`, `cookie.h`, `linux/types.h`, `linux/netdevice.h`, `linux/workqueue.h`, `linux/mutex.h`.
- Detected declarations: `struct wg_device`, `struct multicore_worker`, `struct crypt_queue`, `struct prev_queue`, `struct wg_device`.
- 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.