#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/tcp.h>
#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/clk.h>
#include <linux/if_ether.h>
#include <linux/net_tstamp.h>
#include <linux/phy.h>
#include <net/vxlan.h>
#include "xgbe.h"
#include "xgbe-common.h"
static unsigned int ecc_sec_info_threshold = …;
static unsigned int ecc_sec_warn_threshold = …;
static unsigned int ecc_sec_period = …;
static unsigned int ecc_ded_threshold = …;
static unsigned int ecc_ded_period = …;
#ifdef CONFIG_AMD_XGBE_HAVE_ECC
module_param(ecc_sec_info_threshold, uint, 0644);
MODULE_PARM_DESC(…) …;
module_param(ecc_sec_warn_threshold, uint, 0644);
MODULE_PARM_DESC(…) …;
module_param(ecc_sec_period, uint, 0644);
MODULE_PARM_DESC(…) …;
module_param(ecc_ded_threshold, uint, 0644);
MODULE_PARM_DESC(…) …;
module_param(ecc_ded_period, uint, 0644);
MODULE_PARM_DESC(…) …;
#endif
static int xgbe_one_poll(struct napi_struct *, int);
static int xgbe_all_poll(struct napi_struct *, int);
static void xgbe_stop(struct xgbe_prv_data *);
static void *xgbe_alloc_node(size_t size, int node)
{ … }
static void xgbe_free_channels(struct xgbe_prv_data *pdata)
{ … }
static int xgbe_alloc_channels(struct xgbe_prv_data *pdata)
{ … }
static inline unsigned int xgbe_tx_avail_desc(struct xgbe_ring *ring)
{ … }
static inline unsigned int xgbe_rx_dirty_desc(struct xgbe_ring *ring)
{ … }
static int xgbe_maybe_stop_tx_queue(struct xgbe_channel *channel,
struct xgbe_ring *ring, unsigned int count)
{ … }
static int xgbe_calc_rx_buf_size(struct net_device *netdev, unsigned int mtu)
{ … }
static void xgbe_enable_rx_tx_int(struct xgbe_prv_data *pdata,
struct xgbe_channel *channel)
{ … }
static void xgbe_enable_rx_tx_ints(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_disable_rx_tx_int(struct xgbe_prv_data *pdata,
struct xgbe_channel *channel)
{ … }
static void xgbe_disable_rx_tx_ints(struct xgbe_prv_data *pdata)
{ … }
static bool xgbe_ecc_sec(struct xgbe_prv_data *pdata, unsigned long *period,
unsigned int *count, const char *area)
{ … }
static bool xgbe_ecc_ded(struct xgbe_prv_data *pdata, unsigned long *period,
unsigned int *count, const char *area)
{ … }
static void xgbe_ecc_isr_bh_work(struct work_struct *work)
{ … }
static irqreturn_t xgbe_ecc_isr(int irq, void *data)
{ … }
static void xgbe_isr_bh_work(struct work_struct *work)
{ … }
static irqreturn_t xgbe_isr(int irq, void *data)
{ … }
static irqreturn_t xgbe_dma_isr(int irq, void *data)
{ … }
static void xgbe_tx_timer(struct timer_list *t)
{ … }
static void xgbe_service(struct work_struct *work)
{ … }
static void xgbe_service_timer(struct timer_list *t)
{ … }
static void xgbe_init_timers(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_start_timers(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_stop_timers(struct xgbe_prv_data *pdata)
{ … }
void xgbe_get_all_hw_features(struct xgbe_prv_data *pdata)
{ … }
static int xgbe_vxlan_set_port(struct net_device *netdev, unsigned int table,
unsigned int entry, struct udp_tunnel_info *ti)
{ … }
static int xgbe_vxlan_unset_port(struct net_device *netdev, unsigned int table,
unsigned int entry, struct udp_tunnel_info *ti)
{ … }
static const struct udp_tunnel_nic_info xgbe_udp_tunnels = …;
const struct udp_tunnel_nic_info *xgbe_get_udp_tunnel_info(void)
{ … }
static void xgbe_napi_enable(struct xgbe_prv_data *pdata, unsigned int add)
{ … }
static void xgbe_napi_disable(struct xgbe_prv_data *pdata, unsigned int del)
{ … }
static int xgbe_request_irqs(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_free_irqs(struct xgbe_prv_data *pdata)
{ … }
void xgbe_init_tx_coalesce(struct xgbe_prv_data *pdata)
{ … }
void xgbe_init_rx_coalesce(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_free_tx_data(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_free_rx_data(struct xgbe_prv_data *pdata)
{ … }
static int xgbe_phy_reset(struct xgbe_prv_data *pdata)
{ … }
int xgbe_powerdown(struct net_device *netdev, unsigned int caller)
{ … }
int xgbe_powerup(struct net_device *netdev, unsigned int caller)
{ … }
static void xgbe_free_memory(struct xgbe_prv_data *pdata)
{ … }
static int xgbe_alloc_memory(struct xgbe_prv_data *pdata)
{ … }
static int xgbe_start(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_stop(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_stopdev(struct work_struct *work)
{ … }
void xgbe_full_restart_dev(struct xgbe_prv_data *pdata)
{ … }
void xgbe_restart_dev(struct xgbe_prv_data *pdata)
{ … }
static void xgbe_restart(struct work_struct *work)
{ … }
static void xgbe_tx_tstamp(struct work_struct *work)
{ … }
static int xgbe_get_hwtstamp_settings(struct xgbe_prv_data *pdata,
struct ifreq *ifreq)
{ … }
static int xgbe_set_hwtstamp_settings(struct xgbe_prv_data *pdata,
struct ifreq *ifreq)
{ … }
static void xgbe_prep_tx_tstamp(struct xgbe_prv_data *pdata,
struct sk_buff *skb,
struct xgbe_packet_data *packet)
{ … }
static void xgbe_prep_vlan(struct sk_buff *skb, struct xgbe_packet_data *packet)
{ … }
static int xgbe_prep_tso(struct sk_buff *skb, struct xgbe_packet_data *packet)
{ … }
static bool xgbe_is_vxlan(struct sk_buff *skb)
{ … }
static int xgbe_is_tso(struct sk_buff *skb)
{ … }
static void xgbe_packet_info(struct xgbe_prv_data *pdata,
struct xgbe_ring *ring, struct sk_buff *skb,
struct xgbe_packet_data *packet)
{ … }
static int xgbe_open(struct net_device *netdev)
{ … }
static int xgbe_close(struct net_device *netdev)
{ … }
static netdev_tx_t xgbe_xmit(struct sk_buff *skb, struct net_device *netdev)
{ … }
static void xgbe_set_rx_mode(struct net_device *netdev)
{ … }
static int xgbe_set_mac_address(struct net_device *netdev, void *addr)
{ … }
static int xgbe_ioctl(struct net_device *netdev, struct ifreq *ifreq, int cmd)
{ … }
static int xgbe_change_mtu(struct net_device *netdev, int mtu)
{ … }
static void xgbe_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{ … }
static void xgbe_get_stats64(struct net_device *netdev,
struct rtnl_link_stats64 *s)
{ … }
static int xgbe_vlan_rx_add_vid(struct net_device *netdev, __be16 proto,
u16 vid)
{ … }
static int xgbe_vlan_rx_kill_vid(struct net_device *netdev, __be16 proto,
u16 vid)
{ … }
#ifdef CONFIG_NET_POLL_CONTROLLER
static void xgbe_poll_controller(struct net_device *netdev)
{ … }
#endif
static int xgbe_setup_tc(struct net_device *netdev, enum tc_setup_type type,
void *type_data)
{ … }
static netdev_features_t xgbe_fix_features(struct net_device *netdev,
netdev_features_t features)
{ … }
static int xgbe_set_features(struct net_device *netdev,
netdev_features_t features)
{ … }
static netdev_features_t xgbe_features_check(struct sk_buff *skb,
struct net_device *netdev,
netdev_features_t features)
{ … }
static const struct net_device_ops xgbe_netdev_ops = …;
const struct net_device_ops *xgbe_get_netdev_ops(void)
{ … }
static void xgbe_rx_refresh(struct xgbe_channel *channel)
{ … }
static struct sk_buff *xgbe_create_skb(struct xgbe_prv_data *pdata,
struct napi_struct *napi,
struct xgbe_ring_data *rdata,
unsigned int len)
{ … }
static unsigned int xgbe_rx_buf1_len(struct xgbe_ring_data *rdata,
struct xgbe_packet_data *packet)
{ … }
static unsigned int xgbe_rx_buf2_len(struct xgbe_ring_data *rdata,
struct xgbe_packet_data *packet,
unsigned int len)
{ … }
static int xgbe_tx_poll(struct xgbe_channel *channel)
{ … }
static int xgbe_rx_poll(struct xgbe_channel *channel, int budget)
{ … }
static int xgbe_one_poll(struct napi_struct *napi, int budget)
{ … }
static int xgbe_all_poll(struct napi_struct *napi, int budget)
{ … }
void xgbe_dump_tx_desc(struct xgbe_prv_data *pdata, struct xgbe_ring *ring,
unsigned int idx, unsigned int count, unsigned int flag)
{ … }
void xgbe_dump_rx_desc(struct xgbe_prv_data *pdata, struct xgbe_ring *ring,
unsigned int idx)
{ … }
void xgbe_print_pkt(struct net_device *netdev, struct sk_buff *skb, bool tx_rx)
{ … }