Coder Social home page Coder Social logo

rtl8821cu_driver_v5.8.1's Introduction

RTL8821CU_RTL8811CU_driver version v5.8.1

RTL8811CU and RTL8821CU driver

The Realtek RTL8811CU-CG is a highly integrated single-chip that supports 1-stream 802.11ac solutions with Multi-user MIMO (Multiple-Input, Multiple-Output) and Wireless LAN (WLAN) USB interface controller. It combines a WLAN MAC, a 1T1R capable WLAN baseband, and RF in a single chip. The RTL8811CU-CG provides an outstanding solution for a high-performance integrated wireless device.:

  • USB high speed interface
  • 802.11ac/abgn, 802.11ac
  • 2.4 GHz Support
  • 5.8 GHz Support
  • Supports concurrent mode (operates as two virtual WLAN interfaces)
  • MIMO config - 1x1
  • MU-MIMO
  • AC wave2
  • 256 QAM

Driver features

  • IEEE 802.11 b/g/n/ac WiFi compliant
  • 802.1x, WEP, WPA TKIP and WPA2 AES/Mixed mode for PSK and TLS (Radius)
  • WPA3 SAE (Personal)
  • WPS - PIN and PBC Methods
  • IEEE 802.11b/g/n/ac Client mode
    • Support wireless security for WEP, WPA TKIP and WPA2 AES PSK
    • Support site survey scan and manual connect
    • Support WPA/WPA2 TLS client
    • Support power saving mode
  • Soft AP mode
  • WiFi-Direct
  • Miracast
  • MU-MIMO
  • BT-COEXist
  • Mesh
  • Wake on WLAN

Platform support

  • Linux (kernel 2.6.18 ~ 5.x)
  • Android 1.6 ~ 2.3, 4.0 ~ 9.x

Linux driver support

The Linux driver appears as 8821cu.ko. Check if the USB sub-system recognizes the device.

uname -a
Linux nes3 4.19.0-6-amd64 #1 SMP Debian 4.19.67-2+deb10u2 (2019-11-11) x86_64 GNU/Linux
lsusb | grep Realtek
Bus 001 Device 003: ID 0bda:c811 Realtek Semiconductor Corp.
lsmod | grep 8821cu
8821cu               2260992  0
cfg80211              589824  1 8821cu
usbcore               253952  6 ehci_hcd,xhci_pci,btusb,8821cu,xhci_hcd,ehci_pci

If 8821cu is present, everything is good to go!

Building the driver

If the driver is not present, it can be built using the included driver sources.

  • Driver version : rtl8821CU_WiFi_linux_v5.8.1_34171.20190628_COEX20190509-4141
  • Driver changelog.pdf
  • Build tools - Install build tools, if needed (see below)
# Install build tools
sudo apt-get install build-essential -y
sudo apt-get install bc -y
sudo apt-get install unzip git -y

# install kernel headers
sudo apt-get install linux-headers-$(uname -r)

# check
apt search linux-headers-$(uname -r)
ls -l /usr/src/linux-headers-$(uname -r)

Option 1 - Direct build

git clone https://github.com/axiomware/RTL8821CU_driver_v5.8.1.git
cd RTL8821CU_driver_v5.8.1
Following customizations have been made to the default Makefile(see installation document for details):
  • Choose x86 target
  • Concurrent mode enabled (To disable, comment out EXTRA_CFLAGS += -DCONFIG_CONCURRENT_MODE)
  • Mesh point enabled (To disable, comment out EXTRA_CFLAGS += -DCONFIG_RTW_MESH)
  • Monitor mode enabled (To disable, set CONFIG_WIFI_MONITOR = n)
  • Log Level = 3 (default is 4, set CONFIG_RTW_LOG_LEVEL = 4)
# Build
make

# install
sudo make install

# reboot to start the wireless module or use modprobe to load the driver
sudo modprobe 8821cu

#uninstall the driver using make
sudo make uninstall

# or uninstall directly if make is not installed
KVER=$(uname -r)
MODFILE=/lib/modules/$KVER/kernel/drivers/net/wireless/8821cu.ko
sudo rm -f $MODFILE
sudo /sbin/depmod -a $KVER

Option 2 - DKMS build (verified on Debian 10 LTS with Kernel version 4.19)

DKMS is a system which will automatically recompile and install a kernel module when a new kernel gets installed or updated. To make use of DKMS, install the dkms package and follow the steps listed below:

sudo apt-get install dkms

DRV_NAME=rtl8821CU
DRV_VERSION=5.8.1

git clone https://github.com/axiomware/RTL8821CU_driver_v5.8.1.git

# Modify Makefile, if needed (see installation document for details)
# default Makefile is for:
# x86 target
# Concurrent mode enabled
# Monitor mode enabled
# Mesh point

sudo cp -r  RTL8821CU_driver_v5.8.1 /usr/src/${DRV_NAME}-${DRV_VERSION}

# Build and install
sudo dkms add -m ${DRV_NAME} -v ${DRV_VERSION}
sudo dkms build -m ${DRV_NAME} -v ${DRV_VERSION}
sudo dkms install -m ${DRV_NAME} -v ${DRV_VERSION}

# reboot to start the wireless module or use modprobe to load the driver
sudo modprobe 8821cu

# To remove a driver, do the following:
DRV_NAME=rtl8821CU
DRV_VERSION=5.8.1
sudo dkms remove ${DRV_NAME}/${DRV_VERSION} --all

Test Driver

sudo iwconfig
enp3s0    no wireless extensions.

enp1s0    no wireless extensions.

wlx30eb1f04ecad  unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

enp2s0    no wireless extensions.

lo        no wireless extensions.

wlp0s18u1u2  unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Auto  Frequency=2.412 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

rtl8821cu_driver_v5.8.1's People

Contributors

axiomware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rtl8821cu_driver_v5.8.1's Issues

can't build for armv7l

I wish to build this driver on Raspberry Pi 2B armv7l. There is no option in the Makefile.

Error when compiling Driver with DKMS

Getting the following errors when compiling the driver. My setup:

uname -r
5.4.0-0.bpo.4-amd64

Tried the temporary workaround suggested here:

Just a temporary workaround, but you can still compile and install the driver if you add the following line to the top of the Makefile:
USER_EXTRA_CFLAGS=-Wno-error=incompatible-pointer-types

Make[2]:` *** [/usr/src/linux-headers-5.4.0-0.bpo.4-common/Makefile:1665: /var/lib/dkms/rtl8821CU/5.8.1/build] Error 2
make[1]: *** [/usr/src/linux-headers-5.4.0-0.bpo.4-common/Makefile:179: sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-0.bpo.4-amd64'
make: *** [Makefile:2336: modules] Error 2
/var/lib/dkms/rtl8821CU/5.8.1/build/os_dep/linux/os_intfs.c:1707:22: error: initialization of ‘u16 (*)(struct net_device *, struct sk_buff *, struct net_device *)’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *)’} from incompatible pointer type ‘u16 (*)(struct net_device *, struct sk_buff *, struct net_device *, u16 (*)(struct net_device *, struct sk_buff *, struct net_device *))’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *, short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *))’} [-Werror=incompatible-pointer-types]
  .ndo_select_queue = rtw_select_queue,
                      ^~~~~~~~~~~~~~~~
/var/lib/dkms/rtl8821CU/5.8.1/build/os_dep/linux/os_intfs.c:1707:22: note: (near initialization for ‘rtw_netdev_ops.ndo_select_queue’)
/var/lib/dkms/rtl8821CU/5.8.1/build/os_dep/linux/os_intfs.c:3058:22: error: initialization of ‘u16 (*)(struct net_device *, struct sk_buff *, struct net_device *)’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *)’} from incompatible pointer type ‘u16 (*)(struct net_device *, struct sk_buff *, struct net_device *, u16 (*)(struct net_device *, struct sk_buff *, struct net_device *))’ {aka ‘short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *, short unsigned int (*)(struct net_device *, struct sk_buff *, struct net_device *))’} [-Werror=incompatible-pointer-types]
  .ndo_select_queue = rtw_select_queue,
                      ^~~~~~~~~~~~~~~~
/var/lib/dkms/rtl8821CU/5.8.1/build/os_dep/linux/os_intfs.c:3058:22: note: (near initialization for ‘rtw_netdev_vir_if_ops.ndo_select_queue’)
  CC [M]  /var/lib/dkms/rtl8821CU/5.8.1/build/os_dep/linux/usb_ops_linux.o
cc1: some warnings being treated as errors
make[3]: *** [/usr/src/linux-headers-5.4.0-0.bpo.4-common/scripts/Makefile.build:271: /var/lib/dkms/rtl8821CU/5.8.1/build/os_dep/linux/os_intfs.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [/usr/src/linux-headers-5.4.0-0.bpo.4-common/Makefile:1665: /var/lib/dkms/rtl8821CU/5.8.1/build] Error 2
make[1]: *** [/usr/src/linux-headers-5.4.0-0.bpo.4-common/Makefile:179: sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-0.bpo.4-amd64'
make: *** [Makefile:2336: modules] Error 2

Any idea to relve this issue will be very much appreciated! :)

Stay safe and healthy.
Stanley

Error when making the source code.

When I make the source code, there are some error occur.
./include/linux/slub_def.h:112:28: error: field ‘memcg_params’ has incomplete type 112 | struct memcg_cache_params memcg_params;
Any idea to solve this issue will be very much appreciated! :)

Stay safe and healthy.
BlueHeart0621

[Centos 8 - 4.18.0-305.12.1] Lots of compilation errors

  • 4.18.0-305.12.1.el8_4.x86_64
In file included from /home/alexis/git/RTL8821CU_driver_v5.8.1/include/osdep_intf.h:105,
                 from /home/alexis/git/RTL8821CU_driver_v5.8.1/include/drv_types.h:101,
                 from /home/alexis/git/RTL8821CU_driver_v5.8.1/core/mesh/rtw_mesh.c:18:
/home/alexis/git/RTL8821CU_driver_v5.8.1/core/mesh/rtw_mesh.c: In function ‘rtw_chk_candidate_peer_notify’:
/home/alexis/git/RTL8821CU_driver_v5.8.1/include/../os_dep/linux/ioctl_cfg80211.h:408:86: error: too few arguments to function ‘cfg80211_notify_new_peer_candidate’
 #define rtw_cfg80211_notify_new_peer_candidate(wdev, addr, ie, ie_len, sig_dbm, gfp) cfg80211_notify_new_peer_candidat
(wdev_to_ndev(wdev), addr, ie, ie_len, gfp)

In file included from /home/alexis/git/RTL8821CU_driver_v5.8.1/include/osdep_intf.h:105,
                 from /home/alexis/git/RTL8821CU_driver_v5.8.1/include/drv_types.h:101,
                 from /home/alexis/git/RTL8821CU_driver_v5.8.1/core/mesh/rtw_mesh.c:18:
/home/alexis/git/RTL8821CU_driver_v5.8.1/core/mesh/rtw_mesh.c: In function ‘rtw_mesh_expire_peer_notify’:
/home/alexis/git/RTL8821CU_driver_v5.8.1/include/../os_dep/linux/ioctl_cfg80211.h:408:86: error: too few arguments to function ‘cfg80211_notify_new_peer_candidate’
 #define rtw_cfg80211_notify_new_peer_candidate(wdev, addr, ie, ie_len, sig_dbm, gfp) cfg80211_notify_new_peer_candidat
(wdev_to_ndev(wdev), addr, ie, ie_len, gfp)

In file included from ./include/linux/time.h:5,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:10,
                 from /home/alexis/git/RTL8821CU_driver_v5.8.1/include/basic_types.h:76,
                 from /home/alexis/git/RTL8821CU_driver_v5.8.1/include/drv_types.h:26,
                 from /home/alexis/git/RTL8821CU_driver_v5.8.1/core/mesh/rtw_mesh.c:18:
./include/linux/slub_def.h: At top level:
./include/linux/rh_kabi.h:419:49: error: field ‘rh_reserved_memcg_params’ has incomplete type
 # define _RH_KABI_DEPRECATE(_type, _orig) _type rh_reserved_##_orig

image
image
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.