drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qualcomm/rmnet/rmnet_vnd.c- Extension
.c- Size
- 10276 bytes
- Lines
- 410
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/ethtool.hlinux/if_arp.hnet/pkt_sched.hrmnet_config.hrmnet_handlers.hrmnet_private.hrmnet_map.hrmnet_vnd.h
Detected Declarations
function rmnet_vnd_rx_fixupfunction rmnet_vnd_tx_fixup_lenfunction rmnet_vnd_tx_fixupfunction rmnet_vnd_start_xmitfunction rmnet_vnd_headroomfunction rmnet_vnd_change_mtufunction rmnet_vnd_get_iflinkfunction rmnet_vnd_initfunction rmnet_vnd_uninitfunction rmnet_get_stats64function for_each_possible_cpufunction rmnet_get_stringsfunction rmnet_get_sset_countfunction rmnet_get_ethtool_statsfunction rmnet_get_coalescefunction rmnet_set_coalescefunction rmnet_vnd_setupfunction rmnet_vnd_newlinkfunction rmnet_vnd_dellinkfunction rmnet_vnd_do_flow_controlfunction rmnet_vnd_validate_real_dev_mtufunction hash_for_each_safefunction rmnet_vnd_update_dev_mtufunction hash_for_each_safe
Annotated Snippet
static const struct net_device_ops rmnet_vnd_ops = {
.ndo_start_xmit = rmnet_vnd_start_xmit,
.ndo_change_mtu = rmnet_vnd_change_mtu,
.ndo_get_iflink = rmnet_vnd_get_iflink,
.ndo_add_slave = rmnet_add_bridge,
.ndo_del_slave = rmnet_del_bridge,
.ndo_init = rmnet_vnd_init,
.ndo_uninit = rmnet_vnd_uninit,
.ndo_get_stats64 = rmnet_get_stats64,
};
static const char rmnet_gstrings_stats[][ETH_GSTRING_LEN] = {
"Checksum ok",
"Bad IPv4 header checksum",
"Checksum valid bit not set",
"Checksum validation failed",
"Checksum error bad buffer",
"Checksum error bad ip version",
"Checksum error bad transport",
"Checksum skipped on ip fragment",
"Checksum skipped",
"Checksum computed in software",
"Checksum computed in hardware",
};
static void rmnet_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
{
switch (stringset) {
case ETH_SS_STATS:
memcpy(buf, &rmnet_gstrings_stats,
sizeof(rmnet_gstrings_stats));
break;
}
}
static int rmnet_get_sset_count(struct net_device *dev, int sset)
{
switch (sset) {
case ETH_SS_STATS:
return ARRAY_SIZE(rmnet_gstrings_stats);
default:
return -EOPNOTSUPP;
}
}
static void rmnet_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{
struct rmnet_priv *priv = netdev_priv(dev);
struct rmnet_priv_stats *st = &priv->stats;
if (!data)
return;
memcpy(data, st, ARRAY_SIZE(rmnet_gstrings_stats) * sizeof(u64));
}
static int rmnet_get_coalesce(struct net_device *dev,
struct ethtool_coalesce *coal,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{
struct rmnet_priv *priv = netdev_priv(dev);
struct rmnet_port *port;
port = rmnet_get_port_rtnl(priv->real_dev);
memset(kernel_coal, 0, sizeof(*kernel_coal));
kernel_coal->tx_aggr_max_bytes = port->egress_agg_params.bytes;
kernel_coal->tx_aggr_max_frames = port->egress_agg_params.count;
kernel_coal->tx_aggr_time_usecs = div_u64(port->egress_agg_params.time_nsec,
NSEC_PER_USEC);
return 0;
}
static int rmnet_set_coalesce(struct net_device *dev,
struct ethtool_coalesce *coal,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{
struct rmnet_priv *priv = netdev_priv(dev);
struct rmnet_port *port;
port = rmnet_get_port_rtnl(priv->real_dev);
if (kernel_coal->tx_aggr_max_frames < 1 || kernel_coal->tx_aggr_max_frames > 64)
return -EINVAL;
if (kernel_coal->tx_aggr_max_bytes > 32768)
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/ethtool.h`, `linux/if_arp.h`, `net/pkt_sched.h`, `rmnet_config.h`, `rmnet_handlers.h`, `rmnet_private.h`, `rmnet_map.h`.
- Detected declarations: `function rmnet_vnd_rx_fixup`, `function rmnet_vnd_tx_fixup_len`, `function rmnet_vnd_tx_fixup`, `function rmnet_vnd_start_xmit`, `function rmnet_vnd_headroom`, `function rmnet_vnd_change_mtu`, `function rmnet_vnd_get_iflink`, `function rmnet_vnd_init`, `function rmnet_vnd_uninit`, `function rmnet_get_stats64`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern 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.