Bug 239795 - rtwn(4): Add PCI Device ID's for Realtek RTL8192CE.
Summary: rtwn(4): Add PCI Device ID's for Realtek RTL8192CE.
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: CURRENT
Hardware: amd64 Any
: --- Affects Some People
Assignee: Andriy Voskoboinyk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-12 07:12 UTC by James Parsons
Modified: 2020-08-11 17:55 UTC (History)
4 users (show)

See Also:
markj: mfc-stable12+


Attachments
Patch containing solution (436 bytes, patch)
2019-08-12 07:12 UTC, James Parsons
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Parsons 2019-08-12 07:12:44 UTC
Created attachment 206466 [details]
Patch containing solution

On a new installation of FreeBSD (I've tried it on both FreeBSD 12.0-RELEASE and On FreeBSD 13.0-CURRENT, certain wireless adapters based on the RTL8192CE chipset are not recognized by the rtwn driver. In my particular instance, the card was an ASUS PCE-N15 wireless adapter. Running pciconv -lv shows that the vendor information was correct, but that there is no driver attached e.g. 

    none1@pci0:29:0:0:	class=0x028000 card=0x85e31043 chip=0x817810ec rev=0x01 hdr=0x00
        vendor     = 'Realtek Semiconductor Co., Ltd.'
        device     = 'RTL8192CE PCIe Wireless Network Adapter'

looking at the kernel source under sys/dev/rtwn/pci/rtwn_pci_attach.h, I can see that there is an array containing a list of vendor / device id's. Not included in said array is the PCI device id for my particular card (0x8178). After adding an entry with the device id (see attached patch), building / installing a kernel and rebooting, the card is recognized and the rtwn driver attaches. Furthermore I configured the interface and the driver does work as expected otherwise.

    rtwn0@pci0:29:0:0:	class=0x028000 card=0x85e31043 chip=0x817810ec rev=0x01 hdr=0x00
        vendor     = 'Realtek Semiconductor Co., Ltd.'
        device     = 'RTL8192CE PCIe Wireless Network Adapter'

There may or may not be other cards who's device id's may need separate entries, but as I haven't encountered the hardware, my attached patch only contains the entry for a device id I have confirmed does not work.
Comment 1 Andriy Voskoboinyk freebsd_committer freebsd_triage 2019-08-12 07:50:53 UTC
Yes, the patch is fine; it wasn't committed since the driver was not tested with 2T2R device when it got into the tree (or probably I've missed that).
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-08-12 08:01:28 UTC
A commit references this bug:

Author: avos
Date: Mon Aug 12 08:01:21 UTC 2019
New revision: 350885
URL: https://svnweb.freebsd.org/changeset/base/350885

Log:
  rtwn_pci: add device ID for RTL8192CE.

  PR:		239795
  Submitted by:	James Parsons <james.m.parsons@protonmail.com>
  MFC after:	1 week
  Relnotes:	yes

Changes:
  head/sys/dev/rtwn/pci/rtwn_pci_attach.h
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2020-07-31 03:22:08 UTC
@Andriy Did this end up being merged? If so, please add a comment with the relevant 'base rXXXXXXX' which will auto-link to that changeset, and set mfc-stable12 to +

Thanks!
Comment 4 commit-hook freebsd_committer freebsd_triage 2020-08-11 17:55:04 UTC
A commit references this bug:

Author: markj
Date: Tue Aug 11 17:54:10 UTC 2020
New revision: 364128
URL: https://svnweb.freebsd.org/changeset/base/364128

Log:
  MFC r350885 (by avos):
  rtwn_pci: add device ID for RTL8192CE.

  PR:	239795

Changes:
_U  stable/12/
  stable/12/sys/dev/rtwn/pci/rtwn_pci_attach.h