Hello,

I installed OpenBSD 5.9 on relatively new system running AMD A4 processor
(dmesg included) and the system has realtek 8179 wireless pci which does
not get recognized by the stock kernel.

The stock GENERIC kernel throws the following message during bootup for the
PCI device

vendor "Realtek", unknown product 0x8179 (class network subclass
miscellaneous, rev 0x01) at pci8 dev 0 function 0 not configured

After starting to dig further I made changed pcidevs in
/usr/src/sys/dev/pci, and recompiled the GENERIC.MP kernel, but that did
not work. Still got the same message as above

pcidump from the stock kernel
 8:0:0: Realtek unknown
        0x0000: Vendor ID: 10ec Product ID: 8179
        0x0004: Command: 0007 Status: 0010
        0x0008: Class: 02 Subclass: 80 Interface: 00 Revision: 01
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size:
10
        0x0010: BAR io addr: 0x0000c000/0x0100
        0x0014: BAR empty (00000000)
        0x0018: BAR mem 64bit addr: 0x00000000fe700000/0x00004000
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 10ec Product ID: 8179
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 05 Min Gnt: 00 Max Lat: 00
        0x0040: Capability 0x01: Power Management
                State: D0
        0x0050: Capability 0x05: Message Signaled Interrupts (MSI)
        0x0070: Capability 0x10: PCI Express
                Link Speed: 2.5 / 2.5 GT/s Link Width: x1 / x1
        0x0000: 817910ec 00100007 02800001 00000010
        0x0010: 0000c001 00000000 fe700004 00000000
        0x0020: 00000000 00000000 00000000 817910ec
        0x0030: 00000000 00000040 00000000 00000105


So I changed the following, (why I choose rtwn? because everything else is
either USB or Ethernet interface AFAICT under realtek, this adapter is
capable of running 802.11ac, previous system was Windows 10, so know from
that)

Index: if_rtwn.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_rtwn.c,v
retrieving revision 1.12
diff -u -p -u -r1.12 if_rtwn.c
--- if_rtwn.c   5 Jan 2016 18:41:15 -0000       1.12
+++ if_rtwn.c   13 Aug 2016 23:42:25 -0000
@@ -78,7 +78,8 @@ int rtwn_debug = 0;
                        R92C_IMR_RXFOVW)

 static const struct pci_matchid rtwn_pci_devices[] = {
-       { PCI_VENDOR_REALTEK,   PCI_PRODUCT_REALTEK_RT8188 }
+       { PCI_VENDOR_REALTEK,   PCI_PRODUCT_REALTEK_RT8188 },
+       { PCI_VENDOR_REALTEK,   PCI_PRODUCT_REALTEK_RT8179 },
 };

 int            rtwn_match(struct device *, void *, void *);
Index: pcidevs
===================================================================
RCS file: /cvs/src/sys/dev/pci/pcidevs,v
retrieving revision 1.1788
diff -u -p -u -r1.1788 pcidevs
--- pcidevs     20 Feb 2016 14:34:27 -0000      1.1788
+++ pcidevs     13 Aug 2016 23:42:26 -0000
@@ -6355,6 +6355,7 @@ product REALTEK RTL8192SE 0x8172  8192SE
 product REALTEK RT8180         0x8180  8180
 product REALTEK RT8185         0x8185  8185
 product REALTEK RT8188         0x8176  8188CE
+product REALTEK RT8188         0x8179  8188CE
 product REALTEK RTL8192CE      0x8178  RTL8192CE
 product REALTEK RTL8192EE      0x818b  RTL8192EE
 product REALTEK RTL8190P       0x8190  RTL8190P
Index: pcidevs.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/pcidevs.h,v
retrieving revision 1.1781
diff -u -p -u -r1.1781 pcidevs.h
--- pcidevs.h   20 Feb 2016 14:34:32 -0000      1.1781
+++ pcidevs.h   13 Aug 2016 23:42:27 -0000
@@ -6361,6 +6361,7 @@
 #define        PCI_PRODUCT_REALTEK_RT8185      0x8185          /* 8185 */
 #define        PCI_PRODUCT_REALTEK_RT8188      0x8176          /* 8188CE */
 #define        PCI_PRODUCT_REALTEK_RTL8192CE   0x8178          /*
RTL8192CE */
+#define  PCI_PRODUCT_REALTEK_RT8179 0x8179
 #define        PCI_PRODUCT_REALTEK_RTL8192EE   0x818b          /*
RTL8192EE */
 #define        PCI_PRODUCT_REALTEK_RTL8190P    0x8190          /* RTL8190P
*/
 #define        PCI_PRODUCT_REALTEK_RTL8192E    0x8192          /* RTL8192E
*/
Index: pcidevs_data.h
===================================================================
RCS file: /cvs/src/sys/dev/pci/pcidevs_data.h,v
retrieving revision 1.1776
diff -u -p -u -r1.1776 pcidevs_data.h
--- pcidevs_data.h      20 Feb 2016 14:34:32 -0000      1.1776
+++ pcidevs_data.h      13 Aug 2016 23:42:27 -0000
@@ -22156,6 +22156,10 @@ static const struct pci_known_product pc
            "8192SE",
        },
        {
+                PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8179,
+                "8179",
+       },
+       {
            PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8180,
            "8180",
        },

which resulted in the kernel knowing more about the device.

rtwn0 at pci8 dev 0 function 0 "Realtek 8179" rev 0x01: msi
rtwn0: MAC/BB RTL8188CE, RF 6052 1T1R, address 2c:2c:64:5a:04:94

pcidump from the new kernel compiled with the above diff
[881]$ doas pcidump -v -x 8:0:0
 8:0:0: Realtek unknown
        0x0000: Vendor ID: 10ec Product ID: 8179
        0x0004: Command: 0007 Status: 0010
        0x0008: Class: 02 Subclass: 80 Interface: 00 Revision: 01
        0x000c: BIST: 00 Header Type: 00 Latency Timer: 00 Cache Line Size:
10
        0x0010: BAR io addr: 0x0000c000/0x0100
        0x0014: BAR empty (00000000)
        0x0018: BAR mem 64bit addr: 0x00000000fe700000/0x00004000
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 10ec Product ID: 8179
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 05 Min Gnt: 00 Max Lat: 00
        0x0040: Capability 0x01: Power Management
                State: D0
        0x0050: Capability 0x05: Message Signaled Interrupts (MSI)
        0x0070: Capability 0x10: PCI Express
                Link Speed: 2.5 / 2.5 GT/s Link Width: x1 / x1
        0x0000: 817910ec 00100007 02800001 00000010
        0x0010: 0000c001 00000000 fe700004 00000000
        0x0020: 00000000 00000000 00000000 817910ec
        0x0030: 00000000 00000040 00000000 00000105

But when I tried turning up the device, I get kernel panic (I cannot
provide ps or any other detail as my keyboard(s) do not respond after the
panic)

The kernel panic is (written by taking picture)
rtwn0: timeout waiting for MAC auto ON
rtwn0: could not power on adapter
rtwn0 detached
uvm_fault(0xffffffff81909440, 0xffff8000001792d8, 0, 1) -> e
kernel: page fault trap, code = 0
Stopped at rtwm_write_2+0xe: movq __ALIGN_SIZE+0x2d8
ddb>

I think I might be missing firmware, which might need to be loaded, but
linux-firmare.git has so many firmware, I am lost trying to find the
correct one in that repo and I am lost in firmware.openbsd.org as well.

dmesg from the system is attached.

Any help appreciated!

Thanks,
Prabhu
-

Attachment: dmesg.boot
Description: Binary data

Reply via email to