Re: [Patch] Add support for Realtek RTL8111FP-CG Ethernet Controller

2021-05-06 Thread Jonathan Gray
On Thu, May 06, 2021 at 12:38:17PM -0400, Stephen Taylor wrote:
> This is my first post to the mailing list and my first time customizing 
> the kernel. I apologize in advance for mistakes I make.
> 
> I have a Lenovo ThinkCenter M75n Nano IoT computer. It uses the Realtek 
> RTL8111FP-CG Ethernet controller, as do other similar small form factor 
> computers. OpenBSD 6.9 does not recognize the controller. dmesg shows:
> 
> re0 at pci2 dev 0 function 1 "Realtek 8168" rev 0x1a: unknown ASIC 
> (0x5480), msi, address 00:00:00:00
> 
> Studying similar posts in the mailing lists, I made the changes shown
> in the diffs below, compiled the kernel, and now OpenBSD recognizes 
> and can use the Ethernet.
> 
> Would someone be willing to review and/or commit this? Thank you!

Thanks, committed.  This id is also used by RTL8117.

> 
>  
> Index: re.c
> ===
> RCS file: /cvs/src/sys/dev/ic/re.c,v
> retrieving revision 1.208
> diff -u -p -u -r1.208 re.c
> --- re.c  12 Dec 2020 11:48:52 -  1.208
> +++ re.c  6 May 2021 16:13:43 -
> @@ -248,6 +248,7 @@ static const struct re_revision {
>   { RL_HWREV_8168E,   "RTL8168E/8111E" },
>   { RL_HWREV_8168E_VL,"RTL8168E/8111E-VL" },
>   { RL_HWREV_8168EP,  "RTL8168EP/8111EP" },
> + { RL_HWREV_8168FP,  "RTL8168FP/8111FP" },
>   { RL_HWREV_8169,"RTL8169" },
>   { RL_HWREV_8169_8110SB, "RTL8169/8110SB" },
>   { RL_HWREV_8169_8110SBL, "RTL8169SBL" },
> @@ -754,6 +755,7 @@ re_attach(struct rl_softc *sc, const cha
>   sc->rl_max_mtu = RL_JUMBO_MTU_9K;
>   break;
>   case RL_HWREV_8168EP:
> + case RL_HWREV_8168FP:
>   case RL_HWREV_8168G:
>   case RL_HWREV_8168GU:
>   case RL_HWREV_8168H:
> Index: rtl81x9reg.h
> ===
> RCS file: /cvs/src/sys/dev/ic/rtl81x9reg.h,v
> retrieving revision 1.101
> diff -u -p -u -r1.101 rtl81x9reg.h
> --- rtl81x9reg.h  11 Apr 2018 08:02:18 -  1.101
> +++ rtl81x9reg.h  6 May 2021 16:13:43 -
> @@ -210,6 +210,7 @@
>  #define RL_HWREV_8168EP  0x5000
>  #define RL_HWREV_8168GU  0x5080
>  #define RL_HWREV_8168H   0x5400
> +#define RL_HWREV_8168FP  0x5480
>  #define RL_HWREV_8411B   0x5c80  
>  #define RL_HWREV_81390x6000
>  #define RL_HWREV_8139A   0x7000
> 
> 



[Patch] Add support for Realtek RTL8111FP-CG Ethernet Controller

2021-05-06 Thread Stephen Taylor
This is my first post to the mailing list and my first time customizing 
the kernel. I apologize in advance for mistakes I make.

I have a Lenovo ThinkCenter M75n Nano IoT computer. It uses the Realtek 
RTL8111FP-CG Ethernet controller, as do other similar small form factor 
computers. OpenBSD 6.9 does not recognize the controller. dmesg shows:

re0 at pci2 dev 0 function 1 "Realtek 8168" rev 0x1a: unknown ASIC 
(0x5480), msi, address 00:00:00:00

Studying similar posts in the mailing lists, I made the changes shown
in the diffs below, compiled the kernel, and now OpenBSD recognizes 
and can use the Ethernet.

Would someone be willing to review and/or commit this? Thank you!

 
Index: re.c
===
RCS file: /cvs/src/sys/dev/ic/re.c,v
retrieving revision 1.208
diff -u -p -u -r1.208 re.c
--- re.c12 Dec 2020 11:48:52 -  1.208
+++ re.c6 May 2021 16:13:43 -
@@ -248,6 +248,7 @@ static const struct re_revision {
{ RL_HWREV_8168E,   "RTL8168E/8111E" },
{ RL_HWREV_8168E_VL,"RTL8168E/8111E-VL" },
{ RL_HWREV_8168EP,  "RTL8168EP/8111EP" },
+   { RL_HWREV_8168FP,  "RTL8168FP/8111FP" },
{ RL_HWREV_8169,"RTL8169" },
{ RL_HWREV_8169_8110SB, "RTL8169/8110SB" },
{ RL_HWREV_8169_8110SBL, "RTL8169SBL" },
@@ -754,6 +755,7 @@ re_attach(struct rl_softc *sc, const cha
sc->rl_max_mtu = RL_JUMBO_MTU_9K;
break;
case RL_HWREV_8168EP:
+   case RL_HWREV_8168FP:
case RL_HWREV_8168G:
case RL_HWREV_8168GU:
case RL_HWREV_8168H:
Index: rtl81x9reg.h
===
RCS file: /cvs/src/sys/dev/ic/rtl81x9reg.h,v
retrieving revision 1.101
diff -u -p -u -r1.101 rtl81x9reg.h
--- rtl81x9reg.h11 Apr 2018 08:02:18 -  1.101
+++ rtl81x9reg.h6 May 2021 16:13:43 -
@@ -210,6 +210,7 @@
 #define RL_HWREV_8168EP0x5000
 #define RL_HWREV_8168GU0x5080
 #define RL_HWREV_8168H 0x5400
+#define RL_HWREV_8168FP0x5480
 #define RL_HWREV_8411B 0x5c80  
 #define RL_HWREV_8139  0x6000
 #define RL_HWREV_8139A 0x7000