drivers/net/netdevsim/netdevsim.h
Source file repositories/reference/linux-study-clean/drivers/net/netdevsim/netdevsim.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/netdevsim/netdevsim.h- Extension
.h- Size
- 12063 bytes
- Lines
- 488
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hlinux/device.hlinux/ethtool.hlinux/ethtool_netlink.hlinux/kernel.hlinux/if_vlan.hlinux/list.hlinux/netdevice.hlinux/ptp_mock.hnet/devlink.hnet/udp_tunnel.hnet/xdp.hnet/macsec.h
Detected Declarations
struct nsim_sastruct nsim_ipsecstruct nsim_rxscstruct nsim_secystruct nsim_macsecstruct nsim_vlanstruct nsim_ethtool_pauseparamstruct nsim_ethtoolstruct nsim_rqstruct netdevsimstruct nsim_dev_healthstruct nsim_dev_hwstats_netdevstruct nsim_dev_hwstatsstruct nsim_dev_portstruct nsim_vf_configstruct nsim_devstruct nsim_bus_devenum nsim_resource_idenum nsim_port_resource_idenum nsim_dev_port_typefunction nsim_bpf_dev_initfunction nsim_bpf_dev_exitfunction nsim_bpf_uninitfunction nsim_bpf_disable_tcfunction nsim_bpf_setup_tc_block_cbfunction nsim_dev_psample_initfunction nsim_dev_psample_exitfunction nsim_esw_mode_is_legacyfunction nsim_esw_mode_is_switchdevfunction nsim_dev_port_is_pffunction nsim_dev_port_is_vffunction nsim_ipsec_initfunction nsim_macsec_initfunction nsim_psp_initfunction nsim_psp_uninitfunction nsim_psp_handle_ext
Annotated Snippet
struct nsim_sa {
struct xfrm_state *xs;
__be32 ipaddr[4];
u32 key[4];
u32 salt;
bool used;
bool crypt;
bool rx;
};
struct nsim_ipsec {
struct nsim_sa sa[NSIM_IPSEC_MAX_SA_COUNT];
struct dentry *pfile;
u32 count;
u32 tx;
};
#define NSIM_MACSEC_MAX_SECY_COUNT 3
#define NSIM_MACSEC_MAX_RXSC_COUNT 1
struct nsim_rxsc {
sci_t sci;
bool used;
};
struct nsim_secy {
sci_t sci;
struct nsim_rxsc nsim_rxsc[NSIM_MACSEC_MAX_RXSC_COUNT];
u8 nsim_rxsc_count;
bool used;
};
struct nsim_macsec {
struct nsim_secy nsim_secy[NSIM_MACSEC_MAX_SECY_COUNT];
u8 nsim_secy_count;
};
struct nsim_vlan {
DECLARE_BITMAP(ctag, VLAN_N_VID);
DECLARE_BITMAP(stag, VLAN_N_VID);
};
struct nsim_ethtool_pauseparam {
bool rx;
bool tx;
bool report_stats_rx;
bool report_stats_tx;
};
struct nsim_ethtool {
u32 get_err;
u32 set_err;
u32 channels;
struct nsim_ethtool_pauseparam pauseparam;
struct ethtool_coalesce coalesce;
struct ethtool_ringparam ring;
struct ethtool_fecparam fec;
};
struct nsim_rq {
struct napi_struct napi;
struct sk_buff_head skb_queue;
struct page_pool *page_pool;
struct hrtimer napi_timer;
};
struct netdevsim {
struct net_device *netdev;
struct nsim_dev *nsim_dev;
struct nsim_dev_port *nsim_dev_port;
struct mock_phc *phc;
struct nsim_rq **rq;
int rq_reset_mode;
struct {
atomic64_t rx_packets;
atomic64_t rx_bytes;
atomic64_t tx_packets;
atomic64_t tx_bytes;
struct psp_dev __rcu *dev;
struct dentry *rereg;
struct mutex rereg_lock;
u32 spi;
u32 assoc_cnt;
} psp;
struct nsim_bus_dev *nsim_bus_dev;
struct bpf_prog *bpf_offloaded;
u32 bpf_offloaded_id;
Annotation
- Immediate include surface: `linux/debugfs.h`, `linux/device.h`, `linux/ethtool.h`, `linux/ethtool_netlink.h`, `linux/kernel.h`, `linux/if_vlan.h`, `linux/list.h`, `linux/netdevice.h`.
- Detected declarations: `struct nsim_sa`, `struct nsim_ipsec`, `struct nsim_rxsc`, `struct nsim_secy`, `struct nsim_macsec`, `struct nsim_vlan`, `struct nsim_ethtool_pauseparam`, `struct nsim_ethtool`, `struct nsim_rq`, `struct netdevsim`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.