drivers/net/ethernet/amd/xgbe/xgbe-dev.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/amd/xgbe/xgbe-dev.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/amd/xgbe/xgbe-dev.c- Extension
.c- Size
- 99054 bytes
- Lines
- 3699
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/phy.hlinux/mdio.hlinux/clk.hlinux/bitrev.hlinux/crc32.hlinux/crc32poly.hlinux/pci.hxgbe.hxgbe-common.hxgbe-smn.h
Detected Declarations
function Copyrightfunction xgbe_usec_to_riwtfunction xgbe_riwt_to_usecfunction xgbe_config_pbl_valfunction xgbe_config_osp_modefunction xgbe_config_rsf_modefunction xgbe_config_tsf_modefunction xgbe_config_rx_thresholdfunction xgbe_config_tx_thresholdfunction xgbe_config_rx_coalescefunction xgbe_config_tx_coalescefunction xgbe_config_rx_buffer_sizefunction xgbe_config_tso_modefunction xgbe_config_sph_modefunction xgbe_disable_sph_modefunction xgbe_write_rss_regfunction xgbe_write_rss_hash_keyfunction xgbe_write_rss_lookup_tablefunction xgbe_set_rss_hash_keyfunction xgbe_set_rss_lookup_tablefunction xgbe_enable_rssfunction xgbe_disable_rssfunction xgbe_config_rssfunction xgbe_is_pfc_queuefunction xgbe_set_vxlan_idfunction xgbe_enable_vxlanfunction xgbe_disable_vxlanfunction xgbe_get_fc_queue_countfunction xgbe_disable_tx_flow_controlfunction xgbe_enable_tx_flow_controlfunction xgbe_disable_rx_flow_controlfunction xgbe_enable_rx_flow_controlfunction xgbe_config_tx_flow_controlfunction xgbe_config_rx_flow_controlfunction xgbe_config_flow_controlfunction xgbe_enable_dma_interruptsfunction xgbe_enable_mtl_interruptsfunction xgbe_enable_mac_interruptsfunction xgbe_enable_ecc_interruptsfunction xgbe_disable_ecc_dedfunction xgbe_disable_ecc_secfunction xgbe_set_speedfunction xgbe_enable_rx_vlan_strippingfunction xgbe_disable_rx_vlan_strippingfunction xgbe_enable_rx_vlan_filteringfunction xgbe_disable_rx_vlan_filteringfunction xgbe_vid_crc32_lefunction xgbe_update_vlan_hash_table
Annotated Snippet
if (pdata->rx_rfd[i]) {
/* Flow control thresholds are established */
if (pfc && ets) {
if (xgbe_is_pfc_queue(pdata, i))
ehfc = 1;
} else {
ehfc = 1;
}
}
XGMAC_MTL_IOWRITE_BITS(pdata, i, MTL_Q_RQOMR, EHFC, ehfc);
netif_dbg(pdata, drv, pdata->netdev,
"flow control %s for RXq%u\n",
ehfc ? "enabled" : "disabled", i);
}
/* Set MAC flow control */
q_count = xgbe_get_fc_queue_count(pdata);
reg = MAC_Q0TFCR;
for (i = 0; i < q_count; i++) {
reg_val = XGMAC_IOREAD(pdata, reg);
/* Enable transmit flow control */
XGMAC_SET_BITS(reg_val, MAC_Q0TFCR, TFE, 1);
/* Set pause time */
XGMAC_SET_BITS(reg_val, MAC_Q0TFCR, PT, 0xffff);
XGMAC_IOWRITE(pdata, reg, reg_val);
reg += MAC_QTFCR_INC;
}
return 0;
}
static int xgbe_disable_rx_flow_control(struct xgbe_prv_data *pdata)
{
XGMAC_IOWRITE_BITS(pdata, MAC_RFCR, RFE, 0);
return 0;
}
static int xgbe_enable_rx_flow_control(struct xgbe_prv_data *pdata)
{
XGMAC_IOWRITE_BITS(pdata, MAC_RFCR, RFE, 1);
return 0;
}
static int xgbe_config_tx_flow_control(struct xgbe_prv_data *pdata)
{
struct ieee_pfc *pfc = pdata->pfc;
if (pdata->tx_pause || (pfc && pfc->pfc_en))
xgbe_enable_tx_flow_control(pdata);
else
xgbe_disable_tx_flow_control(pdata);
return 0;
}
static int xgbe_config_rx_flow_control(struct xgbe_prv_data *pdata)
{
struct ieee_pfc *pfc = pdata->pfc;
if (pdata->rx_pause || (pfc && pfc->pfc_en))
xgbe_enable_rx_flow_control(pdata);
else
xgbe_disable_rx_flow_control(pdata);
return 0;
}
static void xgbe_config_flow_control(struct xgbe_prv_data *pdata)
{
struct ieee_pfc *pfc = pdata->pfc;
xgbe_config_tx_flow_control(pdata);
xgbe_config_rx_flow_control(pdata);
XGMAC_IOWRITE_BITS(pdata, MAC_RFCR, PFCE,
(pfc && pfc->pfc_en) ? 1 : 0);
}
static void xgbe_enable_dma_interrupts(struct xgbe_prv_data *pdata)
{
struct xgbe_channel *channel;
unsigned int i, ver;
Annotation
- Immediate include surface: `linux/phy.h`, `linux/mdio.h`, `linux/clk.h`, `linux/bitrev.h`, `linux/crc32.h`, `linux/crc32poly.h`, `linux/pci.h`, `xgbe.h`.
- Detected declarations: `function Copyright`, `function xgbe_usec_to_riwt`, `function xgbe_riwt_to_usec`, `function xgbe_config_pbl_val`, `function xgbe_config_osp_mode`, `function xgbe_config_rsf_mode`, `function xgbe_config_tsf_mode`, `function xgbe_config_rx_threshold`, `function xgbe_config_tx_threshold`, `function xgbe_config_rx_coalesce`.
- 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.
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.