drivers/net/ethernet/amd/xgbe/xgbe.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/amd/xgbe/xgbe.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/amd/xgbe/xgbe.h
Extension
.h
Size
39134 bytes
Lines
1386
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.

Dependency Surface

Detected Declarations

Annotated Snippet

const struct net_device_ops *xgbe_get_netdev_ops(void);
const struct ethtool_ops *xgbe_get_ethtool_ops(void);
const struct udp_tunnel_nic_info *xgbe_get_udp_tunnel_info(void);

#ifdef CONFIG_AMD_XGBE_DCB
const struct dcbnl_rtnl_ops *xgbe_get_dcbnl_ops(void);
#endif

void xgbe_ptp_register(struct xgbe_prv_data *);
void xgbe_ptp_unregister(struct xgbe_prv_data *);
void xgbe_dump_tx_desc(struct xgbe_prv_data *, struct xgbe_ring *,
		       unsigned int, unsigned int, unsigned int);
void xgbe_dump_rx_desc(struct xgbe_prv_data *, struct xgbe_ring *,
		       unsigned int);
void xgbe_print_pkt(struct net_device *, struct sk_buff *, bool);
void xgbe_get_all_hw_features(struct xgbe_prv_data *);
int xgbe_powerup(struct net_device *netdev);
int xgbe_powerdown(struct net_device *netdev);
void xgbe_init_rx_coalesce(struct xgbe_prv_data *);
void xgbe_init_tx_coalesce(struct xgbe_prv_data *);
void xgbe_restart_dev(struct xgbe_prv_data *pdata);
void xgbe_full_restart_dev(struct xgbe_prv_data *pdata);

/* For Timestamp config */
void xgbe_config_tstamp(struct xgbe_prv_data *pdata, unsigned int mac_tscr);
u64 xgbe_get_tstamp_time(struct xgbe_prv_data *pdata);
u64 xgbe_get_tx_tstamp(struct xgbe_prv_data *pdata);
void xgbe_get_rx_tstamp(struct xgbe_packet_data *packet,
			struct xgbe_ring_desc *rdesc);
void xgbe_get_rx_tstamp(struct xgbe_packet_data *packet,
			struct xgbe_ring_desc *rdesc);
void xgbe_update_tstamp_addend(struct xgbe_prv_data *pdata,
			       unsigned int addend);
void xgbe_set_tstamp_time(struct xgbe_prv_data *pdata, unsigned int sec,
			  unsigned int nsec);
void xgbe_tx_tstamp(struct work_struct *work);
int xgbe_get_hwtstamp_settings(struct net_device *netdev,
			       struct kernel_hwtstamp_config *config);
int xgbe_set_hwtstamp_settings(struct net_device *netdev,
			       struct kernel_hwtstamp_config *config,
			       struct netlink_ext_ack *extack);
void xgbe_prep_tx_tstamp(struct xgbe_prv_data *pdata,
			 struct sk_buff *skb,
			 struct xgbe_packet_data *packet);
int xgbe_init_ptp(struct xgbe_prv_data *pdata);
void xgbe_update_tstamp_time(struct xgbe_prv_data *pdata, unsigned int sec,
			     unsigned int nsec);

int xgbe_pps_config(struct xgbe_prv_data *pdata, struct xgbe_pps_config *cfg,
		    int index, bool on);

/* Selftest functions */
void xgbe_selftest_run(struct net_device *dev,
		       struct ethtool_test *etest, u64 *buf);
void xgbe_selftest_get_strings(struct xgbe_prv_data *pdata, u8 *data);
int xgbe_selftest_get_count(struct xgbe_prv_data *pdata);

/* Loopback control */
int xgbe_enable_mac_loopback(struct xgbe_prv_data *pdata);
void xgbe_disable_mac_loopback(struct xgbe_prv_data *pdata);

#ifdef CONFIG_DEBUG_FS
void xgbe_debugfs_init(struct xgbe_prv_data *);
void xgbe_debugfs_exit(struct xgbe_prv_data *);
void xgbe_debugfs_rename(struct xgbe_prv_data *pdata);
#else
static inline void xgbe_debugfs_init(struct xgbe_prv_data *pdata) {}
static inline void xgbe_debugfs_exit(struct xgbe_prv_data *pdata) {}
static inline void xgbe_debugfs_rename(struct xgbe_prv_data *pdata) {}
#endif /* CONFIG_DEBUG_FS */

/* NOTE: Uncomment for function trace log messages in KERNEL LOG */
#if 0
#define YDEBUG
#define YDEBUG_MDIO
#endif

/* For debug prints */
#ifdef YDEBUG
#define DBGPR(x...) pr_alert(x)
#else
#define DBGPR(x...) do { } while (0)
#endif

#ifdef YDEBUG_MDIO
#define DBGPR_MDIO(x...) pr_alert(x)
#else
#define DBGPR_MDIO(x...) do { } while (0)
#endif

Annotation

Implementation Notes