drivers/net/ethernet/sis/sis190.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sis/sis190.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sis/sis190.c- Extension
.c- Size
- 47193 bytes
- Lines
- 1949
- 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.
- 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/interrupt.hlinux/module.hlinux/moduleparam.hlinux/netdevice.hlinux/rtnetlink.hlinux/etherdevice.hlinux/ethtool.hlinux/pci.hlinux/mii.hlinux/delay.hlinux/crc32.hlinux/dma-mapping.hlinux/slab.hasm/irq.h
Detected Declarations
struct TxDescstruct RxDescstruct sis190_privatestruct sis190_phyenum sis190_registersenum sis190_register_contentenum _DescStatusBitenum sis190_eeprom_access_register_bitsenum sis190_eeprom_addressenum sis190_featureenum sis190_phy_typefunction __mdio_cmdfunction mdio_writefunction mdio_readfunction __mdio_writefunction __mdio_readfunction mdio_read_latchedfunction sis190_read_eepromfunction sis190_irq_mask_and_ackfunction sis190_asic_downfunction sis190_mark_as_last_descriptorfunction sis190_give_to_asicfunction sis190_map_to_asicfunction sis190_make_unusable_by_asicfunction sis190_rx_fillfunction sis190_try_rx_copyfunction sis190_rx_pkt_errfunction sis190_rx_interruptfunction sis190_unmap_tx_skbfunction sis190_tx_pkt_errfunction sis190_tx_interruptfunction sis190_irqfunction sis190_netpollfunction sis190_free_rx_skbfunction sis190_rx_clearfunction sis190_init_ring_indexesfunction sis190_init_ringfunction sis190_set_rx_modefunction netdev_for_each_mc_addrfunction sis190_soft_resetfunction sis190_hw_startfunction sis190_phy_taskfunction sis190_phy_timerfunction sis190_delete_timerfunction sis190_request_timerfunction sis190_set_rxbufsizefunction sis190_openfunction sis190_tx_clear
Annotated Snippet
static const struct net_device_ops sis190_netdev_ops = {
.ndo_open = sis190_open,
.ndo_stop = sis190_close,
.ndo_eth_ioctl = sis190_ioctl,
.ndo_start_xmit = sis190_start_xmit,
.ndo_tx_timeout = sis190_tx_timeout,
.ndo_set_rx_mode = sis190_set_rx_mode,
.ndo_set_mac_address = sis190_mac_addr,
.ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = sis190_netpoll,
#endif
};
static int sis190_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
static int printed_version = 0;
struct sis190_private *tp;
struct net_device *dev;
void __iomem *ioaddr;
int rc;
if (!printed_version) {
if (netif_msg_drv(&debug))
pr_info(SIS190_DRIVER_NAME " loaded\n");
printed_version = 1;
}
dev = sis190_init_board(pdev);
if (IS_ERR(dev)) {
rc = PTR_ERR(dev);
goto out;
}
pci_set_drvdata(pdev, dev);
tp = netdev_priv(dev);
ioaddr = tp->mmio_addr;
rc = sis190_get_mac_addr(pdev, dev);
if (rc < 0)
goto err_release_board;
sis190_init_rxfilter(dev);
INIT_WORK(&tp->phy_task, sis190_phy_task);
dev->netdev_ops = &sis190_netdev_ops;
dev->ethtool_ops = &sis190_ethtool_ops;
dev->watchdog_timeo = SIS190_TX_TIMEOUT;
spin_lock_init(&tp->lock);
rc = sis190_mii_probe(dev);
if (rc < 0)
goto err_release_board;
rc = register_netdev(dev);
if (rc < 0)
goto err_remove_mii;
if (netif_msg_probe(tp)) {
netdev_info(dev, "%s: %s at %p (IRQ: %d), %pM\n",
pci_name(pdev),
sis_chip_info[ent->driver_data].name,
ioaddr, pdev->irq, dev->dev_addr);
netdev_info(dev, "%s mode.\n",
(tp->features & F_HAS_RGMII) ? "RGMII" : "GMII");
}
netif_carrier_off(dev);
sis190_set_speed_auto(dev);
out:
return rc;
err_remove_mii:
sis190_mii_remove(dev);
err_release_board:
sis190_release_board(pdev);
goto out;
}
static void sis190_remove_one(struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata(pdev);
struct sis190_private *tp = netdev_priv(dev);
Annotation
- Immediate include surface: `linux/interrupt.h`, `linux/module.h`, `linux/moduleparam.h`, `linux/netdevice.h`, `linux/rtnetlink.h`, `linux/etherdevice.h`, `linux/ethtool.h`, `linux/pci.h`.
- Detected declarations: `struct TxDesc`, `struct RxDesc`, `struct sis190_private`, `struct sis190_phy`, `enum sis190_registers`, `enum sis190_register_content`, `enum _DescStatusBit`, `enum sis190_eeprom_access_register_bits`, `enum sis190_eeprom_address`, `enum sis190_feature`.
- 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.