drivers/net/ethernet/sfc/falcon/falcon_boards.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/sfc/falcon/falcon_boards.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/sfc/falcon/falcon_boards.c- Extension
.c- Size
- 21731 bytes
- Lines
- 762
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/rtnetlink.hnet_driver.hphy.hefx.hnic.hworkarounds.h
Detected Declarations
function ef4_poke_lm87function ef4_init_lm87function ef4_fini_lm87function ef4_check_lm87function ef4_init_lm87function ef4_fini_lm87function sfe4001_powerofffunction sfe4001_poweronfunction phy_flash_cfg_showfunction phy_flash_cfg_storefunction sfe4001_finifunction sfe4001_check_hwfunction sfe4001_initfunction sfe4002_init_phyfunction sfe4002_set_id_ledfunction sfe4002_check_hwfunction sfe4002_initfunction sfn4112f_init_phyfunction sfn4112f_set_id_ledfunction sfn4112f_check_hwfunction sfn4112f_initfunction sfe4003_set_id_ledfunction sfe4003_init_phyfunction sfe4003_check_hwfunction sfe4003_initfunction falcon_probe_board
Annotated Snippet
if (efx->phy_mode & PHY_MODE_SPECIAL) {
schedule_timeout_uninterruptible(HZ);
return 0;
}
for (j = 0; j < 10; ++j) {
msleep(100);
/* Check DSP has asserted AFE power line */
rc = i2c_smbus_read_byte_data(ioexp_client, P1_IN);
if (rc < 0)
goto fail_on;
if (rc & (1 << P1_AFE_PWD_LBN))
return 0;
}
}
netif_info(efx, hw, efx->net_dev, "timed out waiting for DSP boot\n");
rc = -ETIMEDOUT;
fail_on:
sfe4001_poweroff(efx);
return rc;
}
static ssize_t phy_flash_cfg_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct ef4_nic *efx = dev_get_drvdata(dev);
return sprintf(buf, "%d\n", !!(efx->phy_mode & PHY_MODE_SPECIAL));
}
static ssize_t phy_flash_cfg_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct ef4_nic *efx = dev_get_drvdata(dev);
enum ef4_phy_mode old_mode, new_mode;
int err;
rtnl_lock();
old_mode = efx->phy_mode;
if (count == 0 || *buf == '0')
new_mode = old_mode & ~PHY_MODE_SPECIAL;
else
new_mode = PHY_MODE_SPECIAL;
if (!((old_mode ^ new_mode) & PHY_MODE_SPECIAL)) {
err = 0;
} else if (efx->state != STATE_READY || netif_running(efx->net_dev)) {
err = -EBUSY;
} else {
/* Reset the PHY, reconfigure the MAC and enable/disable
* MAC stats accordingly. */
efx->phy_mode = new_mode;
if (new_mode & PHY_MODE_SPECIAL)
falcon_stop_nic_stats(efx);
err = sfe4001_poweron(efx);
if (!err)
err = ef4_reconfigure_port(efx);
if (!(new_mode & PHY_MODE_SPECIAL))
falcon_start_nic_stats(efx);
}
rtnl_unlock();
return err ? err : count;
}
static DEVICE_ATTR_RW(phy_flash_cfg);
static void sfe4001_fini(struct ef4_nic *efx)
{
struct falcon_board *board = falcon_board(efx);
netif_info(efx, drv, efx->net_dev, "%s\n", __func__);
device_remove_file(&efx->pci_dev->dev, &dev_attr_phy_flash_cfg);
sfe4001_poweroff(efx);
i2c_unregister_device(board->ioexp_client);
i2c_unregister_device(board->hwmon_client);
}
static int sfe4001_check_hw(struct ef4_nic *efx)
{
struct falcon_nic_data *nic_data = efx->nic_data;
s32 status;
/* If XAUI link is up then do not monitor */
if (EF4_WORKAROUND_7884(efx) && !nic_data->xmac_poll_required)
return 0;
/* Check the powered status of the PHY. Lack of power implies that
Annotation
- Immediate include surface: `linux/rtnetlink.h`, `net_driver.h`, `phy.h`, `efx.h`, `nic.h`, `workarounds.h`.
- Detected declarations: `function ef4_poke_lm87`, `function ef4_init_lm87`, `function ef4_fini_lm87`, `function ef4_check_lm87`, `function ef4_init_lm87`, `function ef4_fini_lm87`, `function sfe4001_poweroff`, `function sfe4001_poweron`, `function phy_flash_cfg_show`, `function phy_flash_cfg_store`.
- 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.