drivers/net/ethernet/sfc/siena/siena.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sfc/siena/siena.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sfc/siena/siena.c- Extension
.c- Size
- 34309 bytes
- Lines
- 1114
- 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.
- 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/bitops.hlinux/delay.hlinux/pci.hlinux/module.hlinux/slab.hlinux/random.hnet_driver.hbitfield.hefx.hefx_common.hnic.hfarch_regs.hio.hworkarounds.hmcdi.hmcdi_pcol.hmcdi_port.hmcdi_port_common.hselftest.hsiena_sriov.hrx_common.h
Detected Declarations
struct siena_nvram_type_infofunction siena_push_irq_moderationfunction efx_siena_prepare_flushfunction siena_finish_flushfunction siena_test_chipfunction siena_ptp_write_host_timefunction siena_ptp_set_ts_configfunction siena_map_reset_flagsfunction readfunction siena_probe_nvconfigfunction siena_dimension_resourcesfunction siena_mem_barfunction siena_mem_map_sizefunction siena_probe_nicfunction siena_rx_pull_rss_configfunction siena_rx_push_rss_configfunction siena_init_nicfunction siena_remove_nicfunction siena_describe_nic_statsfunction siena_try_update_nic_statsfunction siena_update_nic_statsfunction siena_mac_reconfigurefunction siena_get_wolfunction siena_set_wolfunction siena_init_wolfunction siena_mcdi_requestfunction siena_mcdi_poll_responsefunction siena_mcdi_read_responsefunction siena_mcdi_poll_rebootfunction siena_mtd_probe_partitionfunction siena_mtd_get_fw_subtypesfunction siena_mtd_probefunction siena_check_capsfunction efx_siena_recycle_ring_size
Annotated Snippet
struct siena_nvram_type_info {
int port;
const char *name;
};
static const struct siena_nvram_type_info siena_nvram_types[] = {
[MC_CMD_NVRAM_TYPE_DISABLED_CALLISTO] = { 0, "sfc_dummy_phy" },
[MC_CMD_NVRAM_TYPE_MC_FW] = { 0, "sfc_mcfw" },
[MC_CMD_NVRAM_TYPE_MC_FW_BACKUP] = { 0, "sfc_mcfw_backup" },
[MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT0] = { 0, "sfc_static_cfg" },
[MC_CMD_NVRAM_TYPE_STATIC_CFG_PORT1] = { 1, "sfc_static_cfg" },
[MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT0] = { 0, "sfc_dynamic_cfg" },
[MC_CMD_NVRAM_TYPE_DYNAMIC_CFG_PORT1] = { 1, "sfc_dynamic_cfg" },
[MC_CMD_NVRAM_TYPE_EXP_ROM] = { 0, "sfc_exp_rom" },
[MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT0] = { 0, "sfc_exp_rom_cfg" },
[MC_CMD_NVRAM_TYPE_EXP_ROM_CFG_PORT1] = { 1, "sfc_exp_rom_cfg" },
[MC_CMD_NVRAM_TYPE_PHY_PORT0] = { 0, "sfc_phy_fw" },
[MC_CMD_NVRAM_TYPE_PHY_PORT1] = { 1, "sfc_phy_fw" },
[MC_CMD_NVRAM_TYPE_FPGA] = { 0, "sfc_fpga" },
};
static int siena_mtd_probe_partition(struct efx_nic *efx,
struct efx_mcdi_mtd_partition *part,
unsigned int type)
{
const struct siena_nvram_type_info *info;
size_t size, erase_size;
bool protected;
int rc;
if (type >= ARRAY_SIZE(siena_nvram_types) ||
siena_nvram_types[type].name == NULL)
return -ENODEV;
info = &siena_nvram_types[type];
if (info->port != efx_port_num(efx))
return -ENODEV;
rc = efx_siena_mcdi_nvram_info(efx, type, &size, &erase_size,
&protected);
if (rc)
return rc;
if (protected)
return -ENODEV; /* hide it */
part->nvram_type = type;
part->common.dev_type_name = "Siena NVRAM manager";
part->common.type_name = info->name;
part->common.mtd.type = MTD_NORFLASH;
part->common.mtd.flags = MTD_CAP_NORFLASH;
part->common.mtd.size = size;
part->common.mtd.erasesize = erase_size;
return 0;
}
static int siena_mtd_get_fw_subtypes(struct efx_nic *efx,
struct efx_mcdi_mtd_partition *parts,
size_t n_parts)
{
uint16_t fw_subtype_list[
MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MAXNUM];
size_t i;
int rc;
rc = efx_siena_mcdi_get_board_cfg(efx, NULL, fw_subtype_list, NULL);
if (rc)
return rc;
for (i = 0; i < n_parts; i++)
parts[i].fw_subtype = fw_subtype_list[parts[i].nvram_type];
return 0;
}
static int siena_mtd_probe(struct efx_nic *efx)
{
struct efx_mcdi_mtd_partition *parts;
u32 nvram_types;
unsigned int type;
size_t n_parts;
int rc;
ASSERT_RTNL();
rc = efx_siena_mcdi_nvram_types(efx, &nvram_types);
if (rc)
return rc;
Annotation
- Immediate include surface: `linux/bitops.h`, `linux/delay.h`, `linux/pci.h`, `linux/module.h`, `linux/slab.h`, `linux/random.h`, `net_driver.h`, `bitfield.h`.
- Detected declarations: `struct siena_nvram_type_info`, `function siena_push_irq_moderation`, `function efx_siena_prepare_flush`, `function siena_finish_flush`, `function siena_test_chip`, `function siena_ptp_write_host_time`, `function siena_ptp_set_ts_config`, `function siena_map_reset_flags`, `function read`, `function siena_probe_nvconfig`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.