diff options
author | "Ori Bernstein" <ori@eigenstate.org> | 2022-08-12 09:06:29 +0000 |
---|---|---|
committer | "Ori Bernstein" <ori@eigenstate.org> | 2022-08-12 09:06:29 +0000 |
commit | 302e5bc94465df9b36e326faea94dcd018b1b491 (patch) | |
tree | 5a5ed3c4d8c132bc7119d578c88ce7c5c06f8c3d /sys/src/9/pc/ether8169.c | |
parent | 42a2c7167b4da87df9bfd0a350d9ffdaa2a26490 (diff) |
ether8169: support for RTL8168EP chips
There are a few flags we need to set, and the order
of initialization changed. Synced from the FreeBSD
driver, with the mac version coming from Linux.
Diffstat (limited to 'sys/src/9/pc/ether8169.c')
-rw-r--r-- | sys/src/9/pc/ether8169.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/src/9/pc/ether8169.c b/sys/src/9/pc/ether8169.c index 119fbce66..bb020921e 100644 --- a/sys/src/9/pc/ether8169.c +++ b/sys/src/9/pc/ether8169.c @@ -126,6 +126,7 @@ enum { /* Tcr */ Macv42 = 0x50800000, /* RTL8168GU */ Macv44 = 0x5c800000, /* RTL8411B */ Macv45 = 0x54000000, /* RTL8111HN */ + Macv51 = 0x50000000, /* RTL8168EP */ Ifg0 = 0x01000000, /* Interframe Gap 0 */ Ifg1 = 0x02000000, /* Interframe Gap 1 */ @@ -714,6 +715,7 @@ rtl8169init(Ether* edev) switch(ctlr->macv){ case Macv40: case Macv44: + case Macv51: cplusc |= Macstatdis; break; default: @@ -737,6 +739,7 @@ rtl8169init(Ether* edev) switch(ctlr->macv){ case Macv42: case Macv45: + case Macv51: ctlr->rcr = Rxfth256|Mrxdmaunlimited|Ab|Am|Apm; break; default: @@ -758,6 +761,9 @@ rtl8169init(Ether* edev) r = csr16r(ctlr, Mulint) & 0xF000; csr16w(ctlr, Mulint, r); + if(ctlr->macv == Macv51) + csr8w(ctlr, Cr, Te|Re); + ctlr->imr = Serr|Fovw|Punlc|Rdu|Ter|Rer|Rok|Tdu; csr16w(ctlr, Imr, ctlr->imr); @@ -1096,6 +1102,7 @@ vetmacv(Ctlr *ctlr, uint *macv) case Macv42: case Macv44: case Macv45: + case Macv51: break; } return 0; |