drivers/net/ethernet/i825xx/ether1.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/i825xx/ether1.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/i825xx/ether1.c- Extension
.c- Size
- 27318 bytes
- Lines
- 1087
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/module.hlinux/kernel.hlinux/types.hlinux/fcntl.hlinux/interrupt.hlinux/ioport.hlinux/in.hlinux/slab.hlinux/string.hlinux/errno.hlinux/device.hlinux/init.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/bitops.hasm/io.hasm/dma.hasm/ecard.hether1.h
Detected Declarations
function ether1_inw_pfunction ether1_outw_pfunction ether1_writebufferfunction ether1_readbufferfunction ether1_ramtestfunction ether1_resetfunction ether1_init_2function ether1_init_for_openfunction ether1_txallocfunction ether1_openfunction ether1_timeoutfunction ether1_sendpacketfunction ether1_xmit_donefunction ether1_recv_donefunction ether1_interruptfunction ether1_closefunction ether1_setmulticastlistfunction ether1_probefunction ether1_removefunction ether1_initfunction ether1_exitmodule init ether1_init
Annotated Snippet
static const struct net_device_ops ether1_netdev_ops = {
.ndo_open = ether1_open,
.ndo_stop = ether1_close,
.ndo_start_xmit = ether1_sendpacket,
.ndo_set_rx_mode = ether1_setmulticastlist,
.ndo_tx_timeout = ether1_timeout,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
};
static int
ether1_probe(struct expansion_card *ec, const struct ecard_id *id)
{
struct net_device *dev;
u8 addr[ETH_ALEN];
int i, ret = 0;
ether1_banner();
ret = ecard_request_resources(ec);
if (ret)
goto out;
dev = alloc_etherdev(sizeof(struct ether1_priv));
if (!dev) {
ret = -ENOMEM;
goto release;
}
SET_NETDEV_DEV(dev, &ec->dev);
dev->irq = ec->irq;
priv(dev)->base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
if (!priv(dev)->base) {
ret = -ENOMEM;
goto free;
}
if ((priv(dev)->bus_type = ether1_reset(dev)) == 0) {
ret = -ENODEV;
goto free;
}
for (i = 0; i < 6; i++)
addr[i] = readb(IDPROM_ADDRESS + (i << 2));
eth_hw_addr_set(dev, addr);
if (ether1_init_2(dev)) {
ret = -ENODEV;
goto free;
}
dev->netdev_ops = ðer1_netdev_ops;
dev->watchdog_timeo = 5 * HZ / 100;
ret = register_netdev(dev);
if (ret)
goto free;
printk(KERN_INFO "%s: ether1 in slot %d, %pM\n",
dev->name, ec->slot_no, dev->dev_addr);
ecard_set_drvdata(ec, dev);
return 0;
free:
free_netdev(dev);
release:
ecard_release_resources(ec);
out:
return ret;
}
static void ether1_remove(struct expansion_card *ec)
{
struct net_device *dev = ecard_get_drvdata(ec);
ecard_set_drvdata(ec, NULL);
unregister_netdev(dev);
free_netdev(dev);
ecard_release_resources(ec);
}
static const struct ecard_id ether1_ids[] = {
{ MANU_ACORN, PROD_ACORN_ETHER1 },
{ 0xffff, 0xffff }
};
static struct ecard_driver ether1_driver = {
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/types.h`, `linux/fcntl.h`, `linux/interrupt.h`, `linux/ioport.h`, `linux/in.h`, `linux/slab.h`.
- Detected declarations: `function ether1_inw_p`, `function ether1_outw_p`, `function ether1_writebuffer`, `function ether1_readbuffer`, `function ether1_ramtest`, `function ether1_reset`, `function ether1_init_2`, `function ether1_init_for_open`, `function ether1_txalloc`, `function ether1_open`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- 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.