drivers/net/ethernet/amd/au1000_eth.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/amd/au1000_eth.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/amd/au1000_eth.c- Extension
.c- Size
- 35163 bytes
- Lines
- 1375
- 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/capability.hlinux/dma-mapping.hlinux/module.hlinux/kernel.hlinux/string.hlinux/timer.hlinux/errno.hlinux/in.hlinux/ioport.hlinux/bitops.hlinux/slab.hlinux/interrupt.hlinux/netdevice.hlinux/etherdevice.hlinux/ethtool.hlinux/mii.hlinux/skbuff.hlinux/delay.hlinux/crc32.hlinux/phy.hlinux/platform_device.hlinux/cpu.hlinux/io.hasm/mipsregs.hasm/irq.hasm/processor.hau1000.hau1xxx_eth.hprom.hau1000_eth.h
Detected Declarations
function mii_probefunction au1000_mdio_readfunction au1000_mdio_writefunction au1000_mdiobus_readfunction au1000_mdiobus_writefunction au1000_mdiobus_resetfunction au1000_hard_stopfunction au1000_enable_rx_txfunction au1000_adjust_linkfunction au1000_mii_probefunction au1000_ReleaseDBfunction au1000_reset_mac_unlockedfunction au1000_reset_macfunction au1000_setup_hw_ringsfunction au1000_get_drvinfofunction au1000_set_msglevelfunction au1000_get_msglevelfunction au1000_initfunction au1000_update_rx_statsfunction au1000_rxfunction au1000_update_tx_statsfunction au1000_tx_ackfunction au1000_interruptfunction au1000_openfunction au1000_closefunction au1000_txfunction au1000_tx_timeoutfunction au1000_multicast_listfunction netdev_mc_countfunction au1000_probefunction au1000_remove
Annotated Snippet
static const struct net_device_ops au1000_netdev_ops = {
.ndo_open = au1000_open,
.ndo_stop = au1000_close,
.ndo_start_xmit = au1000_tx,
.ndo_set_rx_mode = au1000_multicast_list,
.ndo_eth_ioctl = phy_do_ioctl_running,
.ndo_tx_timeout = au1000_tx_timeout,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
};
static int au1000_probe(struct platform_device *pdev)
{
struct au1000_private *aup = NULL;
struct au1000_eth_platform_data *pd;
struct net_device *dev = NULL;
struct db_dest *pDB, *pDBfree;
int irq, i, err = 0;
struct resource *base, *macen, *macdma;
base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
if (!base) {
dev_err(&pdev->dev, "failed to retrieve base register\n");
err = -ENODEV;
goto out;
}
macen = platform_get_resource(pdev, IORESOURCE_MEM, 1);
if (!macen) {
dev_err(&pdev->dev, "failed to retrieve MAC Enable register\n");
err = -ENODEV;
goto out;
}
irq = platform_get_irq(pdev, 0);
if (irq < 0) {
err = -ENODEV;
goto out;
}
macdma = platform_get_resource(pdev, IORESOURCE_MEM, 2);
if (!macdma) {
dev_err(&pdev->dev, "failed to retrieve MACDMA registers\n");
err = -ENODEV;
goto out;
}
if (!request_mem_region(base->start, resource_size(base),
pdev->name)) {
dev_err(&pdev->dev, "failed to request memory region for base registers\n");
err = -ENXIO;
goto out;
}
if (!request_mem_region(macen->start, resource_size(macen),
pdev->name)) {
dev_err(&pdev->dev, "failed to request memory region for MAC enable register\n");
err = -ENXIO;
goto err_request;
}
if (!request_mem_region(macdma->start, resource_size(macdma),
pdev->name)) {
dev_err(&pdev->dev, "failed to request MACDMA memory region\n");
err = -ENXIO;
goto err_macdma;
}
dev = alloc_etherdev(sizeof(struct au1000_private));
if (!dev) {
err = -ENOMEM;
goto err_alloc;
}
SET_NETDEV_DEV(dev, &pdev->dev);
platform_set_drvdata(pdev, dev);
aup = netdev_priv(dev);
spin_lock_init(&aup->lock);
aup->msg_enable = (au1000_debug < 4 ?
AU1000_DEF_MSG_ENABLE : au1000_debug);
/* Allocate the data buffers
* Snooping works fine with eth on all au1xxx
*/
aup->vaddr = dma_alloc_coherent(&pdev->dev, MAX_BUF_SIZE *
(NUM_TX_BUFFS + NUM_RX_BUFFS),
&aup->dma_addr, 0);
if (!aup->vaddr) {
dev_err(&pdev->dev, "failed to allocate data buffers\n");
Annotation
- Immediate include surface: `linux/capability.h`, `linux/dma-mapping.h`, `linux/module.h`, `linux/kernel.h`, `linux/string.h`, `linux/timer.h`, `linux/errno.h`, `linux/in.h`.
- Detected declarations: `function mii_probe`, `function au1000_mdio_read`, `function au1000_mdio_write`, `function au1000_mdiobus_read`, `function au1000_mdiobus_write`, `function au1000_mdiobus_reset`, `function au1000_hard_stop`, `function au1000_enable_rx_tx`, `function au1000_adjust_link`, `function au1000_mii_probe`.
- 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.