From: David van Moolenbroek Date: Wed, 13 Feb 2013 22:57:28 +0000 (+0100) Subject: rtl8169: add support for RTL8101E family X-Git-Tag: v3.2.1~2 X-Git-Url: http://zhaoyanbai.com/repos/man.dnssec-importkey.html?a=commitdiff_plain;h=91cea699bb2ee39b5e7f2c549af57d4b8a4b9d56;p=minix.git rtl8169: add support for RTL8101E family All cards in this family (RTL8101E, RTL8102E, RTL8103E, RTL8105E, possibly others) should be recognized based on the added PCI ID. The hardware version number of the RTL8105E has been added only to serve as an example of a card that does not require modification of certain undocumented registers. --- diff --git a/drivers/pci/pci_table.c b/drivers/pci/pci_table.c index f53a9e0b2..e468f2948 100644 --- a/drivers/pci/pci_table.c +++ b/drivers/pci/pci_table.c @@ -92,6 +92,7 @@ struct pci_device pci_device_table[]= { 0x10DE, 0x0110, "nVidia GeForce2 MX [NV11]" }, { 0x10EC, 0x8029, "Realtek RTL8029" }, { 0x10EC, 0x8129, "Realtek RTL8129" }, + { 0x10EC, 0x8136, "Realtek RTL8101E Family" }, { 0x10EC, 0x8139, "Realtek RTL8139" }, { 0x10EC, 0x8167, "Realtek RTL8169/8110 Family Gigabit NIC" }, { 0x10EC, 0x8169, "Realtek RTL8169" }, diff --git a/drivers/rtl8169/rtl8169.c b/drivers/rtl8169/rtl8169.c index 6a3490205..587514ecd 100644 --- a/drivers/rtl8169/rtl8169.c +++ b/drivers/rtl8169/rtl8169.c @@ -980,6 +980,9 @@ re_t *rep; printf("Set MAC Reg C+CR Offset 0x82h = 0x01h\n"); rl_outw(port, 0x82, 0x01); break; + case RL_TCR_HWVER_RTL8105E: + rep->re_model = "RTL8105E"; + break; default: rep->re_model = "Unknown"; rep->re_mac = t; @@ -1012,14 +1015,21 @@ re_t *rep; rl_outw(port, RL_9346CR, RL_9346CR_EEM_CONFIG); /* Unlock */ - t = rl_inw(port, RL_CPLUSCMD); - if ((rep->re_mac == RL_TCR_HWVER_RTL8169S) || - (rep->re_mac == RL_TCR_HWVER_RTL8110S)) { + switch (rep->re_mac) { + case RL_TCR_HWVER_RTL8169S: + case RL_TCR_HWVER_RTL8110S: printf("Set MAC Reg C+CR Offset 0xE0. " "Bit-3 and bit-14 MUST be 1\n"); + t = rl_inw(port, RL_CPLUSCMD); rl_outw(port, RL_CPLUSCMD, t | RL_CPLUS_MULRW | (1 << 14)); - } else + break; + case RL_TCR_HWVER_RTL8169: + case RL_TCR_HWVER_RTL8169SB: + case RL_TCR_HWVER_RTL8110SCd: + t = rl_inw(port, RL_CPLUSCMD); rl_outw(port, RL_CPLUSCMD, t | RL_CPLUS_MULRW); + break; + } rl_outw(port, RL_INTRMITIGATE, 0x00); diff --git a/drivers/rtl8169/rtl8169.conf b/drivers/rtl8169/rtl8169.conf index b97a64278..79a21dc4b 100644 --- a/drivers/rtl8169/rtl8169.conf +++ b/drivers/rtl8169/rtl8169.conf @@ -9,6 +9,7 @@ service rtl8169 DEVIO # 21 ; pci device 10ec/8129; + pci device 10ec/8136; pci device 10ec/8167; pci device 10ec/8169; pci device 10ec/8168; diff --git a/drivers/rtl8169/rtl8169.h b/drivers/rtl8169/rtl8169.h index d806c589a..19f4dc0ef 100644 --- a/drivers/rtl8169/rtl8169.h +++ b/drivers/rtl8169/rtl8169.h @@ -114,6 +114,7 @@ #define RL_TCR_HWVER_RTL8110S 0x04000000 /* RTL8110S */ #define RL_TCR_HWVER_RTL8169SB 0x10000000 /* RTL8169sb/8110sb */ #define RL_TCR_HWVER_RTL8110SCd 0x18000000 /* RTL8169sc/8110sc */ +#define RL_TCR_HWVER_RTL8105E 0x40800000 /* RTL8105E */ #define RL_TCR_RES1 0x00380000 /* Reserved */ #define RL_TCR_LBK_M 0x00060000 /* Loopback Test */ #define RL_TCR_LBK_NORMAL 0x00000000 /* Normal */