drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ibm/ehea/ehea_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ibm/ehea/ehea_ethtool.c- Extension
.c- Size
- 6512 bytes
- Lines
- 278
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
ehea.hehea_phyp.h
Detected Declarations
function ehea_get_link_ksettingsfunction ehea_set_link_ksettingsfunction ehea_nway_resetfunction ehea_get_drvinfofunction ehea_get_msglevelfunction ehea_set_msglevelfunction ehea_get_stringsfunction ehea_get_sset_countfunction ehea_get_ethtool_statsfunction ehea_set_ethtool_ops
Annotated Snippet
switch (port->port_speed) {
case EHEA_SPEED_10M:
speed = SPEED_10;
break;
case EHEA_SPEED_100M:
speed = SPEED_100;
break;
case EHEA_SPEED_1G:
speed = SPEED_1000;
break;
case EHEA_SPEED_10G:
speed = SPEED_10000;
break;
default:
speed = -1;
break; /* BUG */
}
cmd->base.duplex = port->full_duplex == 1 ?
DUPLEX_FULL : DUPLEX_HALF;
} else {
speed = SPEED_UNKNOWN;
cmd->base.duplex = DUPLEX_UNKNOWN;
}
cmd->base.speed = speed;
if (cmd->base.speed == SPEED_10000) {
supported = (SUPPORTED_10000baseT_Full | SUPPORTED_FIBRE);
advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_FIBRE);
cmd->base.port = PORT_FIBRE;
} else {
supported = (SUPPORTED_1000baseT_Full | SUPPORTED_100baseT_Full
| SUPPORTED_100baseT_Half | SUPPORTED_10baseT_Full
| SUPPORTED_10baseT_Half | SUPPORTED_Autoneg
| SUPPORTED_TP);
advertising = (ADVERTISED_1000baseT_Full | ADVERTISED_Autoneg
| ADVERTISED_TP);
cmd->base.port = PORT_TP;
}
cmd->base.autoneg = port->autoneg == 1 ?
AUTONEG_ENABLE : AUTONEG_DISABLE;
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
supported);
ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
advertising);
return 0;
}
static int ehea_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{
struct ehea_port *port = netdev_priv(dev);
int ret = 0;
u32 sp;
if (cmd->base.autoneg == AUTONEG_ENABLE) {
sp = EHEA_SPEED_AUTONEG;
goto doit;
}
switch (cmd->base.speed) {
case SPEED_10:
if (cmd->base.duplex == DUPLEX_FULL)
sp = H_SPEED_10M_F;
else
sp = H_SPEED_10M_H;
break;
case SPEED_100:
if (cmd->base.duplex == DUPLEX_FULL)
sp = H_SPEED_100M_F;
else
sp = H_SPEED_100M_H;
break;
case SPEED_1000:
if (cmd->base.duplex == DUPLEX_FULL)
sp = H_SPEED_1G_F;
else
ret = -EINVAL;
break;
case SPEED_10000:
if (cmd->base.duplex == DUPLEX_FULL)
sp = H_SPEED_10G_F;
else
ret = -EINVAL;
break;
Annotation
- Immediate include surface: `ehea.h`, `ehea_phyp.h`.
- Detected declarations: `function ehea_get_link_ksettings`, `function ehea_set_link_ksettings`, `function ehea_nway_reset`, `function ehea_get_drvinfo`, `function ehea_get_msglevel`, `function ehea_set_msglevel`, `function ehea_get_strings`, `function ehea_get_sset_count`, `function ehea_get_ethtool_stats`, `function ehea_set_ethtool_ops`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.