rtl8192eu-linux-driver/README.md

205 lines
8.4 KiB
Markdown
Raw Normal View History

2015-11-11 19:58:31 +00:00
# rtl8192eu linux drivers
2017-07-06 05:45:27 +00:00
**NOTE:** This branch is based on Realtek's driver versioned 4.4.1. `master` is based on 4.3.1.1 originally.
2015-11-11 19:58:31 +00:00
The official drivers for D-Link DWA-131 Rev E, with patches to keep it working on newer kernels.
Also works on Rosewill RNX-N180UBE v2 N300 Wireless Adapter and TP-Link TL-WN821N V6.
2015-11-11 19:58:31 +00:00
2016-08-01 18:40:06 +00:00
**NOTE:** This is just a "mirror". I have no knowledge about this code or how it works. Expect no support from me or any contributors here. I just think GitHub is a nicer way of keeping track of this than random forum posts and precompiled binaries being sent by email. I don't want someone else to have to spend 5 days of googling and compiling with random patches until it works.
2015-11-11 19:58:31 +00:00
## Source for the official drivers
Official drivers were downloaded from D-Link Australia. D-Link USA and the european countries I checked only lists revision A and B. Australia lists all three.
* [Download page for DWA-131][driver-downloads]
* [Direct download link for Linux drivers][direct-download]
* GitHub will not link to the `ftp://` schema. Raw link contents:
`ftp://files.dlink.com.au/products/DWA-131/REV_E/Drivers/DWA-131_Linux_driver_v4.3.1.1.zip`
In addition, you can find the contents of this version in the initial commit of this repo: [1387cf623d54bc2caec533e72ee18ef3b6a1db29][initial-commit]
## Patches
You can see the applied patches, their sources and/or motivation by looking at the commits. The `master` branch will mostly be kept clean with a single commit per patch, except for Pull Requests. You can review commit by commit and then record the SHA in order to get a safe reference to use. As long as the SHA stays the same you know that what you get has been reviewed by you.
2015-11-11 19:58:31 +00:00
Note that updates to this README will show up as separate commits. I will not mix changes to this file with changes to the code in case you want to mirror this without the README.
## Building and installing using DKMS
This tree supports Dynamic Kernel Module Support (DKMS), a system for
generating kernel modules from out-of-tree kernel sources. It can be used to
install/uninstall kernel modules, and the module will be automatically rebuilt
from source when the kernel is upgraded (for example using your package manager).
1. Install DKMS and other required tools
* for normal Linux systems
```shell
2022-11-04 18:02:15 +00:00
sudo apt-get install git linux-headers-generic build-essential dkms
```
* for Raspberry Pi
```shell
2022-11-04 18:02:15 +00:00
sudo apt-get install git raspberrypi-kernel-headers build-essential dkms
```
Make sure you're installing same headers version as your current running kernel. If you just installed Raspbian it ships with an older kernel version than you'll get headers for after installing `raspberrypi-kernel-headers`. You must either run `sudo apt-get upgrade` or install exact same `raspberrypi-kernel-headers-XXX` version as your kernel is before executing `dkms install`. If you have version mismatch you'll get "Your kernel headers for kernel XXX cannot be found at YYY" error.
2018-10-21 15:34:56 +00:00
2. Clone this repository and change your directory to cloned path.
```shell
2022-11-04 18:02:15 +00:00
git clone https://github.com/Mange/rtl8192eu-linux-driver
```
```shell
2022-11-04 18:02:15 +00:00
cd rtl8192eu-linux-driver
```
3. The Makefile is preconfigured to handle most x86/PC versions. However, if you are compiling for something other than an intel x86 architecture, you need to first select the platform.
* for the Raspberry Pi, you need to set the I386 to n and the ARM_RPI to y:
```sh
...
CONFIG_PLATFORM_I386_PC = n
...
CONFIG_PLATFORM_ARM_RPI = y
```
* for arm64 devices (e.g. Orange Pi PC 2):
```sh
...
CONFIG_PLATFORM_I386_PC = n
...
CONFIG_PLATFORM_ARM_AARCH64 = y
```
2018-10-21 15:34:56 +00:00
4. Add the driver to DKMS. This will copy the source to a system directory so
that it can used to rebuild the module on kernel upgrades.
```shell
2022-11-04 18:02:15 +00:00
sudo dkms add .
2018-10-21 15:34:56 +00:00
```
5. Build and install the driver.
```shell
2022-11-04 18:02:15 +00:00
sudo dkms install rtl8192eu/1.0
2018-10-21 15:34:56 +00:00
```
6. Distributions based on Debian & Ubuntu have RTL8XXXU driver present & running in kernelspace. To use our RTL8192EU driver, we need to blacklist RTL8XXXU.
```shell
2022-11-04 18:02:15 +00:00
echo "blacklist rtl8xxxu" | sudo tee /etc/modprobe.d/rtl8xxxu.conf
2018-10-21 15:34:56 +00:00
```
7. Force RTL8192EU Driver to be active from boot.
```shell
2022-11-04 18:02:15 +00:00
echo -e "8192eu\n\nloop" | sudo tee /etc/modules
2018-10-21 15:34:56 +00:00
```
8. Newer versions of Ubuntu has weird plugging/replugging issue (Check #94). This includes weird idling issues, To fix this:
```shell
2022-11-04 18:02:15 +00:00
echo "options 8192eu rtw_power_mgnt=0 rtw_enusbss=0" | sudo tee /etc/modprobe.d/8192eu.conf
2018-10-21 15:34:56 +00:00
```
9. Update changes to Grub & initramfs
```shell
2022-11-04 18:02:15 +00:00
sudo update-grub; sudo update-initramfs -u
2018-10-21 15:34:56 +00:00
```
10. Reboot system to load new changes from newly generated initramfs.
```shell
2022-11-04 18:02:15 +00:00
systemctl reboot -i
2018-10-21 15:34:56 +00:00
```
2018-10-21 15:34:56 +00:00
11. Check that your kernel has loaded the right module:
```shell
2022-11-04 18:02:15 +00:00
sudo lshw -c network
```
You should see the line ```driver=8192eu```
If you wish to uninstall the driver at a later point, use
_sudo dkms uninstall rtl8192eu/1.0_. To completely remove the driver from DKMS use
_sudo dkms remove rtl8192eu/1.0 --all_.
Add AP info, Add Compile-Time Transmit Power Fixing & Boost Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost.
2020-06-18 19:16:13 +00:00
## Using as AP
Reference: Intelbras IWA 3001 USB WiFi Adapter
Devices using the 8192eu chip can serve as decent access points, with speeds up to ~50Mbps.
Using hostapd to manage your AP, set the proper ht-capab field for this device, which is:
`HT_CAPAB=[RX-STBC1][SHORT-GI-40][SHORT-GI-20][DSSS_CCK-40][MAX-AMSDU-7935]`
Optionally enable wideband, if you don't have neighbours:
Note that while this will result in a increase in network throughput it may cause clients further away to fail connecting.
It may also make the device work better with repeaters repeating its signal.
`HT_CAPAB=[HT40+][RX-STBC1][SHORT-GI-40][SHORT-GI-20][DSSS_CCK-40][MAX-AMSDU-7935]` (for channels 1-7), or
`HT_CAPAB=[HT40-][RX-STBC1][SHORT-GI-40][SHORT-GI-20][DSSS_CCK-40][MAX-AMSDU-7935]` (for channels 5-13)
## Changing transmit power
Currently there is no way to change transmit power in the driver with iw or iwconfig tools, as you would with other wireless devices.
The values returned by these tools are purely fictional on this driver.
However, you can still manually change the transmit power at compile time
by editing the file `hal/rl8192e/rtl8192e_phycfg.c` and changing the lines below:
```
/* Manual Transmit Power Control
The following options take values from 0 to 63, where:
0 - disable
1 - lowest transmit power the device can do
2020-06-19 18:16:02 +00:00
63 - highest transmit power the device can do
Add AP info, Add Compile-Time Transmit Power Fixing & Boost Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost.
2020-06-18 19:16:13 +00:00
Note that these options may override your country's regulations about transmit power.
Setting the device to work at higher transmit powers most of the time may cause premature
failure or damage by overheating. Make sure the device has enough airflow before you increase this.
It is currently unknown what these values translate to in dBm.
*/
// Transmit Power Boost
// This value is added to the device's calculation of transmit power index.
// Useful if you want to keep power usage low while still boosting/decreasing transmit power.
// Can take a negative value as well to reduce power.
// Zero disables it. Default: 2, for a tiny boost.
int transmit_power_boost = 2;
Add AP info, Add Compile-Time Transmit Power Fixing & Boost Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost.
2020-06-18 19:16:13 +00:00
// (ADVANCED) To know what transmit powers this device decides to use dynamically, see:
// https://github.com/lwfinger/rtl8192ee/blob/42ad92dcc71cb15a62f8c39e50debe3a28566b5f/hal/phydm/rtl8192e/halhwimg8192e_rf.c#L1310
// Transmit Power Override
// This value completely overrides the driver's calculations and uses only one value for all transmissions.
// Zero disables it. Default: 0
int transmit_power_override = 0;
Add AP info, Add Compile-Time Transmit Power Fixing & Boost Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost. Add AP and TXPOWER CONTROL info Turns out these devices can serve as really decent access points. Adding txpower control info as well. See my other PR. This is in a separate PR because the readme instructed to do so. Update README.md Move my lines more to the bottom Implement simple transmit power boost and fixed setting Source: https://github.com/lwfinger/rtl8192ee/pull/12/commits/80b9bc47b347baccdc9246936aa43b92585d560e Turns out the "higher levels" of this driver are not actually able to affect the device's physical power output, like via cfg80211, yet. After some extensive testing I finally found the code responsible for setting the device's power and added some compile-time tunables to influence it. For example here we give the transmit power index a tiny boost of two, which can be changed by the user via the source. This is as far as my skills go so if you want to try and make this accessible to iw and iwconfig please give it a go. Note that this will take an index between 1 (min power the device can put out) and 63 (max power the device can put out). I have no idea what these values actually translate to in dBm, but setting the override to max, 63, on my rtl card really gave range a boost.
2020-06-18 19:16:13 +00:00
/* Manual Transmit Power Control */
```
2015-11-11 19:58:31 +00:00
## Submitting patches
1. Fork repo
2. Do your patch in a topic branch
3. Open a pull request on GH, or send it by email to `Magnus Bergmark <magnus.bergmark@gmail.com>`.
4. I'll squash your commits when everything checks out and add it to `master`.
## Copyright and licenses
The original code is copyrighted, but I don't know by whom. The driver download does not contain license information; please open an issue if you are the copyright holder.
Most C files are licensed under GNU General Public License (GPL), version 2.
[driver-downloads]: http://support.dlink.com.au/Download/download.aspx?product=DWA-131
[direct-download]: ftp://files.dlink.com.au/products/DWA-131/REV_E/Drivers/DWA-131_Linux_driver_v4.3.1.1.zip
[initial-commit]: https://github.com/Mange/rtl8192eu-linux-driver/commit/1387cf623d54bc2caec533e72ee18ef3b6a1db29