Solved RTL8188CE /w rtwn(4): 802.11n mode?

zirias@

Developer
I rarely use my little notebook (or netbook?), still it starts to annoy me it's operating in 802.11g mode, mostly because this makes updates soooo slow :what:

So, just dropping relevant info here, hoping someone knows a way to make it use 802.11n.

/boot/loader.conf:
Code:
# RTL8188CE + firmware
if_rtwn_pci_load="YES"
rtwn-rtl8192cfwE_load="YES"
rtwn-rtl8192cfwE_B_load="YES"
legal.realtek.license_ack=1

/etc/rc.conf:
Code:
ipv6_activate_all_interfaces="YES"
rtsold_enable="YES"
rtsold_flags="-aF"
wlans_rtwn0="wlan0"
ifconfig_wlan0="WPA DHCP"

ifconfig:
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 60:d8:19:cc:57:30
    inet6 fe80::62d8:19ff:fecc:5730%wlan0 prefixlen 64 scopeid 0x3
    inet6 2001:470:72ae:99:62d8:19ff:fecc:5730 prefixlen 64 autoconf
    inet 192.168.99.4 netmask 0xffffff00 broadcast 192.168.99.255
    groups: wlan
    ssid home.palmen-it.de channel 11 (2462 MHz 11g) bssid b0:be:76:53:af:64
    regdomain FCC country US authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS wme roaming MANUAL
    parent interface: rtwn0
    media: IEEE 802.11 Wireless Ethernet OFDM/18Mbps mode 11g
    status: associated
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

pciconf:
Code:
rtwn0@pci0:1:0:0:    class=0x028000 rev=0x01 hdr=0x00 vendor=0x10ec device=0x8176 subvendor=0x10ec subdevice=0x8195
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    device     = 'RTL8188CE 802.11b/g/n WiFi Adapter'
    class      = network

BTW I see multiple subforums where this could match, feel free to move if you think this is the wrong one...
 
Got the hint on IRC that a wrong regdomain can cause all sorts of problems, so fixing that is definitely a good idea, therefore changed /etc/rc.conf:
Code:
ifconfig_wlan0="WPA DHCP country DE"

Unfortunately, this still doesn't enable 802.11n :(
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
    ether 60:d8:19:cc:57:30
    inet6 fe80::62d8:19ff:fecc:5730%wlan0 prefixlen 64 scopeid 0x3
    inet6 2001:470:72ae:99:62d8:19ff:fecc:5730 prefixlen 64 autoconf
    inet 192.168.99.4 netmask 0xffffff00 broadcast 192.168.99.255
    groups: wlan
    ssid home.palmen-it.de channel 11 (2462 MHz 11g) bssid b0:be:76:53:af:64
    regdomain ETSI country DE authmode WPA2/802.11i privacy ON
    deftxkey UNDEF AES-CCM 2:128-bit txpower 30 bmiss 7 scanvalid 60
    protmode CTS wme roaming MANUAL
    parent interface: rtwn0
    media: IEEE 802.11 Wireless Ethernet OFDM/36Mbps mode 11g
    status: associated
    nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>
 
Same here with ASUS N10 USB dongle:

rtwn0 on uhub0
rtwn0: <Realtek 802.11n NIC, class 0/0, rev 2.00/0.00, addr 6> on usbus0
rtwn0: MAC/BB RTL8188EU, RF 6052 1T1R

wlan1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 3c:7c:3f:3c:6a:d2
inet 192.168.0.28 netmask 0xffffff00 broadcast 192.168.0.255
groups: wlan
ssid VM0833161 channel 1 (2412 MHz 11g ht/20) bssid 18:35:d1:55:d8:39
regdomain FCC country US authmode WPA2/802.11i privacy ON
deftxkey UNDEF AES-CCM 3:128-bit txpower 30 bmiss 7 scanvalid 60
protmode CTS ht20 ampdulimit 64k ampdudensity 8 shortgi -stbc -ldpc
-uapsd wme roaming MANUAL
parent interface: rtwn0
media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
status: associated
nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>

Can't get it to operate at 802.11n, although not sure if 11g ht/20 should be interpreted as 802.11n? Confused.
 
Another long-standing issue solved. Back when I first tried FreeBSD on that machine, I still had some Debian installed on it and a completely different environment than today (access points ...), and while Debian reached 802.11n speeds, FreeBSD did not.

So when this never improved, I just assumed it was for FreeBSD's "well-known" shortcomings in WiFi support.

Turns out it wasn't. 🙈

Quite some time ago, I found I had to enable a tunable in /boot/loader.conf to allow this card to use "full width" channels:
dev.rtwn.0.ht40=1
... but unfortunately, still "just" 802.11g.

Yesterday, I installed another upgrade for my Wifi (controller software and AP firmware), and, suddenly, it looks like this 🥳:
Code:
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 60:d8:19:cc:57:30
        inet6 fe80::62d8:19ff:fecc:5730%wlan0 prefixlen 64 scopeid 0x3
        inet6 2001:470:72ae:99:62d8:19ff:fecc:5730 prefixlen 64 autoconf
        inet 192.168.99.4 netmask 0xffffff00 broadcast 192.168.99.255
        groups: wlan
        ssid home.palmen-it.de channel 1 (2412 MHz 11g ht/40+) bssid b0:be:76:53:af:64
        regdomain ETSI country DE ecm authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 3:128-bit txpower 30 bmiss 7 scanvalid 60
        protmode CTS ampdulimit 64k ampdudensity 8 shortgi -stbc -ldpc -uapsd
        wme roaming MANUAL
        parent interface: rtwn0
        media: IEEE 802.11 Wireless Ethernet MCS mode 11ng
        status: associated
        nd6 options=23<PERFORMNUD,ACCEPT_RTADV,AUTO_LINKLOCAL>

In practice, I now get 8MiB/s with some (internal network) https download. Still not awesome, but quite okayish.

My theory of what failed is some strange "incompatibility" between the AP and FreeBSD with RTL8188CE. This card is 802.11n capable, but unfortunately only on 2.4GHz. The AP supports "b/g/n" on 2.4GHz and "n/ac" on 5GHz. Somehow it failed to inform the station that it can use HT with 40MHz-wide channels. I have no idea which end was at fault here, I guess it was the AP ... (other .n devices worked as expected, but they're all also 5GHz capable).

So, in a nutshell, to get full functionality from RTL8188CE:
  1. Add some stuff to /boot/loader.conf (see rtwnfn(4) and rtwn(4) for similar devices) so it can load and use firmware and use 40MHz bands:
    Code:
    legal.realtek.license_ack=1
    dev.rtwn.0.ht40=1
    rtwn-rtl8192cfwE_B_load="YES"
    rtwn-rtl8192cfwE_load="YES"
  2. If it's still stuck to plain 802.11g, look out for updates for your AP
 
Back
Top