diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c index 518caaaf8a98..7fe9b04334d5 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8187/dev.c @@ -251,8 +251,17 @@ static void rtl8187_tx(struct ieee80211_hw *dev, flags |= RTL818X_TX_DESC_FLAG_NO_ENC; flags |= ieee80211_get_tx_rate(dev, info)->hw_value << 24; + + // When this flag is set the firmware waits untill ALL fragments have + // reached the USB device. Then it sends the first fragment and waits + // for ACKS's. Of course in monitor mode it won't detect these ACK's. if (ieee80211_has_morefrags(tx_hdr->frame_control)) - flags |= RTL818X_TX_DESC_FLAG_MOREFRAG; + { + // If info->control.vif is NULL it's most likely in monitor mode + if (likely(info->control.vif != NULL && info->control.vif->type != NL80211_IFTYPE_MONITOR)) { + flags |= RTL818X_TX_DESC_FLAG_MOREFRAG; + } + } /* HW will perform RTS-CTS when only RTS flags is set. * HW will perform CTS-to-self when both RTS and CTS flags are set. diff --git a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c index b785742bfd9e..e4e83edef63b 100644 --- a/drivers/net/wireless/zydas/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zydas/zd1211rw/zd_mac.c @@ -242,14 +242,19 @@ void zd_mac_clear(struct zd_mac *mac) static int set_rx_filter(struct zd_mac *mac) { unsigned long flags; - u32 filter = STA_RX_FILTER; + struct zd_ioreq32 ioreqs[] = { + {CR_RX_FILTER, STA_RX_FILTER}, + { CR_SNIFFER_ON, 0U }, + }; spin_lock_irqsave(&mac->lock, flags); - if (mac->pass_ctrl) - filter |= RX_FILTER_CTRL; + if (mac->pass_ctrl) { + ioreqs[0].value |= 0xFFFFFFFF; + ioreqs[1].value = 0x1; + } spin_unlock_irqrestore(&mac->lock, flags); - return zd_iowrite32(&mac->chip, CR_RX_FILTER, filter); + return zd_iowrite32a(&mac->chip, ioreqs, ARRAY_SIZE(ioreqs)); } static int set_mac_and_bssid(struct zd_mac *mac) @@ -1056,7 +1061,8 @@ int zd_mac_rx(struct ieee80211_hw *hw, const u8 *buffer, unsigned int length) /* Caller has to ensure that length >= sizeof(struct rx_status). */ status = (struct rx_status *) (buffer + (length - sizeof(struct rx_status))); - if (status->frame_status & ZD_RX_ERROR) { + if ((status->frame_status & ZD_RX_ERROR) || + (status->frame_status & ~0x21)) { if (mac->pass_failed_fcs && (status->frame_status & ZD_RX_CRC32_ERROR)) { stats.flag |= RX_FLAG_FAILED_FCS_CRC; @@ -1399,7 +1405,7 @@ struct ieee80211_hw *zd_mac_alloc_hw(struct usb_interface *intf) ieee80211_hw_set(hw, MFP_CAPABLE); ieee80211_hw_set(hw, HOST_BROADCAST_PS_BUFFERING); ieee80211_hw_set(hw, RX_INCLUDES_FCS); - ieee80211_hw_set(hw, SIGNAL_UNSPEC); + ieee80211_hw_set(hw, SIGNAL_DBM); hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_MESH_POINT) | diff --git a/drivers/staging/qcacld-3.0/configs/default_defconfig b/drivers/staging/qcacld-3.0/configs/default_defconfig index 3a275753a498..baf0bb7771f1 100644 --- a/drivers/staging/qcacld-3.0/configs/default_defconfig +++ b/drivers/staging/qcacld-3.0/configs/default_defconfig @@ -576,7 +576,7 @@ CONFIG_CONVERGED_TDLS_ENABLE := y CONFIG_WLAN_CONV_SPECTRAL_ENABLE := y CONFIG_WLAN_SPECTRAL_ENABLE := y CONFIG_WMI_CMD_STRINGS := y -CONFIG_FEATURE_MONITOR_MODE_SUPPORT := n +CONFIG_FEATURE_MONITOR_MODE_SUPPORT := y CONFIG_DESC_DUP_DETECT_DEBUG := n CONFIG_DEBUG_RX_RING_BUFFER := n CONFIG_WLAN_FEATURE_TWT := y diff --git a/error.log b/error.log new file mode 100644 index 000000000000..405c0ffa43bf --- /dev/null +++ b/error.log @@ -0,0 +1,279 @@ +make[1]: Entering directory '/mnt/Storage-VM/violet/msm-4.14/out' +scripts/kconfig/conf --silentoldconfig Kconfig + CHK include/config/kernel.release + UPD include/config/kernel.release + CHK include/generated/uapi/linux/version.h + CHK include/generated/utsrelease.h + UPD include/generated/utsrelease.h + Using .. as source for kernel + CHK scripts/mod/devicetable-offsets.h + CHK include/generated/timeconst.h + CHK include/generated/bounds.h + CHK include/generated/asm-offsets.h + CALL ../scripts/checksyscalls.sh + CHK include/generated/compile.h + SKIPPED include/generated/compile.h + CC init/version.o + AR init/built-in.o + CC kernel/sys.o + CC drivers/base/firmware_class.o + AR drivers/base/built-in.o + CC kernel/module.o + CC techpack/audio/ipc/apr.o + CC techpack/audio/ipc/apr_v2.o + CC techpack/audio/ipc/apr_tal_rpmsg.o + CHK kernel/config_data.h + AR kernel/built-in.o + CC techpack/audio/ipc/wcd-dsp-glink.o + AR techpack/audio/ipc/apr_dlkm.o + AR techpack/audio/ipc/wglink_dlkm.o + AR techpack/audio/ipc/built-in.o + AR techpack/audio/built-in.o + DTC arch/arm64/boot/dts/qcom/sm6150.dtb + AR techpack/built-in.o + DTC arch/arm64/boot/dts/qcom/sm6150-idp-overlay.dtbo + CC net/wireguard/main.o + CC net/wireguard/noise.o + CC net/wireguard/device.o + CC net/wireguard/peer.o + CC net/wireguard/timers.o + CC net/wireguard/queueing.o + CC net/wireguard/send.o + CC net/wireguard/receive.o + CC net/wireguard/socket.o + CC net/wireguard/peerlookup.o + CC net/wireguard/allowedips.o + CC net/wireguard/ratelimiter.o + CC net/wireguard/cookie.o + CC net/wireguard/netlink.o + CC net/wireguard/crypto/zinc/chacha20/chacha20.o + CC net/wireguard/crypto/zinc/poly1305/poly1305.o + CC net/wireguard/crypto/zinc/chacha20poly1305.o + CC drivers/media/dvb-frontends/dvb-pll.o + CC net/wireguard/crypto/zinc/blake2s/blake2s.o + CC drivers/media/dvb-frontends/stv0299.o + CC drivers/media/dvb-frontends/stb0899_drv.o + CC net/wireguard/crypto/zinc/curve25519/curve25519.o + CC drivers/media/dvb-frontends/stb0899_algo.o +../drivers/media/dvb-frontends/stb0899_algo.c:929:14: warning: explicitly assigning value of variable of type 'u32' (aka 'unsigned int') to itself [-Wself-assign] + k_indirect = k_indirect; /*kindirect = kindirect 10^-6*/ + ~~~~~~~~~~ ^ ~~~~~~~~~~ + CC drivers/media/dvb-frontends/stb6100.o +1 warning generated. + CC drivers/media/dvb-frontends/sp8870.o + CC drivers/media/dvb-frontends/cx22700.o + CC drivers/media/dvb-frontends/s5h1432.o + CC drivers/media/v4l2-core/v4l2-common.o + CC drivers/media/tuners/tea5767.o + CC drivers/media/tuners/tea5761.o + CC drivers/media/dvb-frontends/cx24110.o + AR net/wireguard/wireguard.o + AR net/wireguard/built-in.o + AR net/built-in.o + CC drivers/media/dvb-frontends/tda8083.o + AR drivers/media/v4l2-core/built-in.o + CC drivers/media/tuners/msi001.o + CC drivers/media/tuners/mt2060.o + CC drivers/media/dvb-frontends/l64781.o + CC drivers/media/tuners/mt2063.o + CC drivers/media/dvb-frontends/dib3000mb.o + CC drivers/media/tuners/mt2266.o + CC drivers/media/tuners/qt1010.o + CC drivers/media/dvb-frontends/dib3000mc.o + CC drivers/media/dvb-frontends/dibx000_common.o + CC drivers/media/tuners/mt2131.o + CC drivers/media/dvb-frontends/dib7000m.o + CC drivers/media/tuners/mxl5005s.o + CC drivers/media/dvb-frontends/dib7000p.o + CC drivers/media/tuners/mxl5007t.o + CC drivers/media/dvb-frontends/dib8000.o +../drivers/media/dvb-frontends/dib7000p.c:1874:15: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] + interleaving = interleaving; + ~~~~~~~~~~~~ ^ ~~~~~~~~~~~~ + CC drivers/media/dvb-frontends/dib9000.o + CC drivers/media/tuners/max2165.o + CC drivers/media/dvb-frontends/mt312.o +1 warning generated. + CC drivers/media/dvb-frontends/ves1820.o + CC drivers/media/tuners/tda18218.o + CC drivers/media/dvb-frontends/ves1x93.o + CC drivers/media/dvb-frontends/tda1004x.o + CC drivers/media/tuners/tda18212.o + CC drivers/media/tuners/e4000.o + CC drivers/media/dvb-frontends/sp887x.o + CC drivers/media/tuners/fc2580.o + CC drivers/media/tuners/tua9001.o + CC drivers/media/tuners/si2157.o + CC drivers/media/tuners/fc0011.o + CC drivers/media/dvb-frontends/nxt6000.o + CC drivers/media/tuners/fc0012.o + CC drivers/media/tuners/fc0013.o + CC drivers/media/dvb-frontends/mt352.o + CC drivers/media/dvb-frontends/zl10036.o + CC drivers/media/dvb-frontends/zl10039.o + CC drivers/media/dvb-frontends/zl10353.o + CC drivers/media/dvb-frontends/cx22702.o + CC drivers/media/tuners/it913x.o + CC drivers/media/dvb-frontends/drxd_firm.o + CC drivers/media/dvb-frontends/drxd_hard.o + CC drivers/media/dvb-frontends/tda10021.o + CC drivers/media/tuners/r820t.o + CC drivers/media/tuners/mxl301rf.o +../drivers/media/dvb-frontends/drxd_hard.c:2144:10: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] + status = status; + ~~~~~~ ^ ~~~~~~ +../drivers/media/dvb-frontends/drxd_hard.c:2255:10: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] + status = status; + ~~~~~~ ^ ~~~~~~ +../drivers/media/dvb-frontends/drxd_hard.c:2322:10: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] + status = status; + ~~~~~~ ^ ~~~~~~ + CC drivers/media/tuners/qm1d1c0042.o + CC drivers/media/dvb-frontends/tda10023.o + CC drivers/media/dvb-frontends/stv0297.o + CC drivers/media/tuners/m88rs6000t.o + CC drivers/media/dvb-frontends/nxt200x.o +3 warnings generated. + CC drivers/media/dvb-frontends/or51211.o + CC drivers/media/dvb-frontends/or51132.o + CC drivers/media/dvb-frontends/bcm3510.o + CC drivers/media/dvb-frontends/s5h1420.o + CC drivers/media/dvb-frontends/lgdt330x.o + CC drivers/media/dvb-frontends/lgdt3305.o + CC drivers/media/dvb-frontends/lgdt3306a.o + CC drivers/media/dvb-frontends/lg2160.o + CC drivers/media/dvb-frontends/cx24123.o + CC drivers/media/dvb-frontends/lnbh25.o + CC drivers/media/dvb-frontends/lnbp21.o + CC drivers/media/dvb-frontends/lnbp22.o + CC drivers/media/dvb-frontends/isl6405.o + CC drivers/media/dvb-frontends/isl6421.o + CC drivers/media/dvb-frontends/tda10086.o + CC drivers/media/dvb-frontends/tda826x.o + CC drivers/media/dvb-frontends/tda8261.o + CC drivers/media/dvb-frontends/dib0070.o + CC drivers/media/dvb-frontends/dib0090.o + CC drivers/media/dvb-frontends/tua6100.o + CC drivers/media/dvb-frontends/s5h1409.o + CC drivers/media/dvb-frontends/itd1000.o + CC drivers/media/dvb-frontends/au8522_common.o + CC drivers/media/dvb-frontends/au8522_dig.o + CC drivers/media/dvb-frontends/au8522_decoder.o + CC drivers/media/dvb-frontends/tda10048.o + CC drivers/media/dvb-frontends/cx24113.o + CC drivers/media/dvb-frontends/s5h1411.o + CC drivers/media/dvb-frontends/lgs8gl5.o + CC drivers/media/dvb-frontends/tda665x.o + CC drivers/media/dvb-frontends/lgs8gxx.o + CC drivers/media/dvb-frontends/atbm8830.o + CC drivers/media/dvb-frontends/af9013.o + CC drivers/media/dvb-frontends/cx24116.o + CC drivers/media/dvb-frontends/cx24117.o + CC drivers/media/dvb-frontends/cx24120.o + CC drivers/media/dvb-frontends/si21xx.o + CC drivers/media/dvb-frontends/si2168.o + CC drivers/media/dvb-frontends/stv0288.o + CC drivers/media/dvb-frontends/stb6000.o + CC drivers/media/dvb-frontends/s921.o + CC drivers/media/dvb-frontends/stv6110.o + CC drivers/media/dvb-frontends/stv0900_core.o + CC drivers/media/dvb-frontends/stv0900_sw.o + CC drivers/media/dvb-frontends/stv090x.o + CC drivers/media/dvb-frontends/stv6110x.o + CC drivers/media/dvb-frontends/m88ds3103.o + CC drivers/media/dvb-frontends/mn88472.o + CC drivers/media/dvb-frontends/mn88473.o + CC drivers/media/dvb-frontends/isl6423.o + CC drivers/media/dvb-frontends/ec100.o + CC drivers/media/dvb-frontends/ds3000.o + CC drivers/media/dvb-frontends/ts2020.o + CC drivers/media/dvb-frontends/mb86a16.o + CC drivers/media/dvb-frontends/drx39xyj/drxj.o + CC drivers/media/dvb-frontends/mb86a20s.o + CC drivers/media/dvb-frontends/ix2505v.o +../drivers/media/dvb-frontends/drx39xyj/drxj.c:11077:13: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((*mode == DRX_POWER_UP)) { + ~~~~~~^~~~~~~~~~~~~~~ +../drivers/media/dvb-frontends/drx39xyj/drxj.c:11077:13: note: remove extraneous parentheses around the comparison to silence this warning + if ((*mode == DRX_POWER_UP)) { + ~ ^ ~ +../drivers/media/dvb-frontends/drx39xyj/drxj.c:11077:13: note: use '=' to turn this equality comparison into an assignment + if ((*mode == DRX_POWER_UP)) { + ^~ + = + CC drivers/media/dvb-frontends/stv0367.o + CC drivers/media/dvb-frontends/cxd2820r_core.o + CC drivers/media/dvb-frontends/cxd2820r_c.o +../drivers/media/dvb-frontends/stv0367.c:1552:14: warning: explicitly assigning value of variable of type 'u32' (aka 'unsigned int') to itself [-Wself-assign] + temporary = temporary; + ~~~~~~~~~ ^ ~~~~~~~~~ +1 warning generated. + CC drivers/media/dvb-frontends/cxd2820r_t.o +1 warning generated. + AR drivers/media/dvb-frontends/drx39xyj/drx39xyj.o + AR drivers/media/dvb-frontends/drx39xyj/built-in.o + CC drivers/media/dvb-frontends/cxd2820r_t2.o + CC drivers/media/dvb-frontends/cxd2841er.o + CC drivers/media/dvb-frontends/drxk_hard.o + CC drivers/media/dvb-frontends/tda18271c2dd.o + CC drivers/media/dvb-frontends/stv0910.o + CC drivers/media/dvb-frontends/stv6111.o +../drivers/media/dvb-frontends/drxk_hard.c:6065:27: warning: equality comparison with extraneous parentheses [-Wparentheses-equality] + if ((state->m_drxk_state == DRXK_UNINITIALIZED)) { + ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~ +../drivers/media/dvb-frontends/drxk_hard.c:6065:27: note: remove extraneous parentheses around the comparison to silence this warning + if ((state->m_drxk_state == DRXK_UNINITIALIZED)) { + ~ ^ ~ +../drivers/media/dvb-frontends/drxk_hard.c:6065:27: note: use '=' to turn this equality comparison into an assignment + if ((state->m_drxk_state == DRXK_UNINITIALIZED)) { + ^~ + = + CC drivers/media/dvb-frontends/mxl5xx.o +../drivers/media/dvb-frontends/tda18271c2dd.c:677:10: warning: explicitly assigning value of variable of type 'int' to itself [-Wself-assign] + status = status; + ~~~~~~ ^ ~~~~~~ +1 warning generated. + CC drivers/media/dvb-frontends/si2165.o + CC drivers/media/dvb-frontends/a8293.o + CC drivers/media/dvb-frontends/sp2.o + CC drivers/media/dvb-frontends/tda10071.o +1 warning generated. + CC drivers/media/dvb-frontends/m88rs2000.o + CC drivers/media/dvb-frontends/af9033.o + CC drivers/media/dvb-frontends/tc90522.o + CC drivers/media/dvb-frontends/horus3a.o + CC drivers/media/dvb-frontends/ascot2e.o + CC drivers/media/dvb-frontends/helene.o + AR drivers/media/dvb-frontends/stb0899.o + AR drivers/media/dvb-frontends/drxd.o + AR drivers/media/dvb-frontends/stv0900.o + AR drivers/media/dvb-frontends/cxd2820r.o + AR drivers/media/dvb-frontends/drxk.o + AR drivers/media/dvb-frontends/built-in.o + CC drivers/staging/qcacld-3.0/core/hdd/src/wlan_hdd_main.o + AR drivers/media/tuners/built-in.o + AR drivers/media/built-in.o + AR drivers/staging/qcacld-3.0/wlan.o + AR drivers/staging/qcacld-3.0/built-in.o + AR drivers/staging/built-in.o + AR drivers/built-in.o + GEN .version + CHK include/generated/compile.h + SKIPPED include/generated/compile.h + AR built-in.o + LTO vmlinux.o + MODPOST vmlinux.o +WARNING: EXPORT symbol "gsi_write_channel_scratch" [vmlinux] version generation failed, symbol will not be versioned. + KSYM .tmp_kallsyms1.o + KSYM .tmp_kallsyms2.o + LD vmlinux + SORTEX vmlinux + SYSMAP System.map + Building modules, stage 2. + OBJCOPY arch/arm64/boot/Image + MODPOST 0 modules +WARNING: EXPORT symbol "gsi_write_channel_scratch" [vmlinux] version generation failed, symbol will not be versioned. + GZIP arch/arm64/boot/Image.gz + DTC arch/arm64/boot/dts/qcom/sm6150.dtb + CAT arch/arm64/boot/Image.gz-dtb +make[1]: Leaving directory '/mnt/Storage-VM/violet/msm-4.14/out' diff --git a/kernel.sh b/kernel.sh new file mode 100644 index 000000000000..69b782918f5c --- /dev/null +++ b/kernel.sh @@ -0,0 +1,325 @@ +#! /bin/bash + + # Script For Building Android arm64 Kernel + # + # Copyright (c) 2018-2020 Panchajanya1999 + # + # Licensed under the Apache License, Version 2.0 (the "License"); + # you may not use this file except in compliance with the License. + # You may obtain a copy of the License at + # + # http://www.apache.org/licenses/LICENSE-2.0 + # + # Unless required by applicable law or agreed to in writing, software + # distributed under the License is distributed on an "AS IS" BASIS, + # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + # See the License for the specific language governing permissions and + # limitations under the License. + # + +#Kernel building script + +# Function to show an informational message +msg() { + echo -e "\e[1;32m$*\e[0m" +} + +err() { + echo -e "\e[1;41m$*\e[0m" + exit 1 +} + +##------------------------------------------------------## +##----------Basic Informations, COMPULSORY--------------## + +# The defult directory where the kernel should be placed +KERNEL_DIR=/mnt/Storage-VM/violet/msm-4.14 + +# The name of the Kernel, to name the ZIP +ZIPNAME="Team-420" + +# The name of the device for which the kernel is built +MODEL="Redmi Note 7 Pro" + +# The codename of the device +DEVICE="violet" + +# The defconfig which should be used. Get it from config.gz from +# your device or check source +DEFCONFIG=vendor/nethunter_defconfig + +# Specify compiler. +# 'clang' or 'gcc' +COMPILER=clang + +# Clean source prior building. 1 is NO(default) | 0 is YES +INCREMENTAL=1 + +# Push ZIP to Telegram. 1 is YES | 0 is NO(default) +PTTG=0 + if [ $PTTG = 1 ] + then + # Set Telegram Chat ID + CHATID="-1001231303646" + fi + +# Generate a full DEFCONFIG prior building. 1 is YES | 0 is NO(default) +DEF_REG=0 + +# Build dtbo.img (select this only if your source has support to building dtbo.img) +# 1 is YES | 0 is NO(default) +BUILD_DTBO=1 + +# Sign the zipfile +# 1 is YES | 0 is NO +SIGN=0 + +# Silence the compilation +# 1 is YES(default) | 0 is NO +SILENCE=0 + +# Debug purpose. Send logs on every successfull builds +# 1 is YES | 0 is NO(default) +LOG_DEBUG=0 + +##------------------------------------------------------## +##---------Do Not Touch Anything Beyond This------------## + +# Check if we are using a dedicated CI ( Continuous Integration ), and +# set KBUILD_BUILD_VERSION and KBUILD_BUILD_HOST and CI_BRANCH + +## Set defaults first +DISTRO=$(cat /etc/*-release | head -n 1 | cut -b 7- | sed s/.$//) +KBUILD_BUILD_HOST=$(uname -a | awk '{print $2}') +CI_BRANCH=$(git rev-parse --abbrev-ref HEAD) +export KBUILD_BUILD_HOST CI_BRANCH + +## Check for CI +if [ -n "$CI" ] +then + if [ -n "$CIRCLECI" ] + then + export KBUILD_BUILD_VERSION=$CIRCLE_BUILD_NUM + export KBUILD_BUILD_HOST="Kali" + export CI_BRANCH=$CIRCLE_BRANCH + fi + if [ -n "$DRONE" ] + then + export KBUILD_BUILD_VERSION=$DRONE_BUILD_NUMBER + export KBUILD_BUILD_HOST=$DRONE_SYSTEM_HOST + export CI_BRANCH=$DRONE_BRANCH + else + echo "Not presetting Build Version" + fi +fi + +#Check Kernel Version +KERVER=$(make kernelversion) + + +# Set a commit head +COMMIT_HEAD=$(git log --oneline -1) + +# Set Date +DATE=$(TZ=Asia/Jakarta date +"%Y%m%d-%T") + +#Now Its time for other stuffs like cloning, exporting, etc + + clone() { + echo " " + if [ $COMPILER = "clang" ] + then + msg "|| Cloning Clang-11 ||" + git clone --depth=1 https://github.com/Panchajanya1999/azure-clang.git clang-llvm + + # Toolchain Directory defaults to clang-llvm + TC_DIR=$KERNEL_DIR/clang-llvm + elif [ $COMPILER = "gcc" ] + then + msg "|| Cloning GCC 9.3.0 baremetal ||" + git clone --depth=1 https://github.com/arter97/arm64-gcc.git gcc64 + git clone --depth=1 https://github.com/arter97/arm32-gcc.git gcc32 + GCC64_DIR=$KERNEL_DIR/gcc64 + GCC32_DIR=$KERNEL_DIR/gcc32 + fi + + msg "|| Cloning Anykernel ||" + git clone --depth 1 --no-single-branch https://github.com/Panchajanya1999/AnyKernel2.git -b $DEVICE + msg "|| Cloning libufdt ||" + git clone https://android.googlesource.com/platform/system/libufdt "$KERNEL_DIR"/scripts/ufdt/libufdt +} + +##------------------------------------------------------## + +exports() { + export KBUILD_BUILD_USER="S133PY" + export ARCH=arm64 + export SUBARCH=arm64 + + if [ $COMPILER = "clang" ] + then + KBUILD_COMPILER_STRING=$("$TC_DIR"/bin/clang --version | head -n 1 | perl -pe 's/\(http.*?\)//gs' | sed -e 's/ */ /g' -e 's/[[:space:]]*$//') + PATH=$TC_DIR/bin/:$PATH + elif [ $COMPILER = "gcc" ] + then + KBUILD_COMPILER_STRING=$("$GCC64_DIR"/bin/aarch64-elf-gcc --version | head -n 1) + PATH=$GCC64_DIR/bin/:$GCC32_DIR/bin/:/usr/bin:$PATH + fi + + export PATH KBUILD_COMPILER_STRING + export BOT_MSG_URL="https://api.telegram.org/bot$token/sendMessage" + export BOT_BUILD_URL="https://api.telegram.org/bot$token/sendDocument" + PROCS=$(nproc --all) + export PROCS +} + +##---------------------------------------------------------## + +tg_post_msg() { + curl -s -X POST "$BOT_MSG_URL" -d chat_id="$2" \ + -d "disable_web_page_preview=true" \ + -d "parse_mode=html" \ + -d text="$1" + +} + +##----------------------------------------------------------------## + +tg_post_build() { + #Post MD5Checksum alongwith for easeness + MD5CHECK=$(md5sum "$1" | cut -d' ' -f1) + + #Show the Checksum alongwith caption + curl --progress-bar -F document=@"$1" "$BOT_BUILD_URL" \ + -F chat_id="$2" \ + -F "disable_web_page_preview=true" \ + -F "parse_mode=html" \ + -F caption="$3 | MD5 Checksum : $MD5CHECK" +} + +##----------------------------------------------------------## + +build_kernel() { + if [ $INCREMENTAL = 0 ] + then + msg "|| Cleaning Sources ||" + make clean && make mrproper && rm -rf out + fi + + if [ "$PTTG" = 1 ] + then + tg_post_msg "$KBUILD_BUILD_VERSION CI Build Triggered%0ADocker OS: $DISTRO%0AKernel Version : $KERVER%0ADate : $(TZ=Asia/Kolkata date)%0ADevice : $MODEL [$DEVICE]%0APipeline Host : $KBUILD_BUILD_HOST%0AHost Core Count : $PROCS%0ACompiler Used : $KBUILD_COMPILER_STRING%0aBranch : $CI_BRANCH%0ATop Commit : $COMMIT_HEAD%0AStatus : #Nightly" "$CHATID" + fi + + make O=out $DEFCONFIG + if [ $DEF_REG = 1 ] + then + cp .config arch/arm64/configs/$DEFCONFIG + git add arch/arm64/configs/$DEFCONFIG + git commit -m "$DEFCONFIG: Regenerate + + This is an auto-generated commit" + fi + + BUILD_START=$(date +"%s") + + if [ $COMPILER = "clang" ] + then + MAKE+=( + CROSS_COMPILE=aarch64-linux-gnu- \ + CROSS_COMPILE_ARM32=arm-linux-gnueabi- \ + CC=clang \ + AR=llvm-ar \ + OBJDUMP=llvm-objdump \ + STRIP=llvm-strip + ) + elif [ $COMPILER = "gcc" ] + then + MAKE+=( + CROSS_COMPILE_ARM32=arm-eabi- \ + CROSS_COMPILE=aarch64-elf- \ + AR=aarch64-elf-ar \ + OBJDUMP=aarch64-elf-objdump \ + STRIP=aarch64-elf-strip + ) + fi + + if [ $SILENCE = "1" ] + then + MAKE+=( -s ) + fi + + msg "|| Started Compilation ||" + make -j"$PROCS" O=out \ + NM=llvm-nm \ + OBJCOPY=llvm-objcopy \ + LD=ld.lld "${MAKE[@]}" 2>&1 | tee error.log + + BUILD_END=$(date +"%s") + DIFF=$((BUILD_END - BUILD_START)) + + if [ -f "$KERNEL_DIR"/out/arch/arm64/boot/Image.gz-dtb ] + then + msg "|| Kernel successfully compiled ||" + if [ $BUILD_DTBO = 1 ] + then + msg "|| Building DTBO ||" + tg_post_msg "Building DTBO.." "$CHATID" + python2 "$KERNEL_DIR/scripts/ufdt/libufdt/utils/src/mkdtboimg.py" \ + create "$KERNEL_DIR/out/arch/arm64/boot/dtbo.img" --page_size=4096 "$KERNEL_DIR/out/arch/arm64/boot/dts/qcom/sm6150-idp-overlay.dtbo" + fi + gen_zip + else + if [ "$PTTG" = 1 ] + then + tg_post_build "error.log" "$CHATID" "Build failed to compile after $((DIFF / 60)) minute(s) and $((DIFF % 60)) seconds" + fi + fi + +} + +##--------------------------------------------------------------## + +gen_zip() { + msg "|| Zipping into a flashable zip ||" + mv "$KERNEL_DIR"/out/arch/arm64/boot/Image.gz-dtb AnyKernel2/Image.gz-dtb + if [ $BUILD_DTBO = 1 ] + then + mv "$KERNEL_DIR"/out/arch/arm64/boot/dtbo.img AnyKernel2/dtbo.img + fi + cd AnyKernel2 || exit + zip -r9 $ZIPNAME-$DEVICE-"$DATE" * -x .git README.md + + ## Prepare a final zip variable + ZIP_FINAL="$ZIPNAME-$DEVICE-$DATE.zip" + + if [ $SIGN = 1 ] + then + ## Sign the zip before sending it to telegram + if [ "$PTTG" = 1 ] + then + msg "|| Signing Zip ||" + tg_post_msg "Signing Zip file with AOSP keys.." "$CHATID" + fi + curl -sLo zipsigner-3.0.jar https://raw.githubusercontent.com/baalajimaestro/AnyKernel2/master/zipsigner-3.0.jar + java -jar zipsigner-3.0.jar $ZIPNAME-$DEVICE-"$DATE".zip "$ZIP_FINAL"-signed.zip + ZIP_FINAL="$ZIP_FINAL-signed.zip" + fi + + if [ "$PTTG" = 1 ] + then + tg_post_build "$ZIP_FINAL" "$CHATID" "Build took : $((DIFF / 60)) minute(s) and $((DIFF % 60)) second(s)" + fi + cd .. +} + +clone +exports +build_kernel + +if [ $LOG_DEBUG = "1" ] +then + tg_post_build "error.log" "$CHATID" "Debug Mode Logs" +fi + +##----------------*****-----------------------------## diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index b1484b8316e8..3bf97a1c276a 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -747,7 +747,8 @@ static int ieee80211_set_monitor_channel(struct wiphy *wiphy, ret = ieee80211_vif_use_channel(sdata, chandef, IEEE80211_CHANCTX_EXCLUSIVE); } - } else if (local->open_count == local->monitors) { + // Patch: Always allow channel change, even if a normal virtual interface is present + } else /*if (local->open_count == local->monitors)*/ { local->_oper_chandef = *chandef; ieee80211_hw_config(local, 0); } diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index 1b1f2d6cb3f4..23850c73e884 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -803,11 +803,19 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) /* * Packet injection may want to control the sequence - * number, if we have no matching interface then we - * neither assign one ourselves nor ask the driver to. + * number, so if an injected packet is found, skip + * renumbering it. Also make the packet NO_ACK to avoid + * excessive retries (ACKing and retrying should be + * handled by the injecting application). + * FIXME This may break hostapd and some other injectors. + * This should be done using a radiotap flag. */ - if (unlikely(info->control.vif->type == NL80211_IFTYPE_MONITOR)) + if (unlikely((info->flags & IEEE80211_TX_CTL_INJECTED) && + !(tx->sdata->u.mntr.flags & MONITOR_FLAG_COOK_FRAMES))) { + if (!ieee80211_has_morefrags(hdr->frame_control)) + info->flags |= IEEE80211_TX_CTL_NO_ACK; return TX_CONTINUE; + } if (unlikely(ieee80211_is_ctl(hdr->frame_control))) return TX_CONTINUE; @@ -1924,7 +1932,10 @@ void ieee80211_xmit(struct ieee80211_sub_if_data *sdata, } } - ieee80211_set_qos_hdr(sdata, skb); + // Don't overwrite QoS header in monitor mode + if (likely(info->control.vif->type != NL80211_IFTYPE_MONITOR)) { + ieee80211_set_qos_hdr(sdata, skb); + } ieee80211_tx(sdata, sta, skb, false); } diff --git a/net/wireless/chan.c b/net/wireless/chan.c index ef5016bf9549..05f3387fe213 100644 --- a/net/wireless/chan.c +++ b/net/wireless/chan.c @@ -982,8 +982,10 @@ int cfg80211_set_monitor_channel(struct cfg80211_registered_device *rdev, { if (!rdev->ops->set_monitor_channel) return -EOPNOTSUPP; - if (!cfg80211_has_monitors_only(rdev)) - return -EBUSY; + // Always allow user to change channel, even if there is another normal + // virtual interface using the device. + //if (!cfg80211_has_monitors_only(rdev)) + // return -EBUSY; return rdev_set_monitor_channel(rdev, chandef); }