Merge remote-tracking branch 'origin/main'

This commit is contained in:
jlkDE 2023-01-12 11:17:07 +01:00
commit 4fe09c965b
21 changed files with 442 additions and 712 deletions

View File

@ -13,6 +13,10 @@ options 88x2bu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_switch_us
#
# Note: To activate USB3 mode, change rtw_switch_usb_mode above to rtw_switch_usb_mode=1
#
# Note: The above `options` line is a good default for managed mode. Below is
# an example for AP mode. Modify as required after reading the documentation:
#options 88x2bu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=2 rtw_power_mgnt=1 rtw_dfs_region_domain=1
#
# After editing is complete, save this file (if using nano: Ctrl + x, y, Enter)
# and reboot to activate the changes.
#
@ -22,8 +26,8 @@ options 88x2bu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_switch_us
#
# Log options ( rtw_drv_log_level )
#
# 0 = NONE (default)
# 1 = ALWAYS
# 0 = NONE
# 1 = ALWAYS (default)
# 2 = ERROR
# 3 = WARNING
# 4 = INFO
@ -68,6 +72,14 @@ options 88x2bu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_switch_us
#
# -----
#
# USB options: ( rtw_switch_usb_mode )
#
# 0 = No switch (default)
# 1 = Switch from usb 2.0 to usb 3.0
# 2 = Switch from usb 3.0 to usb 2.0
#
# -----
#
# DFS Options ( rtw_dfs_region_domain )
#
# 0 = NONE (default)
@ -86,13 +98,6 @@ options 88x2bu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_switch_us
#
# -----
#
# Select P2P interface in concurrent mode ( rtw_sel_p2p_iface )
#
# 0 = Sets interface 0 to be p2p interface
# 1 = Sets interface 1 to be p2p interface (default)
#
# -----
#
# Wireless Mode options ( rtw_wireless_mode )
#
# 1 = 2.4GHz 802.11b
@ -109,18 +114,18 @@ options 88x2bu rtw_drv_log_level=1 rtw_led_ctrl=1 rtw_vht_enable=1 rtw_switch_us
#
# -----
#
# USB options ( rtw_switch_usb_mode )
# Country Code options ( rtw_country_code )
#
# 0 = No switch (default)
# 1 = Switch from usb 2.0 to usb 3.0
# 2 = Switch from usb 3.0 to usb 2.0
# Note: Allows the Country Code to be set in cases where it is unable to
# be obtained otherwise.
#
# Note: This driver may need to stay in USB2 mode for AP mode operations
# on some platforms in order to avoid dropping offline. This issue has been
# observed on the Raspberry Pi 4B with both the 32 and 64 bit versions of the
# Raspberry Pi OS. This problem appears to be specific to the Raspberry Pi 4B
# and adapters based on the rtl8812bu chipset.
# URL: http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
#
# Example for the US: rtw_country_code=US
# Example for Panama: rtw_country_code=PA
# Example for Norway: rtw_country_code=NO
# Example for Kuwait: rtw_country_code=KW
# Example for Taiwan: rtw_country_code=TW
#
# -----
#

View File

@ -124,7 +124,7 @@ endif
CONFIG_RTW_DEBUG = y
# default log level is _DRV_INFO_ = 4,
# please refer to "How_to_set_driver_debug_log_level.doc" to set the available level.
CONFIG_RTW_LOG_LEVEL = 0
CONFIG_RTW_LOG_LEVEL = 1
# enable /proc/net/rtlxxxx/ debug interfaces
CONFIG_PROC_DEBUG = y

View File

@ -11,18 +11,18 @@ confirm that this is the correct driver for your adapter.
- 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 (see FAQ)
- WPA3-SAE (Personal) (see FAQ)
- IEEE 802.11b/g/n/ac Client mode
* Supports wireless security for WEP, WPA TKIP and WPA2 AES PSK
* Supports site survey scan and manual connect
* Supports WPA/WPA2 TLS client
- Power saving modes
- Miracast
- Wireshark compatible
- Aircrack-ng compatible
- Packet injection
- hostapd compatible
- AP mode DFS channel support
- Miracast
- Supported interface modes
* Managed
* Monitor (see FAQ)
@ -38,6 +38,8 @@ confirm that this is the correct driver for your adapter.
### A FAQ is available at the end of this document.
### Additional documentation is in the file `88x2bu.conf`.
### Compatible CPU Architectures
- x86, i686
@ -81,7 +83,7 @@ be provided via PR or message in Issues.
- SkiffOS for Odroid XU4 (ARM 32 bit) (kernel 6.0.7)
- Ubuntu 22.04 (kernel 5.15) and 22.10 (kernel 5.19) (kernel 6.2 rc1)
- Ubuntu 22.04 (kernel 5.15) and 22.10 (kernel 5.19) (kernel 6.2)
- Void Linux (kernel 5.18)
@ -141,9 +143,15 @@ item 2 which will show information about and links to recommended adapters.
### Installation Information
Warning: Installing multiple drivers for the same hardware usually does
not end well. If a previous attempt to install this driver failed or if
you have previously installed another driver for chipsets supported by
Note: As of Linux kernel 6.2, an in-kernel driver for the chipsets supported by
this driver has been included in the Linux kernel. The installation and removal
scripts for the driver in this repo automatically deactivate the in-kernel
driver on installation and reactivate the in-kernel driver on removal. No
special action needs to be taken by users.
Warning: Installing multiple out-of-kernel drivers for the same hardware
usually does not end well. If a previous attempt to install this driver failed
or if you have previously installed another driver for chipsets supported by
this driver, you MUST remove anything that the previous attempt
installed BEFORE attempting to install this driver. This driver can be
removed with the script called `./remove-driver.sh`. Information is
@ -169,7 +177,7 @@ $ sudo ./install-driver.sh
Temporary internet access is required for installation. There are numerous ways
to enable temporary internet access depending on your hardware and situation.
[One method is to use tethering from a phone.](https://www.makeuseof.com/tag/how-to-tether-your-smartphone-in-linux).
Another method is to keep a [WiFi adapter that uses an in-kernel driver](https://github.com/morrownr/USB-WiFi) in your toolkit.
Another method is to keep a [WiFi adapter that uses an in-kernel driver](https://github.com/morrownr/USB-WiFi/blob/main/home/USB_WiFi_Adapters_that_are_supported_with_Linux_in-kernel_drivers.md) in your toolkit.
You will need to use the terminal interface. The quick way to open a terminal:
Ctrl+Alt+T (hold down on the Ctrl and Alt keys then press the T key).
@ -184,7 +192,7 @@ can be executed as the `root` user. (If the command `sudo echo Yes` returns
"Yes", with or without having to enter your password, you do have sufficient
access rights.)
DKMS is used for the installation if available. DKMS is a system utility
DKMS is used for the installation, if available. DKMS is a system utility
which will automatically recompile and reinstall this driver when a new
kernel is installed. DKMS is provided by and maintained by Dell.
@ -212,24 +220,6 @@ install this driver and, after a reboot, the driver is not working, you
can go into the BIOS and temporarily turn secure boot off to see if
secure boot is the problem.
Please ensure the ISO 3166-1 alpha-2 Country Code is set in your Linux distro.
If it is not set, you will likely have problems accessing some channels, especially
5 Ghz and 6 GHz channels. To set your Country Code:
```
sudo iw reg set US
```
If you are not in the US, please use the country code for your country. See:
ISO 3166-1 alpha-2 codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
To check if your country code is properly set:
```
iw reg get
```
### Installation Steps
Note: The installation instructions are for the novice user. Experienced users are
@ -238,7 +228,7 @@ on a best effort basis, based on the steps below.
#### Step 1: Open a terminal (e.g. Ctrl+Alt+T)
#### Step 2: Update and upgrade system packages (select the option for the OS you are using)
#### Step 2: Update and upgrade system packages (select the option for the distro you are using)
Note: If your Linux distro does not fall into one of options listed
below, you will need to research how to update and upgrade your system
@ -574,17 +564,16 @@ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf
Question: Is WPA3 supported?
Answer: WPA3-SAE support is in this driver according to Realtek and it
works well on some Linux distros but not all. Generally the reason for
WPA3 not working on Linux distros is that the distro has an old version
of wpa_supplicant or Network Manager. Your options are to upgrade to a
more modern distro (most distros released after mid 2022) or compile and
install new versions of the wpa_supplicant and Network Manager utilities.
Answer: WPA3-SAE is supported. It works well on most modern Linux distros but
not all. Generally the reason for WPA3 not working on Linux distros is that the
distro has an old version of wpa_supplicant or Network Manager. Your options
are to upgrade to a more modern distro (distros released after mid 2022) or
compile and install new versions of wpa_supplicant and/or Network Manager.
-----
Question: I bought two rtl8812bu based adapters and am planning to use
both in the same computer. How do I set that up?
Question: I bought two usb wifi adapters based on this chipset and am planning
to use both in the same computer. How do I set that up?
Answer: Realtek drivers do not support more than one adapter with the
same chipset in the same computer. You can have multiple Realtek based

View File

@ -1,603 +0,0 @@
2022-12-26
Instructions for setting the ISO 3166-1 alpha-2 Country Code in your Linux
distro. If it is not set, you may have problems using some channels, especially
5 Ghz and 6 GHz channels. To set your Country Code from the command line
interface:
Note: Package "iw" must be installed.
```
sudo iw reg set XX
```
Where XX is the country code for your country. See the list of country codes
below.
To check if your country code is properly set:
```
iw reg get
```
```
ISO 3166-1 alpha-2 Country Codes
Code Name
AF Afghanistan
AX Aland Islands
AL Albania
DZ Algeria
AS American Samoa
AD Andorra
AO Angola
AI Anguilla
AQ Antarctica
AG Antigua and Barbuda
Argentina AR
Armenia AM
Aruba AW
Australia AU
Austria AT
Azerbaijan AZ
Bahamas BS
Bahrain BH
Bangladesh BD
Barbados BB
Belarus BY
Belgium BE
Belize BZ
Benin BJ
Bermuda BM
Bhutan BT
Bolivia BO
Bonaire, Sint
Eustatius and
Saba BQ
Bosnia and
Herzegovina BA
Botswana BW
Bouvet
Island BV
Brazil BR
British Indian
Ocean
Territory IO
Brunei
Darussalam BN
Bulgaria BG
Burkina
Faso BF
Burundi BI
Cambodia KH
Cameroon CM
Canada CA
Cape Verde CV
Cayman
Islands KY
Central
African
Republic CF
Chad TD
Chile CL
China CN
Christmas
Island CX
Cocos
(Keeling)
Islands CC
Colombia CO
Comoros KM
Congo CG
Congo CD
Cook
Islands CK
Costa Rica CR
Côte
d'Ivoire CI
Croatia HR
Cuba CU
Curaçao CW
Cyprus CY
Czech
Republic CZ
Denmark DK
Djibouti DJ
Dominica DM
Dominican
Republic DO
Ecuador EC
Egypt EG
El Salvador SV
Equatorial
Guinea GQ
Eritrea ER
Estonia EE
Ethiopia ET
Falkland
Islands
(Malvinas) FK
Faroe
Islands FO
Fiji FJ
Finland FI
France FR
French
Guiana GF
French
Polynesia PF
French
Southern
Territories TF
Gabon GA
Gambia GM
Georgia GE
Germany DE
Ghana GH
Gibraltar GI
Greece GR
Greenland GL
Grenada GD
Guadeloupe GP
Guam GU
Guatemala GT
Guernsey GG
Guinea GN
Guinea-
Bissau GW
Guyana GY
Haiti HT
Heard Island
and
McDonald
Islands HM
Holy See
(Vatican City
State) VA
Honduras HN
Hong Kong HK
Hungary HU
Iceland IS
India IN
Indonesia ID
Iran, Islamic
Republic of IR
Iraq IQ
Ireland IE
Isle of Man IM
Israel IL
Italy IT
Jamaica JM
Japan JP
Jersey JE
Jordan JO
Kazakhstan KZ
Kenya KE
Kiribati KI
Korea,
Democratic
People's
Republic of KP
Korea,
Republic of KR
Kuwait KW
Kyrgyzstan KG
Lao People's
Democratic
Republic LA
Latvia LV
Lebanon LB
Lesotho LS
Liberia LR
Libya LY
LI Liechtenstein
Lithuania LT
Luxembourg LU
Macao MO
Macedonia,
the Former
Yugoslav
Republic of MK
Madagascar MG
Malawi MW
Malaysia MY
Maldives MV
Mali ML
Malta MT
Marshall
Islands MH
Martinique MQ
Mauritania MR
Mauritius MU
Mayotte YT
Mexico MX
Micronesia,
Federated
States of FM
Moldova,
Republic of MD
Monaco MC
Mongolia MN
Montenegro ME
Montserrat MS
Morocco MA
Mozambique MZ
Myanmar MM
Namibia NA
Nauru NR
Nepal NP
Netherlands NL
New
Caledonia NC
New Zealand NZ
Nicaragua NI
Niger NE
Nigeria NG
Niue NU
NF Norfolk Island
Northern
Mariana
Islands MP
Norway NO
><
Oman OM
Pakistan PK
Palau PW
Palestine PS
Panama PA
Papua New
Guinea PG
Paraguay PY
Peru PE
Philippines PH
Pitcairn PN
Poland PL
Portugal PT
Puerto Rico PR
Qatar QA
Réunion RE
Romania RO
Russia RU
Rwanda RW
Saint
Barthélemy BL
Saint Helena,
Ascension
and Tristan
da Cunha SH
Saint Kitts
and Nevis KN
Saint Lucia LC
MF Saint Martin (French part)
PM Saint Pierre and Miquelon
Saint Vincent
and the
Grenadines VC
Samoa WS
San Marino SM
ST Sao Tome and Principe
SA Saudi Arabia
Senegal SN
Serbia RS
Seychelles SC
SL Sierra Leone
Singapore SG
SX Sint Maarten (Dutch part)
Slovakia SK
Slovenia SI
Solomon
Islands SB
Somalia SO
ZA South Africa
South
Georgia and
the South
Sandwich
Islands GS
South Sudan SS
Spain ES
Sri Lanka LK
Sudan SD
Suriname SR
Svalbard and
Jan Mayen SJ
Swaziland SZ
Sweden SE
Switzerland CH
Syrian Arab
Republic SY
Taiwan TW
Tajikistan TJ
Tanzania,
United
Republic of TZ
Thailand TH
Timor-Leste TL
Togo TG
Tokelau TK
Tonga TO
Trinidad and
Tobago TT
Tunisia TN
Turkey TR
TM Turkmenistan
Turks and
Caicos
Islands TC
Tuvalu TV
Uganda UG
Ukraine UA
United Arab
Emirates AE
GB United Kingdom
US United States
United States
Minor
Outlying
Islands UM
Uruguay UY
Uzbekistan UZ
Vanuatu VU
Venezuela VE
Viet Nam VN
Virgin Islands,
British VG
Virgin Islands,
U.S. VI
WF Wallis and Futuna
EH Western Sahara
YE Yemen
ZM Zambia
ZW Zimbabwe
```

View File

@ -402,8 +402,10 @@ sint rtw_fill_radiotap_hdr(_adapter *padapter, struct rx_pkt_attrib *a, u8 *buf)
}
if (a->ampdu_eof) {
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
tmp_16bit |= cpu_to_le16(IEEE80211_RADIOTAP_AMPDU_EOF_KNOWN);
tmp_16bit |= cpu_to_le16(IEEE80211_RADIOTAP_AMPDU_EOF);
#endif
}
_rtw_memcpy(&hdr_buf[rt_len], &tmp_16bit, 2);

View File

@ -17,6 +17,10 @@
#ifdef __KERNEL__
#include <linux/if_arp.h>
#include <net/ip.h>
#include <linux/version.h>
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
#include <net/ipx.h>
#endif
#include <linux/atalk.h>
#include <linux/udp.h>
#include <linux/if_pppox.h>
@ -168,7 +172,42 @@ static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,
}
static void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
static __inline__ void __nat25_generate_ipx_network_addr_with_node(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned char *ipxNodeAddr)
{
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
networkAddr[0] = NAT25_IPX;
memcpy(networkAddr + 1, (unsigned char *)ipxNetAddr, 4);
memcpy(networkAddr + 5, ipxNodeAddr, 6);
}
static __inline__ void __nat25_generate_ipx_network_addr_with_socket(unsigned char *networkAddr,
unsigned int *ipxNetAddr, unsigned short *ipxSocketAddr)
{
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
networkAddr[0] = NAT25_IPX;
memcpy(networkAddr + 1, (unsigned char *)ipxNetAddr, 4);
memcpy(networkAddr + 5, (unsigned char *)ipxSocketAddr, 2);
}
static __inline__ void __nat25_generate_apple_network_addr(unsigned char *networkAddr,
unsigned short *network, unsigned char *node)
{
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
networkAddr[0] = NAT25_APPLE;
memcpy(networkAddr + 1, (unsigned char *)network, 2);
networkAddr[3] = *node;
}
#endif
static __inline__ void __nat25_generate_pppoe_network_addr(unsigned char *networkAddr,
unsigned char *ac_mac, unsigned short *sid)
{
memset(networkAddr, 0, MAX_NETWORK_ADDR_LEN);
@ -296,6 +335,7 @@ static int __nat25_network_hash(unsigned char *networkAddr)
x = networkAddr[7] ^ networkAddr[8] ^ networkAddr[9] ^ networkAddr[10];
return x & (NAT25_HASH_SIZE - 1);
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
} else if (networkAddr[0] == NAT25_IPX) {
unsigned long x;
@ -309,6 +349,7 @@ static int __nat25_network_hash(unsigned char *networkAddr)
x = networkAddr[1] ^ networkAddr[2] ^ networkAddr[3];
return x & (NAT25_HASH_SIZE - 1);
#endif
} else if (networkAddr[0] == NAT25_PPPOE) {
unsigned long x;
@ -855,6 +896,229 @@ int nat25_db_handle(_adapter *priv, struct sk_buff *skb, int method)
}
}
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0))
/*---------------------------------------------------*/
/* Handle IPX and Apple Talk frame */
/*---------------------------------------------------*/
else if ((protocol == __constant_htons(ETH_P_IPX)) ||
(protocol == __constant_htons(ETH_P_ATALK)) ||
(protocol == __constant_htons(ETH_P_AARP))) {
unsigned char ipx_header[2] = {0xFF, 0xFF};
struct ipxhdr *ipx = NULL;
struct elapaarp *ea = NULL;
struct ddpehdr *ddp = NULL;
unsigned char *framePtr = skb->data + ETH_HLEN;
if (protocol == __constant_htons(ETH_P_IPX)) {
RTW_INFO("NAT25: Protocol=IPX (Ethernet II)\n");
ipx = (struct ipxhdr *)framePtr;
} else { /* if(protocol <= __constant_htons(ETH_FRAME_LEN)) */
if (!memcmp(ipx_header, framePtr, 2)) {
RTW_INFO("NAT25: Protocol=IPX (Ethernet 802.3)\n");
ipx = (struct ipxhdr *)framePtr;
} else {
unsigned char ipx_8022_type = 0xE0;
unsigned char snap_8022_type = 0xAA;
if (*framePtr == snap_8022_type) {
unsigned char ipx_snap_id[5] = {0x0, 0x0, 0x0, 0x81, 0x37}; /* IPX SNAP ID */
unsigned char aarp_snap_id[5] = {0x00, 0x00, 0x00, 0x80, 0xF3}; /* Apple Talk AARP SNAP ID */
unsigned char ddp_snap_id[5] = {0x08, 0x00, 0x07, 0x80, 0x9B}; /* Apple Talk DDP SNAP ID */
framePtr += 3; /* eliminate the 802.2 header */
if (!memcmp(ipx_snap_id, framePtr, 5)) {
framePtr += 5; /* eliminate the SNAP header */
RTW_INFO("NAT25: Protocol=IPX (Ethernet SNAP)\n");
ipx = (struct ipxhdr *)framePtr;
} else if (!memcmp(aarp_snap_id, framePtr, 5)) {
framePtr += 5; /* eliminate the SNAP header */
ea = (struct elapaarp *)framePtr;
} else if (!memcmp(ddp_snap_id, framePtr, 5)) {
framePtr += 5; /* eliminate the SNAP header */
ddp = (struct ddpehdr *)framePtr;
} else {
DEBUG_WARN("NAT25: Protocol=Ethernet SNAP %02x%02x%02x%02x%02x\n", framePtr[0],
framePtr[1], framePtr[2], framePtr[3], framePtr[4]);
return -1;
}
} else if (*framePtr == ipx_8022_type) {
framePtr += 3; /* eliminate the 802.2 header */
if (!memcmp(ipx_header, framePtr, 2)) {
RTW_INFO("NAT25: Protocol=IPX (Ethernet 802.2)\n");
ipx = (struct ipxhdr *)framePtr;
} else
return -1;
}
}
}
/* IPX */
if (ipx != NULL) {
switch (method) {
case NAT25_CHECK:
if (!memcmp(skb->data + ETH_ALEN, ipx->ipx_source.node, ETH_ALEN)) {
RTW_INFO("NAT25: Check IPX skb_copy\n");
return 0;
}
return -1;
case NAT25_INSERT: {
RTW_INFO("NAT25: Insert IPX, Dest=%08x,%02x%02x%02x%02x%02x%02x,%04x Source=%08x,%02x%02x%02x%02x%02x%02x,%04x\n",
ipx->ipx_dest.net,
ipx->ipx_dest.node[0],
ipx->ipx_dest.node[1],
ipx->ipx_dest.node[2],
ipx->ipx_dest.node[3],
ipx->ipx_dest.node[4],
ipx->ipx_dest.node[5],
ipx->ipx_dest.sock,
ipx->ipx_source.net,
ipx->ipx_source.node[0],
ipx->ipx_source.node[1],
ipx->ipx_source.node[2],
ipx->ipx_source.node[3],
ipx->ipx_source.node[4],
ipx->ipx_source.node[5],
ipx->ipx_source.sock);
if (!memcmp(skb->data + ETH_ALEN, ipx->ipx_source.node, ETH_ALEN)) {
RTW_INFO("NAT25: Use IPX Net, and Socket as network addr\n");
__nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_source.net, &ipx->ipx_source.sock);
/* change IPX source node addr to wlan STA address */
memcpy(ipx->ipx_source.node, GET_MY_HWADDR(priv), ETH_ALEN);
} else
__nat25_generate_ipx_network_addr_with_node(networkAddr, &ipx->ipx_source.net, ipx->ipx_source.node);
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
__nat25_db_print(priv);
}
return 0;
case NAT25_LOOKUP: {
if (!memcmp(GET_MY_HWADDR(priv), ipx->ipx_dest.node, ETH_ALEN)) {
RTW_INFO("NAT25: Lookup IPX, Modify Destination IPX Node addr\n");
__nat25_generate_ipx_network_addr_with_socket(networkAddr, &ipx->ipx_dest.net, &ipx->ipx_dest.sock);
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
/* replace IPX destination node addr with Lookup destination MAC addr */
memcpy(ipx->ipx_dest.node, skb->data, ETH_ALEN);
} else {
__nat25_generate_ipx_network_addr_with_node(networkAddr, &ipx->ipx_dest.net, ipx->ipx_dest.node);
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
}
}
return 0;
default:
return -1;
}
}
/* AARP */
else if (ea != NULL) {
/* Sanity check fields. */
if (ea->hw_len != ETH_ALEN || ea->pa_len != AARP_PA_ALEN) {
DEBUG_WARN("NAT25: Appletalk AARP Sanity check fail!\n");
return -1;
}
switch (method) {
case NAT25_CHECK:
return 0;
case NAT25_INSERT: {
/* change to AARP source mac address to wlan STA address */
memcpy(ea->hw_src, GET_MY_HWADDR(priv), ETH_ALEN);
RTW_INFO("NAT25: Insert AARP, Source=%d,%d Destination=%d,%d\n",
ea->pa_src_net,
ea->pa_src_node,
ea->pa_dst_net,
ea->pa_dst_node);
__nat25_generate_apple_network_addr(networkAddr, &ea->pa_src_net, &ea->pa_src_node);
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
__nat25_db_print(priv);
}
return 0;
case NAT25_LOOKUP: {
RTW_INFO("NAT25: Lookup AARP, Source=%d,%d Destination=%d,%d\n",
ea->pa_src_net,
ea->pa_src_node,
ea->pa_dst_net,
ea->pa_dst_node);
__nat25_generate_apple_network_addr(networkAddr, &ea->pa_dst_net, &ea->pa_dst_node);
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
/* change to AARP destination mac address to Lookup result */
memcpy(ea->hw_dst, skb->data, ETH_ALEN);
}
return 0;
default:
return -1;
}
}
/* DDP */
else if (ddp != NULL) {
switch (method) {
case NAT25_CHECK:
return -1;
case NAT25_INSERT: {
RTW_INFO("NAT25: Insert DDP, Source=%d,%d Destination=%d,%d\n",
ddp->deh_snet,
ddp->deh_snode,
ddp->deh_dnet,
ddp->deh_dnode);
__nat25_generate_apple_network_addr(networkAddr, &ddp->deh_snet, &ddp->deh_snode);
__nat25_db_network_insert(priv, skb->data + ETH_ALEN, networkAddr);
__nat25_db_print(priv);
}
return 0;
case NAT25_LOOKUP: {
RTW_INFO("NAT25: Lookup DDP, Source=%d,%d Destination=%d,%d\n",
ddp->deh_snet,
ddp->deh_snode,
ddp->deh_dnet,
ddp->deh_dnode);
__nat25_generate_apple_network_addr(networkAddr, &ddp->deh_dnet, &ddp->deh_dnode);
__nat25_db_network_lookup_and_replace(priv, skb, networkAddr);
}
return 0;
default:
return -1;
}
}
return -1;
}
#endif
/*---------------------------------------------------*/
/* Handle PPPoE frame */
/*---------------------------------------------------*/

View File

@ -16321,6 +16321,12 @@ u8 rtw_set_chbw_hdl(_adapter *padapter, u8 *pbuf)
LeaveAllPowerSaveModeDirect(padapter);
#ifdef CONFIG_MONITOR_MODE_XMIT
pmlmeext->cur_channel = set_ch_parm->ch;
pmlmeext->cur_ch_offset = set_ch_parm->ch_offset;
pmlmeext->cur_bwmode = set_ch_parm->bw;
#endif /* CONFIG_MONITOR_MODE_XMIT */
set_channel_bwmode(padapter, set_ch_parm->ch, set_ch_parm->ch_offset, set_ch_parm->bw);
rtw_mi_get_ch_setting_union(padapter, &u_ch, &u_bw, &u_offset);

View File

@ -4068,9 +4068,8 @@ int recv_frame_monitor(_adapter *padapter, union recv_frame *rframe)
/* read skb information from recv frame */
pskb = rframe->u.hdr.pkt;
pskb->head = rframe->u.hdr.rx_head;
pskb->data = rframe->u.hdr.rx_data;
pskb->len = rframe->u.hdr.len;
pskb->data = rframe->u.hdr.rx_data;
skb_set_tail_pointer(pskb, rframe->u.hdr.len);
if (ndev->type == ARPHRD_IEEE80211_RADIOTAP) {

View File

@ -4899,10 +4899,12 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev)
if (unlikely(skb->len < rtap_len))
goto fail;
#ifndef CONFIG_MONITOR_MODE_XMIT
if (rtap_len != 12) {
RTW_INFO("radiotap len (should be 14): %d\n", rtap_len);
goto fail;
}
#endif /* CONFIG_MONITOR_MODE_XMIT */
_rtw_pktfile_read(&pktfile, dummybuf, rtap_len-sizeof(struct ieee80211_radiotap_header));
len = len - rtap_len;
#endif

View File

@ -26,7 +26,11 @@ int usb_init_recv_priv(_adapter *padapter, u16 ini_in_buf_sz)
#ifdef PLATFORM_LINUX
tasklet_init(&precvpriv->recv_tasklet,
(void(*))usb_recv_tasklet,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
(void(*)(unsigned long))usb_recv_tasklet,
#else
(void *)usb_recv_tasklet,
#endif
(unsigned long)padapter);
#endif /* PLATFORM_LINUX */

View File

@ -1745,6 +1745,22 @@ void BlinkHandler(PLED_USB pLed)
return;
}
#ifdef CONFIG_SW_LED
// 1 is normal blinking
if (padapter->registrypriv.led_ctrl != 1) {
if (padapter->registrypriv.led_ctrl == 0)
{
// Set LED to off
pLed->BlinkingLedState = RTW_LED_OFF;
} else {
// Set LED to solid for 2 or greater
pLed->BlinkingLedState = RTW_LED_ON;
}
// Skip various switch cases where SwLedBlink*() is called below
pLed->CurrLedState = LED_UNKNOWN;
}
#endif
switch (ledpriv->LedStrategy) {
#if CONFIG_RTW_SW_LED_TRX_DA_CLASSIFY
case SW_LED_MODE_UC_TRX_ONLY:

View File

@ -89,7 +89,7 @@
#define PHYDM_SNPRINTF snprintf
#elif (DM_ODM_SUPPORT_TYPE == ODM_CE)
#undef pr_debug
#define pr_debug _RTW_DBG
#define pr_debug printk
#define RT_PRINTK(fmt, args...) pr_debug(fmt, ## args)
#define RT_DISP(dbgtype, dbgflag, printstr)
#define RT_TRACE(adapter, comp, drv_level, fmt, args...) \

View File

@ -57,19 +57,11 @@ static void swledon(PADAPTER padapter, PLED_USB led)
case LED_PIN_LED1:
case LED_PIN_LED2:
default:
if (padapter->registrypriv.led_ctrl == 0) {
rtw_halmac_led_switch(adapter_to_dvobj(padapter), 0);
} else {
rtw_halmac_led_switch(adapter_to_dvobj(padapter), 1);
}
rtw_halmac_led_switch(adapter_to_dvobj(padapter), 1);
break;
}
if (padapter->registrypriv.led_ctrl == 0) {
led->bLedOn = _FALSE;
} else {
led->bLedOn = _TRUE;
}
led->bLedOn = _TRUE;
}
@ -91,19 +83,11 @@ static void swledoff(PADAPTER padapter, PLED_USB led)
case LED_PIN_LED1:
case LED_PIN_LED2:
default:
if (padapter->registrypriv.led_ctrl <= 1) {
rtw_halmac_led_switch(adapter_to_dvobj(padapter), 0);
} else {
rtw_halmac_led_switch(adapter_to_dvobj(padapter), 1);
}
rtw_halmac_led_switch(adapter_to_dvobj(padapter), 0);
break;
}
if (padapter->registrypriv.led_ctrl <= 1) {
led->bLedOn = _FALSE;
} else {
led->bLedOn = _TRUE;
}
led->bLedOn = _FALSE;
}
/*

View File

@ -878,7 +878,11 @@ s32 rtl8822bu_init_xmit_priv(PADAPTER padapter)
#ifdef PLATFORM_LINUX
tasklet_init(&pxmitpriv->xmit_tasklet,
(void(*))rtl8822bu_xmit_tasklet,
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 17, 0))
(void(*)(unsigned long))rtl8822bu_xmit_tasklet,
#else
(void *)rtl8822bu_xmit_tasklet,
#endif
(unsigned long)padapter);
#endif
#ifdef CONFIG_TX_EARLY_MODE

View File

@ -178,7 +178,7 @@
#define CONFIG_RTW_LED
#ifdef CONFIG_RTW_LED
#define CONFIG_RTW_SW_LED
// #define CONFIG_RTW_SW_LED
#ifdef CONFIG_RTW_SW_LED
/* #define CONFIG_RTW_LED_HANDLED_BY_CMD_THREAD */
#endif

View File

@ -242,7 +242,7 @@ struct registry_priv {
#ifdef CONFIG_TX_EARLY_MODE
u8 early_mode;
#endif
#ifdef CONFIG_RTW_SW_LED
#ifdef CONFIG_SW_LED
u8 led_ctrl;
#endif
#ifdef CONFIG_NARROWBAND_SUPPORTING

View File

@ -4,7 +4,7 @@
#
# Supports dkms and non-dkms installations.
# Copyright(c) 2022 Nick Morrow
# Copyright(c) 2023 Nick Morrow
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
@ -16,7 +16,7 @@
# GNU General Public License for more details.
SCRIPT_NAME="install-driver.sh"
SCRIPT_VERSION="20221228"
SCRIPT_VERSION="20230109"
MODULE_NAME="88x2bu"
DRV_VERSION="5.13.1"
@ -115,7 +115,46 @@ do
done
# displays script name and version
echo "Script: ${SCRIPT_NAME} version ${SCRIPT_VERSION}"
echo ": ${SCRIPT_NAME} v${SCRIPT_VERSION}"
# information that helps with bug reports
# display architecture
echo ": ${KARCH}"
# display total memory in system
#grep MemTotal /proc/meminfo
# display kernel version
echo ": ${KVER}"
# display gcc version
gcc_ver=$(gcc --version | grep -i gcc)
echo ": "${gcc_ver}
# display dkms version if installed
if command -v dkms >/dev/null 2>&1
then
dkms_ver=$(dkms --version)
echo ": "${dkms_ver}
fi
# display secure mode status if mokutil is installed
if command -v mokutil >/dev/null 2>&1
then
sb_state=$(mokutil --sb-state)
echo ": "${sb_state}
fi
# display ISO 3166-1 alpha-2 Country Code
#a2_country_code=$(iw reg get | grep -i country)
#echo "Country: "${a2_country_code}
#if [[ $a2_country_code == *"00"* ]];
#then
# echo "The Country Code may not be properly set."
# echo "File alpha-2_Country_Codes is located in the driver directory."
# echo "Please read and follow the directions in the file after installation."
#fi
# check for and remove non-dkms installations
# standard naming
@ -124,6 +163,11 @@ then
echo "Removing a non-dkms installation: ${MODDESTDIR}${MODULE_NAME}.ko"
rm -f "${MODDESTDIR}${MODULE_NAME}".ko
/sbin/depmod -a "${KVER}"
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1
fi
# check for and remove non-dkms installations
@ -133,6 +177,11 @@ then
echo "Removing a non-dkms installation: ${MODDESTDIR}rtl${MODULE_NAME}.ko"
rm -f "${MODDESTDIR}rtl${MODULE_NAME}".ko
/sbin/depmod -a "${KVER}"
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1
fi
# check for and remove non-dkms installations
@ -144,17 +193,24 @@ then
echo "Removing a non-dkms installation: /usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}.ko.xz"
rm -f "/usr/lib/modules/${KVER}/kernel/drivers/net/wireless/${DRV_NAME}/${MODULE_NAME}".ko.xz
/sbin/depmod -a "${KVER}"
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
make clean >/dev/null 2>&1
fi
# check for existing dkms installations of any version of this driver
# check for and remove dkms installations
if command -v dkms >/dev/null 2>&1
then
if dkms status | grep -i ${DRV_NAME}; then
echo "The above driver needs to be removed before the installation can be successfull."
echo "Example: $ sudo dkms remove ${DRV_NAME}/X.X.X.X --all"
echo "Please replace X.X.X.X by the driver version number shown above."
echo "Once the driver is removed, please run \"sudo ./${SCRIPT_NAME}\""
exit 1
if dkms status | grep -i ${DRV_NAME}
then
echo "Removing a dkms installation: ${DRV_NAME}"
dkms remove -m ${DRV_NAME} -v ${DRV_VERSION} --all
echo "Removing ${OPTIONS_FILE} from /etc/modprobe.d"
rm -f /etc/modprobe.d/${OPTIONS_FILE}
echo "Removing source files from /usr/src/${DRV_NAME}-${DRV_VERSION}"
rm -rf /usr/src/${DRV_NAME}-${DRV_VERSION}
fi
fi

View File

@ -5108,9 +5108,11 @@ void rtw_cfg80211_indicate_sta_assoc(_adapter *padapter, u8 *pmgmt_frame, uint f
ie_offset = _REASOCREQ_IE_OFFSET_;
memset(&sinfo, 0, sizeof(sinfo));
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 2, 0))
sinfo.filled = STATION_INFO_ASSOC_REQ_IES;
sinfo.assoc_req_ies = pmgmt_frame + WLAN_HDR_A3_LEN + ie_offset;
sinfo.assoc_req_ies_len = frame_len - WLAN_HDR_A3_LEN - ie_offset;
#endif
cfg80211_new_sta(ndev, get_addr2_ptr(pmgmt_frame), &sinfo, GFP_ATOMIC);
}
#else /* defined(RTW_USE_CFG80211_STA_EVENT) */
@ -6208,11 +6210,15 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy
#endif
, struct ieee80211_channel *chan, enum nl80211_channel_type channel_type)
{
#ifdef CONFIG_WIFI_MONITOR
_adapter *padapter = wiphy_to_adapter(wiphy);
#else /* CONFIG_WIFI_MONITOR */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
_adapter *padapter = (_adapter *)rtw_netdev_priv(ndev);
#else
_adapter *padapter = wiphy_to_adapter(wiphy);
#endif
#endif /* CONFIG_WIFI_MONITOR */
int chan_target = (u8) ieee80211_frequency_to_channel(chan->center_freq);
int chan_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE;
int chan_width = CHANNEL_WIDTH_20;

View File

@ -142,8 +142,8 @@ int rtw_check_fw_ps = 1;
int rtw_early_mode = 1;
#endif
#ifdef CONFIG_RTW_SW_LED
int rtw_led_ctrl = 1; /* default led blink */
#ifdef CONFIG_SW_LED
int rtw_led_ctrl = 1; // default to normal blinking
#endif
int rtw_usb_rxagg_mode = 2;/* RX_AGG_DMA=1, RX_AGG_USB=2 */
@ -617,9 +617,9 @@ module_param(rtw_pci_aspm_enable, int, 0644);
module_param(rtw_early_mode, int, 0644);
#endif
#ifdef CONFIG_RTW_SW_LED
#ifdef CONFIG_SW_LED
module_param(rtw_led_ctrl, int, 0644);
MODULE_PARM_DESC(rtw_led_ctrl,"led control, 0:led off, 1:led blink, 2:led on");
MODULE_PARM_DESC(rtw_led_ctrl,"Led Control: 0=Always off, 1=Normal blink, 2=Always on");
#endif
#ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE
@ -1318,7 +1318,7 @@ uint loadparam(_adapter *padapter)
#ifdef CONFIG_TX_EARLY_MODE
registry_par->early_mode = (u8)rtw_early_mode;
#endif
#ifdef CONFIG_RTW_SW_LED
#ifdef CONFIG_SW_LED
registry_par->led_ctrl = (u8)rtw_led_ctrl;
#endif
registry_par->trx_path_bmp = (u8)rtw_trx_path_bmp;
@ -3937,7 +3937,7 @@ int _netdev_open(struct net_device *pnetdev)
#ifdef CONFIG_IOCTL_CFG80211
rtw_cfg80211_init_wdev_data(padapter);
#endif
rtw_netif_carrier_on(pnetdev); /* call this func when rtw_joinbss_event_callback return success */
/* rtw_netif_carrier_on(pnetdev); */ /* call this func when rtw_joinbss_event_callback return success */
rtw_netif_wake_queue(pnetdev);
#ifdef CONFIG_BR_EXT
@ -4058,7 +4058,7 @@ int _netdev_open(struct net_device *pnetdev)
rtw_set_pwr_state_check_timer(pwrctrlpriv);
#endif
rtw_netif_carrier_on(pnetdev); /* call this func when rtw_joinbss_event_callback return success */
/* rtw_netif_carrier_on(pnetdev); */ /* call this func when rtw_joinbss_event_callback return success */
rtw_netif_wake_queue(pnetdev);
#ifdef CONFIG_BR_EXT

View File

@ -353,7 +353,6 @@ _pkt *rtw_os_alloc_msdu_pkt(union recv_frame *prframe, const u8 *da, const u8 *s
{
sub_skb = rtw_skb_clone(prframe->u.hdr.pkt);
if (sub_skb) {
sub_skb->head = msdu;
sub_skb->data = msdu;
sub_skb->len = msdu_len;
skb_set_tail_pointer(sub_skb, msdu_len);
@ -619,9 +618,8 @@ void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame)
if (skb == NULL)
return;
skb->head = precv_frame->u.hdr.rx_head;
skb->data = precv_frame->u.hdr.rx_data;
skb_set_tail_pointer(skb, precv_frame->u.hdr.rx_tail - precv_frame->u.hdr.rx_data);
skb->tail = precv_frame->u.hdr.rx_tail;
skb->len = precv_frame->u.hdr.len;
/* pskb_copy = rtw_skb_copy(skb);
@ -663,7 +661,6 @@ int rtw_recv_monitor(_adapter *padapter, union recv_frame *precv_frame)
goto _recv_drop;
}
skb->head = precv_frame->u.hdr.rx_head;
skb->data = precv_frame->u.hdr.rx_data;
skb_set_tail_pointer(skb, precv_frame->u.hdr.len);
skb->len = precv_frame->u.hdr.len;
@ -688,7 +685,6 @@ inline void rtw_rframe_set_os_pkt(union recv_frame *rframe)
{
_pkt *skb = rframe->u.hdr.pkt;
skb->head = rframe->u.hdr.rx_head;
skb->data = rframe->u.hdr.rx_data;
skb_set_tail_pointer(skb, rframe->u.hdr.len);
skb->len = rframe->u.hdr.len;

View File

@ -4,7 +4,7 @@
#
# Supports dkms and non-dkms removals.
# Copyright(c) 2022 Nick Morrow
# Copyright(c) 2023 Nick Morrow
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
@ -16,7 +16,7 @@
# GNU General Public License for more details.
SCRIPT_NAME="remove-driver.sh"
SCRIPT_VERSION="20221228"
SCRIPT_VERSION="20230109"
MODULE_NAME="88x2bu"
DRV_VERSION="5.13.1"
@ -57,7 +57,7 @@ do
done
# displays script name and version
echo "Script: ${SCRIPT_NAME} version ${SCRIPT_VERSION}"
echo ": ${SCRIPT_NAME} v${SCRIPT_VERSION}"
# check for and remove non-dkms installations
# standard naming
@ -91,10 +91,10 @@ fi
# information that helps with bug reports
# display kernel version
echo "Kernel: ${KVER}"
echo ": ${KVER}"
# display architecture
echo "Arch: ${KARCH}"
echo ": ${KARCH}"
# determine if dkms is installed and run the appropriate routines
if command -v dkms >/dev/null 2>&1