Giter Club home page Giter Club logo

rtw88-usb's Introduction

rtw88-usb

It's under GPL license, and please feel free to use it. Also welcome to upstream to the Linux kernel if you want, and please refer to the branch, for_kernel_upstream, which meets the Linux coding style, and may be easier to upstream.

Thank to many people's kind help on this project.

Driver for 802.11ac USB Adapter with chipset: RTL88x2BU / RTL88x2CU

supports at least managed (i.e. client) and monitor mode.

This driver is based on Realtek's rtw88 driver in Linux main trunk.

A few known wireless cards that use this driver include

Build

$ make clean
$ make

Installation

Load driver for test:

$ sudo mkdir -p /lib/firmware/rtw88
$ sudo cp fw/rtw8822* /lib/firmware/rtw88/
$ sudo insmod rtw88.ko
$ sudo insmod rtwusb.ko

Load driver at boot:

$ sudo mkdir -p /lib/firmware/rtw88
$ sudo cp fw/rtw8822* /lib/firmware/rtw88/
$ sudo mkdir /lib/modules/`uname -r`/kernel/drivers/net/wireless/realtek/rtw88
$ sudo cp rtw88.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/realtek/rtw88
$ sudo cp rtwusb.ko /lib/modules/`uname -r`/kernel/drivers/net/wireless/realtek/rtw88
$ sudo depmod -a
$ sudo echo -e "rtw88\nrtwusb" > /etc/modules-load.d/rtwusb.conf
$ sudo systemctl start systemd-modules-load

General Commands

Scan:

$ sudo iw wlanX scan

Connect to the AP without security:

$ sudo iw wlanX connect <AP name>

Wifi Sniffer - monitor mode

$ sudo ip link set wlanX down
$ sudo iw dev wlanX set type monitor
$ sudo rfkill unblock all
$ sudo ip link set wlanX up

Then you can use "iw info" to check if the wireless mode is correct.

e.g.
    wlan1    IEEE 802.11  Mode:Monitor ... 

And you can use the program like wireshark to sniffer wifi packets.

  1. set up the sniffer channel
$ sudo iw dev wlanX set channel xxx
  1. run the program
$ sudo wireshark

Test

test ok with general commands with the latest kernel ubuntu 18 + kernel v5.3 test with Network Manager ok.

Known Issues

  • None atm. Need to checkpatch and clean some code only.

rtw88-usb's People

Contributors

borting avatar kimocoder avatar neojou avatar ulli-kroll 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

Watchers

 avatar  avatar  avatar  avatar

rtw88-usb's Issues

Documentation bug? Following "load driver for test" sudo insmod rtw88.ko insmod: ERROR: could not load module rtw88.ko: No such file or directory

And indeed after make there are a lot of .ko but not rtw88.ko :
black@xpslx:~/build/rtw88-usb/rtw88-usb-master$ l *.ko
rtw88_8723de.ko rtw88_8723du.ko rtw88_8821c.ko rtw88_8822be.ko rtw88_8822bu.ko rtw88_8822c.ko rtw88_core.ko rtw88_usb.ko
rtw88_8723d.ko rtw88_8821ce.ko rtw88_8821cu.ko rtw88_8822b.ko rtw88_8822ce.ko rtw88_8822cu.ko rtw88_pci.ko

Do Ineed to config something in the Makefile perhaps?

rtl8812bu support?

Hi,
is it possible to support rtl8812bu chip

[ 1062.792370] usb 3-2.2: new high-speed USB device number 6 using xhci_hcd
[ 1062.885581] usb 3-2.2: New USB device found, idVendor=0bda, idProduct=b812, bcdDevice= 2.10
[ 1062.885583] usb 3-2.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1062.885583] usb 3-2.2: Product: USB3.0 802.11ac 1200M Adapter
[ 1062.885584] usb 3-2.2: Manufacturer: Realtek
[ 1062.885584] usb 3-2.2: SerialNumber: 123456

[Qusetion] plan to go mainline?

Thank you for supporting realtek device.

Ask 2 question to you.

  1. I want to use "rtl8822cu" USB wifi dongle on my Linux kernel 5.4.70 arm64 architecture.
    Just build your code and type modprobe on my board?

  2. Any plan to go your code on mainline ?

Error: redefinition of 'fsleep'

"error: redefinition of 'fsleep'."

Commented the lines of code in main.h and rtw8822c.c regarding fsleep and was able to compile. Test command(s) don't work.

rtl8822bu: high latency, "failed to wait usb ctrl" errors

I'm running into an issue trying to use this driver with my 8822bu USB dongle. After loading the module and plugging in the dongle, it is successfully recognized, an interface shows up, and I am able to scan for and join networks. However it has very high packet latency and correspondingly low throughput. For example:

$ ping 172.16.1.1
PING 172.16.1.1 (172.16.1.1) 56(84) bytes of data.
64 bytes from 172.16.1.1: icmp_seq=1 ttl=64 time=2063 ms
64 bytes from 172.16.1.1: icmp_seq=2 ttl=64 time=2118 ms
64 bytes from 172.16.1.1: icmp_seq=3 ttl=64 time=2381 ms

This is with an access point that is a few feet away, and I would expect to see latency under 1 ms.

Looking in the kernel log, I can see a lot of failure messages. Here's a snippet:

[38973.221372] usbcore: registered new interface driver rtw_8822bu
[38985.694888] usb 1-2: new high-speed USB device number 4 using xhci_hcd
[38986.052877] usb 1-2: New USB device found, idVendor=0bda, idProduct=b812, bcdDevice= 2.10
[38986.052879] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[38986.052880] usb 1-2: Product: USB3.0 802.11ac 1200M Adapter
[38986.052881] usb 1-2: Manufacturer: Realtek
[38986.052881] usb 1-2: SerialNumber: 123456
[38986.058034] rtw_8822bu 1-2:1.0: USB: 2
[38986.058091] rtw_8822bu 1-2:1.0: firmware: direct-loading firmware rtw88/rtw8822b_fw.bin
[38986.058093] rtw_8822bu 1-2:1.0: Firmware version 27.2.0, H2C version 13
[38987.099372] rtw_8822bu 1-2:1.0: use rfe_def[3]
[38988.260105] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64
[38989.251323] rtw_8822bu 1-2:1.0: start vif bc:ec:23:c3:5c:d6 on port 0
[38989.312292] rtw_8822bu 1-2:1.0: stop vif bc:ec:23:c3:5c:d6 on port 0
[38991.302133] rtw_8822bu 1-2:1.0: start vif 4a:0e:6c:6e:cf:e9 on port 0
[38994.131871] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:192
[38994.162061] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:192
[38994.192599] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:192
[38994.223012] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64
[38994.253239] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64
[38994.283422] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:192
[38994.313841] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:192
[38994.449329] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:192
[38994.479484] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:192
[39002.466902] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64
[39002.497113] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64
[39002.527281] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64
[39002.557467] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64
[39002.587621] rtw_8822bu 1-2:1.0: failed to wait usb ctrl req:64

These messages repeat until I unplug the dongle or unload the driver. I've noticed that the number is always either 64 or 192. Unfortunately I'm a bit out of my depth here and am not sure how to continue debugging. Any thoughts? This dongle does work using the separate 88x2bu driver, so I don't think the hardware is broken.

I'm running kernel version 5.10.

TODO

  • Merge more PCI/SDIO code from upstream
  • Add compatibility for older kernels
  • Fix Makefile (so it's more complete then now)

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.