linux/drivers/net/ethernet/realtek/r8169_main.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * r8169.c: RealTek 8169/8168/8101 ethernet driver.
 *
 * Copyright (c) 2002 ShuChen <[email protected]>
 * Copyright (c) 2003 - 2007 Francois Romieu <[email protected]>
 * Copyright (c) a lot of people too. Please respect their work.
 *
 * See MAINTAINERS file for support contact information.
 */

#include <linux/module.h>
#include <linux/pci.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/clk.h>
#include <linux/delay.h>
#include <linux/ethtool.h>
#include <linux/phy.h>
#include <linux/if_vlan.h>
#include <linux/in.h>
#include <linux/io.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/interrupt.h>
#include <linux/dma-mapping.h>
#include <linux/pm_runtime.h>
#include <linux/bitfield.h>
#include <linux/prefetch.h>
#include <linux/ipv6.h>
#include <asm/unaligned.h>
#include <net/ip6_checksum.h>
#include <net/netdev_queues.h>

#include "r8169.h"
#include "r8169_firmware.h"

#define FIRMWARE_8168D_1
#define FIRMWARE_8168D_2
#define FIRMWARE_8168E_1
#define FIRMWARE_8168E_2
#define FIRMWARE_8168E_3
#define FIRMWARE_8168F_1
#define FIRMWARE_8168F_2
#define FIRMWARE_8105E_1
#define FIRMWARE_8402_1
#define FIRMWARE_8411_1
#define FIRMWARE_8411_2
#define FIRMWARE_8106E_1
#define FIRMWARE_8106E_2
#define FIRMWARE_8168G_2
#define FIRMWARE_8168G_3
#define FIRMWARE_8168H_2
#define FIRMWARE_8168FP_3
#define FIRMWARE_8107E_2
#define FIRMWARE_8125A_3
#define FIRMWARE_8125B_2
#define FIRMWARE_8126A_2

#define TX_DMA_BURST
#define InterFrameGap

#define R8169_REGS_SIZE
#define R8169_RX_BUF_SIZE
#define NUM_TX_DESC
#define NUM_RX_DESC
#define R8169_TX_RING_BYTES
#define R8169_RX_RING_BYTES
#define R8169_TX_STOP_THRS
#define R8169_TX_START_THRS

#define OCP_STD_PHY_BASE

#define RTL_CFG_NO_GBIT

/* write/read MMIO register */
#define RTL_W8(tp, reg, val8)
#define RTL_W16(tp, reg, val16)
#define RTL_W32(tp, reg, val32)
#define RTL_R8(tp, reg)
#define RTL_R16(tp, reg)
#define RTL_R32(tp, reg)

#define JUMBO_4K
#define JUMBO_6K
#define JUMBO_7K
#define JUMBO_9K

static const struct {} rtl_chip_infos[] =;

static const struct pci_device_id rtl8169_pci_tbl[] =;

MODULE_DEVICE_TABLE(pci, rtl8169_pci_tbl);

enum rtl_registers {};

enum rtl8168_8101_registers {};

enum rtl8168_registers {};

enum rtl8125_registers {};

#define LEDSEL_MASK_8125

#define RX_VLAN_INNER_8125
#define RX_VLAN_OUTER_8125
#define RX_VLAN_8125

#define RX_FETCH_DFLT_8125

enum rtl_register_content {};

enum rtl_desc_bit {};

/* Generic case. */
enum rtl_tx_desc_bit {};

/* 8169, 8168b and 810x except 8102e. */
enum rtl_tx_desc_bit_0 {};

/* 8102e, 8168c and beyond. */
enum rtl_tx_desc_bit_1 {};

enum rtl_rx_desc_bit {};

#define RTL_GSO_MAX_SIZE_V1
#define RTL_GSO_MAX_SEGS_V1
#define RTL_GSO_MAX_SIZE_V2
#define RTL_GSO_MAX_SEGS_V2

struct TxDesc {};

struct RxDesc {};

struct ring_info {};

struct rtl8169_counters {};

struct rtl8169_tc_offsets {};

enum rtl_flag {};

enum rtl_dash_type {};

struct rtl8169_private {};

rtl_generic_fct;

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_SOFTDEP();
MODULE_LICENSE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();

static inline struct device *tp_to_dev(struct rtl8169_private *tp)
{}

static void rtl_lock_config_regs(struct rtl8169_private *tp)
{}

static void rtl_unlock_config_regs(struct rtl8169_private *tp)
{}

static void rtl_pci_commit(struct rtl8169_private *tp)
{}

static void rtl_mod_config2(struct rtl8169_private *tp, u8 clear, u8 set)
{}

static void rtl_mod_config5(struct rtl8169_private *tp, u8 clear, u8 set)
{}

static bool rtl_is_8125(struct rtl8169_private *tp)
{}

static bool rtl_is_8168evl_up(struct rtl8169_private *tp)
{}

static bool rtl_supports_eee(struct rtl8169_private *tp)
{}

static void rtl_read_mac_from_reg(struct rtl8169_private *tp, u8 *mac, int reg)
{}

struct rtl_cond {};

static bool rtl_loop_wait(struct rtl8169_private *tp, const struct rtl_cond *c,
			  unsigned long usecs, int n, bool high)
{}

static bool rtl_loop_wait_high(struct rtl8169_private *tp,
			       const struct rtl_cond *c,
			       unsigned long d, int n)
{}

static bool rtl_loop_wait_low(struct rtl8169_private *tp,
			      const struct rtl_cond *c,
			      unsigned long d, int n)
{}

#define DECLARE_RTL_COND(name)

int rtl8168_led_mod_ctrl(struct rtl8169_private *tp, u16 mask, u16 val)
{}

int rtl8168_get_led_mode(struct rtl8169_private *tp)
{}

static int rtl8125_get_led_reg(int index)
{}

int rtl8125_set_led_mode(struct rtl8169_private *tp, int index, u16 mode)
{}

int rtl8125_get_led_mode(struct rtl8169_private *tp, int index)
{}

void r8169_get_led_name(struct rtl8169_private *tp, int idx,
			char *buf, int buf_len)
{}

static void r8168fp_adjust_ocp_cmd(struct rtl8169_private *tp, u32 *cmd, int type)
{}

DECLARE_RTL_COND(rtl_eriar_cond)
{}

static void _rtl_eri_write(struct rtl8169_private *tp, int addr, u32 mask,
			   u32 val, int type)
{}

static void rtl_eri_write(struct rtl8169_private *tp, int addr, u32 mask,
			  u32 val)
{}

static u32 _rtl_eri_read(struct rtl8169_private *tp, int addr, int type)
{}

static u32 rtl_eri_read(struct rtl8169_private *tp, int addr)
{}

static void rtl_w0w1_eri(struct rtl8169_private *tp, int addr, u32 p, u32 m)
{}

static void rtl_eri_set_bits(struct rtl8169_private *tp, int addr, u32 p)
{}

static void rtl_eri_clear_bits(struct rtl8169_private *tp, int addr, u32 m)
{}

static bool rtl_ocp_reg_failure(u32 reg)
{}

DECLARE_RTL_COND(rtl_ocp_gphy_cond)
{}

static void r8168_phy_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
{}

static int r8168_phy_ocp_read(struct rtl8169_private *tp, u32 reg)
{}

static void __r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
{}

static void r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
{}

static u16 __r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)
{}

static u16 r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)
{}

static void r8168_mac_ocp_modify(struct rtl8169_private *tp, u32 reg, u16 mask,
				 u16 set)
{}

/* Work around a hw issue with RTL8168g PHY, the quirk disables
 * PHY MCU interrupts before PHY power-down.
 */
static void rtl8168g_phy_suspend_quirk(struct rtl8169_private *tp, int value)
{
	switch (tp->mac_version) {
	case RTL_GIGA_MAC_VER_40:
		if (value & BMCR_RESET || !(value & BMCR_PDOWN))
			rtl_eri_set_bits(tp, 0x1a8, 0xfc000000);
		else
			rtl_eri_clear_bits(tp, 0x1a8, 0xfc000000);
		break;
	default:
		break;
	}
};

static void r8168g_mdio_write(struct rtl8169_private *tp, int reg, int value)
{}

static int r8168g_mdio_read(struct rtl8169_private *tp, int reg)
{}

static void mac_mcu_write(struct rtl8169_private *tp, int reg, int value)
{}

static int mac_mcu_read(struct rtl8169_private *tp, int reg)
{}

DECLARE_RTL_COND(rtl_phyar_cond)
{}

static void r8169_mdio_write(struct rtl8169_private *tp, int reg, int value)
{}

static int r8169_mdio_read(struct rtl8169_private *tp, int reg)
{}

DECLARE_RTL_COND(rtl_ocpar_cond)
{}

#define R8168DP_1_MDIO_ACCESS_BIT

static void r8168dp_2_mdio_start(struct rtl8169_private *tp)
{}

static void r8168dp_2_mdio_stop(struct rtl8169_private *tp)
{}

static void r8168dp_2_mdio_write(struct rtl8169_private *tp, int reg, int value)
{}

static int r8168dp_2_mdio_read(struct rtl8169_private *tp, int reg)
{}

static void rtl_writephy(struct rtl8169_private *tp, int location, int val)
{}

static int rtl_readphy(struct rtl8169_private *tp, int location)
{}

DECLARE_RTL_COND(rtl_ephyar_cond)
{}

static void rtl_ephy_write(struct rtl8169_private *tp, int reg_addr, int value)
{}

static u16 rtl_ephy_read(struct rtl8169_private *tp, int reg_addr)
{}

static u32 r8168dp_ocp_read(struct rtl8169_private *tp, u16 reg)
{}

static u32 r8168ep_ocp_read(struct rtl8169_private *tp, u16 reg)
{}

static void r8168dp_ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg,
			      u32 data)
{}

static void r8168ep_ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg,
			      u32 data)
{}

static void r8168dp_oob_notify(struct rtl8169_private *tp, u8 cmd)
{}

#define OOB_CMD_RESET
#define OOB_CMD_DRIVER_START
#define OOB_CMD_DRIVER_STOP

static u16 rtl8168_get_ocp_reg(struct rtl8169_private *tp)
{}

DECLARE_RTL_COND(rtl_dp_ocp_read_cond)
{}

DECLARE_RTL_COND(rtl_ep_ocp_read_cond)
{}

DECLARE_RTL_COND(rtl_ocp_tx_cond)
{}

static void rtl8168ep_stop_cmac(struct rtl8169_private *tp)
{}

static void rtl_dash_loop_wait(struct rtl8169_private *tp,
			       const struct rtl_cond *c,
			       unsigned long usecs, int n, bool high)
{}

static void rtl_dash_loop_wait_high(struct rtl8169_private *tp,
				    const struct rtl_cond *c,
				    unsigned long d, int n)
{}

static void rtl_dash_loop_wait_low(struct rtl8169_private *tp,
				   const struct rtl_cond *c,
				   unsigned long d, int n)
{}

static void rtl8168dp_driver_start(struct rtl8169_private *tp)
{}

static void rtl8168ep_driver_start(struct rtl8169_private *tp)
{}

static void rtl8168_driver_start(struct rtl8169_private *tp)
{}

static void rtl8168dp_driver_stop(struct rtl8169_private *tp)
{}

static void rtl8168ep_driver_stop(struct rtl8169_private *tp)
{}

static void rtl8168_driver_stop(struct rtl8169_private *tp)
{}

static bool r8168dp_check_dash(struct rtl8169_private *tp)
{}

static bool r8168ep_check_dash(struct rtl8169_private *tp)
{}

static bool rtl_dash_is_enabled(struct rtl8169_private *tp)
{}

static enum rtl_dash_type rtl_get_dash_type(struct rtl8169_private *tp)
{}

static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable)
{}

static void rtl_reset_packet_filter(struct rtl8169_private *tp)
{}

DECLARE_RTL_COND(rtl_efusear_cond)
{}

u8 rtl8168d_efuse_read(struct rtl8169_private *tp, int reg_addr)
{}

static u32 rtl_get_events(struct rtl8169_private *tp)
{}

static void rtl_ack_events(struct rtl8169_private *tp, u32 bits)
{}

static void rtl_irq_disable(struct rtl8169_private *tp)
{}

static void rtl_irq_enable(struct rtl8169_private *tp)
{}

static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp)
{}

static void rtl_link_chg_patch(struct rtl8169_private *tp)
{}

#define WAKE_ANY

static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{}

static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
{}

static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
{}

static void rtl8169_get_drvinfo(struct net_device *dev,
				struct ethtool_drvinfo *info)
{}

static int rtl8169_get_regs_len(struct net_device *dev)
{}

static netdev_features_t rtl8169_fix_features(struct net_device *dev,
	netdev_features_t features)
{}

static void rtl_set_rx_config_features(struct rtl8169_private *tp,
				       netdev_features_t features)
{}

static int rtl8169_set_features(struct net_device *dev,
				netdev_features_t features)
{}

static inline u32 rtl8169_tx_vlan_tag(struct sk_buff *skb)
{}

static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb)
{}

static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs,
			     void *p)
{}

static const char rtl8169_gstrings[][ETH_GSTRING_LEN] =;

static int rtl8169_get_sset_count(struct net_device *dev, int sset)
{}

DECLARE_RTL_COND(rtl_counters_cond)
{}

static void rtl8169_do_counters(struct rtl8169_private *tp, u32 counter_cmd)
{}

static void rtl8169_update_counters(struct rtl8169_private *tp)
{}

static void rtl8169_init_counter_offsets(struct rtl8169_private *tp)
{}

static void rtl8169_get_ethtool_stats(struct net_device *dev,
				      struct ethtool_stats *stats, u64 *data)
{}

static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
{}

/*
 * Interrupt coalescing
 *
 * > 1 - the availability of the IntrMitigate (0xe2) register through the
 * >     8169, 8168 and 810x line of chipsets
 *
 * 8169, 8168, and 8136(810x) serial chipsets support it.
 *
 * > 2 - the Tx timer unit at gigabit speed
 *
 * The unit of the timer depends on both the speed and the setting of CPlusCmd
 * (0xe0) bit 1 and bit 0.
 *
 * For 8169
 * bit[1:0] \ speed        1000M           100M            10M
 * 0 0                     320ns           2.56us          40.96us
 * 0 1                     2.56us          20.48us         327.7us
 * 1 0                     5.12us          40.96us         655.4us
 * 1 1                     10.24us         81.92us         1.31ms
 *
 * For the other
 * bit[1:0] \ speed        1000M           100M            10M
 * 0 0                     5us             2.56us          40.96us
 * 0 1                     40us            20.48us         327.7us
 * 1 0                     80us            40.96us         655.4us
 * 1 1                     160us           81.92us         1.31ms
 */

/* rx/tx scale factors for all CPlusCmd[0:1] cases */
struct rtl_coalesce_info {};

/* produce array with base delay *1, *8, *8*2, *8*2*2 */
#define COALESCE_DELAY

static const struct rtl_coalesce_info rtl_coalesce_info_8169[] =;

static const struct rtl_coalesce_info rtl_coalesce_info_8168_8136[] =;
#undef COALESCE_DELAY

/* get rx/tx scale vector corresponding to current speed */
static const struct rtl_coalesce_info *
rtl_coalesce_info(struct rtl8169_private *tp)
{}

static int rtl_get_coalesce(struct net_device *dev,
			    struct ethtool_coalesce *ec,
			    struct kernel_ethtool_coalesce *kernel_coal,
			    struct netlink_ext_ack *extack)
{}

/* choose appropriate scale factor and CPlusCmd[0:1] for (speed, usec) */
static int rtl_coalesce_choose_scale(struct rtl8169_private *tp, u32 usec,
				     u16 *cp01)
{}

static int rtl_set_coalesce(struct net_device *dev,
			    struct ethtool_coalesce *ec,
			    struct kernel_ethtool_coalesce *kernel_coal,
			    struct netlink_ext_ack *extack)
{}

static void rtl_set_eee_txidle_timer(struct rtl8169_private *tp)
{}

static unsigned int r8169_get_tx_lpi_timer_us(struct rtl8169_private *tp)
{}

static int rtl8169_get_eee(struct net_device *dev, struct ethtool_keee *data)
{}

static int rtl8169_set_eee(struct net_device *dev, struct ethtool_keee *data)
{}

static void rtl8169_get_ringparam(struct net_device *dev,
				  struct ethtool_ringparam *data,
				  struct kernel_ethtool_ringparam *kernel_data,
				  struct netlink_ext_ack *extack)
{}

static void rtl8169_get_pauseparam(struct net_device *dev,
				   struct ethtool_pauseparam *data)
{}

static int rtl8169_set_pauseparam(struct net_device *dev,
				  struct ethtool_pauseparam *data)
{}

static const struct ethtool_ops rtl8169_ethtool_ops =;

static enum mac_version rtl8169_get_mac_version(u16 xid, bool gmii)
{}

static void rtl_release_firmware(struct rtl8169_private *tp)
{}

void r8169_apply_firmware(struct rtl8169_private *tp)
{}

static void rtl8168_config_eee_mac(struct rtl8169_private *tp)
{}

static void rtl8125a_config_eee_mac(struct rtl8169_private *tp)
{}

static void rtl8125b_config_eee_mac(struct rtl8169_private *tp)
{}

static void rtl_rar_exgmac_set(struct rtl8169_private *tp, const u8 *addr)
{}

u16 rtl8168h_2_get_adc_bias_ioffset(struct rtl8169_private *tp)
{}

static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag)
{}

static void rtl8169_init_phy(struct rtl8169_private *tp)
{}

static void rtl_rar_set(struct rtl8169_private *tp, const u8 *addr)
{}

static int rtl_set_mac_address(struct net_device *dev, void *p)
{}

static void rtl_init_rxcfg(struct rtl8169_private *tp)
{}

static void rtl8169_init_ring_indexes(struct rtl8169_private *tp)
{}

static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp)
{}

static void r8168c_hw_jumbo_disable(struct rtl8169_private *tp)
{}

static void r8168dp_hw_jumbo_enable(struct rtl8169_private *tp)
{}

static void r8168dp_hw_jumbo_disable(struct rtl8169_private *tp)
{}

static void r8168e_hw_jumbo_enable(struct rtl8169_private *tp)
{}

static void r8168e_hw_jumbo_disable(struct rtl8169_private *tp)
{}

static void r8168b_1_hw_jumbo_enable(struct rtl8169_private *tp)
{}

static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp)
{}

static void rtl_jumbo_config(struct rtl8169_private *tp)
{}

DECLARE_RTL_COND(rtl_chipcmd_cond)
{}

static void rtl_hw_reset(struct rtl8169_private *tp)
{}

static void rtl_request_firmware(struct rtl8169_private *tp)
{}

static void rtl_rx_close(struct rtl8169_private *tp)
{}

DECLARE_RTL_COND(rtl_npq_cond)
{}

DECLARE_RTL_COND(rtl_txcfg_empty_cond)
{}

DECLARE_RTL_COND(rtl_rxtx_empty_cond)
{}

DECLARE_RTL_COND(rtl_rxtx_empty_cond_2)
{}

static void rtl_wait_txrx_fifo_empty(struct rtl8169_private *tp)
{}

static void rtl_disable_rxdvgate(struct rtl8169_private *tp)
{}

static void rtl_enable_rxdvgate(struct rtl8169_private *tp)
{}

static void rtl_wol_enable_rx(struct rtl8169_private *tp)
{}

static void rtl_prepare_power_down(struct rtl8169_private *tp)
{}

static void rtl_set_tx_config_registers(struct rtl8169_private *tp)
{}

static void rtl_set_rx_max_size(struct rtl8169_private *tp)
{}

static void rtl_set_rx_tx_desc_registers(struct rtl8169_private *tp)
{}

static void rtl8169_set_magic_reg(struct rtl8169_private *tp)
{}

static void rtl_set_rx_mode(struct net_device *dev)
{}

DECLARE_RTL_COND(rtl_csiar_cond)
{}

static void rtl_csi_write(struct rtl8169_private *tp, int addr, int value)
{}

static u32 rtl_csi_read(struct rtl8169_private *tp, int addr)
{}

static void rtl_set_aspm_entry_latency(struct rtl8169_private *tp, u8 val)
{}

static void rtl_set_def_aspm_entry_latency(struct rtl8169_private *tp)
{}

struct ephy_info {};

static void __rtl_ephy_init(struct rtl8169_private *tp,
			    const struct ephy_info *e, int len)
{}

#define rtl_ephy_init(tp, a)

static void rtl_disable_clock_request(struct rtl8169_private *tp)
{}

static void rtl_enable_clock_request(struct rtl8169_private *tp)
{}

static void rtl_pcie_state_l2l3_disable(struct rtl8169_private *tp)
{}

static void rtl_enable_exit_l1(struct rtl8169_private *tp)
{}

static void rtl_disable_exit_l1(struct rtl8169_private *tp)
{}

static void rtl_hw_aspm_clkreq_enable(struct rtl8169_private *tp, bool enable)
{}

static void rtl_set_fifo_size(struct rtl8169_private *tp, u16 rx_stat,
			      u16 tx_stat, u16 rx_dyn, u16 tx_dyn)
{}

static void rtl8168g_set_pause_thresholds(struct rtl8169_private *tp,
					  u8 low, u8 high)
{}

static void rtl_hw_start_8168b(struct rtl8169_private *tp)
{}

static void __rtl_hw_start_8168cp(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168cp_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168cp_2(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168c_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168c_2(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168c_4(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168d(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168d_4(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168e_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168e_2(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168f(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168f_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8411(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168g(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)
{}

static void rtl8411b_fix_phy_down(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168ep(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8117(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8102e_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8102e_2(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8102e_3(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8401(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8105e_1(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8105e_2(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8402(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8106(struct rtl8169_private *tp)
{}

DECLARE_RTL_COND(rtl_mac_ocp_e00e_cond)
{}

static void rtl_hw_start_8125_common(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8125a_2(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8125b(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8126a(struct rtl8169_private *tp)
{}

static void rtl_hw_config(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8125(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8168(struct rtl8169_private *tp)
{}

static void rtl_hw_start_8169(struct rtl8169_private *tp)
{}

static void rtl_hw_start(struct  rtl8169_private *tp)
{}

static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
{}

static void rtl8169_mark_to_asic(struct RxDesc *desc)
{}

static struct page *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
					  struct RxDesc *desc)
{}

static void rtl8169_rx_clear(struct rtl8169_private *tp)
{}

static int rtl8169_rx_fill(struct rtl8169_private *tp)
{}

static int rtl8169_init_ring(struct rtl8169_private *tp)
{}

static void rtl8169_unmap_tx_skb(struct rtl8169_private *tp, unsigned int entry)
{}

static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
				   unsigned int n)
{}

static void rtl8169_tx_clear(struct rtl8169_private *tp)
{}

static void rtl8169_cleanup(struct rtl8169_private *tp)
{}

static void rtl_reset_work(struct rtl8169_private *tp)
{}

static void rtl8169_tx_timeout(struct net_device *dev, unsigned int txqueue)
{}

static int rtl8169_tx_map(struct rtl8169_private *tp, const u32 *opts, u32 len,
			  void *addr, unsigned int entry, bool desc_own)
{}

static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
			      const u32 *opts, unsigned int entry)
{}

static bool rtl_skb_is_udp(struct sk_buff *skb)
{}

#define RTL_MIN_PATCH_LEN

/* see rtl8125_get_patch_pad_len() in r8125 vendor driver */
static unsigned int rtl8125_quirk_udp_padto(struct rtl8169_private *tp,
					    struct sk_buff *skb)
{}

static unsigned int rtl_quirk_packet_padto(struct rtl8169_private *tp,
					   struct sk_buff *skb)
{}

static void rtl8169_tso_csum_v1(struct sk_buff *skb, u32 *opts)
{}

static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
				struct sk_buff *skb, u32 *opts)
{}

static unsigned int rtl_tx_slots_avail(struct rtl8169_private *tp)
{}

/* Versions RTL8102e and from RTL8168c onwards support csum_v2 */
static bool rtl_chip_supports_csum_v2(struct rtl8169_private *tp)
{}

static void rtl8169_doorbell(struct rtl8169_private *tp)
{}

static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
				      struct net_device *dev)
{}

static unsigned int rtl_last_frag_len(struct sk_buff *skb)
{}

/* Workaround for hw issues with TSO on RTL8168evl */
static netdev_features_t rtl8168evl_fix_tso(struct sk_buff *skb,
					    netdev_features_t features)
{}

static netdev_features_t rtl8169_features_check(struct sk_buff *skb,
						struct net_device *dev,
						netdev_features_t features)
{}

static void rtl8169_pcierr_interrupt(struct net_device *dev)
{}

static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp,
		   int budget)
{}

static inline int rtl8169_fragmented_frame(u32 status)
{}

static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1)
{}

static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, int budget)
{}

static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
{}

static void rtl_task(struct work_struct *work)
{}

static int rtl8169_poll(struct napi_struct *napi, int budget)
{}

static void r8169_phylink_handler(struct net_device *ndev)
{}

static int r8169_phy_connect(struct rtl8169_private *tp)
{}

static void rtl8169_down(struct rtl8169_private *tp)
{}

static void rtl8169_up(struct rtl8169_private *tp)
{}

static int rtl8169_close(struct net_device *dev)
{}

#ifdef CONFIG_NET_POLL_CONTROLLER
static void rtl8169_netpoll(struct net_device *dev)
{}
#endif

static int rtl_open(struct net_device *dev)
{}

static void
rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
{}

static void rtl8169_net_suspend(struct rtl8169_private *tp)
{}

static int rtl8169_runtime_resume(struct device *dev)
{}

static int rtl8169_suspend(struct device *device)
{}

static int rtl8169_resume(struct device *device)
{}

static int rtl8169_runtime_suspend(struct device *device)
{}

static int rtl8169_runtime_idle(struct device *device)
{}

static const struct dev_pm_ops rtl8169_pm_ops =;

static void rtl_shutdown(struct pci_dev *pdev)
{}

static void rtl_remove_one(struct pci_dev *pdev)
{}

static const struct net_device_ops rtl_netdev_ops =;

static void rtl_set_irq_mask(struct rtl8169_private *tp)
{}

static int rtl_alloc_irq(struct rtl8169_private *tp)
{}

static void rtl_read_mac_address(struct rtl8169_private *tp,
				 u8 mac_addr[ETH_ALEN])
{}

DECLARE_RTL_COND(rtl_link_list_ready_cond)
{}

static void r8168g_wait_ll_share_fifo_ready(struct rtl8169_private *tp)
{}

static int r8169_mdio_read_reg(struct mii_bus *mii_bus, int phyaddr, int phyreg)
{}

static int r8169_mdio_write_reg(struct mii_bus *mii_bus, int phyaddr,
				int phyreg, u16 val)
{}

static int r8169_mdio_register(struct rtl8169_private *tp)
{}

static void rtl_hw_init_8168g(struct rtl8169_private *tp)
{}

static void rtl_hw_init_8125(struct rtl8169_private *tp)
{}

static void rtl_hw_initialize(struct rtl8169_private *tp)
{}

static int rtl_jumbo_max(struct rtl8169_private *tp)
{}

static void rtl_init_mac_address(struct rtl8169_private *tp)
{}

/* register is set if system vendor successfully tested ASPM 1.2 */
static bool rtl_aspm_is_safe(struct rtl8169_private *tp)
{}

static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
{}

static struct pci_driver rtl8169_pci_driver =;

module_pci_driver();