drivers/net/ethernet/i825xx/sun3_82586.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/i825xx/sun3_82586.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/i825xx/sun3_82586.c- Extension
.c- Size
- 32749 bytes
- Lines
- 1188
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.hlinux/module.hlinux/string.hlinux/errno.hlinux/ioport.hlinux/interrupt.hlinux/delay.hlinux/init.hlinux/bitops.hasm/io.hasm/idprom.hasm/machines.hasm/sun3mmu.hasm/dvma.hasm/byteorder.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hsun3_82586.h
Detected Declarations
struct privfunction sun3_82586_closefunction sun3_82586_openfunction check586function alloc586function sun3_82586_probefunction sun3_82586_probe1function init586function sun3_82586_rnr_intfunction sun3_82586_interruptfunction sun3_82586_rcv_intfunction sun3_82586_rnr_intfunction sun3_82586_xmt_intfunction startrecv586function sun3_82586_timeoutfunction sun3_82586_send_packetfunction set_multicast_listfunction sun3_82586_dumpmodule init sun3_82586_probe
Annotated Snippet
static const struct net_device_ops sun3_82586_netdev_ops = {
.ndo_open = sun3_82586_open,
.ndo_stop = sun3_82586_close,
.ndo_start_xmit = sun3_82586_send_packet,
.ndo_set_rx_mode = set_multicast_list,
.ndo_tx_timeout = sun3_82586_timeout,
.ndo_get_stats = sun3_82586_get_stats,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
};
static int __init sun3_82586_probe1(struct net_device *dev,int ioaddr)
{
int size, retval;
if (!request_region(ioaddr, SUN3_82586_TOTAL_SIZE, DRV_NAME))
return -EBUSY;
/* copy in the ethernet address from the prom */
eth_hw_addr_set(dev, idprom->id_ethaddr);
printk("%s: SUN3 Intel 82586 found at %lx, ",dev->name,dev->base_addr);
/*
* check (or search) IO-Memory, 32K
*/
size = 0x8000;
dev->mem_start = (unsigned long)dvma_malloc_align(0x8000, 0x1000);
dev->mem_end = dev->mem_start + size;
if(size != 0x2000 && size != 0x4000 && size != 0x8000) {
printk("\n%s: Illegal memory size %d. Allowed is 0x2000 or 0x4000 or 0x8000 bytes.\n",dev->name,size);
retval = -ENODEV;
goto out;
}
if(!check586(dev,(char *) dev->mem_start,size)) {
printk("?memcheck, Can't find memory at 0x%lx with size %d!\n",dev->mem_start,size);
retval = -ENODEV;
goto out;
}
((struct priv *)netdev_priv(dev))->memtop =
(char *)dvma_btov(dev->mem_start);
((struct priv *)netdev_priv(dev))->base = (unsigned long) dvma_btov(0);
alloc586(dev);
/* set number of receive-buffs according to memsize */
if(size == 0x2000)
((struct priv *)netdev_priv(dev))->num_recv_buffs =
NUM_RECV_BUFFS_8;
else if(size == 0x4000)
((struct priv *)netdev_priv(dev))->num_recv_buffs =
NUM_RECV_BUFFS_16;
else
((struct priv *)netdev_priv(dev))->num_recv_buffs =
NUM_RECV_BUFFS_32;
printk("Memaddr: 0x%lx, Memsize: %d, IRQ %d\n",dev->mem_start,size, dev->irq);
dev->netdev_ops = &sun3_82586_netdev_ops;
dev->watchdog_timeo = HZ/20;
dev->if_port = 0;
return 0;
out:
release_region(ioaddr, SUN3_82586_TOTAL_SIZE);
return retval;
}
static int init586(struct net_device *dev)
{
void *ptr;
int i,result=0;
struct priv *p = netdev_priv(dev);
volatile struct configure_cmd_struct *cfg_cmd;
volatile struct iasetup_cmd_struct *ias_cmd;
volatile struct tdr_cmd_struct *tdr_cmd;
volatile struct mcsetup_cmd_struct *mc_cmd;
struct netdev_hw_addr *ha;
int num_addrs=netdev_mc_count(dev);
ptr = (void *) ((char *)p->scb + sizeof(struct scb_struct));
cfg_cmd = (struct configure_cmd_struct *)ptr; /* configure-command */
cfg_cmd->cmd_status = 0;
cfg_cmd->cmd_cmd = swab16(CMD_CONFIGURE | CMD_LAST);
cfg_cmd->cmd_link = 0xffff;
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/module.h`, `linux/string.h`, `linux/errno.h`, `linux/ioport.h`, `linux/interrupt.h`, `linux/delay.h`, `linux/init.h`.
- Detected declarations: `struct priv`, `function sun3_82586_close`, `function sun3_82586_open`, `function check586`, `function alloc586`, `function sun3_82586_probe`, `function sun3_82586_probe1`, `function init586`, `function sun3_82586_rnr_int`, `function sun3_82586_interrupt`.
- 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.