drivers/net/ethernet/vertexcom/mse102x.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/vertexcom/mse102x.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/vertexcom/mse102x.c- Extension
.c- Size
- 19003 bytes
- Lines
- 807
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/if_vlan.hlinux/interrupt.hlinux/irq.hlinux/module.hlinux/kernel.hlinux/netdevice.hlinux/etherdevice.hlinux/ethtool.hlinux/cache.hlinux/debugfs.hlinux/seq_file.hlinux/string_choices.hlinux/spi/spi.hlinux/of_net.h
Detected Declarations
struct mse102x_statsstruct mse102x_netstruct mse102x_net_spifunction mse102x_info_showfunction mse102x_init_device_debugfsfunction mse102x_remove_device_debugfsfunction mse102x_init_device_debugfsfunction mse102x_rx_cmd_spifunction mse102x_push_headerfunction mse102x_put_footerfunction mse102x_tx_frame_spifunction mse102x_rx_frame_spifunction mse102x_dump_packetfunction mse102x_rx_pkt_spifunction mse102x_tx_pkt_spifunction mse102x_tx_workfunction mse102x_start_xmit_spifunction mse102x_init_macfunction mse102x_irqfunction mse102x_net_openfunction mse102x_net_stopfunction mse102x_get_drvinfofunction mse102x_get_msglevelfunction mse102x_set_msglevelfunction mse102x_get_ethtool_statsfunction mse102x_get_stringsfunction mse102x_get_sset_countfunction mse102x_suspendfunction mse102x_resumefunction mse102x_probe_spifunction mse102x_remove_spi
Annotated Snippet
static const struct net_device_ops mse102x_netdev_ops = {
.ndo_open = mse102x_net_open,
.ndo_stop = mse102x_net_stop,
.ndo_start_xmit = mse102x_start_xmit_spi,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
};
/* ethtool support */
static void mse102x_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *di)
{
strscpy(di->driver, DRV_NAME, sizeof(di->driver));
strscpy(di->bus_info, dev_name(ndev->dev.parent), sizeof(di->bus_info));
}
static u32 mse102x_get_msglevel(struct net_device *ndev)
{
struct mse102x_net *mse = netdev_priv(ndev);
return mse->msg_enable;
}
static void mse102x_set_msglevel(struct net_device *ndev, u32 to)
{
struct mse102x_net *mse = netdev_priv(ndev);
mse->msg_enable = to;
}
static void mse102x_get_ethtool_stats(struct net_device *ndev,
struct ethtool_stats *estats, u64 *data)
{
struct mse102x_net *mse = netdev_priv(ndev);
struct mse102x_stats *st = &mse->stats;
memcpy(data, st, ARRAY_SIZE(mse102x_gstrings_stats) * sizeof(u64));
}
static void mse102x_get_strings(struct net_device *ndev, u32 stringset, u8 *buf)
{
switch (stringset) {
case ETH_SS_STATS:
memcpy(buf, &mse102x_gstrings_stats,
sizeof(mse102x_gstrings_stats));
break;
default:
WARN_ON(1);
break;
}
}
static int mse102x_get_sset_count(struct net_device *ndev, int sset)
{
switch (sset) {
case ETH_SS_STATS:
return ARRAY_SIZE(mse102x_gstrings_stats);
default:
return -EINVAL;
}
}
static const struct ethtool_ops mse102x_ethtool_ops = {
.get_drvinfo = mse102x_get_drvinfo,
.get_link = ethtool_op_get_link,
.get_msglevel = mse102x_get_msglevel,
.set_msglevel = mse102x_set_msglevel,
.get_ethtool_stats = mse102x_get_ethtool_stats,
.get_strings = mse102x_get_strings,
.get_sset_count = mse102x_get_sset_count,
};
/* driver bus management functions */
static int mse102x_suspend(struct device *dev)
{
struct mse102x_net *mse = dev_get_drvdata(dev);
struct net_device *ndev = mse->ndev;
if (netif_running(ndev)) {
netif_device_detach(ndev);
mse102x_net_stop(ndev);
}
return 0;
}
static int mse102x_resume(struct device *dev)
{
Annotation
- Immediate include surface: `linux/if_vlan.h`, `linux/interrupt.h`, `linux/irq.h`, `linux/module.h`, `linux/kernel.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/ethtool.h`.
- Detected declarations: `struct mse102x_stats`, `struct mse102x_net`, `struct mse102x_net_spi`, `function mse102x_info_show`, `function mse102x_init_device_debugfs`, `function mse102x_remove_device_debugfs`, `function mse102x_init_device_debugfs`, `function mse102x_rx_cmd_spi`, `function mse102x_push_header`, `function mse102x_put_footer`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.