drivers/net/ethernet/ibm/ehea/ehea_main.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ibm/ehea/ehea_main.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ibm/ehea/ehea_main.c- Extension
.c- Size
- 85325 bytes
- Lines
- 3580
- 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/device.hlinux/in.hlinux/ip.hlinux/tcp.hlinux/udp.hlinux/if.hlinux/list.hlinux/slab.hlinux/if_ether.hlinux/notifier.hlinux/reboot.hlinux/memory.hasm/kexec.hlinux/mutex.hlinux/prefetch.hlinux/of.hlinux/of_device.hlinux/platform_device.hnet/ip.hehea.hehea_qmr.hehea_phyp.h
Detected Declarations
function ehea_dumpfunction ehea_schedule_port_resetfunction ehea_update_firmware_handlesfunction list_for_each_entryfunction list_for_each_entryfunction ehea_update_bcmc_registrationsfunction list_for_each_entryfunction list_for_each_entryfunction ehea_get_stats64function ehea_update_statsfunction ehea_refill_rq1function ehea_init_fill_rq1function ehea_refill_rq_deffunction ehea_refill_rq2function ehea_refill_rq3function ehea_check_cqefunction ehea_fill_skbfunction ehea_treat_poll_errorfunction ehea_proc_rwqesfunction reset_sq_restart_flagfunction check_sqsfunction ehea_pollfunction ehea_recv_irq_handlerfunction ehea_qp_aff_irq_handlerfunction ehea_sense_port_attrfunction ehea_set_portspeedfunction ehea_parse_eqefunction ehea_neq_taskletfunction ehea_interrupt_neqfunction ehea_fill_port_resfunction ehea_reg_interruptsfunction ehea_free_interruptsfunction ehea_configure_portfunction ehea_gen_smrsfunction ehea_rem_smrsfunction ehea_init_q_skbafunction ehea_init_port_resfunction ehea_clean_portresfunction write_swqe2_immediatefunction write_swqe2_datafunction ehea_broadcast_reg_helperfunction ehea_set_mac_addrfunction ehea_promiscuous_errorfunction ehea_promiscuousfunction ehea_multicast_reg_helperfunction ehea_drop_multicast_listfunction list_for_each_safefunction ehea_allmulti
Annotated Snippet
static const struct net_device_ops ehea_netdev_ops = {
.ndo_open = ehea_open,
.ndo_stop = ehea_stop,
.ndo_start_xmit = ehea_start_xmit,
.ndo_get_stats64 = ehea_get_stats64,
.ndo_set_mac_address = ehea_set_mac_addr,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_rx_mode = ehea_set_multicast_list,
.ndo_vlan_rx_add_vid = ehea_vlan_rx_add_vid,
.ndo_vlan_rx_kill_vid = ehea_vlan_rx_kill_vid,
.ndo_tx_timeout = ehea_tx_watchdog,
};
static struct ehea_port *ehea_setup_single_port(struct ehea_adapter *adapter,
u32 logical_port_id,
struct device_node *dn)
{
int ret;
struct net_device *dev;
struct ehea_port *port;
struct device *port_dev;
int jumbo;
/* allocate memory for the port structures */
dev = alloc_etherdev_mq(sizeof(struct ehea_port), EHEA_MAX_PORT_RES);
if (!dev) {
ret = -ENOMEM;
goto out_err;
}
port = netdev_priv(dev);
mutex_init(&port->port_lock);
port->state = EHEA_PORT_DOWN;
port->sig_comp_iv = sq_entries / 10;
port->adapter = adapter;
port->netdev = dev;
port->logical_port_id = logical_port_id;
port->msg_enable = netif_msg_init(msg_level, EHEA_MSG_DEFAULT);
port->mc_list = kzalloc_obj(struct ehea_mc_list);
if (!port->mc_list) {
ret = -ENOMEM;
goto out_free_ethdev;
}
INIT_LIST_HEAD(&port->mc_list->list);
ret = ehea_sense_port_attr(port);
if (ret)
goto out_free_mc_list;
netif_set_real_num_rx_queues(dev, port->num_def_qps);
netif_set_real_num_tx_queues(dev, port->num_def_qps);
port_dev = ehea_register_port(port, dn);
if (!port_dev)
goto out_free_mc_list;
SET_NETDEV_DEV(dev, port_dev);
/* initialize net_device structure */
eth_hw_addr_set(dev, (u8 *)&port->mac_addr);
dev->netdev_ops = &ehea_netdev_ops;
ehea_set_ethtool_ops(dev);
dev->hw_features = NETIF_F_SG | NETIF_F_TSO |
NETIF_F_IP_CSUM | NETIF_F_HW_VLAN_CTAG_TX;
dev->features = NETIF_F_SG | NETIF_F_TSO |
NETIF_F_HIGHDMA | NETIF_F_IP_CSUM |
NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX |
NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_RXCSUM;
dev->vlan_features = NETIF_F_SG | NETIF_F_TSO | NETIF_F_HIGHDMA |
NETIF_F_IP_CSUM;
dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
/* MTU range: 68 - 9022 */
dev->min_mtu = ETH_MIN_MTU;
dev->max_mtu = EHEA_MAX_PACKET_SIZE;
INIT_WORK(&port->reset_task, ehea_reset_port);
INIT_DELAYED_WORK(&port->stats_work, ehea_update_stats);
init_waitqueue_head(&port->swqe_avail_wq);
init_waitqueue_head(&port->restart_wq);
Annotation
- Immediate include surface: `linux/device.h`, `linux/in.h`, `linux/ip.h`, `linux/tcp.h`, `linux/udp.h`, `linux/if.h`, `linux/list.h`, `linux/slab.h`.
- Detected declarations: `function ehea_dump`, `function ehea_schedule_port_reset`, `function ehea_update_firmware_handles`, `function list_for_each_entry`, `function list_for_each_entry`, `function ehea_update_bcmc_registrations`, `function list_for_each_entry`, `function list_for_each_entry`, `function ehea_get_stats64`, `function ehea_update_stats`.
- 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.