drivers/net/ethernet/ti/icssg/icssg_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/icssg/icssg_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ti/icssg/icssg_ethtool.c- Extension
.c- Size
- 8911 bytes
- Lines
- 322
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
icssg_prueth.hicssg_stats.h
Detected Declarations
function Copyrightfunction emac_get_msglevelfunction emac_set_msglevelfunction emac_get_link_ksettingsfunction emac_set_link_ksettingsfunction emac_get_eeefunction emac_set_eeefunction emac_nway_resetfunction emac_get_sset_countfunction emac_get_stringsfunction emac_get_ethtool_statsfunction emac_get_ts_infofunction emac_set_channelsfunction emac_get_channelsfunction emac_get_rmon_statsfunction emac_get_coalescefunction emac_get_per_queue_coalescefunction emac_set_coalescefunction emac_set_per_queue_coalesceexport icssg_ethtool_ops
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/* Texas Instruments ICSSG Ethernet driver
*
* Copyright (C) 2018-2022 Texas Instruments Incorporated - https://www.ti.com/
*
*/
#include "icssg_prueth.h"
#include "icssg_stats.h"
static void emac_get_drvinfo(struct net_device *ndev,
struct ethtool_drvinfo *info)
{
struct prueth_emac *emac = netdev_priv(ndev);
struct prueth *prueth = emac->prueth;
strscpy(info->driver, dev_driver_string(prueth->dev),
sizeof(info->driver));
strscpy(info->bus_info, dev_name(prueth->dev), sizeof(info->bus_info));
}
static u32 emac_get_msglevel(struct net_device *ndev)
{
struct prueth_emac *emac = netdev_priv(ndev);
return emac->msg_enable;
}
static void emac_set_msglevel(struct net_device *ndev, u32 value)
{
struct prueth_emac *emac = netdev_priv(ndev);
emac->msg_enable = value;
}
static int emac_get_link_ksettings(struct net_device *ndev,
struct ethtool_link_ksettings *ecmd)
{
return phy_ethtool_get_link_ksettings(ndev, ecmd);
}
static int emac_set_link_ksettings(struct net_device *ndev,
const struct ethtool_link_ksettings *ecmd)
{
return phy_ethtool_set_link_ksettings(ndev, ecmd);
}
static int emac_get_eee(struct net_device *ndev, struct ethtool_keee *edata)
{
if (!ndev->phydev)
return -EOPNOTSUPP;
return phy_ethtool_get_eee(ndev->phydev, edata);
}
static int emac_set_eee(struct net_device *ndev, struct ethtool_keee *edata)
{
if (!ndev->phydev)
return -EOPNOTSUPP;
return phy_ethtool_set_eee(ndev->phydev, edata);
}
static int emac_nway_reset(struct net_device *ndev)
{
return phy_ethtool_nway_reset(ndev);
}
static int emac_get_sset_count(struct net_device *ndev, int stringset)
{
struct prueth_emac *emac = netdev_priv(ndev);
switch (stringset) {
case ETH_SS_STATS:
if (emac->prueth->pa_stats)
return ICSSG_NUM_ETHTOOL_STATS;
else
return ICSSG_NUM_ETHTOOL_STATS - ICSSG_NUM_PA_STATS;
default:
return -EOPNOTSUPP;
}
}
static void emac_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
{
struct prueth_emac *emac = netdev_priv(ndev);
u8 *p = data;
int i;
switch (stringset) {
case ETH_SS_STATS:
Annotation
- Immediate include surface: `icssg_prueth.h`, `icssg_stats.h`.
- Detected declarations: `function Copyright`, `function emac_get_msglevel`, `function emac_set_msglevel`, `function emac_get_link_ksettings`, `function emac_set_link_ksettings`, `function emac_get_eee`, `function emac_set_eee`, `function emac_nway_reset`, `function emac_get_sset_count`, `function emac_get_strings`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: integration 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.