#include <linux/acpi.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/platform_device.h>
#include <linux/skbuff.h>
#include <linux/inetdevice.h>
#include <linux/mbus.h>
#include <linux/module.h>
#include <linux/mfd/syscon.h>
#include <linux/interrupt.h>
#include <linux/cpumask.h>
#include <linux/of.h>
#include <linux/of_irq.h>
#include <linux/of_mdio.h>
#include <linux/of_net.h>
#include <linux/of_address.h>
#include <linux/phy.h>
#include <linux/phylink.h>
#include <linux/phy/phy.h>
#include <linux/ptp_classify.h>
#include <linux/clk.h>
#include <linux/hrtimer.h>
#include <linux/ktime.h>
#include <linux/regmap.h>
#include <uapi/linux/ppp_defs.h>
#include <net/ip.h>
#include <net/ipv6.h>
#include <net/page_pool/helpers.h>
#include <net/tso.h>
#include <linux/bpf_trace.h>
#include "mvpp2.h"
#include "mvpp2_prs.h"
#include "mvpp2_cls.h"
enum mvpp2_bm_pool_log_num { … };
static struct { … } mvpp2_pools[MVPP2_BM_POOLS_NUM];
static void mvpp2_acpi_start(struct mvpp2_port *port);
#define MVPP2_QDIST_SINGLE_MODE …
#define MVPP2_QDIST_MULTI_MODE …
static int queue_mode = …;
module_param(queue_mode, int, 0444);
MODULE_PARM_DESC(…) …;
void mvpp2_write(struct mvpp2 *priv, u32 offset, u32 data)
{ … }
u32 mvpp2_read(struct mvpp2 *priv, u32 offset)
{ … }
static u32 mvpp2_read_relaxed(struct mvpp2 *priv, u32 offset)
{ … }
static inline u32 mvpp2_cpu_to_thread(struct mvpp2 *priv, int cpu)
{ … }
static void mvpp2_cm3_write(struct mvpp2 *priv, u32 offset, u32 data)
{ … }
static u32 mvpp2_cm3_read(struct mvpp2 *priv, u32 offset)
{ … }
static struct page_pool *
mvpp2_create_page_pool(struct device *dev, int num, int len,
enum dma_data_direction dma_dir)
{ … }
static void mvpp2_thread_write(struct mvpp2 *priv, unsigned int thread,
u32 offset, u32 data)
{ … }
static u32 mvpp2_thread_read(struct mvpp2 *priv, unsigned int thread,
u32 offset)
{ … }
static void mvpp2_thread_write_relaxed(struct mvpp2 *priv, unsigned int thread,
u32 offset, u32 data)
{ … }
static u32 mvpp2_thread_read_relaxed(struct mvpp2 *priv, unsigned int thread,
u32 offset)
{ … }
static dma_addr_t mvpp2_txdesc_dma_addr_get(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc)
{ … }
static void mvpp2_txdesc_dma_addr_set(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc,
dma_addr_t dma_addr)
{ … }
static size_t mvpp2_txdesc_size_get(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc)
{ … }
static void mvpp2_txdesc_size_set(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc,
size_t size)
{ … }
static void mvpp2_txdesc_txq_set(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc,
unsigned int txq)
{ … }
static void mvpp2_txdesc_cmd_set(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc,
unsigned int command)
{ … }
static unsigned int mvpp2_txdesc_offset_get(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc)
{ … }
static dma_addr_t mvpp2_rxdesc_dma_addr_get(struct mvpp2_port *port,
struct mvpp2_rx_desc *rx_desc)
{ … }
static unsigned long mvpp2_rxdesc_cookie_get(struct mvpp2_port *port,
struct mvpp2_rx_desc *rx_desc)
{ … }
static size_t mvpp2_rxdesc_size_get(struct mvpp2_port *port,
struct mvpp2_rx_desc *rx_desc)
{ … }
static u32 mvpp2_rxdesc_status_get(struct mvpp2_port *port,
struct mvpp2_rx_desc *rx_desc)
{ … }
static void mvpp2_txq_inc_get(struct mvpp2_txq_pcpu *txq_pcpu)
{ … }
static void mvpp2_txq_inc_put(struct mvpp2_port *port,
struct mvpp2_txq_pcpu *txq_pcpu,
void *data,
struct mvpp2_tx_desc *tx_desc,
enum mvpp2_tx_buf_type buf_type)
{ … }
static int mvpp2_get_nrxqs(struct mvpp2 *priv)
{ … }
static inline int mvpp2_egress_port(struct mvpp2_port *port)
{ … }
static inline int mvpp2_txq_phys(int port, int txq)
{ … }
static void *mvpp2_frag_alloc(const struct mvpp2_bm_pool *pool,
struct page_pool *page_pool)
{ … }
static void mvpp2_frag_free(const struct mvpp2_bm_pool *pool,
struct page_pool *page_pool, void *data)
{ … }
static int mvpp2_bm_pool_create(struct device *dev, struct mvpp2 *priv,
struct mvpp2_bm_pool *bm_pool, int size)
{ … }
static void mvpp2_bm_pool_bufsize_set(struct mvpp2 *priv,
struct mvpp2_bm_pool *bm_pool,
int buf_size)
{ … }
static void mvpp2_bm_bufs_get_addrs(struct device *dev, struct mvpp2 *priv,
struct mvpp2_bm_pool *bm_pool,
dma_addr_t *dma_addr,
phys_addr_t *phys_addr)
{ … }
static void mvpp2_bm_bufs_free(struct device *dev, struct mvpp2 *priv,
struct mvpp2_bm_pool *bm_pool, int buf_num)
{ … }
static int mvpp2_check_hw_buf_num(struct mvpp2 *priv, struct mvpp2_bm_pool *bm_pool)
{ … }
static int mvpp2_bm_pool_destroy(struct device *dev, struct mvpp2 *priv,
struct mvpp2_bm_pool *bm_pool)
{ … }
static int mvpp2_bm_pools_init(struct device *dev, struct mvpp2 *priv)
{ … }
static void mvpp23_bm_set_8pool_mode(struct mvpp2 *priv)
{ … }
static void mvpp2_bm_pool_cleanup(struct mvpp2 *priv, int pool_id)
{ … }
static int mvpp2_bm_init(struct device *dev, struct mvpp2 *priv)
{ … }
static void mvpp2_setup_bm_pool(void)
{ … }
static void mvpp2_rxq_long_pool_set(struct mvpp2_port *port,
int lrxq, int long_pool)
{ … }
static void mvpp2_rxq_short_pool_set(struct mvpp2_port *port,
int lrxq, int short_pool)
{ … }
static void *mvpp2_buf_alloc(struct mvpp2_port *port,
struct mvpp2_bm_pool *bm_pool,
struct page_pool *page_pool,
dma_addr_t *buf_dma_addr,
phys_addr_t *buf_phys_addr,
gfp_t gfp_mask)
{ … }
static void mvpp2_rxq_enable_fc(struct mvpp2_port *port)
{ … }
static void mvpp2_rxq_disable_fc(struct mvpp2_port *port)
{ … }
static void mvpp2_bm_pool_update_fc(struct mvpp2_port *port,
struct mvpp2_bm_pool *pool,
bool en)
{ … }
static void mvpp2_bm_pool_update_priv_fc(struct mvpp2 *priv, bool en)
{ … }
static int mvpp2_enable_global_fc(struct mvpp2 *priv)
{ … }
static inline void mvpp2_bm_pool_put(struct mvpp2_port *port, int pool,
dma_addr_t buf_dma_addr,
phys_addr_t buf_phys_addr)
{ … }
static int mvpp2_bm_bufs_add(struct mvpp2_port *port,
struct mvpp2_bm_pool *bm_pool, int buf_num)
{ … }
static struct mvpp2_bm_pool *
mvpp2_bm_pool_use(struct mvpp2_port *port, unsigned pool, int pkt_size)
{ … }
static struct mvpp2_bm_pool *
mvpp2_bm_pool_use_percpu(struct mvpp2_port *port, int type,
unsigned int pool, int pkt_size)
{ … }
static int mvpp2_swf_bm_pool_init_shared(struct mvpp2_port *port)
{ … }
static int mvpp2_swf_bm_pool_init_percpu(struct mvpp2_port *port)
{ … }
static int mvpp2_swf_bm_pool_init(struct mvpp2_port *port)
{ … }
static void mvpp2_set_hw_csum(struct mvpp2_port *port,
enum mvpp2_bm_pool_log_num new_long_pool)
{ … }
static int mvpp2_bm_update_mtu(struct net_device *dev, int mtu)
{ … }
static inline void mvpp2_interrupts_enable(struct mvpp2_port *port)
{ … }
static inline void mvpp2_interrupts_disable(struct mvpp2_port *port)
{ … }
static inline void mvpp2_qvec_interrupt_enable(struct mvpp2_queue_vector *qvec)
{ … }
static inline void mvpp2_qvec_interrupt_disable(struct mvpp2_queue_vector *qvec)
{ … }
static void mvpp2_interrupts_mask(void *arg)
{ … }
static void mvpp2_interrupts_unmask(void *arg)
{ … }
static void
mvpp2_shared_interrupt_mask_unmask(struct mvpp2_port *port, bool mask)
{ … }
static bool mvpp2_port_supports_xlg(struct mvpp2_port *port)
{ … }
static bool mvpp2_port_supports_rgmii(struct mvpp2_port *port)
{ … }
static bool mvpp2_is_xlg(phy_interface_t interface)
{ … }
static void mvpp2_modify(void __iomem *ptr, u32 mask, u32 set)
{ … }
static void mvpp22_gop_init_rgmii(struct mvpp2_port *port)
{ … }
static void mvpp22_gop_init_sgmii(struct mvpp2_port *port)
{ … }
static void mvpp22_gop_init_10gkr(struct mvpp2_port *port)
{ … }
static void mvpp22_gop_fca_enable_periodic(struct mvpp2_port *port, bool en)
{ … }
static void mvpp22_gop_fca_set_timer(struct mvpp2_port *port, u32 timer)
{ … }
static void mvpp22_gop_fca_set_periodic_timer(struct mvpp2_port *port)
{ … }
static int mvpp22_gop_init(struct mvpp2_port *port, phy_interface_t interface)
{ … }
static void mvpp22_gop_unmask_irq(struct mvpp2_port *port)
{ … }
static void mvpp22_gop_mask_irq(struct mvpp2_port *port)
{ … }
static void mvpp22_gop_setup_irq(struct mvpp2_port *port)
{ … }
static int mvpp22_comphy_init(struct mvpp2_port *port,
phy_interface_t interface)
{ … }
static void mvpp2_port_enable(struct mvpp2_port *port)
{ … }
static void mvpp2_port_disable(struct mvpp2_port *port)
{ … }
static void mvpp2_port_periodic_xon_disable(struct mvpp2_port *port)
{ … }
static void mvpp2_port_loopback_set(struct mvpp2_port *port,
const struct phylink_link_state *state)
{ … }
enum { … };
struct mvpp2_ethtool_counter { … };
static u64 mvpp2_read_count(struct mvpp2_port *port,
const struct mvpp2_ethtool_counter *counter)
{ … }
static u32 mvpp2_read_index(struct mvpp2 *priv, u32 index, u32 reg)
{ … }
static const struct mvpp2_ethtool_counter mvpp2_ethtool_mib_regs[] = …;
static const struct mvpp2_ethtool_counter mvpp2_ethtool_port_regs[] = …;
static const struct mvpp2_ethtool_counter mvpp2_ethtool_txq_regs[] = …;
static const struct mvpp2_ethtool_counter mvpp2_ethtool_rxq_regs[] = …;
static const struct mvpp2_ethtool_counter mvpp2_ethtool_xdp[] = …;
#define MVPP2_N_ETHTOOL_STATS(ntxqs, nrxqs) …
static void mvpp2_ethtool_get_strings(struct net_device *netdev, u32 sset,
u8 *data)
{ … }
static void
mvpp2_get_xdp_stats(struct mvpp2_port *port, struct mvpp2_pcpu_stats *xdp_stats)
{ … }
static void mvpp2_read_stats(struct mvpp2_port *port)
{ … }
static void mvpp2_gather_hw_statistics(struct work_struct *work)
{ … }
static void mvpp2_ethtool_get_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *data)
{ … }
static int mvpp2_ethtool_get_sset_count(struct net_device *dev, int sset)
{ … }
static void mvpp2_mac_reset_assert(struct mvpp2_port *port)
{ … }
static void mvpp22_pcs_reset_assert(struct mvpp2_port *port)
{ … }
static void mvpp22_pcs_reset_deassert(struct mvpp2_port *port,
phy_interface_t interface)
{ … }
static inline void mvpp2_gmac_max_rx_size_set(struct mvpp2_port *port)
{ … }
static inline void mvpp2_xlg_max_rx_size_set(struct mvpp2_port *port)
{ … }
static void mvpp2_defaults_set(struct mvpp2_port *port)
{ … }
static void mvpp2_ingress_enable(struct mvpp2_port *port)
{ … }
static void mvpp2_ingress_disable(struct mvpp2_port *port)
{ … }
static void mvpp2_egress_enable(struct mvpp2_port *port)
{ … }
static void mvpp2_egress_disable(struct mvpp2_port *port)
{ … }
static inline int
mvpp2_rxq_received(struct mvpp2_port *port, int rxq_id)
{ … }
static inline void
mvpp2_rxq_status_update(struct mvpp2_port *port, int rxq_id,
int used_count, int free_count)
{ … }
static inline struct mvpp2_rx_desc *
mvpp2_rxq_next_desc_get(struct mvpp2_rx_queue *rxq)
{ … }
static void mvpp2_rxq_offset_set(struct mvpp2_port *port,
int prxq, int offset)
{ … }
static struct mvpp2_tx_desc *
mvpp2_txq_next_desc_get(struct mvpp2_tx_queue *txq)
{ … }
static void mvpp2_aggr_txq_pend_desc_add(struct mvpp2_port *port, int pending)
{ … }
static int mvpp2_aggr_desc_num_check(struct mvpp2_port *port,
struct mvpp2_tx_queue *aggr_txq, int num)
{ … }
static int mvpp2_txq_alloc_reserved_desc(struct mvpp2_port *port,
struct mvpp2_tx_queue *txq, int num)
{ … }
static int mvpp2_txq_reserved_desc_num_proc(struct mvpp2_port *port,
struct mvpp2_tx_queue *txq,
struct mvpp2_txq_pcpu *txq_pcpu,
int num)
{ … }
static void mvpp2_txq_desc_put(struct mvpp2_tx_queue *txq)
{ … }
static u32 mvpp2_txq_desc_csum(int l3_offs, __be16 l3_proto,
int ip_hdr_len, int l4_proto)
{ … }
static inline int mvpp2_txq_sent_desc_proc(struct mvpp2_port *port,
struct mvpp2_tx_queue *txq)
{ … }
static void mvpp2_txq_sent_counter_clear(void *arg)
{ … }
static void mvpp2_txp_max_tx_size_set(struct mvpp2_port *port)
{ … }
static void mvpp2_set_rxq_free_tresh(struct mvpp2_port *port,
struct mvpp2_rx_queue *rxq)
{ … }
static void mvpp2_rx_pkts_coal_set(struct mvpp2_port *port,
struct mvpp2_rx_queue *rxq)
{ … }
static void mvpp2_tx_pkts_coal_set(struct mvpp2_port *port,
struct mvpp2_tx_queue *txq)
{ … }
static u32 mvpp2_usec_to_cycles(u32 usec, unsigned long clk_hz)
{ … }
static u32 mvpp2_cycles_to_usec(u32 cycles, unsigned long clk_hz)
{ … }
static void mvpp2_rx_time_coal_set(struct mvpp2_port *port,
struct mvpp2_rx_queue *rxq)
{ … }
static void mvpp2_tx_time_coal_set(struct mvpp2_port *port)
{ … }
static void mvpp2_txq_bufs_free(struct mvpp2_port *port,
struct mvpp2_tx_queue *txq,
struct mvpp2_txq_pcpu *txq_pcpu, int num)
{ … }
static inline struct mvpp2_rx_queue *mvpp2_get_rx_queue(struct mvpp2_port *port,
u32 cause)
{ … }
static inline struct mvpp2_tx_queue *mvpp2_get_tx_queue(struct mvpp2_port *port,
u32 cause)
{ … }
static void mvpp2_txq_done(struct mvpp2_port *port, struct mvpp2_tx_queue *txq,
struct mvpp2_txq_pcpu *txq_pcpu)
{ … }
static unsigned int mvpp2_tx_done(struct mvpp2_port *port, u32 cause,
unsigned int thread)
{ … }
static int mvpp2_aggr_txq_init(struct platform_device *pdev,
struct mvpp2_tx_queue *aggr_txq,
unsigned int thread, struct mvpp2 *priv)
{ … }
static int mvpp2_rxq_init(struct mvpp2_port *port,
struct mvpp2_rx_queue *rxq)
{ … }
static void mvpp2_rxq_drop_pkts(struct mvpp2_port *port,
struct mvpp2_rx_queue *rxq)
{ … }
static void mvpp2_rxq_deinit(struct mvpp2_port *port,
struct mvpp2_rx_queue *rxq)
{ … }
static int mvpp2_txq_init(struct mvpp2_port *port,
struct mvpp2_tx_queue *txq)
{ … }
static void mvpp2_txq_deinit(struct mvpp2_port *port,
struct mvpp2_tx_queue *txq)
{ … }
static void mvpp2_txq_clean(struct mvpp2_port *port, struct mvpp2_tx_queue *txq)
{ … }
static void mvpp2_cleanup_txqs(struct mvpp2_port *port)
{ … }
static void mvpp2_cleanup_rxqs(struct mvpp2_port *port)
{ … }
static int mvpp2_setup_rxqs(struct mvpp2_port *port)
{ … }
static int mvpp2_setup_txqs(struct mvpp2_port *port)
{ … }
static irqreturn_t mvpp2_isr(int irq, void *dev_id)
{ … }
static void mvpp2_isr_handle_ptp_queue(struct mvpp2_port *port, int nq)
{ … }
static void mvpp2_isr_handle_ptp(struct mvpp2_port *port)
{ … }
static void mvpp2_isr_handle_link(struct mvpp2_port *port,
struct phylink_pcs *pcs, bool link)
{ … }
static void mvpp2_isr_handle_xlg(struct mvpp2_port *port)
{ … }
static void mvpp2_isr_handle_gmac_internal(struct mvpp2_port *port)
{ … }
static irqreturn_t mvpp2_port_isr(int irq, void *dev_id)
{ … }
static enum hrtimer_restart mvpp2_hr_timer_cb(struct hrtimer *timer)
{ … }
static void mvpp2_rx_error(struct mvpp2_port *port,
struct mvpp2_rx_desc *rx_desc)
{ … }
static int mvpp2_rx_csum(struct mvpp2_port *port, u32 status)
{ … }
static int mvpp2_rx_refill(struct mvpp2_port *port,
struct mvpp2_bm_pool *bm_pool,
struct page_pool *page_pool, int pool)
{ … }
static u32 mvpp2_skb_tx_csum(struct mvpp2_port *port, struct sk_buff *skb)
{ … }
static void mvpp2_xdp_finish_tx(struct mvpp2_port *port, u16 txq_id, int nxmit, int nxmit_byte)
{ … }
static int
mvpp2_xdp_submit_frame(struct mvpp2_port *port, u16 txq_id,
struct xdp_frame *xdpf, bool dma_map)
{ … }
static int
mvpp2_xdp_xmit_back(struct mvpp2_port *port, struct xdp_buff *xdp)
{ … }
static int
mvpp2_xdp_xmit(struct net_device *dev, int num_frame,
struct xdp_frame **frames, u32 flags)
{ … }
static int
mvpp2_run_xdp(struct mvpp2_port *port, struct bpf_prog *prog,
struct xdp_buff *xdp, struct page_pool *pp,
struct mvpp2_pcpu_stats *stats)
{ … }
static void mvpp2_buff_hdr_pool_put(struct mvpp2_port *port, struct mvpp2_rx_desc *rx_desc,
int pool, u32 rx_status)
{ … }
static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
int rx_todo, struct mvpp2_rx_queue *rxq)
{ … }
static inline void
tx_desc_unmap_put(struct mvpp2_port *port, struct mvpp2_tx_queue *txq,
struct mvpp2_tx_desc *desc)
{ … }
static void mvpp2_txdesc_clear_ptp(struct mvpp2_port *port,
struct mvpp2_tx_desc *desc)
{ … }
static bool mvpp2_tx_hw_tstamp(struct mvpp2_port *port,
struct mvpp2_tx_desc *tx_desc,
struct sk_buff *skb)
{ … }
static int mvpp2_tx_frag_process(struct mvpp2_port *port, struct sk_buff *skb,
struct mvpp2_tx_queue *aggr_txq,
struct mvpp2_tx_queue *txq)
{ … }
static inline void mvpp2_tso_put_hdr(struct sk_buff *skb,
struct net_device *dev,
struct mvpp2_tx_queue *txq,
struct mvpp2_tx_queue *aggr_txq,
struct mvpp2_txq_pcpu *txq_pcpu,
int hdr_sz)
{ … }
static inline int mvpp2_tso_put_data(struct sk_buff *skb,
struct net_device *dev, struct tso_t *tso,
struct mvpp2_tx_queue *txq,
struct mvpp2_tx_queue *aggr_txq,
struct mvpp2_txq_pcpu *txq_pcpu,
int sz, bool left, bool last)
{ … }
static int mvpp2_tx_tso(struct sk_buff *skb, struct net_device *dev,
struct mvpp2_tx_queue *txq,
struct mvpp2_tx_queue *aggr_txq,
struct mvpp2_txq_pcpu *txq_pcpu)
{ … }
static netdev_tx_t mvpp2_tx(struct sk_buff *skb, struct net_device *dev)
{ … }
static inline void mvpp2_cause_error(struct net_device *dev, int cause)
{ … }
static int mvpp2_poll(struct napi_struct *napi, int budget)
{ … }
static void mvpp22_mode_reconfigure(struct mvpp2_port *port,
phy_interface_t interface)
{ … }
static void mvpp2_start_dev(struct mvpp2_port *port)
{ … }
static void mvpp2_stop_dev(struct mvpp2_port *port)
{ … }
static int mvpp2_check_ringparam_valid(struct net_device *dev,
struct ethtool_ringparam *ring)
{ … }
static void mvpp21_get_mac_address(struct mvpp2_port *port, unsigned char *addr)
{ … }
static int mvpp2_irqs_init(struct mvpp2_port *port)
{ … }
static void mvpp2_irqs_deinit(struct mvpp2_port *port)
{ … }
static bool mvpp22_rss_is_supported(struct mvpp2_port *port)
{ … }
static int mvpp2_open(struct net_device *dev)
{ … }
static int mvpp2_stop(struct net_device *dev)
{ … }
static int mvpp2_prs_mac_da_accept_list(struct mvpp2_port *port,
struct netdev_hw_addr_list *list)
{ … }
static void mvpp2_set_rx_promisc(struct mvpp2_port *port, bool enable)
{ … }
static void mvpp2_set_rx_mode(struct net_device *dev)
{ … }
static int mvpp2_set_mac_address(struct net_device *dev, void *p)
{ … }
static int mvpp2_bm_switch_buffers(struct mvpp2 *priv, bool percpu)
{ … }
static int mvpp2_change_mtu(struct net_device *dev, int mtu)
{ … }
static int mvpp2_check_pagepool_dma(struct mvpp2_port *port)
{ … }
static void
mvpp2_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{ … }
static int mvpp2_set_ts_config(struct mvpp2_port *port, struct ifreq *ifr)
{ … }
static int mvpp2_get_ts_config(struct mvpp2_port *port, struct ifreq *ifr)
{ … }
static int mvpp2_ethtool_get_ts_info(struct net_device *dev,
struct kernel_ethtool_ts_info *info)
{ … }
static int mvpp2_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{ … }
static int mvpp2_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
{ … }
static int mvpp2_vlan_rx_kill_vid(struct net_device *dev, __be16 proto, u16 vid)
{ … }
static int mvpp2_set_features(struct net_device *dev,
netdev_features_t features)
{ … }
static int mvpp2_xdp_setup(struct mvpp2_port *port, struct netdev_bpf *bpf)
{ … }
static int mvpp2_xdp(struct net_device *dev, struct netdev_bpf *xdp)
{ … }
static int mvpp2_ethtool_nway_reset(struct net_device *dev)
{ … }
static int
mvpp2_ethtool_set_coalesce(struct net_device *dev,
struct ethtool_coalesce *c,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{ … }
static int
mvpp2_ethtool_get_coalesce(struct net_device *dev,
struct ethtool_coalesce *c,
struct kernel_ethtool_coalesce *kernel_coal,
struct netlink_ext_ack *extack)
{ … }
static void mvpp2_ethtool_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *drvinfo)
{ … }
static void
mvpp2_ethtool_get_ringparam(struct net_device *dev,
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{ … }
static int
mvpp2_ethtool_set_ringparam(struct net_device *dev,
struct ethtool_ringparam *ring,
struct kernel_ethtool_ringparam *kernel_ring,
struct netlink_ext_ack *extack)
{ … }
static void mvpp2_ethtool_get_pause_param(struct net_device *dev,
struct ethtool_pauseparam *pause)
{ … }
static int mvpp2_ethtool_set_pause_param(struct net_device *dev,
struct ethtool_pauseparam *pause)
{ … }
static int mvpp2_ethtool_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static int mvpp2_ethtool_set_link_ksettings(struct net_device *dev,
const struct ethtool_link_ksettings *cmd)
{ … }
static int mvpp2_ethtool_get_rxnfc(struct net_device *dev,
struct ethtool_rxnfc *info, u32 *rules)
{ … }
static int mvpp2_ethtool_set_rxnfc(struct net_device *dev,
struct ethtool_rxnfc *info)
{ … }
static u32 mvpp2_ethtool_get_rxfh_indir_size(struct net_device *dev)
{ … }
static int mvpp2_ethtool_get_rxfh(struct net_device *dev,
struct ethtool_rxfh_param *rxfh)
{ … }
static bool mvpp2_ethtool_rxfh_okay(struct mvpp2_port *port,
const struct ethtool_rxfh_param *rxfh)
{ … }
static int mvpp2_create_rxfh_context(struct net_device *dev,
struct ethtool_rxfh_context *ctx,
const struct ethtool_rxfh_param *rxfh,
struct netlink_ext_ack *extack)
{ … }
static int mvpp2_modify_rxfh_context(struct net_device *dev,
struct ethtool_rxfh_context *ctx,
const struct ethtool_rxfh_param *rxfh,
struct netlink_ext_ack *extack)
{ … }
static int mvpp2_remove_rxfh_context(struct net_device *dev,
struct ethtool_rxfh_context *ctx,
u32 rss_context,
struct netlink_ext_ack *extack)
{ … }
static int mvpp2_ethtool_set_rxfh(struct net_device *dev,
struct ethtool_rxfh_param *rxfh,
struct netlink_ext_ack *extack)
{ … }
static const struct net_device_ops mvpp2_netdev_ops = …;
static const struct ethtool_ops mvpp2_eth_tool_ops = …;
static int mvpp2_simple_queue_vectors_init(struct mvpp2_port *port,
struct device_node *port_node)
{ … }
static int mvpp2_multi_queue_vectors_init(struct mvpp2_port *port,
struct device_node *port_node)
{ … }
static int mvpp2_queue_vectors_init(struct mvpp2_port *port,
struct device_node *port_node)
{ … }
static void mvpp2_queue_vectors_deinit(struct mvpp2_port *port)
{ … }
static void mvpp2_rx_irqs_setup(struct mvpp2_port *port)
{ … }
static int mvpp2_port_init(struct mvpp2_port *port)
{ … }
static bool mvpp22_port_has_legacy_tx_irqs(struct device_node *port_node,
unsigned long *flags)
{ … }
static bool mvpp2_port_has_irqs(struct mvpp2 *priv,
struct device_node *port_node,
unsigned long *flags)
{ … }
static int mvpp2_port_copy_mac_addr(struct net_device *dev, struct mvpp2 *priv,
struct fwnode_handle *fwnode,
char **mac_from)
{ … }
static struct mvpp2_port *mvpp2_phylink_to_port(struct phylink_config *config)
{ … }
static struct mvpp2_port *mvpp2_pcs_xlg_to_port(struct phylink_pcs *pcs)
{ … }
static struct mvpp2_port *mvpp2_pcs_gmac_to_port(struct phylink_pcs *pcs)
{ … }
static void mvpp2_xlg_pcs_get_state(struct phylink_pcs *pcs,
struct phylink_link_state *state)
{ … }
static int mvpp2_xlg_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
phy_interface_t interface,
const unsigned long *advertising,
bool permit_pause_to_mac)
{ … }
static const struct phylink_pcs_ops mvpp2_phylink_xlg_pcs_ops = …;
static int mvpp2_gmac_pcs_validate(struct phylink_pcs *pcs,
unsigned long *supported,
const struct phylink_link_state *state)
{ … }
static void mvpp2_gmac_pcs_get_state(struct phylink_pcs *pcs,
struct phylink_link_state *state)
{ … }
static int mvpp2_gmac_pcs_config(struct phylink_pcs *pcs, unsigned int neg_mode,
phy_interface_t interface,
const unsigned long *advertising,
bool permit_pause_to_mac)
{ … }
static void mvpp2_gmac_pcs_an_restart(struct phylink_pcs *pcs)
{ … }
static const struct phylink_pcs_ops mvpp2_phylink_gmac_pcs_ops = …;
static void mvpp2_xlg_config(struct mvpp2_port *port, unsigned int mode,
const struct phylink_link_state *state)
{ … }
static void mvpp2_gmac_config(struct mvpp2_port *port, unsigned int mode,
const struct phylink_link_state *state)
{ … }
static struct phylink_pcs *mvpp2_select_pcs(struct phylink_config *config,
phy_interface_t interface)
{ … }
static int mvpp2_mac_prepare(struct phylink_config *config, unsigned int mode,
phy_interface_t interface)
{ … }
static void mvpp2_mac_config(struct phylink_config *config, unsigned int mode,
const struct phylink_link_state *state)
{ … }
static int mvpp2_mac_finish(struct phylink_config *config, unsigned int mode,
phy_interface_t interface)
{ … }
static void mvpp2_mac_link_up(struct phylink_config *config,
struct phy_device *phy,
unsigned int mode, phy_interface_t interface,
int speed, int duplex,
bool tx_pause, bool rx_pause)
{ … }
static void mvpp2_mac_link_down(struct phylink_config *config,
unsigned int mode, phy_interface_t interface)
{ … }
static const struct phylink_mac_ops mvpp2_phylink_ops = …;
static void mvpp2_acpi_start(struct mvpp2_port *port)
{ … }
static bool mvpp2_use_acpi_compat_mode(struct fwnode_handle *port_fwnode)
{ … }
static int mvpp2_port_probe(struct platform_device *pdev,
struct fwnode_handle *port_fwnode,
struct mvpp2 *priv)
{ … }
static void mvpp2_port_remove(struct mvpp2_port *port)
{ … }
static void mvpp2_conf_mbus_windows(const struct mbus_dram_target_info *dram,
struct mvpp2 *priv)
{ … }
static void mvpp2_rx_fifo_init(struct mvpp2 *priv)
{ … }
static void mvpp22_rx_fifo_set_hw(struct mvpp2 *priv, int port, int data_size)
{ … }
static void mvpp22_rx_fifo_init(struct mvpp2 *priv)
{ … }
static void mvpp23_rx_fifo_fc_set_tresh(struct mvpp2 *priv)
{ … }
void mvpp23_rx_fifo_fc_en(struct mvpp2 *priv, int port, bool en)
{ … }
static void mvpp22_tx_fifo_set_hw(struct mvpp2 *priv, int port, int size)
{ … }
static void mvpp22_tx_fifo_init(struct mvpp2 *priv)
{ … }
static void mvpp2_axi_init(struct mvpp2 *priv)
{ … }
static int mvpp2_init(struct platform_device *pdev, struct mvpp2 *priv)
{ … }
static int mvpp2_get_sram(struct platform_device *pdev,
struct mvpp2 *priv)
{ … }
static int mvpp2_probe(struct platform_device *pdev)
{ … }
static void mvpp2_remove(struct platform_device *pdev)
{ … }
static const struct of_device_id mvpp2_match[] = …;
MODULE_DEVICE_TABLE(of, mvpp2_match);
#ifdef CONFIG_ACPI
static const struct acpi_device_id mvpp2_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, mvpp2_acpi_match);
#endif
static struct platform_driver mvpp2_driver = …;
static int __init mvpp2_driver_init(void)
{ … }
module_init(…) …;
static void __exit mvpp2_driver_exit(void)
{ … }
module_exit(mvpp2_driver_exit);
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;