drivers/net/ethernet/8390/ax88796.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/8390/ax88796.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/8390/ax88796.c- Extension
.c- Size
- 25198 bytes
- Lines
- 1023
- 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/errno.hlinux/isapnp.hlinux/interrupt.hlinux/io.hlinux/platform_device.hlinux/delay.hlinux/timer.hlinux/netdevice.hlinux/etherdevice.hlinux/ethtool.hlinux/mdio-bitbang.hlinux/phy.hlinux/eeprom_93cx6.hlinux/slab.hnet/ax88796.hlib8390.c
Detected Declarations
struct ax_devicefunction ax_NS8390_reinitfunction ax_initial_checkfunction ax_reset_8390function ax_ei_interrupt_filteredfunction ax_get_8390_hdrfunction ax_block_inputfunction ax_block_outputfunction ax_handle_link_changefunction ax_mii_probefunction ax_phy_switchfunction ax_bb_mdcfunction ax_bb_dirfunction ax_bb_set_datafunction ax_bb_get_datafunction ax_mii_initfunction ax_openfunction ax_closefunction ax_ioctlfunction ax_get_drvinfofunction ax_get_msglevelfunction ax_set_msglevelfunction ax_eeprom_register_readfunction ax_eeprom_register_writefunction ax_initial_setupfunction havefunction ax_removefunction ax_probefunction ax_suspendfunction ax_resumeexport ax_NS8390_reinit
Annotated Snippet
static const struct net_device_ops ax_netdev_ops = {
.ndo_open = ax_open,
.ndo_stop = ax_close,
.ndo_eth_ioctl = ax_ioctl,
.ndo_start_xmit = ax_ei_start_xmit,
.ndo_tx_timeout = ax_ei_tx_timeout,
.ndo_get_stats = ax_ei_get_stats,
.ndo_set_rx_mode = ax_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 = ax_ei_poll,
#endif
};
/* setup code */
static void ax_initial_setup(struct net_device *dev, struct ei_device *ei_local)
{
void __iomem *ioaddr = ei_local->mem;
struct ax_device *ax = to_ax_dev(dev);
/* Select page 0 */
ei_outb(E8390_NODMA + E8390_PAGE0 + E8390_STOP, ioaddr + E8390_CMD);
/* set to byte access */
ei_outb(ax->plat->dcr_val & ~1, ioaddr + EN0_DCFG);
ei_outb(ax->plat->gpoc_val, ioaddr + EI_SHIFT(0x17));
}
/*
* ax_init_dev
*
* initialise the specified device, taking care to note the MAC
* address it may already have (if configured), ensure
* the device is ready to be used by lib8390.c and registerd with
* the network layer.
*/
static int ax_init_dev(struct net_device *dev)
{
struct ei_device *ei_local = netdev_priv(dev);
struct ax_device *ax = to_ax_dev(dev);
void __iomem *ioaddr = ei_local->mem;
unsigned int start_page;
unsigned int stop_page;
int ret;
int i;
ret = ax_initial_check(dev);
if (ret)
goto err_out;
/* setup goes here */
ax_initial_setup(dev, ei_local);
/* read the mac from the card prom if we need it */
if (ax->plat->flags & AXFLG_HAS_EEPROM) {
unsigned char SA_prom[32];
ei_outb(6, ioaddr + EN0_RCNTLO);
ei_outb(0, ioaddr + EN0_RCNTHI);
ei_outb(0, ioaddr + EN0_RSARLO);
ei_outb(0, ioaddr + EN0_RSARHI);
ei_outb(E8390_RREAD + E8390_START, ioaddr + NE_CMD);
for (i = 0; i < sizeof(SA_prom); i += 2) {
SA_prom[i] = ei_inb(ioaddr + NE_DATAPORT);
SA_prom[i + 1] = ei_inb(ioaddr + NE_DATAPORT);
}
ei_outb(ENISR_RDC, ioaddr + EN0_ISR); /* Ack intr. */
if (ax->plat->wordlength == 2)
for (i = 0; i < 16; i++)
SA_prom[i] = SA_prom[i+i];
eth_hw_addr_set(dev, SA_prom);
}
#ifdef CONFIG_AX88796_93CX6
if (ax->plat->flags & AXFLG_HAS_93CX6) {
unsigned char mac_addr[ETH_ALEN];
struct eeprom_93cx6 eeprom;
eeprom.data = ei_local;
eeprom.register_read = ax_eeprom_register_read;
eeprom.register_write = ax_eeprom_register_write;
eeprom.width = PCI_EEPROM_WIDTH_93C56;
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/errno.h`, `linux/isapnp.h`, `linux/interrupt.h`, `linux/io.h`, `linux/platform_device.h`, `linux/delay.h`.
- Detected declarations: `struct ax_device`, `function ax_NS8390_reinit`, `function ax_initial_check`, `function ax_reset_8390`, `function ax_ei_interrupt_filtered`, `function ax_get_8390_hdr`, `function ax_block_input`, `function ax_block_output`, `function ax_handle_link_change`, `function ax_mii_probe`.
- 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.