ulli-kroll / rtl8822bu

rtl8822bu/rtl8812bu driver for linux
GNU General Public License v2.0
65 stars 20 forks source link

USB3 issue #1

Open kimocoder opened 6 years ago

kimocoder commented 6 years ago

As for the USB3 (modeswitch) issue you might wan't to der what we did om our repo. Take a look at some lf these commits

USB3 modeswitch commit below https://github.com/aircrack-ng/rtl8812au/commit/cfdf854042c6b7fe73627413d143eac68b9b30ab

And also the Realtek switch was changed https://github.com/aircrack-ng/rtl8812au/commit/d6fe5161fd7cf9eba292fdd0799f1deaa32df55e

The one below is for 8814au https://github.com/aircrack-ng/rtl8812au/commit/6b80d7366928a14b919a25905a5dbd5e297feee2

We now have all chipsets, 8812/8814 and 8821 working with USB3.

ulli-kroll commented 6 years ago

For USB3 modeswitch in general
The code for this is already there for rtl8812bu (*) And Realtek changed this schematic/hardware for (newer) JAGUAR2 devices.

Anyway Currently I have two issues with this device or driver

(*) This was the first thing I've looked after.

cnlohr commented 5 years ago

Any way you can give me some example code for how I would actually try to test a mode switch on USB3? I can't seem to go past ~115 Mbps using the USB 2.0 interface, even if I do monitor mode and force a super high VHT MCS.

I've tried applying the changes here, and the adapter does enumerate with superspeed:

  bLength                 5
  bDescriptorType        15
  wTotalLength           22
  bNumDeviceCaps          2
  USB 2.0 Extension Device Capability:
    bLength                 7
    bDescriptorType        16
    bDevCapabilityType      2
    bmAttributes   0x00000002
      Link Power Management (LPM) Supported
  SuperSpeed USB Device Capability:
    bLength                10
    bDescriptorType        16
    bDevCapabilityType      3
    bmAttributes         0x00
    wSpeedsSupported   0x000e
      Device can operate at Full Speed (12Mbps)
      Device can operate at High Speed (480Mbps)
      Device can operate at SuperSpeed (5Gbps)
    bFunctionalitySupport   1
      Lowest fully-functional device speed is Full Speed (12Mbps)
    bU1DevExitLat          10 micro seconds
    bU2DevExitLat         287 micro seconds
Device Status:     0x000c
  (Bus Powered)
  U1 Enabled
  U2 Enabled

But, the actual transfer rate doesn't seem to be effected.

raplin commented 4 years ago

Can confirm superspeed works fine :-)

Tested against a R7800 (Qualcomm) which is 4x4ac, on 5.8, 80mhz channel

Modeswitch to SS works same as it does on 8812AU:

Before: |__ Port 3: Dev 4, If 2, Class=Vendor Specific Class, Driver=rtl88x2bu, 480M

With USB HS TX was clamped at 30MBytes/sec iperf3 transmit: [ 4] 16.00-17.00 sec 39.0 MBytes 327 Mbits/sec
iperf3 receive: [ 4] 3.00-4.00 sec 29.2 MBytes 245 Mbits/sec

SWITCH echo '1' >/sys/module/88x2bu/parameters/rtw_switch_usb_mode

{replug}

After: |__ Port 3: Dev 2, If 2, Class=Vendor Specific Class, Driver=rtl88x2bu, 5000M

Speed does increase (greatly):

Transmit

*cat /proc/net/rtl88x2bu//sta_tp_info ====== mac_id : 0 [08:02:8e:9e:ba:e9] ====== BCN counts : 10 (per-1 second), DTIM Period:2 tx_rate : VHTSS2MCS9(S)** rx_rate : VHTSS2MCS7, rx_rate_bmc : OFDM_6M, rssi : 55 % RTW: [TP] Tx : 533(Mbps) Rx : 1(Mbps) Total : 534(Mbps) RTW: [Smooth TP] Tx : 528(Mbps) Rx : 1(Mbps) Total : 529(Mbps)

iperf3 [ 4] 4.00-5.00 sec 61.1 MBytes 513 Mbits/sec 0 1.84 MBytes

iperf3 receive

====== mac_id : 0 [08:02:8e:9e:ba:e9] ====== BCN counts : 10 (per-1 second), DTIM Period:2 tx_rate : VHTSS2MCS9(S) rx_rate : VHTSS2MCS8, rx_rate_bmc : OFDM_6M, rssi : 57 % RTW: [TP] Tx : 1(Mbps) Rx : 327(Mbps) Total : 328(Mbps) RTW: [Smooth TP] Tx : 6(Mbps) Rx : 321(Mbps) Total : 327(Mbps)

iperf3 [ 4] 2.00-3.00 sec 46.3 MBytes 388 Mbits/sec

raplin commented 4 years ago

Side note: bluetooth on this dongle is not great when you use wifi,

When connected to AP at 2.4ghz, hcitool lescan --duplicates reports a ton more BLE devices when the adapter is idle.

..in fact BT/BLE appears to just stops working when you are connected to a 5.8ghz AP

ulli-kroll commented 4 years ago

USB3 was meant for me ;-)

currently 8822bu in pre alpha https://github.com/ulli-kroll/rtw88-usb/issues/11#issuecomment-712301992

don't ask !