drivers/net/ethernet/jme.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/jme.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/jme.c- Extension
.c- Size
- 74749 bytes
- Lines
- 3280
- 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/module.hlinux/kernel.hlinux/pci.hlinux/netdevice.hlinux/etherdevice.hlinux/ethtool.hlinux/mii.hlinux/crc32.hlinux/delay.hlinux/spinlock.hlinux/in.hlinux/ip.hlinux/ipv6.hlinux/tcp.hlinux/udp.hlinux/if_vlan.hlinux/slab.hlinux/jiffies.hnet/ip6_checksum.hjme.h
Detected Declarations
function jme_mdio_readfunction jme_mdio_writefunction jme_reset_phy_processorfunction jme_setup_wakeup_framefunction jme_mac_rxclk_offfunction jme_mac_rxclk_onfunction jme_mac_txclk_offfunction jme_mac_txclk_onfunction jme_reset_ghc_speedfunction jme_reset_250A2_workaroundfunction jme_assert_ghc_resetfunction jme_clear_ghc_resetfunction jme_reset_mac_processorfunction jme_clear_pm_enable_wolfunction jme_clear_pm_disable_wolfunction jme_reload_eepromfunction jme_load_macaddrfunction jme_set_rx_pccfunction jme_start_irqfunction jme_stop_irqfunction jme_linkstat_from_phyfunction jme_set_phyfifo_5levelfunction jme_set_phyfifo_8levelfunction jme_check_linkfunction jme_reset_mac_processorfunction jme_setup_tx_resourcesfunction jme_free_tx_resourcesfunction jme_enable_tx_enginefunction jme_disable_tx_enginefunction jme_set_clean_rxdescfunction jme_make_new_rx_buffunction jme_free_rx_buffunction jme_free_rx_resourcesfunction jme_setup_rx_resourcesfunction jme_enable_rx_enginefunction jme_restart_rx_enginefunction jme_disable_rx_enginefunction jme_udpsumfunction jme_rxsum_okfunction jme_alloc_and_feed_skbfunction jme_process_receivefunction jme_attempt_pccfunction jme_dynamic_pccfunction jme_start_pcc_timerfunction jme_stop_pcc_timerfunction jme_shutdown_nicfunction jme_pcc_taskletfunction jme_polling_mode
Annotated Snippet
static const struct net_device_ops jme_netdev_ops = {
.ndo_open = jme_open,
.ndo_stop = jme_close,
.ndo_validate_addr = eth_validate_addr,
.ndo_eth_ioctl = jme_ioctl,
.ndo_start_xmit = jme_start_xmit,
.ndo_set_mac_address = jme_set_macaddr,
.ndo_set_rx_mode = jme_set_multi,
.ndo_change_mtu = jme_change_mtu,
.ndo_tx_timeout = jme_tx_timeout,
.ndo_fix_features = jme_fix_features,
.ndo_set_features = jme_set_features,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = jme_netpoll,
#endif
};
static int
jme_init_one(struct pci_dev *pdev,
const struct pci_device_id *ent)
{
int rc = 0, using_dac, i;
struct net_device *netdev;
struct jme_adapter *jme;
u16 bmcr, bmsr;
u32 apmc;
/*
* set up PCI device basics
*/
pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
PCIE_LINK_STATE_CLKPM);
rc = pci_enable_device(pdev);
if (rc) {
pr_err("Cannot enable PCI device\n");
goto err_out;
}
using_dac = jme_pci_dma64(pdev);
if (using_dac < 0) {
pr_err("Cannot set PCI DMA Mask\n");
rc = -EIO;
goto err_out_disable_pdev;
}
if (!(pci_resource_flags(pdev, 0) & IORESOURCE_MEM)) {
pr_err("No PCI resource region found\n");
rc = -ENOMEM;
goto err_out_disable_pdev;
}
rc = pci_request_regions(pdev, DRV_NAME);
if (rc) {
pr_err("Cannot obtain PCI resource region\n");
goto err_out_disable_pdev;
}
pci_set_master(pdev);
/*
* alloc and init net device
*/
netdev = alloc_etherdev(sizeof(*jme));
if (!netdev) {
rc = -ENOMEM;
goto err_out_release_regions;
}
netdev->netdev_ops = &jme_netdev_ops;
netdev->ethtool_ops = &jme_ethtool_ops;
netdev->watchdog_timeo = TX_TIMEOUT;
netdev->hw_features = NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM |
NETIF_F_SG |
NETIF_F_TSO |
NETIF_F_TSO6 |
NETIF_F_RXCSUM;
netdev->features = NETIF_F_IP_CSUM |
NETIF_F_IPV6_CSUM |
NETIF_F_SG |
NETIF_F_TSO |
NETIF_F_TSO6 |
NETIF_F_HW_VLAN_CTAG_TX |
NETIF_F_HW_VLAN_CTAG_RX;
if (using_dac)
netdev->features |= NETIF_F_HIGHDMA;
/* MTU range: 1280 - 9202*/
netdev->min_mtu = IPV6_MIN_MTU;
netdev->max_mtu = MAX_ETHERNET_JUMBO_PACKET_SIZE - ETH_HLEN;
Annotation
- Immediate include surface: `linux/module.h`, `linux/kernel.h`, `linux/pci.h`, `linux/netdevice.h`, `linux/etherdevice.h`, `linux/ethtool.h`, `linux/mii.h`, `linux/crc32.h`.
- Detected declarations: `function jme_mdio_read`, `function jme_mdio_write`, `function jme_reset_phy_processor`, `function jme_setup_wakeup_frame`, `function jme_mac_rxclk_off`, `function jme_mac_rxclk_on`, `function jme_mac_txclk_off`, `function jme_mac_txclk_on`, `function jme_reset_ghc_speed`, `function jme_reset_250A2_workaround`.
- 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.