drivers/net/ethernet/8390/mac8390.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/8390/mac8390.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/8390/mac8390.c- Extension
.c- Size
- 23148 bytes
- Lines
- 849
- 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/module.hlinux/kernel.hlinux/types.hlinux/fcntl.hlinux/interrupt.hlinux/ptrace.hlinux/ioport.hlinux/nubus.hlinux/in.hlinux/string.hlinux/errno.hlinux/init.hlinux/netdevice.hlinux/etherdevice.hlinux/skbuff.hlinux/bitops.hlinux/io.hasm/dma.hasm/hwtest.hasm/macints.hlib8390.c
Detected Declarations
enum mac8390_typeenum mac8390_accessfunction mac8390_identfunction mac8390_testiofunction mac8390_memsizefunction mac8390_rsrc_initfunction mac8390_device_probefunction for_each_board_func_rsrcfunction mac8390_device_removefunction mac8390_initfunction mac8390_exitfunction mac8390_initdevfunction mac8390_openfunction mac8390_closefunction mac8390_no_resetfunction interlan_resetfunction dayna_memcpy_fromcardfunction dayna_memcpy_tocardfunction sane_get_8390_hdrfunction sane_block_inputfunction sane_block_outputfunction dayna_get_8390_hdrfunction dayna_block_inputfunction dayna_block_outputfunction slow_sane_get_8390_hdrfunction slow_sane_block_inputfunction slow_sane_block_outputfunction word_memcpy_tocardfunction word_memcpy_fromcardmodule init mac8390_init
Annotated Snippet
static const struct net_device_ops mac8390_netdev_ops = {
.ndo_open = mac8390_open,
.ndo_stop = mac8390_close,
.ndo_start_xmit = __ei_start_xmit,
.ndo_tx_timeout = __ei_tx_timeout,
.ndo_get_stats = __ei_get_stats,
.ndo_set_rx_mode = __ei_set_multicast_list,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = __ei_poll,
#endif
};
static int mac8390_initdev(struct net_device *dev, struct nubus_board *board,
enum mac8390_type type)
{
static u32 fwrd4_offsets[16] = {
0, 4, 8, 12,
16, 20, 24, 28,
32, 36, 40, 44,
48, 52, 56, 60
};
static u32 back4_offsets[16] = {
60, 56, 52, 48,
44, 40, 36, 32,
28, 24, 20, 16,
12, 8, 4, 0
};
static u32 fwrd2_offsets[16] = {
0, 2, 4, 6,
8, 10, 12, 14,
16, 18, 20, 22,
24, 26, 28, 30
};
int access_bitmode = 0;
/* Now fill in our stuff */
dev->netdev_ops = &mac8390_netdev_ops;
/* GAR, ei_status is actually a macro even though it looks global */
ei_status.name = cardname[type];
ei_status.word16 = word16[type];
/* Cabletron's TX/RX buffers are backwards */
if (type == MAC8390_CABLETRON) {
ei_status.tx_start_page = CABLETRON_TX_START_PG;
ei_status.rx_start_page = CABLETRON_RX_START_PG;
ei_status.stop_page = CABLETRON_RX_STOP_PG;
ei_status.rmem_start = dev->mem_start;
ei_status.rmem_end = dev->mem_start + CABLETRON_RX_STOP_PG*256;
} else {
ei_status.tx_start_page = WD_START_PG;
ei_status.rx_start_page = WD_START_PG + TX_PAGES;
ei_status.stop_page = (dev->mem_end - dev->mem_start)/256;
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
ei_status.rmem_end = dev->mem_end;
}
/* Fill in model-specific information and functions */
switch (type) {
case MAC8390_FARALLON:
case MAC8390_APPLE:
switch (mac8390_testio(dev->mem_start)) {
case ACCESS_UNKNOWN:
dev_err(&board->dev,
"Don't know how to access card memory\n");
return -ENODEV;
case ACCESS_16:
/* 16 bit card, register map is reversed */
ei_status.reset_8390 = mac8390_no_reset;
ei_status.block_input = slow_sane_block_input;
ei_status.block_output = slow_sane_block_output;
ei_status.get_8390_hdr = slow_sane_get_8390_hdr;
ei_status.reg_offset = back4_offsets;
break;
case ACCESS_32:
/* 32 bit card, register map is reversed */
ei_status.reset_8390 = mac8390_no_reset;
ei_status.block_input = sane_block_input;
ei_status.block_output = sane_block_output;
ei_status.get_8390_hdr = sane_get_8390_hdr;
ei_status.reg_offset = back4_offsets;
access_bitmode = 1;
break;
}
break;
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/types.h`, `linux/fcntl.h`, `linux/interrupt.h`, `linux/ptrace.h`, `linux/ioport.h`, `linux/nubus.h`.
- Detected declarations: `enum mac8390_type`, `enum mac8390_access`, `function mac8390_ident`, `function mac8390_testio`, `function mac8390_memsize`, `function mac8390_rsrc_init`, `function mac8390_device_probe`, `function for_each_board_func_rsrc`, `function mac8390_device_remove`, `function mac8390_init`.
- 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.