lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <cd6c13c6-4629-cb2b-ee02-013e0af0fcfc@gmail.com>
Date:   Thu, 21 Dec 2017 21:50:22 +0100
From:   Heiner Kallweit <hkallweit1@...il.com>
To:     Andrew Lunn <andrew@...n.ch>,
        Realtek linux nic maintainers <nic_swsd@...ltek.com>,
        Chun-Hao Lin <hau@...ltek.com>
Cc:     David Miller <davem@...emloft.net>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>
Subject: [PATCH RFC 07/18] r8168: replace 8169 with 8168 in all relevant
 symbols

After separation from the r8169 driver, replace 8169 with 8168 in all
relevant symbols.

Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
---
 drivers/net/ethernet/realtek/r8168.c | 1066 +++++++++++++++++-----------------
 1 file changed, 533 insertions(+), 533 deletions(-)

diff --git a/drivers/net/ethernet/realtek/r8168.c b/drivers/net/ethernet/realtek/r8168.c
index 0ba0ac5ec..b0c4b5ea8 100644
--- a/drivers/net/ethernet/realtek/r8168.c
+++ b/drivers/net/ethernet/realtek/r8168.c
@@ -1,5 +1,5 @@
 /*
- * r8169.c: RealTek 8169/8168/8101 ethernet driver.
+ * r8168.c: RealTek 8168/8101 ethernet driver.
  *
  * Copyright (c) 2002 ShuChen <shuchen@...ltek.com.tw>
  * Copyright (c) 2003 - 2007 Francois Romieu <romieu@...zoreil.com>
@@ -33,7 +33,7 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
-#define RTL8169_VERSION "2.3LK-NAPI"
+#define RTL8168_VERSION "2.3LK-NAPI"
 #define MODULENAME "r8168"
 #define PFX MODULENAME ": "
 
@@ -57,7 +57,7 @@
 #define FIRMWARE_8107E_1	"rtl_nic/rtl8107e-1.fw"
 #define FIRMWARE_8107E_2	"rtl_nic/rtl8107e-2.fw"
 
-#ifdef RTL8169_DEBUG
+#ifdef RTL8168_DEBUG
 #define assert(expr) \
 	if (!(expr)) {					\
 		printk( "Assertion failed! %s,%s,%s,line=%d\n",	\
@@ -68,9 +68,9 @@
 #else
 #define assert(expr) do {} while (0)
 #define dprintk(fmt, args...)	do {} while (0)
-#endif /* RTL8169_DEBUG */
+#endif /* RTL8168_DEBUG */
 
-#define R8169_MSG_DEFAULT \
+#define R8168_MSG_DEFAULT \
 	(NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
 
 #define TX_SLOTS_AVAIL(tp) \
@@ -88,15 +88,15 @@ static const int multicast_filter_limit = 32;
 #define TX_DMA_BURST	7	/* Maximum PCI burst, '7' is unlimited */
 #define InterFrameGap	0x03	/* 3 means InterFrameGap = the shortest one */
 
-#define R8169_REGS_SIZE		256
-#define R8169_NAPI_WEIGHT	64
+#define R8168_REGS_SIZE		256
+#define R8168_NAPI_WEIGHT	64
 #define NUM_TX_DESC	64	/* Number of Tx descriptor registers */
 #define NUM_RX_DESC	256U	/* Number of Rx descriptor registers */
-#define R8169_TX_RING_BYTES	(NUM_TX_DESC * sizeof(struct TxDesc))
-#define R8169_RX_RING_BYTES	(NUM_RX_DESC * sizeof(struct RxDesc))
+#define R8168_TX_RING_BYTES	(NUM_TX_DESC * sizeof(struct TxDesc))
+#define R8168_RX_RING_BYTES	(NUM_RX_DESC * sizeof(struct RxDesc))
 
-#define RTL8169_TX_TIMEOUT	(6*HZ)
-#define RTL8169_PHY_TIMEOUT	(10*HZ)
+#define RTL8168_TX_TIMEOUT	(6*HZ)
+#define RTL8168_PHY_TIMEOUT	(10*HZ)
 
 /* write/read MMIO register */
 #define RTL_W8(reg, val8)	writeb ((val8), ioaddr + (reg))
@@ -617,7 +617,7 @@ enum rtl_register_content {
 	INTT_2		= 0x0002,	// 8168
 	INTT_3		= 0x0003,	// 8168
 
-	/* rtl8169_PHYstatus */
+	/* rtl8168_PHYstatus */
 	TBI_Enable	= 0x80,
 	TxFlowCtrl	= 0x40,
 	RxFlowCtrl	= 0x20,
@@ -724,7 +724,7 @@ enum features {
 	RTL_FEATURE_GMII	= (1 << 2),
 };
 
-struct rtl8169_counters {
+struct rtl8168_counters {
 	__le64	tx_packets;
 	__le64	rx_packets;
 	__le64	tx_errors;
@@ -740,7 +740,7 @@ struct rtl8169_counters {
 	__le16	tx_underun;
 };
 
-struct rtl8169_tc_offsets {
+struct rtl8168_tc_offsets {
 	bool	inited;
 	__le64	tx_errors;
 	__le32	tx_multi_collision;
@@ -755,13 +755,13 @@ enum rtl_flag {
 	RTL_FLAG_MAX
 };
 
-struct rtl8169_stats {
+struct rtl8168_stats {
 	u64			packets;
 	u64			bytes;
 	struct u64_stats_sync	syncp;
 };
 
-struct rtl8169_private {
+struct rtl8168_private {
 	void __iomem *mmio_addr;	/* memory map physical address */
 	struct pci_dev *pci_dev;
 	struct net_device *dev;
@@ -772,8 +772,8 @@ struct rtl8169_private {
 	u32 cur_rx; /* Index into the Rx descriptor buffer of next Rx pkt. */
 	u32 cur_tx; /* Index into the Tx descriptor buffer of next Rx pkt. */
 	u32 dirty_tx;
-	struct rtl8169_stats rx_stats;
-	struct rtl8169_stats tx_stats;
+	struct rtl8168_stats rx_stats;
+	struct rtl8168_stats tx_stats;
 	struct TxDesc *TxDescArray;	/* 256-aligned Tx descriptor ring */
 	struct RxDesc *RxDescArray;	/* 256-aligned Rx descriptor ring */
 	dma_addr_t TxPhyAddr;
@@ -787,27 +787,27 @@ struct rtl8169_private {
 	const struct rtl_coalesce_info *coalesce_info;
 
 	struct mdio_ops {
-		void (*write)(struct rtl8169_private *, int, int);
-		int (*read)(struct rtl8169_private *, int);
+		void (*write)(struct rtl8168_private *, int, int);
+		int (*read)(struct rtl8168_private *, int);
 	} mdio_ops;
 
 	struct pll_power_ops {
-		void (*down)(struct rtl8169_private *);
-		void (*up)(struct rtl8169_private *);
+		void (*down)(struct rtl8168_private *);
+		void (*up)(struct rtl8168_private *);
 	} pll_power_ops;
 
 	struct jumbo_ops {
-		void (*enable)(struct rtl8169_private *);
-		void (*disable)(struct rtl8169_private *);
+		void (*enable)(struct rtl8168_private *);
+		void (*disable)(struct rtl8168_private *);
 	} jumbo_ops;
 
 	struct csi_ops {
-		void (*write)(struct rtl8169_private *, int, int);
-		u32 (*read)(struct rtl8169_private *, int);
+		void (*write)(struct rtl8168_private *, int, int);
+		u32 (*read)(struct rtl8168_private *, int);
 	} csi_ops;
 
 	void (*hw_start)(struct net_device *);
-	bool (*tso_csum)(struct rtl8169_private *, struct sk_buff *, u32 *);
+	bool (*tso_csum)(struct rtl8168_private *, struct sk_buff *, u32 *);
 
 	struct {
 		DECLARE_BITMAP(flags, RTL_FLAG_MAX);
@@ -819,8 +819,8 @@ struct rtl8169_private {
 
 	struct mii_if_info mii;
 	dma_addr_t counters_phys_addr;
-	struct rtl8169_counters *counters;
-	struct rtl8169_tc_offsets tc_offset;
+	struct rtl8168_counters *counters;
+	struct rtl8168_tc_offsets tc_offset;
 	u32 saved_wolopts;
 	u32 opts1_mask;
 
@@ -841,14 +841,14 @@ struct rtl8169_private {
 	u32 ocp_base;
 };
 
-MODULE_AUTHOR("Realtek and the Linux r8169 crew <netdev@...r.kernel.org>");
-MODULE_DESCRIPTION("RealTek RTL-8169 Gigabit Ethernet driver");
+MODULE_AUTHOR("Realtek and the Linux r8168 crew <netdev@...r.kernel.org>");
+MODULE_DESCRIPTION("RealTek RTL-8168 Gigabit Ethernet driver");
 module_param(use_dac, int, 0);
 MODULE_PARM_DESC(use_dac, "Enable PCI DAC. Unsafe on 32 bit PCI slot.");
 module_param_named(debug, debug.msg_enable, int, 0);
 MODULE_PARM_DESC(debug, "Debug verbosity level (0=none, ..., 16=all)");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(RTL8169_VERSION);
+MODULE_VERSION(RTL8168_VERSION);
 MODULE_FIRMWARE(FIRMWARE_8168D_1);
 MODULE_FIRMWARE(FIRMWARE_8168D_2);
 MODULE_FIRMWARE(FIRMWARE_8168E_1);
@@ -869,12 +869,12 @@ MODULE_FIRMWARE(FIRMWARE_8168H_2);
 MODULE_FIRMWARE(FIRMWARE_8107E_1);
 MODULE_FIRMWARE(FIRMWARE_8107E_2);
 
-static void rtl_lock_work(struct rtl8169_private *tp)
+static void rtl_lock_work(struct rtl8168_private *tp)
 {
 	mutex_lock(&tp->wk.mutex);
 }
 
-static void rtl_unlock_work(struct rtl8169_private *tp)
+static void rtl_unlock_work(struct rtl8168_private *tp)
 {
 	mutex_unlock(&tp->wk.mutex);
 }
@@ -886,7 +886,7 @@ static void rtl_tx_performance_tweak(struct pci_dev *pdev, u16 force)
 }
 
 struct rtl_cond {
-	bool (*check)(struct rtl8169_private *);
+	bool (*check)(struct rtl8168_private *);
 	const char *msg;
 };
 
@@ -895,7 +895,7 @@ static void rtl_udelay(unsigned int d)
 	udelay(d);
 }
 
-static bool rtl_loop_wait(struct rtl8169_private *tp, const struct rtl_cond *c,
+static bool rtl_loop_wait(struct rtl8168_private *tp, const struct rtl_cond *c,
 			  void (*delay)(unsigned int), unsigned int d, int n,
 			  bool high)
 {
@@ -911,28 +911,28 @@ static bool rtl_loop_wait(struct rtl8169_private *tp, const struct rtl_cond *c,
 	return false;
 }
 
-static bool rtl_udelay_loop_wait_high(struct rtl8169_private *tp,
+static bool rtl_udelay_loop_wait_high(struct rtl8168_private *tp,
 				      const struct rtl_cond *c,
 				      unsigned int d, int n)
 {
 	return rtl_loop_wait(tp, c, rtl_udelay, d, n, true);
 }
 
-static bool rtl_udelay_loop_wait_low(struct rtl8169_private *tp,
+static bool rtl_udelay_loop_wait_low(struct rtl8168_private *tp,
 				     const struct rtl_cond *c,
 				     unsigned int d, int n)
 {
 	return rtl_loop_wait(tp, c, rtl_udelay, d, n, false);
 }
 
-static bool rtl_msleep_loop_wait_high(struct rtl8169_private *tp,
+static bool rtl_msleep_loop_wait_high(struct rtl8168_private *tp,
 				      const struct rtl_cond *c,
 				      unsigned int d, int n)
 {
 	return rtl_loop_wait(tp, c, msleep, d, n, true);
 }
 
-static bool rtl_msleep_loop_wait_low(struct rtl8169_private *tp,
+static bool rtl_msleep_loop_wait_low(struct rtl8168_private *tp,
 				     const struct rtl_cond *c,
 				     unsigned int d, int n)
 {
@@ -940,16 +940,16 @@ static bool rtl_msleep_loop_wait_low(struct rtl8169_private *tp,
 }
 
 #define DECLARE_RTL_COND(name)				\
-static bool name ## _check(struct rtl8169_private *);	\
+static bool name ## _check(struct rtl8168_private *);	\
 							\
 static const struct rtl_cond name = {			\
 	.check	= name ## _check,			\
 	.msg	= #name					\
 };							\
 							\
-static bool name ## _check(struct rtl8169_private *tp)
+static bool name ## _check(struct rtl8168_private *tp)
 
-static bool rtl_ocp_reg_failure(struct rtl8169_private *tp, u32 reg)
+static bool rtl_ocp_reg_failure(struct rtl8168_private *tp, u32 reg)
 {
 	if (reg & 0xffff0001) {
 		netif_err(tp, drv, tp->dev, "Invalid ocp reg %x!\n", reg);
@@ -965,7 +965,7 @@ DECLARE_RTL_COND(rtl_ocp_gphy_cond)
 	return RTL_R32(GPHY_OCP) & OCPAR_FLAG;
 }
 
-static void r8168_phy_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
+static void r8168_phy_ocp_write(struct rtl8168_private *tp, u32 reg, u32 data)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -977,7 +977,7 @@ static void r8168_phy_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
 	rtl_udelay_loop_wait_low(tp, &rtl_ocp_gphy_cond, 25, 10);
 }
 
-static u16 r8168_phy_ocp_read(struct rtl8169_private *tp, u32 reg)
+static u16 r8168_phy_ocp_read(struct rtl8168_private *tp, u32 reg)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -990,7 +990,7 @@ static u16 r8168_phy_ocp_read(struct rtl8169_private *tp, u32 reg)
 		(RTL_R32(GPHY_OCP) & 0xffff) : ~0;
 }
 
-static void r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
+static void r8168_mac_ocp_write(struct rtl8168_private *tp, u32 reg, u32 data)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1000,7 +1000,7 @@ static void r8168_mac_ocp_write(struct rtl8169_private *tp, u32 reg, u32 data)
 	RTL_W32(OCPDR, OCPAR_FLAG | (reg << 15) | data);
 }
 
-static u16 r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)
+static u16 r8168_mac_ocp_read(struct rtl8168_private *tp, u32 reg)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1014,7 +1014,7 @@ static u16 r8168_mac_ocp_read(struct rtl8169_private *tp, u32 reg)
 
 #define OCP_STD_PHY_BASE	0xa400
 
-static void r8168g_mdio_write(struct rtl8169_private *tp, int reg, int value)
+static void r8168g_mdio_write(struct rtl8168_private *tp, int reg, int value)
 {
 	if (reg == 0x1f) {
 		tp->ocp_base = value ? value << 4 : OCP_STD_PHY_BASE;
@@ -1027,7 +1027,7 @@ static void r8168g_mdio_write(struct rtl8169_private *tp, int reg, int value)
 	r8168_phy_ocp_write(tp, tp->ocp_base + reg * 2, value);
 }
 
-static int r8168g_mdio_read(struct rtl8169_private *tp, int reg)
+static int r8168g_mdio_read(struct rtl8168_private *tp, int reg)
 {
 	if (tp->ocp_base != OCP_STD_PHY_BASE)
 		reg -= 0x10;
@@ -1035,7 +1035,7 @@ static int r8168g_mdio_read(struct rtl8169_private *tp, int reg)
 	return r8168_phy_ocp_read(tp, tp->ocp_base + reg * 2);
 }
 
-static void mac_mcu_write(struct rtl8169_private *tp, int reg, int value)
+static void mac_mcu_write(struct rtl8168_private *tp, int reg, int value)
 {
 	if (reg == 0x1f) {
 		tp->ocp_base = value << 4;
@@ -1045,7 +1045,7 @@ static void mac_mcu_write(struct rtl8169_private *tp, int reg, int value)
 	r8168_mac_ocp_write(tp, tp->ocp_base + reg, value);
 }
 
-static int mac_mcu_read(struct rtl8169_private *tp, int reg)
+static int mac_mcu_read(struct rtl8168_private *tp, int reg)
 {
 	return r8168_mac_ocp_read(tp, tp->ocp_base + reg);
 }
@@ -1057,7 +1057,7 @@ DECLARE_RTL_COND(rtl_phyar_cond)
 	return RTL_R32(PHYAR) & 0x80000000;
 }
 
-static void r8169_mdio_write(struct rtl8169_private *tp, int reg, int value)
+static void r8168_mdio_write(struct rtl8168_private *tp, int reg, int value)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1071,7 +1071,7 @@ static void r8169_mdio_write(struct rtl8169_private *tp, int reg, int value)
 	udelay(20);
 }
 
-static int r8169_mdio_read(struct rtl8169_private *tp, int reg)
+static int r8168_mdio_read(struct rtl8168_private *tp, int reg)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	int value;
@@ -1097,7 +1097,7 @@ DECLARE_RTL_COND(rtl_ocpar_cond)
 	return RTL_R32(OCPAR) & OCPAR_FLAG;
 }
 
-static void r8168dp_1_mdio_access(struct rtl8169_private *tp, int reg, u32 data)
+static void r8168dp_1_mdio_access(struct rtl8168_private *tp, int reg, u32 data)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1108,13 +1108,13 @@ static void r8168dp_1_mdio_access(struct rtl8169_private *tp, int reg, u32 data)
 	rtl_udelay_loop_wait_low(tp, &rtl_ocpar_cond, 1000, 100);
 }
 
-static void r8168dp_1_mdio_write(struct rtl8169_private *tp, int reg, int value)
+static void r8168dp_1_mdio_write(struct rtl8168_private *tp, int reg, int value)
 {
 	r8168dp_1_mdio_access(tp, reg,
 			      OCPDR_WRITE_CMD | (value & OCPDR_DATA_MASK));
 }
 
-static int r8168dp_1_mdio_read(struct rtl8169_private *tp, int reg)
+static int r8168dp_1_mdio_read(struct rtl8168_private *tp, int reg)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1140,47 +1140,47 @@ static void r8168dp_2_mdio_stop(void __iomem *ioaddr)
 	RTL_W32(0xd0, RTL_R32(0xd0) | R8168DP_1_MDIO_ACCESS_BIT);
 }
 
-static void r8168dp_2_mdio_write(struct rtl8169_private *tp, int reg, int value)
+static void r8168dp_2_mdio_write(struct rtl8168_private *tp, int reg, int value)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	r8168dp_2_mdio_start(ioaddr);
 
-	r8169_mdio_write(tp, reg, value);
+	r8168_mdio_write(tp, reg, value);
 
 	r8168dp_2_mdio_stop(ioaddr);
 }
 
-static int r8168dp_2_mdio_read(struct rtl8169_private *tp, int reg)
+static int r8168dp_2_mdio_read(struct rtl8168_private *tp, int reg)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	int value;
 
 	r8168dp_2_mdio_start(ioaddr);
 
-	value = r8169_mdio_read(tp, reg);
+	value = r8168_mdio_read(tp, reg);
 
 	r8168dp_2_mdio_stop(ioaddr);
 
 	return value;
 }
 
-static void rtl_writephy(struct rtl8169_private *tp, int location, u32 val)
+static void rtl_writephy(struct rtl8168_private *tp, int location, u32 val)
 {
 	tp->mdio_ops.write(tp, location, val);
 }
 
-static int rtl_readphy(struct rtl8169_private *tp, int location)
+static int rtl_readphy(struct rtl8168_private *tp, int location)
 {
 	return tp->mdio_ops.read(tp, location);
 }
 
-static void rtl_patchphy(struct rtl8169_private *tp, int reg_addr, int value)
+static void rtl_patchphy(struct rtl8168_private *tp, int reg_addr, int value)
 {
 	rtl_writephy(tp, reg_addr, rtl_readphy(tp, reg_addr) | value);
 }
 
-static void rtl_w0w1_phy(struct rtl8169_private *tp, int reg_addr, int p, int m)
+static void rtl_w0w1_phy(struct rtl8168_private *tp, int reg_addr, int p, int m)
 {
 	int val;
 
@@ -1191,14 +1191,14 @@ static void rtl_w0w1_phy(struct rtl8169_private *tp, int reg_addr, int p, int m)
 static void rtl_mdio_write(struct net_device *dev, int phy_id, int location,
 			   int val)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	rtl_writephy(tp, location, val);
 }
 
 static int rtl_mdio_read(struct net_device *dev, int phy_id, int location)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	return rtl_readphy(tp, location);
 }
@@ -1210,7 +1210,7 @@ DECLARE_RTL_COND(rtl_ephyar_cond)
 	return RTL_R32(EPHYAR) & EPHYAR_FLAG;
 }
 
-static void rtl_ephy_write(struct rtl8169_private *tp, int reg_addr, int value)
+static void rtl_ephy_write(struct rtl8168_private *tp, int reg_addr, int value)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1222,7 +1222,7 @@ static void rtl_ephy_write(struct rtl8169_private *tp, int reg_addr, int value)
 	udelay(10);
 }
 
-static u16 rtl_ephy_read(struct rtl8169_private *tp, int reg_addr)
+static u16 rtl_ephy_read(struct rtl8168_private *tp, int reg_addr)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1239,7 +1239,7 @@ DECLARE_RTL_COND(rtl_eriar_cond)
 	return RTL_R32(ERIAR) & ERIAR_FLAG;
 }
 
-static void rtl_eri_write(struct rtl8169_private *tp, int addr, u32 mask,
+static void rtl_eri_write(struct rtl8168_private *tp, int addr, u32 mask,
 			  u32 val, int type)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
@@ -1251,7 +1251,7 @@ static void rtl_eri_write(struct rtl8169_private *tp, int addr, u32 mask,
 	rtl_udelay_loop_wait_low(tp, &rtl_eriar_cond, 100, 100);
 }
 
-static u32 rtl_eri_read(struct rtl8169_private *tp, int addr, int type)
+static u32 rtl_eri_read(struct rtl8168_private *tp, int addr, int type)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1261,7 +1261,7 @@ static u32 rtl_eri_read(struct rtl8169_private *tp, int addr, int type)
 		RTL_R32(ERIDR) : ~0;
 }
 
-static void rtl_w0w1_eri(struct rtl8169_private *tp, int addr, u32 mask, u32 p,
+static void rtl_w0w1_eri(struct rtl8168_private *tp, int addr, u32 mask, u32 p,
 			 u32 m, int type)
 {
 	u32 val;
@@ -1270,7 +1270,7 @@ static void rtl_w0w1_eri(struct rtl8169_private *tp, int addr, u32 mask, u32 p,
 	rtl_eri_write(tp, addr, mask, (val & ~m) | p, type);
 }
 
-static u32 r8168dp_ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
+static u32 r8168dp_ocp_read(struct rtl8168_private *tp, u8 mask, u16 reg)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1279,12 +1279,12 @@ static u32 r8168dp_ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
 		RTL_R32(OCPDR) : ~0;
 }
 
-static u32 r8168ep_ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
+static u32 r8168ep_ocp_read(struct rtl8168_private *tp, u8 mask, u16 reg)
 {
 	return rtl_eri_read(tp, reg, ERIAR_OOB);
 }
 
-static u32 ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
+static u32 ocp_read(struct rtl8168_private *tp, u8 mask, u16 reg)
 {
 	switch (tp->mac_version) {
 	case RTL_GIGA_MAC_VER_27:
@@ -1301,7 +1301,7 @@ static u32 ocp_read(struct rtl8169_private *tp, u8 mask, u16 reg)
 	}
 }
 
-static void r8168dp_ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg,
+static void r8168dp_ocp_write(struct rtl8168_private *tp, u8 mask, u16 reg,
 			      u32 data)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
@@ -1311,14 +1311,14 @@ static void r8168dp_ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg,
 	rtl_udelay_loop_wait_low(tp, &rtl_ocpar_cond, 100, 20);
 }
 
-static void r8168ep_ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg,
+static void r8168ep_ocp_write(struct rtl8168_private *tp, u8 mask, u16 reg,
 			      u32 data)
 {
 	rtl_eri_write(tp, reg, ((u32)mask & 0x0f) << ERIAR_MASK_SHIFT,
 		      data, ERIAR_OOB);
 }
 
-static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data)
+static void ocp_write(struct rtl8168_private *tp, u8 mask, u16 reg, u32 data)
 {
 	switch (tp->mac_version) {
 	case RTL_GIGA_MAC_VER_27:
@@ -1337,7 +1337,7 @@ static void ocp_write(struct rtl8169_private *tp, u8 mask, u16 reg, u32 data)
 	}
 }
 
-static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
+static void rtl8168_oob_notify(struct rtl8168_private *tp, u8 cmd)
 {
 	rtl_eri_write(tp, 0xe8, ERIAR_MASK_0001, cmd, ERIAR_EXGMAC);
 
@@ -1348,7 +1348,7 @@ static void rtl8168_oob_notify(struct rtl8169_private *tp, u8 cmd)
 #define OOB_CMD_DRIVER_START	0x05
 #define OOB_CMD_DRIVER_STOP	0x06
 
-static u16 rtl8168_get_ocp_reg(struct rtl8169_private *tp)
+static u16 rtl8168_get_ocp_reg(struct rtl8168_private *tp)
 {
 	return (tp->mac_version == RTL_GIGA_MAC_VER_31) ? 0xb8 : 0x10;
 }
@@ -1374,7 +1374,7 @@ DECLARE_RTL_COND(rtl_ocp_tx_cond)
 	return RTL_R8(IBISR0) & 0x02;
 }
 
-static void rtl8168ep_stop_cmac(struct rtl8169_private *tp)
+static void rtl8168ep_stop_cmac(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1384,20 +1384,20 @@ static void rtl8168ep_stop_cmac(struct rtl8169_private *tp)
 	RTL_W8(IBCR0, RTL_R8(IBCR0) & ~0x01);
 }
 
-static void rtl8168dp_driver_start(struct rtl8169_private *tp)
+static void rtl8168dp_driver_start(struct rtl8168_private *tp)
 {
 	rtl8168_oob_notify(tp, OOB_CMD_DRIVER_START);
 	rtl_msleep_loop_wait_high(tp, &rtl_ocp_read_cond, 10, 10);
 }
 
-static void rtl8168ep_driver_start(struct rtl8169_private *tp)
+static void rtl8168ep_driver_start(struct rtl8168_private *tp)
 {
 	ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_START);
 	ocp_write(tp, 0x01, 0x30, ocp_read(tp, 0x01, 0x30) | 0x01);
 	rtl_msleep_loop_wait_high(tp, &rtl_ep_ocp_read_cond, 10, 10);
 }
 
-static void rtl8168_driver_start(struct rtl8169_private *tp)
+static void rtl8168_driver_start(struct rtl8168_private *tp)
 {
 	switch (tp->mac_version) {
 	case RTL_GIGA_MAC_VER_27:
@@ -1416,13 +1416,13 @@ static void rtl8168_driver_start(struct rtl8169_private *tp)
 	}
 }
 
-static void rtl8168dp_driver_stop(struct rtl8169_private *tp)
+static void rtl8168dp_driver_stop(struct rtl8168_private *tp)
 {
 	rtl8168_oob_notify(tp, OOB_CMD_DRIVER_STOP);
 	rtl_msleep_loop_wait_low(tp, &rtl_ocp_read_cond, 10, 10);
 }
 
-static void rtl8168ep_driver_stop(struct rtl8169_private *tp)
+static void rtl8168ep_driver_stop(struct rtl8168_private *tp)
 {
 	rtl8168ep_stop_cmac(tp);
 	ocp_write(tp, 0x01, 0x180, OOB_CMD_DRIVER_STOP);
@@ -1430,7 +1430,7 @@ static void rtl8168ep_driver_stop(struct rtl8169_private *tp)
 	rtl_msleep_loop_wait_low(tp, &rtl_ep_ocp_read_cond, 10, 10);
 }
 
-static void rtl8168_driver_stop(struct rtl8169_private *tp)
+static void rtl8168_driver_stop(struct rtl8168_private *tp)
 {
 	switch (tp->mac_version) {
 	case RTL_GIGA_MAC_VER_27:
@@ -1449,19 +1449,19 @@ static void rtl8168_driver_stop(struct rtl8169_private *tp)
 	}
 }
 
-static int r8168dp_check_dash(struct rtl8169_private *tp)
+static int r8168dp_check_dash(struct rtl8168_private *tp)
 {
 	u16 reg = rtl8168_get_ocp_reg(tp);
 
 	return (ocp_read(tp, 0x0f, reg) & 0x00008000) ? 1 : 0;
 }
 
-static int r8168ep_check_dash(struct rtl8169_private *tp)
+static int r8168ep_check_dash(struct rtl8168_private *tp)
 {
 	return (ocp_read(tp, 0x0f, 0x128) & 0x00000001) ? 1 : 0;
 }
 
-static int r8168_check_dash(struct rtl8169_private *tp)
+static int r8168_check_dash(struct rtl8168_private *tp)
 {
 	switch (tp->mac_version) {
 	case RTL_GIGA_MAC_VER_27:
@@ -1483,7 +1483,7 @@ struct exgmac_reg {
 	u32 val;
 };
 
-static void rtl_write_exgmac_batch(struct rtl8169_private *tp,
+static void rtl_write_exgmac_batch(struct rtl8168_private *tp,
 				   const struct exgmac_reg *r, int len)
 {
 	while (len-- > 0) {
@@ -1499,7 +1499,7 @@ DECLARE_RTL_COND(rtl_efusear_cond)
 	return RTL_R32(EFUSEAR) & EFUSEAR_FLAG;
 }
 
-static u8 rtl8168d_efuse_read(struct rtl8169_private *tp, int reg_addr)
+static u8 rtl8168d_efuse_read(struct rtl8168_private *tp, int reg_addr)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1509,14 +1509,14 @@ static u8 rtl8168d_efuse_read(struct rtl8169_private *tp, int reg_addr)
 		RTL_R32(EFUSEAR) & EFUSEAR_DATA_MASK : ~0;
 }
 
-static u16 rtl_get_events(struct rtl8169_private *tp)
+static u16 rtl_get_events(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	return RTL_R16(IntrStatus);
 }
 
-static void rtl_ack_events(struct rtl8169_private *tp, u16 bits)
+static void rtl_ack_events(struct rtl8168_private *tp, u16 bits)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1524,7 +1524,7 @@ static void rtl_ack_events(struct rtl8169_private *tp, u16 bits)
 	mmiowb();
 }
 
-static void rtl_irq_disable(struct rtl8169_private *tp)
+static void rtl_irq_disable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1532,7 +1532,7 @@ static void rtl_irq_disable(struct rtl8169_private *tp)
 	mmiowb();
 }
 
-static void rtl_irq_enable(struct rtl8169_private *tp, u16 bits)
+static void rtl_irq_enable(struct rtl8168_private *tp, u16 bits)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1543,12 +1543,12 @@ static void rtl_irq_enable(struct rtl8169_private *tp, u16 bits)
 #define RTL_EVENT_NAPI_TX	(TxOK | TxErr)
 #define RTL_EVENT_NAPI		(RTL_EVENT_NAPI_RX | RTL_EVENT_NAPI_TX)
 
-static void rtl_irq_enable_all(struct rtl8169_private *tp)
+static void rtl_irq_enable_all(struct rtl8168_private *tp)
 {
 	rtl_irq_enable(tp, RTL_EVENT_NAPI | tp->event_slow);
 }
 
-static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp)
+static void rtl8168_irq_mask_and_ack(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -1557,17 +1557,17 @@ static void rtl8169_irq_mask_and_ack(struct rtl8169_private *tp)
 	RTL_R8(ChipCmd);
 }
 
-static unsigned int rtl8169_xmii_reset_pending(struct rtl8169_private *tp)
+static unsigned int rtl8168_xmii_reset_pending(struct rtl8168_private *tp)
 {
 	return rtl_readphy(tp, MII_BMCR) & BMCR_RESET;
 }
 
-static unsigned int rtl8169_xmii_link_ok(void __iomem *ioaddr)
+static unsigned int rtl8168_xmii_link_ok(void __iomem *ioaddr)
 {
 	return RTL_R8(PHYstatus) & LinkStatus;
 }
 
-static void rtl8169_xmii_reset_enable(struct rtl8169_private *tp)
+static void rtl8168_xmii_reset_enable(struct rtl8168_private *tp)
 {
 	unsigned int val;
 
@@ -1575,7 +1575,7 @@ static void rtl8169_xmii_reset_enable(struct rtl8169_private *tp)
 	rtl_writephy(tp, MII_BMCR, val & 0xffff);
 }
 
-static void rtl_link_chg_patch(struct rtl8169_private *tp)
+static void rtl_link_chg_patch(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct net_device *dev = tp->dev;
@@ -1632,11 +1632,11 @@ static void rtl_link_chg_patch(struct rtl8169_private *tp)
 	}
 }
 
-static void __rtl8169_check_link_status(struct net_device *dev,
-					struct rtl8169_private *tp,
+static void __rtl8168_check_link_status(struct net_device *dev,
+					struct rtl8168_private *tp,
 					void __iomem *ioaddr, bool pm)
 {
-	if (rtl8169_xmii_link_ok(ioaddr)) {
+	if (rtl8168_xmii_link_ok(ioaddr)) {
 		rtl_link_chg_patch(tp);
 		/* This is to cancel a scheduled suspend if there's one. */
 		if (pm)
@@ -1652,16 +1652,16 @@ static void __rtl8169_check_link_status(struct net_device *dev,
 	}
 }
 
-static void rtl8169_check_link_status(struct net_device *dev,
-				      struct rtl8169_private *tp,
+static void rtl8168_check_link_status(struct net_device *dev,
+				      struct rtl8168_private *tp,
 				      void __iomem *ioaddr)
 {
-	__rtl8169_check_link_status(dev, tp, ioaddr, false);
+	__rtl8168_check_link_status(dev, tp, ioaddr, false);
 }
 
 #define WAKE_ANY (WAKE_PHY | WAKE_MAGIC | WAKE_UCAST | WAKE_BCAST | WAKE_MCAST)
 
-static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
+static u32 __rtl8168_get_wol(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	u8 options;
@@ -1712,9 +1712,9 @@ static u32 __rtl8169_get_wol(struct rtl8169_private *tp)
 	return wolopts;
 }
 
-static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+static void rtl8168_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct device *d = &tp->pci_dev->dev;
 
 	pm_runtime_get_noresume(d);
@@ -1723,7 +1723,7 @@ static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 
 	wol->supported = WAKE_ANY;
 	if (pm_runtime_active(d))
-		wol->wolopts = __rtl8169_get_wol(tp);
+		wol->wolopts = __rtl8168_get_wol(tp);
 	else
 		wol->wolopts = tp->saved_wolopts;
 
@@ -1732,7 +1732,7 @@ static void rtl8169_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 	pm_runtime_put_noidle(d);
 }
 
-static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
+static void __rtl8168_set_wol(struct rtl8168_private *tp, u32 wolopts)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	unsigned int i, tmp;
@@ -1816,9 +1816,9 @@ static void __rtl8169_set_wol(struct rtl8169_private *tp, u32 wolopts)
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 }
 
-static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+static int rtl8168_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct device *d = &tp->pci_dev->dev;
 
 	pm_runtime_get_noresume(d);
@@ -1830,7 +1830,7 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 	else
 		tp->features &= ~RTL_FEATURE_WOL;
 	if (pm_runtime_active(d))
-		__rtl8169_set_wol(tp, wol->wolopts);
+		__rtl8168_set_wol(tp, wol->wolopts);
 	else
 		tp->saved_wolopts = wol->wolopts;
 
@@ -1843,19 +1843,19 @@ static int rtl8169_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
 	return 0;
 }
 
-static const char *rtl_lookup_firmware_name(struct rtl8169_private *tp)
+static const char *rtl_lookup_firmware_name(struct rtl8168_private *tp)
 {
 	return rtl_chip_infos[tp->mac_version].fw_name;
 }
 
-static void rtl8169_get_drvinfo(struct net_device *dev,
+static void rtl8168_get_drvinfo(struct net_device *dev,
 				struct ethtool_drvinfo *info)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct rtl_fw *rtl_fw = tp->rtl_fw;
 
 	strlcpy(info->driver, MODULENAME, sizeof(info->driver));
-	strlcpy(info->version, RTL8169_VERSION, sizeof(info->version));
+	strlcpy(info->version, RTL8168_VERSION, sizeof(info->version));
 	strlcpy(info->bus_info, pci_name(tp->pci_dev), sizeof(info->bus_info));
 	BUILD_BUG_ON(sizeof(info->fw_version) < sizeof(rtl_fw->version));
 	if (!IS_ERR_OR_NULL(rtl_fw))
@@ -1863,15 +1863,15 @@ static void rtl8169_get_drvinfo(struct net_device *dev,
 			sizeof(info->fw_version));
 }
 
-static int rtl8169_get_regs_len(struct net_device *dev)
+static int rtl8168_get_regs_len(struct net_device *dev)
 {
-	return R8169_REGS_SIZE;
+	return R8168_REGS_SIZE;
 }
 
-static int rtl8169_set_speed_xmii(struct net_device *dev,
+static int rtl8168_set_speed_xmii(struct net_device *dev,
 				  u8 autoneg, u16 speed, u8 duplex, u32 adv)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	int giga_ctrl, bmcr;
 	int rc = -EINVAL;
 
@@ -1934,29 +1934,29 @@ static int rtl8169_set_speed_xmii(struct net_device *dev,
 	return rc;
 }
 
-static int rtl8169_set_speed(struct net_device *dev,
+static int rtl8168_set_speed(struct net_device *dev,
 			     u8 autoneg, u16 speed, u8 duplex, u32 advertising)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	int ret;
 
-	ret = rtl8169_set_speed_xmii(dev, autoneg, speed, duplex, advertising);
+	ret = rtl8168_set_speed_xmii(dev, autoneg, speed, duplex, advertising);
 	if (ret < 0)
 		goto out;
 
 	if (netif_running(dev) && (autoneg == AUTONEG_ENABLE) &&
 	    (advertising & ADVERTISED_1000baseT_Full) &&
 	    !pci_is_pcie(tp->pci_dev)) {
-		mod_timer(&tp->timer, jiffies + RTL8169_PHY_TIMEOUT);
+		mod_timer(&tp->timer, jiffies + RTL8168_PHY_TIMEOUT);
 	}
 out:
 	return ret;
 }
 
-static netdev_features_t rtl8169_fix_features(struct net_device *dev,
+static netdev_features_t rtl8168_fix_features(struct net_device *dev,
 	netdev_features_t features)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	if (dev->mtu > TD_MSS_MAX)
 		features &= ~NETIF_F_ALL_TSO;
@@ -1968,10 +1968,10 @@ static netdev_features_t rtl8169_fix_features(struct net_device *dev,
 	return features;
 }
 
-static void __rtl8169_set_features(struct net_device *dev,
+static void __rtl8168_set_features(struct net_device *dev,
 				   netdev_features_t features)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 	u32 rx_config;
 
@@ -1999,29 +1999,29 @@ static void __rtl8169_set_features(struct net_device *dev,
 	RTL_R16(CPlusCmd);
 }
 
-static int rtl8169_set_features(struct net_device *dev,
+static int rtl8168_set_features(struct net_device *dev,
 				netdev_features_t features)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	features &= NETIF_F_RXALL | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX;
 
 	rtl_lock_work(tp);
 	if (features ^ dev->features)
-		__rtl8169_set_features(dev, features);
+		__rtl8168_set_features(dev, features);
 	rtl_unlock_work(tp);
 
 	return 0;
 }
 
 
-static inline u32 rtl8169_tx_vlan_tag(struct sk_buff *skb)
+static inline u32 rtl8168_tx_vlan_tag(struct sk_buff *skb)
 {
 	return (skb_vlan_tag_present(skb)) ?
 		TxVlanTag | swab16(skb_vlan_tag_get(skb)) : 0x00;
 }
 
-static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb)
+static void rtl8168_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb)
 {
 	u32 opts2 = le32_to_cpu(desc->opts2);
 
@@ -2029,33 +2029,33 @@ static void rtl8169_rx_vlan_tag(struct RxDesc *desc, struct sk_buff *skb)
 		__vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), swab16(opts2 & 0xffff));
 }
 
-static int rtl8169_get_link_ksettings_xmii(struct net_device *dev,
+static int rtl8168_get_link_ksettings_xmii(struct net_device *dev,
 					   struct ethtool_link_ksettings *cmd)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	mii_ethtool_get_link_ksettings(&tp->mii, cmd);
 
 	return 0;
 }
 
-static int rtl8169_get_link_ksettings(struct net_device *dev,
+static int rtl8168_get_link_ksettings(struct net_device *dev,
 				      struct ethtool_link_ksettings *cmd)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	int rc;
 
 	rtl_lock_work(tp);
-	rc = rtl8169_get_link_ksettings_xmii(dev, cmd);
+	rc = rtl8168_get_link_ksettings_xmii(dev, cmd);
 	rtl_unlock_work(tp);
 
 	return rc;
 }
 
-static int rtl8169_set_link_ksettings(struct net_device *dev,
+static int rtl8168_set_link_ksettings(struct net_device *dev,
 				      const struct ethtool_link_ksettings *cmd)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	int rc;
 	u32 advertising;
 
@@ -2066,42 +2066,42 @@ static int rtl8169_set_link_ksettings(struct net_device *dev,
 	del_timer_sync(&tp->timer);
 
 	rtl_lock_work(tp);
-	rc = rtl8169_set_speed(dev, cmd->base.autoneg, cmd->base.speed,
+	rc = rtl8168_set_speed(dev, cmd->base.autoneg, cmd->base.speed,
 			       cmd->base.duplex, advertising);
 	rtl_unlock_work(tp);
 
 	return rc;
 }
 
-static void rtl8169_get_regs(struct net_device *dev, struct ethtool_regs *regs,
+static void rtl8168_get_regs(struct net_device *dev, struct ethtool_regs *regs,
 			     void *p)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	u32 __iomem *data = tp->mmio_addr;
 	u32 *dw = p;
 	int i;
 
 	rtl_lock_work(tp);
-	for (i = 0; i < R8169_REGS_SIZE; i += 4)
+	for (i = 0; i < R8168_REGS_SIZE; i += 4)
 		memcpy_fromio(dw++, data++, 4);
 	rtl_unlock_work(tp);
 }
 
-static u32 rtl8169_get_msglevel(struct net_device *dev)
+static u32 rtl8168_get_msglevel(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	return tp->msg_enable;
 }
 
-static void rtl8169_set_msglevel(struct net_device *dev, u32 value)
+static void rtl8168_set_msglevel(struct net_device *dev, u32 value)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	tp->msg_enable = value;
 }
 
-static const char rtl8169_gstrings[][ETH_GSTRING_LEN] = {
+static const char rtl8168_gstrings[][ETH_GSTRING_LEN] = {
 	"tx_packets",
 	"rx_packets",
 	"tx_errors",
@@ -2117,11 +2117,11 @@ static const char rtl8169_gstrings[][ETH_GSTRING_LEN] = {
 	"tx_underrun",
 };
 
-static int rtl8169_get_sset_count(struct net_device *dev, int sset)
+static int rtl8168_get_sset_count(struct net_device *dev, int sset)
 {
 	switch (sset) {
 	case ETH_SS_STATS:
-		return ARRAY_SIZE(rtl8169_gstrings);
+		return ARRAY_SIZE(rtl8168_gstrings);
 	default:
 		return -EOPNOTSUPP;
 	}
@@ -2134,9 +2134,9 @@ DECLARE_RTL_COND(rtl_counters_cond)
 	return RTL_R32(CounterAddrLow) & (CounterReset | CounterDump);
 }
 
-static bool rtl8169_do_counters(struct net_device *dev, u32 counter_cmd)
+static bool rtl8168_do_counters(struct net_device *dev, u32 counter_cmd)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 	dma_addr_t paddr = tp->counters_phys_addr;
 	u32 cmd;
@@ -2155,9 +2155,9 @@ static bool rtl8169_do_counters(struct net_device *dev, u32 counter_cmd)
 	return ret;
 }
 
-static bool rtl8169_reset_counters(struct net_device *dev)
+static bool rtl8168_reset_counters(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	/*
 	 * Versions prior to RTL_GIGA_MAC_VER_19 don't support resetting the
@@ -2166,12 +2166,12 @@ static bool rtl8169_reset_counters(struct net_device *dev)
 	if (tp->mac_version < RTL_GIGA_MAC_VER_19)
 		return true;
 
-	return rtl8169_do_counters(dev, CounterReset);
+	return rtl8168_do_counters(dev, CounterReset);
 }
 
-static bool rtl8169_update_counters(struct net_device *dev)
+static bool rtl8168_update_counters(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	/*
@@ -2181,17 +2181,17 @@ static bool rtl8169_update_counters(struct net_device *dev)
 	if ((RTL_R8(ChipCmd) & CmdRxEnb) == 0)
 		return true;
 
-	return rtl8169_do_counters(dev, CounterDump);
+	return rtl8168_do_counters(dev, CounterDump);
 }
 
-static bool rtl8169_init_counter_offsets(struct net_device *dev)
+static bool rtl8168_init_counter_offsets(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
-	struct rtl8169_counters *counters = tp->counters;
+	struct rtl8168_private *tp = netdev_priv(dev);
+	struct rtl8168_counters *counters = tp->counters;
 	bool ret = false;
 
 	/*
-	 * rtl8169_init_counter_offsets is called from rtl_open.  On chip
+	 * rtl8168_init_counter_offsets is called from rtl_open.  On chip
 	 * versions prior to RTL_GIGA_MAC_VER_19 the tally counters are only
 	 * reset by a power cycle, while the counter values collected by the
 	 * driver are reset at every driver unload/load cycle.
@@ -2200,8 +2200,8 @@ static bool rtl8169_init_counter_offsets(struct net_device *dev)
 	 * values, we collect the initial values at first open(*) and use them
 	 * as offsets to normalize the values returned by @get_stats64.
 	 *
-	 * (*) We can't call rtl8169_init_counter_offsets from rtl_init_one
-	 * for the reason stated in rtl8169_update_counters; CmdRxEnb is only
+	 * (*) We can't call rtl8168_init_counter_offsets from rtl_init_one
+	 * for the reason stated in rtl8168_update_counters; CmdRxEnb is only
 	 * set at open time by rtl_hw_start.
 	 */
 
@@ -2209,10 +2209,10 @@ static bool rtl8169_init_counter_offsets(struct net_device *dev)
 		return true;
 
 	/* If both, reset and update fail, propagate to caller. */
-	if (rtl8169_reset_counters(dev))
+	if (rtl8168_reset_counters(dev))
 		ret = true;
 
-	if (rtl8169_update_counters(dev))
+	if (rtl8168_update_counters(dev))
 		ret = true;
 
 	tp->tc_offset.tx_errors = counters->tx_errors;
@@ -2223,19 +2223,19 @@ static bool rtl8169_init_counter_offsets(struct net_device *dev)
 	return ret;
 }
 
-static void rtl8169_get_ethtool_stats(struct net_device *dev,
+static void rtl8168_get_ethtool_stats(struct net_device *dev,
 				      struct ethtool_stats *stats, u64 *data)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct device *d = &tp->pci_dev->dev;
-	struct rtl8169_counters *counters = tp->counters;
+	struct rtl8168_counters *counters = tp->counters;
 
 	ASSERT_RTNL();
 
 	pm_runtime_get_noresume(d);
 
 	if (pm_runtime_active(d))
-		rtl8169_update_counters(dev);
+		rtl8168_update_counters(dev);
 
 	pm_runtime_put_noidle(d);
 
@@ -2254,18 +2254,18 @@ static void rtl8169_get_ethtool_stats(struct net_device *dev,
 	data[12] = le16_to_cpu(counters->tx_underun);
 }
 
-static void rtl8169_get_strings(struct net_device *dev, u32 stringset, u8 *data)
+static void rtl8168_get_strings(struct net_device *dev, u32 stringset, u8 *data)
 {
 	switch(stringset) {
 	case ETH_SS_STATS:
-		memcpy(data, *rtl8169_gstrings, sizeof(rtl8169_gstrings));
+		memcpy(data, *rtl8168_gstrings, sizeof(rtl8168_gstrings));
 		break;
 	}
 }
 
-static int rtl8169_nway_reset(struct net_device *dev)
+static int rtl8168_nway_reset(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	return mii_nway_restart(&tp->mii);
 }
@@ -2337,12 +2337,12 @@ static const struct rtl_coalesce_info rtl_coalesce_info_8168_8136[] = {
 /* get rx/tx scale vector corresponding to current speed */
 static const struct rtl_coalesce_info *rtl_coalesce_info(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct ethtool_link_ksettings ecmd;
 	const struct rtl_coalesce_info *ci;
 	int rc;
 
-	rc = rtl8169_get_link_ksettings(dev, &ecmd);
+	rc = rtl8168_get_link_ksettings(dev, &ecmd);
 	if (rc < 0)
 		return ERR_PTR(rc);
 
@@ -2357,7 +2357,7 @@ static const struct rtl_coalesce_info *rtl_coalesce_info(struct net_device *dev)
 
 static int rtl_get_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 	const struct rtl_coalesce_info *ci;
 	const struct rtl_coalesce_scale *scale;
@@ -2427,7 +2427,7 @@ static const struct rtl_coalesce_scale *rtl_coalesce_choose_scale(
 
 static int rtl_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 	const struct rtl_coalesce_scale *scale;
 	struct {
@@ -2487,27 +2487,27 @@ static int rtl_set_coalesce(struct net_device *dev, struct ethtool_coalesce *ec)
 	return 0;
 }
 
-static const struct ethtool_ops rtl8169_ethtool_ops = {
-	.get_drvinfo		= rtl8169_get_drvinfo,
-	.get_regs_len		= rtl8169_get_regs_len,
+static const struct ethtool_ops rtl8168_ethtool_ops = {
+	.get_drvinfo		= rtl8168_get_drvinfo,
+	.get_regs_len		= rtl8168_get_regs_len,
 	.get_link		= ethtool_op_get_link,
 	.get_coalesce		= rtl_get_coalesce,
 	.set_coalesce		= rtl_set_coalesce,
-	.get_msglevel		= rtl8169_get_msglevel,
-	.set_msglevel		= rtl8169_set_msglevel,
-	.get_regs		= rtl8169_get_regs,
-	.get_wol		= rtl8169_get_wol,
-	.set_wol		= rtl8169_set_wol,
-	.get_strings		= rtl8169_get_strings,
-	.get_sset_count		= rtl8169_get_sset_count,
-	.get_ethtool_stats	= rtl8169_get_ethtool_stats,
+	.get_msglevel		= rtl8168_get_msglevel,
+	.set_msglevel		= rtl8168_set_msglevel,
+	.get_regs		= rtl8168_get_regs,
+	.get_wol		= rtl8168_get_wol,
+	.set_wol		= rtl8168_set_wol,
+	.get_strings		= rtl8168_get_strings,
+	.get_sset_count		= rtl8168_get_sset_count,
+	.get_ethtool_stats	= rtl8168_get_ethtool_stats,
 	.get_ts_info		= ethtool_op_get_ts_info,
-	.nway_reset		= rtl8169_nway_reset,
-	.get_link_ksettings	= rtl8169_get_link_ksettings,
-	.set_link_ksettings	= rtl8169_set_link_ksettings,
+	.nway_reset		= rtl8168_nway_reset,
+	.get_link_ksettings	= rtl8168_get_link_ksettings,
+	.set_link_ksettings	= rtl8168_set_link_ksettings,
 };
 
-static void rtl8169_get_mac_version(struct rtl8169_private *tp,
+static void rtl8168_get_mac_version(struct rtl8168_private *tp,
 				    struct net_device *dev, u8 default_version)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
@@ -2642,7 +2642,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
 	}
 }
 
-static void rtl8169_print_mac_version(struct rtl8169_private *tp)
+static void rtl8168_print_mac_version(struct rtl8168_private *tp)
 {
 	dprintk("mac_version = 0x%02x\n", tp->mac_version);
 }
@@ -2652,7 +2652,7 @@ struct phy_reg {
 	u16 val;
 };
 
-static void rtl_writephy_batch(struct rtl8169_private *tp,
+static void rtl_writephy_batch(struct rtl8168_private *tp,
 			       const struct phy_reg *regs, int len)
 {
 	while (len-- > 0) {
@@ -2685,7 +2685,7 @@ struct fw_info {
 
 #define FW_OPCODE_SIZE	sizeof(typeof(*((struct rtl_fw_phy_action *)0)->code))
 
-static bool rtl_fw_format_ok(struct rtl8169_private *tp, struct rtl_fw *rtl_fw)
+static bool rtl_fw_format_ok(struct rtl8168_private *tp, struct rtl_fw *rtl_fw)
 {
 	const struct firmware *fw = rtl_fw->fw;
 	struct fw_info *fw_info = (struct fw_info *)fw->data;
@@ -2736,7 +2736,7 @@ static bool rtl_fw_format_ok(struct rtl8169_private *tp, struct rtl_fw *rtl_fw)
 	return rc;
 }
 
-static bool rtl_fw_data_ok(struct rtl8169_private *tp, struct net_device *dev,
+static bool rtl_fw_data_ok(struct rtl8168_private *tp, struct net_device *dev,
 			   struct rtl_fw_phy_action *pa)
 {
 	bool rc = false;
@@ -2792,7 +2792,7 @@ static bool rtl_fw_data_ok(struct rtl8169_private *tp, struct net_device *dev,
 	return rc;
 }
 
-static int rtl_check_firmware(struct rtl8169_private *tp, struct rtl_fw *rtl_fw)
+static int rtl_check_firmware(struct rtl8168_private *tp, struct rtl_fw *rtl_fw)
 {
 	struct net_device *dev = tp->dev;
 	int rc = -EINVAL;
@@ -2808,7 +2808,7 @@ static int rtl_check_firmware(struct rtl8169_private *tp, struct rtl_fw *rtl_fw)
 	return rc;
 }
 
-static void rtl_phy_write_fw(struct rtl8169_private *tp, struct rtl_fw *rtl_fw)
+static void rtl_phy_write_fw(struct rtl8168_private *tp, struct rtl_fw *rtl_fw)
 {
 	struct rtl_fw_phy_action *pa = &rtl_fw->phy_action;
 	struct mdio_ops org, *ops = &tp->mdio_ops;
@@ -2897,7 +2897,7 @@ static void rtl_phy_write_fw(struct rtl8169_private *tp, struct rtl_fw *rtl_fw)
 	ops->read = org.read;
 }
 
-static void rtl_release_firmware(struct rtl8169_private *tp)
+static void rtl_release_firmware(struct rtl8168_private *tp)
 {
 	if (!IS_ERR_OR_NULL(tp->rtl_fw)) {
 		release_firmware(tp->rtl_fw->fw);
@@ -2906,7 +2906,7 @@ static void rtl_release_firmware(struct rtl8169_private *tp)
 	tp->rtl_fw = RTL_FIRMWARE_UNKNOWN;
 }
 
-static void rtl_apply_firmware(struct rtl8169_private *tp)
+static void rtl_apply_firmware(struct rtl8168_private *tp)
 {
 	struct rtl_fw *rtl_fw = tp->rtl_fw;
 
@@ -2915,7 +2915,7 @@ static void rtl_apply_firmware(struct rtl8169_private *tp)
 		rtl_phy_write_fw(tp, rtl_fw);
 }
 
-static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
+static void rtl_apply_firmware_cond(struct rtl8168_private *tp, u8 reg, u16 val)
 {
 	if (rtl_readphy(tp, reg) != val)
 		netif_warn(tp, hw, tp->dev, "chipset not ready for firmware\n");
@@ -2923,7 +2923,7 @@ static void rtl_apply_firmware_cond(struct rtl8169_private *tp, u8 reg, u16 val)
 		rtl_apply_firmware(tp);
 }
 
-static void rtl8168bb_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168bb_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x10, 0xf41b },
@@ -2936,7 +2936,7 @@ static void rtl8168bb_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
-static void rtl8168bef_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168bef_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0001 },
@@ -2947,7 +2947,7 @@ static void rtl8168bef_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
-static void rtl8168cp_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168cp_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0000 },
@@ -2960,7 +2960,7 @@ static void rtl8168cp_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
-static void rtl8168cp_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168cp_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0001 },
@@ -2975,7 +2975,7 @@ static void rtl8168cp_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
-static void rtl8168c_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168c_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0001 },
@@ -3004,7 +3004,7 @@ static void rtl8168c_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168c_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168c_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0001 },
@@ -3032,7 +3032,7 @@ static void rtl8168c_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168c_3_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168c_3_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0001 },
@@ -3054,12 +3054,12 @@ static void rtl8168c_3_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168c_4_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168c_4_hw_phy_config(struct rtl8168_private *tp)
 {
 	rtl8168c_3_hw_phy_config(tp);
 }
 
-static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168d_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init_0[] = {
 		/* Channel Estimation */
@@ -3170,7 +3170,7 @@ static void rtl8168d_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168d_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init_0[] = {
 		/* Channel Estimation */
@@ -3272,7 +3272,7 @@ static void rtl8168d_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168d_3_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168d_3_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0002 },
@@ -3333,7 +3333,7 @@ static void rtl8168d_3_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
-static void rtl8168d_4_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168d_4_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0001 },
@@ -3349,7 +3349,7 @@ static void rtl8168d_4_hw_phy_config(struct rtl8169_private *tp)
 	rtl_patchphy(tp, 0x0d, 1 << 5);
 }
 
-static void rtl8168e_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168e_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		/* Enable Delay cap */
@@ -3422,7 +3422,7 @@ static void rtl8168e_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x0d, 0x0000);
 }
 
-static void rtl_rar_exgmac_set(struct rtl8169_private *tp, u8 *addr)
+static void rtl_rar_exgmac_set(struct rtl8168_private *tp, u8 *addr)
 {
 	const u16 w[] = {
 		addr[0] | (addr[1] << 8),
@@ -3439,7 +3439,7 @@ static void rtl_rar_exgmac_set(struct rtl8169_private *tp, u8 *addr)
 	rtl_write_exgmac_batch(tp, e, ARRAY_SIZE(e));
 }
 
-static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168e_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		/* Enable Delay cap */
@@ -3531,7 +3531,7 @@ static void rtl8168e_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_rar_exgmac_set(tp, tp->dev->dev_addr);
 }
 
-static void rtl8168f_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168f_hw_phy_config(struct rtl8168_private *tp)
 {
 	/* For 4-corner performance improve */
 	rtl_writephy(tp, 0x1f, 0x0005);
@@ -3553,7 +3553,7 @@ static void rtl8168f_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168f_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168f_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		/* Channel estimation fine tune */
@@ -3603,14 +3603,14 @@ static void rtl8168f_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168f_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168f_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	rtl_apply_firmware(tp);
 
 	rtl8168f_hw_phy_config(tp);
 }
 
-static void rtl8411_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8411_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		/* Channel estimation fine tune */
@@ -3707,7 +3707,7 @@ static void rtl8411_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168g_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	rtl_apply_firmware(tp);
 
@@ -3773,12 +3773,12 @@ static void rtl8168g_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168g_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168g_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	rtl_apply_firmware(tp);
 }
 
-static void rtl8168h_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168h_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	u16 dout_tapbin;
 	u32 data;
@@ -3888,7 +3888,7 @@ static void rtl8168h_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168h_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168h_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	u16 ioffset_p3, ioffset_p2, ioffset_p1, ioffset_p0;
 	u16 rlen;
@@ -3961,7 +3961,7 @@ static void rtl8168h_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168ep_1_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168ep_1_hw_phy_config(struct rtl8168_private *tp)
 {
 	/* Enable PHY auto speed down */
 	rtl_writephy(tp, 0x1f, 0x0a44);
@@ -4003,7 +4003,7 @@ static void rtl8168ep_1_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8168ep_2_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8168ep_2_hw_phy_config(struct rtl8168_private *tp)
 {
 	/* patch 10M & ALDPS */
 	rtl_writephy(tp, 0x1f, 0x0bcc);
@@ -4094,7 +4094,7 @@ static void rtl8168ep_2_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8102e_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0003 },
@@ -4111,7 +4111,7 @@ static void rtl8102e_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
-static void rtl8105e_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8105e_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0005 },
@@ -4137,7 +4137,7 @@ static void rtl8105e_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy_batch(tp, phy_reg_init, ARRAY_SIZE(phy_reg_init));
 }
 
-static void rtl8402_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8402_hw_phy_config(struct rtl8168_private *tp)
 {
 	/* Disable ALDPS before setting firmware */
 	rtl_writephy(tp, 0x1f, 0x0000);
@@ -4154,7 +4154,7 @@ static void rtl8402_hw_phy_config(struct rtl8169_private *tp)
 	rtl_writephy(tp, 0x1f, 0x0000);
 }
 
-static void rtl8106e_hw_phy_config(struct rtl8169_private *tp)
+static void rtl8106e_hw_phy_config(struct rtl8168_private *tp)
 {
 	static const struct phy_reg phy_reg_init[] = {
 		{ 0x1f, 0x0004 },
@@ -4178,9 +4178,9 @@ static void rtl8106e_hw_phy_config(struct rtl8169_private *tp)
 
 static void rtl_hw_phy_config(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
-	rtl8169_print_mac_version(tp);
+	rtl8168_print_mac_version(tp);
 
 	switch (tp->mac_version) {
 	case RTL_GIGA_MAC_VER_07:
@@ -4292,15 +4292,15 @@ static void rtl_hw_phy_config(struct net_device *dev)
 	}
 }
 
-static void rtl_phy_work(struct rtl8169_private *tp)
+static void rtl_phy_work(struct rtl8168_private *tp)
 {
 	struct timer_list *timer = &tp->timer;
 	void __iomem *ioaddr = tp->mmio_addr;
-	unsigned long timeout = RTL8169_PHY_TIMEOUT;
+	unsigned long timeout = RTL8168_PHY_TIMEOUT;
 
 	assert(tp->mac_version > RTL_GIGA_MAC_VER_01);
 
-	if (rtl8169_xmii_reset_pending(tp)) {
+	if (rtl8168_xmii_reset_pending(tp)) {
 		/*
 		 * A busy loop could burn quite a few cycles on nowadays CPU.
 		 * Let's delay the execution of the timer for a few ticks.
@@ -4309,51 +4309,51 @@ static void rtl_phy_work(struct rtl8169_private *tp)
 		goto out_mod_timer;
 	}
 
-	if (rtl8169_xmii_link_ok(ioaddr))
+	if (rtl8168_xmii_link_ok(ioaddr))
 		return;
 
 	netif_dbg(tp, link, tp->dev, "PHY reset until link up\n");
 
-	rtl8169_xmii_reset_enable(tp);
+	rtl8168_xmii_reset_enable(tp);
 
 out_mod_timer:
 	mod_timer(timer, jiffies + timeout);
 }
 
-static void rtl_schedule_task(struct rtl8169_private *tp, enum rtl_flag flag)
+static void rtl_schedule_task(struct rtl8168_private *tp, enum rtl_flag flag)
 {
 	if (!test_and_set_bit(flag, tp->wk.flags))
 		schedule_work(&tp->wk.work);
 }
 
-static void rtl8169_phy_timer(struct timer_list *t)
+static void rtl8168_phy_timer(struct timer_list *t)
 {
-	struct rtl8169_private *tp = from_timer(tp, t, timer);
+	struct rtl8168_private *tp = from_timer(tp, t, timer);
 
 	rtl_schedule_task(tp, RTL_FLAG_TASK_PHY_PENDING);
 }
 
 DECLARE_RTL_COND(rtl_phy_reset_cond)
 {
-	return rtl8169_xmii_reset_pending(tp);
+	return rtl8168_xmii_reset_pending(tp);
 }
 
-static void rtl8169_phy_reset(struct net_device *dev,
-			      struct rtl8169_private *tp)
+static void rtl8168_phy_reset(struct net_device *dev,
+			      struct rtl8168_private *tp)
 {
-	rtl8169_xmii_reset_enable(tp);
+	rtl8168_xmii_reset_enable(tp);
 	rtl_msleep_loop_wait_low(tp, &rtl_phy_reset_cond, 1, 100);
 }
 
-static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
+static void rtl8168_init_phy(struct net_device *dev, struct rtl8168_private *tp)
 {
 	rtl_hw_phy_config(dev);
 
 	pci_write_config_byte(tp->pci_dev, PCI_LATENCY_TIMER, 0x40);
 
-	rtl8169_phy_reset(dev, tp);
+	rtl8168_phy_reset(dev, tp);
 
-	rtl8169_set_speed(dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
+	rtl8168_set_speed(dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
 			  ADVERTISED_10baseT_Half | ADVERTISED_10baseT_Full |
 			  ADVERTISED_100baseT_Half | ADVERTISED_100baseT_Full |
 			  (tp->mii.supports_gmii ?
@@ -4361,7 +4361,7 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
 			   ADVERTISED_1000baseT_Full : 0));
 }
 
-static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
+static void rtl_rar_set(struct rtl8168_private *tp, u8 *addr)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4385,7 +4385,7 @@ static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
 
 static int rtl_set_mac_address(struct net_device *dev, void *p)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct device *d = &tp->pci_dev->dev;
 	struct sockaddr *addr = p;
 
@@ -4404,7 +4404,7 @@ static int rtl_set_mac_address(struct net_device *dev, void *p)
 	return 0;
 }
 
-static int rtl_xmii_ioctl(struct rtl8169_private *tp,
+static int rtl_xmii_ioctl(struct rtl8168_private *tp,
 			  struct mii_ioctl_data *data, int cmd)
 {
 	switch (cmd) {
@@ -4423,15 +4423,15 @@ static int rtl_xmii_ioctl(struct rtl8169_private *tp,
 	return -EOPNOTSUPP;
 }
 
-static int rtl8169_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+static int rtl8168_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct mii_ioctl_data *data = if_mii(ifr);
 
 	return netif_running(dev) ? rtl_xmii_ioctl(tp, data, cmd) : -ENODEV;
 }
 
-static void rtl_init_mdio_ops(struct rtl8169_private *tp)
+static void rtl_init_mdio_ops(struct rtl8168_private *tp)
 {
 	struct mdio_ops *ops = &tp->mdio_ops;
 
@@ -4461,13 +4461,13 @@ static void rtl_init_mdio_ops(struct rtl8169_private *tp)
 		ops->read	= r8168g_mdio_read;
 		break;
 	default:
-		ops->write	= r8169_mdio_write;
-		ops->read	= r8169_mdio_read;
+		ops->write	= r8168_mdio_write;
+		ops->read	= r8168_mdio_read;
 		break;
 	}
 }
 
-static void rtl_speed_down(struct rtl8169_private *tp)
+static void rtl_speed_down(struct rtl8168_private *tp)
 {
 	u32 adv;
 	int lpa;
@@ -4487,11 +4487,11 @@ static void rtl_speed_down(struct rtl8169_private *tp)
 		       ADVERTISED_1000baseT_Half |
 		       ADVERTISED_1000baseT_Full : 0);
 
-	rtl8169_set_speed(tp->dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
+	rtl8168_set_speed(tp->dev, AUTONEG_ENABLE, SPEED_1000, DUPLEX_FULL,
 			  adv);
 }
 
-static void rtl_wol_suspend_quirk(struct rtl8169_private *tp)
+static void rtl_wol_suspend_quirk(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4526,9 +4526,9 @@ static void rtl_wol_suspend_quirk(struct rtl8169_private *tp)
 	}
 }
 
-static bool rtl_wol_pll_power_down(struct rtl8169_private *tp)
+static bool rtl_wol_pll_power_down(struct rtl8168_private *tp)
 {
-	if (!(__rtl8169_get_wol(tp) & WAKE_ANY))
+	if (!(__rtl8168_get_wol(tp) & WAKE_ANY))
 		return false;
 
 	rtl_speed_down(tp);
@@ -4537,19 +4537,19 @@ static bool rtl_wol_pll_power_down(struct rtl8169_private *tp)
 	return true;
 }
 
-static void r810x_phy_power_down(struct rtl8169_private *tp)
+static void r810x_phy_power_down(struct rtl8168_private *tp)
 {
 	rtl_writephy(tp, 0x1f, 0x0000);
 	rtl_writephy(tp, MII_BMCR, BMCR_PDOWN);
 }
 
-static void r810x_phy_power_up(struct rtl8169_private *tp)
+static void r810x_phy_power_up(struct rtl8168_private *tp)
 {
 	rtl_writephy(tp, 0x1f, 0x0000);
 	rtl_writephy(tp, MII_BMCR, BMCR_ANENABLE);
 }
 
-static void r810x_pll_power_down(struct rtl8169_private *tp)
+static void r810x_pll_power_down(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4572,7 +4572,7 @@ static void r810x_pll_power_down(struct rtl8169_private *tp)
 	}
 }
 
-static void r810x_pll_power_up(struct rtl8169_private *tp)
+static void r810x_pll_power_up(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4596,7 +4596,7 @@ static void r810x_pll_power_up(struct rtl8169_private *tp)
 	}
 }
 
-static void r8168_phy_power_up(struct rtl8169_private *tp)
+static void r8168_phy_power_up(struct rtl8168_private *tp)
 {
 	rtl_writephy(tp, 0x1f, 0x0000);
 	switch (tp->mac_version) {
@@ -4623,7 +4623,7 @@ static void r8168_phy_power_up(struct rtl8169_private *tp)
 	rtl_writephy(tp, MII_BMCR, BMCR_ANENABLE);
 }
 
-static void r8168_phy_power_down(struct rtl8169_private *tp)
+static void r8168_phy_power_down(struct rtl8168_private *tp)
 {
 	rtl_writephy(tp, 0x1f, 0x0000);
 	switch (tp->mac_version) {
@@ -4656,7 +4656,7 @@ static void r8168_phy_power_down(struct rtl8169_private *tp)
 	}
 }
 
-static void r8168_pll_power_down(struct rtl8169_private *tp)
+static void r8168_pll_power_down(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4710,7 +4710,7 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
 	}
 }
 
-static void r8168_pll_power_up(struct rtl8169_private *tp)
+static void r8168_pll_power_up(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4743,24 +4743,24 @@ static void r8168_pll_power_up(struct rtl8169_private *tp)
 	r8168_phy_power_up(tp);
 }
 
-static void rtl_generic_op(struct rtl8169_private *tp,
-			   void (*op)(struct rtl8169_private *))
+static void rtl_generic_op(struct rtl8168_private *tp,
+			   void (*op)(struct rtl8168_private *))
 {
 	if (op)
 		op(tp);
 }
 
-static void rtl_pll_power_down(struct rtl8169_private *tp)
+static void rtl_pll_power_down(struct rtl8168_private *tp)
 {
 	rtl_generic_op(tp, tp->pll_power_ops.down);
 }
 
-static void rtl_pll_power_up(struct rtl8169_private *tp)
+static void rtl_pll_power_up(struct rtl8168_private *tp)
 {
 	rtl_generic_op(tp, tp->pll_power_ops.up);
 }
 
-static void rtl_init_pll_power_ops(struct rtl8169_private *tp)
+static void rtl_init_pll_power_ops(struct rtl8168_private *tp)
 {
 	struct pll_power_ops *ops = &tp->pll_power_ops;
 
@@ -4822,7 +4822,7 @@ static void rtl_init_pll_power_ops(struct rtl8169_private *tp)
 	}
 }
 
-static void rtl_init_rxcfg(struct rtl8169_private *tp)
+static void rtl_init_rxcfg(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4868,12 +4868,12 @@ static void rtl_init_rxcfg(struct rtl8169_private *tp)
 	}
 }
 
-static void rtl8169_init_ring_indexes(struct rtl8169_private *tp)
+static void rtl8168_init_ring_indexes(struct rtl8168_private *tp)
 {
 	tp->dirty_tx = tp->cur_tx = tp->cur_rx = 0;
 }
 
-static void rtl_hw_jumbo_enable(struct rtl8169_private *tp)
+static void rtl_hw_jumbo_enable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4882,7 +4882,7 @@ static void rtl_hw_jumbo_enable(struct rtl8169_private *tp)
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 }
 
-static void rtl_hw_jumbo_disable(struct rtl8169_private *tp)
+static void rtl_hw_jumbo_disable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4891,7 +4891,7 @@ static void rtl_hw_jumbo_disable(struct rtl8169_private *tp)
 	RTL_W8(Cfg9346, Cfg9346_Lock);
 }
 
-static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp)
+static void r8168c_hw_jumbo_enable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4900,7 +4900,7 @@ static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp)
 	rtl_tx_performance_tweak(tp->pci_dev, PCI_EXP_DEVCTL_READRQ_512B);
 }
 
-static void r8168c_hw_jumbo_disable(struct rtl8169_private *tp)
+static void r8168c_hw_jumbo_disable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4909,21 +4909,21 @@ static void r8168c_hw_jumbo_disable(struct rtl8169_private *tp)
 	rtl_tx_performance_tweak(tp->pci_dev, 0x5 << MAX_READ_REQUEST_SHIFT);
 }
 
-static void r8168dp_hw_jumbo_enable(struct rtl8169_private *tp)
+static void r8168dp_hw_jumbo_enable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	RTL_W8(Config3, RTL_R8(Config3) | Jumbo_En0);
 }
 
-static void r8168dp_hw_jumbo_disable(struct rtl8169_private *tp)
+static void r8168dp_hw_jumbo_disable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	RTL_W8(Config3, RTL_R8(Config3) & ~Jumbo_En0);
 }
 
-static void r8168e_hw_jumbo_enable(struct rtl8169_private *tp)
+static void r8168e_hw_jumbo_enable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4933,7 +4933,7 @@ static void r8168e_hw_jumbo_enable(struct rtl8169_private *tp)
 	rtl_tx_performance_tweak(tp->pci_dev, PCI_EXP_DEVCTL_READRQ_512B);
 }
 
-static void r8168e_hw_jumbo_disable(struct rtl8169_private *tp)
+static void r8168e_hw_jumbo_disable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4943,19 +4943,19 @@ static void r8168e_hw_jumbo_disable(struct rtl8169_private *tp)
 	rtl_tx_performance_tweak(tp->pci_dev, 0x5 << MAX_READ_REQUEST_SHIFT);
 }
 
-static void r8168b_0_hw_jumbo_enable(struct rtl8169_private *tp)
+static void r8168b_0_hw_jumbo_enable(struct rtl8168_private *tp)
 {
 	rtl_tx_performance_tweak(tp->pci_dev,
 		PCI_EXP_DEVCTL_READRQ_512B | PCI_EXP_DEVCTL_NOSNOOP_EN);
 }
 
-static void r8168b_0_hw_jumbo_disable(struct rtl8169_private *tp)
+static void r8168b_0_hw_jumbo_disable(struct rtl8168_private *tp)
 {
 	rtl_tx_performance_tweak(tp->pci_dev,
 		(0x5 << MAX_READ_REQUEST_SHIFT) | PCI_EXP_DEVCTL_NOSNOOP_EN);
 }
 
-static void r8168b_1_hw_jumbo_enable(struct rtl8169_private *tp)
+static void r8168b_1_hw_jumbo_enable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4964,7 +4964,7 @@ static void r8168b_1_hw_jumbo_enable(struct rtl8169_private *tp)
 	RTL_W8(Config4, RTL_R8(Config4) | (1 << 0));
 }
 
-static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp)
+static void r8168b_1_hw_jumbo_disable(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -4973,7 +4973,7 @@ static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp)
 	RTL_W8(Config4, RTL_R8(Config4) & ~(1 << 0));
 }
 
-static void rtl_init_jumbo_ops(struct rtl8169_private *tp)
+static void rtl_init_jumbo_ops(struct rtl8168_private *tp)
 {
 	struct jumbo_ops *ops = &tp->jumbo_ops;
 
@@ -5042,7 +5042,7 @@ DECLARE_RTL_COND(rtl_chipcmd_cond)
 	return RTL_R8(ChipCmd) & CmdReset;
 }
 
-static void rtl_hw_reset(struct rtl8169_private *tp)
+static void rtl_hw_reset(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5051,7 +5051,7 @@ static void rtl_hw_reset(struct rtl8169_private *tp)
 	rtl_udelay_loop_wait_low(tp, &rtl_chipcmd_cond, 100, 100);
 }
 
-static void rtl_request_uncached_firmware(struct rtl8169_private *tp)
+static void rtl_request_uncached_firmware(struct rtl8168_private *tp)
 {
 	struct rtl_fw *rtl_fw;
 	const char *name;
@@ -5089,13 +5089,13 @@ static void rtl_request_uncached_firmware(struct rtl8169_private *tp)
 	goto out;
 }
 
-static void rtl_request_firmware(struct rtl8169_private *tp)
+static void rtl_request_firmware(struct rtl8168_private *tp)
 {
 	if (IS_ERR(tp->rtl_fw))
 		rtl_request_uncached_firmware(tp);
 }
 
-static void rtl_rx_close(struct rtl8169_private *tp)
+static void rtl_rx_close(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5116,12 +5116,12 @@ DECLARE_RTL_COND(rtl_txcfg_empty_cond)
 	return RTL_R32(TxConfig) & TXCFG_EMPTY;
 }
 
-static void rtl8169_hw_reset(struct rtl8169_private *tp)
+static void rtl8168_hw_reset(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	/* Disable interrupts */
-	rtl8169_irq_mask_and_ack(tp);
+	rtl8168_irq_mask_and_ack(tp);
 
 	rtl_rx_close(tp);
 
@@ -5156,7 +5156,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
 	rtl_hw_reset(tp);
 }
 
-static void rtl_set_rx_tx_config_registers(struct rtl8169_private *tp)
+static void rtl_set_rx_tx_config_registers(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5167,14 +5167,14 @@ static void rtl_set_rx_tx_config_registers(struct rtl8169_private *tp)
 
 static void rtl_hw_start(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	tp->hw_start(dev);
 
 	rtl_irq_enable_all(tp);
 }
 
-static void rtl_set_rx_tx_desc_registers(struct rtl8169_private *tp,
+static void rtl_set_rx_tx_desc_registers(struct rtl8168_private *tp,
 					 void __iomem *ioaddr)
 {
 	/*
@@ -5205,7 +5205,7 @@ static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)
 
 static void rtl_set_rx_mode(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 	u32 mc_filter[2];	/* Multicast hash filter */
 	int rx_mode;
@@ -5255,7 +5255,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
 
 static void rtl_hw_start_8169(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
@@ -5291,18 +5291,18 @@ static void rtl_hw_start_8169(struct net_device *dev)
 	RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);
 }
 
-static void rtl_csi_write(struct rtl8169_private *tp, int addr, int value)
+static void rtl_csi_write(struct rtl8168_private *tp, int addr, int value)
 {
 	if (tp->csi_ops.write)
 		tp->csi_ops.write(tp, addr, value);
 }
 
-static u32 rtl_csi_read(struct rtl8169_private *tp, int addr)
+static u32 rtl_csi_read(struct rtl8168_private *tp, int addr)
 {
 	return tp->csi_ops.read ? tp->csi_ops.read(tp, addr) : ~0;
 }
 
-static void rtl_csi_access_enable(struct rtl8169_private *tp, u32 bits)
+static void rtl_csi_access_enable(struct rtl8168_private *tp, u32 bits)
 {
 	u32 csi;
 
@@ -5310,12 +5310,12 @@ static void rtl_csi_access_enable(struct rtl8169_private *tp, u32 bits)
 	rtl_csi_write(tp, 0x070c, csi | bits);
 }
 
-static void rtl_csi_access_enable_1(struct rtl8169_private *tp)
+static void rtl_csi_access_enable_1(struct rtl8168_private *tp)
 {
 	rtl_csi_access_enable(tp, 0x17000000);
 }
 
-static void rtl_csi_access_enable_2(struct rtl8169_private *tp)
+static void rtl_csi_access_enable_2(struct rtl8168_private *tp)
 {
 	rtl_csi_access_enable(tp, 0x27000000);
 }
@@ -5327,7 +5327,7 @@ DECLARE_RTL_COND(rtl_csiar_cond)
 	return RTL_R32(CSIAR) & CSIAR_FLAG;
 }
 
-static void r8169_csi_write(struct rtl8169_private *tp, int addr, int value)
+static void r8168_csi_write(struct rtl8168_private *tp, int addr, int value)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5338,7 +5338,7 @@ static void r8169_csi_write(struct rtl8169_private *tp, int addr, int value)
 	rtl_udelay_loop_wait_low(tp, &rtl_csiar_cond, 10, 100);
 }
 
-static u32 r8169_csi_read(struct rtl8169_private *tp, int addr)
+static u32 r8168_csi_read(struct rtl8168_private *tp, int addr)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5349,7 +5349,7 @@ static u32 r8169_csi_read(struct rtl8169_private *tp, int addr)
 		RTL_R32(CSIDR) : ~0;
 }
 
-static void r8402_csi_write(struct rtl8169_private *tp, int addr, int value)
+static void r8402_csi_write(struct rtl8168_private *tp, int addr, int value)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5361,7 +5361,7 @@ static void r8402_csi_write(struct rtl8169_private *tp, int addr, int value)
 	rtl_udelay_loop_wait_low(tp, &rtl_csiar_cond, 10, 100);
 }
 
-static u32 r8402_csi_read(struct rtl8169_private *tp, int addr)
+static u32 r8402_csi_read(struct rtl8168_private *tp, int addr)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5372,7 +5372,7 @@ static u32 r8402_csi_read(struct rtl8169_private *tp, int addr)
 		RTL_R32(CSIDR) : ~0;
 }
 
-static void r8411_csi_write(struct rtl8169_private *tp, int addr, int value)
+static void r8411_csi_write(struct rtl8168_private *tp, int addr, int value)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5384,7 +5384,7 @@ static void r8411_csi_write(struct rtl8169_private *tp, int addr, int value)
 	rtl_udelay_loop_wait_low(tp, &rtl_csiar_cond, 10, 100);
 }
 
-static u32 r8411_csi_read(struct rtl8169_private *tp, int addr)
+static u32 r8411_csi_read(struct rtl8168_private *tp, int addr)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5395,7 +5395,7 @@ static u32 r8411_csi_read(struct rtl8169_private *tp, int addr)
 		RTL_R32(CSIDR) : ~0;
 }
 
-static void rtl_init_csi_ops(struct rtl8169_private *tp)
+static void rtl_init_csi_ops(struct rtl8168_private *tp)
 {
 	struct csi_ops *ops = &tp->csi_ops;
 
@@ -5424,8 +5424,8 @@ static void rtl_init_csi_ops(struct rtl8169_private *tp)
 		break;
 
 	default:
-		ops->write	= r8169_csi_write;
-		ops->read	= r8169_csi_read;
+		ops->write	= r8168_csi_write;
+		ops->read	= r8168_csi_read;
 		break;
 	}
 }
@@ -5436,7 +5436,7 @@ struct ephy_info {
 	u16 bits;
 };
 
-static void rtl_ephy_init(struct rtl8169_private *tp, const struct ephy_info *e,
+static void rtl_ephy_init(struct rtl8168_private *tp, const struct ephy_info *e,
 			  int len)
 {
 	u16 w;
@@ -5460,7 +5460,7 @@ static void rtl_enable_clock_request(struct pci_dev *pdev)
 				 PCI_EXP_LNKCTL_CLKREQ_EN);
 }
 
-static void rtl_pcie_state_l2l3_enable(struct rtl8169_private *tp, bool enable)
+static void rtl_pcie_state_l2l3_enable(struct rtl8168_private *tp, bool enable)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	u8 data;
@@ -5486,7 +5486,7 @@ static void rtl_pcie_state_l2l3_enable(struct rtl8169_private *tp, bool enable)
 	PktCntrDisable | \
 	Mac_dbgo_sel)
 
-static void rtl_hw_start_8168bb(struct rtl8169_private *tp)
+static void rtl_hw_start_8168bb(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5501,7 +5501,7 @@ static void rtl_hw_start_8168bb(struct rtl8169_private *tp)
 	}
 }
 
-static void rtl_hw_start_8168bef(struct rtl8169_private *tp)
+static void rtl_hw_start_8168bef(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -5512,7 +5512,7 @@ static void rtl_hw_start_8168bef(struct rtl8169_private *tp)
 	RTL_W8(Config4, RTL_R8(Config4) & ~(1 << 0));
 }
 
-static void __rtl_hw_start_8168cp(struct rtl8169_private *tp)
+static void __rtl_hw_start_8168cp(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5529,7 +5529,7 @@ static void __rtl_hw_start_8168cp(struct rtl8169_private *tp)
 	RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
 }
 
-static void rtl_hw_start_8168cp_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8168cp_1(struct rtl8168_private *tp)
 {
 	static const struct ephy_info e_info_8168cp[] = {
 		{ 0x01, 0,	0x0001 },
@@ -5546,7 +5546,7 @@ static void rtl_hw_start_8168cp_1(struct rtl8169_private *tp)
 	__rtl_hw_start_8168cp(tp);
 }
 
-static void rtl_hw_start_8168cp_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8168cp_2(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5561,7 +5561,7 @@ static void rtl_hw_start_8168cp_2(struct rtl8169_private *tp)
 	RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
 }
 
-static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp)
+static void rtl_hw_start_8168cp_3(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5581,7 +5581,7 @@ static void rtl_hw_start_8168cp_3(struct rtl8169_private *tp)
 	RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
 }
 
-static void rtl_hw_start_8168c_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8168c_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8168c_1[] = {
@@ -5599,7 +5599,7 @@ static void rtl_hw_start_8168c_1(struct rtl8169_private *tp)
 	__rtl_hw_start_8168cp(tp);
 }
 
-static void rtl_hw_start_8168c_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8168c_2(struct rtl8168_private *tp)
 {
 	static const struct ephy_info e_info_8168c_2[] = {
 		{ 0x01, 0,	0x0001 },
@@ -5613,19 +5613,19 @@ static void rtl_hw_start_8168c_2(struct rtl8169_private *tp)
 	__rtl_hw_start_8168cp(tp);
 }
 
-static void rtl_hw_start_8168c_3(struct rtl8169_private *tp)
+static void rtl_hw_start_8168c_3(struct rtl8168_private *tp)
 {
 	rtl_hw_start_8168c_2(tp);
 }
 
-static void rtl_hw_start_8168c_4(struct rtl8169_private *tp)
+static void rtl_hw_start_8168c_4(struct rtl8168_private *tp)
 {
 	rtl_csi_access_enable_2(tp);
 
 	__rtl_hw_start_8168cp(tp);
 }
 
-static void rtl_hw_start_8168d(struct rtl8169_private *tp)
+static void rtl_hw_start_8168d(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5642,7 +5642,7 @@ static void rtl_hw_start_8168d(struct rtl8169_private *tp)
 	RTL_W16(CPlusCmd, RTL_R16(CPlusCmd) & ~R8168_CPCMD_QUIRK_MASK);
 }
 
-static void rtl_hw_start_8168dp(struct rtl8169_private *tp)
+static void rtl_hw_start_8168dp(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5657,7 +5657,7 @@ static void rtl_hw_start_8168dp(struct rtl8169_private *tp)
 	rtl_disable_clock_request(pdev);
 }
 
-static void rtl_hw_start_8168d_4(struct rtl8169_private *tp)
+static void rtl_hw_start_8168d_4(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5678,7 +5678,7 @@ static void rtl_hw_start_8168d_4(struct rtl8169_private *tp)
 	rtl_enable_clock_request(pdev);
 }
 
-static void rtl_hw_start_8168e_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8168e_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5716,7 +5716,7 @@ static void rtl_hw_start_8168e_1(struct rtl8169_private *tp)
 	RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
 }
 
-static void rtl_hw_start_8168e_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8168e_2(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5756,7 +5756,7 @@ static void rtl_hw_start_8168e_2(struct rtl8169_private *tp)
 	RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
 }
 
-static void rtl_hw_start_8168f(struct rtl8169_private *tp)
+static void rtl_hw_start_8168f(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5787,7 +5787,7 @@ static void rtl_hw_start_8168f(struct rtl8169_private *tp)
 	RTL_W8(Config5, RTL_R8(Config5) & ~Spi_en);
 }
 
-static void rtl_hw_start_8168f_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8168f_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8168f_1[] = {
@@ -5807,7 +5807,7 @@ static void rtl_hw_start_8168f_1(struct rtl8169_private *tp)
 	RTL_W8(EEE_LED, RTL_R8(EEE_LED) & ~0x07);
 }
 
-static void rtl_hw_start_8411(struct rtl8169_private *tp)
+static void rtl_hw_start_8411(struct rtl8168_private *tp)
 {
 	static const struct ephy_info e_info_8168f_1[] = {
 		{ 0x06, 0x00c0,	0x0020 },
@@ -5824,7 +5824,7 @@ static void rtl_hw_start_8411(struct rtl8169_private *tp)
 	rtl_w0w1_eri(tp, 0x0d4, ERIAR_MASK_0011, 0x0c00, 0x0000, ERIAR_EXGMAC);
 }
 
-static void rtl_hw_start_8168g(struct rtl8169_private *tp)
+static void rtl_hw_start_8168g(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -5859,7 +5859,7 @@ static void rtl_hw_start_8168g(struct rtl8169_private *tp)
 	rtl_pcie_state_l2l3_enable(tp, false);
 }
 
-static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8168g_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8168g_1[] = {
@@ -5877,7 +5877,7 @@ static void rtl_hw_start_8168g_1(struct rtl8169_private *tp)
 	rtl_ephy_init(tp, e_info_8168g_1, ARRAY_SIZE(e_info_8168g_1));
 }
 
-static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8168g_2(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8168g_2[] = {
@@ -5895,7 +5895,7 @@ static void rtl_hw_start_8168g_2(struct rtl8169_private *tp)
 	rtl_ephy_init(tp, e_info_8168g_2, ARRAY_SIZE(e_info_8168g_2));
 }
 
-static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8411_2(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8411_2[] = {
@@ -5914,7 +5914,7 @@ static void rtl_hw_start_8411_2(struct rtl8169_private *tp)
 	rtl_ephy_init(tp, e_info_8411_2, ARRAY_SIZE(e_info_8411_2));
 }
 
-static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8168h_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -6012,7 +6012,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
 	r8168_mac_ocp_write(tp, 0xc09e, 0x0000);
 }
 
-static void rtl_hw_start_8168ep(struct rtl8169_private *tp)
+static void rtl_hw_start_8168ep(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -6053,7 +6053,7 @@ static void rtl_hw_start_8168ep(struct rtl8169_private *tp)
 	rtl_pcie_state_l2l3_enable(tp, false);
 }
 
-static void rtl_hw_start_8168ep_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8168ep_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8168ep_1[] = {
@@ -6072,7 +6072,7 @@ static void rtl_hw_start_8168ep_1(struct rtl8169_private *tp)
 	rtl_hw_start_8168ep(tp);
 }
 
-static void rtl_hw_start_8168ep_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8168ep_2(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8168ep_2[] = {
@@ -6092,7 +6092,7 @@ static void rtl_hw_start_8168ep_2(struct rtl8169_private *tp)
 	RTL_W8(MISC_1, RTL_R8(MISC_1) & ~PFM_D3COLD_EN);
 }
 
-static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
+static void rtl_hw_start_8168ep_3(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	u32 data;
@@ -6129,7 +6129,7 @@ static void rtl_hw_start_8168ep_3(struct rtl8169_private *tp)
 
 static void rtl_hw_start_8168(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 
 	RTL_W8(Cfg9346, Cfg9346_Unlock);
@@ -6280,7 +6280,7 @@ static void rtl_hw_start_8168(struct net_device *dev)
 	PktCntrDisable | \
 	Mac_dbgo_sel)
 
-static void rtl_hw_start_8102e_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8102e_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -6313,7 +6313,7 @@ static void rtl_hw_start_8102e_1(struct rtl8169_private *tp)
 	rtl_ephy_init(tp, e_info_8102e_1, ARRAY_SIZE(e_info_8102e_1));
 }
 
-static void rtl_hw_start_8102e_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8102e_2(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
@@ -6326,14 +6326,14 @@ static void rtl_hw_start_8102e_2(struct rtl8169_private *tp)
 	RTL_W8(Config3, RTL_R8(Config3) & ~Beacon_en);
 }
 
-static void rtl_hw_start_8102e_3(struct rtl8169_private *tp)
+static void rtl_hw_start_8102e_3(struct rtl8168_private *tp)
 {
 	rtl_hw_start_8102e_2(tp);
 
 	rtl_ephy_write(tp, 0x03, 0xc2f9);
 }
 
-static void rtl_hw_start_8105e_1(struct rtl8169_private *tp)
+static void rtl_hw_start_8105e_1(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8105e_1[] = {
@@ -6361,13 +6361,13 @@ static void rtl_hw_start_8105e_1(struct rtl8169_private *tp)
 	rtl_pcie_state_l2l3_enable(tp, false);
 }
 
-static void rtl_hw_start_8105e_2(struct rtl8169_private *tp)
+static void rtl_hw_start_8105e_2(struct rtl8168_private *tp)
 {
 	rtl_hw_start_8105e_1(tp);
 	rtl_ephy_write(tp, 0x1e, rtl_ephy_read(tp, 0x1e) | 0x8000);
 }
 
-static void rtl_hw_start_8402(struct rtl8169_private *tp)
+static void rtl_hw_start_8402(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	static const struct ephy_info e_info_8402[] = {
@@ -6398,7 +6398,7 @@ static void rtl_hw_start_8402(struct rtl8169_private *tp)
 	rtl_pcie_state_l2l3_enable(tp, false);
 }
 
-static void rtl_hw_start_8106(struct rtl8169_private *tp)
+static void rtl_hw_start_8106(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -6414,7 +6414,7 @@ static void rtl_hw_start_8106(struct rtl8169_private *tp)
 
 static void rtl_hw_start_8101(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
 
@@ -6488,9 +6488,9 @@ static void rtl_hw_start_8101(struct net_device *dev)
 	RTL_W16(MultiIntr, RTL_R16(MultiIntr) & 0xf000);
 }
 
-static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
+static int rtl8168_change_mtu(struct net_device *dev, int new_mtu)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	if (new_mtu > ETH_DATA_LEN)
 		rtl_hw_jumbo_enable(tp);
@@ -6503,13 +6503,13 @@ static int rtl8169_change_mtu(struct net_device *dev, int new_mtu)
 	return 0;
 }
 
-static inline void rtl8169_make_unusable_by_asic(struct RxDesc *desc)
+static inline void rtl8168_make_unusable_by_asic(struct RxDesc *desc)
 {
 	desc->addr = cpu_to_le64(0x0badbadbadbadbadull);
 	desc->opts1 &= ~cpu_to_le32(DescOwn | RsvdMask);
 }
 
-static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
+static void rtl8168_free_rx_databuff(struct rtl8168_private *tp,
 				     void **data_buff, struct RxDesc *desc)
 {
 	dma_unmap_single(&tp->pci_dev->dev, le64_to_cpu(desc->addr), rx_buf_sz,
@@ -6517,10 +6517,10 @@ static void rtl8169_free_rx_databuff(struct rtl8169_private *tp,
 
 	kfree(*data_buff);
 	*data_buff = NULL;
-	rtl8169_make_unusable_by_asic(desc);
+	rtl8168_make_unusable_by_asic(desc);
 }
 
-static inline void rtl8169_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
+static inline void rtl8168_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
 {
 	u32 eor = le32_to_cpu(desc->opts1) & RingEnd;
 
@@ -6530,19 +6530,19 @@ static inline void rtl8169_mark_to_asic(struct RxDesc *desc, u32 rx_buf_sz)
 	desc->opts1 = cpu_to_le32(DescOwn | eor | rx_buf_sz);
 }
 
-static inline void rtl8169_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
+static inline void rtl8168_map_to_asic(struct RxDesc *desc, dma_addr_t mapping,
 				       u32 rx_buf_sz)
 {
 	desc->addr = cpu_to_le64(mapping);
-	rtl8169_mark_to_asic(desc, rx_buf_sz);
+	rtl8168_mark_to_asic(desc, rx_buf_sz);
 }
 
-static inline void *rtl8169_align(void *data)
+static inline void *rtl8168_align(void *data)
 {
 	return (void *)ALIGN((long)data, 16);
 }
 
-static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
+static struct sk_buff *rtl8168_alloc_rx_data(struct rtl8168_private *tp,
 					     struct RxDesc *desc)
 {
 	void *data;
@@ -6555,14 +6555,14 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
 	if (!data)
 		return NULL;
 
-	if (rtl8169_align(data) != data) {
+	if (rtl8168_align(data) != data) {
 		kfree(data);
 		data = kmalloc_node(rx_buf_sz + 15, GFP_KERNEL, node);
 		if (!data)
 			return NULL;
 	}
 
-	mapping = dma_map_single(d, rtl8169_align(data), rx_buf_sz,
+	mapping = dma_map_single(d, rtl8168_align(data), rx_buf_sz,
 				 DMA_FROM_DEVICE);
 	if (unlikely(dma_mapping_error(d, mapping))) {
 		if (net_ratelimit())
@@ -6570,7 +6570,7 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
 		goto err_out;
 	}
 
-	rtl8169_map_to_asic(desc, mapping, rx_buf_sz);
+	rtl8168_map_to_asic(desc, mapping, rx_buf_sz);
 	return data;
 
 err_out:
@@ -6578,24 +6578,24 @@ static struct sk_buff *rtl8169_alloc_rx_data(struct rtl8169_private *tp,
 	return NULL;
 }
 
-static void rtl8169_rx_clear(struct rtl8169_private *tp)
+static void rtl8168_rx_clear(struct rtl8168_private *tp)
 {
 	unsigned int i;
 
 	for (i = 0; i < NUM_RX_DESC; i++) {
 		if (tp->Rx_databuff[i]) {
-			rtl8169_free_rx_databuff(tp, tp->Rx_databuff + i,
+			rtl8168_free_rx_databuff(tp, tp->Rx_databuff + i,
 					    tp->RxDescArray + i);
 		}
 	}
 }
 
-static inline void rtl8169_mark_as_last_descriptor(struct RxDesc *desc)
+static inline void rtl8168_mark_as_last_descriptor(struct RxDesc *desc)
 {
 	desc->opts1 |= cpu_to_le32(RingEnd);
 }
 
-static int rtl8169_rx_fill(struct rtl8169_private *tp)
+static int rtl8168_rx_fill(struct rtl8168_private *tp)
 {
 	unsigned int i;
 
@@ -6605,35 +6605,35 @@ static int rtl8169_rx_fill(struct rtl8169_private *tp)
 		if (tp->Rx_databuff[i])
 			continue;
 
-		data = rtl8169_alloc_rx_data(tp, tp->RxDescArray + i);
+		data = rtl8168_alloc_rx_data(tp, tp->RxDescArray + i);
 		if (!data) {
-			rtl8169_make_unusable_by_asic(tp->RxDescArray + i);
+			rtl8168_make_unusable_by_asic(tp->RxDescArray + i);
 			goto err_out;
 		}
 		tp->Rx_databuff[i] = data;
 	}
 
-	rtl8169_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
+	rtl8168_mark_as_last_descriptor(tp->RxDescArray + NUM_RX_DESC - 1);
 	return 0;
 
 err_out:
-	rtl8169_rx_clear(tp);
+	rtl8168_rx_clear(tp);
 	return -ENOMEM;
 }
 
-static int rtl8169_init_ring(struct net_device *dev)
+static int rtl8168_init_ring(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
-	rtl8169_init_ring_indexes(tp);
+	rtl8168_init_ring_indexes(tp);
 
 	memset(tp->tx_skb, 0x0, NUM_TX_DESC * sizeof(struct ring_info));
 	memset(tp->Rx_databuff, 0x0, NUM_RX_DESC * sizeof(void *));
 
-	return rtl8169_rx_fill(tp);
+	return rtl8168_rx_fill(tp);
 }
 
-static void rtl8169_unmap_tx_skb(struct device *d, struct ring_info *tx_skb,
+static void rtl8168_unmap_tx_skb(struct device *d, struct ring_info *tx_skb,
 				 struct TxDesc *desc)
 {
 	unsigned int len = tx_skb->len;
@@ -6646,7 +6646,7 @@ static void rtl8169_unmap_tx_skb(struct device *d, struct ring_info *tx_skb,
 	tx_skb->len = 0;
 }
 
-static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
+static void rtl8168_tx_clear_range(struct rtl8168_private *tp, u32 start,
 				   unsigned int n)
 {
 	unsigned int i;
@@ -6659,7 +6659,7 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
 		if (len) {
 			struct sk_buff *skb = tx_skb->skb;
 
-			rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
+			rtl8168_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
 					     tp->TxDescArray + entry);
 			if (skb) {
 				dev_consume_skb_any(skb);
@@ -6669,13 +6669,13 @@ static void rtl8169_tx_clear_range(struct rtl8169_private *tp, u32 start,
 	}
 }
 
-static void rtl8169_tx_clear(struct rtl8169_private *tp)
+static void rtl8168_tx_clear(struct rtl8168_private *tp)
 {
-	rtl8169_tx_clear_range(tp, tp->dirty_tx, NUM_TX_DESC);
+	rtl8168_tx_clear_range(tp, tp->dirty_tx, NUM_TX_DESC);
 	tp->cur_tx = tp->dirty_tx = 0;
 }
 
-static void rtl_reset_work(struct rtl8169_private *tp)
+static void rtl_reset_work(struct rtl8168_private *tp)
 {
 	struct net_device *dev = tp->dev;
 	int i;
@@ -6684,28 +6684,28 @@ static void rtl_reset_work(struct rtl8169_private *tp)
 	netif_stop_queue(dev);
 	synchronize_sched();
 
-	rtl8169_hw_reset(tp);
+	rtl8168_hw_reset(tp);
 
 	for (i = 0; i < NUM_RX_DESC; i++)
-		rtl8169_mark_to_asic(tp->RxDescArray + i, rx_buf_sz);
+		rtl8168_mark_to_asic(tp->RxDescArray + i, rx_buf_sz);
 
-	rtl8169_tx_clear(tp);
-	rtl8169_init_ring_indexes(tp);
+	rtl8168_tx_clear(tp);
+	rtl8168_init_ring_indexes(tp);
 
 	napi_enable(&tp->napi);
 	rtl_hw_start(dev);
 	netif_wake_queue(dev);
-	rtl8169_check_link_status(dev, tp, tp->mmio_addr);
+	rtl8168_check_link_status(dev, tp, tp->mmio_addr);
 }
 
-static void rtl8169_tx_timeout(struct net_device *dev)
+static void rtl8168_tx_timeout(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
 }
 
-static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
+static int rtl8168_xmit_frags(struct rtl8168_private *tp, struct sk_buff *skb,
 			      u32 *opts)
 {
 	struct skb_shared_info *info = skb_shinfo(skb);
@@ -6752,22 +6752,22 @@ static int rtl8169_xmit_frags(struct rtl8169_private *tp, struct sk_buff *skb,
 	return cur_frag;
 
 err_out:
-	rtl8169_tx_clear_range(tp, tp->cur_tx + 1, cur_frag);
+	rtl8168_tx_clear_range(tp, tp->cur_tx + 1, cur_frag);
 	return -EIO;
 }
 
-static bool rtl_test_hw_pad_bug(struct rtl8169_private *tp, struct sk_buff *skb)
+static bool rtl_test_hw_pad_bug(struct rtl8168_private *tp, struct sk_buff *skb)
 {
 	return skb->len < ETH_ZLEN && tp->mac_version == RTL_GIGA_MAC_VER_34;
 }
 
-static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+static netdev_tx_t rtl8168_start_xmit(struct sk_buff *skb,
 				      struct net_device *dev);
-/* r8169_csum_workaround()
+/* r8168_csum_workaround()
  * The hw limites the value the transport offset. When the offset is out of the
  * range, calculate the checksum by sw.
  */
-static void r8169_csum_workaround(struct rtl8169_private *tp,
+static void r8168_csum_workaround(struct rtl8168_private *tp,
 				  struct sk_buff *skb)
 {
 	if (skb_shinfo(skb)->gso_size) {
@@ -6783,7 +6783,7 @@ static void r8169_csum_workaround(struct rtl8169_private *tp,
 			nskb = segs;
 			segs = segs->next;
 			nskb->next = NULL;
-			rtl8169_start_xmit(nskb, tp->dev);
+			rtl8168_start_xmit(nskb, tp->dev);
 		} while (segs);
 
 		dev_consume_skb_any(skb);
@@ -6791,7 +6791,7 @@ static void r8169_csum_workaround(struct rtl8169_private *tp,
 		if (skb_checksum_help(skb) < 0)
 			goto drop;
 
-		rtl8169_start_xmit(skb, tp->dev);
+		rtl8168_start_xmit(skb, tp->dev);
 	} else {
 		struct net_device_stats *stats;
 
@@ -6837,7 +6837,7 @@ static inline __be16 get_protocol(struct sk_buff *skb)
 	return protocol;
 }
 
-static bool rtl8169_tso_csum_v1(struct rtl8169_private *tp,
+static bool rtl8168_tso_csum_v1(struct rtl8168_private *tp,
 				struct sk_buff *skb, u32 *opts)
 {
 	u32 mss = skb_shinfo(skb)->gso_size;
@@ -6859,7 +6859,7 @@ static bool rtl8169_tso_csum_v1(struct rtl8169_private *tp,
 	return true;
 }
 
-static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
+static bool rtl8168_tso_csum_v2(struct rtl8168_private *tp,
 				struct sk_buff *skb, u32 *opts)
 {
 	u32 transport_offset = (u32)skb_transport_offset(skb);
@@ -6937,10 +6937,10 @@ static bool rtl8169_tso_csum_v2(struct rtl8169_private *tp,
 	return true;
 }
 
-static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
+static netdev_tx_t rtl8168_start_xmit(struct sk_buff *skb,
 				      struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	unsigned int entry = tp->cur_tx % NUM_TX_DESC;
 	struct TxDesc *txd = tp->TxDescArray + entry;
 	void __iomem *ioaddr = tp->mmio_addr;
@@ -6958,11 +6958,11 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	if (unlikely(le32_to_cpu(txd->opts1) & DescOwn))
 		goto err_stop_0;
 
-	opts[1] = cpu_to_le32(rtl8169_tx_vlan_tag(skb));
+	opts[1] = cpu_to_le32(rtl8168_tx_vlan_tag(skb));
 	opts[0] = DescOwn;
 
 	if (!tp->tso_csum(tp, skb, opts)) {
-		r8169_csum_workaround(tp, skb);
+		r8168_csum_workaround(tp, skb);
 		return NETDEV_TX_OK;
 	}
 
@@ -6977,7 +6977,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	tp->tx_skb[entry].len = len;
 	txd->addr = cpu_to_le64(mapping);
 
-	frags = rtl8169_xmit_frags(tp, skb, opts);
+	frags = rtl8168_xmit_frags(tp, skb, opts);
 	if (frags < 0)
 		goto err_dma_1;
 	else if (frags)
@@ -7028,7 +7028,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 
 err_dma_1:
-	rtl8169_unmap_tx_skb(d, tp->tx_skb + entry, txd);
+	rtl8168_unmap_tx_skb(d, tp->tx_skb + entry, txd);
 err_dma_0:
 	dev_kfree_skb_any(skb);
 	dev->stats.tx_dropped++;
@@ -7040,9 +7040,9 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
 	return NETDEV_TX_BUSY;
 }
 
-static void rtl8169_pcierr_interrupt(struct net_device *dev)
+static void rtl8168_pcierr_interrupt(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct pci_dev *pdev = tp->pci_dev;
 	u16 pci_status, pci_cmd;
 
@@ -7082,12 +7082,12 @@ static void rtl8169_pcierr_interrupt(struct net_device *dev)
 		dev->features &= ~NETIF_F_HIGHDMA;
 	}
 
-	rtl8169_hw_reset(tp);
+	rtl8168_hw_reset(tp);
 
 	rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
 }
 
-static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
+static void rtl_tx(struct net_device *dev, struct rtl8168_private *tp)
 {
 	unsigned int dirty_tx, tx_left;
 
@@ -7110,7 +7110,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
 		 */
 		dma_rmb();
 
-		rtl8169_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
+		rtl8168_unmap_tx_skb(&tp->pci_dev->dev, tx_skb,
 				     tp->TxDescArray + entry);
 		if (status & LastFrag) {
 			u64_stats_update_begin(&tp->tx_stats.syncp);
@@ -7126,7 +7126,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
 
 	if (tp->dirty_tx != dirty_tx) {
 		tp->dirty_tx = dirty_tx;
-		/* Sync with rtl8169_start_xmit:
+		/* Sync with rtl8168_start_xmit:
 		 * - publish dirty_tx ring index (write barrier)
 		 * - refresh cur_tx ring index and queue status (read barrier)
 		 * May the current thread miss the stopped queue condition,
@@ -7152,12 +7152,12 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
 	}
 }
 
-static inline int rtl8169_fragmented_frame(u32 status)
+static inline int rtl8168_fragmented_frame(u32 status)
 {
 	return (status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag);
 }
 
-static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1)
+static inline void rtl8168_rx_csum(struct sk_buff *skb, u32 opts1)
 {
 	u32 status = opts1 & RxProtoMask;
 
@@ -7168,15 +7168,15 @@ static inline void rtl8169_rx_csum(struct sk_buff *skb, u32 opts1)
 		skb_checksum_none_assert(skb);
 }
 
-static struct sk_buff *rtl8169_try_rx_copy(void *data,
-					   struct rtl8169_private *tp,
+static struct sk_buff *rtl8168_try_rx_copy(void *data,
+					   struct rtl8168_private *tp,
 					   int pkt_size,
 					   dma_addr_t addr)
 {
 	struct sk_buff *skb;
 	struct device *d = &tp->pci_dev->dev;
 
-	data = rtl8169_align(data);
+	data = rtl8168_align(data);
 	dma_sync_single_for_cpu(d, addr, pkt_size, DMA_FROM_DEVICE);
 	prefetch(data);
 	skb = napi_alloc_skb(&tp->napi, pkt_size);
@@ -7187,7 +7187,7 @@ static struct sk_buff *rtl8169_try_rx_copy(void *data,
 	return skb;
 }
 
-static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget)
+static int rtl_rx(struct net_device *dev, struct rtl8168_private *tp, u32 budget)
 {
 	unsigned int cur_rx, rx_left;
 	unsigned int count;
@@ -7242,24 +7242,24 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
 			 * frames. They are seen as a symptom of over-mtu
 			 * sized frames.
 			 */
-			if (unlikely(rtl8169_fragmented_frame(status))) {
+			if (unlikely(rtl8168_fragmented_frame(status))) {
 				dev->stats.rx_dropped++;
 				dev->stats.rx_length_errors++;
 				goto release_descriptor;
 			}
 
-			skb = rtl8169_try_rx_copy(tp->Rx_databuff[entry],
+			skb = rtl8168_try_rx_copy(tp->Rx_databuff[entry],
 						  tp, pkt_size, addr);
 			if (!skb) {
 				dev->stats.rx_dropped++;
 				goto release_descriptor;
 			}
 
-			rtl8169_rx_csum(skb, status);
+			rtl8168_rx_csum(skb, status);
 			skb_put(skb, pkt_size);
 			skb->protocol = eth_type_trans(skb, dev);
 
-			rtl8169_rx_vlan_tag(desc, skb);
+			rtl8168_rx_vlan_tag(desc, skb);
 
 			if (skb->pkt_type == PACKET_MULTICAST)
 				dev->stats.multicast++;
@@ -7273,7 +7273,7 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
 		}
 release_descriptor:
 		desc->opts2 = 0;
-		rtl8169_mark_to_asic(desc, rx_buf_sz);
+		rtl8168_mark_to_asic(desc, rx_buf_sz);
 	}
 
 	count = cur_rx - tp->cur_rx;
@@ -7282,10 +7282,10 @@ static int rtl_rx(struct net_device *dev, struct rtl8169_private *tp, u32 budget
 	return count;
 }
 
-static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
+static irqreturn_t rtl8168_interrupt(int irq, void *dev_instance)
 {
 	struct net_device *dev = dev_instance;
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	int handled = 0;
 	u16 status;
 
@@ -7305,7 +7305,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
 /*
  * Workqueue context.
  */
-static void rtl_slow_event_work(struct rtl8169_private *tp)
+static void rtl_slow_event_work(struct rtl8168_private *tp)
 {
 	struct net_device *dev = tp->dev;
 	u16 status;
@@ -7326,10 +7326,10 @@ static void rtl_slow_event_work(struct rtl8169_private *tp)
 	}
 
 	if (unlikely(status & SYSErr))
-		rtl8169_pcierr_interrupt(dev);
+		rtl8168_pcierr_interrupt(dev);
 
 	if (status & LinkChg)
-		__rtl8169_check_link_status(dev, tp, tp->mmio_addr, true);
+		__rtl8168_check_link_status(dev, tp, tp->mmio_addr, true);
 
 	rtl_irq_enable_all(tp);
 }
@@ -7338,15 +7338,15 @@ static void rtl_task(struct work_struct *work)
 {
 	static const struct {
 		int bitnr;
-		void (*action)(struct rtl8169_private *);
+		void (*action)(struct rtl8168_private *);
 	} rtl_work[] = {
 		/* XXX - keep rtl_slow_event_work() as first element. */
 		{ RTL_FLAG_TASK_SLOW_PENDING,	rtl_slow_event_work },
 		{ RTL_FLAG_TASK_RESET_PENDING,	rtl_reset_work },
 		{ RTL_FLAG_TASK_PHY_PENDING,	rtl_phy_work }
 	};
-	struct rtl8169_private *tp =
-		container_of(work, struct rtl8169_private, wk.work);
+	struct rtl8168_private *tp =
+		container_of(work, struct rtl8168_private, wk.work);
 	struct net_device *dev = tp->dev;
 	int i;
 
@@ -7368,9 +7368,9 @@ static void rtl_task(struct work_struct *work)
 	rtl_unlock_work(tp);
 }
 
-static int rtl8169_poll(struct napi_struct *napi, int budget)
+static int rtl8168_poll(struct napi_struct *napi, int budget)
 {
-	struct rtl8169_private *tp = container_of(napi, struct rtl8169_private, napi);
+	struct rtl8168_private *tp = container_of(napi, struct rtl8168_private, napi);
 	struct net_device *dev = tp->dev;
 	u16 enable_mask = RTL_EVENT_NAPI | tp->event_slow;
 	int work_done= 0;
@@ -7401,50 +7401,50 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
 	return work_done;
 }
 
-static void rtl8169_down(struct net_device *dev)
+static void rtl8168_down(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	del_timer_sync(&tp->timer);
 
 	napi_disable(&tp->napi);
 	netif_stop_queue(dev);
 
-	rtl8169_hw_reset(tp);
+	rtl8168_hw_reset(tp);
 
 	/* Give a racing hard_start_xmit a few cycles to complete. */
 	synchronize_sched();
 
-	rtl8169_tx_clear(tp);
+	rtl8168_tx_clear(tp);
 
-	rtl8169_rx_clear(tp);
+	rtl8168_rx_clear(tp);
 
 	rtl_pll_power_down(tp);
 }
 
-static int rtl8169_close(struct net_device *dev)
+static int rtl8168_close(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct pci_dev *pdev = tp->pci_dev;
 
 	pm_runtime_get_sync(&pdev->dev);
 
 	/* Update counters before going down */
-	rtl8169_update_counters(dev);
+	rtl8168_update_counters(dev);
 
 	rtl_lock_work(tp);
 	clear_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
 
-	rtl8169_down(dev);
+	rtl8168_down(dev);
 	rtl_unlock_work(tp);
 
 	cancel_work_sync(&tp->wk.work);
 
 	free_irq(pdev->irq, dev);
 
-	dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
+	dma_free_coherent(&pdev->dev, R8168_RX_RING_BYTES, tp->RxDescArray,
 			  tp->RxPhyAddr);
-	dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
+	dma_free_coherent(&pdev->dev, R8168_TX_RING_BYTES, tp->TxDescArray,
 			  tp->TxPhyAddr);
 	tp->TxDescArray = NULL;
 	tp->RxDescArray = NULL;
@@ -7455,17 +7455,17 @@ static int rtl8169_close(struct net_device *dev)
 }
 
 #ifdef CONFIG_NET_POLL_CONTROLLER
-static void rtl8169_netpoll(struct net_device *dev)
+static void rtl8168_netpoll(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
-	rtl8169_interrupt(tp->pci_dev->irq, dev);
+	rtl8168_interrupt(tp->pci_dev->irq, dev);
 }
 #endif
 
 static int rtl_open(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	void __iomem *ioaddr = tp->mmio_addr;
 	struct pci_dev *pdev = tp->pci_dev;
 	int retval = -ENOMEM;
@@ -7476,17 +7476,17 @@ static int rtl_open(struct net_device *dev)
 	 * Rx and Tx descriptors needs 256 bytes alignment.
 	 * dma_alloc_coherent provides more.
 	 */
-	tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8169_TX_RING_BYTES,
+	tp->TxDescArray = dma_alloc_coherent(&pdev->dev, R8168_TX_RING_BYTES,
 					     &tp->TxPhyAddr, GFP_KERNEL);
 	if (!tp->TxDescArray)
 		goto err_pm_runtime_put;
 
-	tp->RxDescArray = dma_alloc_coherent(&pdev->dev, R8169_RX_RING_BYTES,
+	tp->RxDescArray = dma_alloc_coherent(&pdev->dev, R8168_RX_RING_BYTES,
 					     &tp->RxPhyAddr, GFP_KERNEL);
 	if (!tp->RxDescArray)
 		goto err_free_tx_0;
 
-	retval = rtl8169_init_ring(dev);
+	retval = rtl8168_init_ring(dev);
 	if (retval < 0)
 		goto err_free_rx_1;
 
@@ -7496,7 +7496,7 @@ static int rtl_open(struct net_device *dev)
 
 	rtl_request_firmware(tp);
 
-	retval = request_irq(pdev->irq, rtl8169_interrupt,
+	retval = request_irq(pdev->irq, rtl8168_interrupt,
 			     (tp->features & RTL_FEATURE_MSI) ? 0 : IRQF_SHARED,
 			     dev->name, dev);
 	if (retval < 0)
@@ -7508,15 +7508,15 @@ static int rtl_open(struct net_device *dev)
 
 	napi_enable(&tp->napi);
 
-	rtl8169_init_phy(dev, tp);
+	rtl8168_init_phy(dev, tp);
 
-	__rtl8169_set_features(dev, dev->features);
+	__rtl8168_set_features(dev, dev->features);
 
 	rtl_pll_power_up(tp);
 
 	rtl_hw_start(dev);
 
-	if (!rtl8169_init_counter_offsets(dev))
+	if (!rtl8168_init_counter_offsets(dev))
 		netif_warn(tp, hw, dev, "counter reset/update failed\n");
 
 	netif_start_queue(dev);
@@ -7526,19 +7526,19 @@ static int rtl_open(struct net_device *dev)
 	tp->saved_wolopts = 0;
 	pm_runtime_put_noidle(&pdev->dev);
 
-	rtl8169_check_link_status(dev, tp, ioaddr);
+	rtl8168_check_link_status(dev, tp, ioaddr);
 out:
 	return retval;
 
 err_release_fw_2:
 	rtl_release_firmware(tp);
-	rtl8169_rx_clear(tp);
+	rtl8168_rx_clear(tp);
 err_free_rx_1:
-	dma_free_coherent(&pdev->dev, R8169_RX_RING_BYTES, tp->RxDescArray,
+	dma_free_coherent(&pdev->dev, R8168_RX_RING_BYTES, tp->RxDescArray,
 			  tp->RxPhyAddr);
 	tp->RxDescArray = NULL;
 err_free_tx_0:
-	dma_free_coherent(&pdev->dev, R8169_TX_RING_BYTES, tp->TxDescArray,
+	dma_free_coherent(&pdev->dev, R8168_TX_RING_BYTES, tp->TxDescArray,
 			  tp->TxPhyAddr);
 	tp->TxDescArray = NULL;
 err_pm_runtime_put:
@@ -7547,11 +7547,11 @@ static int rtl_open(struct net_device *dev)
 }
 
 static void
-rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
+rtl8168_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct pci_dev *pdev = tp->pci_dev;
-	struct rtl8169_counters *counters = tp->counters;
+	struct rtl8168_counters *counters = tp->counters;
 	unsigned int start;
 
 	pm_runtime_get_noresume(&pdev->dev);
@@ -7582,11 +7582,11 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
 	 * from tally counters.
 	 */
 	if (pm_runtime_active(&pdev->dev))
-		rtl8169_update_counters(dev);
+		rtl8168_update_counters(dev);
 
 	/*
 	 * Subtract values fetched during initalization.
-	 * See rtl8169_init_counter_offsets for a description why we do that.
+	 * See rtl8168_init_counter_offsets for a description why we do that.
 	 */
 	stats->tx_errors = le64_to_cpu(counters->tx_errors) -
 		le64_to_cpu(tp->tc_offset.tx_errors);
@@ -7598,9 +7598,9 @@ rtl8169_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats)
 	pm_runtime_put_noidle(&pdev->dev);
 }
 
-static void rtl8169_net_suspend(struct net_device *dev)
+static void rtl8168_net_suspend(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	if (!netif_running(dev))
 		return;
@@ -7618,19 +7618,19 @@ static void rtl8169_net_suspend(struct net_device *dev)
 
 #ifdef CONFIG_PM
 
-static int rtl8169_suspend(struct device *device)
+static int rtl8168_suspend(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
 
-	rtl8169_net_suspend(dev);
+	rtl8168_net_suspend(dev);
 
 	return 0;
 }
 
-static void __rtl8169_resume(struct net_device *dev)
+static void __rtl8168_resume(struct net_device *dev)
 {
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	netif_device_attach(dev);
 
@@ -7644,94 +7644,94 @@ static void __rtl8169_resume(struct net_device *dev)
 	rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
 }
 
-static int rtl8169_resume(struct device *device)
+static int rtl8168_resume(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
-	rtl8169_init_phy(dev, tp);
+	rtl8168_init_phy(dev, tp);
 
 	if (netif_running(dev))
-		__rtl8169_resume(dev);
+		__rtl8168_resume(dev);
 
 	return 0;
 }
 
-static int rtl8169_runtime_suspend(struct device *device)
+static int rtl8168_runtime_suspend(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	if (!tp->TxDescArray)
 		return 0;
 
 	rtl_lock_work(tp);
-	tp->saved_wolopts = __rtl8169_get_wol(tp);
-	__rtl8169_set_wol(tp, WAKE_ANY);
+	tp->saved_wolopts = __rtl8168_get_wol(tp);
+	__rtl8168_set_wol(tp, WAKE_ANY);
 	rtl_unlock_work(tp);
 
-	rtl8169_net_suspend(dev);
+	rtl8168_net_suspend(dev);
 
 	/* Update counters before going runtime suspend */
-	rtl8169_update_counters(dev);
+	rtl8168_update_counters(dev);
 
 	return 0;
 }
 
-static int rtl8169_runtime_resume(struct device *device)
+static int rtl8168_runtime_resume(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	rtl_rar_set(tp, dev->dev_addr);
 
 	if (!tp->TxDescArray)
 		return 0;
 
 	rtl_lock_work(tp);
-	__rtl8169_set_wol(tp, tp->saved_wolopts);
+	__rtl8168_set_wol(tp, tp->saved_wolopts);
 	tp->saved_wolopts = 0;
 	rtl_unlock_work(tp);
 
-	rtl8169_init_phy(dev, tp);
+	rtl8168_init_phy(dev, tp);
 
-	__rtl8169_resume(dev);
+	__rtl8168_resume(dev);
 
 	return 0;
 }
 
-static int rtl8169_runtime_idle(struct device *device)
+static int rtl8168_runtime_idle(struct device *device)
 {
 	struct pci_dev *pdev = to_pci_dev(device);
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	return tp->TxDescArray ? -EBUSY : 0;
 }
 
 static const struct dev_pm_ops rtl8168_pm_ops = {
-	.suspend		= rtl8169_suspend,
-	.resume			= rtl8169_resume,
-	.freeze			= rtl8169_suspend,
-	.thaw			= rtl8169_resume,
-	.poweroff		= rtl8169_suspend,
-	.restore		= rtl8169_resume,
-	.runtime_suspend	= rtl8169_runtime_suspend,
-	.runtime_resume		= rtl8169_runtime_resume,
-	.runtime_idle		= rtl8169_runtime_idle,
+	.suspend		= rtl8168_suspend,
+	.resume			= rtl8168_resume,
+	.freeze			= rtl8168_suspend,
+	.thaw			= rtl8168_resume,
+	.poweroff		= rtl8168_suspend,
+	.restore		= rtl8168_resume,
+	.runtime_suspend	= rtl8168_runtime_suspend,
+	.runtime_resume		= rtl8168_runtime_resume,
+	.runtime_idle		= rtl8168_runtime_idle,
 };
 
 #define RTL8168_PM_OPS	(&rtl8168_pm_ops)
 
 #else /* !CONFIG_PM */
 
-#define RTL8169_PM_OPS	NULL
+#define RTL8168_PM_OPS	NULL
 
 #endif /* !CONFIG_PM */
 
-static void rtl_wol_shutdown_quirk(struct rtl8169_private *tp)
+static void rtl_wol_shutdown_quirk(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 
@@ -7754,20 +7754,20 @@ static void rtl_wol_shutdown_quirk(struct rtl8169_private *tp)
 static void rtl_shutdown(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 	struct device *d = &pdev->dev;
 
 	pm_runtime_get_sync(d);
 
-	rtl8169_net_suspend(dev);
+	rtl8168_net_suspend(dev);
 
 	/* Restore original MAC address */
 	rtl_rar_set(tp, dev->perm_addr);
 
-	rtl8169_hw_reset(tp);
+	rtl8168_hw_reset(tp);
 
 	if (system_state == SYSTEM_POWER_OFF) {
-		if (__rtl8169_get_wol(tp) & WAKE_ANY) {
+		if (__rtl8168_get_wol(tp) & WAKE_ANY) {
 			rtl_wol_suspend_quirk(tp);
 			rtl_wol_shutdown_quirk(tp);
 		}
@@ -7782,7 +7782,7 @@ static void rtl_shutdown(struct pci_dev *pdev)
 static void rtl_remove_one(struct pci_dev *pdev)
 {
 	struct net_device *dev = pci_get_drvdata(pdev);
-	struct rtl8169_private *tp = netdev_priv(dev);
+	struct rtl8168_private *tp = netdev_priv(dev);
 
 	if ((tp->mac_version == RTL_GIGA_MAC_VER_27 ||
 	     tp->mac_version == RTL_GIGA_MAC_VER_28 ||
@@ -7809,19 +7809,19 @@ static void rtl_remove_one(struct pci_dev *pdev)
 
 static const struct net_device_ops rtl_netdev_ops = {
 	.ndo_open		= rtl_open,
-	.ndo_stop		= rtl8169_close,
-	.ndo_get_stats64	= rtl8169_get_stats64,
-	.ndo_start_xmit		= rtl8169_start_xmit,
-	.ndo_tx_timeout		= rtl8169_tx_timeout,
+	.ndo_stop		= rtl8168_close,
+	.ndo_get_stats64	= rtl8168_get_stats64,
+	.ndo_start_xmit		= rtl8168_start_xmit,
+	.ndo_tx_timeout		= rtl8168_tx_timeout,
 	.ndo_validate_addr	= eth_validate_addr,
-	.ndo_change_mtu		= rtl8169_change_mtu,
-	.ndo_fix_features	= rtl8169_fix_features,
-	.ndo_set_features	= rtl8169_set_features,
+	.ndo_change_mtu		= rtl8168_change_mtu,
+	.ndo_fix_features	= rtl8168_fix_features,
+	.ndo_set_features	= rtl8168_set_features,
 	.ndo_set_mac_address	= rtl_set_mac_address,
-	.ndo_do_ioctl		= rtl8169_ioctl,
+	.ndo_do_ioctl		= rtl8168_ioctl,
 	.ndo_set_rx_mode	= rtl_set_rx_mode,
 #ifdef CONFIG_NET_POLL_CONTROLLER
-	.ndo_poll_controller	= rtl8169_netpoll,
+	.ndo_poll_controller	= rtl8168_netpoll,
 #endif
 
 };
@@ -7866,7 +7866,7 @@ static const struct rtl_cfg_info {
 };
 
 /* Cfg9346_Unlock assumed. */
-static unsigned rtl_try_msi(struct rtl8169_private *tp,
+static unsigned rtl_try_msi(struct rtl8168_private *tp,
 			    const struct rtl_cfg_info *cfg)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
@@ -7899,7 +7899,7 @@ DECLARE_RTL_COND(rtl_rxtx_empty_cond)
 	return (RTL_R8(MCU) & RXTX_EMPTY) == RXTX_EMPTY;
 }
 
-static void rtl_hw_init_8168g(struct rtl8169_private *tp)
+static void rtl_hw_init_8168g(struct rtl8168_private *tp)
 {
 	void __iomem *ioaddr = tp->mmio_addr;
 	u32 data;
@@ -7933,13 +7933,13 @@ static void rtl_hw_init_8168g(struct rtl8169_private *tp)
 		return;
 }
 
-static void rtl_hw_init_8168ep(struct rtl8169_private *tp)
+static void rtl_hw_init_8168ep(struct rtl8168_private *tp)
 {
 	rtl8168ep_stop_cmac(tp);
 	rtl_hw_init_8168g(tp);
 }
 
-static void rtl_hw_initialize(struct rtl8169_private *tp)
+static void rtl_hw_initialize(struct rtl8168_private *tp)
 {
 	switch (tp->mac_version) {
 	case RTL_GIGA_MAC_VER_40:
@@ -7967,7 +7967,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 {
 	const struct rtl_cfg_info *cfg = rtl_cfg_infos + ent->driver_data;
 	const unsigned int region = cfg->region;
-	struct rtl8169_private *tp;
+	struct rtl8168_private *tp;
 	struct mii_if_info *mii;
 	struct net_device *dev;
 	void __iomem *ioaddr;
@@ -7976,7 +7976,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	if (netif_msg_drv(&debug)) {
 		printk(KERN_INFO "%s Gigabit Ethernet driver %s loaded\n",
-		       MODULENAME, RTL8169_VERSION);
+		       MODULENAME, RTL8168_VERSION);
 	}
 
 	dev = devm_alloc_etherdev(&pdev->dev, sizeof (*tp));
@@ -7988,7 +7988,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	tp = netdev_priv(dev);
 	tp->dev = dev;
 	tp->pci_dev = pdev;
-	tp->msg_enable = netif_msg_init(debug.msg_enable, R8169_MSG_DEFAULT);
+	tp->msg_enable = netif_msg_init(debug.msg_enable, R8168_MSG_DEFAULT);
 
 	mii = &tp->mii;
 	mii->dev = dev;
@@ -8022,7 +8022,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	}
 
 	/* check for weird/broken PCI region reporting */
-	if (pci_resource_len(pdev, region) < R8169_REGS_SIZE) {
+	if (pci_resource_len(pdev, region) < R8168_REGS_SIZE) {
 		netif_err(tp, probe, dev,
 			  "Invalid PCI region size(s), aborting\n");
 		return -ENODEV;
@@ -8036,7 +8036,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	/* ioremap MMIO region */
 	ioaddr = devm_ioremap(&pdev->dev, pci_resource_start(pdev, region),
-			      R8169_REGS_SIZE);
+			      R8168_REGS_SIZE);
 	if (!ioaddr) {
 		netif_err(tp, probe, dev, "cannot remap MMIO, aborting\n");
 		return -EIO;
@@ -8047,7 +8047,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 		netif_info(tp, probe, dev, "not PCI Express\n");
 
 	/* Identify chip attached to board */
-	rtl8169_get_mac_version(tp, dev, cfg->default_ver);
+	rtl8168_get_mac_version(tp, dev, cfg->default_ver);
 	/* This driver doesn't handle the older non-PCIE models */
 	if (tp->mac_version >= RTL_GIGA_MAC_VER_01 &&
 	    tp->mac_version <= RTL_GIGA_MAC_VER_06)
@@ -8090,7 +8090,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	rtl_init_jumbo_ops(tp);
 	rtl_init_csi_ops(tp);
 
-	rtl8169_print_mac_version(tp);
+	rtl8168_print_mac_version(tp);
 
 	chipset = tp->mac_version;
 	tp->txd_version = rtl_chip_infos[chipset].txd_version;
@@ -8163,10 +8163,10 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	for (i = 0; i < ETH_ALEN; i++)
 		dev->dev_addr[i] = RTL_R8(MAC0 + i);
 
-	dev->ethtool_ops = &rtl8169_ethtool_ops;
-	dev->watchdog_timeo = RTL8169_TX_TIMEOUT;
+	dev->ethtool_ops = &rtl8168_ethtool_ops;
+	dev->watchdog_timeo = RTL8168_TX_TIMEOUT;
 
-	netif_napi_add(dev, &tp->napi, rtl8169_poll, R8169_NAPI_WEIGHT);
+	netif_napi_add(dev, &tp->napi, rtl8168_poll, R8168_NAPI_WEIGHT);
 
 	/* don't enable SG, IP_CSUM and TSO by default - it might not work
 	 * properly for all devices */
@@ -8182,9 +8182,9 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 	tp->cp_cmd |= RxChkSum | RxVlan;
 
 	if (tp->txd_version == RTL_TD_0)
-		tp->tso_csum = rtl8169_tso_csum_v1;
+		tp->tso_csum = rtl8168_tso_csum_v1;
 	else if (tp->txd_version == RTL_TD_1) {
-		tp->tso_csum = rtl8169_tso_csum_v2;
+		tp->tso_csum = rtl8168_tso_csum_v2;
 		dev->hw_features |= NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
 	} else
 		WARN_ON_ONCE(1);
@@ -8202,7 +8202,7 @@ static int rtl_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
 
 	tp->opts1_mask = ~(RxBOVF | RxFOVF);
 
-	timer_setup(&tp->timer, rtl8169_phy_timer, 0);
+	timer_setup(&tp->timer, rtl8168_phy_timer, 0);
 
 	tp->rtl_fw = RTL_FIRMWARE_UNKNOWN;
 
-- 
2.15.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ