drivers/net/ethernet/freescale/gianfar_ethtool.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/gianfar_ethtool.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/gianfar_ethtool.c- Extension
.c- Size
- 39904 bytes
- Lines
- 1532
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/string.hlinux/errno.hlinux/interrupt.hlinux/delay.hlinux/netdevice.hlinux/etherdevice.hlinux/net_tstamp.hlinux/skbuff.hlinux/spinlock.hlinux/mm.hasm/io.hasm/irq.hlinux/uaccess.hlinux/module.hlinux/crc32.hasm/types.hlinux/ethtool.hlinux/mii.hlinux/phy.hlinux/sort.hlinux/if_vlan.hlinux/of.hlinux/of_platform.hlinux/platform_device.hlinux/fsl/ptp_qoriq.hgianfar.h
Detected Declarations
function gfar_gstringsfunction gfar_fill_statsfunction gfar_sset_countfunction gfar_gdrvinfofunction gfar_reglenfunction gfar_get_regsfunction gfar_usecs2ticksfunction gfar_ticks2usecsfunction gfar_gcoalescefunction gfar_scoalescefunction gfar_gringparamfunction gfar_sringparamfunction gfar_gpauseparamfunction gfar_spauseparamfunction gfar_set_featuresfunction gfar_get_msglevelfunction gfar_set_msglevelfunction gfar_get_wolfunction gfar_set_wolfunction ethflow_to_filer_rulesfunction gfar_ethflow_to_filer_tablefunction gfar_set_rxfh_fieldsfunction gfar_check_filer_hardwarefunction gfar_set_maskfunction gfar_set_parse_bitsfunction gfar_set_general_attributefunction levelfunction gfar_set_basic_ipfunction gfar_set_user_ipfunction gfar_set_etherfunction vlan_tci_vidfunction vlan_tci_vidmfunction vlan_tci_cfifunction vlan_tci_cfimfunction vlan_tci_priofunction vlan_tci_priomfunction gfar_convert_to_filerfunction gfar_write_filer_tablefunction gfar_check_capabilityfunction gfar_process_filer_changesfunction gfar_invert_masksfunction gfar_add_clsfunction list_for_each_entryfunction gfar_del_clsfunction list_for_each_entryfunction gfar_get_clsfunction list_for_each_entryfunction gfar_get_cls_all
Annotated Snippet
if (epause->tx_pause) {
priv->tx_pause_en = 1;
}
} else if (epause->tx_pause) {
priv->tx_pause_en = 1;
}
if (epause->autoneg)
priv->pause_aneg_en = 1;
else
priv->pause_aneg_en = 0;
if (!epause->autoneg) {
u32 tempval = gfar_read(®s->maccfg1);
tempval &= ~(MACCFG1_TX_FLOW | MACCFG1_RX_FLOW);
priv->tx_actual_en = 0;
if (priv->tx_pause_en) {
priv->tx_actual_en = 1;
tempval |= MACCFG1_TX_FLOW;
}
if (priv->rx_pause_en)
tempval |= MACCFG1_RX_FLOW;
gfar_write(®s->maccfg1, tempval);
}
return 0;
}
int gfar_set_features(struct net_device *dev, netdev_features_t features)
{
netdev_features_t changed = dev->features ^ features;
struct gfar_private *priv = netdev_priv(dev);
int err = 0;
if (!(changed & (NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_RXCSUM)))
return 0;
while (test_and_set_bit_lock(GFAR_RESETTING, &priv->state))
cpu_relax();
dev->features = features;
if (dev->flags & IFF_UP) {
/* Now we take down the rings to rebuild them */
stop_gfar(dev);
err = startup_gfar(dev);
} else {
gfar_mac_reset(priv);
}
clear_bit_unlock(GFAR_RESETTING, &priv->state);
return err;
}
static uint32_t gfar_get_msglevel(struct net_device *dev)
{
struct gfar_private *priv = netdev_priv(dev);
return priv->msg_enable;
}
static void gfar_set_msglevel(struct net_device *dev, uint32_t data)
{
struct gfar_private *priv = netdev_priv(dev);
priv->msg_enable = data;
}
#ifdef CONFIG_PM
static void gfar_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{
struct gfar_private *priv = netdev_priv(dev);
wol->supported = 0;
wol->wolopts = 0;
if (priv->wol_supported & GFAR_WOL_MAGIC)
wol->supported |= WAKE_MAGIC;
if (priv->wol_supported & GFAR_WOL_FILER_UCAST)
wol->supported |= WAKE_UCAST;
if (priv->wol_opts & GFAR_WOL_MAGIC)
wol->wolopts |= WAKE_MAGIC;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/string.h`, `linux/errno.h`, `linux/interrupt.h`, `linux/delay.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/net_tstamp.h`.
- Detected declarations: `function gfar_gstrings`, `function gfar_fill_stats`, `function gfar_sset_count`, `function gfar_gdrvinfo`, `function gfar_reglen`, `function gfar_get_regs`, `function gfar_usecs2ticks`, `function gfar_ticks2usecs`, `function gfar_gcoalesce`, `function gfar_scoalesce`.
- 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.