drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/qlogic/netxen/netxen_nic_ethtool.c- Extension
.c- Size
- 26022 bytes
- Lines
- 946
- 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/types.hlinux/delay.hlinux/pci.hasm/io.hlinux/netdevice.hlinux/ethtool.hnetxen_nic.hnetxen_nic_hw.h
Detected Declarations
struct netxen_nic_statsfunction netxen_nic_get_eeprom_lenfunction netxen_nic_get_drvinfofunction netxen_nic_get_link_ksettingsfunction netxen_nic_set_link_ksettingsfunction netxen_nic_get_regs_lenfunction netxen_nic_get_regsfunction netxen_nic_test_linkfunction netxen_nic_get_eepromfunction netxen_nic_get_ringparamfunction netxen_validate_ringparamfunction netxen_nic_set_ringparamfunction netxen_nic_get_pauseparamfunction netxen_nic_set_pauseparamfunction netxen_nic_reg_testfunction netxen_get_sset_countfunction netxen_nic_diag_testfunction netxen_nic_get_stringsfunction netxen_nic_get_ethtool_statsfunction netxen_nic_get_wolfunction netxen_nic_set_wolfunction netxen_set_intr_coalescefunction netxen_get_intr_coalescefunction netxen_get_dump_flagfunction netxen_set_dumpfunction netxen_get_dump_data
Annotated Snippet
struct netxen_nic_stats {
char stat_string[ETH_GSTRING_LEN];
int sizeof_stat;
int stat_offset;
};
#define NETXEN_NIC_STAT(m) sizeof(((struct netxen_adapter *)0)->m), \
offsetof(struct netxen_adapter, m)
#define NETXEN_NIC_PORT_WINDOW 0x10000
#define NETXEN_NIC_INVALID_DATA 0xDEADBEEF
static const struct netxen_nic_stats netxen_nic_gstrings_stats[] = {
{"xmit_called", NETXEN_NIC_STAT(stats.xmitcalled)},
{"xmit_finished", NETXEN_NIC_STAT(stats.xmitfinished)},
{"rx_dropped", NETXEN_NIC_STAT(stats.rxdropped)},
{"tx_dropped", NETXEN_NIC_STAT(stats.txdropped)},
{"csummed", NETXEN_NIC_STAT(stats.csummed)},
{"rx_pkts", NETXEN_NIC_STAT(stats.rx_pkts)},
{"lro_pkts", NETXEN_NIC_STAT(stats.lro_pkts)},
{"rx_bytes", NETXEN_NIC_STAT(stats.rxbytes)},
{"tx_bytes", NETXEN_NIC_STAT(stats.txbytes)},
};
#define NETXEN_NIC_STATS_LEN ARRAY_SIZE(netxen_nic_gstrings_stats)
static const char netxen_nic_gstrings_test[][ETH_GSTRING_LEN] = {
"Register_Test_on_offline",
"Link_Test_on_offline"
};
#define NETXEN_NIC_TEST_LEN ARRAY_SIZE(netxen_nic_gstrings_test)
#define NETXEN_NIC_REGS_COUNT 30
#define NETXEN_NIC_REGS_LEN (NETXEN_NIC_REGS_COUNT * sizeof(__le32))
#define NETXEN_MAX_EEPROM_LEN 1024
static int netxen_nic_get_eeprom_len(struct net_device *dev)
{
return NETXEN_FLASH_TOTAL_SIZE;
}
static void
netxen_nic_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo)
{
struct netxen_adapter *adapter = netdev_priv(dev);
u32 fw_major = 0;
u32 fw_minor = 0;
u32 fw_build = 0;
strscpy(drvinfo->driver, netxen_nic_driver_name,
sizeof(drvinfo->driver));
strscpy(drvinfo->version, NETXEN_NIC_LINUX_VERSIONID,
sizeof(drvinfo->version));
fw_major = NXRD32(adapter, NETXEN_FW_VERSION_MAJOR);
fw_minor = NXRD32(adapter, NETXEN_FW_VERSION_MINOR);
fw_build = NXRD32(adapter, NETXEN_FW_VERSION_SUB);
snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
"%d.%d.%d", fw_major, fw_minor, fw_build);
strscpy(drvinfo->bus_info, pci_name(adapter->pdev),
sizeof(drvinfo->bus_info));
}
static int
netxen_nic_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{
struct netxen_adapter *adapter = netdev_priv(dev);
int check_sfp_module = 0;
u32 supported, advertising;
/* read which mode */
if (adapter->ahw.port_type == NETXEN_NIC_GBE) {
supported = (SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full |
SUPPORTED_100baseT_Half |
SUPPORTED_100baseT_Full |
SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full);
advertising = (ADVERTISED_100baseT_Half |
ADVERTISED_100baseT_Full |
ADVERTISED_1000baseT_Half |
ADVERTISED_1000baseT_Full);
cmd->base.port = PORT_TP;
cmd->base.speed = adapter->link_speed;
cmd->base.duplex = adapter->link_duplex;
Annotation
- Immediate include surface: `linux/types.h`, `linux/delay.h`, `linux/pci.h`, `asm/io.h`, `linux/netdevice.h`, `linux/ethtool.h`, `netxen_nic.h`, `netxen_nic_hw.h`.
- Detected declarations: `struct netxen_nic_stats`, `function netxen_nic_get_eeprom_len`, `function netxen_nic_get_drvinfo`, `function netxen_nic_get_link_ksettings`, `function netxen_nic_set_link_ksettings`, `function netxen_nic_get_regs_len`, `function netxen_nic_get_regs`, `function netxen_nic_test_link`, `function netxen_nic_get_eeprom`, `function netxen_nic_get_ringparam`.
- 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.