Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 262454
b: refs/heads/master
c: c28aa38
h: refs/heads/master
v: v3
  • Loading branch information
françois romieu authored and David S. Miller committed Aug 3, 2011
1 parent a6c56cc commit 7219ae6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 87b7ba3d24a25cf18aece447de27d7804fa9668c
refs/heads/master: c28aa38567101bad4e020f4392df41d0bf6c165c
27 changes: 27 additions & 0 deletions trunk/drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,21 @@ rtl_w1w0_eri(void __iomem *ioaddr, int addr, u32 mask, u32 p, u32 m, int type)
rtl_eri_write(ioaddr, addr, mask, (val & ~m) | p, type);
}

struct exgmac_reg {
u16 addr;
u16 mask;
u32 val;
};

static void rtl_write_exgmac_batch(void __iomem *ioaddr,
const struct exgmac_reg *r, int len)
{
while (len-- > 0) {
rtl_eri_write(ioaddr, r->addr, r->mask, r->val, ERIAR_EXGMAC);
r++;
}
}

static u8 rtl8168d_efuse_read(void __iomem *ioaddr, int reg_addr)
{
u8 value = 0xff;
Expand Down Expand Up @@ -3117,6 +3132,18 @@ static void rtl_rar_set(struct rtl8169_private *tp, u8 *addr)
RTL_W32(MAC0, low);
RTL_R32(MAC0);

if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
const struct exgmac_reg e[] = {
{ .addr = 0xe0, ERIAR_MASK_1111, .val = low },
{ .addr = 0xe4, ERIAR_MASK_1111, .val = high },
{ .addr = 0xf0, ERIAR_MASK_1111, .val = low << 16 },
{ .addr = 0xf4, ERIAR_MASK_1111, .val = high << 16 |
low >> 16 },
};

rtl_write_exgmac_batch(ioaddr, e, ARRAY_SIZE(e));
}

RTL_W8(Cfg9346, Cfg9346_Lock);

spin_unlock_irq(&tp->lock);
Expand Down

0 comments on commit 7219ae6

Please sign in to comment.