diff options
Diffstat (limited to 'drivers/net/r8169.c')
-rw-r--r-- | drivers/net/r8169.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 7d9c650f395e..02339b3352e7 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -239,6 +239,7 @@ static DEFINE_PCI_DEVICE_TABLE(rtl8169_pci_tbl) = { | |||
239 | { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), 0, 0, RTL_CFG_1 }, | 239 | { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), 0, 0, RTL_CFG_1 }, |
240 | { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8169), 0, 0, RTL_CFG_0 }, | 240 | { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8169), 0, 0, RTL_CFG_0 }, |
241 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4300), 0, 0, RTL_CFG_0 }, | 241 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4300), 0, 0, RTL_CFG_0 }, |
242 | { PCI_DEVICE(PCI_VENDOR_ID_DLINK, 0x4302), 0, 0, RTL_CFG_0 }, | ||
242 | { PCI_DEVICE(PCI_VENDOR_ID_AT, 0xc107), 0, 0, RTL_CFG_0 }, | 243 | { PCI_DEVICE(PCI_VENDOR_ID_AT, 0xc107), 0, 0, RTL_CFG_0 }, |
243 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, | 244 | { PCI_DEVICE(0x16ec, 0x0116), 0, 0, RTL_CFG_0 }, |
244 | { PCI_VENDOR_ID_LINKSYS, 0x1032, | 245 | { PCI_VENDOR_ID_LINKSYS, 0x1032, |
@@ -1091,6 +1092,21 @@ rtl_w1w0_eri(void __iomem *ioaddr, int addr, u32 mask, u32 p, u32 m, int type) | |||
1091 | rtl_eri_write(ioaddr, addr, mask, (val & ~m) | p, type); | 1092 | rtl_eri_write(ioaddr, addr, mask, (val & ~m) | p, type); |
1092 | } | 1093 | } |
1093 | 1094 | ||
1095 | struct exgmac_reg { | ||
1096 | u16 addr; | ||
1097 | u16 mask; | ||
1098 | u32 val; | ||
1099 | }; | ||
1100 | |||
1101 | static void rtl_write_exgmac_batch(void __iomem *ioaddr, | ||
1102 | const struct exgmac_reg *r, int len) | ||
1103 | { | ||
1104 | while (len-- > 0) { | ||
1105 | rtl_eri_write(ioaddr, r->addr, r->mask, r->val, ERIAR_EXGMAC); | ||
1106 | r++; | ||
1107 | } | ||
1108 | } | ||
1109 | |||
1094 | static u8 rtl8168d_efuse_read(void __iomem *ioaddr, int reg_addr) | 1110 | static u8 rtl8168d_efuse_read(void __iomem *ioaddr, int reg_addr) |
1095 | { | 1111 | { |
1096 | u8 value = 0xff; | 1112 | u8 value = 0xff; |
@@ -3116,6 +3132,18 @@ static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr) | |||
3116 | RTL_W32(MAC0, low); | 3132 | RTL_W32(MAC0, low); |
3117 | RTL_R32(MAC0); | 3133 | RTL_R32(MAC0); |
3118 | 3134 | ||
3135 | if (tp->mac_version == RTL_GIGA_MAC_VER_34) { | ||
3136 | const struct exgmac_reg e[] = { | ||
3137 | { .addr = 0xe0, ERIAR_MASK_1111, .val = low }, | ||
3138 | { .addr = 0xe4, ERIAR_MASK_1111, .val = high }, | ||
3139 | { .addr = 0xf0, ERIAR_MASK_1111, .val = low << 16 }, | ||
3140 | { .addr = 0xf4, ERIAR_MASK_1111, .val = high << 16 | | ||
3141 | low >> 16 }, | ||
3142 | }; | ||
3143 | |||
3144 | rtl_write_exgmac_batch(ioaddr, e, ARRAY_SIZE(e)); | ||
3145 | } | ||
3146 | |||
3119 | RTL_W8(Cfg9346, Cfg9346_Lock); | 3147 | RTL_W8(Cfg9346, Cfg9346_Lock); |
3120 | 3148 | ||
3121 | spin_unlock_irq(&tp->lock); | 3149 | spin_unlock_irq(&tp->lock); |