From 3ce7f1e477c97099fdc905ae7c921e1790d52d0c Mon Sep 17 00:00:00 2001 From: Robert Marko Date: Thu, 12 Nov 2020 19:45:22 +0100 Subject: [PATCH 1/6] ipq40xx: add MikroTik hAP ac2 support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This adds support for the MikroTik RouterBOARD RBD52G-5HacD2HnD-TC (hAP ac²), a indoor dual band, dual-radio 802.11ac wireless AP with integrated omnidirectional antennae, USB port and five 10/100/1000 Mbps Ethernet ports. See https://mikrotik.com/product/hap_ac2 for more info. Specifications: - SoC: Qualcomm Atheros IPQ4018 - RAM: 128 MB - Storage: 16 MB NOR - Wireless: · Built-in IPQ4018 (SoC) 802.11b/g/n 2x2:2, 2.5 dBi antennae · Built-in IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 2.5 dBi antennae - Ethernet: Built-in IPQ4018 (SoC, QCA8075) , 5x 1000/100/10 port, passive PoE in - 1x USB Type A port Installation: Boot the initramfs image via TFTP and then flash the sysupgrade image using "sysupgrade -n" Signed-off-by: Robert Marko (cherry picked from commit faea7becafc634dc882f0ad8f9388862ccd5bd0d) [Compile Tested] Signed-off-by: Nick Hainke --- package/firmware/ipq-wifi/Makefile | 2 + .../ipq-wifi/board-mikrotik_hap-ac2.qca4019 | Bin 0 -> 24324 bytes .../ipq40xx/base-files/etc/board.d/02_network | 6 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 10 + .../base-files/lib/upgrade/platform.sh | 4 + .../arm/boot/dts/qcom-ipq4018-hap-ac2.dts | 272 ++++++++++++++++++ target/linux/ipq40xx/image/mikrotik.mk | 20 ++ .../901-arm-boot-add-dts-files.patch | 3 +- 8 files changed, 316 insertions(+), 1 deletion(-) create mode 100644 package/firmware/ipq-wifi/board-mikrotik_hap-ac2.qca4019 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-hap-ac2.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index e5f10a1f98..770360443a 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -43,6 +43,7 @@ ALLWIFIBOARDS:= \ linksys_ea8300 \ linksys_mr8300-v0 \ luma_wrtq-329acn \ + mikrotik_hap-ac2 \ mobipromo_cm520-79f \ nec_wg2600hp3 \ plasmacloud_pa1200 \ @@ -126,6 +127,7 @@ $(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300)) $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN)) +$(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) $(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) diff --git a/package/firmware/ipq-wifi/board-mikrotik_hap-ac2.qca4019 b/package/firmware/ipq-wifi/board-mikrotik_hap-ac2.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..73372c183e1c46d307e25ffb276c456cebddd2bb GIT binary patch literal 24324 zcmeHP|5p>)6(5i<*5b;91c8JhBm@Xe0tBiNP#{E3LPlXJB1CKXrjkIG7!bs;N6!`& zFd{1}OMnQ=!Ebz-Qsq$HRk79G?w+GL{R{l1zms-PPmeu4#lFcTkc0%2Wsv}LlQ-|a zH}B59?=vsVWbTK2oR`bbEs>_C$ob;J++qo&R;wW(nq+(nK?gvoI@`FvvbKs>rB?E* zYn2+lvSxpZrB&5Xsjb1Ase5?Mm0D%xCr$egDeJTiCCWN}ZEg|2vRbHC`+;LH!SR^M z{YF1OKmTn3fkF7OlbB#r0YN*0K@B7nywgCv9lTr#mz#zk3WCzo(*E`1k5Cph2zvYX z>)E!ljq1wEqrT_Pqk0HW&^sW```ov8E$#{hv%z0B!DF=POLex(h-ba2>e&5`i>grM{Ws2-KQ-d9?H43?G-?Q<-D_vUU$Fe=oCVASx zu4lHfdS8yzeOjPOIU1fld8@HwZw=>2l>F)V8AJY+L~TTcVd9u!-xX$KSmom(Wt+T? zeJDKV@o2;4%vx?a9sTZp>z9RB1dY+vUr)3c4qfH9FiyR^rD@AQ$&!U-ycla}FKCEA z5-z!WN7*m!`c(_P_VHBnaPoy1O<2XoLWzvlhCpEOFMhdm7aT_09Z8RlvHitgs{iXC zHYW#mQgRNStN;=v z5+yeXkW0f2Fb>^Y5+w%&$Oef3i2#WJi2#WJi2#WJi2#WJiNJaz;Aw`y({bxPA20o* z$7}U7uOSH3=ky~pubpe(eCEA@qDooJ9{8l@<#PGp!zB>xm$Z+O`@tQP4mUjl@1{ej z{sA>00|Bzj{sG&+1o9OS+r%FMSxp~W2L8B?%>3Z4PKf8kt!E)JcSNp^$j+ffC1uAe zYHIa8U-S=+jNO}@o_X~2&)@#=+WQ@Lc|2S4YLnHFB@c>HI&7IxOAZtjci6I^mi#9w z?674(y$8{)#pXwMlP#8wG96EH#)nH!oa*kobqAZB`>Q*Bqs-UaIH?O%n1L_^43r8< z79=o=paK+?KNo`)I_T zcTZyi{3;-bX64<(R^C0dJ;WvPp8cEUynDbu$hMVL@b2$8pUKtm?s5LRGw&Xc5%*yw zYgyg7=D!2py~q4_;y?uN9@pLS?yVk)%C%p>yZ2nER4Qa&7z_qvUqV7cATP?#%e!}; zMhQz)T3iK%Tw-o3ykR@Oa>X?ue1TbirIL-Ov4Z>~?4 zzQArl)str^_KbT%w?IaqwdPxV?b>thaebAvdk$KLKkR<`+V1OxgX-$@V&7-(G}U9M zF;&kncbMuhxlyQ(o|`rH>CTkri#T%+ura+(RW4%S|C2k^pO6TddrhsF!kDAyn{S$Q z*fFD6pN!2IM^viv!y?|?pNuzj>TySz;p>aZ7kC7HxHXSv3lbX9UuEz z->1?_B_bg(=+)KR3~m_`xDXh24b$k0ReQ|0O}*GTeVHl?o6`@fnxqF4BP<^3RL6*r zj01Q`MpGA7r<0V&nMY06F|GcH>HzkQ-k@rhN)zdGkBm1hA;sV!-5N*)9{Nqc$EtM) zq*1`M15@h6QabiWP-g zX(R~5pgUVG7jaFq*nnQEDwM_%9=IT+>!x#9nNBFBnm;$4#}q(=O^>m!0G2r-K!GCkt@NNIQK zd8TUD;qUI(-^jVhQAeKmen45YHz9sE1U(x*UoXuQ@S~$2-8<8l^BGr5Ir3s$*_(Zl zT_17c<#1z#cn^mW5%T1A{b{KbVTFe22M=FLZK56BdGPW5sv8*>n02&cPmT4*izK`_ zIACV9S$j~*N~A?~8453_H%F9*NFPr8?xyIo7&Yz0On+0g>;R7)7Bp^bZj_-y5sf}G ztnJQg */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MikroTik hAP ac2"; + compatible = "mikrotik,hap-ac2"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x08000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + tcsr@194b000 { + /* select hostmode */ + compatible = "qcom,tcsr"; + reg = <0x194b000 0x100>; + qcom,usb-hsphy-mode-select = ; + status = "okay"; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + usb3@8af8800 { + status = "okay"; + + dwc3@8a00000 { + phys = <&usb3_hs_phy>; + phy-names = "usb2-phy"; + }; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-switch@c000000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + + mode { + label = "mode"; + gpios = <&tlmm 5 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "green:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + led_user: user { + label = "green:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; + + enable-usb-power { + gpio-hog; + gpios = <2 GPIO_ACTIVE_HIGH>; + output-high; + line-name = "enable USB power"; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + read-only; + + hard_config { + read-only; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&usb3_hs_phy { + status = "okay"; +}; + +&mdio { + status = "okay"; +}; + +ðphy0 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy1 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy2 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy3 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +ðphy4 { + qcom,single-led-1000; + qcom,single-led-100; + qcom,single-led-10; +}; + +&wifi0 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-hAP-ac2"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-hAP-ac2"; +}; diff --git a/target/linux/ipq40xx/image/mikrotik.mk b/target/linux/ipq40xx/image/mikrotik.mk index e69de29bb2..9509ef8577 100644 --- a/target/linux/ipq40xx/image/mikrotik.mk +++ b/target/linux/ipq40xx/image/mikrotik.mk @@ -0,0 +1,20 @@ +define Device/mikrotik_nor + DEVICE_VENDOR := MikroTik + BLOCKSIZE := 64k + IMAGE_SIZE := 16128k + KERNEL_NAME := vmlinux + KERNEL := kernel-bin | append-dtb-elf + IMAGES = sysupgrade.bin + IMAGE/sysupgrade.bin := append-kernel | kernel2minor -s 1024 | \ + pad-to $$$$(BLOCKSIZE) | append-rootfs | pad-rootfs | \ + append-metadata | check-size +endef + +define Device/mikrotik_hap-ac2 + $(call Device/mikrotik_nor) + DEVICE_MODEL := hAP ac2 + SOC := qcom-ipq4018 + DEVICE_PACKAGES := ipq-wifi-mikrotik_hap-ac2 -kmod-ath10k-ct \ + kmod-ath10k-ct-smallbuffers +endef +TARGET_DEVICES += mikrotik_hap-ac2 diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index a3d3341587..6a421b9007 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,58 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,59 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -31,6 +31,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-gl-ap1300.dtb \ + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ ++ qcom-ipq4018-hap-ac2.dtb \ + qcom-ipq4018-nbg6617.dtb \ + qcom-ipq4019-oap100.dtb \ + qcom-ipq4018-pa1200.dtb \ From 701d25b551144cacd5d7fd8024fd2e6c7c264b70 Mon Sep 17 00:00:00 2001 From: Roger Pueyo Centelles Date: Fri, 23 Oct 2020 16:05:28 +0200 Subject: [PATCH 2/6] ipq40xx: add support for MikroTik SXTsq 5 ac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit adds support for the MikroTik SXTsq 5 ac (RBSXTsqG-5acD), an outdoor 802.11ac wireless CPE with one 10/100/1000 Mbps Ethernet port. Specifications: - SoC: Qualcomm Atheros IPQ4018 - RAM: 256 MB - Storage: 16 MB NOR - Wireless: IPQ4018 (SoC) 802.11a/n/ac 2x2:2, 16 dBi antennae - Ethernet: IPQ4018 (SoC) 1x 10/100/1000 port, 10-28 Vdc PoE in - 1x Ethernet LED (green) - 7x user-controllable LEDs · 1x power (blue) · 1x user (green) · 5x rssi (green) Note: Serial UART is probably available on the board, but it has not been tested. Flashing: Boot via TFTP the initramfs image. Then, upload a sysupgrade image via SSH and flash it normally. More info at the "Common procedures for MikroTik products" page https://openwrt.org/toh/mikrotik/common. Signed-off-by: Roger Pueyo Centelles (cherry picked from commit d1f1e5269ed992e6fc30d575b43b0913c9e58ca2) [Compile and Run Tested] Signed-off-by: Nick Hainke --- package/firmware/ipq-wifi/Makefile | 2 + .../board-mikrotik_sxtsq-5-ac.qca4019 | Bin 0 -> 12176 bytes .../ipq40xx/base-files/etc/board.d/01_leds | 8 + .../ipq40xx/base-files/etc/board.d/02_network | 5 + .../etc/hotplug.d/firmware/11-ath10k-caldata | 3 +- .../base-files/lib/upgrade/platform.sh | 3 +- .../arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts | 242 ++++++++++++++++++ target/linux/ipq40xx/image/mikrotik.mk | 8 + .../901-arm-boot-add-dts-files.patch | 3 +- 9 files changed, 271 insertions(+), 3 deletions(-) create mode 100644 package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 create mode 100644 target/linux/ipq40xx/files/arch/arm/boot/dts/qcom-ipq4018-sxtsq-5-ac.dts diff --git a/package/firmware/ipq-wifi/Makefile b/package/firmware/ipq-wifi/Makefile index 770360443a..e3b25bb556 100644 --- a/package/firmware/ipq-wifi/Makefile +++ b/package/firmware/ipq-wifi/Makefile @@ -44,6 +44,7 @@ ALLWIFIBOARDS:= \ linksys_mr8300-v0 \ luma_wrtq-329acn \ mikrotik_hap-ac2 \ + mikrotik_sxtsq-5-ac \ mobipromo_cm520-79f \ nec_wg2600hp3 \ plasmacloud_pa1200 \ @@ -128,6 +129,7 @@ $(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300)) $(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300)) $(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN)) $(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2)) +$(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac)) $(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F)) $(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3)) $(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200)) diff --git a/package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 b/package/firmware/ipq-wifi/board-mikrotik_sxtsq-5-ac.qca4019 new file mode 100644 index 0000000000000000000000000000000000000000..97f982637a8b10fd5bf2e6fb3cfbb3bf98cca1e1 GIT binary patch literal 12176 zcmeHN|5Fp!7Qa{!^#x_~MIZ@FNI()M31;C*3IRe0bPHRc78TG(0a3}4ln{_2@r_JN z-$37rRw{+m6=bxf%51GN)PAw__1kM_bjNvrK>vXEgPC#Oyy-6w-ra-{z9dSf)-TMS zPZOKCc{Kt}EQCXQNbl%$$>=cMZqL3_?%K^s%fglpzx;6AQU%iiqjg?_1&Eg61 zy_FDz^$j&~?b@|a<}fzyo(WPIr*)W5Kw5`e(1i~OVi8{BQ3{Vua3*4uf}y;|BfulT zBe3xhXl$(CUsFSr8G%q3ALrknQIoDxDpTM<9Q)tj=I13)^V>LMvLJR-boBpxu2JCZ z+3rSvd|ce72mbh@M+0k0rSO^Rv6FM!IW!Gdb)FiU=9o*MUnFg2rdpkrrc|KMrWOhe z1VxZyv=}j<2E=*1_f-Gj(D3M51(+7;>xdK~D%1<_2oWhN)k}$ZG#*JrEvQ9rxnn`f z(Q1sTB?dy*Ib|VKq5j#_eF>d zmFZEI<2F`Jw;A&)mK19Hgh0bNcTjqPCTq zn7Ms7_;#^U3-x(fZu1VZc7~u0l-xVOwlNhnMkUY9(j)GUx-w(>+zsY3D9GY4r4mBq}^6C_zzY1GbrPM>o->MTYD7eJ3?WB{*+eTO+l zS5pPvadwcg)BD^y=1XdXbm3Mb1_OrO_CUbJu?!7>Zl@V1wU^xEy}}MNJyb1eV&cBX!c#E&26nq^G>p77#FpVEM&f-#>j3QSIg#Z(dT_7rEn!( z^r&HmQTA=-u)7eK!q5T6=CiFiN?AagSyf@Q$#3Ortvw zPx6kj{Y;D7geSp5#@xs2DvTO-mhn(7vI6e9lVyVg7w{(q^^=mq$&4RLTFCRHw;8q<=sQYfXr@lzHOOhCK^Zd!SatoFv zOFT2Nf5_0QAa_*$^ojkPxi8(3)bO*%R-K!%D*=FS#(V8}iC&kSd~2#>#Qc`VCEWM@ zRoie;pUR%t@WXg#qh(LJJW=rV75gz9N0sp+>ch%+3|*1~aiw2;(tIxOl%h>?@HTBf zRBhF!A<;9F-L6txsg_9J9jp3VPIqFR0Ka+d_4CHJQXG5Sg~v0G zi7GytYWL*#t6buSkIy)pt@$dsTs z)6?LON|~xqrKT!V_s47ji~Y(FVNcYQfF&R)!k4g@kSbv=mWvb#w*(06Z9X@749;zhM;!PznJsL%FSA(`N++kolsr*v}~)nJ@bIQhc-l z#P-D~{Jd>Z#wbkC-x902XNl4L3o<9~apR}FJwE+I5Lmb_5JyM1fZEZiAEP!!Z}|Yy zB}jpgTabQ_EwIiXC5c-2%XMPrmvAy;S9;phWPj(*->dU?=ZNZ>+Cz;kt<>4~M=wlV zo|?WsbL;j$e*EQb$UzJn zvGLJ;Zf=8(Rp@$p#+CaUjt-4n{D_&I`)4?PW1$k */ + +#include "qcom-ipq4019.dtsi" +#include +#include +#include + +/ { + model = "MikroTik SXTsq 5 ac (RBSXTsqG-5acD)"; + compatible = "mikrotik,sxtsq-5-ac"; + + memory { + device_type = "memory"; + reg = <0x80000000 0x10000000>; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + aliases { + led-boot = &led_user; + led-failsafe = &led_user; + led-running = &led_user; + led-upgrade = &led_user; + }; + + soc { + rng@22000 { + status = "okay"; + }; + + mdio@90000 { + status = "okay"; + }; + + counter@4a1000 { + compatible = "qcom,qca-gcnt"; + reg = <0x4a1000 0x4>; + }; + + tcsr@1949000 { + compatible = "qcom,tcsr"; + reg = <0x1949000 0x100>; + qcom,wifi_glb_cfg = ; + }; + + ess_tcsr@1953000 { + compatible = "qcom,tcsr"; + reg = <0x1953000 0x1000>; + qcom,ess-interface-select = ; + }; + + tcsr@1957000 { + compatible = "qcom,tcsr"; + reg = <0x1957000 0x100>; + qcom,wifi_noc_memtype_m0_m2 = ; + }; + + crypto@8e3a000 { + status = "okay"; + }; + + watchdog@b017000 { + status = "okay"; + }; + + ess-psgmii@98000 { + status = "okay"; + }; + + edma@c080000 { + status = "okay"; + phy-mode = "rgmii"; + qcom,num_gmac = <1>; + qcom,single-phy; + }; + }; + + keys { + compatible = "gpio-keys"; + + reset { + label = "reset"; + gpios = <&tlmm 63 GPIO_ACTIVE_LOW>; + linux,code = ; + }; + }; + + leds { + compatible = "gpio-leds"; + + power { + label = "blue:power"; + gpios = <&tlmm 0 GPIO_ACTIVE_HIGH>; + default-state = "keep"; + panic-indicator; + }; + + led_user: user { + label = "green:user"; + gpios = <&tlmm 3 GPIO_ACTIVE_HIGH>; + }; + + rssilow { + label = "green:rssilow"; + gpios = <&tlmm 58 GPIO_ACTIVE_HIGH>; + }; + + rssimediumlow { + label = "green:rssimediumlow"; + gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>; + }; + + rssimedium { + label = "green:rssimedium"; + gpios = <&tlmm 2 GPIO_ACTIVE_HIGH>; + }; + + rssimediumhigh { + label = "green:rssimediumhigh"; + gpios = <&tlmm 4 GPIO_ACTIVE_HIGH>; + }; + + rssihigh { + label = "green:rssihigh"; + gpios = <&tlmm 5 GPIO_ACTIVE_HIGH>; + }; + }; +}; + +&tlmm { + serial_pins: serial_pinmux { + mux { + pins = "gpio60", "gpio61"; + function = "blsp_uart0"; + bias-disable; + }; + }; + + spi_0_pins: spi_0_pinmux { + pin { + function = "blsp_spi0"; + pins = "gpio55", "gpio56", "gpio57"; + drive-strength = <2>; + bias-disable; + }; + pin_cs { + function = "gpio"; + pins = "gpio54"; + drive-strength = <2>; + bias-disable; + output-high; + }; + }; +}; + +&blsp_dma { + status = "okay"; +}; + +&blsp1_spi1 { + status = "okay"; + + pinctrl-0 = <&spi_0_pins>; + pinctrl-names = "default"; + cs-gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; + + flash@0 { + reg = <0>; + compatible = "jedec,spi-nor"; + spi-max-frequency = <40000000>; + + partitions { + compatible = "fixed-partitions"; + #address-cells = <1>; + #size-cells = <1>; + + partition@0 { + label = "Qualcomm"; + reg = <0x0 0x80000>; + read-only; + }; + + partition@80000 { + compatible = "mikrotik,routerboot-partitions"; + #address-cells = <1>; + #size-cells = <1>; + label = "RouterBoot"; + reg = <0x80000 0x80000>; + read-only; + + hard_config { + read-only; + }; + + dtb_config { + read-only; + }; + + soft_config { + }; + }; + + partition@100000 { + compatible = "mikrotik,minor"; + label = "firmware"; + reg = <0x100000 0xf00000>; + }; + }; + }; +}; + +&blsp1_uart1 { + status = "okay"; + + pinctrl-0 = <&serial_pins>; + pinctrl-names = "default"; +}; + +&cryptobam { + status = "okay"; +}; + +&wifi1 { + status = "okay"; + + qcom,ath10k-calibration-variant = "MikroTik-SXTsq-5-ac"; +}; + +&gmac0 { + qcom,phy_mdio_addr = <4>; + qcom,poll_required = <1>; + qcom,forced_speed = <1000>; + qcom,forced_duplex = <1>; + vlan_tag = <1 0x20>; +}; + +&mdio { + status = "okay"; +}; diff --git a/target/linux/ipq40xx/image/mikrotik.mk b/target/linux/ipq40xx/image/mikrotik.mk index 9509ef8577..7c2fa52738 100644 --- a/target/linux/ipq40xx/image/mikrotik.mk +++ b/target/linux/ipq40xx/image/mikrotik.mk @@ -18,3 +18,11 @@ define Device/mikrotik_hap-ac2 kmod-ath10k-ct-smallbuffers endef TARGET_DEVICES += mikrotik_hap-ac2 + +define Device/mikrotik_sxtsq-5-ac + $(call Device/mikrotik_nor) + DEVICE_MODEL := SXTsq 5 ac (RBSXTsqG-5acD) + SOC := qcom-ipq4018 + DEVICE_PACKAGES := ipq-wifi-mikrotik_sxtsq-5-ac rssileds +endef +TARGET_DEVICES += mikrotik_sxtsq-5-ac diff --git a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch index 6a421b9007..6b7c68bf63 100644 --- a/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch +++ b/target/linux/ipq40xx/patches-5.4/901-arm-boot-add-dts-files.patch @@ -10,7 +10,7 @@ Signed-off-by: John Crispin --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile -@@ -837,11 +837,59 @@ dtb-$(CONFIG_ARCH_QCOM) += \ +@@ -837,11 +837,60 @@ dtb-$(CONFIG_ARCH_QCOM) += \ qcom-apq8074-dragonboard.dtb \ qcom-apq8084-ifc6540.dtb \ qcom-apq8084-mtp.dtb \ @@ -32,6 +32,7 @@ Signed-off-by: John Crispin + qcom-ipq4018-jalapeno.dtb \ + qcom-ipq4018-meshpoint-one.dtb \ + qcom-ipq4018-hap-ac2.dtb \ ++ qcom-ipq4018-sxtsq-5-ac.dtb \ + qcom-ipq4018-nbg6617.dtb \ + qcom-ipq4019-oap100.dtb \ + qcom-ipq4018-pa1200.dtb \ From a641502849091feebf5d41c2eaa9ac89e59b8127 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 2 May 2021 17:42:19 +0200 Subject: [PATCH 3/6] busybox: backport fix for CVE-2021-28831 This backports a fix for the low priority CVE-2021-28831: decompress_gunzip.c in BusyBox through 1.32.1 mishandles the error bit on the huft_build result pointer, with a resultant invalid free or segmentation fault, via malformed gzip data. Signed-off-by: Hauke Mehrtens (cherry picked from commit 13397b2b95b4800fb0a29c3d483fa280d10f0eb0) --- package/utils/busybox/Makefile | 2 +- .../patches/005-backport-CVE-2021-28831.patch | 52 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 package/utils/busybox/patches/005-backport-CVE-2021-28831.patch diff --git a/package/utils/busybox/Makefile b/package/utils/busybox/Makefile index 9df358ef78..58bc1e6795 100644 --- a/package/utils/busybox/Makefile +++ b/package/utils/busybox/Makefile @@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=busybox PKG_VERSION:=1.33.0 -PKG_RELEASE:=2 +PKG_RELEASE:=3 PKG_FLAGS:=essential PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 diff --git a/package/utils/busybox/patches/005-backport-CVE-2021-28831.patch b/package/utils/busybox/patches/005-backport-CVE-2021-28831.patch new file mode 100644 index 0000000000..7637679a69 --- /dev/null +++ b/package/utils/busybox/patches/005-backport-CVE-2021-28831.patch @@ -0,0 +1,52 @@ +From f25d254dfd4243698c31a4f3153d4ac72aa9e9bd Mon Sep 17 00:00:00 2001 +From: Samuel Sapalski +Date: Wed, 3 Mar 2021 16:31:22 +0100 +Subject: decompress_gunzip: Fix DoS if gzip is corrupt + +On certain corrupt gzip files, huft_build will set the error bit on +the result pointer. If afterwards abort_unzip is called huft_free +might run into a segmentation fault or an invalid pointer to +free(p). + +In order to mitigate this, we check in huft_free if the error bit +is set and clear it before the linked list is freed. + +Signed-off-by: Samuel Sapalski +Signed-off-by: Peter Kaestle +Signed-off-by: Denys Vlasenko +--- + archival/libarchive/decompress_gunzip.c | 12 ++++++++++-- + 1 file changed, 10 insertions(+), 2 deletions(-) + +--- a/archival/libarchive/decompress_gunzip.c ++++ b/archival/libarchive/decompress_gunzip.c +@@ -220,10 +220,20 @@ static const uint8_t border[] ALIGN1 = { + * each table. + * t: table to free + */ ++#define BAD_HUFT(p) ((uintptr_t)(p) & 1) ++#define ERR_RET ((huft_t*)(uintptr_t)1) + static void huft_free(huft_t *p) + { + huft_t *q; + ++ /* ++ * If 'p' has the error bit set we have to clear it, otherwise we might run ++ * into a segmentation fault or an invalid pointer to free(p) ++ */ ++ if (BAD_HUFT(p)) { ++ p = (huft_t*)((uintptr_t)(p) ^ (uintptr_t)(ERR_RET)); ++ } ++ + /* Go through linked list, freeing from the malloced (t[-1]) address. */ + while (p) { + q = (--p)->v.t; +@@ -289,8 +299,6 @@ static unsigned fill_bitbuffer(STATE_PAR + * or a valid pointer to a Huffman table, ORed with 0x1 if incompete table + * is given: "fixed inflate" decoder feeds us such data. + */ +-#define BAD_HUFT(p) ((uintptr_t)(p) & 1) +-#define ERR_RET ((huft_t*)(uintptr_t)1) + static huft_t* huft_build(const unsigned *b, const unsigned n, + const unsigned s, const struct cp_ext *cp_ext, + unsigned *m) From ce41fc38ba65013a0352e29794823f1380c9c93b Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 2 May 2021 18:45:40 +0200 Subject: [PATCH 4/6] mac80211: Update to version 5.10.34-1 The removed patches were applied upstream and are not needed anymore. Signed-off-by: Hauke Mehrtens (cherry picked from commit 17ac9849d3ff687c8c14d63e46f3e205adc22a3e) --- package/kernel/mac80211/Makefile | 6 +- .../ath/500-ath9k_eeprom_debugfs.patch | 4 +- .../ath/512-ath9k_channelbw_debugfs.patch | 4 +- .../patches/ath/530-ath9k_extra_leds.patch | 10 +-- .../patches/ath/542-ath9k_debugfs_diag.patch | 4 +- .../ath/548-ath9k_enable_gpio_chip.patch | 4 +- .../ath/549-ath9k_enable_gpio_buttons.patch | 2 +- .../ath/551-ath9k_ubnt_uap_plus_hsr.patch | 2 +- .../mac80211/patches/ath/552-ahb_of.patch | 2 +- ...itting-to-stations-in-dynamic-SMPS-m.patch | 49 --------------- .../ath/930-ath10k_add_tpt_led_trigger.patch | 4 +- ...rolling-support-for-various-chipsets.patch | 2 +- ...75-ath10k-use-tpt-trigger-by-default.patch | 2 +- .../100-remove-cryptoapi-dependencies.patch | 7 ++- .../subsys/150-disable_addr_notifier.patch | 6 +- .../mac80211/patches/subsys/210-ap_scan.patch | 2 +- ...ort-immediate-reconnect-request-hint.patch | 14 ++--- ...-driver-based-disconnect-with-reconn.patch | 12 ++-- .../370-mac80211-fix-TXQ-AC-confusion.patch | 61 ------------------- ...c80211-fix-time-is-after-bug-in-mlme.patch | 31 ---------- .../500-mac80211_configure_antenna_gain.patch | 8 +-- 21 files changed, 48 insertions(+), 188 deletions(-) delete mode 100644 package/kernel/mac80211/patches/ath/560-ath9k-fix-transmitting-to-stations-in-dynamic-SMPS-m.patch delete mode 100644 package/kernel/mac80211/patches/subsys/370-mac80211-fix-TXQ-AC-confusion.patch delete mode 100644 package/kernel/mac80211/patches/subsys/374-mac80211-fix-time-is-after-bug-in-mlme.patch diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile index f6ad06452f..19cda3696c 100644 --- a/package/kernel/mac80211/Makefile +++ b/package/kernel/mac80211/Makefile @@ -10,10 +10,10 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=5.10.16-1 +PKG_VERSION:=5.10.34-1 PKG_RELEASE:=1 -PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.16/ -PKG_HASH:=12856db780c5023edc47e2d18486eb3346bb7c82f1f2fc48deb3b163142f7d2d +PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.10.34/ +PKG_HASH:=03c4ca6bf47d4e50b91b61bc2943a98c788439e56ce2b4080bc4c94141c2c15b PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION) diff --git a/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch b/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch index 786a3ed3fb..48ccc81308 100644 --- a/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch +++ b/package/kernel/mac80211/patches/ath/500-ath9k_eeprom_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1361,6 +1361,53 @@ void ath9k_deinit_debug(struct ath_softc +@@ -1364,6 +1364,53 @@ void ath9k_deinit_debug(struct ath_softc ath9k_cmn_spectral_deinit_debug(&sc->spec_priv); } @@ -54,7 +54,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1380,6 +1427,8 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1383,6 +1430,8 @@ int ath9k_init_debug(struct ath_hw *ah) ath9k_tx99_init_debug(sc); ath9k_cmn_spectral_init_debug(&sc->spec_priv, sc->debug.debugfs_phy); diff --git a/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch b/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch index 80e33182f7..126d1d5c62 100644 --- a/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch +++ b/package/kernel/mac80211/patches/ath/512-ath9k_channelbw_debugfs.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1408,6 +1408,52 @@ static const struct file_operations fops +@@ -1411,6 +1411,52 @@ static const struct file_operations fops .owner = THIS_MODULE }; @@ -53,7 +53,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1429,6 +1475,8 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1432,6 +1478,8 @@ int ath9k_init_debug(struct ath_hw *ah) debugfs_create_file("eeprom", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_eeprom); diff --git a/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch b/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch index 1f19483064..5fd5c73a2f 100644 --- a/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch +++ b/package/kernel/mac80211/patches/ath/530-ath9k_extra_leds.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -843,6 +843,9 @@ static inline int ath9k_dump_btcoex(stru +@@ -844,6 +844,9 @@ static inline int ath9k_dump_btcoex(stru #ifdef CPTCFG_MAC80211_LEDS void ath_init_leds(struct ath_softc *sc); void ath_deinit_leds(struct ath_softc *sc); @@ -10,7 +10,7 @@ #else static inline void ath_init_leds(struct ath_softc *sc) { -@@ -979,6 +982,13 @@ void ath_ant_comb_scan(struct ath_softc +@@ -980,6 +983,13 @@ void ath_ant_comb_scan(struct ath_softc #define ATH9K_NUM_CHANCTX 2 /* supports 2 operating channels */ @@ -24,7 +24,7 @@ struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1032,9 +1042,8 @@ struct ath_softc { +@@ -1033,9 +1043,8 @@ struct ath_softc { spinlock_t chan_lock; #ifdef CPTCFG_MAC80211_LEDS @@ -192,7 +192,7 @@ #endif --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1453,6 +1453,61 @@ static const struct file_operations fops +@@ -1456,6 +1456,61 @@ static const struct file_operations fops .llseek = default_llseek, }; @@ -254,7 +254,7 @@ int ath9k_init_debug(struct ath_hw *ah) { -@@ -1477,6 +1532,10 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1480,6 +1535,10 @@ int ath9k_init_debug(struct ath_hw *ah) &fops_eeprom); debugfs_create_file("chanbw", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, sc, &fops_chanbw); diff --git a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch index 76cb63a5c8..f93a6fe5cd 100644 --- a/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch +++ b/package/kernel/mac80211/patches/ath/542-ath9k_debugfs_diag.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -1509,6 +1509,50 @@ static const struct file_operations fops +@@ -1512,6 +1512,50 @@ static const struct file_operations fops #endif @@ -51,7 +51,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -1536,6 +1580,8 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -1539,6 +1583,8 @@ int ath9k_init_debug(struct ath_hw *ah) debugfs_create_file("gpio_led", S_IWUSR, sc->debug.debugfs_phy, sc, &fops_gpio_led); #endif diff --git a/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch b/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch index 78206d2860..88198a4562 100644 --- a/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch +++ b/package/kernel/mac80211/patches/ath/548-ath9k_enable_gpio_chip.patch @@ -18,7 +18,7 @@ Signed-off-by: Felix Fietkau #include "common.h" #include "debug.h" -@@ -989,6 +990,14 @@ struct ath_led { +@@ -990,6 +991,14 @@ struct ath_led { struct led_classdev cdev; }; @@ -33,7 +33,7 @@ Signed-off-by: Felix Fietkau struct ath_softc { struct ieee80211_hw *hw; struct device *dev; -@@ -1044,6 +1053,9 @@ struct ath_softc { +@@ -1045,6 +1054,9 @@ struct ath_softc { #ifdef CPTCFG_MAC80211_LEDS const char *led_default_trigger; struct list_head leds; diff --git a/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch b/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch index 716e09f351..83076b8ae4 100644 --- a/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch +++ b/package/kernel/mac80211/patches/ath/549-ath9k_enable_gpio_buttons.patch @@ -10,7 +10,7 @@ Signed-off-by: Felix Fietkau --- --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -1055,6 +1055,7 @@ struct ath_softc { +@@ -1056,6 +1056,7 @@ struct ath_softc { struct list_head leds; #ifdef CONFIG_GPIOLIB struct ath9k_gpio_chip *gpiochip; diff --git a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch index 7e3e1236f7..acb9ad443c 100644 --- a/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch +++ b/package/kernel/mac80211/patches/ath/551-ath9k_ubnt_uap_plus_hsr.patch @@ -381,7 +381,7 @@ ATH9K_HTC_DEBUGFS= --- a/drivers/net/wireless/ath/ath9k/Kconfig +++ b/drivers/net/wireless/ath/ath9k/Kconfig -@@ -60,6 +60,19 @@ config ATH9K_AHB +@@ -58,6 +58,19 @@ config ATH9K_AHB Say Y, if you have a SoC with a compatible built-in wireless MAC. Say N if unsure. diff --git a/package/kernel/mac80211/patches/ath/552-ahb_of.patch b/package/kernel/mac80211/patches/ath/552-ahb_of.patch index 2552bbc7a1..8fd6e4409b 100644 --- a/package/kernel/mac80211/patches/ath/552-ahb_of.patch +++ b/package/kernel/mac80211/patches/ath/552-ahb_of.patch @@ -325,7 +325,7 @@ #include "common.h" #include "debug.h" -@@ -1011,6 +1012,9 @@ struct ath_softc { +@@ -1012,6 +1013,9 @@ struct ath_softc { struct ath_hw *sc_ah; void __iomem *mem; int irq; diff --git a/package/kernel/mac80211/patches/ath/560-ath9k-fix-transmitting-to-stations-in-dynamic-SMPS-m.patch b/package/kernel/mac80211/patches/ath/560-ath9k-fix-transmitting-to-stations-in-dynamic-SMPS-m.patch deleted file mode 100644 index 68f3a31548..0000000000 --- a/package/kernel/mac80211/patches/ath/560-ath9k-fix-transmitting-to-stations-in-dynamic-SMPS-m.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Felix Fietkau -Date: Sun, 14 Feb 2021 19:45:50 +0100 -Subject: [PATCH] ath9k: fix transmitting to stations in dynamic SMPS mode - -When transmitting to a receiver in dynamic SMPS mode, all transmissions that -use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to -give the receiver's extra chains some time to wake up. -This fixes the tx rate getting stuck at <= MCS7 for some clients, especially -Intel ones, which make aggressive use of SMPS. - -Cc: stable@vger.kernel.org -Reported-by: Martin Kennedy -Signed-off-by: Felix Fietkau ---- - ---- a/drivers/net/wireless/ath/ath9k/ath9k.h -+++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -179,7 +179,8 @@ struct ath_frame_info { - s8 txq; - u8 keyix; - u8 rtscts_rate; -- u8 retries : 7; -+ u8 retries : 6; -+ u8 dyn_smps : 1; - u8 baw_tracked : 1; - u8 tx_power; - enum ath9k_key_type keytype:2; ---- a/drivers/net/wireless/ath/ath9k/xmit.c -+++ b/drivers/net/wireless/ath/ath9k/xmit.c -@@ -1271,6 +1271,11 @@ static void ath_buf_set_rate(struct ath_ - is_40, is_sgi, is_sp); - if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC)) - info->rates[i].RateFlags |= ATH9K_RATESERIES_STBC; -+ if (rix >= 8 && fi->dyn_smps) { -+ info->rates[i].RateFlags |= -+ ATH9K_RATESERIES_RTS_CTS; -+ info->flags |= ATH9K_TXDESC_CTSENA; -+ } - - info->txpower[i] = ath_get_rate_txpower(sc, bf, rix, - is_40, false); -@@ -2114,6 +2119,7 @@ static void setup_frame_info(struct ieee - fi->keyix = an->ps_key; - else - fi->keyix = ATH9K_TXKEYIX_INVALID; -+ fi->dyn_smps = sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC; - fi->keytype = keytype; - fi->framelen = framelen; - fi->tx_power = txpower; diff --git a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch index 1fedd337ac..74b3292e0c 100644 --- a/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch +++ b/package/kernel/mac80211/patches/ath/930-ath10k_add_tpt_led_trigger.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -9713,6 +9713,21 @@ static int ath10k_mac_init_rd(struct ath +@@ -9708,6 +9708,21 @@ static int ath10k_mac_init_rd(struct ath return 0; } @@ -22,7 +22,7 @@ int ath10k_mac_register(struct ath10k *ar) { static const u32 cipher_suites[] = { -@@ -10062,6 +10077,12 @@ int ath10k_mac_register(struct ath10k *a +@@ -10057,6 +10072,12 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; diff --git a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index ab7cb669bb..ac46e35b67 100644 --- a/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/mac80211/patches/ath/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -456,7 +456,7 @@ v13: { --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c -@@ -4585,6 +4585,8 @@ static const struct wmi_ops wmi_tlv_ops +@@ -4591,6 +4591,8 @@ static const struct wmi_ops wmi_tlv_ops .gen_echo = ath10k_wmi_tlv_op_gen_echo, .gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf, .gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable, diff --git a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch index f7569df33c..6da7bfa725 100644 --- a/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/mac80211/patches/ath/975-ath10k-use-tpt-trigger-by-default.patch @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c -@@ -10079,7 +10079,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -10074,7 +10074,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS diff --git a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch index 7b036e4e4c..ec6ecbcfce 100644 --- a/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch +++ b/package/kernel/mac80211/patches/subsys/100-remove-cryptoapi-dependencies.patch @@ -20,7 +20,7 @@ ethtool.o \ --- a/net/mac80211/aead_api.c +++ /dev/null -@@ -1,112 +0,0 @@ +@@ -1,113 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-only -/* - * Copyright 2003-2004, Instant802 Networks, Inc. @@ -46,6 +46,7 @@ - struct aead_request *aead_req; - int reqsize = sizeof(*aead_req) + crypto_aead_reqsize(tfm); - u8 *__aad; +- int ret; - - aead_req = kzalloc(reqsize + aad_len, GFP_ATOMIC); - if (!aead_req) @@ -63,10 +64,10 @@ - aead_request_set_crypt(aead_req, sg, sg, data_len, b_0); - aead_request_set_ad(aead_req, sg[0].length); - -- crypto_aead_encrypt(aead_req); +- ret = crypto_aead_encrypt(aead_req); - kfree_sensitive(aead_req); - -- return 0; +- return ret; -} - -int aead_decrypt(struct crypto_aead *tfm, u8 *b_0, u8 *aad, size_t aad_len, diff --git a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch index 8a717558a7..9589235f71 100644 --- a/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch +++ b/package/kernel/mac80211/patches/subsys/150-disable_addr_notifier.patch @@ -18,7 +18,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, unsigned long data, void *arg) { -@@ -1301,14 +1301,14 @@ int ieee80211_register_hw(struct ieee802 +@@ -1312,14 +1312,14 @@ int ieee80211_register_hw(struct ieee802 rtnl_unlock(); @@ -35,7 +35,7 @@ local->ifa6_notifier.notifier_call = ieee80211_ifa6_changed; result = register_inet6addr_notifier(&local->ifa6_notifier); if (result) -@@ -1317,13 +1317,13 @@ int ieee80211_register_hw(struct ieee802 +@@ -1328,13 +1328,13 @@ int ieee80211_register_hw(struct ieee802 return 0; @@ -52,7 +52,7 @@ fail_ifa: #endif wiphy_unregister(local->hw.wiphy); -@@ -1351,10 +1351,10 @@ void ieee80211_unregister_hw(struct ieee +@@ -1362,10 +1362,10 @@ void ieee80211_unregister_hw(struct ieee tasklet_kill(&local->tx_pending_tasklet); tasklet_kill(&local->tasklet); diff --git a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch index 80f995737b..ee49942459 100644 --- a/package/kernel/mac80211/patches/subsys/210-ap_scan.patch +++ b/package/kernel/mac80211/patches/subsys/210-ap_scan.patch @@ -1,6 +1,6 @@ --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2442,7 +2442,7 @@ static int ieee80211_scan(struct wiphy * +@@ -2444,7 +2444,7 @@ static int ieee80211_scan(struct wiphy * * the frames sent while scanning on other channel will be * lost) */ diff --git a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch index d3f4aa7972..cbc2a2e03d 100644 --- a/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch +++ b/package/kernel/mac80211/patches/subsys/300-cfg80211-support-immediate-reconnect-request-hint.patch @@ -64,7 +64,7 @@ Signed-off-by: Johannes Berg else cfg80211_rx_mlme_mgmt(sdata->dev, buf, len); -@@ -4716,7 +4716,8 @@ void ieee80211_mgd_quiesce(struct ieee80 +@@ -4719,7 +4719,8 @@ void ieee80211_mgd_quiesce(struct ieee80 if (ifmgd->auth_data) ieee80211_destroy_auth_data(sdata, false); cfg80211_tx_mlme_mgmt(sdata->dev, frame_buf, @@ -166,7 +166,7 @@ Signed-off-by: Johannes Berg --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -732,6 +732,7 @@ static const struct nla_policy nl80211_p +@@ -736,6 +736,7 @@ static const struct nla_policy nl80211_p NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), [NL80211_ATTR_S1G_CAPABILITY_MASK] = NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), @@ -174,7 +174,7 @@ Signed-off-by: Johannes Berg }; /* policy for the key attributes */ -@@ -15899,7 +15900,7 @@ static void nl80211_send_mlme_event(stru +@@ -15903,7 +15904,7 @@ static void nl80211_send_mlme_event(stru const u8 *buf, size_t len, enum nl80211_commands cmd, gfp_t gfp, int uapsd_queues, const u8 *req_ies, @@ -183,7 +183,7 @@ Signed-off-by: Johannes Berg { struct sk_buff *msg; void *hdr; -@@ -15921,6 +15922,9 @@ static void nl80211_send_mlme_event(stru +@@ -15925,6 +15926,9 @@ static void nl80211_send_mlme_event(stru nla_put(msg, NL80211_ATTR_REQ_IE, req_ies_len, req_ies))) goto nla_put_failure; @@ -193,7 +193,7 @@ Signed-off-by: Johannes Berg if (uapsd_queues >= 0) { struct nlattr *nla_wmm = nla_nest_start_noflag(msg, NL80211_ATTR_STA_WME); -@@ -15949,7 +15953,8 @@ void nl80211_send_rx_auth(struct cfg8021 +@@ -15953,7 +15957,8 @@ void nl80211_send_rx_auth(struct cfg8021 size_t len, gfp_t gfp) { nl80211_send_mlme_event(rdev, netdev, buf, len, @@ -203,7 +203,7 @@ Signed-off-by: Johannes Berg } void nl80211_send_rx_assoc(struct cfg80211_registered_device *rdev, -@@ -15959,23 +15964,25 @@ void nl80211_send_rx_assoc(struct cfg802 +@@ -15963,23 +15968,25 @@ void nl80211_send_rx_assoc(struct cfg802 { nl80211_send_mlme_event(rdev, netdev, buf, len, NL80211_CMD_ASSOCIATE, gfp, uapsd_queues, @@ -234,7 +234,7 @@ Signed-off-by: Johannes Berg } void cfg80211_rx_unprot_mlme_mgmt(struct net_device *dev, const u8 *buf, -@@ -16006,7 +16013,7 @@ void cfg80211_rx_unprot_mlme_mgmt(struct +@@ -16010,7 +16017,7 @@ void cfg80211_rx_unprot_mlme_mgmt(struct trace_cfg80211_rx_unprot_mlme_mgmt(dev, buf, len); nl80211_send_mlme_event(rdev, dev, buf, len, cmd, GFP_ATOMIC, -1, diff --git a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch index 8f948c140e..59a154a543 100644 --- a/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch +++ b/package/kernel/mac80211/patches/subsys/301-mac80211-support-driver-based-disconnect-with-reconn.patch @@ -174,7 +174,7 @@ Signed-off-by: Johannes Berg } static int ieee80211_auth(struct ieee80211_sub_if_data *sdata) -@@ -5431,7 +5462,8 @@ int ieee80211_mgd_auth(struct ieee80211_ +@@ -5434,7 +5465,8 @@ int ieee80211_mgd_auth(struct ieee80211_ ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -184,7 +184,7 @@ Signed-off-by: Johannes Berg } sdata_info(sdata, "authenticate with %pM\n", req->bss->bssid); -@@ -5503,7 +5535,8 @@ int ieee80211_mgd_assoc(struct ieee80211 +@@ -5506,7 +5538,8 @@ int ieee80211_mgd_assoc(struct ieee80211 ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -194,7 +194,7 @@ Signed-off-by: Johannes Berg } if (ifmgd->auth_data && !ifmgd->auth_data->done) { -@@ -5802,7 +5835,7 @@ int ieee80211_mgd_deauth(struct ieee8021 +@@ -5805,7 +5838,7 @@ int ieee80211_mgd_deauth(struct ieee8021 ieee80211_destroy_auth_data(sdata, false); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -203,7 +203,7 @@ Signed-off-by: Johannes Berg return 0; } -@@ -5822,7 +5855,7 @@ int ieee80211_mgd_deauth(struct ieee8021 +@@ -5825,7 +5858,7 @@ int ieee80211_mgd_deauth(struct ieee8021 ieee80211_destroy_assoc_data(sdata, false, true); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -212,7 +212,7 @@ Signed-off-by: Johannes Berg return 0; } -@@ -5837,7 +5870,7 @@ int ieee80211_mgd_deauth(struct ieee8021 +@@ -5840,7 +5873,7 @@ int ieee80211_mgd_deauth(struct ieee8021 req->reason_code, tx, frame_buf); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, @@ -221,7 +221,7 @@ Signed-off-by: Johannes Berg return 0; } -@@ -5870,7 +5903,7 @@ int ieee80211_mgd_disassoc(struct ieee80 +@@ -5873,7 +5906,7 @@ int ieee80211_mgd_disassoc(struct ieee80 frame_buf); ieee80211_report_disconnect(sdata, frame_buf, sizeof(frame_buf), true, diff --git a/package/kernel/mac80211/patches/subsys/370-mac80211-fix-TXQ-AC-confusion.patch b/package/kernel/mac80211/patches/subsys/370-mac80211-fix-TXQ-AC-confusion.patch deleted file mode 100644 index 0b7c8dd49b..0000000000 --- a/package/kernel/mac80211/patches/subsys/370-mac80211-fix-TXQ-AC-confusion.patch +++ /dev/null @@ -1,61 +0,0 @@ -From: Johannes Berg -Date: Tue, 23 Mar 2021 21:05:01 +0100 -Subject: [PATCH] mac80211: fix TXQ AC confusion - -Normally, TXQs have - - txq->tid = tid; - txq->ac = ieee80211_ac_from_tid(tid); - -However, the special management TXQ actually has - - txq->tid = IEEE80211_NUM_TIDS; // 16 - txq->ac = IEEE80211_AC_VO; - -This makes sense, but ieee80211_ac_from_tid(16) is the same -as ieee80211_ac_from_tid(0) which is just IEEE80211_AC_BE. - -Now, normally this is fine. However, if the netdev queues -were stopped, then the code in ieee80211_tx_dequeue() will -propagate the stop from the interface (vif->txqs_stopped[]) -if the AC 2 (ieee80211_ac_from_tid(txq->tid)) is marked as -stopped. On wake, however, __ieee80211_wake_txqs() will wake -the TXQ if AC 0 (txq->ac) is woken up. - -If a driver stops all queues with ieee80211_stop_tx_queues() -and then wakes them again with ieee80211_wake_tx_queues(), -the ieee80211_wake_txqs() tasklet will run to resync queue -and TXQ state. If all queues were woken, then what'll happen -is that _ieee80211_wake_txqs() will run in order of HW queues -0-3, typically (and certainly for iwlwifi) corresponding to -ACs 0-3, so it'll call __ieee80211_wake_txqs() for each AC in -order 0-3. - -When __ieee80211_wake_txqs() is called for AC 0 (VO) that'll -wake up the management TXQ (remember its tid is 16), and the -driver's wake_tx_queue() will be called. That tries to get a -frame, which will immediately *stop* the TXQ again, because -now we check against AC 2, and AC 2 hasn't yet been marked as -woken up again in sdata->vif.txqs_stopped[] since we're only -in the __ieee80211_wake_txqs() call for AC 0. - -Thus, the management TXQ will never be started again. - -Fix this by checking txq->ac directly instead of calculating -the AC as ieee80211_ac_from_tid(txq->tid). - -Fixes: adf8ed01e4fd ("mac80211: add an optional TXQ for other PS-buffered frames") -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/tx.c -+++ b/net/mac80211/tx.c -@@ -3589,7 +3589,7 @@ begin: - test_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags)) - goto out; - -- if (vif->txqs_stopped[ieee80211_ac_from_tid(txq->tid)]) { -+ if (vif->txqs_stopped[txq->ac]) { - set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txqi->flags); - goto out; - } diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-fix-time-is-after-bug-in-mlme.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-fix-time-is-after-bug-in-mlme.patch deleted file mode 100644 index 0573aece64..0000000000 --- a/package/kernel/mac80211/patches/subsys/374-mac80211-fix-time-is-after-bug-in-mlme.patch +++ /dev/null @@ -1,31 +0,0 @@ -From: Ben Greear -Date: Tue, 30 Mar 2021 16:07:49 -0700 -Subject: [PATCH] mac80211: fix time-is-after bug in mlme - -The incorrect timeout check caused probing to happen when it did -not need to happen. This in turn caused tx performance drop -for around 5 seconds in ath10k-ct driver. Possibly that tx drop -is due to a secondary issue, but fixing the probe to not happen -when traffic is running fixes the symptom. - -Signed-off-by: Ben Greear -Fixes: 9abf4e49830d ("mac80211: optimize station connection monitor") -Acked-by: Felix Fietkau -Link: https://lore.kernel.org/r/20210330230749.14097-1-greearb@candelatech.com -Signed-off-by: Johannes Berg ---- - ---- a/net/mac80211/mlme.c -+++ b/net/mac80211/mlme.c -@@ -4691,7 +4691,10 @@ static void ieee80211_sta_conn_mon_timer - timeout = sta->rx_stats.last_rx; - timeout += IEEE80211_CONNECTION_IDLE_TIME; - -- if (time_is_before_jiffies(timeout)) { -+ /* If timeout is after now, then update timer to fire at -+ * the later date, but do not actually probe at this time. -+ */ -+ if (time_is_after_jiffies(timeout)) { - mod_timer(&ifmgd->conn_mon_timer, round_jiffies_up(timeout)); - return; - } diff --git a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch index 3d1bb3d6c8..5d5dcd51ad 100644 --- a/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch +++ b/package/kernel/mac80211/patches/subsys/500-mac80211_configure_antenna_gain.patch @@ -57,7 +57,7 @@ __NL80211_ATTR_AFTER_LAST, --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c -@@ -2707,6 +2707,19 @@ static int ieee80211_get_tx_power(struct +@@ -2709,6 +2709,19 @@ static int ieee80211_get_tx_power(struct return 0; } @@ -77,7 +77,7 @@ static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, const u8 *addr) { -@@ -4137,6 +4150,7 @@ const struct cfg80211_ops mac80211_confi +@@ -4139,6 +4152,7 @@ const struct cfg80211_ops mac80211_confi .set_wiphy_params = ieee80211_set_wiphy_params, .set_tx_power = ieee80211_set_tx_power, .get_tx_power = ieee80211_get_tx_power, @@ -129,7 +129,7 @@ local->hw.max_mtu = IEEE80211_MAX_DATA_LEN; --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -733,6 +733,7 @@ static const struct nla_policy nl80211_p +@@ -737,6 +737,7 @@ static const struct nla_policy nl80211_p [NL80211_ATTR_S1G_CAPABILITY_MASK] = NLA_POLICY_EXACT_LEN(IEEE80211_S1G_CAPABILITY_LEN), [NL80211_ATTR_RECONNECT_REQUESTED] = { .type = NLA_REJECT }, @@ -137,7 +137,7 @@ }; /* policy for the key attributes */ -@@ -3241,6 +3242,20 @@ static int nl80211_set_wiphy(struct sk_b +@@ -3245,6 +3246,20 @@ static int nl80211_set_wiphy(struct sk_b if (result) return result; } From 08cfc7a0d31fbb8761ed5df26d911ae8c90eb621 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 2 May 2021 22:59:36 +0200 Subject: [PATCH 5/6] ltq-dsl-base: Make package nonshared to fix image builder This package depends on the lantiq target and is only build for that target. A normal package would be build by the SDK builder probably under a different target and then this package will not be selected. Mark it as nonshared to build it when the lantiq target gets build. Fixes: FS#3773, FS#3774 Signed-off-by: Hauke Mehrtens (cherry picked from commit 454d514f4647d6f1f0d93d8f67abdef94cd66a7d) --- package/network/utils/ltq-dsl-base/Makefile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/utils/ltq-dsl-base/Makefile b/package/network/utils/ltq-dsl-base/Makefile index aae07bc299..2ff069ca4d 100644 --- a/package/network/utils/ltq-dsl-base/Makefile +++ b/package/network/utils/ltq-dsl-base/Makefile @@ -8,6 +8,8 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ltq-dsl-base PKG_RELEASE:=3 +PKG_FLAGS:=nonshared + include $(INCLUDE_DIR)/package.mk define Package/ltq-dsl-base From d1a056f62052a251789d0a26c025f319bf497f2f Mon Sep 17 00:00:00 2001 From: Alan Swanson Date: Tue, 27 Apr 2021 16:24:05 +0100 Subject: [PATCH 6/6] dnsmasq: Update to version 2.85 Fixes issue with merged DNS requests in 2.83/2.84 not being retried on the firsts failed request causing lookup failures. Also fixes the following security problem in dnsmasq: * CVE-2021-3448: If specifiying the source address or interface to be used when contacting upstream name servers such as: server=8.8.8.8@1.2.3.4, server=8.8.8.8@1.2.3.4#66 and server=8.8.8.8@eth0 then all would use the same socket bound to the explicitly configured port. Now only server=8.8.8.8@1.2.3.4#66 will use the explicitly configured port and the others random source ports. Remove upstreamed patches and update remaining patch. Signed-off-by: Alan Swanson [refreshed old runtime support patch] Signed-off-by: Kevin Darbyshire-Bryant (cherry picked from commit 3980daffa4e284377cd1ae803fba78331c1fc40b) --- package/network/services/dnsmasq/Makefile | 4 +- ...ak-sort-order-of-tags-in-get-version.patch | 45 ------------------- ...4a875e0f16fd645df965db346fc56d2ab1dd.patch | 28 ------------ ...00-remove-old-runtime-kernel-support.patch | 21 ++------- 4 files changed, 6 insertions(+), 92 deletions(-) delete mode 100644 package/network/services/dnsmasq/patches/0001-Tweak-sort-order-of-tags-in-get-version.patch delete mode 100644 package/network/services/dnsmasq/patches/0002-Tweak-f1204a875e0f16fd645df965db346fc56d2ab1dd.patch diff --git a/package/network/services/dnsmasq/Makefile b/package/network/services/dnsmasq/Makefile index bc70931400..90a81b5f65 100644 --- a/package/network/services/dnsmasq/Makefile +++ b/package/network/services/dnsmasq/Makefile @@ -8,13 +8,13 @@ include $(TOPDIR)/rules.mk PKG_NAME:=dnsmasq -PKG_UPSTREAM_VERSION:=2.84 +PKG_UPSTREAM_VERSION:=2.85 PKG_VERSION:=$(subst test,~~test,$(subst rc,~rc,$(PKG_UPSTREAM_VERSION))) PKG_RELEASE:=$(AUTORELEASE) PKG_SOURCE:=$(PKG_NAME)-$(PKG_UPSTREAM_VERSION).tar.xz PKG_SOURCE_URL:=http://thekelleys.org.uk/dnsmasq -PKG_HASH:=603195c64b73137609b07e1024ae0b37f652b2f5fe467dce66985b3d1850050c +PKG_HASH:=ad98d3803df687e5b938080f3d25c628fe41c878752d03fbc6199787fee312fa PKG_LICENSE:=GPL-2.0 PKG_LICENSE_FILES:=COPYING diff --git a/package/network/services/dnsmasq/patches/0001-Tweak-sort-order-of-tags-in-get-version.patch b/package/network/services/dnsmasq/patches/0001-Tweak-sort-order-of-tags-in-get-version.patch deleted file mode 100644 index d7659ea037..0000000000 --- a/package/network/services/dnsmasq/patches/0001-Tweak-sort-order-of-tags-in-get-version.patch +++ /dev/null @@ -1,45 +0,0 @@ -From f1204a875e0f16fd645df965db346fc56d2ab1dd Mon Sep 17 00:00:00 2001 -From: Simon Kelley -Date: Fri, 29 Jan 2021 23:20:06 +0000 -Subject: [PATCH 1/2] Tweak sort order of tags in get-version. - -We want to sort such that the most recent/relevant tag is first -and gets used to set the compiled-in version. - -The solution is far from general, but works for the tag formats -used by dnsmasq. v2.84 sorts before v2.83, but v2.83 sorts -before v2.83rc1 and 2.83rc1 sorts before v2.83test1 - -Signed-off-by: Kevin Darbyshire-Bryant ---- - bld/get-version | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/bld/get-version b/bld/get-version -index e472aab..1d7e7f0 100755 ---- a/bld/get-version -+++ b/bld/get-version -@@ -9,7 +9,10 @@ - # If we can find one which matches $v[0-9].* then we assume it's - # a version-number tag, else we just use the whole string. - # If there is more than one v[0-9].* tag, sort them and use the --# first. This favours, eg v2.63 over 2.63rc6. -+# first. The insane arguments to the sort command are to ensure -+# that, eg v2.64 comes before v2.63, but v2.63 comes before v2.63rc1 -+# and v2.63rc1 comes before v2.63test1 -+ - - # Change directory to the toplevel source directory. - if test -z "$1" || ! test -d "$1" || ! cd "$1"; then -@@ -28,7 +31,7 @@ else - vers=`cat $1/VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep ^v[0-9]` - - if [ $? -eq 0 ]; then -- echo "${vers}" | sort -r | head -n 1 | sed 's/^v//' -+ echo "${vers}" | sort -k1.2,1.5r -k 1.6,1.6 -k1.8,1.9r -k1.10,1.11r | head -n 1 | sed 's/^v//' - else - cat $1/VERSION - fi --- -2.24.3 (Apple Git-128) - diff --git a/package/network/services/dnsmasq/patches/0002-Tweak-f1204a875e0f16fd645df965db346fc56d2ab1dd.patch b/package/network/services/dnsmasq/patches/0002-Tweak-f1204a875e0f16fd645df965db346fc56d2ab1dd.patch deleted file mode 100644 index 255507ced9..0000000000 --- a/package/network/services/dnsmasq/patches/0002-Tweak-f1204a875e0f16fd645df965db346fc56d2ab1dd.patch +++ /dev/null @@ -1,28 +0,0 @@ -From cfcafdd27c74dc187fe96a9cfa88b1aef53540a0 Mon Sep 17 00:00:00 2001 -From: Simon Kelley -Date: Mon, 1 Feb 2021 23:46:43 +0000 -Subject: [PATCH 2/2] Tweak f1204a875e0f16fd645df965db346fc56d2ab1dd - -This gets, eg, v2.65test1 and v2.65test11 in the correct order. - -Signed-off-by: Kevin Darbyshire-Bryant ---- - bld/get-version | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/bld/get-version b/bld/get-version -index 1d7e7f0..1f51768 100755 ---- a/bld/get-version -+++ b/bld/get-version -@@ -31,7 +31,7 @@ else - vers=`cat $1/VERSION | sed 's/[(), ]/,/ g' | tr ',' '\n' | grep ^v[0-9]` - - if [ $? -eq 0 ]; then -- echo "${vers}" | sort -k1.2,1.5r -k 1.6,1.6 -k1.8,1.9r -k1.10,1.11r | head -n 1 | sed 's/^v//' -+ echo "${vers}" | sort -k1.2,1.5Vr -k1.6,1.6 -k1.8,1.9Vr -k1.10,1.11Vr | head -n 1 | sed 's/^v//' - else - cat $1/VERSION - fi --- -2.24.3 (Apple Git-128) - diff --git a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch index bd11806ae0..b601bce1a9 100644 --- a/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch +++ b/package/network/services/dnsmasq/patches/100-remove-old-runtime-kernel-support.patch @@ -1,4 +1,4 @@ -From 7df4c681678612d196b4e1eec24963d181fdb28a Mon Sep 17 00:00:00 2001 +From 02fbe60e1c7e74d2ba57109575e7bfc238b1b5d4 Mon Sep 17 00:00:00 2001 From: Kevin Darbyshire-Bryant Date: Sun, 5 Apr 2020 17:18:23 +0100 Subject: [PATCH] drop runtime old kernel support @@ -8,9 +8,8 @@ Signed-off-by: Kevin Darbyshire-Bryant src/dnsmasq.c | 4 ---- src/dnsmasq.h | 5 +--- src/ipset.c | 64 ++++----------------------------------------------- - src/netlink.c | 3 +-- src/util.c | 19 --------------- - 5 files changed, 6 insertions(+), 89 deletions(-) + 4 files changed, 5 insertions(+), 87 deletions(-) --- a/src/dnsmasq.c +++ b/src/dnsmasq.c @@ -27,7 +26,7 @@ Signed-off-by: Kevin Darbyshire-Bryant --- a/src/dnsmasq.h +++ b/src/dnsmasq.h -@@ -1125,7 +1125,7 @@ extern struct daemon { +@@ -1144,7 +1144,7 @@ extern struct daemon { int inotifyfd; #endif #if defined(HAVE_LINUX_NETWORK) @@ -36,7 +35,7 @@ Signed-off-by: Kevin Darbyshire-Bryant #elif defined(HAVE_BSD_NETWORK) int dhcp_raw_fd, dhcp_icmp_fd, routefd; #endif -@@ -1306,9 +1306,6 @@ int read_write(int fd, unsigned char *pa +@@ -1326,9 +1326,6 @@ int read_write(int fd, unsigned char *pa void close_fds(long max_fd, int spare1, int spare2, int spare3); int wildcard_match(const char* wildcard, const char* match); int wildcard_matchn(const char* wildcard, const char* match, int num); @@ -139,18 +138,6 @@ Signed-off-by: Kevin Darbyshire-Bryant if (ret == -1) my_syslog(LOG_ERR, _("failed to update ipset %s: %s"), setname, strerror(errno)); ---- a/src/netlink.c -+++ b/src/netlink.c -@@ -92,8 +92,7 @@ char *netlink_init(void) - iov.iov_len = 100; - iov.iov_base = safe_malloc(iov.iov_len); - -- if (daemon->kernel_version >= KERNEL_VERSION(2,6,30) && -- setsockopt(daemon->netlinkfd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &opt, sizeof(opt)) == -1) -+ if (setsockopt(daemon->netlinkfd, SOL_NETLINK, NETLINK_NO_ENOBUFS, &opt, sizeof(opt)) == -1) - return _("warning: failed to set NETLINK_NO_ENOBUFS on netlink socket"); - - return NULL; --- a/src/util.c +++ b/src/util.c @@ -786,22 +786,3 @@ int wildcard_matchn(const char* wildcard