drivers/net/ethernet/sfc/ef10.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sfc/ef10.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sfc/ef10.c- Extension
.c- Size
- 136082 bytes
- Lines
- 4435
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: implementation source
- Status
- source 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.
- 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
net_driver.hrx_common.htx_common.hef10_regs.hio.hmcdi.hmcdi_pcol.hmcdi_port.hmcdi_port_common.hmcdi_functions.hnic.hmcdi_filters.hworkarounds.hselftest.hef10_sriov.hlinux/in.hlinux/jhash.hlinux/wait.hlinux/workqueue.hnet/udp_tunnel.h
Detected Declarations
struct efx_ef10_vlanstruct efx_ef10_nvram_type_infofunction efx_ef10_get_warm_boot_countfunction efx_ef10_pf_mem_barfunction efx_ef10_vf_mem_barfunction efx_ef10_mem_map_sizefunction efx_ef10_is_vffunction efx_ef10_get_vf_indexfunction efx_ef10_init_datapath_capsfunction efx_ef10_read_licensed_featuresfunction efx_ef10_get_sysclk_freqfunction efx_ef10_get_timer_workaroundsfunction efx_ef10_process_timer_configfunction efx_ef10_get_timer_configfunction efx_ef10_get_mac_address_pffunction efx_ef10_get_mac_address_vffunction link_control_flag_showfunction primary_flag_showfunction list_for_each_entryfunction efx_ef10_add_vlanfunction efx_ef10_del_vlan_internalfunction efx_ef10_del_vlanfunction efx_ef10_cleanup_vlansfunction efx_ef10_probefunction efx_ef10_free_piobufsfunction efx_ef10_alloc_piobufsfunction efx_ef10_link_piobufsfunction efx_for_each_channel_tx_queuefunction efx_ef10_forget_old_piobufsfunction efx_ef10_alloc_piobufsfunction efx_ef10_link_piobufsfunction efx_ef10_free_piobufsfunction efx_ef10_probe_pffunction efx_ef10_vadaptor_queryfunction efx_ef10_vadaptor_allocfunction efx_ef10_vadaptor_freefunction efx_ef10_vport_add_macfunction efx_ef10_vport_del_macfunction efx_ef10_probe_vffunction efx_ef10_probe_vffunction efx_ef10_alloc_visfunction efx_ef10_dimension_resourcesfunction efx_ef10_fini_nicfunction efx_ef10_init_nicfunction efx_ef10_table_reset_mc_allocationsfunction efx_ef10_map_reset_reasonfunction efx_ef10_map_reset_flagsfunction efx_ef10_reset
Annotated Snippet
struct efx_ef10_vlan {
struct list_head list;
u16 vid;
};
static int efx_ef10_set_udp_tnl_ports(struct efx_nic *efx, bool unloading);
static const struct udp_tunnel_nic_info efx_ef10_udp_tunnels;
static int efx_ef10_get_warm_boot_count(struct efx_nic *efx)
{
efx_dword_t reg;
efx_readd(efx, ®, ER_DZ_BIU_MC_SFT_STATUS);
return EFX_DWORD_FIELD(reg, EFX_WORD_1) == 0xb007 ?
EFX_DWORD_FIELD(reg, EFX_WORD_0) : -EIO;
}
/* On all EF10s up to and including SFC9220 (Medford1), all PFs use BAR 0 for
* I/O space and BAR 2(&3) for memory. On SFC9250 (Medford2), there is no I/O
* bar; PFs use BAR 0/1 for memory.
*/
static unsigned int efx_ef10_pf_mem_bar(struct efx_nic *efx)
{
switch (efx->pci_dev->device) {
case 0x0b03: /* SFC9250 PF */
return 0;
default:
return 2;
}
}
/* All VFs use BAR 0/1 for memory */
static unsigned int efx_ef10_vf_mem_bar(struct efx_nic *efx)
{
return 0;
}
static unsigned int efx_ef10_mem_map_size(struct efx_nic *efx)
{
int bar;
bar = efx->type->mem_bar(efx);
return resource_size(&efx->pci_dev->resource[bar]);
}
static bool efx_ef10_is_vf(struct efx_nic *efx)
{
return efx->type->is_vf;
}
#ifdef CONFIG_SFC_SRIOV
static int efx_ef10_get_vf_index(struct efx_nic *efx)
{
MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_FUNCTION_INFO_OUT_LEN);
struct efx_ef10_nic_data *nic_data = efx->nic_data;
size_t outlen;
int rc;
rc = efx_mcdi_rpc(efx, MC_CMD_GET_FUNCTION_INFO, NULL, 0, outbuf,
sizeof(outbuf), &outlen);
if (rc)
return rc;
if (outlen < sizeof(outbuf))
return -EIO;
nic_data->vf_index = MCDI_DWORD(outbuf, GET_FUNCTION_INFO_OUT_VF);
return 0;
}
#endif
static int efx_ef10_init_datapath_caps(struct efx_nic *efx)
{
MCDI_DECLARE_BUF(outbuf, MC_CMD_GET_CAPABILITIES_V4_OUT_LEN);
struct efx_ef10_nic_data *nic_data = efx->nic_data;
size_t outlen;
int rc;
BUILD_BUG_ON(MC_CMD_GET_CAPABILITIES_IN_LEN != 0);
rc = efx_mcdi_rpc(efx, MC_CMD_GET_CAPABILITIES, NULL, 0,
outbuf, sizeof(outbuf), &outlen);
if (rc)
return rc;
if (outlen < MC_CMD_GET_CAPABILITIES_OUT_LEN) {
netif_err(efx, drv, efx->net_dev,
"unable to read datapath firmware capabilities\n");
return -EIO;
}
nic_data->datapath_caps =
Annotation
- Immediate include surface: `net_driver.h`, `rx_common.h`, `tx_common.h`, `ef10_regs.h`, `io.h`, `mcdi.h`, `mcdi_pcol.h`, `mcdi_port.h`.
- Detected declarations: `struct efx_ef10_vlan`, `struct efx_ef10_nvram_type_info`, `function efx_ef10_get_warm_boot_count`, `function efx_ef10_pf_mem_bar`, `function efx_ef10_vf_mem_bar`, `function efx_ef10_mem_map_size`, `function efx_ef10_is_vf`, `function efx_ef10_get_vf_index`, `function efx_ef10_init_datapath_caps`, `function efx_ef10_read_licensed_features`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.