Skip to content

Commit

Permalink
Merge branch 'v5.2.20' into kernel_6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
peteallenm authored Aug 3, 2023
2 parents 941b917 + 2f43cd2 commit 9419a45
Show file tree
Hide file tree
Showing 13 changed files with 153 additions and 24 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/autocompiler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: autoinstaller

on: [push]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
build:
runs-on: ubuntu-latest
env:
CLOUDSMITH_API_KEY: ${{ secrets.CLOUDSMITH_API_KEY }}
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: install dependencies
run: |
sudo apt install -y ruby-dev
sudo gem install fpm
- name: create installer
run: |
mkdir ../temp
mkdir ../temp2
cp -r packagedir/* ../temp2
rm -Rf packagedir
mv * ../temp
mkdir -p packagedir/opt/rtl8812au/
mv ../temp/* packagedir/opt/rtl8812au
mv ../temp2/* packagedir/
fpm -a arm64 -s dir -t deb -n rtl8812au-autocompiler -v 2.3.4-$(date '+%m%d%H%M') -C ./packagedir/ -p rtl8812au-autocompiler.deb --after-install packagedir/opt/rtl8812au/after-install.sh
ls -a
- name: Upload to Github
uses: 'actions/upload-artifact@v2'
with:
name: "rtl8812au-autocompiler"
path: |
*.deb
- name: Push
id: push
uses: cloudsmith-io/action@master
with:
api-key: ${{ secrets.CLOUDSMITH_API_KEY }}
command: "push"
format: "deb"
owner: "openhd"
repo: "openhd-2-3-evo"
distro: "any-distro"
release: "any-version"
republish: "true" # needed ONLY if version is not changing
file: "*.deb"
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ modules.order
*.mod.c
.tmp_versions
.cache.mk
.idea
3 changes: 2 additions & 1 deletion Kconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
config RTL8812AU
tristate "Realtek 8812A USB WiFi"
depends on USB
---help---
select WIRELESS_EXT
help
Help message of RTL8812AU
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ EXTRA_CFLAGS += -Wno-unused-function
EXTRA_CFLAGS += -Wno-unused
EXTRA_CFLAGS += -Wno-cast-function-type
EXTRA_CFLAGS += -Wno-date-time
#EXTRA_CFLAGS += -Wno-misleading-indentation
EXTRA_CFLAGS += -Wno-misleading-indentation
EXTRA_CFLAGS += -Wno-uninitialized
# Relax some warnings from '-Wextra' so we won't get flooded with warnings
EXTRA_CFLAGS += -Wno-sign-compare
Expand Down Expand Up @@ -94,7 +94,7 @@ CONFIG_USB2_EXTERNAL_POWER = y
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 = 4 #Consti10 3==DRV_WARNING
CONFIG_RTW_LOG_LEVEL = 3 #Consti10 3==DRV_WARNING
######################## Wake On Lan ##########################
CONFIG_WOWLAN = n
CONFIG_WAKEUP_TYPE = 0x7 #bit2: deauth, bit1: unicast, bit0: magic pkt.
Expand Down
4 changes: 4 additions & 0 deletions after-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

systemctl enable rtl8812auEasyCompile
chmod +x /usr/local/bin/rtl8812auEasyCompile.sh
6 changes: 5 additions & 1 deletion core/rtw_cmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1496,7 +1496,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork)
#endif /* CONFIG_80211N_HT */

#ifdef CONFIG_RTW_80211R
/*IEEE802.11-2012 Std. Table 8-101¡XAKM suite selectors*/
/*IEEE802.11-2012 Std. Table 8-101XAKM suite selectors*/
if ((rtw_chk_ft_flags(padapter, RTW_FT_STA_SUPPORTED)) &&
((psecuritypriv->rsn_akm_suite_type == 3) || (psecuritypriv->rsn_akm_suite_type == 4))
) {
Expand Down Expand Up @@ -2103,6 +2103,10 @@ u8 rtw_set_chbw_cmd(_adapter *padapter, u8 ch, u8 bw, u8 ch_offset, u8 flags)

RTW_INFO(FUNC_NDEV_FMT" ch:%u, bw:%u, ch_offset:%u\n",
FUNC_NDEV_ARG(padapter->pnetdev), ch, bw, ch_offset);
if(true){
RTW_WARN(FUNC_NDEV_FMT" ch:%u, bw:%u, ch_offset:%uOpenHD channel debug\n",
FUNC_NDEV_ARG(padapter->pnetdev), ch, bw, ch_offset);
}

/* check input parameter */

Expand Down
4 changes: 4 additions & 0 deletions core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -3317,6 +3317,10 @@ unsigned int on_action_spct_ch_switch(_adapter *padapter, struct sta_info *psta,

RTW_INFO(FUNC_NDEV_FMT" from "MAC_FMT"\n",
FUNC_NDEV_ARG(padapter->pnetdev), MAC_ARG(psta->cmn.mac_addr));
if(true){
RTW_WARN(FUNC_NDEV_FMT" from "MAC_FMT"OpenHD channel debug\n",
FUNC_NDEV_ARG(padapter->pnetdev), MAC_ARG(psta->cmn.mac_addr));
}

for_each_ie(ie, ies, ies_len) {
if (ie->id == WLAN_EID_CHANNEL_SWITCH) {
Expand Down
25 changes: 7 additions & 18 deletions hal/rtl8812a/usb/rtl8812au_xmit.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,24 +112,15 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba
SET_TX_DESC_QUEUE_SEL_8812(ptxdesc, pattrib->qsel);

/* offset 12 */
// Not injected
if(pattrib->inject != 0xa5)
{
if (!pattrib->qos_en) {
SET_TX_DESC_HWSEQ_EN_8812(ptxdesc, 1); /* Hw set sequence number */
} else {
SET_TX_DESC_SEQ_8812(ptxdesc, pattrib->seqnum);
}
}

if (!pattrib->qos_en) {
SET_TX_DESC_HWSEQ_EN_8812(ptxdesc, 1); /* Hw set sequence number */
} else
SET_TX_DESC_SEQ_8812(ptxdesc, pattrib->seqnum);

/* injected frame */
if(pattrib->inject == 0xa5) {
/* Prevent sequence number from being overwritten */
SET_TX_DESC_HWSEQ_EN_8812(ptxdesc, 0); /* Hw do not set sequence number */
SET_TX_DESC_SEQ_8812(ptxdesc, pattrib->seqnum); /* Copy inject sequence number to TxDesc */

SET_TX_DESC_RETRY_LIMIT_ENABLE_8812(ptxdesc, 1);

if (pattrib->retry_ctrl == _TRUE) {
SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 6);
} else {
Expand Down Expand Up @@ -328,7 +319,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba
if (pattrib->retry_ctrl == _TRUE)
SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 6);
else
SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 0);
SET_TX_DESC_DATA_RETRY_LIMIT_8812(ptxdesc, 12);
}

#ifdef CONFIG_XMIT_ACK
Expand Down Expand Up @@ -416,9 +407,7 @@ s32 rtl8812au_xmit_buf_handler(PADAPTER padapter)
break;

/* only XMITBUF_DATA & XMITBUF_MGNT */
pxmitframe = (struct xmit_frame *) pxmitbuf->priv_data;
rtw_write_port_and_wait(padapter, pxmitbuf->ff_hwaddr, pxmitbuf->len, (unsigned char *)pxmitbuf, 500);
rtw_free_xmitframe(pxmitpriv, pxmitframe);
} while (1);

#ifdef CONFIG_LPS_LCLK
Expand Down Expand Up @@ -453,7 +442,7 @@ u32 upload_txpktbuf_8812au(_adapter *adapter, u8 *buf, u32 buflen)
}
rtw_write32(adapter, REG_PKTBUF_DBG_CTRL, 0xff800000+(beacon_head<<6) + qw_addr);
loop_cnt = 0;
while ((rtw_read32(adapter, REG_PKTBUF_DBG_CTRL) & BIT23) != _FALSE) {
while ((rtw_read32(adapter, REG_PKTBUF_DBG_CTRL) & BIT23) == false) {
rtw_udelay_os(10);
if (loop_cnt++ == 100)
return _FALSE;
Expand Down
2 changes: 2 additions & 0 deletions include/drv_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ struct registry_priv {
#endif
u8 RegEnableTxPowerByRate;
u8 RegTxPowerIndexOverride;
int32_t openhd_override_channel;
int32_t openhd_override_channel_width;

u8 target_tx_pwr_valid;
s8 target_tx_pwr_2g[RF_PATH_MAX][RATE_SECTION_NUM];
Expand Down
29 changes: 27 additions & 2 deletions os_dep/linux/ioctl_cfg80211.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,6 @@ u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8
if (ret != _SUCCESS)
goto exit;


#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2))
Expand Down Expand Up @@ -5010,13 +5009,17 @@ struct cfg80211_chan_def *chandef){
chandef->center_freq1 = center_freq;
chandef->center_freq2 = center_freq2;
//RTW_INFO("%s : channel %d width %d freq1 %d freq2 %d center_freq %d offset %d\n", __func__, channel, width, chandef->center_freq1, chandef->center_freq2, chandef->chan->center_freq,rtw_get_oper_choffset(padapter));
// Consti10: this method seems to be used
if(true){
RTW_WARN("OpenHD channel debug: %s : channel %d width %d freq1 %d freq2 %d center_freq %d offset %d\n", __func__, channel, width, chandef->center_freq1, chandef->center_freq2, chandef->chan->center_freq,rtw_get_oper_choffset(padapter));
}
} else {
return -EINVAL;
}
return 0;

}

// Consti10: In monitor mode, this method seems to be not used (set_monitor_channel is used instead)
static int cfg80211_rtw_set_channel(struct wiphy *wiphy
#if (CFG80211_API_LEVEL >= KERNEL_VERSION(2, 6, 35))
, struct net_device *ndev
Expand Down Expand Up @@ -5058,12 +5061,17 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy

RTW_INFO(FUNC_ADPT_FMT" ch:%d bw:%d, offset:%d\n"
, FUNC_ADPT_ARG(padapter), chan_target, chan_width, chan_offset);
if(true){
RTW_WARN(FUNC_ADPT_FMT" ch:%d bw:%d, offset:%d OpenHD channel debug\n"
, FUNC_ADPT_ARG(padapter), chan_target, chan_width, chan_offset);
}

rtw_set_chbw_cmd(padapter, chan_target, chan_width, chan_offset, RTW_CMDF_WAIT_ACK);

return 0;
}

// Consti10: In monitor mode, this method is used the set the channel freq, at least on ubuntu 5.19.X
static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
#if (CFG80211_API_LEVEL >= KERNEL_VERSION(3, 8, 0))
, struct cfg80211_chan_def *chandef
Expand Down Expand Up @@ -5158,6 +5166,22 @@ static int cfg80211_rtw_set_monitor_channel(struct wiphy *wiphy
RTW_INFO(FUNC_ADPT_FMT" ch:%d bw:%d, offset:%d\n"
, FUNC_ADPT_ARG(padapter), target_channal, target_width, target_offset);

// OpenHD channel via module param
{
if(padapter->registrypriv.openhd_override_channel){
target_channal=padapter->registrypriv.openhd_override_channel;
RTW_WARN("OpenHD: using openhd_override_channel");
}
if(padapter->registrypriv.openhd_override_channel_width){
target_width=padapter->registrypriv.openhd_override_channel_width;
RTW_WARN("OpenHD: using openhd_override_channel_width");
}
}

if(true){
RTW_WARN(FUNC_ADPT_FMT" ch:%d bw:%d, offset:%d OpenHD channel debug\n"
, FUNC_ADPT_ARG(padapter), target_channal, target_width, target_offset);
}
rtw_set_chbw_cmd(padapter, target_channal, target_width, target_offset, RTW_CMDF_WAIT_ACK);

return 0;
Expand Down Expand Up @@ -7819,6 +7843,7 @@ static struct cfg80211_ops rtw_cfg80211_ops = {
.flush_pmksa = cfg80211_rtw_flush_pmksa,

#ifdef CONFIG_AP_MODE

.add_virtual_intf = cfg80211_rtw_add_virtual_intf,
.del_virtual_intf = cfg80211_rtw_del_virtual_intf,

Expand Down
16 changes: 16 additions & 0 deletions os_dep/linux/os_intfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,17 @@ int rtw_tx_pwr_by_rate = CONFIG_TXPWR_BY_RATE_EN;
module_param(rtw_tx_pwr_by_rate, int, 0644);
MODULE_PARM_DESC(rtw_tx_pwr_by_rate, "0:Disable, 1:Enable, 2: Depend on efuse");

// OpenHD params
int openhd_override_channel = 0;
module_param(openhd_override_channel, int, 0644);
MODULE_PARM_DESC(openhd_override_channel, "OpenHD easy (CRDA workaround)");
//
int openhd_override_channel_width = 0;
module_param(openhd_override_channel_width, int, 0644);
MODULE_PARM_DESC(openhd_override_channel_width, "OpenHD easy (CRDA workaround)");
//


#ifdef CONFIG_TXPWR_LIMIT
int rtw_tx_pwr_lmt_enable = CONFIG_TXPWR_LIMIT_EN;
module_param(rtw_tx_pwr_lmt_enable, int, 0644);
Expand Down Expand Up @@ -1013,6 +1024,11 @@ uint loadparam(_adapter *padapter)
registry_par->RegTxPowerIndexOverride = (u8)rtw_tx_pwr_idx_override;
RTW_INFO("OpenHD:rtw_tx_pwr_idx_override:%d\n",(int)rtw_tx_pwr_idx_override);

registry_par->openhd_override_channel = openhd_override_channel;
registry_par->openhd_override_channel_width = openhd_override_channel_width;
RTW_WARN("OpenHD: openhd_override_channel %d, openhd_override_channel_width: %d",
registry_par->openhd_override_channel,registry_par->openhd_override_channel_width);


rtw_regsty_load_target_tx_power(registry_par);

Expand Down
13 changes: 13 additions & 0 deletions packagedir/etc/systemd/system/rtl8812auEasyCompile.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=rtl8812au Compiler
After=multi-user.target

[Service]
Type=simple
ExecStart=/usr/local/bin/rtl8812auEasyCompile.sh
User=root


[Install]
WantedBy=multi-user.target

13 changes: 13 additions & 0 deletions packagedir/usr/local/bin/rtl8812auEasyCompile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
echo "We're now compiling the rtl8812au driver into your stock kernel"
sudo apt install -y dkms
cd /opt/rtl8812au/
sudo ./dkms-install.sh > /opt/installrtl.log
systemctl disable rtl8812auEasyCompile
sudo rm -Rf /etc/systemd/system/rtl8812auEasyCompile.service
sudo rm -Rf /usr/local/bin/rtl8812auEasyCompile.sh
echo "cleanup done"
rm /etc/motd
mv /etc/motd2 /etc/motd
systemctl enable openhd
reboot

0 comments on commit 9419a45

Please sign in to comment.