mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 18:38:10 +00:00 
			
		
		
		
	Compare commits
	
		
			47 Commits
		
	
	
		
			v3.0.1-rc1
			...
			v3.0.2-rc1
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|   | f0035a9908 | ||
|   | 0412bf03eb | ||
|   | afcffbc418 | ||
|   | c29c179b9e | ||
|   | 36c4008c68 | ||
|   | 07f5deefce | ||
|   | 0d21a66d0a | ||
|   | 206b4348fc | ||
|   | f0c34c39da | ||
|   | b85b388eb5 | ||
|   | 556f8880bc | ||
|   | bf2ca9a9e4 | ||
|   | b24846cce3 | ||
|   | 4bcc60934e | ||
|   | 2b4fd7911a | ||
|   | 7b0f05d11b | ||
|   | af4c7e4ce5 | ||
|   | bfeea74870 | ||
|   | 3b5f90b339 | ||
|   | 8870e802a7 | ||
|   | 775af3700f | ||
|   | c95b91c399 | ||
|   | 460050a114 | ||
|   | 01adebbd6f | ||
|   | dcdbb4f091 | ||
|   | 144c5d00f4 | ||
|   | 2826c6d487 | ||
|   | 367415663f | ||
|   | 3ce4088499 | ||
|   | 37f1ef534e | ||
|   | 1142deb3d0 | ||
|   | 922067a652 | ||
|   | 62b9c6e257 | ||
|   | 63dd51cbc4 | ||
|   | 80c55c2d82 | ||
|   | 4e2b42e95a | ||
|   | 1949f602bf | ||
|   | 84f86bfc98 | ||
|   | ed9d29fb03 | ||
|   | c587a12ee5 | ||
|   | 2197badcde | ||
|   | 84c8eb5ccf | ||
|   | 16ebb7cec3 | ||
|   | 75a51e3cd9 | ||
|   | 832fbb8898 | ||
|   | 4d2603b4ce | ||
|   | 6fc396682c | 
							
								
								
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							| @@ -21,7 +21,7 @@ jobs: | ||||
|     strategy: | ||||
|       fail-fast: false | ||||
|       matrix: | ||||
|         target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf660a', 'cybertan_eww622-a1', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap102', 'hfcl_ion4','hfcl_ion4xi_wp', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4xi_w', 'hfcl_ion4xi_HMR', 'hfcl_ion4x_w', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'indio_um-310ax-v1', 'indio_um-510axp-v1', 'indio_um-510axm-v1', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018_v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ] | ||||
|         target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cig_wf660a', 'cybertan_eww622-a1', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap102', 'hfcl_ion4','hfcl_ion4xi_wp', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4xi_w', 'hfcl_ion4xi_HMR', 'hfcl_ion4x_w', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'indio_um-310ax-v1', 'indio_um-510axp-v1', 'indio_um-510axm-v1', 'sercomm_ap72tip', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018-v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ] | ||||
|  | ||||
|     steps: | ||||
|     - uses: actions/checkout@v3 | ||||
|   | ||||
							
								
								
									
										28
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								LICENSE
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,28 @@ | ||||
| BSD 3-Clause License | ||||
|  | ||||
| Copyright (c) 2024, Telecom Infra Project | ||||
|  | ||||
| Redistribution and use in source and binary forms, with or without | ||||
| modification, are permitted provided that the following conditions are met: | ||||
|  | ||||
| 1. Redistributions of source code must retain the above copyright notice, this | ||||
|    list of conditions and the following disclaimer. | ||||
|  | ||||
| 2. Redistributions in binary form must reproduce the above copyright notice, | ||||
|    this list of conditions and the following disclaimer in the documentation | ||||
|    and/or other materials provided with the distribution. | ||||
|  | ||||
| 3. Neither the name of the copyright holder nor the names of its | ||||
|    contributors may be used to endorse or promote products derived from | ||||
|    this software without specific prior written permission. | ||||
|  | ||||
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||||
| AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||||
| IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||||
| DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||||
| FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||||
| DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||||
| SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||||
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||||
| OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||||
| OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||||
| @@ -83,12 +83,12 @@ platform_do_upgrade() { | ||||
| 		part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | cut -d " " -f 1)" | ||||
| 		case "$part" in | ||||
| 		rootfs1) | ||||
| 			fw_setenv active 2 || exit 1 | ||||
| 			CI_UBIPART="rootfs2" | ||||
| 			CI_FWSETENV="active 2" | ||||
| 			;; | ||||
| 		rootfs2) | ||||
| 			fw_setenv active 1 || exit 1 | ||||
| 			CI_UBIPART="rootfs1" | ||||
| 			CI_FWSETENV="active 1" | ||||
| 			;; | ||||
| 		*) | ||||
| 			# legacy bootloader | ||||
|   | ||||
| @@ -16,7 +16,8 @@ boot() { | ||||
| 		;;		 | ||||
| 	edgecore,eap101|\ | ||||
| 	edgecore,eap102|\ | ||||
| 	edgecore,oap102) | ||||
| 	edgecore,oap102|\ | ||||
| 	edgecore.eap104) | ||||
| 		avail=$(fw_printenv -n upgrade_available) | ||||
| 		[ "${avail}" -eq 1 ] || fw_setenv upgrade_available 1 | ||||
| 		fw_setenv bootcount 0 | ||||
|   | ||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | ||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | ||||
| 	sync | ||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" | ||||
| 	echo "sysupgrade successful" | ||||
| 	umount -a | ||||
| 	reboot -f | ||||
|   | ||||
| @@ -194,8 +194,6 @@ platform_do_upgrade() { | ||||
| 	cig,wf194c4|\ | ||||
| 	cig,wf196|\ | ||||
| 	cybertan,eww622-a1|\ | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1|\ | ||||
| 	glinet,ax1800|\ | ||||
| 	glinet,axt1800|\ | ||||
| 	indio,um-310ax-v1|\ | ||||
| @@ -262,8 +260,8 @@ platform_do_upgrade() { | ||||
| 		else | ||||
| 			if [ -e /tmp/downgrade ]; then | ||||
| 				CI_UBIPART="rootfs1" | ||||
| 				fw_setenv active 1 || exit 1 | ||||
| 				fw_setenv upgrade_available 0 || exit 1 | ||||
| 				{ echo 'active 1'; echo 'upgrade_available 0'; } > /tmp/fw_setenv.txt || exit 1 | ||||
| 				CI_FWSETENV="-s /tmp/fw_setenv.txt" | ||||
| 			elif grep -q rootfs1 /proc/cmdline; then | ||||
| 				CI_UBIPART="rootfs2" | ||||
| 				CI_FWSETENV="active 2" | ||||
| @@ -289,5 +287,18 @@ platform_do_upgrade() { | ||||
| 		} | ||||
| 		nand_upgrade_tar "$1" | ||||
| 		;; | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1) | ||||
| 		boot_part=$(fw_printenv bootfrom | cut  -d = -f2) | ||||
| 		echo "Current bootfrom is $boot_part" | ||||
| 		if [[ $boot_part == 1 ]]; then | ||||
| 			CI_UBIPART="rootfs" | ||||
| 			CI_FWSETENV="bootfrom 0" | ||||
| 		else | ||||
| 			CI_UBIPART="rootfs_1" | ||||
| 			CI_FWSETENV="bootfrom 1" | ||||
| 		fi | ||||
| 		nand_upgrade_tar "$1" | ||||
| 		;; | ||||
| 	esac | ||||
| } | ||||
|   | ||||
| @@ -29,9 +29,9 @@ ALLWIFIBOARDS:= \ | ||||
| 	cig-wf660a \ | ||||
| 	cig-wf194c \ | ||||
| 	cig-wf194c4 \ | ||||
| 	cig-wf196-ca \ | ||||
| 	cig-wf196-us \ | ||||
| 	cybertan-eww622-a1 \ | ||||
| 	cybertan-eww631-a1 \ | ||||
| 	cybertan-eww631-b1 \ | ||||
| 	edgecore-eap101 \ | ||||
| 	gl-ax1800 \ | ||||
| 	gl-axt1800 \ | ||||
| @@ -89,14 +89,9 @@ $(call Package/ath11k-wifi-default) | ||||
|     TITLE:=board-2.bin for QCOM IPQ6122 eval kits | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf196_6g-ca | ||||
| define Package/ath11k-wifi-cig-wf196 | ||||
| $(call Package/ath11k-wifi-default) | ||||
|     TITLE:=cig-wf196 6G bdf CA | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf196_6g-us | ||||
| $(call Package/ath11k-wifi-default) | ||||
|     TITLE:=cig-wf196 6G bdf US | ||||
|     TITLE:=cig-wf196 bdf | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-gl-ax1800 | ||||
| @@ -175,14 +170,9 @@ $(call Package/ath11k-wifi-default) | ||||
|     TITLE:=edgecore-oap101e bdf | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf188n-ca | ||||
| define Package/ath11k-wifi-cig-wf188n | ||||
| $(call Package/ath11k-wifi-default) | ||||
|     TITLE:=cig-wf188n bdf CA | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf188n-us | ||||
| $(call Package/ath11k-wifi-default) | ||||
|     TITLE:=cig-wf188n bdf US | ||||
|     TITLE:=cig-wf188n bdf | ||||
| endef | ||||
|  | ||||
| define ath11k-wifi-install-one-to | ||||
| @@ -262,16 +252,12 @@ define Package/ath11k-wifi-qcom-qcn9000/install | ||||
| 	$(INSTALL_DATA) ./board-2.bin.QCN9000 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board-2.bin | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf196_6g-ca/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-cig-wf196_6g-ca.bin.QCN9074 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board.bin | ||||
| 	echo -n 'CA' > $(1)/lib/firmware/country | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf196_6g-us/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-cig-wf196_6g-us.bin.QCN9074 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board.bin | ||||
| 	echo -n 'US' > $(1)/lib/firmware/country | ||||
| define Package/ath11k-wifi-cig-wf196/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/ $(1)/lib/firmware/ath11k/IPQ8074/hw2.0/ | ||||
| 	$(INSTALL_DATA) ./board-cig-wf196_6g-ca.bin.QCN9074 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board.bin.CA | ||||
| 	$(INSTALL_DATA) ./board-cig-wf196_6g-us.bin.QCN9074 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board.bin.US | ||||
| 	$(INSTALL_DATA) ./board-cig-wf196-ca.bin.IPQ8074 $(1)/lib/firmware/ath11k/IPQ8074/hw2.0/board.bin.CA | ||||
| 	$(INSTALL_DATA) ./board-cig-wf196-us.bin.IPQ8074 $(1)/lib/firmware/ath11k/IPQ8074/hw2.0/board.bin.US | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-optimcloud-d50/install | ||||
| @@ -365,16 +351,10 @@ define Package/ath11k-wifi-edgecore-oap101e/install | ||||
| 	$(INSTALL_DATA) ./board-2-edgecore-oap101e.bin.QCN6122 $(1)/lib/firmware/ath11k/qcn6122/hw1.0/board-2.bin | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf188n-ca/install | ||||
| define Package/ath11k-wifi-cig-wf188n/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-cig-wf188n-ca.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin | ||||
| 	echo -n 'CA MY DE' > $(1)/lib/firmware/country | ||||
| endef | ||||
|  | ||||
| define Package/ath11k-wifi-cig-wf188n-us/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-cig-wf188n-us.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin | ||||
| 	echo -n 'US MY DE' > $(1)/lib/firmware/country | ||||
| 	$(INSTALL_DATA) ./board-cig-wf188n-ca.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin.CA | ||||
| 	$(INSTALL_DATA) ./board-cig-wf188n-us.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin.US | ||||
| endef | ||||
|  | ||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf186w,Cigtech WF186w)) | ||||
| @@ -382,9 +362,9 @@ $(eval $(call generate-ath11k-wifi-package,cig-wf186h,Cigtech WF186h)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf660a,Cigtech WF660a)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf194c,Cigtech WF194c)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf194c4,Cigtech WF194c4)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf196-ca,Cigtech WF196 CA)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf196-us,Cigtech WF196 US)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cybertan-eww622-a1,CyberTan EWW622 A1)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cybertan-eww631-a1,CyberTan EWW631 A1)) | ||||
| $(eval $(call generate-ath11k-wifi-package,cybertan-eww631-b1,CyberTan EWW631 B1)) | ||||
| $(eval $(call generate-ath11k-wifi-package,sercomm-wallaby,Sercomm Kiwi)) | ||||
| $(eval $(call generate-ath11k-wifi-package,wallys-dr6018,Wallys DR6018)) | ||||
| $(eval $(call generate-ath11k-wifi-package,wallys-dr6018-v4,Wallys DR6018 V4)) | ||||
| @@ -410,8 +390,7 @@ $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq6122)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq8074)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq6018)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-qcom-qcn9000)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf196_6g-ca)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf196_6g-us)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf196)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-motorola-q14)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-optimcloud-d50)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-optimcloud-d60)) | ||||
| @@ -423,5 +402,4 @@ $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4x_w)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi_HMR)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-edgecore-oap101)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-edgecore-oap101e)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf188n-ca)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf188n-us)) | ||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf188n)) | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -18,6 +18,13 @@ qcom_setup_interfaces() | ||||
| 	cig,wf186h) | ||||
| 		ucidef_add_switch "switch0" "4:wan" "1:lan" "2:lan" "6@eth0" | ||||
| 		;; | ||||
| 	cybertan,eww631-a1) | ||||
| 		ucidef_set_interface_wan "eth0" | ||||
| 		ucidef_set_interface_lan "" | ||||
| 		;; | ||||
| 	cybertan,eww631-b1) | ||||
| 		ucidef_add_switch "switch1" "5:wan" "2:lan" "3:lan" "4:lan" "6@eth0" | ||||
| 		;; | ||||
| 	edgecore,oap101|\ | ||||
|  	edgecore,oap101-6e|\ | ||||
| 	edgecore,oap101e|\ | ||||
| @@ -63,6 +70,18 @@ qcom_setup_macs() | ||||
| 		ucidef_set_network_device_mac eth0 $wan_mac | ||||
| 		ip link set eth0 address $wan_mac | ||||
| 		;; | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1) | ||||
| 		mtd=$(find_mtd_chardev "0:APPSBLENV") | ||||
| 		[ -z "$mtd" ] && return; | ||||
| 		mac=$(grep BaseMacAddress= $mtd | cut -d '=' -f2) | ||||
| 		[ -z "$mac" ] && return; | ||||
| 		wan_mac=$(macaddr_canonicalize $mac) | ||||
| 		lan_mac=$(macaddr_add "$wan_mac" 1) | ||||
| 		ucidef_set_network_device_mac eth0 $wan_mac | ||||
| 		ip link set eth0 address $wan_mac | ||||
| 		ucidef_set_label_macaddr $wan_mac | ||||
| 		;; | ||||
| 	*) | ||||
| 		wan_mac=$(cat /sys/class/net/eth0/address) | ||||
| 		lan_mac=$(macaddr_add "$wan_mac" 1) | ||||
|   | ||||
| @@ -39,6 +39,28 @@ ath11k_generate_macs_ion4x() { | ||||
| 	echo -ne \\x${wifimac2//:/\\x} >> /lib/firmware/ath11k-macs | ||||
| } | ||||
|  | ||||
| ath11k_generate_macs_eww631_a1() { | ||||
| 	touch /lib/firmware/ath11k-macs | ||||
| 	local dev=$(find_mtd_chardev "0:APPSBLENV") | ||||
| 	mac=$(grep BaseMacAddress= $dev | cut -d '=' -f2) | ||||
| 	eth=$(macaddr_canonicalize $mac) | ||||
| 	mac1=$(macaddr_add $eth 1) | ||||
| 	mac2=$(macaddr_add $eth 2) | ||||
| 	echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs | ||||
| 	echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs | ||||
| } | ||||
|  | ||||
| ath11k_generate_macs_eww631_b1() { | ||||
| 	touch /lib/firmware/ath11k-macs | ||||
| 	local dev=$(find_mtd_chardev "0:APPSBLENV") | ||||
| 	mac=$(grep BaseMacAddress= $dev | cut -d '=' -f2) | ||||
| 	eth=$(macaddr_canonicalize $mac) | ||||
| 	mac1=$(macaddr_add $eth 2) | ||||
| 	mac2=$(macaddr_add $eth 3) | ||||
| 	echo -ne \\x${mac1//:/\\x} >> /lib/firmware/ath11k-macs | ||||
| 	echo -ne \\x${mac2//:/\\x} >> /lib/firmware/ath11k-macs | ||||
| } | ||||
|  | ||||
| caldata_die() { | ||||
| 	echo "caldata: " "$*" | ||||
| 	exit 1 | ||||
| @@ -64,6 +86,8 @@ ath11k/IPQ5018/hw1.0/caldata.bin) | ||||
| 	case "$board" in | ||||
| 	cig,wf186w|\ | ||||
| 	cig,wf186h|\ | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1|\ | ||||
| 	edgecore,eap104|\ | ||||
| 	edgecore,oap101|\ | ||||
| 	edgecore,oap101-6e|\ | ||||
| @@ -84,6 +108,8 @@ ath11k/qcn6122/hw1.0/caldata_1.bin) | ||||
| 	case "$board" in | ||||
| 	cig,wf186w|\ | ||||
| 	cig,wf186h|\ | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1|\ | ||||
| 	edgecore,oap101|\ | ||||
| 	edgecore,oap101-6e|\ | ||||
| 	edgecore,oap101e|\ | ||||
| @@ -101,6 +127,10 @@ ath11k/qcn6122/hw1.0/caldata_2.bin) | ||||
| 	edgecore,oap101e-6e) | ||||
| 		caldata_extract "0:ART" 0x4c000 0x20000   | ||||
| 		;; | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1) | ||||
| 		caldata_extract "0:ART" 0x26800 0x20000 | ||||
| 		;; | ||||
| 	esac | ||||
| 	;; | ||||
| ath11k/QCN9074/hw1.0/caldata_1.bin) | ||||
| @@ -119,6 +149,12 @@ ath11k-macs) | ||||
| 	cig,wf186h) | ||||
| 		ath11k_generate_macs_wf186w | ||||
| 		;; | ||||
| 	cybertan,eww631-a1) | ||||
| 		ath11k_generate_macs_eww631_a1 | ||||
| 		;; | ||||
| 	cybertan,eww631-b1) | ||||
| 		ath11k_generate_macs_eww631_b1 | ||||
| 		;; | ||||
| 	edgecore,eap104|\ | ||||
| 	optimcloud,d60|\ | ||||
| 	optimcloud,d60-5g|\ | ||||
|   | ||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | ||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | ||||
| 	sync | ||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" | ||||
| 	echo "sysupgrade successful" | ||||
| 	umount -a | ||||
| 	reboot -f | ||||
|   | ||||
| @@ -70,6 +70,8 @@ platform_check_image() { | ||||
| 	case $board in | ||||
| 	cig,wf186w|\ | ||||
| 	cig,wf186h|\ | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1|\ | ||||
| 	edgecore,eap104|\ | ||||
| 	hfcl,ion4x_w|\ | ||||
| 	hfcl,ion4xi_w|\ | ||||
| @@ -130,5 +132,18 @@ platform_do_upgrade() { | ||||
| 		} | ||||
| 		nand_upgrade_tar "$1" | ||||
| 		;; | ||||
| 	cybertan,eww631-a1|\ | ||||
| 	cybertan,eww631-b1) | ||||
| 		boot_part=$(fw_printenv bootfrom | cut  -d = -f2) | ||||
| 		echo "Current bootfrom is $boot_part" | ||||
| 		if [[ $boot_part == 1 ]]; then | ||||
| 			CI_UBIPART="rootfs" | ||||
| 			CI_FWSETENV="bootfrom 0" | ||||
| 		else | ||||
| 			CI_UBIPART="rootfs_1" | ||||
| 			CI_FWSETENV="bootfrom 1" | ||||
| 		fi | ||||
| 		nand_upgrade_tar "$1" | ||||
| 		;; | ||||
| 	esac | ||||
| } | ||||
|   | ||||
| @@ -0,0 +1,915 @@ | ||||
| /dts-v1/; | ||||
| /* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. | ||||
|  * | ||||
|  * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. | ||||
|  * | ||||
|  * Permission to use, copy, modify, and/or distribute this software for any | ||||
|  * purpose with or without fee is hereby granted, provided that the above | ||||
|  * copyright notice and this permission notice appear in all copies. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||||
|  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||||
|  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||||
|  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||||
|  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||||
|  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||||
|  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| #include "ipq5018.dtsi" | ||||
|  | ||||
| / { | ||||
| 	#address-cells = <0x2>; | ||||
| 	#size-cells = <0x2>; | ||||
| 	model = "CyberTan EWW631-A1"; | ||||
| 	compatible = "cybertan,eww631-a1", "qcom,ipq5018-mp03.5", "qcom,ipq5018"; | ||||
| 	interrupt-parent = <&intc>; | ||||
|  | ||||
| 	aliases { | ||||
| 		sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ | ||||
| 		serial0 = &blsp1_uart1; | ||||
| 		serial1 = &blsp1_uart2; | ||||
| 		ethernet0 = "/soc/dp1"; | ||||
| 		ethernet1 = "/soc/dp2"; | ||||
| 	}; | ||||
|  | ||||
| 	chosen { | ||||
| 		bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; | ||||
| 		bootargs-append = " swiotlb=1 coherent_pool=2M"; | ||||
| 		stdout-path = "serial0"; | ||||
| 	}; | ||||
|  | ||||
| 	reserved-memory { | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	/*                   256 MB Profile | ||||
| 	 * +==========+==============+=========================+ | ||||
| 	 * |          |              |                         | | ||||
| 	 * |  Region  | Start Offset |          Size           | | ||||
| 	 * |          |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    NSS   |  0x40000000  |           8MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   Linux  |  0x40800000  | Depends on total memory | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   uboot  |  0x4A600000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    SBL   |  0x4AA00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   smem   |  0x4AB00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    TZ    |  0x4AC00000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    Q6    |              |                         | | ||||
| 	 * |   code/  |  0x4B000000  |          20MB           | | ||||
| 	 * |   data   |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   data   |  0x4C400000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |  M3 Dump |  0x4D100000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   QDSS   |  0x4D200000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   data   |  0x4D300000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |  M3 Dump |  0x4E000000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   QDSS   |  0x4E100000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   data   |  0x4E200000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |  M3 Dump |  0x4EF00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   QDSS   |  0x4F000000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |                                                   | | ||||
| 	 * |            Rest of the memory for Linux           | | ||||
| 	 * |                                                   | | ||||
| 	 * +===================================================+ | ||||
| 	 */ | ||||
| 		q6_mem_regions: q6_mem_regions@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 0x4100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_code_data: q6_code_data@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 0x1400000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_ipq5018_data: q6_ipq5018_data@4C400000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4C400000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump: m3_dump@4D100000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D100000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_etr_region: q6_etr_dump@4D200000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D200000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D300000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E000000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E100000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E100000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data2: q6_qcn6122_data2@4E200000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E200000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_2: m3_dump_qcn6122_2@4EF00000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4EF00000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4F000000 0x0 0x100000>; | ||||
| 		}; | ||||
| 	#else | ||||
| 	/*                 512MB/1GB Profiles | ||||
| 	 * +==========+==============+=========================+ | ||||
| 	 * |          |              |                         | | ||||
| 	 * |  Region  | Start Offset |          Size           | | ||||
| 	 * |          |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    NSS   |  0x40000000  |          16MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   Linux  |  0x41000000  | Depends on total memory | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   uboot  |  0x4A600000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    SBL   |  0x4AA00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   smem   |  0x4AB00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    TZ    |  0x4AC00000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    Q6    |              |                         | | ||||
| 	 * |   code/  |  0x4B000000  |          20MB           | | ||||
| 	 * |   data   |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   data   |  0x4C400000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |  M3 Dump |  0x4D100000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   QDSS   |  0x4D200000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |  Caldb   |  0x4D300000  |           2MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   data   |  0x4D500000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |  M3 Dump |  0x4E200000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   QDSS   |  0x4E300000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |  Caldb   |  0x4E400000  |           5MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   data   |  0x4E900000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |  M3 Dump |  0x4F600000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   QDSS   |  0x4F700000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |  Caldb   |  0x4F800000  |           5MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |                                                   | | ||||
| 	 * |            Rest of the memory for Linux           | | ||||
| 	 * |                                                   | | ||||
| 	 * +===================================================+ | ||||
| 	 */ | ||||
| 		q6_mem_regions: q6_mem_regions@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 0x4D00000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_code_data: q6_code_data@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 01400000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_ipq5018_data: q6_ipq5018_data@4C400000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4C400000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump: m3_dump@4D100000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D100000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_etr_region: q6_etr_dump@4D200000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D200000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_caldb_region: q6_caldb_region@4D300000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D300000 0x0 0x200000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data1: q6_qcn6122_data1@4D500000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D500000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E200000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E300000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E400000 0x0 0x500000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E900000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F600000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4F600000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F700000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4F700000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4F800000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4F800000 0x0 0x500000>; | ||||
| 		}; | ||||
|  | ||||
| 	#endif | ||||
| 	}; | ||||
|  | ||||
| 	soc { | ||||
| 		serial@78af000 { | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		blsp1_uart2: serial@78b0000 { | ||||
| 			pinctrl-0 = <&blsp1_uart_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 		}; | ||||
|  | ||||
| 		qpic_bam: dma@7984000{ | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		nand: qpic-nand@79b0000 { | ||||
| 			pinctrl-0 = <&qspi_nand_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		spi_0: spi@78b5000 { /* BLSP1 QUP0 */ | ||||
| 			pinctrl-0 = <&blsp0_spi_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 			cs-select = <0>; | ||||
| 			status = "ok"; | ||||
|  | ||||
| 			m25p80@0 { | ||||
| 				#address-cells = <1>; | ||||
| 				#size-cells = <1>; | ||||
| 				reg = <0>; | ||||
| 				compatible = "n25q128a11"; | ||||
| 				linux,modalias = "m25p80", "n25q128a11"; | ||||
| 				spi-max-frequency = <50000000>; | ||||
| 				use-default-sizes; | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		mdio0: mdio@88000 { | ||||
| 			status = "ok"; | ||||
|  | ||||
| 			ethernet-phy@0 { | ||||
| 				reg = <7>; | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		mdio1: mdio@90000 { | ||||
| 			status = "disabled"; | ||||
| 			pinctrl-0 = <&mdio1_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 			phy-reset-gpio = <&tlmm 39 0>; | ||||
|  | ||||
| 			ethernet-phy@0 { | ||||
| 				reg = <28>; | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		ess-instance { | ||||
| 			num_devices = <0x1>; | ||||
| 			ess-switch@0x39c00000 { | ||||
| 				switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ | ||||
| 				cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ | ||||
| 				qcom,port_phyinfo { | ||||
| 					port@0 { | ||||
| 						port_id = <1>; | ||||
| 						phy_address = <7>; | ||||
| 						mdiobus = <&mdio0>; | ||||
| 					}; | ||||
| 					/* | ||||
| 					port@1 { | ||||
| 						port_id = <2>; | ||||
| 						phy_address = <0x1c>; | ||||
| 						mdiobus = <&mdio1>; | ||||
| 						port_mac_sel = "QGMAC_PORT"; | ||||
| 					}; | ||||
| 					*/ | ||||
| 				}; | ||||
| 				 | ||||
| 				led_source@0 { | ||||
| 					source = <0>; | ||||
| 					mode = "normal"; | ||||
| 					speed = "all"; | ||||
| 					blink_en = "enable"; | ||||
| 					active = "high"; | ||||
| 				}; | ||||
| 				 | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		dp1 { | ||||
| 			device_type = "network"; | ||||
| 			compatible = "qcom,nss-dp"; | ||||
| 			clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; | ||||
| 			clock-names = "nss-snoc-gmac-axi-clk"; | ||||
| 			qcom,id = <1>; | ||||
| 			reg = <0x39C00000 0x10000>; | ||||
| 			interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>; | ||||
| 			qcom,mactype = <2>; | ||||
| 			qcom,link-poll = <1>; | ||||
| 			qcom,phy-mdio-addr = <7>; | ||||
| 			mdio-bus = <&mdio0>; | ||||
| 			local-mac-address = [000000000000]; | ||||
| 			phy-mode = "sgmii"; | ||||
| 			qcom,rx-page-mode = <0>; | ||||
| 		}; | ||||
| 		/* | ||||
| 		dp2 { | ||||
| 			device_type = "network"; | ||||
| 			compatible = "qcom,nss-dp"; | ||||
| 			clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; | ||||
| 			clock-names = "nss-snoc-gmac-axi-clk"; | ||||
| 			qcom,id = <2>; | ||||
| 			reg = <0x39D00000 0x10000>; | ||||
| 			interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; | ||||
| 			qcom,mactype = <2>; | ||||
| 			qcom,link-poll = <1>; | ||||
| 			qcom,phy-mdio-addr = <28>; | ||||
| 			mdio-bus = <&mdio1>; | ||||
| 			local-mac-address = [000000000000]; | ||||
| 			phy-mode = "sgmii"; | ||||
| 			qcom,rx-page-mode = <0>; | ||||
| 		}; | ||||
| 		*/ | ||||
|  | ||||
| 		nss-macsec1 { | ||||
| 			compatible = "qcom,nss-macsec"; | ||||
| 			phy_addr = <0x1c>; | ||||
| 			mdiobus = <&mdio1>; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	qcom,test@0 { | ||||
| 		status = "ok"; | ||||
| 	}; | ||||
|  | ||||
| 	thermal-zones { | ||||
| 		status = "ok"; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &tlmm { | ||||
| 	pinctrl-0 = <&blsp0_uart_pins &phy_led_pins>; | ||||
| 	pinctrl-names = "default"; | ||||
|  | ||||
| 	blsp0_uart_pins: blsp0_uart_pins { | ||||
| 		blsp0_uart_rx_tx { | ||||
| 			pins = "gpio20", "gpio21"; | ||||
| 			function = "blsp0_uart0"; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	blsp1_uart_pins: blsp1_uart_pins { | ||||
| 		blsp1_uart_rx_tx { | ||||
| 			pins = "gpio23", "gpio25", "gpio24", "gpio26"; | ||||
| 			function = "blsp1_uart2"; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	blsp0_spi_pins: blsp0_spi_pins { | ||||
| 		mux { | ||||
| 			pins = "gpio10", "gpio11", "gpio12", "gpio13"; | ||||
| 			function = "blsp0_spi"; | ||||
| 			drive-strength = <2>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	qspi_nand_pins: qspi_nand_pins { | ||||
| 		qspi_clock { | ||||
| 			pins = "gpio9"; | ||||
| 			function = "qspi_clk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
|  | ||||
| 		qspi_cs { | ||||
| 			pins = "gpio8"; | ||||
| 			function = "qspi_cs"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
|  | ||||
| 		qspi_data { | ||||
| 			pins = "gpio4", "gpio5", "gpio6", "gpio7"; | ||||
| 			function = "qspi_data"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	mdio1_pins: mdio_pinmux { | ||||
| 		mux_0 { | ||||
| 			pins = "gpio36"; | ||||
| 			function = "mdc"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
|  | ||||
| 		mux_1 { | ||||
| 			pins = "gpio37"; | ||||
| 			function = "mdio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	phy_led_pins: phy_led_pins { | ||||
| 		gephy_led_pin { | ||||
| 			pins = "gpio46"; | ||||
| 			function = "led0"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	i2c_pins: i2c_pins { | ||||
| 		i2c_scl { | ||||
| 			pins = "gpio25"; | ||||
| 			function = "blsp2_i2c1"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
|  | ||||
| 		i2c_sda { | ||||
| 			pins = "gpio26"; | ||||
| 			function = "blsp2_i2c1"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	button_pins: button_pins { | ||||
| 		reset_button { | ||||
| 			pins = "gpio28"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	audio_pins: audio_pinmux { | ||||
| 		mux_1 { | ||||
| 			pins = "gpio24"; | ||||
| 			function = "audio_rxbclk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_2 { | ||||
| 			pins = "gpio25"; | ||||
| 			function = "audio_rxfsync"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_3 { | ||||
| 			pins = "gpio26"; | ||||
| 			function = "audio_rxd"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_4 { | ||||
| 			pins = "gpio27"; | ||||
| 			function = "audio_txmclk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_5 { | ||||
| 			pins = "gpio28"; | ||||
| 			function = "audio_txbclk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_6 { | ||||
| 			pins = "gpio29"; | ||||
| 			function = "audio_txfsync"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_7 { | ||||
| 			pins = "gpio30"; | ||||
| 			function = "audio_txd"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
| 	}; | ||||
| 	leds_pins: leds_pinmux { | ||||
| 		sys_blue { | ||||
| 			pins = "gpio30"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
| 		sys_red { | ||||
| 			pins = "gpio36"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 		sys_green { | ||||
| 			pins = "gpio37"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &soc { | ||||
| 	gpio_keys { | ||||
| 		compatible = "gpio-keys"; | ||||
| 		pinctrl-0 = <&button_pins>; | ||||
| 		pinctrl-names = "default"; | ||||
|  | ||||
| 		button@1 { | ||||
| 			label = "reset"; | ||||
| 			linux,code = <KEY_RESTART>; | ||||
| 			gpios = <&tlmm 28 GPIO_ACTIVE_LOW>; | ||||
| 			linux,input-type = <1>; | ||||
| 			debounce-interval = <60>; | ||||
| 		}; | ||||
| 	}; | ||||
| 	gpio_leds { | ||||
| 		compatible = "gpio-leds"; | ||||
| 		pinctrl-0 = <&leds_pins>; | ||||
| 		pinctrl-names = "default"; | ||||
|  | ||||
| 		led@30 { | ||||
| 			label = "sys:blue"; | ||||
| 			gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;  /* GPIO_30 */ | ||||
| 			default-state="on"; | ||||
| 		/*	linux,default-trigger = "timer"; | ||||
| 			active-delay = <700>; | ||||
| 			inactive-delay = <700>; | ||||
| 			default-state="on";		*/ | ||||
| 		}; | ||||
| 		led@36 { | ||||
| 			label = "sys:red"; | ||||
| 			gpios = <&tlmm 36 GPIO_ACTIVE_HIGH>;  /* GPIO_36 */ | ||||
| 			default-state="off"; | ||||
| 		/*	linux,default-trigger = "timer"; | ||||
| 			active-delay = <700>; | ||||
| 			inactive-delay = <700>; | ||||
| 			default-state="on";		*/ | ||||
| 		}; | ||||
| 		led@37 { | ||||
| 			label = "sys:green"; | ||||
| 			gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;  /* GPIO_37 */ | ||||
| 			default-state="off"; | ||||
| 		/*	linux,default-trigger = "timer"; | ||||
| 			active-delay = <700>; | ||||
| 			inactive-delay = <700>; | ||||
| 			default-state="on";		*/ | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| }; | ||||
|  | ||||
| &q6v5_wcss { | ||||
| 	compatible = "qcom,ipq5018-q6-mpd"; | ||||
| 	#address-cells = <1>; | ||||
| 	#size-cells = <1>; | ||||
| 	ranges; | ||||
| 	firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 	reg = <0x0cd00000 0x4040>, | ||||
| 		<0x1938000 0x8>, | ||||
| 		<0x193d204 0x4>; | ||||
| 	reg-names = "qdsp6", | ||||
| 			"tcsr-msip", | ||||
| 			"tcsr-q6"; | ||||
| 	resets = <&gcc GCC_WCSSAON_RESET>, | ||||
| 			<&gcc GCC_WCSS_Q6_BCR>; | ||||
|  | ||||
| 	reset-names = "wcss_aon_reset", | ||||
| 			"wcss_q6_reset"; | ||||
|  | ||||
| 	clocks = <&gcc GCC_Q6_AXIS_CLK>, | ||||
| 		<&gcc GCC_WCSS_ECAHB_CLK>, | ||||
| 		<&gcc GCC_Q6_AXIM_CLK>, | ||||
| 		<&gcc GCC_Q6_AXIM2_CLK>, | ||||
| 		<&gcc GCC_Q6_AHB_CLK>, | ||||
| 		<&gcc GCC_Q6_AHB_S_CLK>, | ||||
| 		<&gcc GCC_WCSS_AXI_S_CLK>; | ||||
| 	clock-names = "gcc_q6_axis_clk", | ||||
| 		"gcc_wcss_ecahb_clk", | ||||
| 		"gcc_q6_axim_clk", | ||||
| 		"gcc_q6_axim2_clk", | ||||
| 		"gcc_q6_ahb_clk", | ||||
| 		"gcc_q6_ahb_s_clk", | ||||
| 		"gcc_wcss_axi_s_clk"; | ||||
|  | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_mem_regions>, <&q6_etr_region>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_mem_regions>, <&q6_etr_region>, | ||||
| 				<&q6_caldb_region>; | ||||
| 	#endif | ||||
|  | ||||
| 	qcom,rproc = <&q6v5_wcss>; | ||||
| 	qcom,bootargs_smem = <507>; | ||||
| 	boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, | ||||
| 			<0x2 0x4 0x2 0x12 0x0 0x0>; | ||||
| 	status = "ok"; | ||||
| 	q6_wcss_pd1: remoteproc_pd1@4ab000 { | ||||
| 		compatible = "qcom,ipq5018-wcss-ahb-mpd"; | ||||
| 		reg = <0x4ab000 0x20>; | ||||
| 		reg-names = "rmb"; | ||||
| 		firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 		m3_firmware = "IPQ5018/m3_fw.mdt"; | ||||
| 		interrupts-extended = <&wcss_smp2p_in 8 0>, | ||||
| 					<&wcss_smp2p_in 9 0>, | ||||
| 					<&wcss_smp2p_in 12 0>, | ||||
| 					<&wcss_smp2p_in 11 0>; | ||||
| 		interrupt-names = "fatal", | ||||
| 					"ready", | ||||
| 					"spawn-ack", | ||||
| 					"stop-ack"; | ||||
|  | ||||
| 		resets = <&gcc GCC_WCSSAON_RESET>, | ||||
| 				<&gcc GCC_WCSS_BCR>, | ||||
| 				<&gcc GCC_CE_BCR>; | ||||
| 		reset-names = "wcss_aon_reset", | ||||
| 				"wcss_reset", | ||||
| 				"ce_reset"; | ||||
|  | ||||
| 		clocks = <&gcc GCC_WCSS_AHB_S_CLK>, | ||||
| 				<&gcc GCC_WCSS_ACMT_CLK>, | ||||
| 				<&gcc GCC_WCSS_AXI_M_CLK>; | ||||
| 		clock-names = "gcc_wcss_ahb_s_clk", | ||||
| 					"gcc_wcss_acmt_clk", | ||||
| 					"gcc_wcss_axi_m_clk"; | ||||
|  | ||||
| 		qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>; | ||||
|  | ||||
| 		qcom,smem-states = <&wcss_smp2p_out 8>, | ||||
| 					<&wcss_smp2p_out 9>, | ||||
| 					<&wcss_smp2p_out 10>; | ||||
| 		qcom,smem-state-names = "shutdown", | ||||
| 					"stop", | ||||
| 					"spawn"; | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_ipq5018_data>, <&m3_dump>, | ||||
| 				<&q6_etr_region>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_ipq5018_data>, <&m3_dump>, | ||||
| 				<&q6_etr_region>, <&q6_caldb_region>; | ||||
| 	#endif | ||||
|  | ||||
| 	}; | ||||
|  | ||||
| 	q6_wcss_pd2: remoteproc_pd2 { | ||||
| 		compatible = "qcom,ipq5018-wcss-pcie-mpd"; | ||||
| 		firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 		m3_firmware = "qcn6122/m3_fw.mdt"; | ||||
| 		interrupts-extended = <&wcss_smp2p_in 16 0>, | ||||
| 					<&wcss_smp2p_in 17 0>, | ||||
| 					<&wcss_smp2p_in 20 0>, | ||||
| 					<&wcss_smp2p_in 19 0>; | ||||
| 		interrupt-names = "fatal", | ||||
| 					"ready", | ||||
| 					"spawn-ack", | ||||
| 					"stop-ack"; | ||||
|  | ||||
| 		qcom,smem-states = <&wcss_smp2p_out 16>, | ||||
| 					<&wcss_smp2p_out 17>, | ||||
| 					<&wcss_smp2p_out 18>; | ||||
| 		qcom,smem-state-names = "shutdown", | ||||
| 					"stop", | ||||
| 					"spawn"; | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, | ||||
| 				<&q6_qcn6122_etr_1>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, | ||||
| 				<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; | ||||
| 	#endif | ||||
|  | ||||
| 	}; | ||||
|  | ||||
| 	q6_wcss_pd3: remoteproc_pd3 { | ||||
| 		compatible = "qcom,ipq5018-wcss-pcie-mpd"; | ||||
| 		firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 		interrupts-extended = <&wcss_smp2p_in 24 0>, | ||||
| 					<&wcss_smp2p_in 25 0>, | ||||
| 					<&wcss_smp2p_in 28 0>, | ||||
| 					<&wcss_smp2p_in 27 0>; | ||||
| 		interrupt-names = "fatal", | ||||
| 					"ready", | ||||
| 					"spawn-ack", | ||||
| 					"stop-ack"; | ||||
|  | ||||
| 		qcom,smem-states = <&wcss_smp2p_out 24>, | ||||
| 					<&wcss_smp2p_out 25>, | ||||
| 					<&wcss_smp2p_out 26>; | ||||
| 		qcom,smem-state-names = "shutdown", | ||||
| 					"stop", | ||||
| 					"spawn"; | ||||
| 	#ifdef	__IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, | ||||
| 				<&q6_qcn6122_etr_2>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, | ||||
| 				<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; | ||||
| 	#endif | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &i2c_0 { | ||||
| 	pinctrl-0 = <&i2c_pins>; | ||||
| 	pinctrl-names = "default"; | ||||
| 	status = "disabled"; | ||||
| }; | ||||
|  | ||||
| &wifi0 { | ||||
| 	/* IPQ5018 */ | ||||
| 	qcom,multipd_arch; | ||||
| 	qcom,rproc = <&q6_wcss_pd1>; | ||||
| 	qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; | ||||
| #ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	qcom,tgt-mem-mode = <2>; | ||||
| #else | ||||
| 	qcom,tgt-mem-mode = <1>; | ||||
| #endif | ||||
| 	qcom,board_id = <0x24>; | ||||
| #ifdef __CNSS2__ | ||||
| 	qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>; | ||||
| 	qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0 0>; | ||||
| 	qcom,caldb-size = <0x200000>; | ||||
| 	mem-region = <&q6_ipq5018_data>; | ||||
| 1235 | ||||
| #else | ||||
| 	memory-region = <&q6_ipq5018_data>; | ||||
| #endif | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &wifi1 { | ||||
| 	/* QCN6122 5G */ | ||||
| 	qcom,multipd_arch; | ||||
| 	qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; | ||||
| 	qcom,rproc = <&q6_wcss_pd3>; | ||||
| #ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	qcom,tgt-mem-mode = <2>; | ||||
| #else | ||||
| 	qcom,tgt-mem-mode = <1>; | ||||
| #endif | ||||
| 	qcom,board_id = <0x60>; | ||||
| #ifdef __CNSS2__ | ||||
| 	qcom,bdf-addr = <0x4E900000 0x4E900000 0x4E200000 0x0 0x0>; | ||||
| 	qcom,caldb-addr = <0x4F800000 0x4F800000 0 0 0>; | ||||
| 	qcom,caldb-size = <0x500000>; | ||||
| 	mem-region = <&q6_qcn6122_data2>; | ||||
| #else | ||||
| 	memory-region = <&q6_qcn6122_data2>; | ||||
| #endif | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &wifi2 { | ||||
| 	/* QCN6122 6G */ | ||||
| 	qcom,multipd_arch; | ||||
| 	qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; | ||||
| #ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	qcom,tgt-mem-mode = <2>; | ||||
| #else | ||||
| 	qcom,tgt-mem-mode = <1>; | ||||
| #endif | ||||
| 	qcom,board_id = <0xb0>; | ||||
| 	qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; | ||||
| #ifdef __CNSS2__ | ||||
| 	qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; | ||||
| #else | ||||
| 	qcom,caldb-addr = <0x4FF00000>; | ||||
| 	m3-dump-addr = <0x4FD00000>; | ||||
| #endif | ||||
| 	qcom,caldb-size = <0x500000>; | ||||
| 	status = "disabled"; | ||||
| }; | ||||
|  | ||||
| &usb3 { | ||||
|        status = "ok"; | ||||
|        device-power-gpio = <&tlmm 24 1>; | ||||
| }; | ||||
|  | ||||
| &dwc_0 { | ||||
|        /delete-property/ #phy-cells; | ||||
|        /delete-property/ phys; | ||||
|        /delete-property/ phy-names; | ||||
| }; | ||||
|  | ||||
| &hs_m31phy_0 { | ||||
|        status = "ok"; | ||||
| }; | ||||
|  | ||||
| &eud { | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &pcie_x1 { | ||||
| 	perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>; | ||||
| }; | ||||
|  | ||||
| &pcie_x2 { | ||||
| 	perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>; | ||||
| }; | ||||
|  | ||||
| &pcie_x1_rp { | ||||
| 	status = "disabled"; | ||||
|  | ||||
| 	mhi_0: qcom,mhi@0 { | ||||
| 		reg = <0 0 0 0 0 >; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &pcie_x2_rp { | ||||
| 	status = "disabled"; | ||||
|  | ||||
| 	mhi_1: qcom,mhi@1 { | ||||
| 		reg = <0 0 0 0 0 >; | ||||
|  | ||||
| 	}; | ||||
| }; | ||||
| @@ -0,0 +1,981 @@ | ||||
| /dts-v1/; | ||||
| /* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. | ||||
|  * | ||||
|  * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. | ||||
|  * | ||||
|  * Permission to use, copy, modify, and/or distribute this software for any | ||||
|  * purpose with or without fee is hereby granted, provided that the above | ||||
|  * copyright notice and this permission notice appear in all copies. | ||||
|  * | ||||
|  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | ||||
|  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | ||||
|  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | ||||
|  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | ||||
|  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | ||||
|  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | ||||
|  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||
|  */ | ||||
|  | ||||
| #include "ipq5018.dtsi" | ||||
|  | ||||
| / { | ||||
| 	#address-cells = <0x2>; | ||||
| 	#size-cells = <0x2>; | ||||
| 	model = "CyberTan EWW631-B1"; | ||||
| 	compatible = "cybertan,eww631-b1", "qcom,ipq5018-mp03.5", "qcom,ipq5018"; | ||||
| 	interrupt-parent = <&intc>; | ||||
|  | ||||
| 	aliases { | ||||
| 		sdhc1 = &sdhc_1; /* SDC1 eMMC slot */ | ||||
| 		serial0 = &blsp1_uart1; | ||||
| 		serial1 = &blsp1_uart2; | ||||
| 		ethernet0 = "/soc/dp1"; | ||||
| 		ethernet1 = "/soc/dp2"; | ||||
| 	}; | ||||
|  | ||||
| 	chosen { | ||||
| 		bootargs = "console=ttyMSM0,115200,n8 rw init=/init"; | ||||
| 		bootargs-append = " swiotlb=1 coherent_pool=2M"; | ||||
| 		stdout-path = "serial0"; | ||||
| 	}; | ||||
|  | ||||
| 	reserved-memory { | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	/*                   256 MB Profile | ||||
| 	 * +==========+==============+=========================+ | ||||
| 	 * |          |              |                         | | ||||
| 	 * |  Region  | Start Offset |          Size           | | ||||
| 	 * |          |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    NSS   |  0x40000000  |           8MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   Linux  |  0x40800000  | Depends on total memory | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   uboot  |  0x4A600000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    SBL   |  0x4AA00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   smem   |  0x4AB00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    TZ    |  0x4AC00000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    Q6    |              |                         | | ||||
| 	 * |   code/  |  0x4B000000  |          20MB           | | ||||
| 	 * |   data   |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   data   |  0x4C400000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |  M3 Dump |  0x4D100000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   QDSS   |  0x4D200000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   data   |  0x4D300000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |  M3 Dump |  0x4E000000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   QDSS   |  0x4E100000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   data   |  0x4E200000  |          13MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |  M3 Dump |  0x4EF00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   QDSS   |  0x4F000000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |                                                   | | ||||
| 	 * |            Rest of the memory for Linux           | | ||||
| 	 * |                                                   | | ||||
| 	 * +===================================================+ | ||||
| 	 */ | ||||
| 		q6_mem_regions: q6_mem_regions@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 0x4100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_code_data: q6_code_data@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 0x1400000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_ipq5018_data: q6_ipq5018_data@4C400000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4C400000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump: m3_dump@4D100000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D100000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_etr_region: q6_etr_dump@4D200000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D200000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data1: q6_qcn6122_data1@4D300000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D300000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E000000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E100000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E100000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data2: q6_qcn6122_data2@4E200000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E200000 0x0 0xD00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_2: m3_dump_qcn6122_2@4EF00000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4EF00000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4F000000 0x0 0x100000>; | ||||
| 		}; | ||||
| 	#else | ||||
| 	/*                 512MB/1GB Profiles | ||||
| 	 * +==========+==============+=========================+ | ||||
| 	 * |          |              |                         | | ||||
| 	 * |  Region  | Start Offset |          Size           | | ||||
| 	 * |          |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    NSS   |  0x40000000  |          16MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   Linux  |  0x41000000  | Depends on total memory | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   uboot  |  0x4A600000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    SBL   |  0x4AA00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |   smem   |  0x4AB00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    TZ    |  0x4AC00000  |           4MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |    Q6    |              |                         | | ||||
| 	 * |   code/  |  0x4B000000  |          20MB           | | ||||
| 	 * |   data   |              |                         | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   data   |  0x4C400000  |          14MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |  M3 Dump |  0x4D200000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |   QDSS   |  0x4D300000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |  IPQ5018 |              |                         | | ||||
| 	 * |  Caldb   |  0x4D400000  |           2MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   data   |  0x4D600000  |          16MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |  M3 Dump |  0x4E600000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |   QDSS   |  0x4E700000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_1|              |                         | | ||||
| 	 * |  Caldb   |  0x4E800000  |           5MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   data   |  0x4ED00000  |          16MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |  M3 Dump |  0x4FD00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |   QDSS   |  0x4FE00000  |           1MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * | QCN6122_2|              |                         | | ||||
| 	 * |  Caldb   |  0x4FF00000  |           5MB           | | ||||
| 	 * +----------+--------------+-------------------------+ | ||||
| 	 * |                                                   | | ||||
| 	 * |            Rest of the memory for Linux           | | ||||
| 	 * |                                                   | | ||||
| 	 * +===================================================+ | ||||
| 	 */ | ||||
| 		q6_mem_regions: q6_mem_regions@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 0x5400000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_code_data: q6_code_data@4B000000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4B000000 0x0 01400000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_ipq5018_data: q6_ipq5018_data@4C400000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4C400000 0x0 0xE00000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump: m3_dump@4D200000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D200000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_etr_region: q6_etr_dump@4D300000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D300000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_caldb_region: q6_caldb_region@4D400000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D400000 0x0 0x200000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data1: q6_qcn6122_data1@4D600000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4D600000 0x0 0x1000000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E600000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E700000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4E800000 0x0 0x500000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_data2: q6_qcn6122_data2@4E900000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4ED00000 0x0 0x1000000>; | ||||
| 		}; | ||||
|  | ||||
| 		m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4FD00000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4FE00000 0x0 0x100000>; | ||||
| 		}; | ||||
|  | ||||
| 		q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 { | ||||
| 			no-map; | ||||
| 			reg = <0x0 0x4FF00000 0x0 0x500000>; | ||||
| 		}; | ||||
|  | ||||
| 	#endif | ||||
| 	}; | ||||
|  | ||||
| 	soc { | ||||
| 		serial@78af000 { | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
| /* | ||||
| 		blsp1_uart2: serial@78b0000 { | ||||
| 			pinctrl-0 = <&blsp1_uart_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 		}; | ||||
| */ | ||||
| 		qpic_bam: dma@7984000{ | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		nand: qpic-nand@79b0000 { | ||||
| 			pinctrl-0 = <&qspi_nand_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		spi_0: spi@78b5000 { /* BLSP1 QUP0 */ | ||||
| 			pinctrl-0 = <&blsp0_spi_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 			cs-select = <0>; | ||||
| 			status = "ok"; | ||||
|  | ||||
| 			m25p80@0 { | ||||
| 				#address-cells = <1>; | ||||
| 				#size-cells = <1>; | ||||
| 				reg = <0>; | ||||
| 				compatible = "n25q128a11"; | ||||
| 				linux,modalias = "m25p80", "n25q128a11"; | ||||
| 				spi-max-frequency = <50000000>; | ||||
| 				use-default-sizes; | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		mdio0: mdio@88000 { | ||||
| 			status = "ok"; | ||||
|  | ||||
| 			ethernet-phy@0 { | ||||
| 				reg = <7>; | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		mdio1: mdio@90000 { | ||||
| 			status = "ok"; | ||||
| 			pinctrl-0 = <&mdio1_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 			phy-reset-gpio = <&tlmm 38 0>; | ||||
|  | ||||
| 			ethernet-phy@0 { | ||||
| 				reg = <0>; | ||||
| 			}; | ||||
|  | ||||
| 			ethernet-phy@1 { | ||||
| 				reg = <1>; | ||||
| 			}; | ||||
|  | ||||
| 			ethernet-phy@2 { | ||||
| 				reg = <2>; | ||||
| 			}; | ||||
|  | ||||
| 			ethernet-phy@3 { | ||||
| 				reg = <3>; | ||||
| 			}; | ||||
|  | ||||
| 			ethernet-phy@4 { | ||||
| 				reg = <4>; | ||||
| 			}; | ||||
| 		}; | ||||
|  | ||||
| 		ess-instance { | ||||
| 			num_devices = <0x2>; | ||||
| 			ess-switch@0x39c00000 { | ||||
| 				compatible = "qcom,ess-switch-ipq50xx"; | ||||
| 				device_id = <0>; | ||||
| 				switch_mac_mode = <0xf>; /* mac mode for uniphy instance*/ | ||||
| 				cmnblk_clk = "internal_96MHz"; /* cmnblk clk*/ | ||||
| 				qcom,port_phyinfo { | ||||
| 					port@0 { | ||||
| 						port_id = <1>; | ||||
| 						phy_address = <7>; | ||||
| 					}; | ||||
| 					port@1 { | ||||
| 						port_id = <2>; | ||||
| 						forced-speed = <1000>; | ||||
| 						forced-duplex = <1>; | ||||
| 					}; | ||||
| 				}; | ||||
| 				led_source@0 { | ||||
| 					source = <0>; | ||||
| 					mode = "normal"; | ||||
| 					speed = "all"; | ||||
| 					blink_en = "enable"; | ||||
| 					active = "high"; | ||||
| 				}; | ||||
| 			}; | ||||
| 			ess-switch1@1 { | ||||
| 				compatible = "qcom,ess-switch-qca83xx"; | ||||
| 				device_id = <1>; | ||||
| 				switch_access_mode = "mdio"; | ||||
| 				mdio-bus = <&mdio1>; | ||||
| 				reset_gpio = <&tlmm 0x26 0>; | ||||
| 				switch_cpu_bmp = <0x40>;  /* cpu port bitmap (Port 6 GMAC) */ | ||||
| 				switch_lan_bmp = <0x3c>; /* lan port bitmap */ | ||||
| 				switch_wan_bmp = <0x0>;  /* wan port bitmap */ | ||||
| 				qca,ar8327-initvals = < | ||||
| 						0x00004 0x7600000   /* PAD0_MODE */ | ||||
| 						0x00008 0x1000000   /* PAD5_MODE */ | ||||
| 						0x0000c 0x80        /* PAD6_MODE */ | ||||
| 						0x00010 0x2613a0    /* PORT6 FORCE MODE*/ | ||||
| 						0x000e4 0xaa545     /* MAC_POWER_SEL */ | ||||
| 						0x000e0 0xc74164de  /* SGMII_CTRL */ | ||||
| 						0x0007c 0x4e        /* PORT0_STATUS */ | ||||
| 						0x00094 0x4e        /* PORT6_STATUS */ | ||||
| 				>; | ||||
| 				qcom,port_phyinfo { | ||||
| 					port@0 { | ||||
| 						port_id = <1>; | ||||
| 						phy_address = <0>; | ||||
| 					}; | ||||
| 					port@1 { | ||||
| 						port_id = <2>; | ||||
| 						phy_address = <1>; | ||||
| 					}; | ||||
| 					port@2 { | ||||
| 						port_id = <3>; | ||||
| 						phy_address = <2>; | ||||
| 					}; | ||||
| 					port@3 { | ||||
| 						port_id = <4>; | ||||
| 						phy_address = <3>; | ||||
| 					}; | ||||
| 					port@4 { | ||||
| 						port_id = <5>; | ||||
| 						phy_address = <4>; | ||||
| 					}; | ||||
| 				}; | ||||
| 			}; | ||||
| 		}; | ||||
| 		dp1 { | ||||
| 			device_type = "network"; | ||||
| 			compatible = "qcom,nss-dp"; | ||||
| 			clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>; | ||||
| 			clock-names = "nss-snoc-gmac-axi-clk"; | ||||
| 			qcom,id = <2>; | ||||
| 			reg = <0x39D00000 0x10000>; | ||||
| 			interrupts = <GIC_SPI 109 IRQ_TYPE_LEVEL_HIGH>; | ||||
| 			qcom,mactype = <2>; | ||||
| 			local-mac-address = [000000000000]; | ||||
| 			phy-mode = "sgmii"; | ||||
| 		}; | ||||
|  | ||||
| 		dp2 { | ||||
| 			device_type = "network"; | ||||
| 			compatible = "qcom,nss-dp"; | ||||
| 			clocks = <&gcc GCC_SNOC_GMAC0_AXI_CLK>; | ||||
| 			clock-names = "nss-snoc-gmac-axi-clk"; | ||||
| 			qcom,id = <1>; | ||||
| 			reg = <0x39C00000 0x10000>; | ||||
| 			interrupts = <GIC_SPI 101 IRQ_TYPE_LEVEL_HIGH>; | ||||
| 			qcom,mactype = <2>; | ||||
| 			qcom,link-poll = <1>; | ||||
| 			qcom,phy-mdio-addr = <7>; | ||||
| 			mdio-bus = <&mdio0>; | ||||
| 			local-mac-address = [000000000000]; | ||||
| 			phy-mode = "sgmii"; | ||||
| 		}; | ||||
|  | ||||
| 		qcom,test@0 { | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| /* | ||||
| 		lpass: lpass@0xA000000{ | ||||
| 			status = "disabled"; | ||||
| 		}; | ||||
|  | ||||
| 		pcm: pcm@0xA3C0000{ | ||||
| 			pinctrl-0 = <&audio_pins>; | ||||
| 			pinctrl-names = "default"; | ||||
| 			status = "disabled"; | ||||
| 		}; | ||||
|  | ||||
| 		pcm_lb: pcm_lb@0 { | ||||
| 			status = "disabled"; | ||||
| 		}; | ||||
| */ | ||||
| 	}; | ||||
|  | ||||
| 	thermal-zones { | ||||
| 		status = "ok"; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &tlmm { | ||||
| 	pinctrl-0 = <&blsp0_uart_pins>; //<&blsp0_uart_pins &phy_led_pins>; | ||||
| 	pinctrl-names = "default"; | ||||
|  | ||||
| 	blsp0_uart_pins: blsp0_uart_pins { | ||||
| 		blsp0_uart_rx_tx { | ||||
| 			pins = "gpio20", "gpio21"; | ||||
| 			function = "blsp0_uart0"; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
| /* | ||||
| 	blsp1_uart_pins: blsp1_uart_pins { | ||||
| 		blsp1_uart_rx_tx { | ||||
| 			pins = "gpio23", "gpio25", "gpio24", "gpio26"; | ||||
| 			function = "blsp1_uart2"; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
| */ | ||||
| 	blsp0_spi_pins: blsp0_spi_pins { | ||||
| 		mux { | ||||
| 			pins = "gpio10", "gpio11", "gpio12", "gpio13"; | ||||
| 			function = "blsp0_spi"; | ||||
| 			drive-strength = <2>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	qspi_nand_pins: qspi_nand_pins { | ||||
| 		qspi_clock { | ||||
| 			pins = "gpio9"; | ||||
| 			function = "qspi_clk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
|  | ||||
| 		qspi_cs { | ||||
| 			pins = "gpio8"; | ||||
| 			function = "qspi_cs"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
|  | ||||
| 		qspi_data { | ||||
| 			pins = "gpio4", "gpio5", "gpio6", "gpio7"; | ||||
| 			function = "qspi_data"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	mdio1_pins: mdio_pinmux { | ||||
| 		mux_0 { | ||||
| 			pins = "gpio36"; | ||||
| 			function = "mdc"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
|  | ||||
| 		mux_1 { | ||||
| 			pins = "gpio37"; | ||||
| 			function = "mdio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
| 	}; | ||||
| /* | ||||
| 	phy_led_pins: phy_led_pins { | ||||
| 		gephy_led_pin { | ||||
| 			pins = "gpio46"; | ||||
| 			function = "led0"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
| 	}; | ||||
| */ | ||||
| 	i2c_pins: i2c_pins { | ||||
| 		i2c_scl { | ||||
| 			pins = "gpio25"; | ||||
| 			function = "blsp2_i2c1"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
|  | ||||
| 		i2c_sda { | ||||
| 			pins = "gpio26"; | ||||
| 			function = "blsp2_i2c1"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	button_pins: button_pins { | ||||
| 		reset_button { | ||||
| 			pins = "gpio28"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
| 	}; | ||||
| /* | ||||
| 	audio_pins: audio_pinmux { | ||||
| 		mux_1 { | ||||
| 			pins = "gpio24"; | ||||
| 			function = "audio_rxbclk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_2 { | ||||
| 			pins = "gpio25"; | ||||
| 			function = "audio_rxfsync"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_3 { | ||||
| 			pins = "gpio26"; | ||||
| 			function = "audio_rxd"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_4 { | ||||
| 			pins = "gpio27"; | ||||
| 			function = "audio_txmclk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_5 { | ||||
| 			pins = "gpio28"; | ||||
| 			function = "audio_txbclk"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_6 { | ||||
| 			pins = "gpio29"; | ||||
| 			function = "audio_txfsync"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
|  | ||||
| 		mux_7 { | ||||
| 			pins = "gpio30"; | ||||
| 			function = "audio_txd"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-down; | ||||
| 		}; | ||||
| 	}; | ||||
| */ | ||||
| 	poe_pins: poe_pinmux { | ||||
| 		/* | ||||
| 			LAN port PoE output enable | ||||
| 			H --> enable; L --> disable (Default setting to H) | ||||
| 		*/ | ||||
| 		mux_0 { /* PoE_OUT_EN */ | ||||
| 			pins = "gpio24"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <2>; | ||||
| 			bias-pull-up; | ||||
| 			output-high; | ||||
| 		}; | ||||
|  | ||||
| 		mux_1 { /* PSE_INT_N */ | ||||
| 			pins = "gpio27"; | ||||
| 			function = "gpio"; | ||||
| 			bias-pull-up; | ||||
| 			input; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	leds_pins: leds_pinmux { | ||||
| 		sys_green { | ||||
| 			pins = "gpio1"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 		sys_blue { | ||||
| 			pins = "gpio30"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-pull-up; | ||||
| 		}; | ||||
| 		sys_red { | ||||
| 			pins = "gpio46"; | ||||
| 			function = "gpio"; | ||||
| 			drive-strength = <8>; | ||||
| 			bias-disable; | ||||
| 		}; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &soc { | ||||
| 	gpio_keys { | ||||
| 		compatible = "gpio-keys"; | ||||
| 		pinctrl-0 = <&button_pins>; | ||||
| 		pinctrl-names = "default"; | ||||
|  | ||||
| 		button@1 { | ||||
| 			label = "reset"; | ||||
| 			linux,code = <KEY_RESTART>; | ||||
| 			gpios = <&tlmm 28 GPIO_ACTIVE_LOW>; | ||||
| 			linux,input-type = <1>; | ||||
| 			debounce-interval = <60>; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	gpio_leds { | ||||
| 		compatible = "gpio-leds"; | ||||
| 		pinctrl-0 = <&leds_pins>; | ||||
| 		pinctrl-names = "default"; | ||||
|  | ||||
| 		led@1 { | ||||
| 			label = "sys:green"; | ||||
| 			gpios = <&tlmm 1 GPIO_ACTIVE_HIGH>;  /* GPIO_1/ATST_QP0 */ | ||||
| 			default-state="off"; | ||||
| 		}; | ||||
| 		led@30 { | ||||
| 			label = "sys:blue"; | ||||
| 			gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>;  /* GPIO_30 */ | ||||
| 			default-state="on"; | ||||
| 		}; | ||||
| 		led@46 { | ||||
| 			label = "sys:red"; | ||||
| 			gpios = <&tlmm 46 GPIO_ACTIVE_HIGH>;  /* GPIO_46 */ | ||||
| 			default-state="off"; | ||||
| 		}; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &q6v5_wcss { | ||||
| 	compatible = "qcom,ipq5018-q6-mpd"; | ||||
| 	#address-cells = <1>; | ||||
| 	#size-cells = <1>; | ||||
| 	ranges; | ||||
| 	firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 	reg = <0x0cd00000 0x4040>, | ||||
| 		<0x1938000 0x8>, | ||||
| 		<0x193d204 0x4>; | ||||
| 	reg-names = "qdsp6", | ||||
| 			"tcsr-msip", | ||||
| 			"tcsr-q6"; | ||||
| 	resets = <&gcc GCC_WCSSAON_RESET>, | ||||
| 			<&gcc GCC_WCSS_Q6_BCR>; | ||||
|  | ||||
| 	reset-names = "wcss_aon_reset", | ||||
| 			"wcss_q6_reset"; | ||||
|  | ||||
| 	clocks = <&gcc GCC_Q6_AXIS_CLK>, | ||||
| 		<&gcc GCC_WCSS_ECAHB_CLK>, | ||||
| 		<&gcc GCC_Q6_AXIM_CLK>, | ||||
| 		<&gcc GCC_Q6_AXIM2_CLK>, | ||||
| 		<&gcc GCC_Q6_AHB_CLK>, | ||||
| 		<&gcc GCC_Q6_AHB_S_CLK>, | ||||
| 		<&gcc GCC_WCSS_AXI_S_CLK>; | ||||
| 	clock-names = "gcc_q6_axis_clk", | ||||
| 		"gcc_wcss_ecahb_clk", | ||||
| 		"gcc_q6_axim_clk", | ||||
| 		"gcc_q6_axim2_clk", | ||||
| 		"gcc_q6_ahb_clk", | ||||
| 		"gcc_q6_ahb_s_clk", | ||||
| 		"gcc_wcss_axi_s_clk"; | ||||
|  | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_mem_regions>, <&q6_etr_region>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_mem_regions>, <&q6_etr_region>, | ||||
| 				<&q6_caldb_region>; | ||||
| 	#endif | ||||
|  | ||||
| 	qcom,rproc = <&q6v5_wcss>; | ||||
| 	qcom,bootargs_smem = <507>; | ||||
| 	boot-args = <0x1 0x4 0x3 0x0F 0x0 0x0>, | ||||
| 			<0x2 0x4 0x2 0x12 0x0 0x0>; | ||||
| 	status = "ok"; | ||||
| 	q6_wcss_pd1: remoteproc_pd1@4ab000 { | ||||
| 		compatible = "qcom,ipq5018-wcss-ahb-mpd"; | ||||
| 		reg = <0x4ab000 0x20>; | ||||
| 		reg-names = "rmb"; | ||||
| 		firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 		m3_firmware = "IPQ5018/m3_fw.mdt"; | ||||
| 		interrupts-extended = <&wcss_smp2p_in 8 0>, | ||||
| 					<&wcss_smp2p_in 9 0>, | ||||
| 					<&wcss_smp2p_in 12 0>, | ||||
| 					<&wcss_smp2p_in 11 0>; | ||||
| 		interrupt-names = "fatal", | ||||
| 					"ready", | ||||
| 					"spawn-ack", | ||||
| 					"stop-ack"; | ||||
|  | ||||
| 		resets = <&gcc GCC_WCSSAON_RESET>, | ||||
| 				<&gcc GCC_WCSS_BCR>, | ||||
| 				<&gcc GCC_CE_BCR>; | ||||
| 		reset-names = "wcss_aon_reset", | ||||
| 				"wcss_reset", | ||||
| 				"ce_reset"; | ||||
|  | ||||
| 		clocks = <&gcc GCC_WCSS_AHB_S_CLK>, | ||||
| 				<&gcc GCC_WCSS_ACMT_CLK>, | ||||
| 				<&gcc GCC_WCSS_AXI_M_CLK>; | ||||
| 		clock-names = "gcc_wcss_ahb_s_clk", | ||||
| 					"gcc_wcss_acmt_clk", | ||||
| 					"gcc_wcss_axi_m_clk"; | ||||
|  | ||||
| 		qcom,halt-regs = <&tcsr_q6_block 0xa000 0xd000 0x0>; | ||||
|  | ||||
| 		qcom,smem-states = <&wcss_smp2p_out 8>, | ||||
| 					<&wcss_smp2p_out 9>, | ||||
| 					<&wcss_smp2p_out 10>; | ||||
| 		qcom,smem-state-names = "shutdown", | ||||
| 					"stop", | ||||
| 					"spawn"; | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_ipq5018_data>, <&m3_dump>, | ||||
| 				<&q6_etr_region>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_ipq5018_data>, <&m3_dump>, | ||||
| 				<&q6_etr_region>, <&q6_caldb_region>; | ||||
| 	#endif | ||||
|  | ||||
| 	}; | ||||
|  | ||||
| 	q6_wcss_pd2: remoteproc_pd2 { | ||||
| 		compatible = "qcom,ipq5018-wcss-pcie-mpd"; | ||||
| 		firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 		m3_firmware = "qcn6122/m3_fw.mdt"; | ||||
| 		interrupts-extended = <&wcss_smp2p_in 16 0>, | ||||
| 					<&wcss_smp2p_in 17 0>, | ||||
| 					<&wcss_smp2p_in 20 0>, | ||||
| 					<&wcss_smp2p_in 19 0>; | ||||
| 		interrupt-names = "fatal", | ||||
| 					"ready", | ||||
| 					"spawn-ack", | ||||
| 					"stop-ack"; | ||||
|  | ||||
| 		qcom,smem-states = <&wcss_smp2p_out 16>, | ||||
| 					<&wcss_smp2p_out 17>, | ||||
| 					<&wcss_smp2p_out 18>; | ||||
| 		qcom,smem-state-names = "shutdown", | ||||
| 					"stop", | ||||
| 					"spawn"; | ||||
| 	#ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, | ||||
| 				<&q6_qcn6122_etr_1>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_qcn6122_data1>, <&m3_dump_qcn6122_1>, | ||||
| 				<&q6_qcn6122_etr_1>, <&q6_qcn6122_caldb_1>; | ||||
| 	#endif | ||||
|  | ||||
| 	}; | ||||
|  | ||||
| 	q6_wcss_pd3: remoteproc_pd3 { | ||||
| 		compatible = "qcom,ipq5018-wcss-pcie-mpd"; | ||||
| 		firmware = "IPQ5018/q6_fw.mdt"; | ||||
| 		interrupts-extended = <&wcss_smp2p_in 24 0>, | ||||
| 					<&wcss_smp2p_in 25 0>, | ||||
| 					<&wcss_smp2p_in 28 0>, | ||||
| 					<&wcss_smp2p_in 27 0>; | ||||
| 		interrupt-names = "fatal", | ||||
| 					"ready", | ||||
| 					"spawn-ack", | ||||
| 					"stop-ack"; | ||||
|  | ||||
| 		qcom,smem-states = <&wcss_smp2p_out 24>, | ||||
| 					<&wcss_smp2p_out 25>, | ||||
| 					<&wcss_smp2p_out 26>; | ||||
| 		qcom,smem-state-names = "shutdown", | ||||
| 					"stop", | ||||
| 					"spawn"; | ||||
| 	#ifdef	__IPQ_MEM_PROFILE_256_MB__ | ||||
| 		memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, | ||||
| 				<&q6_qcn6122_etr_2>; | ||||
| 	#else | ||||
| 		memory-region = <&q6_qcn6122_data2>, <&m3_dump_qcn6122_2>, | ||||
| 				<&q6_qcn6122_etr_2>, <&q6_qcn6122_caldb_2>; | ||||
| 	#endif | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &i2c_0 { | ||||
| 	pinctrl-0 = <&i2c_pins>; | ||||
| 	pinctrl-names = "default"; | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &wifi0 { | ||||
| 	/* IPQ5018 */ | ||||
| 	qcom,multipd_arch; | ||||
| 	qcom,rproc = <&q6_wcss_pd1>; | ||||
| 	qcom,userpd-subsys-name = "q6v5_wcss_userpd1"; | ||||
| #ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	qcom,tgt-mem-mode = <2>; | ||||
| #else | ||||
| 	qcom,tgt-mem-mode = <1>; | ||||
| #endif | ||||
| 	qcom,board_id = <0x24>; | ||||
| #ifdef __CNSS2__ | ||||
| 	qcom,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0 0x0>; | ||||
| 	qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0 0>; | ||||
| 	qcom,caldb-size = <0x200000>; | ||||
| 	mem-region = <&q6_ipq5018_data>; | ||||
| #else | ||||
| 	memory-region = <&q6_ipq5018_data>; | ||||
| #endif | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &wifi1 { | ||||
| 	/* QCN6122 5G */ | ||||
| 	qcom,multipd_arch; | ||||
| 	qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; | ||||
| 	qcom,rproc = <&q6_wcss_pd3>; | ||||
| #ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	qcom,tgt-mem-mode = <2>; | ||||
| #else | ||||
| 	qcom,tgt-mem-mode = <1>; | ||||
| #endif | ||||
| 	qcom,board_id = <0x60>; | ||||
| #ifdef __CNSS2__ | ||||
| 	qcom,bdf-addr = <0x4E900000 0x4E900000 0x4E200000 0x0 0x0>; | ||||
| 	qcom,caldb-addr = <0x4F800000 0x4F800000 0 0 0>; | ||||
| 	qcom,caldb-size = <0x500000>; | ||||
| 	mem-region = <&q6_qcn6122_data2>; | ||||
| #else | ||||
| 	memory-region = <&q6_qcn6122_data2>; | ||||
| #endif | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &wifi2 { | ||||
| 	/* QCN6122 6G */ | ||||
| 	qcom,multipd_arch; | ||||
| 	qcom,userpd-subsys-name = "q6v5_wcss_userpd3"; | ||||
| #ifdef __IPQ_MEM_PROFILE_256_MB__ | ||||
| 	qcom,tgt-mem-mode = <2>; | ||||
| #else | ||||
| 	qcom,tgt-mem-mode = <1>; | ||||
| #endif | ||||
| 	qcom,board_id = <0xb0>; | ||||
| 	qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>; | ||||
| #ifdef __CNSS2__ | ||||
| 	qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>; | ||||
| #else | ||||
| 	qcom,caldb-addr = <0x4FF00000>; | ||||
| 	m3-dump-addr = <0x4FD00000>; | ||||
| #endif | ||||
| 	qcom,caldb-size = <0x500000>; | ||||
| 	status = "disabled"; | ||||
| }; | ||||
|  | ||||
| &usb3 { | ||||
|        status = "ok"; | ||||
|        device-power-gpio = <&tlmm 24 1>; | ||||
| }; | ||||
|  | ||||
| &dwc_0 { | ||||
|        /delete-property/ #phy-cells; | ||||
|        /delete-property/ phys; | ||||
|        /delete-property/ phy-names; | ||||
| }; | ||||
|  | ||||
| &hs_m31phy_0 { | ||||
|        status = "ok"; | ||||
| }; | ||||
|  | ||||
| &eud { | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &pcie_x1 { | ||||
| 	perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>; | ||||
| }; | ||||
|  | ||||
| &pcie_x2 { | ||||
| 	perst-gpio = <&tlmm 15 GPIO_ACTIVE_LOW>; | ||||
| }; | ||||
|  | ||||
| &pcie_x1_rp { | ||||
| 	status = "disabled"; | ||||
|  | ||||
| 	mhi_0: qcom,mhi@0 { | ||||
| 		reg = <0 0 0 0 0 >; | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &pcie_x2_rp { | ||||
| 	status = "disabled"; | ||||
|  | ||||
| 	mhi_1: qcom,mhi@1 { | ||||
| 		reg = <0 0 0 0 0 >; | ||||
|  | ||||
| 	}; | ||||
| }; | ||||
| @@ -18,6 +18,28 @@ define Device/cig_wf186w | ||||
| endef | ||||
| TARGET_DEVICES += cig_wf186w | ||||
|  | ||||
| define Device/cybertan_eww631_a1 | ||||
|   DEVICE_TITLE := CyberTan EWW631-A1 | ||||
|   DEVICE_DTS := qcom-ipq5018-eww631-a1 | ||||
|   SUPPORTED_DEVICES := cybertan,eww631-a1 | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cybertan-eww631-a1 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 | ||||
|   DEVICE_DTS_CONFIG := config@mp03.5-c1 | ||||
|   IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi | ||||
|   IMAGE/nand-factory.ubi := append-ubi | ||||
| endef | ||||
| TARGET_DEVICES += cybertan_eww631_a1 | ||||
|  | ||||
| define Device/cybertan_eww631_b1 | ||||
|   DEVICE_TITLE := CyberTan EWW631-B1 | ||||
|   DEVICE_DTS := qcom-ipq5018-eww631-b1 | ||||
|   SUPPORTED_DEVICES := cybertan,eww631-b1 | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cybertan-eww631-b1 ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122 | ||||
|   DEVICE_DTS_CONFIG := config@mp03.5-c1 | ||||
|   IMAGES := sysupgrade.tar nand-factory.bin nand-factory.ubi | ||||
|   IMAGE/nand-factory.ubi := append-ubi | ||||
| endef | ||||
| TARGET_DEVICES += cybertan_eww631_b1 | ||||
|  | ||||
| define Device/edgecore_eap104 | ||||
|   DEVICE_TITLE := EdgeCore EAP104 | ||||
|   DEVICE_DTS := qcom-ipq5018-eap104 | ||||
|   | ||||
							
								
								
									
										54
									
								
								feeds/ipq807x_v5.4/ipq50xx/patches/301-diag_char.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								feeds/ipq807x_v5.4/ipq50xx/patches/301-diag_char.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,54 @@ | ||||
| Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/char/diag/diagchar_core.c | ||||
| =================================================================== | ||||
| --- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/char/diag/diagchar_core.c | ||||
| +++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/char/diag/diagchar_core.c | ||||
| @@ -763,11 +763,6 @@ static void diag_cmd_invalidate_polling( | ||||
|  	driver->polling_reg_flag = 0; | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			return; | ||||
| -		} | ||||
|  		polling = diag_cmd_chk_polling(&item->entry); | ||||
|  		if (polling == DIAG_CMD_POLLING) { | ||||
|  			driver->polling_reg_flag = 1; | ||||
| @@ -829,11 +824,6 @@ struct diag_cmd_reg_entry_t *diag_cmd_se | ||||
|   | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			return NULL; | ||||
| -		} | ||||
|  		temp_entry = &item->entry; | ||||
|  		if (temp_entry->cmd_code == entry->cmd_code && | ||||
|  		    temp_entry->subsys_id == entry->subsys_id && | ||||
| @@ -907,12 +897,6 @@ void diag_cmd_remove_reg_by_pid(int pid) | ||||
|  	mutex_lock(&driver->cmd_reg_mutex); | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			mutex_unlock(&driver->cmd_reg_mutex); | ||||
| -			return; | ||||
| -		} | ||||
|  		if (item->pid == pid) { | ||||
|  			list_del(&item->link); | ||||
|  			kfree(item); | ||||
| @@ -931,12 +915,6 @@ void diag_cmd_remove_reg_by_proc(int pro | ||||
|  	mutex_lock(&driver->cmd_reg_mutex); | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			mutex_unlock(&driver->cmd_reg_mutex); | ||||
| -			return; | ||||
| -		} | ||||
|  		if (item->proc == proc) { | ||||
|  			list_del(&item->link); | ||||
|  			kfree(item); | ||||
| @@ -0,0 +1,16 @@ | ||||
| Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/mtd/nand/raw/nand_ids.c | ||||
| =================================================================== | ||||
| --- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/mtd/nand/raw/nand_ids.c | ||||
| +++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/mtd/nand/raw/nand_ids.c | ||||
| @@ -79,9 +79,9 @@ | ||||
|  		{ .id = {0xc2, 0xb7} }, | ||||
|  		SZ_4K, SZ_512, SZ_256K, 0, 2, 256, NAND_ECC_INFO(8, SZ_512), 0}, | ||||
|   | ||||
| -	{"MX35UF2GE4AD-Z4I SPI NAND 2G 1.8V", | ||||
| +	{"MX35UF2GE4AD-Z4I SPI NAND 2G 1.8V 8-bit", | ||||
|  		{ .id = {0xc2, 0xa6} }, | ||||
| -		SZ_2K, SZ_128, SZ_128K, 0, 2, 160, NAND_ECC_INFO(4, SZ_512), 0 }, | ||||
| +		SZ_2K, SZ_256, SZ_128K, 0, 2, 128, NAND_ECC_INFO(8, SZ_512), 0 }, | ||||
|   | ||||
|  	{"GD5F1GQ5REYIH SPI NAND 1G 1.8V", | ||||
|  		{ .id = {0xc8, 0x21} }, | ||||
| @@ -1,5 +1,4 @@ | ||||
| #!/bin/sh | ||||
|  | ||||
| [ -e /lib/firmware/$FIRMWARE ] && exit 0 | ||||
|  | ||||
| . /lib/functions.sh | ||||
| @@ -98,6 +97,18 @@ ath11k-macs) | ||||
| 		;; | ||||
| 	esac | ||||
| 	;; | ||||
| ath11k/IPQ6018/hw1.0/board.bin) | ||||
| 	case "$board" in | ||||
| 	cig,wf188n) | ||||
| 		country=`cat /etc/ucentral/country` | ||||
| 		if [ "$country" == "CA" ]; then | ||||
| 			ln -s /lib/firmware/ath11k/IPQ6018/hw1.0/board.bin.CA /lib/firmware/ath11k/IPQ6018/hw1.0/board.bin | ||||
| 		else | ||||
| 			ln -s /lib/firmware/ath11k/IPQ6018/hw1.0/board.bin.US /lib/firmware/ath11k/IPQ6018/hw1.0/board.bin | ||||
| 		fi | ||||
| 		;; | ||||
| 	esac | ||||
| 	;; | ||||
| *) | ||||
| 	exit 1 | ||||
| 	;; | ||||
|   | ||||
| @@ -10,7 +10,8 @@ boot() { | ||||
| 		;;		 | ||||
| 	edgecore,eap101|\ | ||||
| 	edgecore,eap102|\ | ||||
| 	edgecore,oap102) | ||||
| 	edgecore,oap102|\ | ||||
| 	edgecore.eap104) | ||||
| 		avail=$(fw_printenv -n upgrade_available) | ||||
| 		[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1 | ||||
| 		fw_setenv bootcount 0 | ||||
|   | ||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | ||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | ||||
| 	sync | ||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" | ||||
| 	echo "sysupgrade successful" | ||||
| 	umount -a | ||||
| 	reboot -f | ||||
|   | ||||
| @@ -122,10 +122,10 @@ platform_do_upgrade() { | ||||
| 		else | ||||
| 			if grep -q rootfs1 /proc/cmdline; then | ||||
| 				CI_UBIPART="rootfs2" | ||||
| 				fw_setenv active 2 || exit 1 | ||||
| 				CI_FWSETENV="active 2" | ||||
| 			else | ||||
| 				CI_UBIPART="rootfs1" | ||||
| 				fw_setenv active 1 || exit 1 | ||||
| 				CI_FWSETENV="active 1" | ||||
| 			fi | ||||
| 		fi | ||||
| 		nand_upgrade_tar "$1" | ||||
|   | ||||
| @@ -2,23 +2,14 @@ KERNEL_LOADADDR := 0x41080000 | ||||
|  | ||||
| DEVICE_VARS += CE_TYPE | ||||
|  | ||||
| define Device/cig_wf188n-ca | ||||
| define Device/cig_wf188n | ||||
|   DEVICE_TITLE := Cigtech WF-188n | ||||
|   DEVICE_DTS := qcom-ipq6018-cig-wf188n | ||||
|   DEVICE_DTS_CONFIG := config@cp03-c1 | ||||
|   SUPPORTED_DEVICES := cig,wf188n | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf188n-ca uboot-env | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf188n uboot-env | ||||
| endef | ||||
| TARGET_DEVICES += cig_wf188n-ca | ||||
|  | ||||
| define Device/cig_wf188n-us | ||||
|   DEVICE_TITLE := Cigtech WF-188n | ||||
|   DEVICE_DTS := qcom-ipq6018-cig-wf188n | ||||
|   DEVICE_DTS_CONFIG := config@cp03-c1 | ||||
|   SUPPORTED_DEVICES := cig,wf188n | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf188n-us uboot-env | ||||
| endef | ||||
| TARGET_DEVICES += cig_wf188n-us | ||||
| TARGET_DEVICES += cig_wf188n | ||||
|  | ||||
| define Device/hfcl_ion4xe | ||||
|   DEVICE_TITLE := HFCL ION4Xe | ||||
| @@ -101,14 +92,14 @@ define Device/wallys_dr6018 | ||||
| endef | ||||
| TARGET_DEVICES += wallys_dr6018 | ||||
|  | ||||
| define Device/wallys_dr6018_v4 | ||||
| define Device/wallys_dr6018-v4 | ||||
|   DEVICE_TITLE := Wallys DR6018 V4 | ||||
|   DEVICE_DTS := qcom-ipq6018-wallys-dr6018-v4 | ||||
|   DEVICE_DTS_CONFIG := config@cp01-c4 | ||||
|   SUPPORTED_DEVICES := wallys,dr6018-v4 | ||||
|   DEVICE_PACKAGES := ath11k-wifi-wallys-dr6018-v4 uboot-envtools ath11k-firmware-qcn9000 | ||||
| endef | ||||
| TARGET_DEVICES += wallys_dr6018_v4 | ||||
| TARGET_DEVICES += wallys_dr6018-v4 | ||||
|  | ||||
| define Device/glinet_ax1800 | ||||
|   DEVICE_TITLE := GL-iNet AX1800 | ||||
|   | ||||
							
								
								
									
										54
									
								
								feeds/ipq807x_v5.4/ipq60xx/patches/301-diag_char.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								feeds/ipq807x_v5.4/ipq60xx/patches/301-diag_char.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,54 @@ | ||||
| Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/char/diag/diagchar_core.c | ||||
| =================================================================== | ||||
| --- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/char/diag/diagchar_core.c | ||||
| +++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/char/diag/diagchar_core.c | ||||
| @@ -763,11 +763,6 @@ static void diag_cmd_invalidate_polling( | ||||
|  	driver->polling_reg_flag = 0; | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			return; | ||||
| -		} | ||||
|  		polling = diag_cmd_chk_polling(&item->entry); | ||||
|  		if (polling == DIAG_CMD_POLLING) { | ||||
|  			driver->polling_reg_flag = 1; | ||||
| @@ -829,11 +824,6 @@ struct diag_cmd_reg_entry_t *diag_cmd_se | ||||
|   | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			return NULL; | ||||
| -		} | ||||
|  		temp_entry = &item->entry; | ||||
|  		if (temp_entry->cmd_code == entry->cmd_code && | ||||
|  		    temp_entry->subsys_id == entry->subsys_id && | ||||
| @@ -907,12 +897,6 @@ void diag_cmd_remove_reg_by_pid(int pid) | ||||
|  	mutex_lock(&driver->cmd_reg_mutex); | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			mutex_unlock(&driver->cmd_reg_mutex); | ||||
| -			return; | ||||
| -		} | ||||
|  		if (item->pid == pid) { | ||||
|  			list_del(&item->link); | ||||
|  			kfree(item); | ||||
| @@ -931,12 +915,6 @@ void diag_cmd_remove_reg_by_proc(int pro | ||||
|  	mutex_lock(&driver->cmd_reg_mutex); | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			mutex_unlock(&driver->cmd_reg_mutex); | ||||
| -			return; | ||||
| -		} | ||||
|  		if (item->proc == proc) { | ||||
|  			list_del(&item->link); | ||||
|  			kfree(item); | ||||
| @@ -18,6 +18,9 @@ edgecore,oap102) | ||||
|         ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt" | ||||
|         ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt" | ||||
| 	;; | ||||
| cybertan,eww631-b1) | ||||
| 	ucidef_set_led_default "power" "POWER" "sys:blue" "on" | ||||
| 	;; | ||||
| esac | ||||
|  | ||||
| board_config_flush | ||||
|   | ||||
| @@ -16,9 +16,9 @@ ath11k_generate_macs() { | ||||
| 	echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs | ||||
| } | ||||
|  | ||||
| ath11k_generate_macs_wf194() { | ||||
| ath11k_generate_macs_wf196() { | ||||
| 	touch /lib/firmware/ath11k-macs | ||||
| 	mac=$(grep BaseMacAddress= /dev/mtd14 | cut -dx -f2) | ||||
| 	mac=$(grep BaseMacAddress= /dev/mtd18 | cut -dx -f2) | ||||
| 	eth=$(macaddr_canonicalize $mac) | ||||
| 	mac1=$(macaddr_add $eth 2) | ||||
| 	mac2=$(macaddr_add $eth 3) | ||||
| @@ -92,8 +92,32 @@ ath11k-macs) | ||||
| 	edgecore,eap106) | ||||
| 		ath11k_generate_macs | ||||
| 		;; | ||||
| 	cig,wf194c) | ||||
| 		ath11k_generate_macs_wf194 | ||||
| 	cig,wf196) | ||||
| 		ath11k_generate_macs_wf196 | ||||
| 		;; | ||||
| 	esac | ||||
| 	;; | ||||
| ath11k/IPQ8074/hw2.0/board.bin) | ||||
| 	case "$board" in | ||||
| 	cig,wf196) | ||||
| 		country=`cat /etc/ucentral/country` | ||||
| 		if [ "$country" == "CA" ]; then | ||||
| 			ln -s /lib/firmware/ath11k/IPQ8074/hw2.0/board.bin.CA /lib/firmware/ath11k/IPQ8074/hw2.0/board.bin | ||||
| 		else | ||||
| 			ln -s /lib/firmware/ath11k/IPQ8074/hw2.0/board.bin.US /lib/firmware/ath11k/IPQ8074/hw2.0/board.bin | ||||
| 		fi | ||||
| 		;; | ||||
| 	esac | ||||
| 	;; | ||||
| ath11k/QCN9074/hw1.0/board.bin) | ||||
| 	case "$board" in | ||||
| 	cig,wf196) | ||||
| 		country=`cat /etc/ucentral/country` | ||||
| 		if [ "$country" == "CA" ]; then | ||||
| 			ln -s /lib/firmware/ath11k/QCN9074/hw1.0/board.bin.CA /lib/firmware/ath11k/QCN9074/hw1.0/board.bin | ||||
| 		else | ||||
| 			ln -s /lib/firmware/ath11k/QCN9074/hw1.0/board.bin.US /lib/firmware/ath11k/QCN9074/hw1.0/board.bin | ||||
| 		fi | ||||
| 		;; | ||||
| 	esac | ||||
| 	;; | ||||
|   | ||||
| @@ -10,7 +10,8 @@ boot() { | ||||
| 		;;		 | ||||
| 	edgecore,eap101|\ | ||||
| 	edgecore,eap102|\ | ||||
| 	edgecore,oap102) | ||||
| 	edgecore,oap102|\ | ||||
| 	edgecore.eap104) | ||||
| 		avail=$(fw_printenv -n upgrade_available) | ||||
| 		[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1 | ||||
| 		fw_setenv bootcount 0 | ||||
|   | ||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | ||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | ||||
| 	sync | ||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" | ||||
| 	echo "sysupgrade successful" | ||||
| 	umount -a | ||||
| 	reboot -f | ||||
|   | ||||
| @@ -61,12 +61,16 @@ platform_do_upgrade() { | ||||
| 		if [ "$(find_mtd_chardev rootfs)" ]; then | ||||
| 			CI_UBIPART="rootfs" | ||||
| 		else | ||||
| 			if grep -q rootfs1 /proc/cmdline; then | ||||
| 			if [ -e /tmp/downgrade ]; then | ||||
| 				CI_UBIPART="rootfs1" | ||||
| 				{ echo 'active 1'; echo 'upgrade_available 0'; } > /tmp/fw_setenv.txt || exit 1 | ||||
| 				CI_FWSETENV="-s /tmp/fw_setenv.txt" | ||||
| 			elif grep -q rootfs1 /proc/cmdline; then | ||||
| 				CI_UBIPART="rootfs2" | ||||
| 				fw_setenv active 2 || exit 1 | ||||
| 				CI_FWSETENV="active 2" | ||||
| 			else | ||||
| 				CI_UBIPART="rootfs1" | ||||
| 				fw_setenv active 1 || exit 1 | ||||
| 				CI_FWSETENV="active 1" | ||||
| 			fi | ||||
| 		fi | ||||
| 		nand_upgrade_tar "$1" | ||||
|   | ||||
| @@ -29,8 +29,79 @@ | ||||
| 		stdout-path = "serial0"; | ||||
| 	}; | ||||
|  | ||||
| 	gpio-export { | ||||
| 		compatible = "gpio-export"; | ||||
| 		#size-cells = <0>; | ||||
|  | ||||
| 		mcu-enable { | ||||
| 			gpio-export,name = "mcu-enable"; | ||||
| 			gpio-export,output = <0>; | ||||
| 			gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
|  | ||||
| 		usb-hub-enable { | ||||
| 			gpio-export,name = "usb-hub-enable"; | ||||
| 			gpio-export,output = <1>; | ||||
| 			gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
|  | ||||
| 		usb-rear-power { | ||||
| 			gpio-export,name = "usb-rear-power"; | ||||
| 			gpio-export,output = <1>; | ||||
| 			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
|  | ||||
| 		usb-side-power { | ||||
| 			gpio-export,name = "usb-side-power"; | ||||
| 			gpio-export,output = <1>; | ||||
| 			gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	soc { | ||||
| 		pinctrl@1000000 { | ||||
| 			pinctrl-0 = <&mcu_rst &mcu_rsv &usb_rear_pwr &usb_side_pwr &usb_hub_rst>; | ||||
| 			pinctrl-names = "default"; | ||||
|  | ||||
| 			mcu_rst: mcu_rst_pins { | ||||
| 				pins = "gpio54"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-low; | ||||
| 			}; | ||||
|  | ||||
| 			mcu_rsv: mcu_rsv_pins { | ||||
| 				pins = "gpio56"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 			}; | ||||
|  | ||||
| 			usb_rear_pwr: usb_rear_pwr_pins { | ||||
| 				pins = "gpio29"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-high; | ||||
| 			}; | ||||
|  | ||||
| 			usb_side_pwr: usb_side_pwr_pins { | ||||
| 				pins = "gpio30"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-high; | ||||
| 			}; | ||||
|  | ||||
| 			usb_hub_rst: usb_hub_rst_pins { | ||||
| 				pins = "gpio55"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-high; | ||||
| 			}; | ||||
|  | ||||
| 			button_pins: button_pins { | ||||
| 				reset_button { | ||||
| 					pins = "gpio66"; | ||||
| @@ -40,30 +111,6 @@ | ||||
| 				}; | ||||
| 			}; | ||||
|  | ||||
| 			usb_mux_sel_pins: usb_mux_pins { | ||||
| 				mux { | ||||
| 					pins = "gpio27"; | ||||
| 					function = "gpio"; | ||||
| 					drive-strength = <8>; | ||||
| 					bias-pull-down; | ||||
| 				}; | ||||
| 			}; | ||||
|  | ||||
| 			pcie0_pins: pcie_pins { | ||||
| 				pcie0_rst { | ||||
| 					pins = "gpio58"; | ||||
| 					function = "pcie0_rst"; | ||||
| 					drive-strength = <8>; | ||||
| 					bias-pull-down; | ||||
| 				}; | ||||
| 				pcie0_wake { | ||||
| 					pins = "gpio59"; | ||||
| 					function = "pcie0_wake"; | ||||
| 					drive-strength = <8>; | ||||
| 					bias-pull-down; | ||||
| 				}; | ||||
| 			}; | ||||
|  | ||||
| 			mdio_pins: mdio_pinmux { | ||||
| 				mux_0 { | ||||
| 					pins = "gpio68"; | ||||
| @@ -170,19 +217,6 @@ | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		phy@84000 { | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		phy@86000 { | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		pci@20000000 { | ||||
| 			perst-gpio = <&tlmm 58 1>; | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		gpio_keys { | ||||
| 			compatible = "gpio-keys"; | ||||
| 			pinctrl-0 = <&button_pins>; | ||||
|   | ||||
| @@ -29,8 +29,79 @@ | ||||
| 		stdout-path = "serial0"; | ||||
| 	}; | ||||
|  | ||||
| 	gpio-export { | ||||
| 		compatible = "gpio-export"; | ||||
| 		#size-cells = <0>; | ||||
|  | ||||
| 		mcu-enable { | ||||
| 			gpio-export,name = "mcu-enable"; | ||||
| 			gpio-export,output = <0>; | ||||
| 			gpios = <&tlmm 54 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
|  | ||||
| 		usb-hub-enable { | ||||
| 			gpio-export,name = "usb-hub-enable"; | ||||
| 			gpio-export,output = <1>; | ||||
| 			gpios = <&tlmm 55 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
|  | ||||
| 		usb-rear-power { | ||||
| 			gpio-export,name = "usb-rear-power"; | ||||
| 			gpio-export,output = <1>; | ||||
| 			gpios = <&tlmm 29 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
|  | ||||
| 		usb-side-power { | ||||
| 			gpio-export,name = "usb-side-power"; | ||||
| 			gpio-export,output = <1>; | ||||
| 			gpios = <&tlmm 30 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	soc { | ||||
| 		pinctrl@1000000 { | ||||
| 			pinctrl-0 = <&mcu_rst &mcu_rsv &usb_rear_pwr &usb_side_pwr &usb_hub_rst>; | ||||
| 			pinctrl-names = "default"; | ||||
|  | ||||
| 			mcu_rst: mcu_rst_pins { | ||||
| 				pins = "gpio54"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-low; | ||||
| 			}; | ||||
|  | ||||
| 			mcu_rsv: mcu_rsv_pins { | ||||
| 				pins = "gpio56"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 			}; | ||||
|  | ||||
| 			usb_rear_pwr: usb_rear_pwr_pins { | ||||
| 				pins = "gpio29"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-high; | ||||
| 			}; | ||||
|  | ||||
| 			usb_side_pwr: usb_side_pwr_pins { | ||||
| 				pins = "gpio30"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-high; | ||||
| 			}; | ||||
|  | ||||
| 			usb_hub_rst: usb_hub_rst_pins { | ||||
| 				pins = "gpio55"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-high; | ||||
| 			}; | ||||
|  | ||||
| 			button_pins: button_pins { | ||||
| 				reset_button { | ||||
| 					pins = "gpio66"; | ||||
| @@ -40,30 +111,6 @@ | ||||
| 				}; | ||||
| 			}; | ||||
|  | ||||
| 			usb_mux_sel_pins: usb_mux_pins { | ||||
| 				mux { | ||||
| 					pins = "gpio27"; | ||||
| 					function = "gpio"; | ||||
| 					drive-strength = <8>; | ||||
| 					bias-pull-down; | ||||
| 				}; | ||||
| 			}; | ||||
|  | ||||
| 			pcie0_pins: pcie_pins { | ||||
| 				pcie0_rst { | ||||
| 					pins = "gpio58"; | ||||
| 					function = "pcie0_rst"; | ||||
| 					drive-strength = <8>; | ||||
| 					bias-pull-down; | ||||
| 				}; | ||||
| 				pcie0_wake { | ||||
| 					pins = "gpio59"; | ||||
| 					function = "pcie0_wake"; | ||||
| 					drive-strength = <8>; | ||||
| 					bias-pull-down; | ||||
| 				}; | ||||
| 			}; | ||||
|  | ||||
| 			mdio_pins: mdio_pinmux { | ||||
| 				mux_0 { | ||||
| 					pins = "gpio68"; | ||||
| @@ -170,19 +217,6 @@ | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		phy@84000 { | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		phy@86000 { | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		pci@20000000 { | ||||
| 			perst-gpio = <&tlmm 58 1>; | ||||
| 			status = "ok"; | ||||
| 		}; | ||||
|  | ||||
| 		gpio_keys { | ||||
| 			compatible = "gpio-keys"; | ||||
| 			pinctrl-0 = <&button_pins>; | ||||
|   | ||||
| @@ -16,6 +16,7 @@ | ||||
|  | ||||
| 	aliases { | ||||
| 		serial0 = &blsp1_uart5; | ||||
| 		serial1 = &blsp1_uart3; | ||||
| 		/* Aliases as required by u-boot to patch MAC addresses */ | ||||
| 		ethernet0 = "/soc/dp1"; | ||||
| 		ethernet1 = "/soc/dp2"; | ||||
| @@ -29,6 +30,17 @@ | ||||
| 		stdout-path = "serial0"; | ||||
| 	}; | ||||
|  | ||||
| 	gpio-export { | ||||
| 		compatible = "gpio-export"; | ||||
| 		#size-cells = <0>; | ||||
|  | ||||
| 		mcu-enable { | ||||
| 			gpio-export,name = "mcu-enable"; | ||||
| 			gpio-export,output = <0>; | ||||
| 			gpios = <&tlmm 34 GPIO_ACTIVE_HIGH>; | ||||
| 		}; | ||||
| 	}; | ||||
|  | ||||
| 	reserved-memory { | ||||
| /* No Pine attach in 256M profile */ | ||||
| #if !defined(__IPQ_MEM_PROFILE_256_MB__) | ||||
| @@ -130,6 +142,26 @@ | ||||
|  | ||||
| 	soc { | ||||
| 		pinctrl@1000000 { | ||||
| 			pinctrl-0 = <&mcu_rst>; | ||||
| 			pinctrl-names = "default"; | ||||
|  | ||||
| 			mcu_rst: mcu_rst_pins { | ||||
| 				pins = "gpio34"; | ||||
| 				function = "gpio"; | ||||
| 				drive-strength = <8>; | ||||
| 				bias-disable; | ||||
| 				output-low; | ||||
| 			}; | ||||
|  | ||||
| 			mcu_uart: mcu_uart_pins { | ||||
| 				mux { | ||||
| 					pins = "gpio48", "gpio49"; | ||||
| 					function = "blsp2_uart"; | ||||
| 					drive-strength = <8>; | ||||
| 					bias-disable; | ||||
| 				}; | ||||
| 			}; | ||||
|  | ||||
| 			button_pins: button_pins { | ||||
| 				wps_button { | ||||
| 					pins = "gpio67"; | ||||
| @@ -688,6 +720,12 @@ | ||||
| 	}; | ||||
| }; | ||||
|  | ||||
| &blsp1_uart3 { | ||||
| 	pinctrl-0 = <&mcu_uart>; | ||||
| 	pinctrl-names = "default"; | ||||
| 	status = "ok"; | ||||
| }; | ||||
|  | ||||
| &npu_cpr { | ||||
| 	status = "disabled"; | ||||
| }; | ||||
|   | ||||
| @@ -9,29 +9,17 @@ define Device/cig_wf194c4 | ||||
| endef | ||||
| TARGET_DEVICES += cig_wf194c4 | ||||
|  | ||||
| define Device/cig_wf196_us | ||||
| define Device/cig_wf196 | ||||
|   DEVICE_TITLE := CIG WF196 | ||||
|   DEVICE_DTS := qcom-ipq807x-wf196 | ||||
|   DEVICE_DTS_CONFIG=config@hk14 | ||||
|   SUPPORTED_DEVICES := cig,wf196 | ||||
|   BLOCKSIZE := 256k | ||||
|   PAGESIZE := 4096 | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf196-us aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 \ | ||||
|   	ath11k-firmware-qcn9000 ath11k-wifi-cig-wf196_6g-us | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf196 aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 \ | ||||
|   	ath11k-firmware-qcn9000 | ||||
| endef | ||||
| TARGET_DEVICES += cig_wf196_us | ||||
|  | ||||
| define Device/cig_wf196_ca | ||||
|   DEVICE_TITLE := CIG WF196 | ||||
|   DEVICE_DTS := qcom-ipq807x-wf196 | ||||
|   DEVICE_DTS_CONFIG=config@hk14 | ||||
|   SUPPORTED_DEVICES := cig,wf196 | ||||
|   BLOCKSIZE := 256k | ||||
|   PAGESIZE := 4096 | ||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf196-ca aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 \ | ||||
|   	ath11k-firmware-qcn9000 ath11k-wifi-cig-wf196_6g-ca | ||||
| endef | ||||
| TARGET_DEVICES += cig_wf196_ca | ||||
| TARGET_DEVICES += cig_wf196 | ||||
|  | ||||
| define Device/edgecore_eap102 | ||||
|   DEVICE_TITLE := Edgecore EAP102 | ||||
|   | ||||
							
								
								
									
										54
									
								
								feeds/ipq807x_v5.4/ipq807x/patches/301-diag_char.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										54
									
								
								feeds/ipq807x_v5.4/ipq807x/patches/301-diag_char.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,54 @@ | ||||
| Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/char/diag/diagchar_core.c | ||||
| =================================================================== | ||||
| --- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/char/diag/diagchar_core.c | ||||
| +++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/char/diag/diagchar_core.c | ||||
| @@ -763,11 +763,6 @@ static void diag_cmd_invalidate_polling( | ||||
|  	driver->polling_reg_flag = 0; | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			return; | ||||
| -		} | ||||
|  		polling = diag_cmd_chk_polling(&item->entry); | ||||
|  		if (polling == DIAG_CMD_POLLING) { | ||||
|  			driver->polling_reg_flag = 1; | ||||
| @@ -829,11 +824,6 @@ struct diag_cmd_reg_entry_t *diag_cmd_se | ||||
|   | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			return NULL; | ||||
| -		} | ||||
|  		temp_entry = &item->entry; | ||||
|  		if (temp_entry->cmd_code == entry->cmd_code && | ||||
|  		    temp_entry->subsys_id == entry->subsys_id && | ||||
| @@ -907,12 +897,6 @@ void diag_cmd_remove_reg_by_pid(int pid) | ||||
|  	mutex_lock(&driver->cmd_reg_mutex); | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			mutex_unlock(&driver->cmd_reg_mutex); | ||||
| -			return; | ||||
| -		} | ||||
|  		if (item->pid == pid) { | ||||
|  			list_del(&item->link); | ||||
|  			kfree(item); | ||||
| @@ -931,12 +915,6 @@ void diag_cmd_remove_reg_by_proc(int pro | ||||
|  	mutex_lock(&driver->cmd_reg_mutex); | ||||
|  	list_for_each_safe(start, temp, &driver->cmd_reg_list) { | ||||
|  		item = list_entry(start, struct diag_cmd_reg_t, link); | ||||
| -		if (&item->entry == NULL) { | ||||
| -			pr_err("diag: In %s, unable to search command\n", | ||||
| -			       __func__); | ||||
| -			mutex_unlock(&driver->cmd_reg_mutex); | ||||
| -			return; | ||||
| -		} | ||||
|  		if (item->proc == proc) { | ||||
|  			list_del(&item->link); | ||||
|  			kfree(item); | ||||
							
								
								
									
										27
									
								
								feeds/ipq807x_v5.4/libtcmd/patches/100-compile.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										27
									
								
								feeds/ipq807x_v5.4/libtcmd/patches/100-compile.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,27 @@ | ||||
| Index: libtcmd-11.5/libtcmd.h | ||||
| =================================================================== | ||||
| --- libtcmd-11.5.orig/libtcmd.h | ||||
| +++ libtcmd-11.5/libtcmd.h | ||||
| @@ -71,7 +71,9 @@ struct tcmd_cfg { | ||||
|  	struct sigevent sev; | ||||
|  	timer_t timer; | ||||
|  	bool timeout; | ||||
| -} tcmd_cfg; | ||||
| +}; | ||||
| + | ||||
| +extern struct tcmd_cfg tcmd_cfg; | ||||
|   | ||||
|  /* WLAN API */ | ||||
|  #ifdef WLAN_API_NL80211 | ||||
| Index: libtcmd-11.5/nl80211.c | ||||
| =================================================================== | ||||
| --- libtcmd-11.5.orig/nl80211.c | ||||
| +++ libtcmd-11.5/nl80211.c | ||||
| @@ -23,6 +23,7 @@ | ||||
|  #endif | ||||
|   | ||||
|  int cb_ret; | ||||
| +struct tcmd_cfg tcmd_cfg; | ||||
|   | ||||
|  #ifdef LIBNL_2 | ||||
|  static inline struct nl_sock *nl_handle_alloc(void) | ||||
| @@ -0,0 +1,58 @@ | ||||
| --- a/drivers/net/wireless/ath/ath11k/core.h | ||||
| +++ b/drivers/net/wireless/ath/ath11k/core.h | ||||
| @@ -786,6 +786,7 @@ struct ath11k { | ||||
|  	u32 max_tx_power; | ||||
|  	u32 txpower_limit_2g; | ||||
|  	u32 txpower_limit_5g; | ||||
| +	u32 txpower_limit_6g; | ||||
|  	u32 txpower_scale; | ||||
|  	u32 power_scale; | ||||
|  	u32 chan_tx_pwr; | ||||
| --- a/drivers/net/wireless/ath/ath11k/mac.c | ||||
| +++ b/drivers/net/wireless/ath/ath11k/mac.c | ||||
| @@ -633,6 +633,7 @@ static void ath11k_pdev_caps_update(stru | ||||
|   | ||||
|  	ar->txpower_limit_2g = ar->max_tx_power; | ||||
|  	ar->txpower_limit_5g = ar->max_tx_power; | ||||
| +	ar->txpower_limit_6g = ar->max_tx_power; | ||||
|  	ar->txpower_scale = WMI_HOST_TP_SCALE_MAX; | ||||
|  } | ||||
|   | ||||
| @@ -803,6 +804,16 @@ static int ath11k_mac_txpower_recalc(str | ||||
|  		ar->txpower_limit_5g = txpower; | ||||
|  	} | ||||
|   | ||||
| +        if ((ar->hw->wiphy->bands[NL80211_BAND_6GHZ]) && | ||||
| +            ar->txpower_limit_6g != txpower) { | ||||
| +                param = WMI_PDEV_PARAM_TXPOWER_LIMIT5G; | ||||
| +                ret = ath11k_wmi_pdev_set_param(ar, param, | ||||
| +                                                txpower, ar->pdev->pdev_id); | ||||
| +                if (ret) | ||||
| +                        goto fail; | ||||
| +                ar->txpower_limit_6g = txpower; | ||||
| +        } | ||||
| + | ||||
|  	return 0; | ||||
|   | ||||
|  fail: | ||||
| @@ -3542,18 +3553,8 @@ static void ath11k_mac_op_bss_info_chang | ||||
|  		ath11k_dbg(ar->ab, ATH11K_DBG_MAC, "mac vdev_id %i txpower %d\n", | ||||
|  			   arvif->vdev_id, info->txpower); | ||||
|   | ||||
| -		if (ar->supports_6ghz && info->chandef.chan && | ||||
| -		    info->chandef.chan->band == NL80211_BAND_6GHZ && | ||||
| -		    (arvif->vdev_type == WMI_VDEV_TYPE_STA || | ||||
| -		     arvif->vdev_type == WMI_VDEV_TYPE_AP) && | ||||
| -		    test_bit(WMI_TLV_SERVICE_EXT_TPC_REG_SUPPORT, | ||||
| -			     ar->ab->wmi_ab.svc_map)) { | ||||
| -			ath11k_dbg(ar->ab, ATH11K_DBG_MAC, | ||||
| -				   "discard tx power, change to set TPC power\n"); | ||||
| -		} else { | ||||
| -			arvif->txpower = info->txpower; | ||||
| -			ath11k_mac_txpower_recalc(ar); | ||||
| -		} | ||||
| +		arvif->txpower = info->txpower; | ||||
| +		ath11k_mac_txpower_recalc(ar); | ||||
|  	} | ||||
|   | ||||
|  	if (changed & BSS_CHANGED_MCAST_RATE && | ||||
| @@ -29,7 +29,6 @@ define Package/qca-diag/Description | ||||
|   stack. | ||||
| endef | ||||
|  | ||||
|  | ||||
| QCASSDK_CONFIG_OPTS+= TOOL_PATH=$(TOOLCHAIN_DIR)/bin/ \ | ||||
|                 SYS_PATH=$(LINUX_DIR) \ | ||||
|                 TOOLPREFIX=$(TARGET_CROSS) \ | ||||
|   | ||||
| @@ -2,7 +2,7 @@ INCLUDE_DIR +=  include -I src | ||||
| LIB	:= -lpthread -shared | ||||
| LDFLAGS +=  -Llib/ -ldiag -lpthread -pie | ||||
| FLAGS = -fPIC -g -DUSE_MUSL | ||||
| EXTRA_CFLAGS = $(TARGET_CFLAGS) $(TARGET_LDFLAGS) $(TARGET_CPPFLAGS) -fstack-protector-all -znow -zrelro -Werror -Wno-error=attributes | ||||
| EXTRA_CFLAGS = $(TARGET_CFLAGS) $(TARGET_LDFLAGS) $(TARGET_CPPFLAGS) -fstack-protector-all -znow -zrelro -Werror -Wno-error=address-of-packed-member -Wl,--allow-multiple-definition -Wno-error=attributes  | ||||
| sample_cliobj	:= dci_client/diag_dci_sample.c | ||||
| klogobj		:= klog/diag_klog.c | ||||
| mdobj		:= mdlog/diag_mdlog.c | ||||
|   | ||||
| @@ -123,17 +123,23 @@ when       who     what, where, why | ||||
|  | ||||
| #define GUID_LEN 16 | ||||
|  | ||||
| #ifdef ANDROID | ||||
| #if defined (ANDROID) || defined (USE_ANDROID_LOGGING) | ||||
| 	#define LOG_TAG "Diag_Lib" | ||||
| 	#define DIAG_LOGE(...)  { \ | ||||
| 		ALOGE(__VA_ARGS__); \ | ||||
| 		if (!diag_disable_console) \ | ||||
| 			printf(__VA_ARGS__); \ | ||||
| 	} | ||||
| 	#include <cutils/log.h> | ||||
| 	#define DIAG_LOGD(...)  { \ | ||||
| 		ALOGE(__VA_ARGS__); \ | ||||
| 		if (!diag_disable_console) \ | ||||
| 			printf(__VA_ARGS__); \ | ||||
| 	} | ||||
| 	#include <log/log.h> | ||||
|     #include "common_log.h" | ||||
| #else | ||||
| 	#define DIAG_LOGE(...) printf (__VA_ARGS__) | ||||
| 	#define DIAG_LOGD(...) printf (__VA_ARGS__) | ||||
| #endif | ||||
| #include <pthread.h> | ||||
| #include <stdio.h> | ||||
| @@ -167,6 +173,12 @@ typedef enum { | ||||
| 	DB_PARSER_STATE_CLOSE, | ||||
| } qsr4_db_file_parser_state; | ||||
|  | ||||
| /* enum to handle packet processing status */ | ||||
| enum pkt_status{ | ||||
| 	PKT_PROCESS_ONGOING, | ||||
| 	PKT_PROCESS_DONE | ||||
| }; | ||||
|  | ||||
| /* | ||||
|  * Structure to keep track of diag callback interface clients. Please note that | ||||
|  * there can be only client communicating with an ASIC at a given time. | ||||
|   | ||||
| @@ -64,7 +64,7 @@ when       who    what, where, why | ||||
| #define PID_DIR "/root/diag_logs" | ||||
| #define MAX_CHAN	4 | ||||
|  | ||||
| static unsigned char read_buf[4096]; | ||||
| static unsigned char read_buf[MAX_CHAN][4096]; | ||||
| static char ip_addr_name[FILE_NAME_LEN] = "192.168.0.10"; | ||||
| static char port_number_string[FILE_NAME_LEN] = "2500"; | ||||
| static int port_number = 2500; | ||||
| @@ -397,13 +397,22 @@ int open_connection(struct diag_socket *sock) | ||||
| int read_socket(struct diag_socket *socket) | ||||
| { | ||||
| 	int num_read; | ||||
| 	int status; | ||||
|  | ||||
| repeat: | ||||
| 	/* Read from the socket */ | ||||
| 	memset(read_buf, 0, 4096); | ||||
| 	num_read = recv(socket->fd, (unsigned char *)read_buf, 4096, 0); | ||||
| 	memset(read_buf[socket->id], 0, 4096); | ||||
| 	num_read = recv(socket->fd, (unsigned char *)read_buf[socket->id], 4096, 0); | ||||
| 	if (num_read > 0) { | ||||
| 		/* Send the data read off of the socket to the kernel via the library */ | ||||
| 		diag_send_socket_data(socket->id, read_buf, num_read); | ||||
| 		/* | ||||
| 		 * Process socket data to make sure full command is received before send it | ||||
| 		 * to the diag core via the library. If return value is not PKT_PROCESS_DONE | ||||
| 		 * then this is the case of partial packet and wait for pending bytes to | ||||
| 		 * get full diag command. | ||||
| 		 */ | ||||
| 		status = diag_send_socket_data(socket->id, read_buf[socket->id], num_read); | ||||
| 		if (status != PKT_PROCESS_DONE) | ||||
| 			goto repeat; | ||||
| 	} else if (num_read == -1) { | ||||
| 		DIAG_LOGE("diag_socket_log: Read socket error: %s, errno: %d\n", | ||||
| 				strerror(errno), errno); | ||||
|   | ||||
| @@ -89,6 +89,9 @@ when       who    what, where, why | ||||
|  | ||||
| #define MAX_CHANNELS 4 | ||||
|  | ||||
| #define MAX_USER_PKT_SIZE		16384 | ||||
| #define USER_SPACE_DATA_TYPE_SIZE	4 | ||||
|  | ||||
| #define DCI_HEADER_LENGTH	sizeof(int) | ||||
| #define DCI_LEN_FIELD_LENGTH	sizeof(int) | ||||
| #define DCI_EVENT_OFFSET	sizeof(uint16) | ||||
| @@ -134,6 +137,13 @@ when       who    what, where, why | ||||
| 	char dir_name[FILE_NAME_LEN]; | ||||
| 	char peripheral_name[FILE_NAME_LEN]; | ||||
|  | ||||
| /* enum defined to handle full/partial packet case */ | ||||
| typedef enum { | ||||
| 	PKT_START, | ||||
| 	PKT_HEADER, | ||||
| 	PKT_PAYLOAD | ||||
| } diag_pkt_states; | ||||
|  | ||||
| static struct diag_callback_tbl_t cb_clients[NUM_PROC]; | ||||
| static int socket_inited = 0; | ||||
| static int (*socket_cb_ptr)(void *socket_cb_data_ptr, int socket_id); | ||||
| @@ -619,46 +629,246 @@ SIDE EFFECTS | ||||
| ===========================================================================*/ | ||||
| int diag_send_socket_data(int id, unsigned char buf[], int num_bytes) | ||||
| { | ||||
| 	unsigned char send_buf[4100]; | ||||
| 	unsigned char offset = 4; | ||||
| 	int i; | ||||
| 	int start = 0; | ||||
| 	int end = 0; | ||||
| 	int copy_bytes; | ||||
| 	int success; | ||||
| 	static unsigned char send_buf[MAX_CHANNELS][MAX_USER_PKT_SIZE]; | ||||
| 	static unsigned char extra_header = USER_SPACE_DATA_TYPE_SIZE; | ||||
| 	static unsigned char tmp_header[DIAG_NON_HDLC_HEADER_SIZE]; | ||||
| 	static diag_pkt_states pkt_state = PKT_START; | ||||
| 	static int hdlc_pkt_pending = FALSE; | ||||
| 	static uint32_t total_pkt_size = 0; | ||||
| 	static uint32_t bytes_required = 0; | ||||
| 	static int s_char = 0, e_char = 0; | ||||
| 	static uint32_t pkt_start_off = 0; | ||||
| 	static uint32_t saved_bytes = 0; | ||||
| 	int status = PKT_PROCESS_DONE; | ||||
| 	int packet_len_index = 0; | ||||
| 	uint16_t packet_len = 0; | ||||
| 	int i = 0, j = 0; | ||||
|  | ||||
| 	if ((id >= 0) && (id < MAX_CHANNELS)) { | ||||
| 		*(int *)send_buf = USER_SPACE_DATA_TYPE; | ||||
| 		if (socket_token[id] != 0 ) { | ||||
| 			*(int *)(send_buf + offset) = socket_token[id]; | ||||
| 			offset += 4; | ||||
| 	if ((id < 0) || id >= MAX_CHANNELS) { | ||||
| 		DIAG_LOGE("diag_socket_log: %s: Error sending socket data. socket id: %d, num_bytes: %d\n", | ||||
| 			__func__, id, num_bytes); | ||||
| 		return PKT_PROCESS_DONE; | ||||
| 	} | ||||
|  | ||||
| 	for (i = 0; i < num_bytes; i++) { | ||||
| 			if (hdlc_disabled) { | ||||
| 				if (buf[i] == CONTROL_CHAR && i == 0) { | ||||
| 					end = end + 1; | ||||
| 					continue; | ||||
| 		status = PKT_PROCESS_ONGOING; | ||||
| 		switch (pkt_state) | ||||
| 		{ | ||||
| 		case PKT_START: | ||||
| 			if (buf[i] == CONTROL_CHAR && !hdlc_pkt_pending) { | ||||
| 				s_char = buf[i]; | ||||
| 				pkt_start_off = i; | ||||
| 				/* probably it is non-HDLC packet */ | ||||
| 				if (num_bytes >= (pkt_start_off + DIAG_NON_HDLC_HEADER_SIZE)) { | ||||
| 					/* received full header */ | ||||
| 					packet_len_index = pkt_start_off + 2; | ||||
| 					packet_len = (uint16_t)(*(uint16_t *)(buf + packet_len_index)); | ||||
| 					total_pkt_size = DIAG_NON_HDLC_HEADER_SIZE + packet_len + 1; | ||||
| 					if (total_pkt_size <= (num_bytes - pkt_start_off)) { | ||||
| 						e_char = buf[total_pkt_size-1]; | ||||
| 						if (s_char == e_char) { | ||||
| 							/* full non-HDLC packet received */ | ||||
| 							memset(send_buf[id], 0, MAX_USER_PKT_SIZE); | ||||
| 							*(int *)send_buf[id] = USER_SPACE_DATA_TYPE; | ||||
| 							if (socket_token[id] != 0) { | ||||
| 								*(int *)(send_buf[id] + extra_header) = socket_token[id]; | ||||
| 								extra_header += sizeof(int); | ||||
| 							} | ||||
| 							memcpy(send_buf[id] + extra_header, buf, total_pkt_size); | ||||
| 							/* send it diag core */ | ||||
| 							diag_send_data(send_buf[id], total_pkt_size + extra_header); | ||||
| 							i += total_pkt_size - 1; | ||||
| 							s_char = 0; | ||||
| 							e_char = 0; | ||||
| 							total_pkt_size = 0; | ||||
| 							extra_header = USER_SPACE_DATA_TYPE_SIZE; | ||||
| 							status = PKT_PROCESS_DONE; | ||||
| 						} | ||||
| 			if (buf[i] == CONTROL_CHAR) { | ||||
| 				copy_bytes = end-start+1; | ||||
| 				memcpy(send_buf+offset, buf+start, copy_bytes); | ||||
| 				diag_send_data(send_buf, copy_bytes+offset); | ||||
| 				start = i+1; | ||||
| 				end = i+1; | ||||
| 				continue; | ||||
| 			} | ||||
| 			end = end+1; | ||||
| 		} | ||||
| 		success = 1; | ||||
| 					} else { | ||||
| 		DIAG_LOGE("diag: In %s, Error sending socket data. Invalid socket id: %d\n", | ||||
| 			__func__, id); | ||||
| 		success = 0; | ||||
| 						/* full header + partial packet received */ | ||||
| 						pkt_state = PKT_PAYLOAD; | ||||
| 						memset(send_buf[id], 0, MAX_USER_PKT_SIZE); | ||||
| 						*(int *)send_buf[id] = USER_SPACE_DATA_TYPE; | ||||
| 						if (socket_token[id] != 0) { | ||||
| 							*(int *)(send_buf[id] + extra_header) = socket_token[id]; | ||||
| 							extra_header += sizeof(int); | ||||
| 						} | ||||
| 						memcpy(send_buf[id] + extra_header, (buf + pkt_start_off), (num_bytes - pkt_start_off)); | ||||
| 						saved_bytes = (num_bytes - pkt_start_off + extra_header); | ||||
| 						bytes_required = total_pkt_size - (saved_bytes - extra_header); | ||||
| 						i += num_bytes - 1; | ||||
| 						DIAG_LOGD("%s:PKT_START: full header + partial pkt received, total_pkt_size %d recvd %d pending %d\n", | ||||
| 							__func__, total_pkt_size, (saved_bytes - extra_header), bytes_required); | ||||
| 					} | ||||
| 				} else { | ||||
| 					/* partial header received */ | ||||
| 					memcpy(tmp_header, (buf + pkt_start_off), (num_bytes - pkt_start_off)); | ||||
| 					saved_bytes = (num_bytes - pkt_start_off); | ||||
| 					bytes_required = DIAG_NON_HDLC_HEADER_SIZE - saved_bytes; | ||||
| 					i += num_bytes - 1; | ||||
| 					pkt_state = PKT_HEADER; | ||||
| 					DIAG_LOGD("%s:PKT_START: partial header received, recvd %d pending %d\n", | ||||
| 						__func__, saved_bytes, bytes_required); | ||||
| 				} | ||||
| 			} else { | ||||
| 				/* HDLC packet will enter here */ | ||||
| 				if (!hdlc_pkt_pending) { | ||||
| 					hdlc_pkt_pending = TRUE; | ||||
| 					memset(send_buf[id], 0, MAX_USER_PKT_SIZE); | ||||
| 					*(int *)send_buf[id] = USER_SPACE_DATA_TYPE; | ||||
| 					if (socket_token[id] != 0) { | ||||
| 						*(int *)(send_buf[id] + extra_header) = socket_token[id]; | ||||
| 						extra_header += sizeof(int); | ||||
| 					} | ||||
| 					saved_bytes = extra_header; | ||||
| 				} | ||||
| 				/* iterate through the packet to find the delimiter */ | ||||
| 				for (j = 0; j < num_bytes; j++) { | ||||
| 					if (buf[j] == CONTROL_CHAR) { | ||||
| 						if (j == (num_bytes - 1)) { | ||||
| 							/* delimiter found at the end of current packet | ||||
| 							 * probably this is end of HDLC packet | ||||
| 							 */ | ||||
| 							if (saved_bytes + num_bytes >= MAX_USER_PKT_SIZE) { | ||||
| 								DIAG_LOGE("%s:hdlc: command too large, dropping pkt\n", __func__); | ||||
| 								hdlc_pkt_pending = FALSE; | ||||
| 								saved_bytes = 0; | ||||
| 								i += num_bytes - 1; | ||||
| 								break; | ||||
| 							} | ||||
| 							memcpy(send_buf[id] + saved_bytes, buf, num_bytes); | ||||
| 							/* send it to diag core */ | ||||
| 							diag_send_data(send_buf[id], saved_bytes + num_bytes); | ||||
| 							hdlc_pkt_pending = FALSE; | ||||
| 							i += num_bytes - 1; | ||||
| 							saved_bytes = 0; | ||||
| 							extra_header = USER_SPACE_DATA_TYPE_SIZE; | ||||
| 							status = PKT_PROCESS_DONE; | ||||
| 						} else { | ||||
| 							/* delimiter character may come at the middle of packet | ||||
| 							 * just ignore as we cant handle this case | ||||
| 							 */ | ||||
| 							DIAG_LOGD("%s:hdlc: Delimiter found at the middle index %d\n", __func__, j); | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 				/* full HDLC packet has not received */ | ||||
| 				if (hdlc_pkt_pending) { | ||||
| 					if (saved_bytes + num_bytes >= MAX_USER_PKT_SIZE) { | ||||
| 						DIAG_LOGE("%s:hdlc: command too large, dropping pkt\n", __func__); | ||||
| 						hdlc_pkt_pending = FALSE; | ||||
| 						saved_bytes = 0; | ||||
| 						i += num_bytes - 1; | ||||
| 						break; | ||||
| 					} | ||||
| 					memcpy(send_buf[id] + saved_bytes, buf, num_bytes); | ||||
| 					saved_bytes += num_bytes; | ||||
| 					i += num_bytes - 1; | ||||
| 					DIAG_LOGD("%s:hdlc: Partial Packet received, recvd %d\n", __func__, | ||||
| 						(saved_bytes - extra_header)); | ||||
| 				} | ||||
| 			} | ||||
| 			break; | ||||
|  | ||||
| 		case PKT_HEADER: | ||||
| 			if(num_bytes >= bytes_required){ | ||||
| 				/* we have full header now */ | ||||
| 				memcpy(tmp_header+saved_bytes, buf, bytes_required); | ||||
| 				packet_len = (uint16_t)(*(uint16_t *)(tmp_header + 2)); | ||||
| 				total_pkt_size = DIAG_NON_HDLC_HEADER_SIZE + packet_len + 1; | ||||
| 				if (total_pkt_size <= (num_bytes + saved_bytes)) { | ||||
| 					/* might received full packet */ | ||||
| 					e_char = buf[total_pkt_size - saved_bytes - 1]; | ||||
| 					if (s_char == e_char) { | ||||
| 						/* full non-HDLC packet received */ | ||||
| 						memset(send_buf[id], 0, MAX_USER_PKT_SIZE); | ||||
| 						*(int *)send_buf[id] = USER_SPACE_DATA_TYPE; | ||||
| 						if (socket_token[id] != 0) { | ||||
| 							*(int *)(send_buf[id] + extra_header) = socket_token[id]; | ||||
| 							extra_header += sizeof(int); | ||||
| 						} | ||||
| 						memcpy(send_buf[id] + extra_header, tmp_header, saved_bytes); | ||||
| 						memcpy(send_buf[id] + extra_header + saved_bytes, buf, | ||||
| 								total_pkt_size - saved_bytes); | ||||
| 						/* send it to diag core */ | ||||
| 						diag_send_data(send_buf[id], total_pkt_size + extra_header); | ||||
| 						i += total_pkt_size - saved_bytes - 1; | ||||
| 						s_char = 0; | ||||
| 						e_char = 0; | ||||
| 						total_pkt_size = 0; | ||||
| 						bytes_required = 0; | ||||
| 						saved_bytes = 0; | ||||
| 						extra_header = USER_SPACE_DATA_TYPE_SIZE; | ||||
| 						pkt_state = PKT_START; | ||||
| 						status = PKT_PROCESS_DONE; | ||||
| 					} | ||||
| 				} else { | ||||
| 					/* full header + partial packet received */ | ||||
| 					pkt_state = PKT_PAYLOAD; | ||||
| 					memset(send_buf[id], 0, MAX_USER_PKT_SIZE); | ||||
| 					*(int *)send_buf[id] = USER_SPACE_DATA_TYPE; | ||||
| 					if (socket_token[id] != 0) { | ||||
| 						*(int *)(send_buf[id] + extra_header) = socket_token[id]; | ||||
| 						extra_header += sizeof(int); | ||||
| 					} | ||||
| 					/* copy partial header received */ | ||||
| 					memcpy(send_buf[id] + extra_header, tmp_header, saved_bytes); | ||||
| 					memcpy(send_buf[id] + extra_header + saved_bytes, buf, num_bytes); | ||||
| 					bytes_required = total_pkt_size - saved_bytes - num_bytes; | ||||
| 					i += num_bytes - 1; | ||||
| 					saved_bytes += num_bytes + extra_header; | ||||
| 					DIAG_LOGD("%s:PKT_HEADER: full header + partial pkt received, total_pkt_size %d recvd %d pending %d\n", | ||||
| 						__func__, total_pkt_size, (saved_bytes - extra_header), bytes_required); | ||||
| 				} | ||||
| 			} else { | ||||
| 				/* still full header not yet received */ | ||||
| 				memcpy(tmp_header + saved_bytes, buf, num_bytes); | ||||
| 				saved_bytes += num_bytes; | ||||
| 				bytes_required = DIAG_NON_HDLC_HEADER_SIZE - saved_bytes; | ||||
| 				i += num_bytes - 1; | ||||
| 				DIAG_LOGD("%s:PKT_HEADER: still partial header received, recvd %d pending %d\n", | ||||
| 					__func__, saved_bytes, bytes_required); | ||||
| 			} | ||||
| 			break; | ||||
|  | ||||
| 		case PKT_PAYLOAD: | ||||
| 			if(num_bytes >= bytes_required){ | ||||
| 				/* received pending bytes */ | ||||
| 				e_char = buf[bytes_required - 1]; | ||||
| 				if (s_char == e_char) { | ||||
| 					/* full non-HDLC packet received */ | ||||
| 					memcpy(send_buf[id] + saved_bytes, buf, bytes_required); | ||||
| 					/* send it to diag core */ | ||||
| 					diag_send_data(send_buf[id], total_pkt_size + extra_header); | ||||
| 					i += bytes_required - 1; | ||||
| 					s_char = 0; | ||||
| 					e_char = 0; | ||||
| 					total_pkt_size = 0; | ||||
| 					bytes_required = 0; | ||||
| 					saved_bytes = 0; | ||||
| 					extra_header = USER_SPACE_DATA_TYPE_SIZE; | ||||
| 					pkt_state = PKT_START; | ||||
| 					status = PKT_PROCESS_DONE; | ||||
| 				} | ||||
| 			} else { | ||||
| 				/* still not yet received the full packet */ | ||||
| 				memcpy(send_buf[id] + saved_bytes, buf, num_bytes); | ||||
| 				bytes_required = total_pkt_size - (saved_bytes - | ||||
| 								extra_header) - num_bytes; | ||||
| 				i += num_bytes - 1; | ||||
| 				saved_bytes += num_bytes; | ||||
| 				DIAG_LOGD("%s:PKT_PAYLOAD: Still waiting for full packet,saved %d pending %d\n", | ||||
| 							__func__, (saved_bytes - extra_header), bytes_required); | ||||
| 			} | ||||
| 			break; | ||||
| 		default: | ||||
| 			DIAG_LOGD("%s:default: Unexpected packet state\n", | ||||
| 						__func__); | ||||
| 			break; | ||||
| 		} | ||||
| 	} | ||||
|  | ||||
| 	return success; | ||||
| 	return status; | ||||
| } | ||||
|  | ||||
| /*========================================================================== | ||||
| @@ -2300,6 +2510,7 @@ int diag_read_mask_file(void) | ||||
| 		if (!found_cmd) { | ||||
| 			DIAG_LOGE("Sorry, could not find valid commands in the mask file," | ||||
| 					"please check the mask file again\n"); | ||||
| 			fclose(read_mask_fp); | ||||
| 			return -1; | ||||
| 		} | ||||
| 	} else { | ||||
| @@ -2321,6 +2532,7 @@ int diag_read_mask_file(void) | ||||
| 			if (mask_buf[count_mask_bytes] != CONTROL_CHAR && i == 0) { | ||||
| 				DIAG_LOGE("Sorry, the mask file doesn't adhere to framing definition," | ||||
| 					"please check the mask file again\n"); | ||||
| 				fclose(read_mask_fp); | ||||
| 				return -1; | ||||
| 			} | ||||
| 			if (count_mask_bytes > payload && mask_buf[count_mask_bytes] == CONTROL_CHAR && i != 0) { | ||||
|   | ||||
| @@ -34,6 +34,14 @@ when       who     what, where, why | ||||
| #define DIAG_MDLOG_PID_FILE_SZ  100 | ||||
| #define NUM_PROC 10 | ||||
| #define HDLC_DISABLE	1 | ||||
|  | ||||
| /* Non-HDLC Header: | ||||
|  * 1 byte - Control char | ||||
|  * 1 byte - Version | ||||
|  * 2 bytes - Packet length | ||||
|  */ | ||||
| #define DIAG_NON_HDLC_HEADER_SIZE       4 | ||||
|  | ||||
| extern int diag_fd; | ||||
| extern int fd_md[NUM_PROC]; | ||||
| extern int gdwClientID; | ||||
|   | ||||
| @@ -249,6 +249,8 @@ static int diag_qsr4_db_file_mem_init(qsr4_db_file_list** file_entry) | ||||
| 	} | ||||
| 	if (entry->head == NULL) | ||||
| 		entry->head = file_block_offset; | ||||
| 	else | ||||
| 		free(file_block_offset); | ||||
|  | ||||
| 	return TRUE; | ||||
|  | ||||
|   | ||||
| @@ -1,11 +1,11 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=ath12k-firmware | ||||
| PKG_MIRROR_HASH:=a325f86b1d613f713d2e015abca4a9ff86c8448d4cd540fa022866da2c5aa042 | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_BRANCH:=main | ||||
| PKG_SOURCE_URL:=https://github.com/quic/upstream-wifi-fw.git | ||||
| PKG_MIRROR_HASH:=ade4287ff2935ad1d54e5dabb8e6de28f648d0974fa76238fcc1616235e6773e | ||||
| PKG_SOURCE_VERSION:=3417bb86645c5ff4c58258db7cc33e43260b4222 | ||||
| PKG_SOURCE_VERSION:=e90d32aaa149800ea79760639cb5ac9ddcfc8281 | ||||
|  | ||||
| PKG_MAINTAINER:=John Crispin <john@phrozen.org> | ||||
|  | ||||
| @@ -18,20 +18,59 @@ define Package/ath12k-firmware-default | ||||
|   DEPENDS:= | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-qcn92xx-split-phy | ||||
|   $(Package/ath12k-firmware-default) | ||||
|   TITLE:=ath12k firmware for qcn92xx split phy devices | ||||
|   DEPENDS:=@(TARGET_ipq95xx||TARGET_ipq53xx) | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-qcn92xx | ||||
|   $(Package/ath12k-firmware-default) | ||||
|   TITLE:=ath12k firmware for qcn92xx devices | ||||
|   DEPENDS:=@TARGET_ipq95xx | ||||
|   DEPENDS:=@(TARGET_ipq95xx||TARGET_ipq53xx) | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-ipq53xx | ||||
|   $(Package/ath12k-firmware-default) | ||||
|   TITLE:=ath12k firmware for ipq53xx devices | ||||
|   DEPENDS:=@TARGET_ipq53xx | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-ipq53xx-wk-wk | ||||
|   $(Package/ath12k-firmware-default) | ||||
|   TITLE:=ath12k firmware for ipq53xx + wk + wk devices | ||||
|   DEPENDS:=@TARGET_ipq53xx | ||||
| endef | ||||
|  | ||||
| define Build/Compile | ||||
|  | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-qcn92xx-split-phy/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0 | ||||
| 	$(CP) $(PKG_BUILD_DIR)/ath12k-firmware/QCN9274/hw2.0_split_phy/1.2.1/WLAN.WBE.1.2.1-00148-QCAHKSWPL_SILICONZ-1/* \ | ||||
| 		$(1)/lib/firmware/ath12k/QCN92XX/hw1.0 | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-qcn92xx/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw2.0 | ||||
| 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/ath12k-firmware/QCN9274/hw2.0/1.1.1/WLAN.WBE.1.1.1-00126-QCAHKSWPL_SILICONZ-1/* \ | ||||
| 		$(1)/lib/firmware/ath12k/QCN92XX/hw2.0 | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0 | ||||
| 	$(CP) $(PKG_BUILD_DIR)/ath12k-firmware/QCN9274/hw2.0/1.2.1/WLAN.WBE.1.2.1-00201-QCAHKSWPL_SILICONZ-1/* \ | ||||
| 		$(1)/lib/firmware/ath12k/QCN92XX/hw1.0 | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-ipq53xx/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/IPQ5332/ | ||||
| 	$(CP) $(PKG_BUILD_DIR)/ath12k-firmware//IPQ5322/hw1.0/1.2.1/WLAN.WBE.1.2.1-00201-QCAHKSWPL_SILICONZ-1/* \ | ||||
| 		$(1)/lib/firmware/IPQ5332/ | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-firmware-ipq53xx-wk-wk/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/IPQ5332/ | ||||
| 	$(CP) $(PKG_BUILD_DIR)/ath12k-firmware/IPQ5322_QCN6432_QCN6432/hw1.0/testing/1.3/WLAN.WBE.1.3-02907-QCAHKSWPL_SILICONZ-1/* \ | ||||
| 		$(1)/lib/firmware/IPQ5332/ | ||||
| endef | ||||
|  | ||||
| $(eval $(call BuildPackage,ath12k-firmware-qcn92xx)) | ||||
| $(eval $(call BuildPackage,ath12k-firmware-qcn92xx-split-phy)) | ||||
| $(eval $(call BuildPackage,ath12k-firmware-ipq53xx)) | ||||
| $(eval $(call BuildPackage,ath12k-firmware-ipq53xx-wk-wk)) | ||||
|   | ||||
| @@ -19,7 +19,7 @@ define Package/ath12k-wifi-default | ||||
|   SUBMENU:=ath12k Board-Specific Overrides | ||||
|   SECTION:=firmware | ||||
|   CATEGORY:=Firmware | ||||
|   DEPENDS:=@TARGET_qcn9274 | ||||
|   DEPENDS:=@(TARGET_qcn9274||TARGET_ipq53xx) | ||||
|   TITLE:=Custom Board | ||||
| endef | ||||
|  | ||||
| @@ -33,4 +33,32 @@ define Package/ath12k-wifi-qcom-qcn9274/install | ||||
| 	$(INSTALL_DATA) ./board-2.bin.QCN9274 $(1)/lib/firmware/ath12k/QCN9274/hw1.0/board-2.bin | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-wifi-cig-wf189 | ||||
| $(call Package/ath12k-wifi-default) | ||||
|     TITLE:=board.bin for CIG WF189 | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-wifi-sercomm-ap72tip | ||||
| $(call Package/ath12k-wifi-default) | ||||
|     TITLE:=board.bin for Sercomm WIFI-7 | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-wifi-cig-wf189/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0 $(1)/lib/firmware/ath12k/IPQ5332/hw1.0 | ||||
| 	$(INSTALL_DATA) ./regdb.bin $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-cig-wf189.bin.qcn9224 $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/board.bin | ||||
| 	$(INSTALL_DATA) ./regdb.bin $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-cig-wf189.bin.ipq53xx $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/board.bin | ||||
| endef | ||||
|  | ||||
| define Package/ath12k-wifi-sercomm-ap72tip/install | ||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0 $(1)/lib/firmware/ath12k/IPQ5332/hw1.0 | ||||
| 	$(INSTALL_DATA) ./regdb.bin $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-sercomm-ap72tip.bin.qcn9224 $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/board.bin | ||||
| 	$(INSTALL_DATA) ./regdb.bin $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/ | ||||
| 	$(INSTALL_DATA) ./board-sercomm-ap72tip.bin.ipq53xx $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/board.bin | ||||
| endef | ||||
|  | ||||
| $(eval $(call BuildPackage,ath12k-wifi-qcom-qcn9274)) | ||||
| $(eval $(call BuildPackage,ath12k-wifi-cig-wf189)) | ||||
| $(eval $(call BuildPackage,ath12k-wifi-sercomm-ap72tip)) | ||||
|   | ||||
							
								
								
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-cig-wf189.bin.ipq53xx
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-cig-wf189.bin.ipq53xx
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-cig-wf189.bin.qcn9224
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-cig-wf189.bin.qcn9224
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-sercomm-ap72tip.bin.ipq53xx
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-sercomm-ap72tip.bin.ipq53xx
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-sercomm-ap72tip.bin.qcn9224
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/board-sercomm-ap72tip.bin.qcn9224
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/regdb.bin
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								feeds/ipq95xx/ath12k-wifi/regdb.bin
									
									
									
									
									
										Executable file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -5,13 +5,11 @@ | ||||
| include $(TOPDIR)/rules.mk | ||||
|  | ||||
| PKG_NAME:=hostapd | ||||
| PKG_RELEASE:=$(AUTORELEASE) | ||||
| PKG_VERSION:=2023-02-21-ath12.3-cs | ||||
|  | ||||
| PKG_SOURCE_URL:=http://w1.fi/hostap.git | ||||
| PKG_SOURCE_PROTO:=git | ||||
| PKG_SOURCE_DATE:=2021-12-13 | ||||
| PKG_SOURCE_VERSION:=b26f5c0fe3 | ||||
| PKG_MIRROR_HASH:=2c5b72056b6efc3a16ca912118b324371527c7ac79c4b997349d94680538a7d8 | ||||
| PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | ||||
| PKG_HASH:=6153bacd614d9bb2dfba634dd698a698e37c043e08543a0802903718238a12fa | ||||
| PKG_SOURCE_URL:=@KERNEL/software/utils/dtc | ||||
|  | ||||
| PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | ||||
| PKG_LICENSE:=BSD-3-Clause | ||||
|   | ||||
| @@ -126,6 +126,7 @@ hostapd_common_add_device_config() { | ||||
| 	config_add_int airtime_mode | ||||
|  | ||||
| 	config_add_boolean multiple_bssid rnr_beacon he_co_locate ema | ||||
| 	config_add_boolean mlo | ||||
|  | ||||
| 	hostapd_add_log_config | ||||
| } | ||||
| @@ -140,7 +141,7 @@ hostapd_prepare_device_config() { | ||||
| 		acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density \ | ||||
| 		rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc \ | ||||
| 		multiple_bssid he_co_locate rnr_beacon ema acs_exclude_dfs \ | ||||
| 		maxassoc_ignore_probe | ||||
| 		maxassoc_ignore_probe mlo | ||||
|  | ||||
| 	hostapd_set_log_options base_cfg | ||||
|  | ||||
| @@ -155,6 +156,7 @@ hostapd_prepare_device_config() { | ||||
| 	set_default multiple_bssid 0 | ||||
| 	set_default ema 0 | ||||
| 	set_default acs_exclude_dfs 0 | ||||
| 	set_default mlo 0 | ||||
|  | ||||
| 	[ -n "$country" ] && { | ||||
| 		append base_cfg "country_code=$country" "$N" | ||||
| @@ -252,6 +254,7 @@ hostapd_prepare_device_config() { | ||||
| #	[ "$he_co_locate" -gt 0 ] && append base_cfg "he_co_locate=$he_co_locate" "$N" | ||||
| 	[ "$multiple_bssid" -gt 0 ] && append base_cfg "multiple_bssid=$multiple_bssid" "$N" | ||||
| 	[ "$ema" -gt 0 ] && append base_cfg "ema=$ema" "$N" | ||||
| 	[ "$mlo" -gt 0 ] && append base_cfg "mlo=1" "$N" | ||||
| 	[ "$acs_exclude_dfs" -gt 0 ] && append base_cfg "acs_exclude_dfs=$acs_exclude_dfs" "$N" | ||||
|  | ||||
| 	json_get_values opts hostapd_options | ||||
|   | ||||
| @@ -0,0 +1,43 @@ | ||||
| From 21ce83b4ae2b9563175fdb4fc4312096cc399cf8 Mon Sep 17 00:00:00 2001 | ||||
| From: David Bauer <mail@david-bauer.net> | ||||
| Date: Wed, 5 May 2021 00:44:34 +0200 | ||||
| Subject: [PATCH] wolfssl: add RNG to EC key | ||||
|  | ||||
| Since upstream commit 6467de5a8840 ("Randomize z ordinates in | ||||
| scalar mult when timing resistant") WolfSSL requires a RNG for | ||||
| the EC key when built hardened which is the default. | ||||
|  | ||||
| Set the RNG for the EC key to fix connections for OWE clients. | ||||
|  | ||||
| Signed-off-by: David Bauer <mail@david-bauer.net> | ||||
| --- | ||||
|  src/crypto/crypto_wolfssl.c | 4 ++++ | ||||
|  1 file changed, 4 insertions(+) | ||||
|  | ||||
| --- a/src/crypto/crypto_wolfssl.c | ||||
| +++ b/src/crypto/crypto_wolfssl.c | ||||
| @@ -1340,6 +1340,7 @@ int ecc_projective_add_point(ecc_point * | ||||
|   | ||||
|  struct crypto_ec { | ||||
|  	ecc_key key; | ||||
| +	WC_RNG rng; | ||||
|  	mp_int a; | ||||
|  	mp_int prime; | ||||
|  	mp_int order; | ||||
| @@ -1394,6 +1395,8 @@ struct crypto_ec * crypto_ec_init(int gr | ||||
|  		return NULL; | ||||
|   | ||||
|  	if (wc_ecc_init(&e->key) != 0 || | ||||
| +	    wc_InitRng(&e->rng) != 0 || | ||||
| +	    wc_ecc_set_rng(&e->key, &e->rng) != 0 || | ||||
|  	    wc_ecc_set_curve(&e->key, 0, curve_id) != 0 || | ||||
|  	    mp_init(&e->a) != MP_OKAY || | ||||
|  	    mp_init(&e->prime) != MP_OKAY || | ||||
| @@ -1425,6 +1428,7 @@ void crypto_ec_deinit(struct crypto_ec* | ||||
|  	mp_clear(&e->order); | ||||
|  	mp_clear(&e->prime); | ||||
|  	mp_clear(&e->a); | ||||
| +	wc_FreeRng(&e->rng); | ||||
|  	wc_ecc_free(&e->key); | ||||
|  	os_free(e); | ||||
|  } | ||||
| @@ -0,0 +1,26 @@ | ||||
| --- a/src/ap/ieee802_11.c | ||||
| +++ b/src/ap/ieee802_11.c | ||||
| @@ -4621,6 +4621,13 @@ static int add_associated_sta(struct hos | ||||
|  	 * drivers to accept the STA parameter configuration. Since this is | ||||
|  	 * after a new FT-over-DS exchange, a new TK has been derived, so key | ||||
|  	 * reinstallation is not a concern for this case. | ||||
| +	 * | ||||
| +	 * If the STA was associated and authorized earlier, but came for a new | ||||
| +	 * connection (!added_unassoc + !reassoc), remove the existing STA entry | ||||
| +	 * so that it can be re-added. This case is rarely seen when the AP could | ||||
| +	 * not receive the deauth/disassoc frame from the STA. And the STA comes | ||||
| +	 * back with new connection within a short period or before the inactive | ||||
| +	 * STA entry is removed from the list. | ||||
|  	 */ | ||||
|  	wpa_printf(MSG_DEBUG, "Add associated STA " MACSTR | ||||
|  		   " (added_unassoc=%d auth_alg=%u ft_over_ds=%u reassoc=%d authorized=%d ft_tk=%d fils_tk=%d)", | ||||
| @@ -4634,7 +4641,8 @@ static int add_associated_sta(struct hos | ||||
|  	    (!(sta->flags & WLAN_STA_AUTHORIZED) || | ||||
|  	     (reassoc && sta->ft_over_ds && sta->auth_alg == WLAN_AUTH_FT) || | ||||
|  	     (!wpa_auth_sta_ft_tk_already_set(sta->wpa_sm) && | ||||
| -	      !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)))) { | ||||
| +	      !wpa_auth_sta_fils_tk_already_set(sta->wpa_sm)) || | ||||
| +	     (!reassoc && (sta->flags & WLAN_STA_AUTHORIZED)))) { | ||||
|  		hostapd_drv_sta_remove(hapd, sta->addr); | ||||
|  		wpa_auth_sm_event(sta->wpa_sm, WPA_DRV_STA_REMOVED); | ||||
|  		set = 0; | ||||
| @@ -0,0 +1,27 @@ | ||||
| From: Felix Fietkau <nbd@nbd.name> | ||||
| Date: Thu, 8 Jul 2021 16:33:03 +0200 | ||||
| Subject: [PATCH] hostapd: fix use of uninitialized stack variables | ||||
|  | ||||
| When a CSA is performed on an 80 MHz channel, hostapd_change_config_freq | ||||
| unconditionally calls hostapd_set_oper_centr_freq_seg0/1_idx with seg0/1 | ||||
| filled by ieee80211_freq_to_chan. | ||||
| However, if ieee80211_freq_to_chan fails (because the freq is 0 or invalid), | ||||
| seg0/1 remains uninitialized and filled with stack garbage, causing errors | ||||
| such as "hostapd: 80 MHz: center segment 1 configured" | ||||
|  | ||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
| --- | ||||
|  | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/hostapd.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.c | ||||
| @@ -4352,7 +4352,7 @@ static int hostapd_change_config_freq(st | ||||
|  				      struct hostapd_freq_params *old_params) | ||||
|  { | ||||
|  	int channel; | ||||
| -	u8 seg0, seg1 = 0; | ||||
| +	u8 seg0 = 0, seg1 = 0; | ||||
|  	struct hostapd_hw_modes *mode; | ||||
|   | ||||
|  	if (!params->channel) { | ||||
| @@ -0,0 +1,19 @@ | ||||
| From: Felix Fietkau <nbd@nbd.name> | ||||
| Date: Wed, 28 Jul 2021 05:43:29 +0200 | ||||
| Subject: [PATCH] ndisc_snoop: call dl_list_del before freeing ipv6 addresses | ||||
|  | ||||
| Fixes a segmentation fault on sta disconnect | ||||
|  | ||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
| --- | ||||
|  | ||||
| --- a/src/ap/ndisc_snoop.c | ||||
| +++ b/src/ap/ndisc_snoop.c | ||||
| @@ -61,6 +61,7 @@ void sta_ip6addr_del(struct hostapd_data | ||||
|  	dl_list_for_each_safe(ip6addr, prev, &sta->ip6addr, struct ip6addr, | ||||
|  			      list) { | ||||
|  		hostapd_drv_br_delete_ip_neigh(hapd, 6, (u8 *) &ip6addr->addr); | ||||
| +		dl_list_del(&ip6addr->list); | ||||
|  		os_free(ip6addr); | ||||
|  	} | ||||
|  } | ||||
							
								
								
									
										20
									
								
								feeds/ipq95xx/hostapd/patches/050-build_fix.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										20
									
								
								feeds/ipq95xx/hostapd/patches/050-build_fix.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,20 @@ | ||||
| --- a/hostapd/Makefile | ||||
| +++ b/hostapd/Makefile | ||||
| @@ -324,6 +324,7 @@ ifdef CONFIG_FILS | ||||
|  CFLAGS += -DCONFIG_FILS | ||||
|  OBJS += ../src/ap/fils_hlp.o | ||||
|  NEED_SHA384=y | ||||
| +NEED_HMAC_SHA384_KDF=y | ||||
|  NEED_AES_SIV=y | ||||
|  ifdef CONFIG_FILS_SK_PFS | ||||
|  CFLAGS += -DCONFIG_FILS_SK_PFS | ||||
| --- a/wpa_supplicant/Makefile | ||||
| +++ b/wpa_supplicant/Makefile | ||||
| @@ -331,6 +331,7 @@ endif | ||||
|  ifdef CONFIG_FILS | ||||
|  CFLAGS += -DCONFIG_FILS | ||||
|  NEED_SHA384=y | ||||
| +NEED_HMAC_SHA384_KDF=y | ||||
|  NEED_AES_SIV=y | ||||
|  ifdef CONFIG_FILS_SK_PFS | ||||
|  CFLAGS += -DCONFIG_FILS_SK_PFS | ||||
| @@ -1,97 +0,0 @@ | ||||
| --- a/src/utils/os_unix.c | ||||
| +++ b/src/utils/os_unix.c | ||||
| @@ -10,6 +10,7 @@ | ||||
|   | ||||
|  #include <time.h> | ||||
|  #include <sys/wait.h> | ||||
| +#include <fcntl.h> | ||||
|   | ||||
|  #ifdef ANDROID | ||||
|  #include <sys/capability.h> | ||||
| @@ -188,59 +189,46 @@ int os_gmtime(os_time_t t, struct os_tm | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| - | ||||
| -#ifdef __APPLE__ | ||||
| -#include <fcntl.h> | ||||
| -static int os_daemon(int nochdir, int noclose) | ||||
| +int os_daemonize(const char *pid_file) | ||||
|  { | ||||
| -	int devnull; | ||||
| +	int pid = 0, i, devnull; | ||||
|   | ||||
| -	if (chdir("/") < 0) | ||||
| -		return -1; | ||||
| +#if defined(__uClinux__) || defined(__sun__) | ||||
| +	return -1; | ||||
| +#else /* defined(__uClinux__) || defined(__sun__) */ | ||||
|   | ||||
| -	devnull = open("/dev/null", O_RDWR); | ||||
| -	if (devnull < 0) | ||||
| +#ifndef __APPLE__ | ||||
| +	pid = fork(); | ||||
| +	if (pid < 0) | ||||
|  		return -1; | ||||
| +#endif | ||||
|   | ||||
| -	if (dup2(devnull, STDIN_FILENO) < 0) { | ||||
| -		close(devnull); | ||||
| -		return -1; | ||||
| +	if (pid > 0) { | ||||
| +		if (pid_file) { | ||||
| +			FILE *f = fopen(pid_file, "w"); | ||||
| +			if (f) { | ||||
| +				fprintf(f, "%u\n", pid); | ||||
| +				fclose(f); | ||||
| +			} | ||||
| +		} | ||||
| +		_exit(0); | ||||
|  	} | ||||
|   | ||||
| -	if (dup2(devnull, STDOUT_FILENO) < 0) { | ||||
| -		close(devnull); | ||||
| +	if (setsid() < 0) | ||||
|  		return -1; | ||||
| -	} | ||||
|   | ||||
| -	if (dup2(devnull, STDERR_FILENO) < 0) { | ||||
| -		close(devnull); | ||||
| +	if (chdir("/") < 0) | ||||
|  		return -1; | ||||
| -	} | ||||
| - | ||||
| -	return 0; | ||||
| -} | ||||
| -#else /* __APPLE__ */ | ||||
| -#define os_daemon daemon | ||||
| -#endif /* __APPLE__ */ | ||||
|   | ||||
| - | ||||
| -int os_daemonize(const char *pid_file) | ||||
| -{ | ||||
| -#if defined(__uClinux__) || defined(__sun__) | ||||
| -	return -1; | ||||
| -#else /* defined(__uClinux__) || defined(__sun__) */ | ||||
| -	if (os_daemon(0, 0)) { | ||||
| -		perror("daemon"); | ||||
| +	devnull = open("/dev/null", O_RDWR); | ||||
| +	if (devnull < 0) | ||||
|  		return -1; | ||||
| -	} | ||||
|   | ||||
| -	if (pid_file) { | ||||
| -		FILE *f = fopen(pid_file, "w"); | ||||
| -		if (f) { | ||||
| -			fprintf(f, "%u\n", getpid()); | ||||
| -			fclose(f); | ||||
| -		} | ||||
| -	} | ||||
| +	for (i = 0; i <= STDERR_FILENO; i++) | ||||
| +		dup2(devnull, i); | ||||
| + | ||||
| +	if (devnull > 2) | ||||
| +		close(devnull); | ||||
|   | ||||
|  	return -0; | ||||
|  #endif /* defined(__uClinux__) || defined(__sun__) */ | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										114
									
								
								feeds/ipq95xx/hostapd/patches/120-mbedtls-fips186_2_prf.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										114
									
								
								feeds/ipq95xx/hostapd/patches/120-mbedtls-fips186_2_prf.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,114 @@ | ||||
| From c8dba4bd750269bcc80fed3d546e2077cb4cdf0e Mon Sep 17 00:00:00 2001 | ||||
| From: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| Date: Tue, 19 Jul 2022 20:02:21 -0400 | ||||
| Subject: [PATCH 2/7] mbedtls: fips186_2_prf() | ||||
|  | ||||
| Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| --- | ||||
|  hostapd/Makefile            |  4 --- | ||||
|  src/crypto/crypto_mbedtls.c | 60 +++++++++++++++++++++++++++++++++++++ | ||||
|  wpa_supplicant/Makefile     |  4 --- | ||||
|  3 files changed, 60 insertions(+), 8 deletions(-) | ||||
|  | ||||
| --- a/hostapd/Makefile | ||||
| +++ b/hostapd/Makefile | ||||
| @@ -759,10 +759,6 @@ endif | ||||
|  OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o | ||||
|  HOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o | ||||
|  SOBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o | ||||
| -ifdef NEED_FIPS186_2_PRF | ||||
| -OBJS += ../src/crypto/fips_prf_internal.o | ||||
| -SHA1OBJS += ../src/crypto/sha1-internal.o | ||||
| -endif | ||||
|  ifeq ($(CONFIG_CRYPTO), mbedtls) | ||||
|  ifdef CONFIG_DPP | ||||
|  LIBS += -lmbedx509 | ||||
| --- a/src/crypto/crypto_mbedtls.c | ||||
| +++ b/src/crypto/crypto_mbedtls.c | ||||
| @@ -132,6 +132,12 @@ | ||||
|  #define CRYPTO_MBEDTLS_HMAC_KDF_SHA512 | ||||
|  #endif | ||||
|   | ||||
| +#if defined(EAP_SIM) || defined(EAP_SIM_DYNAMIC) || defined(EAP_SERVER_SIM) \ | ||||
| + || defined(EAP_AKA) || defined(EAP_AKA_DYNAMIC) || defined(EAP_SERVER_AKA) | ||||
| +/* EAP_SIM=y EAP_AKA=y */ | ||||
| +#define CRYPTO_MBEDTLS_FIPS186_2_PRF | ||||
| +#endif | ||||
| + | ||||
|  #if defined(EAP_FAST) || defined(EAP_FAST_DYNAMIC) || defined(EAP_SERVER_FAST) \ | ||||
|   || defined(EAP_TEAP) || defined(EAP_TEAP_DYNAMIC) || defined(EAP_SERVER_FAST) | ||||
|  #define CRYPTO_MBEDTLS_SHA1_T_PRF | ||||
| @@ -813,6 +819,60 @@ int sha1_t_prf(const u8 *key, size_t key | ||||
|   | ||||
|  #endif /* CRYPTO_MBEDTLS_SHA1_T_PRF */ | ||||
|   | ||||
| +#ifdef CRYPTO_MBEDTLS_FIPS186_2_PRF | ||||
| + | ||||
| +/* fips_prf_internal.c sha1-internal.c */ | ||||
| + | ||||
| +/* used only by src/eap_common/eap_sim_common.c:eap_sim_prf() | ||||
| + * for eap_sim_derive_keys() and eap_sim_derive_keys_reauth() | ||||
| + * where xlen is 160 */ | ||||
| + | ||||
| +int fips186_2_prf(const u8 *seed, size_t seed_len, u8 *x, size_t xlen) | ||||
| +{ | ||||
| +	/* FIPS 186-2 + change notice 1 */ | ||||
| + | ||||
| +	mbedtls_sha1_context ctx; | ||||
| +	u8 * const xkey = ctx.MBEDTLS_PRIVATE(buffer); | ||||
| +	u32 * const xstate = ctx.MBEDTLS_PRIVATE(state); | ||||
| +	const u32 xstate_init[] = | ||||
| +	  { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }; | ||||
| + | ||||
| +	mbedtls_sha1_init(&ctx); | ||||
| +	os_memcpy(xkey, seed, seed_len < 64 ? seed_len : 64); | ||||
| + | ||||
| +	/* note: does not fill extra bytes if (xlen % 20) (SHA1_MAC_LEN) */ | ||||
| +	for (; xlen >= 20; xlen -= 20) { | ||||
| +		/* XSEED_j = 0 */ | ||||
| +		/* XVAL = (XKEY + XSEED_j) mod 2^b */ | ||||
| + | ||||
| +		/* w_i = G(t, XVAL) */ | ||||
| +		os_memcpy(xstate, xstate_init, sizeof(xstate_init)); | ||||
| +		mbedtls_internal_sha1_process(&ctx, xkey); | ||||
| + | ||||
| +	  #if __BYTE_ORDER == __LITTLE_ENDIAN | ||||
| +		xstate[0] = host_to_be32(xstate[0]); | ||||
| +		xstate[1] = host_to_be32(xstate[1]); | ||||
| +		xstate[2] = host_to_be32(xstate[2]); | ||||
| +		xstate[3] = host_to_be32(xstate[3]); | ||||
| +		xstate[4] = host_to_be32(xstate[4]); | ||||
| +	  #endif | ||||
| +		os_memcpy(x, xstate, 20); | ||||
| +		if (xlen == 20) /*(done; skip prep for next loop)*/ | ||||
| +			break; | ||||
| + | ||||
| +		/* XKEY = (1 + XKEY + w_i) mod 2^b */ | ||||
| +		for (u32 carry = 1, k = 20; k-- > 0; carry >>= 8) | ||||
| +			xkey[k] = (carry += xkey[k] + x[k]) & 0xff; | ||||
| +		x += 20; | ||||
| +		/* x_j = w_0|w_1 (each pair of iterations through loop)*/ | ||||
| +	} | ||||
| + | ||||
| +	mbedtls_sha1_free(&ctx); | ||||
| +	return 0; | ||||
| +} | ||||
| + | ||||
| +#endif /* CRYPTO_MBEDTLS_FIPS186_2_PRF */ | ||||
| + | ||||
|  #endif /* MBEDTLS_SHA1_C */ | ||||
|   | ||||
|   | ||||
| --- a/wpa_supplicant/Makefile | ||||
| +++ b/wpa_supplicant/Makefile | ||||
| @@ -1174,10 +1174,6 @@ endif | ||||
|  OBJS += ../src/crypto/crypto_$(CONFIG_CRYPTO).o | ||||
|  OBJS_p += ../src/crypto/crypto_$(CONFIG_CRYPTO).o | ||||
|  OBJS_priv += ../src/crypto/crypto_$(CONFIG_CRYPTO).o | ||||
| -ifdef NEED_FIPS186_2_PRF | ||||
| -OBJS += ../src/crypto/fips_prf_internal.o | ||||
| -SHA1OBJS += ../src/crypto/sha1-internal.o | ||||
| -endif | ||||
|  ifeq ($(CONFIG_CRYPTO), mbedtls) | ||||
|  LIBS += -lmbedcrypto | ||||
|  LIBS_p += -lmbedcrypto | ||||
| @@ -0,0 +1,421 @@ | ||||
| From 31bd19e0e0254b910cccfd3ddc6a6a9222bbcfc0 Mon Sep 17 00:00:00 2001 | ||||
| From: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| Date: Sun, 9 Oct 2022 05:12:17 -0400 | ||||
| Subject: [PATCH 3/7] mbedtls: annotate with TEST_FAIL() for hwsim tests | ||||
|  | ||||
| Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| --- | ||||
|  src/crypto/crypto_mbedtls.c | 124 ++++++++++++++++++++++++++++++++++++ | ||||
|  1 file changed, 124 insertions(+) | ||||
|  | ||||
| --- a/src/crypto/crypto_mbedtls.c | ||||
| +++ b/src/crypto/crypto_mbedtls.c | ||||
| @@ -280,6 +280,9 @@ __attribute_noinline__ | ||||
|  static int md_vector(size_t num_elem, const u8 *addr[], const size_t *len, | ||||
|                       u8 *mac, mbedtls_md_type_t md_type) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_md_context_t ctx; | ||||
|  	mbedtls_md_init(&ctx); | ||||
|  	if (mbedtls_md_setup(&ctx, mbedtls_md_info_from_type(md_type), 0) != 0){ | ||||
| @@ -343,6 +346,9 @@ __attribute_noinline__ | ||||
|  static int sha384_512_vector(size_t num_elem, const u8 *addr[], | ||||
|                               const size_t *len, u8 *mac, int is384) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	struct mbedtls_sha512_context ctx; | ||||
|  	mbedtls_sha512_init(&ctx); | ||||
|    #if MBEDTLS_VERSION_MAJOR >= 3 | ||||
| @@ -375,6 +381,9 @@ int sha384_vector(size_t num_elem, const | ||||
|  #include <mbedtls/sha256.h> | ||||
|  int sha256_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	struct mbedtls_sha256_context ctx; | ||||
|  	mbedtls_sha256_init(&ctx); | ||||
|    #if MBEDTLS_VERSION_MAJOR >= 3 | ||||
| @@ -397,6 +406,9 @@ int sha256_vector(size_t num_elem, const | ||||
|  #include <mbedtls/sha1.h> | ||||
|  int sha1_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	struct mbedtls_sha1_context ctx; | ||||
|  	mbedtls_sha1_init(&ctx); | ||||
|    #if MBEDTLS_VERSION_MAJOR >= 3 | ||||
| @@ -419,6 +431,9 @@ int sha1_vector(size_t num_elem, const u | ||||
|  #include <mbedtls/md5.h> | ||||
|  int md5_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	struct mbedtls_md5_context ctx; | ||||
|  	mbedtls_md5_init(&ctx); | ||||
|    #if MBEDTLS_VERSION_MAJOR >= 3 | ||||
| @@ -441,6 +456,9 @@ int md5_vector(size_t num_elem, const u8 | ||||
|  #include <mbedtls/md4.h> | ||||
|  int md4_vector(size_t num_elem, const u8 *addr[], const size_t *len, u8 *mac) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	struct mbedtls_md4_context ctx; | ||||
|  	mbedtls_md4_init(&ctx); | ||||
|  	mbedtls_md4_starts_ret(&ctx); | ||||
| @@ -460,6 +478,9 @@ static int hmac_vector(const u8 *key, si | ||||
|                         const u8 *addr[], const size_t *len, u8 *mac, | ||||
|                         mbedtls_md_type_t md_type) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_md_context_t ctx; | ||||
|  	mbedtls_md_init(&ctx); | ||||
|  	if (mbedtls_md_setup(&ctx, mbedtls_md_info_from_type(md_type), 1) != 0){ | ||||
| @@ -571,6 +592,9 @@ static int hmac_kdf_expand(const u8 *prk | ||||
|                             const char *label, const u8 *info, size_t info_len, | ||||
|                             u8 *okm, size_t okm_len, mbedtls_md_type_t md_type) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_type); | ||||
|    #ifdef MBEDTLS_HKDF_C | ||||
|  	if (label == NULL)  /* RFC 5869 HKDF-Expand when (label == NULL) */ | ||||
| @@ -663,6 +687,9 @@ static int hmac_prf_bits(const u8 *key, | ||||
|                           const u8 *data, size_t data_len, u8 *buf, | ||||
|                           size_t buf_len_bits, mbedtls_md_type_t md_type) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_md_context_t ctx; | ||||
|  	mbedtls_md_init(&ctx); | ||||
|  	const mbedtls_md_info_t *md_info = mbedtls_md_info_from_type(md_type); | ||||
| @@ -938,6 +965,9 @@ int pbkdf2_sha1(const char *passphrase, | ||||
|   | ||||
|  static void *aes_crypt_init_mode(const u8 *key, size_t len, int mode) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return NULL; | ||||
| + | ||||
|  	mbedtls_aes_context *aes = os_malloc(sizeof(*aes)); | ||||
|  	if (!aes) | ||||
|  		return NULL; | ||||
| @@ -996,6 +1026,9 @@ void aes_decrypt_deinit(void *ctx) | ||||
|  /* aes-wrap.c */ | ||||
|  int aes_wrap(const u8 *kek, size_t kek_len, int n, const u8 *plain, u8 *cipher) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_nist_kw_context ctx; | ||||
|  	mbedtls_nist_kw_init(&ctx); | ||||
|  	size_t olen; | ||||
| @@ -1010,6 +1043,9 @@ int aes_wrap(const u8 *kek, size_t kek_l | ||||
|  /* aes-unwrap.c */ | ||||
|  int aes_unwrap(const u8 *kek, size_t kek_len, int n, const u8 *cipher, u8 *plain) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_nist_kw_context ctx; | ||||
|  	mbedtls_nist_kw_init(&ctx); | ||||
|  	size_t olen; | ||||
| @@ -1041,6 +1077,9 @@ int omac1_aes_vector( | ||||
|      const u8 *key, size_t key_len, size_t num_elem, const u8 *addr[], | ||||
|      const size_t *len, u8 *mac) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_cipher_type_t cipher_type; | ||||
|  	switch (key_len) { | ||||
|  	case 16: cipher_type = MBEDTLS_CIPHER_AES_128_ECB; break; | ||||
| @@ -1103,6 +1142,9 @@ int omac1_aes_256(const u8 *key, const u | ||||
|  /* aes-encblock.c */ | ||||
|  int aes_128_encrypt_block(const u8 *key, const u8 *in, u8 *out) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_aes_context aes; | ||||
|  	mbedtls_aes_init(&aes); | ||||
|  	int ret = mbedtls_aes_setkey_enc(&aes, key, 128) | ||||
| @@ -1118,6 +1160,9 @@ int aes_128_encrypt_block(const u8 *key, | ||||
|  int aes_ctr_encrypt(const u8 *key, size_t key_len, const u8 *nonce, | ||||
|  		    u8 *data, size_t data_len) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	unsigned char counter[MBEDTLS_AES_BLOCK_SIZE]; | ||||
|  	unsigned char stream_block[MBEDTLS_AES_BLOCK_SIZE]; | ||||
|  	os_memcpy(counter, nonce, MBEDTLS_AES_BLOCK_SIZE);/*(must be writable)*/ | ||||
| @@ -1160,11 +1205,17 @@ static int aes_128_cbc_oper(const u8 *ke | ||||
|   | ||||
|  int aes_128_cbc_encrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return aes_128_cbc_oper(key, iv, data, data_len, MBEDTLS_AES_ENCRYPT); | ||||
|  } | ||||
|   | ||||
|  int aes_128_cbc_decrypt(const u8 *key, const u8 *iv, u8 *data, size_t data_len) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return aes_128_cbc_oper(key, iv, data, data_len, MBEDTLS_AES_DECRYPT); | ||||
|  } | ||||
|   | ||||
| @@ -1407,6 +1458,10 @@ int crypto_hash_finish(struct crypto_has | ||||
|  	} | ||||
|  	mbedtls_md_free(mctx); | ||||
|  	os_free(mctx); | ||||
| + | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| @@ -1421,6 +1476,9 @@ int crypto_hash_finish(struct crypto_has | ||||
|   | ||||
|  struct crypto_bignum *crypto_bignum_init(void) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return NULL; | ||||
| + | ||||
|  	mbedtls_mpi *bn = os_malloc(sizeof(*bn)); | ||||
|  	if (bn) | ||||
|  		mbedtls_mpi_init(bn); | ||||
| @@ -1429,6 +1487,9 @@ struct crypto_bignum *crypto_bignum_init | ||||
|   | ||||
|  struct crypto_bignum *crypto_bignum_init_set(const u8 *buf, size_t len) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return NULL; | ||||
| + | ||||
|  	mbedtls_mpi *bn = os_malloc(sizeof(*bn)); | ||||
|  	if (bn) { | ||||
|  		mbedtls_mpi_init(bn); | ||||
| @@ -1442,6 +1503,9 @@ struct crypto_bignum *crypto_bignum_init | ||||
|   | ||||
|  struct crypto_bignum *crypto_bignum_init_uint(unsigned int val) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return NULL; | ||||
| + | ||||
|    #if 0 /*(hostap use of this interface passes int, not uint)*/ | ||||
|  	val = host_to_be32(val); | ||||
|  	return crypto_bignum_init_set((const u8 *)&val, sizeof(val)); | ||||
| @@ -1467,6 +1531,9 @@ void crypto_bignum_deinit(struct crypto_ | ||||
|  int crypto_bignum_to_bin(const struct crypto_bignum *a, | ||||
|  			 u8 *buf, size_t buflen, size_t padlen) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	size_t n = mbedtls_mpi_size((mbedtls_mpi *)a); | ||||
|  	if (n < padlen) | ||||
|  		n = padlen; | ||||
| @@ -1477,6 +1544,9 @@ int crypto_bignum_to_bin(const struct cr | ||||
|   | ||||
|  int crypto_bignum_rand(struct crypto_bignum *r, const struct crypto_bignum *m) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	/*assert(r != m);*//* r must not be same as m for mbedtls_mpi_random()*/ | ||||
|    #if MBEDTLS_VERSION_NUMBER >= 0x021B0000 /* mbedtls 2.27.0 */ | ||||
|  	return mbedtls_mpi_random((mbedtls_mpi *)r, 0, (mbedtls_mpi *)m, | ||||
| @@ -1513,6 +1583,9 @@ int crypto_bignum_exptmod(const struct c | ||||
|  			  const struct crypto_bignum *c, | ||||
|  			  struct crypto_bignum *d) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	/* (check if input params match d; d is the result) */ | ||||
|  	/* (a == d) is ok in current mbedtls implementation */ | ||||
|  	if (b == d || c == d) { /*(not ok; store result in intermediate)*/ | ||||
| @@ -1540,6 +1613,9 @@ int crypto_bignum_inverse(const struct c | ||||
|  			  const struct crypto_bignum *b, | ||||
|  			  struct crypto_bignum *c) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return mbedtls_mpi_inv_mod((mbedtls_mpi *)c, | ||||
|  				   (const mbedtls_mpi *)a, | ||||
|  				   (const mbedtls_mpi *)b) ? -1 : 0; | ||||
| @@ -1549,6 +1625,9 @@ int crypto_bignum_sub(const struct crypt | ||||
|  		      const struct crypto_bignum *b, | ||||
|  		      struct crypto_bignum *c) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return mbedtls_mpi_sub_mpi((mbedtls_mpi *)c, | ||||
|  				   (const mbedtls_mpi *)a, | ||||
|  				   (const mbedtls_mpi *)b) ? -1 : 0; | ||||
| @@ -1558,6 +1637,9 @@ int crypto_bignum_div(const struct crypt | ||||
|  		      const struct crypto_bignum *b, | ||||
|  		      struct crypto_bignum *c) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	/*(most current use of this crypto.h interface has a == c (result), | ||||
|  	 * so store result in an intermediate to avoid overwritten input)*/ | ||||
|  	mbedtls_mpi R; | ||||
| @@ -1575,6 +1657,9 @@ int crypto_bignum_addmod(const struct cr | ||||
|  			 const struct crypto_bignum *c, | ||||
|  			 struct crypto_bignum *d) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return mbedtls_mpi_add_mpi((mbedtls_mpi *)d, | ||||
|  				   (const mbedtls_mpi *)a, | ||||
|  				   (const mbedtls_mpi *)b) | ||||
| @@ -1588,6 +1673,9 @@ int crypto_bignum_mulmod(const struct cr | ||||
|  			 const struct crypto_bignum *c, | ||||
|  			 struct crypto_bignum *d) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return mbedtls_mpi_mul_mpi((mbedtls_mpi *)d, | ||||
|  				   (const mbedtls_mpi *)a, | ||||
|  				   (const mbedtls_mpi *)b) | ||||
| @@ -1600,6 +1688,9 @@ int crypto_bignum_sqrmod(const struct cr | ||||
|  			 const struct crypto_bignum *b, | ||||
|  			 struct crypto_bignum *c) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|    #if 1 | ||||
|  	return crypto_bignum_mulmod(a, a, b, c); | ||||
|    #else | ||||
| @@ -1650,6 +1741,9 @@ int crypto_bignum_is_odd(const struct cr | ||||
|  int crypto_bignum_legendre(const struct crypto_bignum *a, | ||||
|  			   const struct crypto_bignum *p) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -2; | ||||
| + | ||||
|  	/* Security Note: | ||||
|  	 * mbedtls_mpi_exp_mod() is not documented to run in constant time, | ||||
|  	 * though mbedtls/library/bignum.c uses constant_time_internal.h funcs. | ||||
| @@ -1702,6 +1796,9 @@ int crypto_mod_exp(const u8 *base, size_ | ||||
|  		   const u8 *modulus, size_t modulus_len, | ||||
|  		   u8 *result, size_t *result_len) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	mbedtls_mpi bn_base, bn_exp, bn_modulus, bn_result; | ||||
|  	mbedtls_mpi_init(&bn_base); | ||||
|  	mbedtls_mpi_init(&bn_exp); | ||||
| @@ -1769,6 +1866,9 @@ static int crypto_mbedtls_dh_init_public | ||||
|  int crypto_dh_init(u8 generator, const u8 *prime, size_t prime_len, u8 *privkey, | ||||
|  		   u8 *pubkey) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|    #if 0 /*(crypto_dh_init() duplicated (and identical) in crypto_*.c modules)*/ | ||||
|  	size_t pubkey_len, pad; | ||||
|   | ||||
| @@ -1810,6 +1910,9 @@ int crypto_dh_derive_secret(u8 generator | ||||
|  			    const u8 *pubkey, size_t pubkey_len, | ||||
|  			    u8 *secret, size_t *len) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|    #if 0 | ||||
|  	if (pubkey_len > prime_len || | ||||
|  	    (pubkey_len == prime_len && | ||||
| @@ -2512,6 +2615,9 @@ const struct crypto_ec_point * crypto_ec | ||||
|   | ||||
|  struct crypto_ec_point *crypto_ec_point_init(struct crypto_ec *e) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return NULL; | ||||
| + | ||||
|  	mbedtls_ecp_point *p = os_malloc(sizeof(*p)); | ||||
|  	if (p != NULL) | ||||
|  		mbedtls_ecp_point_init(p); | ||||
| @@ -2536,6 +2642,9 @@ int crypto_ec_point_x(struct crypto_ec * | ||||
|  int crypto_ec_point_to_bin(struct crypto_ec *e, | ||||
|  			   const struct crypto_ec_point *point, u8 *x, u8 *y) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	/* crypto.h documents crypto_ec_point_to_bin() output is big-endian */ | ||||
|  	size_t len = CRYPTO_EC_plen(e); | ||||
|  	if (x) { | ||||
| @@ -2563,6 +2672,9 @@ int crypto_ec_point_to_bin(struct crypto | ||||
|  struct crypto_ec_point * crypto_ec_point_from_bin(struct crypto_ec *e, | ||||
|  						  const u8 *val) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return NULL; | ||||
| + | ||||
|  	size_t len = CRYPTO_EC_plen(e); | ||||
|  	mbedtls_ecp_point *p = os_malloc(sizeof(*p)); | ||||
|  	u8 buf[1+MBEDTLS_MPI_MAX_SIZE*2]; | ||||
| @@ -2615,6 +2727,9 @@ int crypto_ec_point_add(struct crypto_ec | ||||
|  			const struct crypto_ec_point *b, | ||||
|  			struct crypto_ec_point *c) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	/* mbedtls does not provide an mbedtls_ecp_point add function */ | ||||
|  	mbedtls_mpi one; | ||||
|  	mbedtls_mpi_init(&one); | ||||
| @@ -2631,6 +2746,9 @@ int crypto_ec_point_mul(struct crypto_ec | ||||
|  			const struct crypto_bignum *b, | ||||
|  			struct crypto_ec_point *res) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	return mbedtls_ecp_mul( | ||||
|  		(mbedtls_ecp_group *)e, (mbedtls_ecp_point *)res, | ||||
|  		(const mbedtls_mpi *)b, (const mbedtls_ecp_point *)p, | ||||
| @@ -2639,6 +2757,9 @@ int crypto_ec_point_mul(struct crypto_ec | ||||
|   | ||||
|  int crypto_ec_point_invert(struct crypto_ec *e, struct crypto_ec_point *p) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return -1; | ||||
| + | ||||
|  	if (mbedtls_ecp_get_type((mbedtls_ecp_group *)e) | ||||
|  	    == MBEDTLS_ECP_TYPE_MONTGOMERY) { | ||||
|  		/* e.g. MBEDTLS_ECP_DP_CURVE25519 and MBEDTLS_ECP_DP_CURVE448 */ | ||||
| @@ -2751,6 +2872,9 @@ struct crypto_bignum * | ||||
|  crypto_ec_point_compute_y_sqr(struct crypto_ec *e, | ||||
|  			      const struct crypto_bignum *x) | ||||
|  { | ||||
| +	if (TEST_FAIL()) | ||||
| +		return NULL; | ||||
| + | ||||
|  	mbedtls_mpi *y2 = os_malloc(sizeof(*y2)); | ||||
|  	if (y2 == NULL) | ||||
|  		return NULL; | ||||
| @@ -0,0 +1,91 @@ | ||||
| The code for hostapd-mbedtls did not work when used for OWE association. | ||||
|  | ||||
| When handling association requests, the buffer offsets and length assumptions were incorrect, leading to never calculating the y point, thus denying association. | ||||
|  | ||||
| Also when crafting the association response, the buffer contained the trailing key-type. | ||||
|  | ||||
| Fix up both issues to adhere to the specification and make hostapd-mbedtls work with the OWE security type. | ||||
|  | ||||
| --- a/src/crypto/crypto_mbedtls.c | ||||
| +++ b/src/crypto/crypto_mbedtls.c | ||||
| @@ -2299,25 +2299,30 @@ struct crypto_ecdh * crypto_ecdh_init2(i | ||||
|  struct wpabuf * crypto_ecdh_get_pubkey(struct crypto_ecdh *ecdh, int inc_y) | ||||
|  { | ||||
|  	mbedtls_ecp_group *grp = &ecdh->grp; | ||||
| -	size_t len = CRYPTO_EC_plen(grp); | ||||
| +	size_t prime_len = CRYPTO_EC_plen(grp); | ||||
| +	size_t output_len = prime_len; | ||||
| +	u8 output_offset = 0; | ||||
| +	u8 buf[256]; | ||||
| + | ||||
|    #ifdef MBEDTLS_ECP_MONTGOMERY_ENABLED | ||||
|  	/* len */ | ||||
|    #endif | ||||
|    #ifdef MBEDTLS_ECP_SHORT_WEIERSTRASS_ENABLED | ||||
| -	if (mbedtls_ecp_get_type(grp) == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS) | ||||
| -		len = inc_y ? len*2+1 : len+1; | ||||
| +	if (mbedtls_ecp_get_type(grp) == MBEDTLS_ECP_TYPE_SHORT_WEIERSTRASS) { | ||||
| +		output_len = inc_y ? prime_len * 2 + 1 : prime_len + 1; | ||||
| +		output_offset = 1; | ||||
| +	} | ||||
|    #endif | ||||
| -	struct wpabuf *buf = wpabuf_alloc(len); | ||||
| -	if (buf == NULL) | ||||
| + | ||||
| +	if (output_len > sizeof(buf)) | ||||
|  		return NULL; | ||||
| + | ||||
|  	inc_y = inc_y ? MBEDTLS_ECP_PF_UNCOMPRESSED : MBEDTLS_ECP_PF_COMPRESSED; | ||||
| -	if (mbedtls_ecp_point_write_binary(grp, &ecdh->Q, inc_y, &len, | ||||
| -	                                   wpabuf_mhead_u8(buf), len) == 0) { | ||||
| -		wpabuf_put(buf, len); | ||||
| -		return buf; | ||||
| +	if (mbedtls_ecp_point_write_binary(grp, &ecdh->Q, inc_y, &output_len, | ||||
| +	                                   buf, output_len) == 0) { | ||||
| +		return wpabuf_alloc_copy(buf + output_offset, output_len - output_offset); | ||||
|  	} | ||||
|   | ||||
| -	wpabuf_free(buf); | ||||
|  	return NULL; | ||||
|  } | ||||
|   | ||||
| @@ -2379,10 +2384,7 @@ struct wpabuf * crypto_ecdh_set_peerkey( | ||||
|  				os_memcpy(buf+2, key, len); | ||||
|  			} | ||||
|  			len >>= 1; /*(repurpose len to prime_len)*/ | ||||
| -		} | ||||
| -		else if (key[0] == 0x02 || key[0] == 0x03) { /* (inc_y == 0) */ | ||||
| -			--len; /*(repurpose len to prime_len)*/ | ||||
| - | ||||
| +		} else { /* (inc_y == 0) */ | ||||
|  			/* mbedtls_ecp_point_read_binary() does not currently support | ||||
|  			 * MBEDTLS_ECP_PF_COMPRESSED format (buf[1] = 0x02 or 0x03) | ||||
|  			 * (returns MBEDTLS_ERR_ECP_FEATURE_UNAVAILABLE) */ | ||||
| @@ -2390,22 +2392,21 @@ struct wpabuf * crypto_ecdh_set_peerkey( | ||||
|  			/* derive y, amend buf[] with y for UNCOMPRESSED format */ | ||||
|  			if (sizeof(buf)-2 < len*2 || len == 0) | ||||
|  				return NULL; | ||||
| + | ||||
|  			buf[0] = (u8)(1+len*2); | ||||
|  			buf[1] = 0x04; | ||||
| +			os_memcpy(buf+2, key, len); | ||||
| + | ||||
|  			mbedtls_mpi bn; | ||||
|  			mbedtls_mpi_init(&bn); | ||||
| -			int ret = mbedtls_mpi_read_binary(&bn, key+1, len) | ||||
| -			       || crypto_mbedtls_short_weierstrass_derive_y(grp, &bn, | ||||
| -			                                                    key[0] & 1) | ||||
| +			int ret = mbedtls_mpi_read_binary(&bn, key, len) | ||||
| +			       || crypto_mbedtls_short_weierstrass_derive_y(grp, &bn, 0) | ||||
|  			       || mbedtls_mpi_write_binary(&bn, buf+2+len, len); | ||||
|  			mbedtls_mpi_free(&bn); | ||||
|  			if (ret != 0) | ||||
|  				return NULL; | ||||
|  		} | ||||
|   | ||||
| -		if (key[0] == 0) /*(repurpose len to prime_len)*/ | ||||
| -			len = CRYPTO_EC_plen(grp); | ||||
| - | ||||
|  		if (mbedtls_ecdh_read_public(&ecdh->ctx, buf, buf[0]+1)) | ||||
|  			return NULL; | ||||
|  	} | ||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @@ -0,0 +1,45 @@ | ||||
| From 33afce36c54b0cad38643629ded10ff5d727f077 Mon Sep 17 00:00:00 2001 | ||||
| From: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| Date: Fri, 12 Aug 2022 05:34:47 -0400 | ||||
| Subject: [PATCH 5/7] add NULL checks (encountered during tests/hwsim) | ||||
|  | ||||
| sae_derive_commit_element_ecc NULL pwe_ecc check | ||||
| dpp_gen_keypair() NULL curve check | ||||
|  | ||||
| Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| --- | ||||
|  src/common/dpp_crypto.c | 6 ++++++ | ||||
|  src/common/sae.c        | 7 +++++++ | ||||
|  2 files changed, 13 insertions(+) | ||||
|  | ||||
| --- a/src/common/dpp_crypto.c | ||||
| +++ b/src/common/dpp_crypto.c | ||||
| @@ -269,6 +269,12 @@ int dpp_get_pubkey_hash(struct crypto_ec | ||||
|   | ||||
|  struct crypto_ec_key * dpp_gen_keypair(const struct dpp_curve_params *curve) | ||||
|  { | ||||
| +	if (curve == NULL) { | ||||
| +		wpa_printf(MSG_DEBUG, | ||||
| +		           "DPP: %s curve must be initialized", __func__); | ||||
| +		return NULL; | ||||
| +	} | ||||
| + | ||||
|  	struct crypto_ec_key *key; | ||||
|   | ||||
|  	wpa_printf(MSG_DEBUG, "DPP: Generating a keypair"); | ||||
| --- a/src/common/sae.c | ||||
| +++ b/src/common/sae.c | ||||
| @@ -1278,6 +1278,13 @@ void sae_deinit_pt(struct sae_pt *pt) | ||||
|  static int sae_derive_commit_element_ecc(struct sae_data *sae, | ||||
|  					 struct crypto_bignum *mask) | ||||
|  { | ||||
| +	if (sae->tmp->pwe_ecc == NULL) { | ||||
| +		wpa_printf(MSG_DEBUG, | ||||
| +		           "SAE: %s sae->tmp->pwe_ecc must be initialized", | ||||
| +		           __func__); | ||||
| +		return -1; | ||||
| +	} | ||||
| + | ||||
|  	/* COMMIT-ELEMENT = inverse(scalar-op(mask, PWE)) */ | ||||
|  	if (!sae->tmp->own_commit_element_ecc) { | ||||
|  		sae->tmp->own_commit_element_ecc = | ||||
| @@ -0,0 +1,26 @@ | ||||
| From 54211caa2e0e5163aefef390daf88a971367a702 Mon Sep 17 00:00:00 2001 | ||||
| From: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| Date: Tue, 4 Oct 2022 17:09:24 -0400 | ||||
| Subject: [PATCH 6/7] dpp_pkex: EC point mul w/ value < prime | ||||
|  | ||||
| crypto_ec_point_mul() with mbedtls requires point | ||||
| be multiplied by a multiplicand with value < prime | ||||
|  | ||||
| Signed-off-by: Glenn Strauss <gstrauss@gluelogic.com> | ||||
| --- | ||||
|  src/common/dpp_crypto.c | 4 +++- | ||||
|  1 file changed, 3 insertions(+), 1 deletion(-) | ||||
|  | ||||
| --- a/src/common/dpp_crypto.c | ||||
| +++ b/src/common/dpp_crypto.c | ||||
| @@ -1588,7 +1588,9 @@ dpp_pkex_derive_Qr(const struct dpp_curv | ||||
|  	Pr = crypto_ec_key_get_public_key(Pr_key); | ||||
|  	Qr = crypto_ec_point_init(ec); | ||||
|  	hash_bn = crypto_bignum_init_set(hash, curve->hash_len); | ||||
| -	if (!Pr || !Qr || !hash_bn || crypto_ec_point_mul(ec, Pr, hash_bn, Qr)) | ||||
| +	if (!Pr || !Qr || !hash_bn || | ||||
| +	    crypto_bignum_mod(hash_bn, crypto_ec_get_prime(ec), hash_bn) || | ||||
| +	    crypto_ec_point_mul(ec, Pr, hash_bn, Qr)) | ||||
|  		goto fail; | ||||
|   | ||||
|  	if (crypto_ec_point_is_at_infinity(ec, Qr)) { | ||||
| @@ -0,0 +1,20 @@ | ||||
| From: Felix Fietkau <nbd@nbd.name> | ||||
| Date: Thu, 14 Sep 2023 10:53:50 +0200 | ||||
| Subject: [PATCH] driver_nl80211: fix setting QoS map on secondary BSSs | ||||
|  | ||||
| The setting is per-BSS, not per PHY | ||||
|  | ||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
| --- | ||||
|  | ||||
| --- a/src/drivers/driver_nl80211.c | ||||
| +++ b/src/drivers/driver_nl80211.c | ||||
| @@ -11341,7 +11341,7 @@ static int nl80211_set_qos_map(void *pri | ||||
|  	wpa_hexdump(MSG_DEBUG, "nl80211: Setting QoS Map", | ||||
|  		    qos_map_set, qos_map_set_len); | ||||
|   | ||||
| -	if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_SET_QOS_MAP)) || | ||||
| +	if (!(msg = nl80211_bss_msg(bss, 0, NL80211_CMD_SET_QOS_MAP)) || | ||||
|  	    nla_put(msg, NL80211_ATTR_QOS_MAP, qos_map_set_len, qos_map_set)) { | ||||
|  		nlmsg_free(msg); | ||||
|  		return -ENOBUFS; | ||||
| @@ -0,0 +1,18 @@ | ||||
| From: Felix Fietkau <nbd@nbd.name> | ||||
| Date: Thu, 14 Sep 2023 11:28:03 +0200 | ||||
| Subject: [PATCH] driver_nl80211: update drv->ifindex on removing the first | ||||
|  BSS | ||||
|  | ||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
| --- | ||||
|  | ||||
| --- a/src/drivers/driver_nl80211.c | ||||
| +++ b/src/drivers/driver_nl80211.c | ||||
| @@ -8867,6 +8867,7 @@ static int wpa_driver_nl80211_if_remove( | ||||
|  		if (drv->first_bss->next) { | ||||
|  			drv->first_bss = drv->first_bss->next; | ||||
|  			drv->ctx = drv->first_bss->ctx; | ||||
| +			drv->ifindex = drv->first_bss->ifindex; | ||||
|  			os_free(bss); | ||||
|  		} else { | ||||
|  			wpa_printf(MSG_DEBUG, "nl80211: No second BSS to reassign context to"); | ||||
| @@ -0,0 +1,34 @@ | ||||
| From: Felix Fietkau <nbd@nbd.name> | ||||
| Date: Mon, 18 Sep 2023 16:47:41 +0200 | ||||
| Subject: [PATCH] nl80211: move nl80211_put_freq_params call outside of | ||||
|  802.11ax #ifdef | ||||
|  | ||||
| The relevance of this call is not specific to 802.11ax, so it should be done | ||||
| even with CONFIG_IEEE80211AX disabled. | ||||
|  | ||||
| Fixes: b3921db426ea ("nl80211: Add frequency info in start AP command") | ||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
| --- | ||||
|  | ||||
| --- a/src/drivers/driver_nl80211.c | ||||
| +++ b/src/drivers/driver_nl80211.c | ||||
| @@ -5226,6 +5226,9 @@ static int wpa_driver_nl80211_set_ap(voi | ||||
|  		nla_nest_end(msg, ftm); | ||||
|  	} | ||||
|   | ||||
| +	if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0) | ||||
| +		goto fail; | ||||
| + | ||||
|  #ifdef CONFIG_IEEE80211AX | ||||
|  	if (params->he_spr_ctrl) { | ||||
|  		struct nlattr *spr; | ||||
| @@ -5260,9 +5263,6 @@ static int wpa_driver_nl80211_set_ap(voi | ||||
|  		nla_nest_end(msg, spr); | ||||
|  	} | ||||
|   | ||||
| -	if (params->freq && nl80211_put_freq_params(msg, params->freq) < 0) | ||||
| -		goto fail; | ||||
| - | ||||
|  	if (params->freq && params->freq->he_enabled) { | ||||
|  		struct nlattr *bss_color; | ||||
|   | ||||
| @@ -0,0 +1,28 @@ | ||||
| From: Felix Fietkau <nbd@nbd.name> | ||||
| Date: Wed, 20 Sep 2023 13:41:10 +0200 | ||||
| Subject: [PATCH] hostapd: cancel channel_list_update_timeout in | ||||
|  hostapd_cleanup_iface_partial | ||||
|  | ||||
| Fixes a crash when disabling an interface during channel list update | ||||
|  | ||||
| Signed-off-by: Felix Fietkau <nbd@nbd.name> | ||||
| --- | ||||
|  | ||||
| --- a/src/ap/hostapd.c | ||||
| +++ b/src/ap/hostapd.c | ||||
| @@ -569,6 +569,7 @@ static void sta_track_deinit(struct host | ||||
|  void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) | ||||
|  { | ||||
|  	wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); | ||||
| +	eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); | ||||
|  #ifdef NEED_AP_MLME | ||||
|  	hostapd_stop_setup_timers(iface); | ||||
|  #endif /* NEED_AP_MLME */ | ||||
| @@ -598,7 +599,6 @@ void hostapd_cleanup_iface_partial(struc | ||||
|  static void hostapd_cleanup_iface(struct hostapd_iface *iface) | ||||
|  { | ||||
|  	wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); | ||||
| -	eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); | ||||
|  	eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface, | ||||
|  			     NULL); | ||||
|   | ||||
| @@ -18,7 +18,7 @@ | ||||
|  OBJS += ../src/ap/vlan_init.o | ||||
|  OBJS += ../src/ap/vlan_ifconfig.o | ||||
|  OBJS += ../src/ap/vlan.o | ||||
| @@ -349,10 +351,14 @@ CFLAGS += -DCONFIG_MBO | ||||
| @@ -357,10 +359,14 @@ CFLAGS += -DCONFIG_MBO | ||||
|  OBJS += ../src/ap/mbo_ap.o | ||||
|  endif | ||||
|   | ||||
| @@ -36,7 +36,7 @@ | ||||
|  LIBS += $(DRV_AP_LIBS) | ||||
|   | ||||
|  ifdef CONFIG_L2_PACKET | ||||
| @@ -1277,6 +1283,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) | ||||
| @@ -1380,6 +1386,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) | ||||
|  _OBJS_VAR := OBJS | ||||
|  include ../src/objs.mk | ||||
|   | ||||
| @@ -49,7 +49,7 @@ | ||||
|  hostapd: $(OBJS) | ||||
|  	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) | ||||
|  	@$(E) "  LD " $@ | ||||
| @@ -1351,6 +1363,12 @@ include ../src/objs.mk | ||||
| @@ -1460,6 +1472,12 @@ include ../src/objs.mk | ||||
|  _OBJS_VAR := SOBJS | ||||
|  include ../src/objs.mk | ||||
|   | ||||
| @@ -64,15 +64,15 @@ | ||||
|  	@$(E) "  LD " $@ | ||||
| --- a/wpa_supplicant/Makefile | ||||
| +++ b/wpa_supplicant/Makefile | ||||
| @@ -17,6 +17,7 @@ endif | ||||
| @@ -10,6 +10,7 @@ ALL += dbus/fi.w1.wpa_supplicant1.servic | ||||
|  EXTRA_TARGETS=dynamic_eap_methods | ||||
|   | ||||
|  CONFIG_FILE=.config | ||||
| +-include $(if $(MULTICALL),../hostapd/.config) | ||||
|  include ../src/build.rules | ||||
|   | ||||
|  ifdef LIBS | ||||
| @@ -354,7 +355,9 @@ endif | ||||
|  ifdef CONFIG_BUILD_PASN_SO | ||||
| @@ -382,7 +383,9 @@ endif | ||||
|  ifdef CONFIG_IBSS_RSN | ||||
|  NEED_RSN_AUTHENTICATOR=y | ||||
|  CFLAGS += -DCONFIG_IBSS_RSN | ||||
| @@ -82,7 +82,7 @@ | ||||
|  OBJS += ibss_rsn.o | ||||
|  endif | ||||
|   | ||||
| @@ -886,6 +889,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS | ||||
| @@ -924,6 +927,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS | ||||
|  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS | ||||
|  LIBS += -ldl -rdynamic | ||||
|  endif | ||||
| @@ -93,7 +93,7 @@ | ||||
|  endif | ||||
|   | ||||
|  ifdef CONFIG_AP | ||||
| @@ -893,9 +900,11 @@ NEED_EAP_COMMON=y | ||||
| @@ -931,9 +938,11 @@ NEED_EAP_COMMON=y | ||||
|  NEED_RSN_AUTHENTICATOR=y | ||||
|  CFLAGS += -DCONFIG_AP | ||||
|  OBJS += ap.o | ||||
| @@ -105,7 +105,7 @@ | ||||
|  OBJS += ../src/ap/hostapd.o | ||||
|  OBJS += ../src/ap/wpa_auth_glue.o | ||||
|  OBJS += ../src/ap/utils.o | ||||
| @@ -975,6 +984,12 @@ endif | ||||
| @@ -1022,6 +1031,12 @@ endif | ||||
|  ifdef CONFIG_HS20 | ||||
|  OBJS += ../src/ap/hs20.o | ||||
|  endif | ||||
| @@ -118,7 +118,7 @@ | ||||
|  endif | ||||
|   | ||||
|  ifdef CONFIG_MBO | ||||
| @@ -983,7 +998,9 @@ CFLAGS += -DCONFIG_MBO | ||||
| @@ -1030,7 +1045,9 @@ CFLAGS += -DCONFIG_MBO | ||||
|  endif | ||||
|   | ||||
|  ifdef NEED_RSN_AUTHENTICATOR | ||||
| @@ -128,7 +128,7 @@ | ||||
|  NEED_AES_WRAP=y | ||||
|  OBJS += ../src/ap/wpa_auth.o | ||||
|  OBJS += ../src/ap/wpa_auth_ie.o | ||||
| @@ -1878,6 +1895,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) | ||||
| @@ -2010,6 +2027,12 @@ wpa_priv: $(BCHECK) $(OBJS_priv) | ||||
|   | ||||
|  _OBJS_VAR := OBJS | ||||
|  include ../src/objs.mk | ||||
| @@ -141,7 +141,7 @@ | ||||
|  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) | ||||
|  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) | ||||
|  	@$(E) "  LD " $@ | ||||
| @@ -1983,6 +2006,12 @@ eap_eke.so: ../src/eap_peer/eap_eke.c .. | ||||
| @@ -2142,6 +2165,12 @@ eap_gpsk.so: $(SRC_EAP_GPSK) | ||||
|  	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ | ||||
|  	@$(E) "  sed" $< | ||||
|   | ||||
| @@ -156,7 +156,7 @@ | ||||
|  wpa_cli.exe: wpa_cli | ||||
| --- a/src/drivers/driver.h | ||||
| +++ b/src/drivers/driver.h | ||||
| @@ -6018,8 +6018,8 @@ union wpa_event_data { | ||||
| @@ -6667,8 +6667,8 @@ union wpa_event_data { | ||||
|   * Driver wrapper code should call this function whenever an event is received | ||||
|   * from the driver. | ||||
|   */ | ||||
| @@ -167,7 +167,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * wpa_supplicant_event_global - Report a driver event for wpa_supplicant | ||||
| @@ -6031,7 +6031,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
| @@ -6680,7 +6680,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
|   * Same as wpa_supplicant_event(), but we search for the interface in | ||||
|   * wpa_global. | ||||
|   */ | ||||
| @@ -178,7 +178,7 @@ | ||||
|  /* | ||||
| --- a/src/ap/drv_callbacks.c | ||||
| +++ b/src/ap/drv_callbacks.c | ||||
| @@ -1827,8 +1827,8 @@ err: | ||||
| @@ -2184,8 +2184,8 @@ err: | ||||
|  #endif /* CONFIG_OWE */ | ||||
|   | ||||
|   | ||||
| @@ -189,7 +189,7 @@ | ||||
|  { | ||||
|  	struct hostapd_data *hapd = ctx; | ||||
|  #ifndef CONFIG_NO_STDOUT_DEBUG | ||||
| @@ -2073,7 +2073,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
| @@ -2489,7 +2489,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -200,7 +200,7 @@ | ||||
|  	struct hapd_interfaces *interfaces = ctx; | ||||
| --- a/wpa_supplicant/wpa_priv.c | ||||
| +++ b/wpa_supplicant/wpa_priv.c | ||||
| @@ -1038,8 +1038,8 @@ static void wpa_priv_send_ft_response(st | ||||
| @@ -1039,8 +1039,8 @@ static void wpa_priv_send_ft_response(st | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -211,7 +211,7 @@ | ||||
|  { | ||||
|  	struct wpa_priv_interface *iface = ctx; | ||||
|   | ||||
| @@ -1102,7 +1102,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
| @@ -1103,7 +1103,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -220,7 +220,7 @@ | ||||
|  				 union wpa_event_data *data) | ||||
|  { | ||||
|  	struct wpa_priv_global *global = ctx; | ||||
| @@ -1215,6 +1215,8 @@ int main(int argc, char *argv[]) | ||||
| @@ -1217,6 +1217,8 @@ int main(int argc, char *argv[]) | ||||
|  	if (os_program_init()) | ||||
|  		return -1; | ||||
|   | ||||
| @@ -231,7 +231,7 @@ | ||||
|  	os_memset(&global, 0, sizeof(global)); | ||||
| --- a/wpa_supplicant/events.c | ||||
| +++ b/wpa_supplicant/events.c | ||||
| @@ -4666,8 +4666,8 @@ static void wpas_event_unprot_beacon(str | ||||
| @@ -5353,8 +5353,8 @@ static void wpas_link_reconfig(struct wp | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -242,7 +242,7 @@ | ||||
|  { | ||||
|  	struct wpa_supplicant *wpa_s = ctx; | ||||
|  	int resched; | ||||
| @@ -5512,7 +5512,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
| @@ -6272,7 +6272,7 @@ void wpa_supplicant_event(void *ctx, enu | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -253,7 +253,7 @@ | ||||
|  	struct wpa_supplicant *wpa_s; | ||||
| --- a/wpa_supplicant/wpa_supplicant.c | ||||
| +++ b/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -6814,7 +6814,6 @@ struct wpa_interface * wpa_supplicant_ma | ||||
| @@ -7462,7 +7462,6 @@ struct wpa_interface * wpa_supplicant_ma | ||||
|  	return NULL; | ||||
|  } | ||||
|   | ||||
| @@ -261,7 +261,7 @@ | ||||
|  /** | ||||
|   * wpa_supplicant_match_existing - Match existing interfaces | ||||
|   * @global: Pointer to global data from wpa_supplicant_init() | ||||
| @@ -6849,6 +6848,11 @@ static int wpa_supplicant_match_existing | ||||
| @@ -7497,6 +7496,11 @@ static int wpa_supplicant_match_existing | ||||
|   | ||||
|  #endif /* CONFIG_MATCH_IFACE */ | ||||
|   | ||||
| @@ -273,7 +273,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * wpa_supplicant_add_iface - Add a new network interface | ||||
| @@ -7105,6 +7109,8 @@ struct wpa_global * wpa_supplicant_init( | ||||
| @@ -7753,6 +7757,8 @@ struct wpa_global * wpa_supplicant_init( | ||||
|  #ifndef CONFIG_NO_WPA_MSG | ||||
|  	wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); | ||||
|  #endif /* CONFIG_NO_WPA_MSG */ | ||||
| @@ -284,7 +284,7 @@ | ||||
|  		wpa_debug_open_file(params->wpa_debug_file_path); | ||||
| --- a/hostapd/main.c | ||||
| +++ b/hostapd/main.c | ||||
| @@ -590,6 +590,11 @@ fail: | ||||
| @@ -698,6 +698,11 @@ fail: | ||||
|  	return -1; | ||||
|  } | ||||
|   | ||||
| @@ -296,14 +296,14 @@ | ||||
|   | ||||
|  #ifdef CONFIG_WPS | ||||
|  static int gen_uuid(const char *txt_addr) | ||||
| @@ -683,6 +688,8 @@ int main(int argc, char *argv[]) | ||||
| @@ -791,6 +796,8 @@ int main(int argc, char *argv[]) | ||||
|  		return -1; | ||||
|  #endif /* CONFIG_DPP */ | ||||
|   | ||||
| +	wpa_supplicant_event = hostapd_wpa_event; | ||||
| +	wpa_supplicant_event_global = hostapd_wpa_event_global; | ||||
|  	for (;;) { | ||||
|  		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); | ||||
|  		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q"); | ||||
|  		if (c < 0) | ||||
| --- a/src/drivers/drivers.c | ||||
| +++ b/src/drivers/drivers.c | ||||
| @@ -320,7 +320,7 @@ | ||||
|  { | ||||
| --- a/wpa_supplicant/eapol_test.c | ||||
| +++ b/wpa_supplicant/eapol_test.c | ||||
| @@ -30,7 +30,12 @@ | ||||
| @@ -31,7 +31,12 @@ | ||||
|  #include "ctrl_iface.h" | ||||
|  #include "pcsc_funcs.h" | ||||
|  #include "wpas_glue.h" | ||||
| @@ -333,7 +333,7 @@ | ||||
|   | ||||
|  const struct wpa_driver_ops *const wpa_drivers[] = { NULL }; | ||||
|   | ||||
| @@ -1292,6 +1297,10 @@ static void usage(void) | ||||
| @@ -1303,6 +1308,10 @@ static void usage(void) | ||||
|  	       "option several times.\n"); | ||||
|  } | ||||
|   | ||||
| @@ -344,7 +344,7 @@ | ||||
|   | ||||
|  int main(int argc, char *argv[]) | ||||
|  { | ||||
| @@ -1312,6 +1321,8 @@ int main(int argc, char *argv[]) | ||||
| @@ -1323,6 +1332,8 @@ int main(int argc, char *argv[]) | ||||
|  	if (os_program_init()) | ||||
|  		return -1; | ||||
|   | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/hostapd/config_file.c | ||||
| +++ b/hostapd/config_file.c | ||||
| @@ -3439,6 +3439,10 @@ static int hostapd_config_fill(struct ho | ||||
| @@ -3448,6 +3448,10 @@ static int hostapd_config_fill(struct ho | ||||
|  		if (bss->ocv && !bss->ieee80211w) | ||||
|  			bss->ieee80211w = 1; | ||||
|  #endif /* CONFIG_OCV */ | ||||
| @@ -13,7 +13,7 @@ | ||||
|  	} else if (os_strcmp(buf, "ht_capab") == 0) { | ||||
| --- a/src/ap/ap_config.h | ||||
| +++ b/src/ap/ap_config.h | ||||
| @@ -995,6 +995,8 @@ struct hostapd_config { | ||||
| @@ -1075,6 +1075,8 @@ struct hostapd_config { | ||||
|   | ||||
|  	int ht_op_mode_fixed; | ||||
|  	u16 ht_capab; | ||||
| @@ -24,7 +24,7 @@ | ||||
|  	int no_pri_sec_switch; | ||||
| --- a/src/ap/hw_features.c | ||||
| +++ b/src/ap/hw_features.c | ||||
| @@ -517,7 +517,8 @@ static int ieee80211n_check_40mhz(struct | ||||
| @@ -546,7 +546,8 @@ static int ieee80211n_check_40mhz(struct | ||||
|  	int ret; | ||||
|   | ||||
|  	/* Check that HT40 is used and PRI / SEC switch is allowed */ | ||||
| @@ -36,7 +36,7 @@ | ||||
|  	hostapd_set_state(iface, HAPD_IFACE_HT_SCAN); | ||||
| --- a/src/ap/ieee802_11_ht.c | ||||
| +++ b/src/ap/ieee802_11_ht.c | ||||
| @@ -230,6 +230,9 @@ void hostapd_2040_coex_action(struct hos | ||||
| @@ -239,6 +239,9 @@ void hostapd_2040_coex_action(struct hos | ||||
|  		return; | ||||
|  	} | ||||
|   | ||||
| @@ -46,7 +46,7 @@ | ||||
|  	if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) { | ||||
|  		wpa_printf(MSG_DEBUG, | ||||
|  			   "Ignore too short 20/40 BSS Coexistence Management frame"); | ||||
| @@ -390,6 +393,9 @@ void ht40_intolerant_add(struct hostapd_ | ||||
| @@ -399,6 +402,9 @@ void ht40_intolerant_add(struct hostapd_ | ||||
|  	if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) | ||||
|  		return; | ||||
|   | ||||
|   | ||||
| @@ -1,81 +0,0 @@ | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/config.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/config.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/config.c | ||||
| @@ -2532,6 +2532,7 @@ static const struct parse_data ssid_fiel | ||||
|  #else /* CONFIG_MESH */ | ||||
|  	{ INT_RANGE(mode, 0, 4) }, | ||||
|  #endif /* CONFIG_MESH */ | ||||
| +	{ INT_RANGE(noscan, 0, 1) }, | ||||
|  	{ INT_RANGE(proactive_key_caching, 0, 1) }, | ||||
|  	{ INT_RANGE(disabled, 0, 2) }, | ||||
|  	{ STR(id_str) }, | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/config_file.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/config_file.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/config_file.c | ||||
| @@ -769,6 +769,7 @@ static void wpa_config_write_network(FIL | ||||
|  #endif /* IEEE8021X_EAPOL */ | ||||
|  	INT(mode); | ||||
|  	INT(no_auto_peer); | ||||
| +	INT(noscan); | ||||
|  	INT(mesh_fwding); | ||||
|  	INT(frequency); | ||||
|  	INT(enable_edmg); | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/mesh.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/mesh.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/mesh.c | ||||
| @@ -505,6 +505,8 @@ static int wpa_supplicant_mesh_init(stru | ||||
|  			   frequency); | ||||
|  		goto out_free; | ||||
|  	} | ||||
| +	if (ssid->noscan) | ||||
| +		conf->noscan = 1; | ||||
|   | ||||
|  	if (ssid->mesh_basic_rates == NULL) { | ||||
|  		/* | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/wpa_supplicant.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -2433,7 +2433,7 @@ void ibss_mesh_setup_freq(struct wpa_sup | ||||
|  	int ieee80211_mode = wpas_mode_to_ieee80211_mode(ssid->mode); | ||||
|  	enum hostapd_hw_mode hw_mode; | ||||
|  	struct hostapd_hw_modes *mode = NULL; | ||||
| -	int ht40plus[] = { 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, | ||||
| +	int ht40plus[] = { 1, 2, 3, 4, 5, 6, 36, 44, 52, 60, 100, 108, 116, 124, 132, 149, 157, | ||||
|  			   184, 192 }; | ||||
|  	int bw80[] = { 5180, 5260, 5500, 5580, 5660, 5745, 5955, | ||||
|  		       6035, 6115, 6195, 6275, 6355, 6435, 6515, | ||||
| @@ -2441,7 +2441,7 @@ void ibss_mesh_setup_freq(struct wpa_sup | ||||
|  	int bw160[] = { 5955, 6115, 6275, 6435, 6595, 6755, 6915 }; | ||||
|  	struct hostapd_channel_data *pri_chan = NULL, *sec_chan = NULL; | ||||
|  	u8 channel; | ||||
| -	int i, chan_idx, ht40 = -1, res, obss_scan = 1; | ||||
| +	int i, chan_idx, ht40 = -1, res, obss_scan = !(ssid->noscan); | ||||
|  	unsigned int j, k; | ||||
|  	struct hostapd_freq_params vht_freq; | ||||
|  	int chwidth, seg0, seg1; | ||||
| @@ -2530,7 +2530,7 @@ void ibss_mesh_setup_freq(struct wpa_sup | ||||
|  #endif /* CONFIG_HE_OVERRIDES */ | ||||
|   | ||||
|  	/* Setup higher BW only for 5 GHz */ | ||||
| -	if (mode->mode != HOSTAPD_MODE_IEEE80211A) | ||||
| +	if (mode->mode != HOSTAPD_MODE_IEEE80211A && !(ssid->noscan)) | ||||
|  		return; | ||||
|   | ||||
|  	for (chan_idx = 0; chan_idx < mode->num_channels; chan_idx++) { | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/config_ssid.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/config_ssid.h | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/config_ssid.h | ||||
| @@ -974,6 +974,8 @@ struct wpa_ssid { | ||||
|  	 */ | ||||
|  	int no_auto_peer; | ||||
|   | ||||
| +	int noscan; | ||||
| + | ||||
|  	/** | ||||
|  	 * mesh_rssi_threshold - Set mesh parameter mesh_rssi_threshold (dBm) | ||||
|  	 * | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/wpa_supplicant/wpa_supplicant.c | ||||
| +++ b/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -5147,7 +5147,7 @@ wpa_supplicant_alloc(struct wpa_supplica | ||||
| @@ -5769,7 +5769,7 @@ wpa_supplicant_alloc(struct wpa_supplica | ||||
|  	if (wpa_s == NULL) | ||||
|  		return NULL; | ||||
|  	wpa_s->scan_req = INITIAL_SCAN_REQ; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/src/drivers/drivers.mak | ||||
| +++ b/src/drivers/drivers.mak | ||||
| @@ -50,7 +50,6 @@ NEED_SME=y | ||||
| @@ -54,7 +54,6 @@ NEED_SME=y | ||||
|  NEED_AP_MLME=y | ||||
|  NEED_NETLINK=y | ||||
|  NEED_LINUX_IOCTL=y | ||||
| @@ -8,7 +8,7 @@ | ||||
|  NEED_RADIOTAP=y | ||||
|  NEED_LIBNL=y | ||||
|  endif | ||||
| @@ -107,7 +106,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT | ||||
| @@ -111,7 +110,6 @@ DRV_WPA_CFLAGS += -DCONFIG_DRIVER_WEXT | ||||
|  CONFIG_WIRELESS_EXTENSION=y | ||||
|  NEED_NETLINK=y | ||||
|  NEED_LINUX_IOCTL=y | ||||
| @@ -16,7 +16,7 @@ | ||||
|  endif | ||||
|   | ||||
|  ifdef CONFIG_DRIVER_NDIS | ||||
| @@ -133,7 +131,6 @@ endif | ||||
| @@ -137,7 +135,6 @@ endif | ||||
|  ifdef CONFIG_WIRELESS_EXTENSION | ||||
|  DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION | ||||
|  DRV_WPA_OBJS += ../src/drivers/driver_wext.o | ||||
| @@ -24,7 +24,7 @@ | ||||
|  endif | ||||
|   | ||||
|  ifdef NEED_NETLINK | ||||
| @@ -142,6 +139,7 @@ endif | ||||
| @@ -146,6 +143,7 @@ endif | ||||
|   | ||||
|  ifdef NEED_RFKILL | ||||
|  DRV_OBJS += ../src/drivers/rfkill.o | ||||
|   | ||||
| @@ -1,8 +1,8 @@ | ||||
| --- a/src/drivers/driver_nl80211.c | ||||
| +++ b/src/drivers/driver_nl80211.c | ||||
| @@ -4919,7 +4919,7 @@ static int nl80211_set_channel(struct i8 | ||||
|  		   freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, | ||||
|  		   freq->bandwidth, freq->center_freq1, freq->center_freq2); | ||||
| @@ -5407,7 +5407,7 @@ static int nl80211_set_channel(struct i8 | ||||
|  		   freq->he_enabled, freq->eht_enabled, freq->bandwidth, | ||||
|  		   freq->center_freq1, freq->center_freq2); | ||||
|   | ||||
| -	msg = nl80211_drv_msg(drv, 0, set_chan ? NL80211_CMD_SET_CHANNEL : | ||||
| +	msg = nl80211_bss_msg(bss, 0, set_chan ? NL80211_CMD_SET_CHANNEL : | ||||
|   | ||||
| @@ -1,13 +1,18 @@ | ||||
| --- a/wpa_supplicant/ap.c | ||||
| +++ b/wpa_supplicant/ap.c | ||||
| @@ -1513,15 +1513,35 @@ int ap_switch_channel(struct wpa_supplic | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ap.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/ap.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ap.c | ||||
| @@ -1852,25 +1852,35 @@ int ap_switch_channel(struct wpa_supplic | ||||
|   | ||||
|   | ||||
|  #ifdef CONFIG_CTRL_IFACE | ||||
| -int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos) | ||||
| + | ||||
| +static int __ap_ctrl_iface_chanswitch(struct hostapd_iface *iface, | ||||
| +				      struct csa_settings *settings) | ||||
| +{ | ||||
|  { | ||||
| -	struct csa_settings settings; | ||||
| -	int ret; | ||||
| +#ifdef NEED_AP_MLME | ||||
| +	if (!iface || !iface->bss[0]) | ||||
| +		return 0; | ||||
| @@ -17,17 +22,25 @@ | ||||
| +	return -1; | ||||
| +#endif | ||||
| +} | ||||
| + | ||||
| + | ||||
|  int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos) | ||||
|  { | ||||
|  	struct csa_settings settings; | ||||
|  	int ret = hostapd_parse_csa_settings(pos, &settings); | ||||
|   | ||||
| -	if (wpa_s->ifmsh && wpa_s->ifmsh->conf->disable_csa_dfs == 1) { | ||||
| -		wpa_printf(MSG_DEBUG, "wpa chanswitch interface %s :" | ||||
| -			   " cancelling radar handling timeout", | ||||
| -			   wpa_s->ifmsh->conf->bss[0]->iface); | ||||
| -		eloop_cancel_timeout(hostapd_dfs_radar_handling_timeout, | ||||
| -				     wpa_s->ifmsh, NULL); | ||||
| -	} | ||||
|   | ||||
| -	ret = hostapd_parse_csa_settings(pos, &settings); | ||||
| +int ap_ctrl_iface_chanswitch(struct wpa_supplicant *wpa_s, const char *pos) | ||||
| +{ | ||||
| + 	struct csa_settings settings; | ||||
| + 	int ret = hostapd_parse_csa_settings(pos, &settings); | ||||
| +  | ||||
| +	if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) && | ||||
| +	    !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0])) | ||||
| +		return -1; | ||||
| + | ||||
|   | ||||
| +	ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings); | ||||
|  	if (ret) | ||||
|  		return ret; | ||||
|   | ||||
| @@ -1,54 +0,0 @@ | ||||
| --- a/src/drivers/driver_nl80211.c | ||||
| +++ b/src/drivers/driver_nl80211.c | ||||
| @@ -2891,10 +2891,15 @@ static int wpa_driver_nl80211_del_beacon | ||||
|  	struct nl_msg *msg; | ||||
|  	struct wpa_driver_nl80211_data *drv = bss->drv; | ||||
|   | ||||
| +	if (!bss->beacon_set) | ||||
| +		return 0; | ||||
| + | ||||
| +	bss->beacon_set = 0; | ||||
| + | ||||
|  	wpa_printf(MSG_DEBUG, "nl80211: Remove beacon (ifindex=%d)", | ||||
| -		   drv->ifindex); | ||||
| +		   bss->ifindex); | ||||
|  	nl80211_put_wiphy_data_ap(bss); | ||||
| -	msg = nl80211_drv_msg(drv, 0, NL80211_CMD_DEL_BEACON); | ||||
| +	msg = nl80211_bss_msg(bss, 0, NL80211_CMD_DEL_BEACON); | ||||
|  	return send_and_recv_msgs(drv, msg, NULL, NULL, NULL, NULL); | ||||
|  } | ||||
|   | ||||
| @@ -5550,7 +5555,7 @@ static void nl80211_teardown_ap(struct i | ||||
|  		nl80211_mgmt_unsubscribe(bss, "AP teardown"); | ||||
|   | ||||
|  	nl80211_put_wiphy_data_ap(bss); | ||||
| -	bss->beacon_set = 0; | ||||
| +	wpa_driver_nl80211_del_beacon(bss); | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -7990,8 +7995,6 @@ static int wpa_driver_nl80211_if_remove( | ||||
|  	} else { | ||||
|  		wpa_printf(MSG_DEBUG, "nl80211: First BSS - reassign context"); | ||||
|  		nl80211_teardown_ap(bss); | ||||
| -		if (!bss->added_if && !drv->first_bss->next) | ||||
| -			wpa_driver_nl80211_del_beacon(bss); | ||||
|  		nl80211_destroy_bss(bss); | ||||
|  		if (!bss->added_if) | ||||
|  			i802_set_iface_flags(bss, 0); | ||||
| @@ -8388,7 +8391,6 @@ static int wpa_driver_nl80211_deinit_ap( | ||||
|  	if (!is_ap_interface(drv->nlmode)) | ||||
|  		return -1; | ||||
|  	wpa_driver_nl80211_del_beacon(bss); | ||||
| -	bss->beacon_set = 0; | ||||
|   | ||||
|  	/* | ||||
|  	 * If the P2P GO interface was dynamically added, then it is | ||||
| @@ -8408,7 +8410,6 @@ static int wpa_driver_nl80211_stop_ap(vo | ||||
|  	if (!is_ap_interface(drv->nlmode)) | ||||
|  		return -1; | ||||
|  	wpa_driver_nl80211_del_beacon(bss); | ||||
| -	bss->beacon_set = 0; | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| @@ -1,5 +1,7 @@ | ||||
| --- a/hostapd/Makefile | ||||
| +++ b/hostapd/Makefile | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/hostapd/Makefile | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/Makefile | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/hostapd/Makefile | ||||
| @@ -221,6 +221,9 @@ endif | ||||
|  ifdef CONFIG_NO_CTRL_IFACE | ||||
|  CFLAGS += -DCONFIG_NO_CTRL_IFACE | ||||
| @@ -10,9 +12,11 @@ | ||||
|  ifeq ($(CONFIG_CTRL_IFACE), udp) | ||||
|  CFLAGS += -DCONFIG_CTRL_IFACE_UDP | ||||
|  else | ||||
| --- a/hostapd/ctrl_iface.c | ||||
| +++ b/hostapd/ctrl_iface.c | ||||
| @@ -3388,6 +3388,7 @@ static int hostapd_ctrl_iface_receive_pr | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/hostapd/ctrl_iface.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/ctrl_iface.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/hostapd/ctrl_iface.c | ||||
| @@ -3805,6 +3805,7 @@ static int hostapd_ctrl_iface_receive_pr | ||||
|  						      reply_size); | ||||
|  	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { | ||||
|  		reply_len = hostapd_drv_status(hapd, reply, reply_size); | ||||
| @@ -20,7 +24,7 @@ | ||||
|  	} else if (os_strcmp(buf, "MIB") == 0) { | ||||
|  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size); | ||||
|  		if (reply_len >= 0) { | ||||
| @@ -3429,6 +3430,7 @@ static int hostapd_ctrl_iface_receive_pr | ||||
| @@ -3846,6 +3847,7 @@ static int hostapd_ctrl_iface_receive_pr | ||||
|  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { | ||||
|  		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, | ||||
|  							reply_size); | ||||
| @@ -28,9 +32,11 @@ | ||||
|  	} else if (os_strcmp(buf, "ATTACH") == 0) { | ||||
|  		if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL)) | ||||
|  			reply_len = -1; | ||||
| --- a/wpa_supplicant/Makefile | ||||
| +++ b/wpa_supplicant/Makefile | ||||
| @@ -942,6 +942,9 @@ ifdef CONFIG_FILS | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/Makefile | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/Makefile | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/Makefile | ||||
| @@ -987,6 +987,9 @@ ifdef CONFIG_FILS | ||||
|  OBJS += ../src/ap/fils_hlp.o | ||||
|  endif | ||||
|  ifdef CONFIG_CTRL_IFACE | ||||
| @@ -40,9 +46,11 @@ | ||||
|  OBJS += ../src/ap/ctrl_iface_ap.o | ||||
|  endif | ||||
|   | ||||
| --- a/wpa_supplicant/ctrl_iface.c | ||||
| +++ b/wpa_supplicant/ctrl_iface.c | ||||
| @@ -2294,7 +2294,7 @@ static int wpa_supplicant_ctrl_iface_sta | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ctrl_iface.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/ctrl_iface.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ctrl_iface.c | ||||
| @@ -2327,7 +2327,7 @@ static int wpa_supplicant_ctrl_iface_sta | ||||
|  			pos += ret; | ||||
|  		} | ||||
|   | ||||
| @@ -51,7 +59,7 @@ | ||||
|  		if (wpa_s->ap_iface) { | ||||
|  			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, | ||||
|  							    end - pos, | ||||
| @@ -10602,6 +10602,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||
| @@ -11989,6 +11989,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||
|  			reply_len = -1; | ||||
|  	} else if (os_strncmp(buf, "NOTE ", 5) == 0) { | ||||
|  		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); | ||||
| @@ -59,7 +67,7 @@ | ||||
|  	} else if (os_strcmp(buf, "MIB") == 0) { | ||||
|  		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); | ||||
|  		if (reply_len >= 0) { | ||||
| @@ -10614,6 +10615,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||
| @@ -12001,6 +12002,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||
|  				reply_size - reply_len); | ||||
|  #endif /* CONFIG_MACSEC */ | ||||
|  		} | ||||
| @@ -67,7 +75,7 @@ | ||||
|  	} else if (os_strncmp(buf, "STATUS", 6) == 0) { | ||||
|  		reply_len = wpa_supplicant_ctrl_iface_status( | ||||
|  			wpa_s, buf + 6, reply, reply_size); | ||||
| @@ -11102,6 +11104,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||
| @@ -12489,6 +12491,7 @@ char * wpa_supplicant_ctrl_iface_process | ||||
|  		reply_len = wpa_supplicant_ctrl_iface_bss( | ||||
|  			wpa_s, buf + 4, reply, reply_size); | ||||
|  #ifdef CONFIG_AP | ||||
| @@ -75,7 +83,7 @@ | ||||
|  	} else if (os_strcmp(buf, "STA-FIRST") == 0) { | ||||
|  		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); | ||||
|  	} else if (os_strncmp(buf, "STA ", 4) == 0) { | ||||
| @@ -11110,12 +11113,15 @@ char * wpa_supplicant_ctrl_iface_process | ||||
| @@ -12497,12 +12500,15 @@ char * wpa_supplicant_ctrl_iface_process | ||||
|  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { | ||||
|  		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, | ||||
|  						   reply_size); | ||||
| @@ -91,17 +99,19 @@ | ||||
|  	} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { | ||||
|  		if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12)) | ||||
|  			reply_len = -1; | ||||
| --- a/src/ap/ctrl_iface_ap.c | ||||
| +++ b/src/ap/ctrl_iface_ap.c | ||||
| @@ -25,6 +25,7 @@ | ||||
|  #include "mbo_ap.h" | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ctrl_iface_ap.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ctrl_iface_ap.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/ctrl_iface_ap.c | ||||
| @@ -26,6 +26,7 @@ | ||||
|  #include "taxonomy.h" | ||||
|  #include "wnm_ap.h" | ||||
|   | ||||
| +#ifdef CONFIG_CTRL_IFACE_MIB | ||||
|   | ||||
|  static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen, | ||||
|  					   size_t curr_len, const u8 *mcs_set) | ||||
| @@ -451,6 +452,7 @@ int hostapd_ctrl_iface_sta_next(struct h | ||||
|  typedef enum { | ||||
|  	BAND_UNII_1 = 1, | ||||
| @@ -760,6 +761,7 @@ int hostapd_ctrl_iface_sta_next(struct h | ||||
|  	return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); | ||||
|  } | ||||
|   | ||||
| @@ -109,7 +119,7 @@ | ||||
|   | ||||
|  #ifdef CONFIG_P2P_MANAGER | ||||
|  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, | ||||
| @@ -807,12 +809,12 @@ int hostapd_ctrl_iface_status(struct hos | ||||
| @@ -1192,12 +1194,12 @@ int hostapd_ctrl_iface_status(struct hos | ||||
|  			return len; | ||||
|  		len += ret; | ||||
|  	} | ||||
| @@ -124,9 +134,11 @@ | ||||
|  	if (iface->current_rates && iface->num_rates) { | ||||
|  		ret = os_snprintf(buf + len, buflen - len, "supported_rates="); | ||||
|  		if (os_snprintf_error(buflen - len, ret)) | ||||
| --- a/src/ap/ieee802_1x.c | ||||
| +++ b/src/ap/ieee802_1x.c | ||||
| @@ -2712,6 +2712,7 @@ static const char * bool_txt(bool val) | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ieee802_1x.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ieee802_1x.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/ieee802_1x.c | ||||
| @@ -2768,6 +2768,7 @@ static const char * bool_txt(bool val) | ||||
|  	return val ? "TRUE" : "FALSE"; | ||||
|  } | ||||
|   | ||||
| @@ -134,7 +146,7 @@ | ||||
|   | ||||
|  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) | ||||
|  { | ||||
| @@ -2898,6 +2899,7 @@ int ieee802_1x_get_mib_sta(struct hostap | ||||
| @@ -2954,6 +2955,7 @@ int ieee802_1x_get_mib_sta(struct hostap | ||||
|  	return len; | ||||
|  } | ||||
|   | ||||
| @@ -142,9 +154,11 @@ | ||||
|   | ||||
|  #ifdef CONFIG_HS20 | ||||
|  static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) | ||||
| --- a/src/ap/wpa_auth.c | ||||
| +++ b/src/ap/wpa_auth.c | ||||
| @@ -4503,6 +4503,7 @@ static const char * wpa_bool_txt(int val | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/wpa_auth.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/wpa_auth.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/wpa_auth.c | ||||
| @@ -5715,6 +5715,7 @@ static const char * wpa_bool_txt(int val | ||||
|  	return val ? "TRUE" : "FALSE"; | ||||
|  } | ||||
|   | ||||
| @@ -152,7 +166,7 @@ | ||||
|   | ||||
|  #define RSN_SUITE "%02x-%02x-%02x-%d" | ||||
|  #define RSN_SUITE_ARG(s) \ | ||||
| @@ -4653,7 +4654,7 @@ int wpa_get_mib_sta(struct wpa_state_mac | ||||
| @@ -5867,7 +5868,7 @@ int wpa_get_mib_sta(struct wpa_state_mac | ||||
|   | ||||
|  	return len; | ||||
|  } | ||||
| @@ -161,9 +175,11 @@ | ||||
|   | ||||
|  void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) | ||||
|  { | ||||
| --- a/src/rsn_supp/wpa.c | ||||
| +++ b/src/rsn_supp/wpa.c | ||||
| @@ -2763,6 +2763,8 @@ static u32 wpa_key_mgmt_suite(struct wpa | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/rsn_supp/wpa.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/rsn_supp/wpa.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/rsn_supp/wpa.c | ||||
| @@ -3835,6 +3835,8 @@ static u32 wpa_key_mgmt_suite(struct wpa | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -172,7 +188,7 @@ | ||||
|  #define RSN_SUITE "%02x-%02x-%02x-%d" | ||||
|  #define RSN_SUITE_ARG(s) \ | ||||
|  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff | ||||
| @@ -2844,6 +2846,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch | ||||
| @@ -3916,6 +3918,7 @@ int wpa_sm_get_mib(struct wpa_sm *sm, ch | ||||
|   | ||||
|  	return (int) len; | ||||
|  } | ||||
| @@ -180,9 +196,11 @@ | ||||
|  #endif /* CONFIG_CTRL_IFACE */ | ||||
|   | ||||
|   | ||||
| --- a/wpa_supplicant/ap.c | ||||
| +++ b/wpa_supplicant/ap.c | ||||
| @@ -1364,7 +1364,7 @@ int wpas_ap_wps_nfc_report_handover(stru | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ap.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/ap.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ap.c | ||||
| @@ -1512,7 +1512,7 @@ int wpas_ap_wps_nfc_report_handover(stru | ||||
|  #endif /* CONFIG_WPS */ | ||||
|   | ||||
|   | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/hostapd/hostapd_cli.c | ||||
| +++ b/hostapd/hostapd_cli.c | ||||
| @@ -744,7 +744,7 @@ static int wpa_ctrl_command_sta(struct w | ||||
| @@ -757,7 +757,7 @@ static int wpa_ctrl_command_sta(struct w | ||||
|  	} | ||||
|   | ||||
|  	buf[len] = '\0'; | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/src/common/wpa_common.c | ||||
| +++ b/src/common/wpa_common.c | ||||
| @@ -2444,6 +2444,31 @@ u32 wpa_akm_to_suite(int akm) | ||||
| @@ -2841,6 +2841,31 @@ u32 wpa_akm_to_suite(int akm) | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -32,7 +32,7 @@ | ||||
|  int wpa_compare_rsn_ie(int ft_initial_assoc, | ||||
|  		       const u8 *ie1, size_t ie1len, | ||||
|  		       const u8 *ie2, size_t ie2len) | ||||
| @@ -2451,8 +2476,19 @@ int wpa_compare_rsn_ie(int ft_initial_as | ||||
| @@ -2848,8 +2873,19 @@ int wpa_compare_rsn_ie(int ft_initial_as | ||||
|  	if (ie1 == NULL || ie2 == NULL) | ||||
|  		return -1; | ||||
|   | ||||
|   | ||||
| @@ -11,7 +11,7 @@ | ||||
|  			bss->wpa_pairwise |= WPA_CIPHER_TKIP; | ||||
|  #endif /* CONFIG_NO_TKIP */ | ||||
|  		bss->rsn_pairwise = bss->wpa_pairwise; | ||||
| @@ -1178,8 +1177,7 @@ int hostapd_init_wps(struct hostapd_data | ||||
| @@ -1181,8 +1180,7 @@ int hostapd_init_wps(struct hostapd_data | ||||
|  					  WPA_CIPHER_GCMP_256)) { | ||||
|  			wps->encr_types |= WPS_ENCR_AES; | ||||
|  			wps->encr_types_rsn |= WPS_ENCR_AES; | ||||
|   | ||||
| @@ -60,7 +60,7 @@ | ||||
|  #ifdef CONFIG_DEBUG_FILE | ||||
|  static char *last_path = NULL; | ||||
|  #endif /* CONFIG_DEBUG_FILE */ | ||||
| @@ -636,7 +610,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_ | ||||
| @@ -644,7 +618,7 @@ void wpa_msg_register_ifname_cb(wpa_msg_ | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -69,7 +69,7 @@ | ||||
|  { | ||||
|  	va_list ap; | ||||
|  	char *buf; | ||||
| @@ -674,7 +648,7 @@ void wpa_msg(void *ctx, int level, const | ||||
| @@ -682,7 +656,7 @@ void wpa_msg(void *ctx, int level, const | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -80,9 +80,9 @@ | ||||
|  	char *buf; | ||||
| --- a/src/utils/wpa_debug.h | ||||
| +++ b/src/utils/wpa_debug.h | ||||
| @@ -50,6 +50,17 @@ int wpa_debug_reopen_file(void); | ||||
|  void wpa_debug_close_file(void); | ||||
| @@ -51,6 +51,17 @@ void wpa_debug_close_file(void); | ||||
|  void wpa_debug_setup_stdout(void); | ||||
|  void wpa_debug_stop_log(void); | ||||
|   | ||||
| +/* internal */ | ||||
| +void _wpa_hexdump(int level, const char *title, const u8 *buf, | ||||
| @@ -98,7 +98,7 @@ | ||||
|  /** | ||||
|   * wpa_debug_printf_timestamp - Print timestamp for debug output | ||||
|   * | ||||
| @@ -70,9 +81,15 @@ void wpa_debug_print_timestamp(void); | ||||
| @@ -71,9 +82,15 @@ void wpa_debug_print_timestamp(void); | ||||
|   * | ||||
|   * Note: New line '\n' is added to the end of the text when printing to stdout. | ||||
|   */ | ||||
| @@ -115,7 +115,7 @@ | ||||
|  /** | ||||
|   * wpa_hexdump - conditional hex dump | ||||
|   * @level: priority level (MSG_*) of the message | ||||
| @@ -84,7 +101,13 @@ PRINTF_FORMAT(2, 3); | ||||
| @@ -85,7 +102,13 @@ PRINTF_FORMAT(2, 3); | ||||
|   * output may be directed to stdout, stderr, and/or syslog based on | ||||
|   * configuration. The contents of buf is printed out has hex dump. | ||||
|   */ | ||||
| @@ -130,7 +130,7 @@ | ||||
|   | ||||
|  static inline void wpa_hexdump_buf(int level, const char *title, | ||||
|  				   const struct wpabuf *buf) | ||||
| @@ -106,7 +129,13 @@ static inline void wpa_hexdump_buf(int l | ||||
| @@ -107,7 +130,13 @@ static inline void wpa_hexdump_buf(int l | ||||
|   * like wpa_hexdump(), but by default, does not include secret keys (passwords, | ||||
|   * etc.) in debug output. | ||||
|   */ | ||||
| @@ -145,7 +145,7 @@ | ||||
|   | ||||
|  static inline void wpa_hexdump_buf_key(int level, const char *title, | ||||
|  				       const struct wpabuf *buf) | ||||
| @@ -128,8 +157,14 @@ static inline void wpa_hexdump_buf_key(i | ||||
| @@ -129,8 +158,14 @@ static inline void wpa_hexdump_buf_key(i | ||||
|   * the hex numbers and ASCII characters (for printable range) are shown. 16 | ||||
|   * bytes per line will be shown. | ||||
|   */ | ||||
| @@ -162,7 +162,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * wpa_hexdump_ascii_key - conditional hex dump, hide keys | ||||
| @@ -145,8 +180,14 @@ void wpa_hexdump_ascii(int level, const | ||||
| @@ -146,8 +181,14 @@ void wpa_hexdump_ascii(int level, const | ||||
|   * bytes per line will be shown. This works like wpa_hexdump_ascii(), but by | ||||
|   * default, does not include secret keys (passwords, etc.) in debug output. | ||||
|   */ | ||||
| @@ -179,7 +179,7 @@ | ||||
|   | ||||
|  /* | ||||
|   * wpa_dbg() behaves like wpa_msg(), but it can be removed from build to reduce | ||||
| @@ -183,7 +224,12 @@ void wpa_hexdump_ascii_key(int level, co | ||||
| @@ -184,7 +225,12 @@ void wpa_hexdump_ascii_key(int level, co | ||||
|   * | ||||
|   * Note: New line '\n' is added to the end of the text when printing to stdout. | ||||
|   */ | ||||
| @@ -193,7 +193,7 @@ | ||||
|   | ||||
|  /** | ||||
|   * wpa_msg_ctrl - Conditional printf for ctrl_iface monitors | ||||
| @@ -197,8 +243,13 @@ void wpa_msg(void *ctx, int level, const | ||||
| @@ -198,8 +244,13 @@ void wpa_msg(void *ctx, int level, const | ||||
|   * attached ctrl_iface monitors. In other words, it can be used for frequent | ||||
|   * events that do not need to be sent to syslog. | ||||
|   */ | ||||
|   | ||||
| @@ -1,23 +1,24 @@ | ||||
| --- a/hostapd/main.c | ||||
| +++ b/hostapd/main.c | ||||
| @@ -15,6 +15,7 @@ | ||||
|  #include "utils/common.h" | ||||
|  #include "utils/eloop.h" | ||||
|  #include "utils/uuid.h" | ||||
| +#include "utils/build_features.h" | ||||
|  #include "crypto/random.h" | ||||
|  #include "crypto/tls.h" | ||||
|  #include "common/version.h" | ||||
| @@ -691,7 +692,7 @@ int main(int argc, char *argv[]) | ||||
| @@ -31,7 +31,7 @@ | ||||
|  #include "config_file.h" | ||||
|  #include "eap_register.h" | ||||
|  #include "ctrl_iface.h" | ||||
| - | ||||
| +#include "build_features.h" | ||||
|   | ||||
|  struct hapd_global { | ||||
|  	void **drv_priv; | ||||
| @@ -799,7 +799,7 @@ int main(int argc, char *argv[]) | ||||
|  	wpa_supplicant_event = hostapd_wpa_event; | ||||
|  	wpa_supplicant_event_global = hostapd_wpa_event_global; | ||||
|  	for (;;) { | ||||
| -		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:"); | ||||
| +		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:v::"); | ||||
| -		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:vg:G:q"); | ||||
| +		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::"); | ||||
|  		if (c < 0) | ||||
|  			break; | ||||
|  		switch (c) { | ||||
| @@ -728,6 +729,8 @@ int main(int argc, char *argv[]) | ||||
| @@ -836,6 +836,8 @@ int main(int argc, char *argv[]) | ||||
|  			break; | ||||
|  #endif /* CONFIG_DEBUG_LINUX_TRACING */ | ||||
|  		case 'v': | ||||
| @@ -25,7 +26,7 @@ | ||||
| +				exit(!has_feature(optarg)); | ||||
|  			show_version(); | ||||
|  			exit(1); | ||||
|  			break; | ||||
|  		case 'g': | ||||
| --- a/wpa_supplicant/main.c | ||||
| +++ b/wpa_supplicant/main.c | ||||
| @@ -12,6 +12,7 @@ | ||||
| @@ -33,10 +34,10 @@ | ||||
|   | ||||
|  #include "common.h" | ||||
| +#include "build_features.h" | ||||
|  #include "crypto/crypto.h" | ||||
|  #include "fst/fst.h" | ||||
|  #include "wpa_supplicant_i.h" | ||||
|  #include "driver_i.h" | ||||
| @@ -201,7 +202,7 @@ int main(int argc, char *argv[]) | ||||
| @@ -202,7 +203,7 @@ int main(int argc, char *argv[]) | ||||
|   | ||||
|  	for (;;) { | ||||
|  		c = getopt(argc, argv, | ||||
| @@ -45,7 +46,7 @@ | ||||
|  		if (c < 0) | ||||
|  			break; | ||||
|  		switch (c) { | ||||
| @@ -301,8 +302,12 @@ int main(int argc, char *argv[]) | ||||
| @@ -302,8 +303,12 @@ int main(int argc, char *argv[]) | ||||
|  			break; | ||||
|  #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ | ||||
|  		case 'v': | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/hostapd/hostapd_cli.c | ||||
| +++ b/hostapd/hostapd_cli.c | ||||
| @@ -388,7 +388,6 @@ static int hostapd_cli_cmd_disassociate( | ||||
| @@ -401,7 +401,6 @@ static int hostapd_cli_cmd_disassociate( | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -8,7 +8,7 @@ | ||||
|  static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc, | ||||
|  				     char *argv[]) | ||||
|  { | ||||
| @@ -401,7 +400,6 @@ static int hostapd_cli_cmd_signature(str | ||||
| @@ -414,7 +413,6 @@ static int hostapd_cli_cmd_signature(str | ||||
|  	os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]); | ||||
|  	return wpa_ctrl_command(ctrl, buf); | ||||
|  } | ||||
| @@ -16,7 +16,7 @@ | ||||
|   | ||||
|   | ||||
|  static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc, | ||||
| @@ -418,7 +416,6 @@ static int hostapd_cli_cmd_sa_query(stru | ||||
| @@ -431,7 +429,6 @@ static int hostapd_cli_cmd_sa_query(stru | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -24,7 +24,7 @@ | ||||
|  static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, | ||||
|  				   char *argv[]) | ||||
|  { | ||||
| @@ -644,7 +641,6 @@ static int hostapd_cli_cmd_wps_config(st | ||||
| @@ -657,7 +654,6 @@ static int hostapd_cli_cmd_wps_config(st | ||||
|  			 ssid_hex, argv[1]); | ||||
|  	return wpa_ctrl_command(ctrl, buf); | ||||
|  } | ||||
| @@ -32,7 +32,7 @@ | ||||
|   | ||||
|   | ||||
|  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, | ||||
| @@ -1571,13 +1567,10 @@ static const struct hostapd_cli_cmd host | ||||
| @@ -1610,13 +1606,10 @@ static const struct hostapd_cli_cmd host | ||||
|  	{ "disassociate", hostapd_cli_cmd_disassociate, | ||||
|  	  hostapd_complete_stations, | ||||
|  	  "<addr> = disassociate a station" }, | ||||
| @@ -46,7 +46,7 @@ | ||||
|  	{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL, | ||||
|  	  "<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" }, | ||||
|  	{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, | ||||
| @@ -1602,7 +1595,6 @@ static const struct hostapd_cli_cmd host | ||||
| @@ -1641,7 +1634,6 @@ static const struct hostapd_cli_cmd host | ||||
|  	  "<SSID> <auth> <encr> <key> = configure AP" }, | ||||
|  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, | ||||
|  	  "= show current WPS status" }, | ||||
|   | ||||
| @@ -1,10 +0,0 @@ | ||||
| --- a/src/drivers/linux_wext.h | ||||
| +++ b/src/drivers/linux_wext.h | ||||
| @@ -26,6 +26,7 @@ typedef int32_t __s32; | ||||
|  typedef uint16_t __u16; | ||||
|  typedef int16_t __s16; | ||||
|  typedef uint8_t __u8; | ||||
| +typedef int8_t __s8; | ||||
|  #ifndef __user | ||||
|  #define __user | ||||
|  #endif /* __user */ | ||||
| @@ -22,7 +22,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | ||||
|  #include "common/defs.h" | ||||
|  #include "common/ieee802_11_defs.h" | ||||
|  #include "common/wpa_common.h" | ||||
| @@ -851,6 +852,9 @@ struct wpa_driver_associate_params { | ||||
| @@ -953,6 +954,9 @@ struct wpa_driver_associate_params { | ||||
|  	 * responsible for selecting with which BSS to associate. */ | ||||
|  	const u8 *bssid; | ||||
|   | ||||
| @@ -42,7 +42,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | ||||
|  #include "config.h" | ||||
|   | ||||
|   | ||||
| @@ -2321,6 +2322,97 @@ static char * wpa_config_write_peerkey(c | ||||
| @@ -2389,6 +2390,97 @@ static char * wpa_config_write_mac_value | ||||
|  #endif /* NO_CONFIG_WRITE */ | ||||
|   | ||||
|   | ||||
| @@ -140,7 +140,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | ||||
|  /* Helper macros for network block parser */ | ||||
|   | ||||
|  #ifdef OFFSET | ||||
| @@ -2606,6 +2698,8 @@ static const struct parse_data ssid_fiel | ||||
| @@ -2674,6 +2766,8 @@ static const struct parse_data ssid_fiel | ||||
|  	{ INT(ap_max_inactivity) }, | ||||
|  	{ INT(dtim_period) }, | ||||
|  	{ INT(beacon_int) }, | ||||
| @@ -162,7 +162,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | ||||
|   | ||||
|   | ||||
|  #define DEFAULT_EAP_WORKAROUND ((unsigned int) -1) | ||||
| @@ -843,6 +845,9 @@ struct wpa_ssid { | ||||
| @@ -879,6 +881,9 @@ struct wpa_ssid { | ||||
|  	 */ | ||||
|  	void *parent_cred; | ||||
|   | ||||
| @@ -174,7 +174,7 @@ Signed-hostap: Antonio Quartulli <ordex@autistici.org> | ||||
|  	 * macsec_policy - Determines the policy for MACsec secure session | ||||
| --- a/wpa_supplicant/wpa_supplicant.c | ||||
| +++ b/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -3673,6 +3673,12 @@ static void wpas_start_assoc_cb(struct w | ||||
| @@ -4177,6 +4177,12 @@ static void wpas_start_assoc_cb(struct w | ||||
|  			params.beacon_int = ssid->beacon_int; | ||||
|  		else | ||||
|  			params.beacon_int = wpa_s->conf->beacon_int; | ||||
|   | ||||
| @@ -1,59 +0,0 @@ | ||||
| From ffc4445958a3ed4064f2e1bf73fa478a61c5cf7b Mon Sep 17 00:00:00 2001 | ||||
| From: Antonio Quartulli <ordex@autistici.org> | ||||
| Date: Sun, 3 Jun 2012 18:42:25 +0200 | ||||
| Subject: [PATCHv2 602/602] driver_nl80211: use new parameters during ibss join | ||||
|  | ||||
| Signed-hostap: Antonio Quartulli <ordex@autistici.org> | ||||
| --- | ||||
|  src/drivers/driver_nl80211.c |   33 ++++++++++++++++++++++++++++++++- | ||||
|  1 file changed, 32 insertions(+), 1 deletion(-) | ||||
|  | ||||
| --- a/src/drivers/driver_nl80211.c | ||||
| +++ b/src/drivers/driver_nl80211.c | ||||
| @@ -5886,7 +5886,7 @@ static int wpa_driver_nl80211_ibss(struc | ||||
|  				   struct wpa_driver_associate_params *params) | ||||
|  { | ||||
|  	struct nl_msg *msg; | ||||
| -	int ret = -1; | ||||
| +	int ret = -1, i; | ||||
|  	int count = 0; | ||||
|   | ||||
|  	wpa_printf(MSG_DEBUG, "nl80211: Join IBSS (ifindex=%d)", drv->ifindex); | ||||
| @@ -5913,6 +5913,37 @@ retry: | ||||
|  	    nl80211_put_beacon_int(msg, params->beacon_int)) | ||||
|  		goto fail; | ||||
|   | ||||
| +	if (params->fixed_freq) { | ||||
| +		wpa_printf(MSG_DEBUG, "  * fixed_freq"); | ||||
| +		nla_put_flag(msg, NL80211_ATTR_FREQ_FIXED); | ||||
| +	} | ||||
| + | ||||
| +	if (params->beacon_int > 0) { | ||||
| +		wpa_printf(MSG_DEBUG, "  * beacon_int=%d", | ||||
| +			   params->beacon_int); | ||||
| +		nla_put_u32(msg, NL80211_ATTR_BEACON_INTERVAL, | ||||
| +			    params->beacon_int); | ||||
| +	} | ||||
| + | ||||
| +	if (params->rates[0] > 0) { | ||||
| +		wpa_printf(MSG_DEBUG, "  * basic_rates:"); | ||||
| +		i = 0; | ||||
| +		while (i < NL80211_MAX_SUPP_RATES && | ||||
| +		       params->rates[i] > 0) { | ||||
| +			wpa_printf(MSG_DEBUG, "    %.1f", | ||||
| +				   (double)params->rates[i] / 2); | ||||
| +			i++; | ||||
| +		} | ||||
| +		nla_put(msg, NL80211_ATTR_BSS_BASIC_RATES, i, | ||||
| +			params->rates); | ||||
| +	} | ||||
| + | ||||
| +	if (params->mcast_rate > 0) { | ||||
| +		wpa_printf(MSG_DEBUG, "  * mcast_rate=%.1f", | ||||
| +			   (double)params->mcast_rate / 10); | ||||
| +		nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); | ||||
| +	} | ||||
| + | ||||
|  	ret = nl80211_set_conn_keys(params, msg); | ||||
|  	if (ret) | ||||
|  		goto fail; | ||||
| @@ -1,68 +0,0 @@ | ||||
| From: Sven Eckelmann <sven.eckelmann@openmesh.com> | ||||
| Date: Thu, 11 May 2017 08:21:45 +0200 | ||||
| Subject: [PATCH] set mcast_rate in mesh mode | ||||
|  | ||||
| The wpa_supplicant code for IBSS allows to set the mcast rate. It is | ||||
| recommended to increase this value from 1 or 6 Mbit/s to something higher | ||||
| when using a mesh protocol on top which uses the multicast packet loss as | ||||
| indicator for the link quality. | ||||
|  | ||||
| This setting was unfortunately not applied for mesh mode. But it would be | ||||
| beneficial when wpa_supplicant would behave similar to IBSS mode and set | ||||
| this argument during mesh join like authsae already does. At least it is | ||||
| helpful for companies/projects which are currently switching to 802.11s | ||||
| (without mesh_fwding and with mesh_ttl set to 1) as replacement for IBSS | ||||
| because newer drivers seem to support 802.11s but not IBSS anymore. | ||||
|  | ||||
| Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com> | ||||
| Tested-by: Simon Wunderlich <simon.wunderlich@openmesh.com> | ||||
|  | ||||
| --- a/src/drivers/driver.h | ||||
| +++ b/src/drivers/driver.h | ||||
| @@ -1618,6 +1618,7 @@ struct wpa_driver_mesh_join_params { | ||||
|  #define WPA_DRIVER_MESH_FLAG_AMPE	0x00000008 | ||||
|  	unsigned int flags; | ||||
|  	bool handle_dfs; | ||||
| +	int mcast_rate; | ||||
|  }; | ||||
|   | ||||
|  struct wpa_driver_set_key_params { | ||||
| --- a/src/drivers/driver_nl80211.c | ||||
| +++ b/src/drivers/driver_nl80211.c | ||||
| @@ -10398,6 +10398,18 @@ static int nl80211_put_mesh_id(struct nl | ||||
|  } | ||||
|   | ||||
|   | ||||
| +static int nl80211_put_mcast_rate(struct nl_msg *msg, int mcast_rate) | ||||
| +{ | ||||
| +	if (mcast_rate > 0) { | ||||
| +		wpa_printf(MSG_DEBUG, "  * mcast_rate=%.1f", | ||||
| +			   (double)mcast_rate / 10); | ||||
| +		return nla_put_u32(msg, NL80211_ATTR_MCAST_RATE, mcast_rate); | ||||
| +	} | ||||
| + | ||||
| +	return 0; | ||||
| +} | ||||
| + | ||||
| + | ||||
|  static int nl80211_put_mesh_config(struct nl_msg *msg, | ||||
|  				   struct wpa_driver_mesh_bss_params *params) | ||||
|  { | ||||
| @@ -10459,6 +10471,7 @@ static int nl80211_join_mesh(struct i802 | ||||
|  	    nl80211_put_basic_rates(msg, params->basic_rates) || | ||||
|  	    nl80211_put_mesh_id(msg, params->meshid, params->meshid_len) || | ||||
|  	    nl80211_put_beacon_int(msg, params->beacon_int) || | ||||
| +	    nl80211_put_mcast_rate(msg, params->mcast_rate) || | ||||
|  	    nl80211_put_dtim_period(msg, params->dtim_period)) | ||||
|  		goto fail; | ||||
|   | ||||
| --- a/wpa_supplicant/mesh.c | ||||
| +++ b/wpa_supplicant/mesh.c | ||||
| @@ -600,6 +600,7 @@ int wpa_supplicant_join_mesh(struct wpa_ | ||||
|   | ||||
|  	params->meshid = ssid->ssid; | ||||
|  	params->meshid_len = ssid->ssid_len; | ||||
| +	params->mcast_rate = ssid->mcast_rate; | ||||
|  	ibss_mesh_setup_freq(wpa_s, ssid, ¶ms->freq); | ||||
|  	wpa_s->mesh_ht_enabled = !!params->freq.ht_enabled; | ||||
|  	wpa_s->mesh_vht_enabled = !!params->freq.vht_enabled; | ||||
| @@ -1,19 +1,14 @@ | ||||
| --- a/wpa_supplicant/wpa_supplicant.c | ||||
| +++ b/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -2403,11 +2403,13 @@ void ibss_mesh_setup_freq(struct wpa_sup | ||||
|  	for (j = 0; j < wpa_s->last_scan_res_used; j++) { | ||||
|  		struct wpa_bss *bss = wpa_s->last_scan_res[j]; | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/wpa_supplicant.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -2744,6 +2744,9 @@ void ibss_mesh_setup_freq(struct wpa_sup | ||||
|          bool is_24ghz, is_6ghz; | ||||
|   | ||||
| -		if (ssid->mode != WPAS_MODE_IBSS) | ||||
| +		/* Don't adjust control freq in case of fixed_freq */ | ||||
|          freq->freq = ssid->frequency; | ||||
| +	if (ssid->fixed_freq) { | ||||
| +		obss_scan = 0; | ||||
|  			break; | ||||
| +	} | ||||
|   | ||||
| -		/* Don't adjust control freq in case of fixed_freq */ | ||||
| -		if (ssid->fixed_freq) | ||||
| +		if (ssid->mode != WPAS_MODE_IBSS) | ||||
|  			break; | ||||
|   | ||||
|  		if (!bss_is_ibss(bss)) | ||||
|          for (j = 0; j < wpa_s->last_scan_res_used; j++) { | ||||
|                  struct wpa_bss *bss = wpa_s->last_scan_res[j]; | ||||
|   | ||||
| @@ -1,44 +1,29 @@ | ||||
| Index: hostapd-2021-12-13-b26f5c0f/src/ap/acs.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/src/ap/acs.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/src/ap/acs.c | ||||
| @@ -302,16 +302,12 @@ static void acs_fail(struct hostapd_ifac | ||||
|  static long double | ||||
|  acs_survey_interference_factor(struct freq_survey *survey, s8 min_nf) | ||||
|  { | ||||
| -	long double factor, busy, total; | ||||
| +	long double factor, busy = 0, total; | ||||
|   | ||||
|  	if (survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) | ||||
|  		busy = survey->channel_time_busy; | ||||
|  	else if (survey->filled & SURVEY_HAS_CHAN_TIME_RX) | ||||
|  		busy = survey->channel_time_rx; | ||||
| -	else { | ||||
| -		wpa_printf(MSG_ERROR, "ACS: Survey data missing"); | ||||
| -		return 0; | ||||
| -	} | ||||
|   | ||||
|  	total = survey->channel_time; | ||||
|   | ||||
| @@ -420,20 +416,19 @@ static int acs_usable_bw160_chan(const s | ||||
| --- a/src/ap/acs.c | ||||
| +++ b/src/ap/acs.c | ||||
| @@ -455,17 +455,17 @@ static int acs_get_bw_center_chan(int fr | ||||
|  static int acs_survey_is_sufficient(struct freq_survey *survey) | ||||
|  { | ||||
|  	if (!(survey->filled & SURVEY_HAS_NF)) { | ||||
| +		survey->nf = -95; | ||||
|  		wpa_printf(MSG_INFO, "ACS: Survey is missing noise floor"); | ||||
|  		wpa_printf(MSG_INFO, | ||||
|  			   "ACS: Survey for freq %d is missing noise floor", | ||||
|  			   survey->freq); | ||||
| -		return 0; | ||||
|  	} | ||||
|   | ||||
|  	if (!(survey->filled & SURVEY_HAS_CHAN_TIME)) { | ||||
| +		survey->channel_time = 0; | ||||
|  		wpa_printf(MSG_INFO, "ACS: Survey is missing channel time"); | ||||
|  		wpa_printf(MSG_INFO, | ||||
|  			   "ACS: Survey for freq %d is missing channel time", | ||||
|  			   survey->freq); | ||||
| -		return 0; | ||||
|  	} | ||||
|   | ||||
|  	if (!(survey->filled & SURVEY_HAS_CHAN_TIME_BUSY) && | ||||
|  	    !(survey->filled & SURVEY_HAS_CHAN_TIME_RX)) { | ||||
| @@ -473,7 +473,6 @@ static int acs_survey_is_sufficient(stru | ||||
|  		wpa_printf(MSG_INFO, | ||||
|  			   "ACS: Survey is missing RX and busy time (at least one is required)"); | ||||
|  			   "ACS: Survey for freq %d is missing RX and busy time (at least one is required)", | ||||
|  			   survey->freq); | ||||
| -		return 0; | ||||
|  	} | ||||
|   | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/hostapd/Makefile | ||||
| +++ b/hostapd/Makefile | ||||
| @@ -1293,7 +1293,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) | ||||
| @@ -1396,7 +1396,7 @@ hostapd_multi.a: $(BCHECK) $(OBJS) | ||||
|  	@$(AR) cr $@ hostapd_multi.o $(OBJS) | ||||
|   | ||||
|  hostapd: $(OBJS) | ||||
| @@ -9,7 +9,7 @@ | ||||
|  	@$(E) "  LD " $@ | ||||
|   | ||||
|  ifdef CONFIG_WPA_TRACE | ||||
| @@ -1304,7 +1304,7 @@ _OBJS_VAR := OBJS_c | ||||
| @@ -1407,7 +1407,7 @@ _OBJS_VAR := OBJS_c | ||||
|  include ../src/objs.mk | ||||
|   | ||||
|  hostapd_cli: $(OBJS_c) | ||||
| @@ -20,7 +20,7 @@ | ||||
|  NOBJS = nt_password_hash.o ../src/crypto/ms_funcs.o $(SHA1OBJS) | ||||
| --- a/wpa_supplicant/Makefile | ||||
| +++ b/wpa_supplicant/Makefile | ||||
| @@ -1905,31 +1905,31 @@ wpa_supplicant_multi.a: .config $(BCHECK | ||||
| @@ -2037,31 +2037,31 @@ wpa_supplicant_multi.a: .config $(BCHECK | ||||
|  	@$(AR) cr $@ wpa_supplicant_multi.o $(OBJS) | ||||
|   | ||||
|  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/src/ap/hostapd.h | ||||
| +++ b/src/ap/hostapd.h | ||||
| @@ -148,6 +148,21 @@ struct hostapd_sae_commit_queue { | ||||
| @@ -163,6 +163,21 @@ struct hostapd_sae_commit_queue { | ||||
|  }; | ||||
|   | ||||
|  /** | ||||
| @@ -22,9 +22,9 @@ | ||||
|   * struct hostapd_data - hostapd per-BSS data structure | ||||
|   */ | ||||
|  struct hostapd_data { | ||||
| @@ -161,6 +176,9 @@ struct hostapd_data { | ||||
| @@ -182,6 +197,9 @@ struct hostapd_data { | ||||
|   | ||||
|  	u8 own_addr[ETH_ALEN]; | ||||
|  	struct hostapd_data *mld_first_bss; | ||||
|   | ||||
| +	/* OpenWrt specific statistics */ | ||||
| +	struct hostapd_openwrt_stats openwrt_stats; | ||||
| @@ -42,9 +42,9 @@ | ||||
|  	wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request to " | ||||
|  		   MACSTR " dialog_token=%u req_mode=0x%x disassoc_timer=%u " | ||||
|  		   "validity_interval=%u", | ||||
| @@ -646,10 +647,12 @@ int ieee802_11_rx_wnm_action_ap(struct h | ||||
|   | ||||
|  	switch (action) { | ||||
| @@ -790,10 +791,12 @@ int ieee802_11_rx_wnm_action_ap(struct h | ||||
|  					       plen); | ||||
|  		return 0; | ||||
|  	case WNM_BSS_TRANS_MGMT_QUERY: | ||||
| +		hapd->openwrt_stats.wnm.bss_transition_query_rx++; | ||||
|  		ieee802_11_rx_bss_trans_mgmt_query(hapd, mgmt->sa, payload, | ||||
| @@ -55,7 +55,7 @@ | ||||
|  		ieee802_11_rx_bss_trans_mgmt_resp(hapd, mgmt->sa, payload, | ||||
|  						  plen); | ||||
|  		return 0; | ||||
| @@ -696,6 +699,7 @@ int wnm_send_disassoc_imminent(struct ho | ||||
| @@ -840,6 +843,7 @@ int wnm_send_disassoc_imminent(struct ho | ||||
|   | ||||
|  	pos = mgmt->u.action.u.bss_tm_req.variable; | ||||
|   | ||||
| @@ -63,7 +63,7 @@ | ||||
|  	wpa_printf(MSG_DEBUG, "WNM: Send BSS Transition Management Request frame to indicate imminent disassociation (disassoc_timer=%d) to " | ||||
|  		   MACSTR, disassoc_timer, MAC2STR(sta->addr)); | ||||
|  	if (hostapd_drv_send_mlme(hapd, buf, pos - buf, 0, NULL, 0, 0) < 0) { | ||||
| @@ -777,6 +781,7 @@ int wnm_send_ess_disassoc_imminent(struc | ||||
| @@ -921,6 +925,7 @@ int wnm_send_ess_disassoc_imminent(struc | ||||
|  		return -1; | ||||
|  	} | ||||
|   | ||||
| @@ -71,7 +71,7 @@ | ||||
|  	if (disassoc_timer) { | ||||
|  		/* send disassociation frame after time-out */ | ||||
|  		set_disassoc_timer(hapd, sta, disassoc_timer); | ||||
| @@ -856,6 +861,7 @@ int wnm_send_bss_tm_req(struct hostapd_d | ||||
| @@ -1001,6 +1006,7 @@ int wnm_send_bss_tm_req(struct hostapd_d | ||||
|  	} | ||||
|  	os_free(buf); | ||||
|   | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| Index: hostapd-2021-02-20-59e9794c/hostapd/Makefile | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/hostapd/Makefile | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/hostapd/Makefile | ||||
| +++ hostapd-2021-02-20-59e9794c/hostapd/Makefile | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/Makefile | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/hostapd/Makefile | ||||
| @@ -166,6 +166,12 @@ OBJS += ../src/common/hw_features_common | ||||
|   | ||||
|  OBJS += ../src/eapol_auth/eapol_auth_sm.o | ||||
| @@ -15,11 +15,11 @@ Index: hostapd-2021-02-20-59e9794c/hostapd/Makefile | ||||
|   | ||||
|  ifdef CONFIG_CODE_COVERAGE | ||||
|  CFLAGS += -O0 -fprofile-arcs -ftest-coverage | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.h | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.h | ||||
| @@ -17,6 +17,7 @@ | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/hostapd.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.h | ||||
| @@ -18,6 +18,7 @@ | ||||
|  #include "utils/list.h" | ||||
|  #include "ap_config.h" | ||||
|  #include "drivers/driver.h" | ||||
| @@ -27,15 +27,15 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h | ||||
|   | ||||
|  #define OCE_STA_CFON_ENABLED(hapd) \ | ||||
|  	((hapd->conf->oce & OCE_STA_CFON) && \ | ||||
| @@ -169,6 +170,7 @@ struct hostapd_data { | ||||
|  	struct hostapd_iface *iface; | ||||
| @@ -203,6 +204,7 @@ struct hostapd_data { | ||||
|  #endif | ||||
|  	struct hostapd_config *iconf; | ||||
|  	struct hostapd_bss_config *conf; | ||||
| +	struct hostapd_ubus_bss ubus; | ||||
|  	int interface_added; /* virtual interface added for this BSS */ | ||||
|  	unsigned int started:1; | ||||
|  	unsigned int disabled:1; | ||||
| @@ -626,6 +628,7 @@ hostapd_alloc_bss_data(struct hostapd_if | ||||
| @@ -741,6 +743,7 @@ hostapd_alloc_bss_data(struct hostapd_if | ||||
|  		       struct hostapd_bss_config *bss); | ||||
|  int hostapd_setup_interface(struct hostapd_iface *iface); | ||||
|  int hostapd_setup_interface_complete(struct hostapd_iface *iface, int err); | ||||
| @@ -43,11 +43,11 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.h | ||||
|  void hostapd_interface_deinit(struct hostapd_iface *iface); | ||||
|  void hostapd_interface_free(struct hostapd_iface *iface); | ||||
|  struct hostapd_iface * hostapd_alloc_iface(void); | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/hostapd.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/hostapd.c | ||||
| @@ -376,6 +376,7 @@ void hostapd_free_hapd_data(struct hosta | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/hostapd.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.c | ||||
| @@ -471,6 +471,7 @@ void hostapd_free_hapd_data(struct hosta | ||||
|  	hapd->beacon_set_done = 0; | ||||
|   | ||||
|  	wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); | ||||
| @@ -55,7 +55,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c | ||||
|  	accounting_deinit(hapd); | ||||
|  	hostapd_deinit_wpa(hapd); | ||||
|  	vlan_deinit(hapd); | ||||
| @@ -1398,6 +1399,8 @@ static int hostapd_setup_bss(struct host | ||||
| @@ -1224,6 +1225,8 @@ static int hostapd_start_beacon(struct h | ||||
|  	if (hapd->driver && hapd->driver->set_operstate) | ||||
|  		hapd->driver->set_operstate(hapd->drv_priv, 1); | ||||
|   | ||||
| @@ -64,15 +64,15 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| @@ -1983,6 +1986,7 @@ static int hostapd_setup_interface_compl | ||||
| @@ -2331,6 +2334,7 @@ static int hostapd_setup_interface_compl | ||||
|  	if (err) | ||||
|  		goto fail; | ||||
|   | ||||
| +	hostapd_ubus_add_iface(iface); | ||||
|  	wpa_printf(MSG_DEBUG, "Completing interface initialization"); | ||||
|   | ||||
|  	if (iface->freq) { | ||||
|  #ifdef NEED_AP_MLME | ||||
| @@ -2180,6 +2184,7 @@ dfs_offload: | ||||
| @@ -2567,6 +2571,7 @@ dfs_offload: | ||||
|   | ||||
|  fail: | ||||
|  	wpa_printf(MSG_ERROR, "Interface initialization failed"); | ||||
| @@ -80,7 +80,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c | ||||
|  	hostapd_set_state(iface, HAPD_IFACE_DISABLED); | ||||
|  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_EVENT_DISABLED); | ||||
|  #ifdef CONFIG_FST | ||||
| @@ -2653,6 +2658,7 @@ void hostapd_interface_deinit_free(struc | ||||
| @@ -3464,6 +3469,7 @@ void hostapd_interface_deinit_free(struc | ||||
|  		   (unsigned int) iface->conf->num_bss); | ||||
|  	driver = iface->bss[0]->driver; | ||||
|  	drv_priv = iface->bss[0]->drv_priv; | ||||
| @@ -88,11 +88,21 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/hostapd.c | ||||
|  	hostapd_interface_deinit(iface); | ||||
|  	wpa_printf(MSG_DEBUG, "%s: driver=%p drv_priv=%p -> hapd_deinit", | ||||
|  		   __func__, driver, drv_priv); | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ieee802_11.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/ieee802_11.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
| @@ -3421,13 +3421,18 @@ static void handle_auth(struct hostapd_d | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ieee802_11.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/ieee802_11.c | ||||
| @@ -87,8 +87,7 @@ static size_t hostapd_eid_basic_resp_mle | ||||
|   | ||||
|  static void handle_auth(struct hostapd_data *hapd, | ||||
|  			struct ieee80211_mgmt *mgmt, size_t len, | ||||
| -			int rssi, int from_queue, | ||||
| -			struct hostapd_frame_info *fi); | ||||
| +			int rssi, int from_queue); | ||||
|   | ||||
|   | ||||
|  u8 * hostapd_eid_multi_ap(struct hostapd_data *hapd, u8 *eid) | ||||
| @@ -2785,7 +2784,7 @@ static void handle_auth(struct hostapd_d | ||||
|  	u16 auth_alg, auth_transaction, status_code; | ||||
|  	u16 resp = WLAN_STATUS_SUCCESS; | ||||
|  	struct sta_info *sta = NULL; | ||||
| @@ -101,9 +111,10 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
|  	u16 fc; | ||||
|  	const u8 *challenge = NULL; | ||||
|  	u8 resp_ies[2 + WLAN_AUTH_CHALLENGE_LEN]; | ||||
|  	size_t resp_ies_len = 0; | ||||
|  	u16 seq_ctrl; | ||||
|  	struct radius_sta rad_info; | ||||
| @@ -2800,6 +2799,11 @@ static void handle_auth(struct hostapd_d | ||||
|  	const u8 *token = NULL; | ||||
|  	size_t token_len = 0; | ||||
|  	int parsed_len = 0; | ||||
| +	struct hostapd_ubus_request req = { | ||||
| +		.type = HOSTAPD_UBUS_AUTH_REQ, | ||||
| +		.mgmt_frame = mgmt, | ||||
| @@ -112,7 +123,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
|   | ||||
|  	if (len < IEEE80211_HDRLEN + sizeof(mgmt->u.auth)) { | ||||
|  		wpa_printf(MSG_INFO, "handle_auth - too short payload (len=%lu)", | ||||
| @@ -3595,6 +3600,13 @@ static void handle_auth(struct hostapd_d | ||||
| @@ -3019,6 +3023,13 @@ skip_ml_parsing: | ||||
|  		resp = WLAN_STATUS_UNSPECIFIED_FAILURE; | ||||
|  		goto fail; | ||||
|  	} | ||||
| @@ -126,7 +137,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
|  	if (res == HOSTAPD_ACL_PENDING) | ||||
|  		return; | ||||
|   | ||||
| @@ -5322,7 +5334,7 @@ static void handle_assoc(struct hostapd_ | ||||
| @@ -5519,7 +5530,7 @@ static void handle_assoc(struct hostapd_ | ||||
|  	int resp = WLAN_STATUS_SUCCESS; | ||||
|  	u16 reply_res = WLAN_STATUS_UNSPECIFIED_FAILURE; | ||||
|  	const u8 *pos; | ||||
| @@ -135,7 +146,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
|  	struct sta_info *sta; | ||||
|  	u8 *tmp = NULL; | ||||
|  #ifdef CONFIG_FILS | ||||
| @@ -5535,6 +5547,11 @@ static void handle_assoc(struct hostapd_ | ||||
| @@ -5733,6 +5744,11 @@ static void handle_assoc(struct hostapd_ | ||||
|  		left = res; | ||||
|  	} | ||||
|  #endif /* CONFIG_FILS */ | ||||
| @@ -147,7 +158,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
|   | ||||
|  	/* followed by SSID and Supported rates; and HT capabilities if 802.11n | ||||
|  	 * is used */ | ||||
| @@ -5633,6 +5650,13 @@ static void handle_assoc(struct hostapd_ | ||||
| @@ -5840,6 +5856,13 @@ static void handle_assoc(struct hostapd_ | ||||
|  	} | ||||
|  #endif /* CONFIG_FILS */ | ||||
|   | ||||
| @@ -161,31 +172,30 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/ieee802_11.c | ||||
|   fail: | ||||
|   | ||||
|  	/* | ||||
| @@ -5726,6 +5750,7 @@ static void handle_disassoc(struct hosta | ||||
|  	wpa_printf(MSG_DEBUG, "disassocation: STA=" MACSTR " reason_code=%d", | ||||
|  		   MAC2STR(mgmt->sa), | ||||
|  		   le_to_host16(mgmt->u.disassoc.reason_code)); | ||||
| @@ -6019,6 +6042,7 @@ static void handle_deauth(struct hostapd | ||||
|   | ||||
|  	/* Clear the PTKSA cache entries for PASN */ | ||||
|  	ptksa_cache_flush(hapd->ptksa, mgmt->sa, WPA_CIPHER_NONE); | ||||
| +	hostapd_ubus_notify(hapd, "deauth", mgmt->sa); | ||||
|   | ||||
|  	sta = ap_get_sta(hapd, mgmt->sa); | ||||
|  	if (sta == NULL) { | ||||
| @@ -6141,6 +6165,7 @@ static int handle_action(struct hostapd_ | ||||
|  		sta->last_seq_ctrl = seq_ctrl; | ||||
|  		sta->last_subtype = WLAN_FC_STYPE_ACTION; | ||||
|  	} | ||||
| +	hostapd_ubus_notify(hapd, "disassoc", mgmt->sa); | ||||
|   | ||||
|  	sta = ap_get_sta(hapd, mgmt->sa); | ||||
|  	if (sta == NULL) { | ||||
| @@ -5792,6 +5817,8 @@ static void handle_deauth(struct hostapd | ||||
|  		" reason_code=%d", | ||||
|  		MAC2STR(mgmt->sa), le_to_host16(mgmt->u.deauth.reason_code)); | ||||
|   | ||||
| +	hostapd_ubus_notify(hapd, "deauth", mgmt->sa); | ||||
| + | ||||
|  	sta = ap_get_sta(hapd, mgmt->sa); | ||||
|  	if (sta == NULL) { | ||||
|  		wpa_msg(hapd->msg_ctx, MSG_DEBUG, "Station " MACSTR " trying " | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c | ||||
|  	switch (mgmt->u.action.category) { | ||||
|  #ifdef CONFIG_IEEE80211R_AP | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/beacon.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/beacon.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/beacon.c | ||||
| @@ -823,6 +823,12 @@ void handle_probe_req(struct hostapd_dat | ||||
|  	u16 csa_offs[2]; | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/beacon.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/beacon.c | ||||
| @@ -1424,6 +1424,12 @@ void handle_probe_req(struct hostapd_dat | ||||
|  	size_t csa_offs_len; | ||||
|  	struct radius_sta rad_info; | ||||
|  	struct multi_link_data ml_data; | ||||
| +	struct hostapd_ubus_request req = { | ||||
| +		.type = HOSTAPD_UBUS_PROBE_REQ, | ||||
| +		.mgmt_frame = mgmt, | ||||
| @@ -193,9 +203,9 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c | ||||
| +		.elems = &elems, | ||||
| +	}; | ||||
|   | ||||
|  	if (hapd->iconf->rssi_ignore_probe_request && ssi_signal && | ||||
|  	    ssi_signal < hapd->iconf->rssi_ignore_probe_request) | ||||
| @@ -1009,6 +1015,12 @@ void handle_probe_req(struct hostapd_dat | ||||
|  	os_memset(&ml_data, 0, sizeof(struct multi_link_data)); | ||||
|   | ||||
| @@ -1612,6 +1618,12 @@ void handle_probe_req(struct hostapd_dat | ||||
|  	} | ||||
|  #endif /* CONFIG_P2P */ | ||||
|   | ||||
| @@ -208,11 +218,11 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/beacon.c | ||||
|  	/* TODO: verify that supp_rates contains at least one matching rate | ||||
|  	 * with AP configuration */ | ||||
|   | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/drv_callbacks.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/drv_callbacks.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/drv_callbacks.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/drv_callbacks.c | ||||
| @@ -145,6 +145,10 @@ int hostapd_notif_assoc(struct hostapd_d | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/drv_callbacks.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/drv_callbacks.c | ||||
| @@ -147,6 +147,10 @@ int hostapd_notif_assoc(struct hostapd_d | ||||
|  	u16 reason = WLAN_REASON_UNSPECIFIED; | ||||
|  	int status = WLAN_STATUS_SUCCESS; | ||||
|  	const u8 *p2p_dev_addr = NULL; | ||||
| @@ -223,7 +233,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/drv_callbacks.c | ||||
|   | ||||
|  	if (addr == NULL) { | ||||
|  		/* | ||||
| @@ -237,6 +241,12 @@ int hostapd_notif_assoc(struct hostapd_d | ||||
| @@ -239,6 +243,12 @@ int hostapd_notif_assoc(struct hostapd_d | ||||
|  		goto fail; | ||||
|  	} | ||||
|   | ||||
| @@ -236,23 +246,11 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/drv_callbacks.c | ||||
|  #ifdef CONFIG_P2P | ||||
|  	if (elems.p2p) { | ||||
|  		wpabuf_free(sta->p2p_ie); | ||||
| @@ -981,9 +991,11 @@ void hostapd_event_ch_switch(struct host | ||||
|   | ||||
|  		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED | ||||
|  			"freq=%d dfs=%d", freq, is_dfs); | ||||
| +		hostapd_ubus_notify_csa(hapd, freq); | ||||
|  	} else if (hapd->iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) { | ||||
|  		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED | ||||
|  			"freq=%d dfs=%d", freq, is_dfs); | ||||
| +		hostapd_ubus_notify_csa(hapd, freq); | ||||
|  	} else if (is_dfs && | ||||
|  		   hostapd_is_dfs_required(hapd->iface) && | ||||
|  		   !hostapd_is_dfs_chan_available(hapd->iface) && | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/sta_info.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/sta_info.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/sta_info.c | ||||
| @@ -458,6 +458,7 @@ void ap_handle_timer(void *eloop_ctx, vo | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/sta_info.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/sta_info.c | ||||
| @@ -597,6 +597,7 @@ void ap_handle_timer(void *eloop_ctx, vo | ||||
|  		hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, | ||||
|  			       HOSTAPD_LEVEL_INFO, "deauthenticated due to " | ||||
|  			       "local deauth request"); | ||||
| @@ -260,7 +258,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c | ||||
|  		ap_free_sta(hapd, sta); | ||||
|  		return; | ||||
|  	} | ||||
| @@ -613,6 +614,7 @@ skip_poll: | ||||
| @@ -752,6 +753,7 @@ skip_poll: | ||||
|  		mlme_deauthenticate_indication( | ||||
|  			hapd, sta, | ||||
|  			WLAN_REASON_PREV_AUTH_NOT_VALID); | ||||
| @@ -268,7 +266,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c | ||||
|  		ap_free_sta(hapd, sta); | ||||
|  		break; | ||||
|  	} | ||||
| @@ -1298,12 +1300,25 @@ void ap_sta_set_authorized(struct hostap | ||||
| @@ -1592,15 +1594,28 @@ void ap_sta_set_authorized(struct hostap | ||||
|  					sta->addr, authorized, dev_addr); | ||||
|   | ||||
|  	if (authorized) { | ||||
| @@ -283,18 +281,21 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c | ||||
| +			[WLAN_AUTH_PASN] = "pasn", | ||||
| +		}; | ||||
| +		const char *auth_alg = NULL; | ||||
|  		const u8 *dpp_pkhash; | ||||
|  		const char *keyid; | ||||
|  		char dpp_pkhash_buf[100]; | ||||
|  		char keyid_buf[100]; | ||||
|  		char ip_addr[100]; | ||||
| +		char alg_buf[100]; | ||||
|   | ||||
|  		dpp_pkhash_buf[0] = '\0'; | ||||
|  		keyid_buf[0] = '\0'; | ||||
|  		ip_addr[0] = '\0'; | ||||
| +		alg_buf[0] = '\0'; | ||||
|  #ifdef CONFIG_P2P | ||||
|  		if (wpa_auth_get_ip_addr(sta->wpa_sm, ip_addr_buf) == 0) { | ||||
|  			os_snprintf(ip_addr, sizeof(ip_addr), | ||||
| @@ -1313,22 +1328,31 @@ void ap_sta_set_authorized(struct hostap | ||||
| @@ -1610,6 +1625,13 @@ void ap_sta_set_authorized(struct hostap | ||||
|  		} | ||||
|  #endif /* CONFIG_P2P */ | ||||
|   | ||||
| @@ -308,33 +309,35 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.c | ||||
|  		keyid = ap_sta_wpa_get_keyid(hapd, sta); | ||||
|  		if (keyid) { | ||||
|  			os_snprintf(keyid_buf, sizeof(keyid_buf), | ||||
|  				    " keyid=%s", keyid); | ||||
| @@ -1628,17 +1650,19 @@ void ap_sta_set_authorized(struct hostap | ||||
|  					 dpp_pkhash, SHA256_MAC_LEN); | ||||
|  		} | ||||
|   | ||||
| -		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s", | ||||
| -			buf, ip_addr, keyid_buf); | ||||
| +		hostapd_ubus_notify_authorized(hapd, sta); | ||||
| +		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s", | ||||
| +			buf, ip_addr, keyid_buf, alg_buf); | ||||
| -		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s", | ||||
| -			buf, ip_addr, keyid_buf, dpp_pkhash_buf); | ||||
| +		hostapd_ubus_notify_authorized(hapd, sta, auth_alg); | ||||
| +		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_CONNECTED "%s%s%s%s%s", | ||||
| +			buf, ip_addr, keyid_buf, dpp_pkhash_buf, alg_buf); | ||||
|   | ||||
|  		if (hapd->msg_ctx_parent && | ||||
|  		    hapd->msg_ctx_parent != hapd->msg_ctx) | ||||
|  			wpa_msg_no_global(hapd->msg_ctx_parent, MSG_INFO, | ||||
| -					  AP_STA_CONNECTED "%s%s%s", | ||||
| -					  buf, ip_addr, keyid_buf); | ||||
| +					  AP_STA_CONNECTED "%s%s%s%s", | ||||
| +					  buf, ip_addr, keyid_buf, alg_buf); | ||||
| -					  AP_STA_CONNECTED "%s%s%s%s", | ||||
| +					  AP_STA_CONNECTED "%s%s%s%s%s", | ||||
|  					  buf, ip_addr, keyid_buf, | ||||
| -					  dpp_pkhash_buf); | ||||
| +					  dpp_pkhash_buf, alg_buf); | ||||
|  	} else { | ||||
|  		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_DISCONNECTED "%s", buf); | ||||
| +		hostapd_ubus_notify(hapd, "disassoc", sta->addr); | ||||
|   | ||||
|  		if (hapd->msg_ctx_parent && | ||||
|  		    hapd->msg_ctx_parent != hapd->msg_ctx) | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/wpa_auth_glue.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/wpa_auth_glue.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/wpa_auth_glue.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/wpa_auth_glue.c | ||||
| @@ -265,6 +265,7 @@ static void hostapd_wpa_auth_psk_failure | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/wpa_auth_glue.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/wpa_auth_glue.c | ||||
| @@ -270,6 +270,7 @@ static void hostapd_wpa_auth_psk_failure | ||||
|  	struct hostapd_data *hapd = ctx; | ||||
|  	wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POSSIBLE_PSK_MISMATCH MACSTR, | ||||
|  		MAC2STR(addr)); | ||||
| @@ -342,11 +345,11 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/wpa_auth_glue.c | ||||
|  } | ||||
|   | ||||
|   | ||||
| Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/Makefile | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/Makefile | ||||
| +++ hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile | ||||
| @@ -169,6 +169,13 @@ ifdef CONFIG_EAPOL_TEST | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/Makefile | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/Makefile | ||||
| @@ -192,6 +192,13 @@ ifdef CONFIG_EAPOL_TEST | ||||
|  CFLAGS += -Werror -DEAPOL_TEST | ||||
|  endif | ||||
|   | ||||
| @@ -360,7 +363,7 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile | ||||
|  ifdef CONFIG_CODE_COVERAGE | ||||
|  CFLAGS += -O0 -fprofile-arcs -ftest-coverage | ||||
|  LIBS += -lgcov | ||||
| @@ -946,6 +953,9 @@ ifdef CONFIG_CTRL_IFACE_MIB | ||||
| @@ -991,6 +998,9 @@ ifdef CONFIG_CTRL_IFACE_MIB | ||||
|  CFLAGS += -DCONFIG_CTRL_IFACE_MIB | ||||
|  endif | ||||
|  OBJS += ../src/ap/ctrl_iface_ap.o | ||||
| @@ -370,11 +373,11 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/Makefile | ||||
|  endif | ||||
|   | ||||
|  CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY | ||||
| Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant.c | ||||
| +++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -6943,6 +6943,8 @@ struct wpa_supplicant * wpa_supplicant_a | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/wpa_supplicant.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -7640,6 +7640,8 @@ struct wpa_supplicant * wpa_supplicant_a | ||||
|  	} | ||||
|  #endif /* CONFIG_P2P */ | ||||
|   | ||||
| @@ -383,7 +386,7 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c | ||||
|  	return wpa_s; | ||||
|  } | ||||
|   | ||||
| @@ -6969,6 +6971,8 @@ int wpa_supplicant_remove_iface(struct w | ||||
| @@ -7666,6 +7668,8 @@ int wpa_supplicant_remove_iface(struct w | ||||
|  	struct wpa_supplicant *parent = wpa_s->parent; | ||||
|  #endif /* CONFIG_MESH */ | ||||
|   | ||||
| @@ -392,7 +395,7 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c | ||||
|  	/* Remove interface from the global list of interfaces */ | ||||
|  	prev = global->ifaces; | ||||
|  	if (prev == wpa_s) { | ||||
| @@ -7272,8 +7276,12 @@ int wpa_supplicant_run(struct wpa_global | ||||
| @@ -8012,8 +8016,12 @@ int wpa_supplicant_run(struct wpa_global | ||||
|  	eloop_register_signal_terminate(wpa_supplicant_terminate, global); | ||||
|  	eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); | ||||
|   | ||||
| @@ -405,19 +408,19 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant.c | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant_i.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wpa_supplicant_i.h | ||||
| +++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h | ||||
| @@ -19,6 +19,7 @@ | ||||
|  #include "wps/wps_defs.h" | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/wpa_supplicant_i.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant_i.h | ||||
| @@ -21,6 +21,7 @@ | ||||
|  #include "config_ssid.h" | ||||
|  #include "wmm_ac.h" | ||||
|  #include "pasn/pasn_common.h" | ||||
| +#include "ubus.h" | ||||
|   | ||||
|  extern const char *const wpa_supplicant_version; | ||||
|  extern const char *const wpa_supplicant_license; | ||||
| @@ -316,6 +317,8 @@ struct wpa_global { | ||||
| @@ -319,6 +320,8 @@ struct wpa_global { | ||||
|  #endif /* CONFIG_WIFI_DISPLAY */ | ||||
|   | ||||
|  	struct psk_list_entry *add_psk; /* From group formation */ | ||||
| @@ -426,7 +429,7 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h | ||||
|  }; | ||||
|   | ||||
|   | ||||
| @@ -596,6 +599,7 @@ struct wpa_supplicant { | ||||
| @@ -650,6 +653,7 @@ struct wpa_supplicant { | ||||
|  	unsigned char own_addr[ETH_ALEN]; | ||||
|  	unsigned char perm_addr[ETH_ALEN]; | ||||
|  	char ifname[100]; | ||||
| @@ -434,10 +437,10 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wpa_supplicant_i.h | ||||
|  #ifdef CONFIG_MATCH_IFACE | ||||
|  	int matched; | ||||
|  #endif /* CONFIG_MATCH_IFACE */ | ||||
| Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wps_supplicant.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wps_supplicant.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/wps_supplicant.c | ||||
| +++ hostapd-2021-02-20-59e9794c/wpa_supplicant/wps_supplicant.c | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/wps_supplicant.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wps_supplicant.c | ||||
| @@ -33,6 +33,7 @@ | ||||
|  #include "p2p/p2p.h" | ||||
|  #include "p2p_supplicant.h" | ||||
| @@ -446,7 +449,7 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wps_supplicant.c | ||||
|   | ||||
|   | ||||
|  #ifndef WPS_PIN_SCAN_IGNORE_SEL_REG | ||||
| @@ -392,6 +393,8 @@ static int wpa_supplicant_wps_cred(void | ||||
| @@ -402,6 +403,8 @@ static int wpa_supplicant_wps_cred(void | ||||
|  	wpa_hexdump_key(MSG_DEBUG, "WPS: Received Credential attribute", | ||||
|  			cred->cred_attr, cred->cred_attr_len); | ||||
|   | ||||
| @@ -455,11 +458,11 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/wps_supplicant.c | ||||
|  	if (wpa_s->conf->wps_cred_processing == 1) | ||||
|  		return 0; | ||||
|   | ||||
| Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/main.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/wpa_supplicant/main.c | ||||
| +++ hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c | ||||
| @@ -202,7 +202,7 @@ int main(int argc, char *argv[]) | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/main.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/main.c | ||||
| @@ -203,7 +203,7 @@ int main(int argc, char *argv[]) | ||||
|   | ||||
|  	for (;;) { | ||||
|  		c = getopt(argc, argv, | ||||
| @@ -468,7 +471,7 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c | ||||
|  		if (c < 0) | ||||
|  			break; | ||||
|  		switch (c) { | ||||
| @@ -267,6 +267,9 @@ int main(int argc, char *argv[]) | ||||
| @@ -268,6 +268,9 @@ int main(int argc, char *argv[]) | ||||
|  			params.conf_p2p_dev = optarg; | ||||
|  			break; | ||||
|  #endif /* CONFIG_P2P */ | ||||
| @@ -478,10 +481,10 @@ Index: hostapd-2021-02-20-59e9794c/wpa_supplicant/main.c | ||||
|  		case 'o': | ||||
|  			params.override_driver = optarg; | ||||
|  			break; | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/rrm.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/rrm.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/rrm.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/rrm.c | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/rrm.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/rrm.c | ||||
| @@ -89,6 +89,9 @@ static void hostapd_handle_beacon_report | ||||
|  		return; | ||||
|  	wpa_msg(hapd->msg_ctx, MSG_INFO, BEACON_RESP_RX MACSTR " %u %02x %s", | ||||
| @@ -492,10 +495,18 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/rrm.c | ||||
|  } | ||||
|   | ||||
|   | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/vlan_init.c | ||||
| @@ -360,6 +363,7 @@ void hostapd_handle_radio_measurement(st | ||||
|  		break; | ||||
|  	case WLAN_RRM_LINK_MEASUREMENT_REPORT: | ||||
|  		hostapd_handle_link_mesr_report(hapd, buf, len); | ||||
| +		hostapd_ubus_handle_link_measurement(hapd, buf, len); | ||||
|  		break; | ||||
|  	default: | ||||
|  		wpa_printf(MSG_DEBUG, "RRM action %u is not supported", | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/vlan_init.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/vlan_init.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/vlan_init.c | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/vlan_init.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/vlan_init.c | ||||
| @@ -22,6 +22,7 @@ | ||||
|  static int vlan_if_add(struct hostapd_data *hapd, struct hostapd_vlan *vlan, | ||||
|  		       int existsok) | ||||
| @@ -532,11 +543,11 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/vlan_init.c | ||||
|  	return hostapd_vlan_if_remove(hapd, vlan->ifname); | ||||
|  } | ||||
|   | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/dfs.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/dfs.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/dfs.c | ||||
| @@ -1226,6 +1226,8 @@ int hostapd_dfs_nop_finished(struct host | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/dfs.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/dfs.c | ||||
| @@ -1331,6 +1331,8 @@ int hostapd_dfs_pre_cac_expired(struct h | ||||
|  		"freq=%d ht_enabled=%d chan_offset=%d chan_width=%d cf1=%d cf2=%d", | ||||
|  		freq, ht_enabled, chan_offset, chan_width, cf1, cf2); | ||||
|   | ||||
| @@ -545,11 +556,11 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/dfs.c | ||||
|  	/* Proceed only if DFS is not offloaded to the driver */ | ||||
|  	if (iface->drv_flags & WPA_DRIVER_FLAGS_DFS_OFFLOAD) | ||||
|  		return 0; | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/airtime_policy.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/airtime_policy.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/airtime_policy.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/airtime_policy.c | ||||
| @@ -108,8 +108,14 @@ static void set_sta_weights(struct hosta | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/airtime_policy.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/airtime_policy.c | ||||
| @@ -112,8 +112,14 @@ static void set_sta_weights(struct hosta | ||||
|  { | ||||
|  	struct sta_info *sta; | ||||
|   | ||||
| @@ -566,7 +577,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/airtime_policy.c | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -240,7 +246,10 @@ int airtime_policy_new_sta(struct hostap | ||||
| @@ -244,7 +250,10 @@ int airtime_policy_new_sta(struct hostap | ||||
|  	unsigned int weight; | ||||
|   | ||||
|  	if (hapd->iconf->airtime_mode == AIRTIME_MODE_STATIC) { | ||||
| @@ -578,11 +589,11 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/airtime_policy.c | ||||
|  		if (weight) | ||||
|  			return sta_set_airtime_weight(hapd, sta, weight); | ||||
|  	} | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/sta_info.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/sta_info.h | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/sta_info.h | ||||
| @@ -323,6 +323,7 @@ struct sta_info { | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/sta_info.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/sta_info.h | ||||
| @@ -322,6 +322,7 @@ struct sta_info { | ||||
|  #endif /* CONFIG_TESTING_OPTIONS */ | ||||
|  #ifdef CONFIG_AIRTIME_POLICY | ||||
|  	unsigned int airtime_weight; | ||||
| @@ -590,13 +601,13 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/sta_info.h | ||||
|  	struct os_reltime backlogged_until; | ||||
|  #endif /* CONFIG_AIRTIME_POLICY */ | ||||
|   | ||||
| Index: hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/wnm_ap.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/ap/wnm_ap.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c | ||||
| @@ -442,7 +442,8 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
|  	wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries", | ||||
|  		    pos, end - pos); | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/wnm_ap.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/wnm_ap.c | ||||
| @@ -495,7 +495,8 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
|  		MAC2STR(addr), reason, hex ? " neighbor=" : "", hex); | ||||
|  	os_free(hex); | ||||
|   | ||||
| -	ieee802_11_send_bss_trans_mgmt_request(hapd, addr, dialog_token); | ||||
| +	if (!hostapd_ubus_notify_bss_transition_query(hapd, addr, dialog_token, reason, pos, end - pos)) | ||||
| @@ -604,7 +615,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -464,7 +465,7 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
| @@ -517,7 +518,7 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
|  					      size_t len) | ||||
|  { | ||||
|  	u8 dialog_token, status_code, bss_termination_delay; | ||||
| @@ -613,7 +624,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c | ||||
|  	int enabled = hapd->conf->bss_transition; | ||||
|  	struct sta_info *sta; | ||||
|   | ||||
| @@ -511,6 +512,7 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
| @@ -564,6 +565,7 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
|  			wpa_printf(MSG_DEBUG, "WNM: not enough room for Target BSSID field"); | ||||
|  			return; | ||||
|  		} | ||||
| @@ -621,7 +632,7 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c | ||||
|  		sta->agreed_to_steer = 1; | ||||
|  		eloop_cancel_timeout(ap_sta_reset_steer_flag_timer, hapd, sta); | ||||
|  		eloop_register_timeout(2, 0, ap_sta_reset_steer_flag_timer, | ||||
| @@ -530,6 +532,10 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
| @@ -583,6 +585,10 @@ static void ieee802_11_rx_bss_trans_mgmt | ||||
|  			MAC2STR(addr), status_code, bss_termination_delay); | ||||
|  	} | ||||
|   | ||||
| @@ -632,10 +643,10 @@ Index: hostapd-2021-02-20-59e9794c/src/ap/wnm_ap.c | ||||
|  	wpa_hexdump(MSG_DEBUG, "WNM: BSS Transition Candidate List Entries", | ||||
|  		    pos, end - pos); | ||||
|  } | ||||
| Index: hostapd-2021-02-20-59e9794c/src/utils/eloop.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/utils/eloop.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/utils/eloop.c | ||||
| +++ hostapd-2021-02-20-59e9794c/src/utils/eloop.c | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/utils/eloop.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/utils/eloop.c | ||||
| @@ -77,6 +77,9 @@ struct eloop_sock_table { | ||||
|  struct eloop_data { | ||||
|  	int max_sock; | ||||
| @@ -646,7 +657,7 @@ Index: hostapd-2021-02-20-59e9794c/src/utils/eloop.c | ||||
|  	size_t count; /* sum of all table counts */ | ||||
|  #ifdef CONFIG_ELOOP_POLL | ||||
|  	size_t max_pollfd_map; /* number of pollfds_map currently allocated */ | ||||
| @@ -1116,6 +1119,12 @@ void eloop_run(void) | ||||
| @@ -1121,6 +1124,12 @@ void eloop_run(void) | ||||
|  				os_reltime_sub(&timeout->time, &now, &tv); | ||||
|  			else | ||||
|  				tv.sec = tv.usec = 0; | ||||
| @@ -659,7 +670,7 @@ Index: hostapd-2021-02-20-59e9794c/src/utils/eloop.c | ||||
|  #if defined(CONFIG_ELOOP_POLL) || defined(CONFIG_ELOOP_EPOLL) | ||||
|  			timeout_ms = tv.sec * 1000 + tv.usec / 1000; | ||||
|  #endif /* defined(CONFIG_ELOOP_POLL) || defined(CONFIG_ELOOP_EPOLL) */ | ||||
| @@ -1185,7 +1194,8 @@ void eloop_run(void) | ||||
| @@ -1190,7 +1199,8 @@ void eloop_run(void) | ||||
|  		eloop.exceptions.changed = 0; | ||||
|   | ||||
|  		eloop_process_pending_signals(); | ||||
| @@ -669,7 +680,7 @@ Index: hostapd-2021-02-20-59e9794c/src/utils/eloop.c | ||||
|   | ||||
|  		/* check if some registered timeouts have occurred */ | ||||
|  		timeout = dl_list_first(&eloop.timeout, struct eloop_timeout, | ||||
| @@ -1247,6 +1257,14 @@ out: | ||||
| @@ -1252,6 +1262,14 @@ out: | ||||
|  	return; | ||||
|  } | ||||
|   | ||||
| @@ -684,10 +695,10 @@ Index: hostapd-2021-02-20-59e9794c/src/utils/eloop.c | ||||
|   | ||||
|  void eloop_terminate(void) | ||||
|  { | ||||
| Index: hostapd-2021-02-20-59e9794c/src/utils/eloop.h | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/utils/eloop.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-02-20-59e9794c.orig/src/utils/eloop.h | ||||
| +++ hostapd-2021-02-20-59e9794c/src/utils/eloop.h | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/utils/eloop.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/utils/eloop.h | ||||
| @@ -65,6 +65,9 @@ typedef void (*eloop_timeout_handler)(vo | ||||
|   */ | ||||
|  typedef void (*eloop_signal_handler)(int sig, void *signal_ctx); | ||||
| @@ -717,10 +728,10 @@ Index: hostapd-2021-02-20-59e9794c/src/utils/eloop.h | ||||
|  /** | ||||
|   * eloop_run - Start the event loop | ||||
|   * | ||||
| Index: hostapd-2021-02-20-59e9794c/src/utils/uloop.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/utils/uloop.c | ||||
| =================================================================== | ||||
| --- /dev/null | ||||
| +++ hostapd-2021-02-20-59e9794c/src/utils/uloop.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/utils/uloop.c | ||||
| @@ -0,0 +1,64 @@ | ||||
| +#include <libubox/uloop.h> | ||||
| +#include "includes.h" | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| Index: hostapd-2021-12-13-b26f5c0f/hostapd/Makefile | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/hostapd/Makefile | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/hostapd/Makefile | ||||
| +++ hostapd-2021-12-13-b26f5c0f/hostapd/Makefile | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/Makefile | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/hostapd/Makefile | ||||
| @@ -168,9 +168,21 @@ OBJS += ../src/eapol_auth/eapol_auth_sm. | ||||
|   | ||||
|  ifdef CONFIG_UBUS | ||||
| @@ -26,11 +26,11 @@ Index: hostapd-2021-12-13-b26f5c0f/hostapd/Makefile | ||||
|  endif | ||||
|   | ||||
|  ifdef CONFIG_CODE_COVERAGE | ||||
| Index: hostapd-2021-12-13-b26f5c0f/hostapd/main.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/hostapd/main.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/hostapd/main.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/hostapd/main.c | ||||
| @@ -898,6 +898,7 @@ int main(int argc, char *argv[]) | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/main.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/hostapd/main.c | ||||
| @@ -985,6 +985,7 @@ int main(int argc, char *argv[]) | ||||
|  	} | ||||
|   | ||||
|  	hostapd_global_ctrl_iface_init(&interfaces); | ||||
| @@ -38,19 +38,19 @@ Index: hostapd-2021-12-13-b26f5c0f/hostapd/main.c | ||||
|   | ||||
|  	if (hostapd_global_run(&interfaces, daemonize, pid_file)) { | ||||
|  		wpa_printf(MSG_ERROR, "Failed to start eloop"); | ||||
| @@ -907,6 +908,7 @@ int main(int argc, char *argv[]) | ||||
| @@ -994,6 +995,7 @@ int main(int argc, char *argv[]) | ||||
|  	ret = 0; | ||||
|   | ||||
|   out: | ||||
| +	hostapd_ucode_free(); | ||||
|  	hostapd_global_ctrl_iface_deinit(&interfaces); | ||||
|  	/* Deinitialize all interfaces */ | ||||
|  	for (i = 0; i < interfaces.count; i++) { | ||||
| Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.h | ||||
|  	/* Sending deauth to all stations before deinit */ | ||||
|  	hostapd_deauthenticate_stations(&interfaces); | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/src/ap/hostapd.h | ||||
| +++ hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.h | ||||
| @@ -18,6 +18,7 @@ | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/hostapd.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.h | ||||
| @@ -19,6 +19,7 @@ | ||||
|  #include "ap_config.h" | ||||
|  #include "drivers/driver.h" | ||||
|  #include "ubus.h" | ||||
| @@ -58,7 +58,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.h | ||||
|   | ||||
|  #define OCE_STA_CFON_ENABLED(hapd) \ | ||||
|  	((hapd->conf->oce & OCE_STA_CFON) && \ | ||||
| @@ -50,6 +51,10 @@ struct hapd_interfaces { | ||||
| @@ -56,6 +57,10 @@ struct hapd_interfaces { | ||||
|  	struct hostapd_config * (*config_read_cb)(const char *config_fname); | ||||
|  	int (*ctrl_iface_init)(struct hostapd_data *hapd); | ||||
|  	void (*ctrl_iface_deinit)(struct hostapd_data *hapd); | ||||
| @@ -69,7 +69,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.h | ||||
|  	int (*for_each_interface)(struct hapd_interfaces *interfaces, | ||||
|  				  int (*cb)(struct hostapd_iface *iface, | ||||
|  					    void *ctx), void *ctx); | ||||
| @@ -173,6 +178,7 @@ struct hostapd_data { | ||||
| @@ -205,6 +210,7 @@ struct hostapd_data { | ||||
|  	struct hostapd_config *iconf; | ||||
|  	struct hostapd_bss_config *conf; | ||||
|  	struct hostapd_ubus_bss ubus; | ||||
| @@ -77,7 +77,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.h | ||||
|  	int interface_added; /* virtual interface added for this BSS */ | ||||
|  	unsigned int started:1; | ||||
|  	unsigned int disabled:1; | ||||
| @@ -467,6 +473,7 @@ struct hostapd_sta_info { | ||||
| @@ -540,6 +546,7 @@ struct hostapd_mld { | ||||
|   */ | ||||
|  struct hostapd_iface { | ||||
|  	struct hapd_interfaces *interfaces; | ||||
| @@ -85,7 +85,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.h | ||||
|  	void *owner; | ||||
|  	char *config_fname; | ||||
|  	struct hostapd_config *conf; | ||||
| @@ -641,6 +648,8 @@ struct hostapd_iface * hostapd_init(stru | ||||
| @@ -752,6 +759,8 @@ struct hostapd_iface * hostapd_init(stru | ||||
|  struct hostapd_iface * | ||||
|  hostapd_interface_init_bss(struct hapd_interfaces *interfaces, const char *phy, | ||||
|  			   const char *config_fname, int debug); | ||||
| @@ -94,11 +94,11 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.h | ||||
|  void hostapd_new_assoc_sta(struct hostapd_data *hapd, struct sta_info *sta, | ||||
|  			   int reassoc); | ||||
|  void hostapd_interface_deinit_free(struct hostapd_iface *iface); | ||||
| Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/src/ap/hostapd.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.c | ||||
| @@ -217,6 +217,8 @@ int hostapd_reload_config(struct hostapd | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/hostapd.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/hostapd.c | ||||
| @@ -285,6 +285,8 @@ int hostapd_reload_config(struct hostapd | ||||
|  	struct hostapd_config *newconf, *oldconf; | ||||
|  	size_t j; | ||||
|   | ||||
| @@ -107,7 +107,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.c | ||||
|  	if (iface->config_fname == NULL) { | ||||
|  		/* Only in-memory config in use - assume it has been updated */ | ||||
|  		hostapd_clear_old(iface); | ||||
| @@ -377,6 +379,7 @@ void hostapd_free_hapd_data(struct hosta | ||||
| @@ -471,6 +473,7 @@ void hostapd_free_hapd_data(struct hosta | ||||
|  	hapd->beacon_set_done = 0; | ||||
|   | ||||
|  	wpa_printf(MSG_DEBUG, "%s(%s)", __func__, hapd->conf->iface); | ||||
| @@ -115,24 +115,15 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.c | ||||
|  	hostapd_ubus_free_bss(hapd); | ||||
|  	accounting_deinit(hapd); | ||||
|  	hostapd_deinit_wpa(hapd); | ||||
| @@ -534,6 +537,7 @@ void hostapd_cleanup_iface_partial(struc | ||||
| @@ -637,6 +640,7 @@ void hostapd_cleanup_iface_partial(struc | ||||
|  static void hostapd_cleanup_iface(struct hostapd_iface *iface) | ||||
|  { | ||||
|  	wpa_printf(MSG_DEBUG, "%s(%p)", __func__, iface); | ||||
| +	hostapd_ucode_free_iface(iface); | ||||
|  	eloop_cancel_timeout(channel_list_update_timeout, iface, NULL); | ||||
|  	eloop_cancel_timeout(hostapd_interface_setup_failure_handler, iface, | ||||
|  			     NULL); | ||||
| @@ -1108,7 +1112,7 @@ static int db_table_create_radius_attrib | ||||
|   * initialized. Most of the modules that are initialized here will be | ||||
|   * deinitialized in hostapd_cleanup(). | ||||
|   */ | ||||
| -static int hostapd_setup_bss(struct hostapd_data *hapd, int first) | ||||
| +int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool set_beacon) | ||||
|  { | ||||
|  	struct hostapd_bss_config *conf = hapd->conf; | ||||
|  	u8 ssid[SSID_MAX_LEN + 1]; | ||||
| @@ -1405,6 +1409,7 @@ static int hostapd_setup_bss(struct host | ||||
|   | ||||
| @@ -1226,6 +1230,7 @@ static int hostapd_start_beacon(struct h | ||||
|  		hapd->driver->set_operstate(hapd->drv_priv, 1); | ||||
|   | ||||
|  	hostapd_ubus_add_bss(hapd); | ||||
| @@ -140,16 +131,17 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.c | ||||
|   | ||||
|  	return 0; | ||||
|  } | ||||
| @@ -2116,7 +2121,7 @@ static int hostapd_setup_interface_compl | ||||
|  		hapd = iface->bss[j]; | ||||
|  		if (j) | ||||
|  			os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); | ||||
| -		if (hostapd_setup_bss(hapd, j == 0)) { | ||||
| +		if (hostapd_setup_bss(hapd, j == 0, true)) { | ||||
|  			for (;;) { | ||||
|  				hapd = iface->bss[j]; | ||||
|  				hostapd_bss_deinit_no_free(hapd); | ||||
| @@ -2396,7 +2401,7 @@ hostapd_alloc_bss_data(struct hostapd_if | ||||
| @@ -1248,8 +1253,7 @@ static int hostapd_start_beacon(struct h | ||||
|   * initialized. Most of the modules that are initialized here will be | ||||
|   * deinitialized in hostapd_cleanup(). | ||||
|   */ | ||||
| -static int hostapd_setup_bss(struct hostapd_data *hapd, int first, | ||||
| -			     bool start_beacon) | ||||
| +int hostapd_setup_bss(struct hostapd_data *hapd, int first, bool start_beacon) | ||||
|  { | ||||
|  	struct hostapd_bss_config *conf = hapd->conf; | ||||
|  	u8 ssid[SSID_MAX_LEN + 1]; | ||||
| @@ -2919,7 +2923,7 @@ hostapd_alloc_bss_data(struct hostapd_if | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -158,16 +150,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.c | ||||
|  { | ||||
|  	if (!hapd) | ||||
|  		return; | ||||
| @@ -3013,7 +3018,7 @@ int hostapd_add_iface(struct hapd_interf | ||||
|   | ||||
|  			if (start_ctrl_iface_bss(hapd) < 0 || | ||||
|  			    (hapd_iface->state == HAPD_IFACE_ENABLED && | ||||
| -			     hostapd_setup_bss(hapd, -1))) { | ||||
| +			     hostapd_setup_bss(hapd, -1, true))) { | ||||
|  				hostapd_cleanup(hapd); | ||||
|  				hapd_iface->bss[hapd_iface->num_bss - 1] = NULL; | ||||
|  				hapd_iface->conf->num_bss--; | ||||
| @@ -3165,7 +3170,8 @@ int hostapd_remove_iface(struct hapd_int | ||||
| @@ -4086,7 +4090,8 @@ int hostapd_remove_iface(struct hapd_int | ||||
|  		hapd_iface = interfaces->iface[i]; | ||||
|  		if (hapd_iface == NULL) | ||||
|  			return -1; | ||||
| @@ -177,11 +160,11 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/hostapd.c | ||||
|  			wpa_printf(MSG_INFO, "Remove interface '%s'", buf); | ||||
|  			hapd_iface->driver_ap_teardown = | ||||
|  				!!(hapd_iface->drv_flags & | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/Makefile | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/Makefile | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/Makefile | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/Makefile | ||||
| @@ -177,8 +177,20 @@ endif | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/Makefile | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/Makefile | ||||
| @@ -195,8 +195,20 @@ endif | ||||
|  ifdef CONFIG_UBUS | ||||
|  CFLAGS += -DUBUS_SUPPORT | ||||
|  OBJS += ubus.o | ||||
| @@ -203,7 +186,7 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/Makefile | ||||
|  endif | ||||
|   | ||||
|  ifdef CONFIG_CODE_COVERAGE | ||||
| @@ -969,6 +981,9 @@ OBJS += ../src/ap/ctrl_iface_ap.o | ||||
| @@ -1001,6 +1013,9 @@ OBJS += ../src/ap/ctrl_iface_ap.o | ||||
|  ifdef CONFIG_UBUS | ||||
|  OBJS += ../src/ap/ubus.o | ||||
|  endif | ||||
| @@ -213,11 +196,11 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/Makefile | ||||
|  endif | ||||
|   | ||||
|  CFLAGS += -DEAP_SERVER -DEAP_SERVER_IDENTITY | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/wpa_supplicant.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -1033,6 +1033,7 @@ void wpa_supplicant_set_state(struct wpa | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/wpa_supplicant.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant.c | ||||
| @@ -1044,6 +1044,7 @@ void wpa_supplicant_set_state(struct wpa | ||||
|  		sme_sched_obss_scan(wpa_s, 0); | ||||
|  	} | ||||
|  	wpa_s->wpa_state = state; | ||||
| @@ -225,7 +208,7 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
|   | ||||
|  #ifdef CONFIG_BGSCAN | ||||
|  	if (state == WPA_COMPLETED && wpa_s->current_ssid != wpa_s->bgscan_ssid) | ||||
| @@ -7155,6 +7156,7 @@ struct wpa_supplicant * wpa_supplicant_a | ||||
| @@ -7641,6 +7642,7 @@ struct wpa_supplicant * wpa_supplicant_a | ||||
|  #endif /* CONFIG_P2P */ | ||||
|   | ||||
|  	wpas_ubus_add_bss(wpa_s); | ||||
| @@ -233,7 +216,7 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
|   | ||||
|  	return wpa_s; | ||||
|  } | ||||
| @@ -7182,6 +7184,7 @@ int wpa_supplicant_remove_iface(struct w | ||||
| @@ -7668,6 +7670,7 @@ int wpa_supplicant_remove_iface(struct w | ||||
|  	struct wpa_supplicant *parent = wpa_s->parent; | ||||
|  #endif /* CONFIG_MESH */ | ||||
|   | ||||
| @@ -241,7 +224,7 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
|  	wpas_ubus_free_bss(wpa_s); | ||||
|   | ||||
|  	/* Remove interface from the global list of interfaces */ | ||||
| @@ -7449,6 +7452,7 @@ struct wpa_global * wpa_supplicant_init( | ||||
| @@ -7978,6 +7981,7 @@ struct wpa_global * wpa_supplicant_init( | ||||
|   | ||||
|  	eloop_register_timeout(WPA_SUPPLICANT_CLEANUP_INTERVAL, 0, | ||||
|  			       wpas_periodic, global, NULL); | ||||
| @@ -249,7 +232,7 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
|   | ||||
|  	return global; | ||||
|  } | ||||
| @@ -7487,12 +7491,8 @@ int wpa_supplicant_run(struct wpa_global | ||||
| @@ -8016,12 +8020,8 @@ int wpa_supplicant_run(struct wpa_global | ||||
|  	eloop_register_signal_terminate(wpa_supplicant_terminate, global); | ||||
|  	eloop_register_signal_reconfig(wpa_supplicant_reconfig, global); | ||||
|   | ||||
| @@ -262,7 +245,7 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| @@ -7525,6 +7525,8 @@ void wpa_supplicant_deinit(struct wpa_gl | ||||
| @@ -8054,6 +8054,8 @@ void wpa_supplicant_deinit(struct wpa_gl | ||||
|   | ||||
|  	wpas_notify_supplicant_deinitialized(global); | ||||
|   | ||||
| @@ -271,19 +254,19 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant.c | ||||
|  	eap_peer_unregister_methods(); | ||||
|  #ifdef CONFIG_AP | ||||
|  	eap_server_unregister_methods(); | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant_i.h | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant_i.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/wpa_supplicant_i.h | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant_i.h | ||||
| @@ -20,6 +20,7 @@ | ||||
|  #include "config_ssid.h" | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/wpa_supplicant_i.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/wpa_supplicant_i.h | ||||
| @@ -22,6 +22,7 @@ | ||||
|  #include "wmm_ac.h" | ||||
|  #include "pasn/pasn_common.h" | ||||
|  #include "ubus.h" | ||||
| +#include "ucode.h" | ||||
|   | ||||
|  extern const char *const wpa_supplicant_version; | ||||
|  extern const char *const wpa_supplicant_license; | ||||
| @@ -707,6 +708,7 @@ struct wpa_supplicant { | ||||
| @@ -654,6 +655,7 @@ struct wpa_supplicant { | ||||
|  	unsigned char perm_addr[ETH_ALEN]; | ||||
|  	char ifname[100]; | ||||
|  	struct wpas_ubus_bss ubus; | ||||
| @@ -291,11 +274,11 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/wpa_supplicant_i.h | ||||
|  #ifdef CONFIG_MATCH_IFACE | ||||
|  	int matched; | ||||
|  #endif /* CONFIG_MATCH_IFACE */ | ||||
| Index: hostapd-2021-12-13-b26f5c0f/hostapd/ctrl_iface.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/hostapd/ctrl_iface.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/hostapd/ctrl_iface.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/hostapd/ctrl_iface.c | ||||
| @@ -5023,6 +5023,7 @@ try_again: | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/hostapd/ctrl_iface.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/hostapd/ctrl_iface.c | ||||
| @@ -5369,6 +5369,7 @@ try_again: | ||||
|  		return -1; | ||||
|  	} | ||||
|   | ||||
| @@ -303,7 +286,7 @@ Index: hostapd-2021-12-13-b26f5c0f/hostapd/ctrl_iface.c | ||||
|  	wpa_msg_register_cb(hostapd_ctrl_iface_msg_cb); | ||||
|   | ||||
|  	return 0; | ||||
| @@ -5124,6 +5125,7 @@ fail: | ||||
| @@ -5470,6 +5471,7 @@ fail: | ||||
|  	os_free(fname); | ||||
|   | ||||
|  	interface->global_ctrl_sock = s; | ||||
| @@ -311,11 +294,11 @@ Index: hostapd-2021-12-13-b26f5c0f/hostapd/ctrl_iface.c | ||||
|  	eloop_register_read_sock(s, hostapd_global_ctrl_iface_receive, | ||||
|  				 interface, NULL); | ||||
|   | ||||
| Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver.h | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/drivers/driver.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/src/drivers/driver.h | ||||
| +++ hostapd-2021-12-13-b26f5c0f/src/drivers/driver.h | ||||
| @@ -3366,6 +3366,25 @@ struct wpa_driver_ops { | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/drivers/driver.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/drivers/driver.h | ||||
| @@ -3899,6 +3899,25 @@ struct wpa_driver_ops { | ||||
|  			 const char *ifname); | ||||
|   | ||||
|  	/** | ||||
| @@ -341,7 +324,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver.h | ||||
|  	 * set_sta_vlan - Bind a station into a specific interface (AP only) | ||||
|  	 * @priv: Private driver interface data | ||||
|  	 * @ifname: Interface (main or virtual BSS or VLAN) | ||||
| @@ -5842,6 +5861,7 @@ union wpa_event_data { | ||||
| @@ -6525,6 +6544,7 @@ union wpa_event_data { | ||||
|   | ||||
|  	/** | ||||
|  	 * struct ch_switch | ||||
| @@ -349,56 +332,58 @@ Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver.h | ||||
|  	 * @freq: Frequency of new channel in MHz | ||||
|  	 * @ht_enabled: Whether this is an HT channel | ||||
|  	 * @ch_offset: Secondary channel offset | ||||
| @@ -5850,6 +5870,7 @@ union wpa_event_data { | ||||
|  	 * @cf2: Center frequency 2 | ||||
| @@ -6534,6 +6554,7 @@ union wpa_event_data { | ||||
|  	 * @link_id: Link ID of the MLO link | ||||
|  	 */ | ||||
|  	struct ch_switch { | ||||
| +		int count; | ||||
|  		int freq; | ||||
|  		int ht_enabled; | ||||
|  		int ch_offset; | ||||
| Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211_event.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/drivers/driver_nl80211_event.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/src/drivers/driver_nl80211_event.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211_event.c | ||||
| @@ -684,6 +684,7 @@ static void mlme_event_ch_switch(struct | ||||
|  				 struct nlattr *ifindex, struct nlattr *freq, | ||||
|  				 struct nlattr *type, struct nlattr *bw, | ||||
|  				 struct nlattr *cf1, struct nlattr *cf2, | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/drivers/driver_nl80211_event.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/drivers/driver_nl80211_event.c | ||||
| @@ -1002,6 +1002,7 @@ static void mlme_event_ch_switch(struct | ||||
|  				 struct nlattr *cf2, | ||||
|  				 struct nlattr *ru_punct_bitmap, | ||||
|  				 struct nlattr *ru_punct_ofdma, | ||||
| +				 struct nlattr *count, | ||||
|  				 int finished) | ||||
|  { | ||||
|  	struct i802_bss *bss; | ||||
| @@ -745,6 +746,8 @@ static void mlme_event_ch_switch(struct | ||||
|  		data.ch_switch.cf1 = nla_get_u32(cf1); | ||||
|  	if (cf2) | ||||
|  		data.ch_switch.cf2 = nla_get_u32(cf2); | ||||
| @@ -1092,7 +1093,9 @@ static void mlme_event_ch_switch(struct | ||||
|  		if (ru_punct_ofdma) | ||||
|  			data.ch_switch.ru_punct_ofdma = nla_get_flag(ru_punct_ofdma); | ||||
|  	} | ||||
| - | ||||
| +	if (count) | ||||
| +		data.ch_switch.count = nla_get_u32(count); | ||||
|   | ||||
| +  | ||||
|  	if (finished) | ||||
|  		bss->freq = data.ch_switch.freq; | ||||
| @@ -3003,6 +3006,7 @@ static void do_process_drv_event(struct | ||||
|  				     tb[NL80211_ATTR_CHANNEL_WIDTH], | ||||
|  				     tb[NL80211_ATTR_CENTER_FREQ1], | ||||
|   | ||||
| @@ -3833,6 +3836,7 @@ static void do_process_drv_event(struct | ||||
|  				     tb[NL80211_ATTR_CENTER_FREQ2], | ||||
|  				     tb[NL80211_ATTR_RU_PUNCT_BITMAP], | ||||
|  				     tb[NL80211_ATTR_RU_PUNCT_SUPP_HE], | ||||
| +				     tb[NL80211_ATTR_CH_SWITCH_COUNT], | ||||
|  				     0); | ||||
|  		break; | ||||
|  	case NL80211_CMD_CH_SWITCH_NOTIFY: | ||||
| @@ -3013,6 +3017,7 @@ static void do_process_drv_event(struct | ||||
|  				     tb[NL80211_ATTR_CHANNEL_WIDTH], | ||||
|  				     tb[NL80211_ATTR_CENTER_FREQ1], | ||||
| @@ -3846,6 +3850,7 @@ static void do_process_drv_event(struct | ||||
|  				     tb[NL80211_ATTR_CENTER_FREQ2], | ||||
|  				     tb[NL80211_ATTR_RU_PUNCT_BITMAP], | ||||
|  				     tb[NL80211_ATTR_RU_PUNCT_SUPP_HE], | ||||
| +				     NULL, | ||||
|  				     1); | ||||
|  		break; | ||||
|  	case NL80211_CMD_DISCONNECT: | ||||
| Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/events.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/events.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/wpa_supplicant/events.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/wpa_supplicant/events.c | ||||
| @@ -4927,6 +4927,7 @@ void supplicant_event(void *ctx, enum wp | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/wpa_supplicant/events.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/events.c | ||||
| @@ -5294,6 +5294,7 @@ void supplicant_event(void *ctx, enum wp | ||||
|  		event_to_string(event), event); | ||||
|  #endif /* CONFIG_NO_STDOUT_DEBUG */ | ||||
|   | ||||
| @@ -406,11 +391,11 @@ Index: hostapd-2021-12-13-b26f5c0f/wpa_supplicant/events.c | ||||
|  	switch (event) { | ||||
|  	case EVENT_AUTH: | ||||
|  #ifdef CONFIG_FST | ||||
| Index: hostapd-2021-12-13-b26f5c0f/src/ap/ap_drv_ops.h | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ap_drv_ops.h | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/src/ap/ap_drv_ops.h | ||||
| +++ hostapd-2021-12-13-b26f5c0f/src/ap/ap_drv_ops.h | ||||
| @@ -367,6 +367,23 @@ static inline int hostapd_drv_stop_ap(st | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ap_drv_ops.h | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/ap/ap_drv_ops.h | ||||
| @@ -415,6 +415,23 @@ static inline int hostapd_drv_stop_ap(st | ||||
|  	return hapd->driver->stop_ap(hapd->drv_priv); | ||||
|  } | ||||
|   | ||||
| @@ -434,11 +419,11 @@ Index: hostapd-2021-12-13-b26f5c0f/src/ap/ap_drv_ops.h | ||||
|  static inline int hostapd_drv_channel_info(struct hostapd_data *hapd, | ||||
|  					   struct wpa_channel_info *ci) | ||||
|  { | ||||
| Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211.c | ||||
| Index: hostapd-2023-02-21-ath12.3-cs/src/drivers/driver_nl80211.c | ||||
| =================================================================== | ||||
| --- hostapd-2021-12-13-b26f5c0f.orig/src/drivers/driver_nl80211.c | ||||
| +++ hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211.c | ||||
| @@ -1249,7 +1249,7 @@ static void wpa_driver_nl80211_event_rtm | ||||
| --- hostapd-2023-02-21-ath12.3-cs.orig/src/drivers/driver_nl80211.c | ||||
| +++ hostapd-2023-02-21-ath12.3-cs/src/drivers/driver_nl80211.c | ||||
| @@ -1370,7 +1370,7 @@ static void wpa_driver_nl80211_event_rtm | ||||
|  		} | ||||
|  		wpa_printf(MSG_DEBUG, "nl80211: Interface down (%s/%s)", | ||||
|  			   namebuf, ifname); | ||||
| @@ -447,7 +432,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211.c | ||||
|  			wpa_printf(MSG_DEBUG, | ||||
|  				   "nl80211: Not the main interface (%s) - do not indicate interface down", | ||||
|  				   drv->first_bss->ifname); | ||||
| @@ -1285,7 +1285,7 @@ static void wpa_driver_nl80211_event_rtm | ||||
| @@ -1406,7 +1406,7 @@ static void wpa_driver_nl80211_event_rtm | ||||
|  		} | ||||
|  		wpa_printf(MSG_DEBUG, "nl80211: Interface up (%s/%s)", | ||||
|  			   namebuf, ifname); | ||||
| @@ -456,15 +441,15 @@ Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211.c | ||||
|  			wpa_printf(MSG_DEBUG, | ||||
|  				   "nl80211: Not the main interface (%s) - do not indicate interface up", | ||||
|  				   drv->first_bss->ifname); | ||||
| @@ -7691,6 +7691,7 @@ static void *i802_init(struct hostapd_da | ||||
|  	char master_ifname[IFNAMSIZ]; | ||||
| @@ -8706,6 +8706,7 @@ static void *i802_init(struct hostapd_da | ||||
|  	int ifindex, br_ifindex = 0; | ||||
|  	int br_added = 0; | ||||
|  	const u8 *set_addr; | ||||
| +	int err; | ||||
|   | ||||
|  	bss = wpa_driver_nl80211_drv_init(hapd, params->ifname, | ||||
|  					  params->global_priv, 1, | ||||
| @@ -7751,21 +7752,17 @@ static void *i802_init(struct hostapd_da | ||||
|  	if (params->mld_addr) | ||||
|  		set_addr = params->mld_addr; | ||||
| @@ -8789,21 +8790,17 @@ static void *i802_init(struct hostapd_da | ||||
|  		add_ifidx(drv, br_ifindex, drv->ifindex); | ||||
|   | ||||
|  #ifdef CONFIG_LIBNL3_ROUTE | ||||
| @@ -496,7 +481,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211.c | ||||
|  	} | ||||
|  #endif /* CONFIG_LIBNL3_ROUTE */ | ||||
|   | ||||
| @@ -8125,6 +8122,50 @@ static int wpa_driver_nl80211_if_remove( | ||||
| @@ -9218,6 +9215,50 @@ static int wpa_driver_nl80211_if_remove( | ||||
|  	return 0; | ||||
|  } | ||||
|   | ||||
| @@ -547,7 +532,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211.c | ||||
|   | ||||
|  static int cookie_handler(struct nl_msg *msg, void *arg) | ||||
|  { | ||||
| @@ -9479,6 +9520,37 @@ static int driver_nl80211_if_remove(void | ||||
| @@ -10784,6 +10825,37 @@ static int driver_nl80211_if_remove(void | ||||
|  } | ||||
|   | ||||
|   | ||||
| @@ -585,7 +570,7 @@ Index: hostapd-2021-12-13-b26f5c0f/src/drivers/driver_nl80211.c | ||||
|  static int driver_nl80211_send_mlme(void *priv, const u8 *data, | ||||
|  				    size_t data_len, int noack, | ||||
|  				    unsigned int freq, | ||||
| @@ -12183,6 +12255,8 @@ const struct wpa_driver_ops wpa_driver_n | ||||
| @@ -13925,6 +13997,8 @@ const struct wpa_driver_ops wpa_driver_n | ||||
|  	.set_acl = wpa_driver_nl80211_set_acl, | ||||
|  	.if_add = wpa_driver_nl80211_if_add, | ||||
|  	.if_remove = driver_nl80211_if_remove, | ||||
|   | ||||
| @@ -0,0 +1,33 @@ | ||||
| --- a/src/common/wpa_ctrl.c | ||||
| +++ b/src/common/wpa_ctrl.c | ||||
| @@ -135,7 +135,7 @@ try_again: | ||||
|  		return NULL; | ||||
|  	} | ||||
|  	tries++; | ||||
| -#ifdef ANDROID | ||||
| + | ||||
|  	/* Set client socket file permissions so that bind() creates the client | ||||
|  	 * socket with these permissions and there is no need to try to change | ||||
|  	 * them with chmod() after bind() which would have potential issues with | ||||
| @@ -147,7 +147,7 @@ try_again: | ||||
|  	 * operations to allow the response to go through. Those are using the | ||||
|  	 * no-deference-symlinks version to avoid races. */ | ||||
|  	fchmod(ctrl->s, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP); | ||||
| -#endif /* ANDROID */ | ||||
| + | ||||
|  	if (bind(ctrl->s, (struct sockaddr *) &ctrl->local, | ||||
|  		    sizeof(ctrl->local)) < 0) { | ||||
|  		if (errno == EADDRINUSE && tries < 2) { | ||||
| @@ -165,7 +165,11 @@ try_again: | ||||
|  		return NULL; | ||||
|  	} | ||||
|   | ||||
| -#ifdef ANDROID | ||||
| +#ifndef ANDROID | ||||
| +	/* Set group even if we do not have privileges to change owner */ | ||||
| +	lchown(ctrl->local.sun_path, -1, 101); | ||||
| +	lchown(ctrl->local.sun_path, 101, 101); | ||||
| +#else | ||||
|  	/* Set group even if we do not have privileges to change owner */ | ||||
|  	lchown(ctrl->local.sun_path, -1, AID_WIFI); | ||||
|  	lchown(ctrl->local.sun_path, AID_SYSTEM, AID_WIFI); | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/hostapd/config_file.c | ||||
| +++ b/hostapd/config_file.c | ||||
| @@ -4699,7 +4699,12 @@ struct hostapd_config * hostapd_config_r | ||||
| @@ -4816,7 +4816,12 @@ struct hostapd_config * hostapd_config_r | ||||
|  	int errors = 0; | ||||
|  	size_t i; | ||||
|   | ||||
| @@ -16,7 +16,7 @@ | ||||
|  			   "for reading.", fname); | ||||
| --- a/wpa_supplicant/config_file.c | ||||
| +++ b/wpa_supplicant/config_file.c | ||||
| @@ -318,8 +318,13 @@ struct wpa_config * wpa_config_read(cons | ||||
| @@ -326,8 +326,13 @@ struct wpa_config * wpa_config_read(cons | ||||
|  	while (cred_tail && cred_tail->next) | ||||
|  		cred_tail = cred_tail->next; | ||||
|   | ||||
|   | ||||
| @@ -1,6 +1,6 @@ | ||||
| --- a/src/ap/ap_config.h | ||||
| +++ b/src/ap/ap_config.h | ||||
| @@ -115,6 +115,7 @@ struct hostapd_ssid { | ||||
| @@ -121,6 +121,7 @@ struct hostapd_ssid { | ||||
|  #define DYNAMIC_VLAN_OPTIONAL 1 | ||||
|  #define DYNAMIC_VLAN_REQUIRED 2 | ||||
|  	int dynamic_vlan; | ||||
| @@ -30,7 +30,7 @@ | ||||
|   | ||||
| --- a/hostapd/config_file.c | ||||
| +++ b/hostapd/config_file.c | ||||
| @@ -3342,6 +3342,8 @@ static int hostapd_config_fill(struct ho | ||||
| @@ -3351,6 +3351,8 @@ static int hostapd_config_fill(struct ho | ||||
|  #ifndef CONFIG_NO_VLAN | ||||
|  	} else if (os_strcmp(buf, "dynamic_vlan") == 0) { | ||||
|  		bss->ssid.dynamic_vlan = atoi(pos); | ||||
|   | ||||
| @@ -1,6 +1,8 @@ | ||||
| --- a/hostapd/config_file.c | ||||
| +++ b/hostapd/config_file.c | ||||
| @@ -2341,6 +2341,8 @@ static int hostapd_config_fill(struct ho | ||||
| Index: hostapd-2023-02-21-a9012070/hostapd/config_file.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-a9012070.orig/hostapd/config_file.c | ||||
| +++ hostapd-2023-02-21-a9012070/hostapd/config_file.c | ||||
| @@ -2316,6 +2316,8 @@ static int hostapd_config_fill(struct ho | ||||
|  			   sizeof(conf->bss[0]->iface)); | ||||
|  	} else if (os_strcmp(buf, "bridge") == 0) { | ||||
|  		os_strlcpy(bss->bridge, pos, sizeof(bss->bridge)); | ||||
| @@ -9,9 +11,11 @@ | ||||
|  	} else if (os_strcmp(buf, "vlan_bridge") == 0) { | ||||
|  		os_strlcpy(bss->vlan_bridge, pos, sizeof(bss->vlan_bridge)); | ||||
|  	} else if (os_strcmp(buf, "wds_bridge") == 0) { | ||||
| --- a/src/ap/ap_drv_ops.c | ||||
| +++ b/src/ap/ap_drv_ops.c | ||||
| @@ -340,8 +340,6 @@ int hostapd_set_wds_sta(struct hostapd_d | ||||
| Index: hostapd-2023-02-21-a9012070/src/ap/ap_drv_ops.c | ||||
| =================================================================== | ||||
| --- hostapd-2023-02-21-a9012070.orig/src/ap/ap_drv_ops.c | ||||
| +++ hostapd-2023-02-21-a9012070/src/ap/ap_drv_ops.c | ||||
| @@ -348,8 +348,6 @@ int hostapd_set_wds_sta(struct hostapd_d | ||||
|  		return -1; | ||||
|  	if (hapd->conf->wds_bridge[0]) | ||||
|  		bridge = hapd->conf->wds_bridge; | ||||
|   | ||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user