mirror of
				https://github.com/Telecominfraproject/wlan-ap.git
				synced 2025-10-31 18:38:10 +00:00 
			
		
		
		
	Compare commits
	
		
			65 Commits
		
	
	
		
			v3.0.0-rc3
			...
			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 | ||
|   | 14aa04ad10 | ||
|   | 589cdf6795 | ||
|   | d5ffdffd8c | ||
|   | a14df28bd6 | ||
|   | 25bec55d4a | ||
|   | 575686449a | ||
|   | a849ad6e39 | ||
|   | de834a7d07 | ||
|   | d8fd2b8f39 | ||
|   | e1745cae9b | ||
|   | bfa3b829ee | ||
|   | 91dacf0e93 | ||
|   | c0dcc4aea2 | ||
|   | c97ac2da72 | ||
|   | f21fa9ab80 | ||
|   | 9305bc609b | ||
|   | 6d81e1e587 | ||
|   | 0c55b1f97a | 
							
								
								
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.github/workflows/build-dev.yml
									
									
									
									
										vendored
									
									
								
							| @@ -21,7 +21,7 @@ jobs: | |||||||
|     strategy: |     strategy: | ||||||
|       fail-fast: false |       fail-fast: false | ||||||
|       matrix: |       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: |     steps: | ||||||
|     - uses: actions/checkout@v3 |     - 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)" | 		part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | cut -d " " -f 1)" | ||||||
| 		case "$part" in | 		case "$part" in | ||||||
| 		rootfs1) | 		rootfs1) | ||||||
| 			fw_setenv active 2 || exit 1 |  | ||||||
| 			CI_UBIPART="rootfs2" | 			CI_UBIPART="rootfs2" | ||||||
|  | 			CI_FWSETENV="active 2" | ||||||
| 			;; | 			;; | ||||||
| 		rootfs2) | 		rootfs2) | ||||||
| 			fw_setenv active 1 || exit 1 |  | ||||||
| 			CI_UBIPART="rootfs1" | 			CI_UBIPART="rootfs1" | ||||||
|  | 			CI_FWSETENV="active 1" | ||||||
| 			;; | 			;; | ||||||
| 		*) | 		*) | ||||||
| 			# legacy bootloader | 			# legacy bootloader | ||||||
|   | |||||||
| @@ -133,7 +133,7 @@ qcom_setup_interfaces() | |||||||
| 		ucidef_set_interface_lan "" | 		ucidef_set_interface_lan "" | ||||||
| 		;; | 		;; | ||||||
| 	cybertan,eww631-b1) | 	cybertan,eww631-b1) | ||||||
| 		ucidef_add_switch "switch1" "5:wan" "2:lan" "3:lan" "4:lan" "6@eth0" | 		ucidef_add_switch "switch1" "5:wan" "4:lan" "3:lan" "2:lan" "6@eth0" | ||||||
| 		;; | 		;; | ||||||
| 	wallys,dr5018) | 	wallys,dr5018) | ||||||
|                 ucidef_set_interface_lan "eth0 eth1" |                 ucidef_set_interface_lan "eth0 eth1" | ||||||
|   | |||||||
| @@ -16,7 +16,8 @@ boot() { | |||||||
| 		;;		 | 		;;		 | ||||||
| 	edgecore,eap101|\ | 	edgecore,eap101|\ | ||||||
| 	edgecore,eap102|\ | 	edgecore,eap102|\ | ||||||
| 	edgecore,oap102) | 	edgecore,oap102|\ | ||||||
|  | 	edgecore.eap104) | ||||||
| 		avail=$(fw_printenv -n upgrade_available) | 		avail=$(fw_printenv -n upgrade_available) | ||||||
| 		[ "${avail}" -eq 1 ] || fw_setenv upgrade_available 1 | 		[ "${avail}" -eq 1 ] || fw_setenv upgrade_available 1 | ||||||
| 		fw_setenv bootcount 0 | 		fw_setenv bootcount 0 | ||||||
|   | |||||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | |||||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | 	local conf_tar="/tmp/sysupgrade.tgz" | ||||||
| 	sync | 	sync | ||||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||||
|  | 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" |  | ||||||
| 	echo "sysupgrade successful" | 	echo "sysupgrade successful" | ||||||
| 	umount -a | 	umount -a | ||||||
| 	reboot -f | 	reboot -f | ||||||
|   | |||||||
| @@ -194,8 +194,6 @@ platform_do_upgrade() { | |||||||
| 	cig,wf194c4|\ | 	cig,wf194c4|\ | ||||||
| 	cig,wf196|\ | 	cig,wf196|\ | ||||||
| 	cybertan,eww622-a1|\ | 	cybertan,eww622-a1|\ | ||||||
| 	cybertan,eww631-a1|\ |  | ||||||
| 	cybertan,eww631-b1|\ |  | ||||||
| 	glinet,ax1800|\ | 	glinet,ax1800|\ | ||||||
| 	glinet,axt1800|\ | 	glinet,axt1800|\ | ||||||
| 	indio,um-310ax-v1|\ | 	indio,um-310ax-v1|\ | ||||||
| @@ -262,8 +260,8 @@ platform_do_upgrade() { | |||||||
| 		else | 		else | ||||||
| 			if [ -e /tmp/downgrade ]; then | 			if [ -e /tmp/downgrade ]; then | ||||||
| 				CI_UBIPART="rootfs1" | 				CI_UBIPART="rootfs1" | ||||||
| 				fw_setenv active 1 || exit 1 | 				{ echo 'active 1'; echo 'upgrade_available 0'; } > /tmp/fw_setenv.txt || exit 1 | ||||||
| 				fw_setenv upgrade_available 0 || exit 1 | 				CI_FWSETENV="-s /tmp/fw_setenv.txt" | ||||||
| 			elif grep -q rootfs1 /proc/cmdline; then | 			elif grep -q rootfs1 /proc/cmdline; then | ||||||
| 				CI_UBIPART="rootfs2" | 				CI_UBIPART="rootfs2" | ||||||
| 				CI_FWSETENV="active 2" | 				CI_FWSETENV="active 2" | ||||||
| @@ -289,5 +287,18 @@ platform_do_upgrade() { | |||||||
| 		} | 		} | ||||||
| 		nand_upgrade_tar "$1" | 		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 | 	esac | ||||||
| } | } | ||||||
|   | |||||||
| @@ -29,9 +29,9 @@ ALLWIFIBOARDS:= \ | |||||||
| 	cig-wf660a \ | 	cig-wf660a \ | ||||||
| 	cig-wf194c \ | 	cig-wf194c \ | ||||||
| 	cig-wf194c4 \ | 	cig-wf194c4 \ | ||||||
| 	cig-wf196-ca \ |  | ||||||
| 	cig-wf196-us \ |  | ||||||
| 	cybertan-eww622-a1 \ | 	cybertan-eww622-a1 \ | ||||||
|  | 	cybertan-eww631-a1 \ | ||||||
|  | 	cybertan-eww631-b1 \ | ||||||
| 	edgecore-eap101 \ | 	edgecore-eap101 \ | ||||||
| 	gl-ax1800 \ | 	gl-ax1800 \ | ||||||
| 	gl-axt1800 \ | 	gl-axt1800 \ | ||||||
| @@ -89,14 +89,9 @@ $(call Package/ath11k-wifi-default) | |||||||
|     TITLE:=board-2.bin for QCOM IPQ6122 eval kits |     TITLE:=board-2.bin for QCOM IPQ6122 eval kits | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-cig-wf196_6g-ca | define Package/ath11k-wifi-cig-wf196 | ||||||
| $(call Package/ath11k-wifi-default) | $(call Package/ath11k-wifi-default) | ||||||
|     TITLE:=cig-wf196 6G bdf CA |     TITLE:=cig-wf196 bdf | ||||||
| endef |  | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-cig-wf196_6g-us |  | ||||||
| $(call Package/ath11k-wifi-default) |  | ||||||
|     TITLE:=cig-wf196 6G bdf US |  | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-gl-ax1800 | define Package/ath11k-wifi-gl-ax1800 | ||||||
| @@ -134,6 +129,11 @@ $(call Package/ath11k-wifi-default) | |||||||
|     TITLE:=hfcl-ion4xi bdf |     TITLE:=hfcl-ion4xi bdf | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define Package/ath11k-wifi-hfcl-ion4xe | ||||||
|  | $(call Package/ath11k-wifi-default) | ||||||
|  |     TITLE:=hfcl-ion4xe bdf | ||||||
|  | endef | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-hfcl-ion4xi_w | define Package/ath11k-wifi-hfcl-ion4xi_w | ||||||
| $(call Package/ath11k-wifi-default) | $(call Package/ath11k-wifi-default) | ||||||
|     TITLE:=hfcl-ion4xi_w bdf |     TITLE:=hfcl-ion4xi_w bdf | ||||||
| @@ -170,14 +170,9 @@ $(call Package/ath11k-wifi-default) | |||||||
|     TITLE:=edgecore-oap101e bdf |     TITLE:=edgecore-oap101e bdf | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-cig-wf188n-ca | define Package/ath11k-wifi-cig-wf188n | ||||||
| $(call Package/ath11k-wifi-default) | $(call Package/ath11k-wifi-default) | ||||||
|     TITLE:=cig-wf188n bdf CA |     TITLE:=cig-wf188n bdf | ||||||
| endef |  | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-cig-wf188n-us |  | ||||||
| $(call Package/ath11k-wifi-default) |  | ||||||
|     TITLE:=cig-wf188n bdf US |  | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define ath11k-wifi-install-one-to | define ath11k-wifi-install-one-to | ||||||
| @@ -257,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 | 	$(INSTALL_DATA) ./board-2.bin.QCN9000 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board-2.bin | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-cig-wf196_6g-ca/install | define Package/ath11k-wifi-cig-wf196/install | ||||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/QCN9074/hw1.0/ | 	$(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 | 	$(INSTALL_DATA) ./board-cig-wf196_6g-ca.bin.QCN9074 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board.bin.CA | ||||||
| 	echo -n 'CA' > $(1)/lib/firmware/country | 	$(INSTALL_DATA) ./board-cig-wf196_6g-us.bin.QCN9074 $(1)/lib/firmware/ath11k/QCN9074/hw1.0/board.bin.US | ||||||
| endef | 	$(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 | ||||||
| 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 |  | ||||||
| endef | endef | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-optimcloud-d50/install | define Package/ath11k-wifi-optimcloud-d50/install | ||||||
| @@ -315,6 +306,11 @@ define Package/ath11k-wifi-hfcl-ion4xi/install | |||||||
| 	$(INSTALL_DATA) ./board-hfcl-ion4xi.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board-2.bin | 	$(INSTALL_DATA) ./board-hfcl-ion4xi.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board-2.bin | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  | define Package/ath11k-wifi-hfcl-ion4xe/install | ||||||
|  | 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/ | ||||||
|  | 	$(INSTALL_DATA) ./board-hfcl-ion4xe.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board-2.bin | ||||||
|  | endef | ||||||
|  |  | ||||||
| define Package/ath11k-wifi-hfcl-ion4xi_wp/install | define Package/ath11k-wifi-hfcl-ion4xi_wp/install | ||||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/ | 	$(INSTALL_DIR) $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/ | ||||||
| 	$(INSTALL_DATA) ./board-hfcl-ion4xi_wp.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin | 	$(INSTALL_DATA) ./board-hfcl-ion4xi_wp.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin | ||||||
| @@ -355,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 | 	$(INSTALL_DATA) ./board-2-edgecore-oap101e.bin.QCN6122 $(1)/lib/firmware/ath11k/qcn6122/hw1.0/board-2.bin | ||||||
| endef | 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_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 | 	$(INSTALL_DATA) ./board-cig-wf188n-ca.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin.CA | ||||||
| 	echo -n 'CA MY DE' > $(1)/lib/firmware/country | 	$(INSTALL_DATA) ./board-cig-wf188n-us.bin.IPQ6018 $(1)/lib/firmware/ath11k/IPQ6018/hw1.0/board.bin.US | ||||||
| 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 |  | ||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf186w,Cigtech WF186w)) | $(eval $(call generate-ath11k-wifi-package,cig-wf186w,Cigtech WF186w)) | ||||||
| @@ -372,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-wf660a,Cigtech WF660a)) | ||||||
| $(eval $(call generate-ath11k-wifi-package,cig-wf194c,Cigtech WF194c)) | $(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-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-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,sercomm-wallaby,Sercomm Kiwi)) | ||||||
| $(eval $(call generate-ath11k-wifi-package,wallys-dr6018,Wallys DR6018)) | $(eval $(call generate-ath11k-wifi-package,wallys-dr6018,Wallys DR6018)) | ||||||
| $(eval $(call generate-ath11k-wifi-package,wallys-dr6018-v4,Wallys DR6018 V4)) | $(eval $(call generate-ath11k-wifi-package,wallys-dr6018-v4,Wallys DR6018 V4)) | ||||||
| @@ -400,17 +390,16 @@ $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq6122)) | |||||||
| $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq8074)) | $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq8074)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq6018)) | $(eval $(call BuildPackage,ath11k-wifi-qcom-ipq6018)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-qcom-qcn9000)) | $(eval $(call BuildPackage,ath11k-wifi-qcom-qcn9000)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf196_6g-ca)) | $(eval $(call BuildPackage,ath11k-wifi-cig-wf196)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf196_6g-us)) |  | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-motorola-q14)) | $(eval $(call BuildPackage,ath11k-wifi-motorola-q14)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-optimcloud-d50)) | $(eval $(call BuildPackage,ath11k-wifi-optimcloud-d50)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-optimcloud-d60)) | $(eval $(call BuildPackage,ath11k-wifi-optimcloud-d60)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi)) | $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi)) | ||||||
|  | $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xe)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi_wp)) | $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi_wp)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi_w)) | $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi_w)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4x_w)) | $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4x_w)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi_HMR)) | $(eval $(call BuildPackage,ath11k-wifi-hfcl-ion4xi_HMR)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-edgecore-oap101)) | $(eval $(call BuildPackage,ath11k-wifi-edgecore-oap101)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-edgecore-oap101e)) | $(eval $(call BuildPackage,ath11k-wifi-edgecore-oap101e)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf188n-ca)) | $(eval $(call BuildPackage,ath11k-wifi-cig-wf188n)) | ||||||
| $(eval $(call BuildPackage,ath11k-wifi-cig-wf188n-us)) |  | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								feeds/ipq807x_v5.4/ath11k-wifi/board-hfcl-ion4xe.bin.IPQ6018
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								feeds/ipq807x_v5.4/ath11k-wifi/board-hfcl-ion4xe.bin.IPQ6018
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -1958,6 +1958,9 @@ void hostapd_ubus_notify_radar_detected(struct hostapd_iface *iface, int frequen | |||||||
| 	struct hostapd_data *hapd; | 	struct hostapd_data *hapd; | ||||||
| 	int i; | 	int i; | ||||||
|  |  | ||||||
|  | 	if (!ctx) | ||||||
|  | 		return; | ||||||
|  |  | ||||||
| 	blob_buf_init(&b, 0); | 	blob_buf_init(&b, 0); | ||||||
| 	blobmsg_add_u16(&b, "frequency", frequency); | 	blobmsg_add_u16(&b, "frequency", frequency); | ||||||
| 	blobmsg_add_u16(&b, "width", chan_width); | 	blobmsg_add_u16(&b, "width", chan_width); | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-ssdk swconfig \ | |||||||
| 	kmod-usb-phy-ipq5018 kmod-usb-dwc3-qcom-internal \ | 	kmod-usb-phy-ipq5018 kmod-usb-dwc3-qcom-internal \ | ||||||
| 	kmod-ath11k-ahb  ath11k-firmware-ipq5018 \ | 	kmod-ath11k-ahb  ath11k-firmware-ipq5018 \ | ||||||
| 	kmod-gpio-button-hotplug iwinfo \ | 	kmod-gpio-button-hotplug iwinfo \ | ||||||
| 	qca-ssdk-shell \ | 	qca-ssdk-shell kmod-bootconfig \ | ||||||
| 	uboot-envtools -procd-ujail | 	uboot-envtools -procd-ujail | ||||||
|  |  | ||||||
| $(eval $(call BuildTarget)) | $(eval $(call BuildTarget)) | ||||||
|   | |||||||
| @@ -18,6 +18,13 @@ qcom_setup_interfaces() | |||||||
| 	cig,wf186h) | 	cig,wf186h) | ||||||
| 		ucidef_add_switch "switch0" "4:wan" "1:lan" "2:lan" "6@eth0" | 		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|\ | ||||||
|  	edgecore,oap101-6e|\ |  	edgecore,oap101-6e|\ | ||||||
| 	edgecore,oap101e|\ | 	edgecore,oap101e|\ | ||||||
| @@ -63,6 +70,18 @@ qcom_setup_macs() | |||||||
| 		ucidef_set_network_device_mac eth0 $wan_mac | 		ucidef_set_network_device_mac eth0 $wan_mac | ||||||
| 		ip link set eth0 address $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) | 		wan_mac=$(cat /sys/class/net/eth0/address) | ||||||
| 		lan_mac=$(macaddr_add "$wan_mac" 1) | 		lan_mac=$(macaddr_add "$wan_mac" 1) | ||||||
|   | |||||||
| @@ -39,6 +39,28 @@ ath11k_generate_macs_ion4x() { | |||||||
| 	echo -ne \\x${wifimac2//:/\\x} >> /lib/firmware/ath11k-macs | 	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() { | caldata_die() { | ||||||
| 	echo "caldata: " "$*" | 	echo "caldata: " "$*" | ||||||
| 	exit 1 | 	exit 1 | ||||||
| @@ -64,6 +86,8 @@ ath11k/IPQ5018/hw1.0/caldata.bin) | |||||||
| 	case "$board" in | 	case "$board" in | ||||||
| 	cig,wf186w|\ | 	cig,wf186w|\ | ||||||
| 	cig,wf186h|\ | 	cig,wf186h|\ | ||||||
|  | 	cybertan,eww631-a1|\ | ||||||
|  | 	cybertan,eww631-b1|\ | ||||||
| 	edgecore,eap104|\ | 	edgecore,eap104|\ | ||||||
| 	edgecore,oap101|\ | 	edgecore,oap101|\ | ||||||
| 	edgecore,oap101-6e|\ | 	edgecore,oap101-6e|\ | ||||||
| @@ -84,6 +108,8 @@ ath11k/qcn6122/hw1.0/caldata_1.bin) | |||||||
| 	case "$board" in | 	case "$board" in | ||||||
| 	cig,wf186w|\ | 	cig,wf186w|\ | ||||||
| 	cig,wf186h|\ | 	cig,wf186h|\ | ||||||
|  | 	cybertan,eww631-a1|\ | ||||||
|  | 	cybertan,eww631-b1|\ | ||||||
| 	edgecore,oap101|\ | 	edgecore,oap101|\ | ||||||
| 	edgecore,oap101-6e|\ | 	edgecore,oap101-6e|\ | ||||||
| 	edgecore,oap101e|\ | 	edgecore,oap101e|\ | ||||||
| @@ -101,6 +127,10 @@ ath11k/qcn6122/hw1.0/caldata_2.bin) | |||||||
| 	edgecore,oap101e-6e) | 	edgecore,oap101e-6e) | ||||||
| 		caldata_extract "0:ART" 0x4c000 0x20000   | 		caldata_extract "0:ART" 0x4c000 0x20000   | ||||||
| 		;; | 		;; | ||||||
|  | 	cybertan,eww631-a1|\ | ||||||
|  | 	cybertan,eww631-b1) | ||||||
|  | 		caldata_extract "0:ART" 0x26800 0x20000 | ||||||
|  | 		;; | ||||||
| 	esac | 	esac | ||||||
| 	;; | 	;; | ||||||
| ath11k/QCN9074/hw1.0/caldata_1.bin) | ath11k/QCN9074/hw1.0/caldata_1.bin) | ||||||
| @@ -119,6 +149,12 @@ ath11k-macs) | |||||||
| 	cig,wf186h) | 	cig,wf186h) | ||||||
| 		ath11k_generate_macs_wf186w | 		ath11k_generate_macs_wf186w | ||||||
| 		;; | 		;; | ||||||
|  | 	cybertan,eww631-a1) | ||||||
|  | 		ath11k_generate_macs_eww631_a1 | ||||||
|  | 		;; | ||||||
|  | 	cybertan,eww631-b1) | ||||||
|  | 		ath11k_generate_macs_eww631_b1 | ||||||
|  | 		;; | ||||||
| 	edgecore,eap104|\ | 	edgecore,eap104|\ | ||||||
| 	optimcloud,d60|\ | 	optimcloud,d60|\ | ||||||
| 	optimcloud,d60-5g|\ | 	optimcloud,d60-5g|\ | ||||||
|   | |||||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | |||||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | 	local conf_tar="/tmp/sysupgrade.tgz" | ||||||
| 	sync | 	sync | ||||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||||
|  | 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" |  | ||||||
| 	echo "sysupgrade successful" | 	echo "sysupgrade successful" | ||||||
| 	umount -a | 	umount -a | ||||||
| 	reboot -f | 	reboot -f | ||||||
|   | |||||||
| @@ -70,6 +70,8 @@ platform_check_image() { | |||||||
| 	case $board in | 	case $board in | ||||||
| 	cig,wf186w|\ | 	cig,wf186w|\ | ||||||
| 	cig,wf186h|\ | 	cig,wf186h|\ | ||||||
|  | 	cybertan,eww631-a1|\ | ||||||
|  | 	cybertan,eww631-b1|\ | ||||||
| 	edgecore,eap104|\ | 	edgecore,eap104|\ | ||||||
| 	hfcl,ion4x_w|\ | 	hfcl,ion4x_w|\ | ||||||
| 	hfcl,ion4xi_w|\ | 	hfcl,ion4xi_w|\ | ||||||
| @@ -130,5 +132,18 @@ platform_do_upgrade() { | |||||||
| 		} | 		} | ||||||
| 		nand_upgrade_tar "$1" | 		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 | 	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 >; | ||||||
|  |  | ||||||
|  | 	}; | ||||||
|  | }; | ||||||
| @@ -340,7 +340,7 @@ | |||||||
| 			status = "ok"; | 			status = "ok"; | ||||||
| 			pinctrl-0 = <&mdio1_pins>; | 			pinctrl-0 = <&mdio1_pins>; | ||||||
| 			pinctrl-names = "default"; | 			pinctrl-names = "default"; | ||||||
| 			phy-reset-gpio = <&tlmm 39 0>; | 			phy-reset-gpio = <&tlmm 16 0>; | ||||||
|  |  | ||||||
| 			ethernet-phy@0 { | 			ethernet-phy@0 { | ||||||
| 				reg = <0x00>; | 				reg = <0x00>; | ||||||
|   | |||||||
| @@ -18,6 +18,28 @@ define Device/cig_wf186w | |||||||
| endef | endef | ||||||
| TARGET_DEVICES += cig_wf186w | 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 | define Device/edgecore_eap104 | ||||||
|   DEVICE_TITLE := EdgeCore EAP104 |   DEVICE_TITLE := EdgeCore EAP104 | ||||||
|   DEVICE_DTS := qcom-ipq5018-eap104 |   DEVICE_DTS := qcom-ipq5018-eap104 | ||||||
|   | |||||||
| @@ -51,3 +51,17 @@ define KernelPackage/tpm-tis-i2c/description | |||||||
|   within Linux. |   within Linux. | ||||||
| endef | endef | ||||||
| $(eval $(call KernelPackage,tpm-tis-i2c)) | $(eval $(call KernelPackage,tpm-tis-i2c)) | ||||||
|  |  | ||||||
|  | define KernelPackage/bootconfig | ||||||
|  |   SUBMENU:=Other modules | ||||||
|  |   TITLE:=Bootconfig partition for failsafe | ||||||
|  |   KCONFIG:=CONFIG_BOOTCONFIG_PARTITION | ||||||
|  |   FILES:=$(LINUX_DIR)/drivers/platform/ipq/bootconfig.ko@ge4.4 | ||||||
|  |   AUTOLOAD:=$(call AutoLoad,56,bootconfig,1) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/bootconfig/description | ||||||
|  |   Bootconfig partition for failsafe | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call KernelPackage,bootconfig)) | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								feeds/ipq807x_v5.4/ipq50xx/patches/300-bootconfig.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								feeds/ipq807x_v5.4/ipq50xx/patches/300-bootconfig.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/platform/ipq/bootconfig.c | ||||||
|  | =================================================================== | ||||||
|  | --- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/platform/ipq/bootconfig.c | ||||||
|  | +++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/platform/ipq/bootconfig.c | ||||||
|  | @@ -366,7 +366,7 @@ static int __init bootconfig_partition_i | ||||||
|  |  			continue; | ||||||
|  |   | ||||||
|  |  		partname_dir[i] = proc_mkdir(part_info[i].name, boot_info_dir); | ||||||
|  | -		if (partname_dir != NULL) { | ||||||
|  | +		if (partname_dir[i] != NULL) { | ||||||
|  |  			proc_create_data("primaryboot", S_IRUGO, | ||||||
|  |  					   partname_dir[i], | ||||||
|  |  					   &primaryboot_ops, | ||||||
							
								
								
									
										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} }, | ||||||
| @@ -20,7 +20,7 @@ DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-ssdk swconfig \ | |||||||
| 	kmod-usb-phy-ipq807x kmod-usb-dwc3-qcom-internal \ | 	kmod-usb-phy-ipq807x kmod-usb-dwc3-qcom-internal \ | ||||||
| 	kmod-ath11k-ahb  ath11k-firmware-ipq60xx \ | 	kmod-ath11k-ahb  ath11k-firmware-ipq60xx \ | ||||||
| 	kmod-gpio-button-hotplug iwinfo \ | 	kmod-gpio-button-hotplug iwinfo \ | ||||||
| 	qca-ssdk-shell \ | 	qca-ssdk-shell kmod-bootconfig \ | ||||||
| 	uboot-envtools -procd-ujail | 	uboot-envtools -procd-ujail | ||||||
|  |  | ||||||
| $(eval $(call BuildTarget)) | $(eval $(call BuildTarget)) | ||||||
|   | |||||||
| @@ -1,5 +1,4 @@ | |||||||
| #!/bin/sh | #!/bin/sh | ||||||
|  |  | ||||||
| [ -e /lib/firmware/$FIRMWARE ] && exit 0 | [ -e /lib/firmware/$FIRMWARE ] && exit 0 | ||||||
|  |  | ||||||
| . /lib/functions.sh | . /lib/functions.sh | ||||||
| @@ -98,6 +97,18 @@ ath11k-macs) | |||||||
| 		;; | 		;; | ||||||
| 	esac | 	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 | 	exit 1 | ||||||
| 	;; | 	;; | ||||||
|   | |||||||
| @@ -10,7 +10,8 @@ boot() { | |||||||
| 		;;		 | 		;;		 | ||||||
| 	edgecore,eap101|\ | 	edgecore,eap101|\ | ||||||
| 	edgecore,eap102|\ | 	edgecore,eap102|\ | ||||||
| 	edgecore,oap102) | 	edgecore,oap102|\ | ||||||
|  | 	edgecore.eap104) | ||||||
| 		avail=$(fw_printenv -n upgrade_available) | 		avail=$(fw_printenv -n upgrade_available) | ||||||
| 		[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1 | 		[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1 | ||||||
| 		fw_setenv bootcount 0 | 		fw_setenv bootcount 0 | ||||||
|   | |||||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | |||||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | 	local conf_tar="/tmp/sysupgrade.tgz" | ||||||
| 	sync | 	sync | ||||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||||
|  | 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" |  | ||||||
| 	echo "sysupgrade successful" | 	echo "sysupgrade successful" | ||||||
| 	umount -a | 	umount -a | ||||||
| 	reboot -f | 	reboot -f | ||||||
|   | |||||||
| @@ -122,10 +122,10 @@ platform_do_upgrade() { | |||||||
| 		else | 		else | ||||||
| 			if grep -q rootfs1 /proc/cmdline; then | 			if grep -q rootfs1 /proc/cmdline; then | ||||||
| 				CI_UBIPART="rootfs2" | 				CI_UBIPART="rootfs2" | ||||||
| 				fw_setenv active 2 || exit 1 | 				CI_FWSETENV="active 2" | ||||||
| 			else | 			else | ||||||
| 				CI_UBIPART="rootfs1" | 				CI_UBIPART="rootfs1" | ||||||
| 				fw_setenv active 1 || exit 1 | 				CI_FWSETENV="active 1" | ||||||
| 			fi | 			fi | ||||||
| 		fi | 		fi | ||||||
| 		nand_upgrade_tar "$1" | 		nand_upgrade_tar "$1" | ||||||
|   | |||||||
| @@ -2,30 +2,21 @@ KERNEL_LOADADDR := 0x41080000 | |||||||
|  |  | ||||||
| DEVICE_VARS += CE_TYPE | DEVICE_VARS += CE_TYPE | ||||||
|  |  | ||||||
| define Device/cig_wf188n-ca | define Device/cig_wf188n | ||||||
|   DEVICE_TITLE := Cigtech WF-188n |   DEVICE_TITLE := Cigtech WF-188n | ||||||
|   DEVICE_DTS := qcom-ipq6018-cig-wf188n |   DEVICE_DTS := qcom-ipq6018-cig-wf188n | ||||||
|   DEVICE_DTS_CONFIG := config@cp03-c1 |   DEVICE_DTS_CONFIG := config@cp03-c1 | ||||||
|   SUPPORTED_DEVICES := cig,wf188n |   SUPPORTED_DEVICES := cig,wf188n | ||||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf188n-ca uboot-env |   DEVICE_PACKAGES := ath11k-wifi-cig-wf188n uboot-env | ||||||
| endef | endef | ||||||
| TARGET_DEVICES += cig_wf188n-ca | TARGET_DEVICES += cig_wf188n | ||||||
|  |  | ||||||
| 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 |  | ||||||
|  |  | ||||||
| define Device/hfcl_ion4xe | define Device/hfcl_ion4xe | ||||||
|   DEVICE_TITLE := HFCL ION4Xe |   DEVICE_TITLE := HFCL ION4Xe | ||||||
|   DEVICE_DTS := qcom-ipq6018-hfcl-ion4xe |   DEVICE_DTS := qcom-ipq6018-hfcl-ion4xe | ||||||
|   DEVICE_DTS_CONFIG := config@cp01-c1 |   DEVICE_DTS_CONFIG := config@cp01-c1 | ||||||
|   SUPPORTED_DEVICES := hfcl,ion4xe |   SUPPORTED_DEVICES := hfcl,ion4xe | ||||||
|   DEVICE_PACKAGES := ath11k-wifi-qcom-ipq6018 uboot-envtools kmod-hwmon-lm75 |   DEVICE_PACKAGES := ath11k-wifi-hfcl-ion4xe uboot-envtools kmod-hwmon-lm75 | ||||||
| endef | endef | ||||||
| TARGET_DEVICES += hfcl_ion4xe | TARGET_DEVICES += hfcl_ion4xe | ||||||
|  |  | ||||||
| @@ -101,14 +92,14 @@ define Device/wallys_dr6018 | |||||||
| endef | endef | ||||||
| TARGET_DEVICES += wallys_dr6018 | TARGET_DEVICES += wallys_dr6018 | ||||||
|  |  | ||||||
| define Device/wallys_dr6018_v4 | define Device/wallys_dr6018-v4 | ||||||
|   DEVICE_TITLE := Wallys DR6018 V4 |   DEVICE_TITLE := Wallys DR6018 V4 | ||||||
|   DEVICE_DTS := qcom-ipq6018-wallys-dr6018-v4 |   DEVICE_DTS := qcom-ipq6018-wallys-dr6018-v4 | ||||||
|   DEVICE_DTS_CONFIG := config@cp01-c4 |   DEVICE_DTS_CONFIG := config@cp01-c4 | ||||||
|   SUPPORTED_DEVICES := wallys,dr6018-v4 |   SUPPORTED_DEVICES := wallys,dr6018-v4 | ||||||
|   DEVICE_PACKAGES := ath11k-wifi-wallys-dr6018-v4 uboot-envtools ath11k-firmware-qcn9000 |   DEVICE_PACKAGES := ath11k-wifi-wallys-dr6018-v4 uboot-envtools ath11k-firmware-qcn9000 | ||||||
| endef | endef | ||||||
| TARGET_DEVICES += wallys_dr6018_v4 | TARGET_DEVICES += wallys_dr6018-v4 | ||||||
|  |  | ||||||
| define Device/glinet_ax1800 | define Device/glinet_ax1800 | ||||||
|   DEVICE_TITLE := GL-iNet AX1800 |   DEVICE_TITLE := GL-iNet AX1800 | ||||||
|   | |||||||
| @@ -76,3 +76,17 @@ define KernelPackage/usb-dwc3-qcom-internal/description | |||||||
| endef | endef | ||||||
|  |  | ||||||
| $(eval $(call KernelPackage,usb-dwc3-qcom-internal)) | $(eval $(call KernelPackage,usb-dwc3-qcom-internal)) | ||||||
|  |  | ||||||
|  | define KernelPackage/bootconfig | ||||||
|  |   SUBMENU:=Other modules | ||||||
|  |   TITLE:=Bootconfig partition for failsafe | ||||||
|  |   KCONFIG:=CONFIG_BOOTCONFIG_PARTITION | ||||||
|  |   FILES:=$(LINUX_DIR)/drivers/platform/ipq/bootconfig.ko@ge4.4 | ||||||
|  |   AUTOLOAD:=$(call AutoLoad,56,bootconfig,1) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/bootconfig/description | ||||||
|  |   Bootconfig partition for failsafe | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call KernelPackage,bootconfig)) | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								feeds/ipq807x_v5.4/ipq60xx/patches/300-bootconfig.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								feeds/ipq807x_v5.4/ipq60xx/patches/300-bootconfig.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/platform/ipq/bootconfig.c | ||||||
|  | =================================================================== | ||||||
|  | --- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/platform/ipq/bootconfig.c | ||||||
|  | +++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/platform/ipq/bootconfig.c | ||||||
|  | @@ -366,7 +366,7 @@ static int __init bootconfig_partition_i | ||||||
|  |  			continue; | ||||||
|  |   | ||||||
|  |  		partname_dir[i] = proc_mkdir(part_info[i].name, boot_info_dir); | ||||||
|  | -		if (partname_dir != NULL) { | ||||||
|  | +		if (partname_dir[i] != NULL) { | ||||||
|  |  			proc_create_data("primaryboot", S_IRUGO, | ||||||
|  |  					   partname_dir[i], | ||||||
|  |  					   &primaryboot_ops, | ||||||
							
								
								
									
										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); | ||||||
| @@ -20,7 +20,7 @@ DEFAULT_PACKAGES += kmod-qca-nss-dp kmod-qca-ssdk swconfig \ | |||||||
| 	kmod-usb-phy-ipq807x kmod-usb-dwc3-qcom-internal \ | 	kmod-usb-phy-ipq807x kmod-usb-dwc3-qcom-internal \ | ||||||
| 	kmod-ath11k-ahb ath11k-firmware-ipq807x \ | 	kmod-ath11k-ahb ath11k-firmware-ipq807x \ | ||||||
| 	kmod-gpio-button-hotplug iwinfo \ | 	kmod-gpio-button-hotplug iwinfo \ | ||||||
| 	qca-ssdk-shell \ | 	qca-ssdk-shell kmod-bootconfig \ | ||||||
| 	uboot-envtools -procd-ujail | 	uboot-envtools -procd-ujail | ||||||
|  |  | ||||||
| $(eval $(call BuildTarget)) | $(eval $(call BuildTarget)) | ||||||
|   | |||||||
| @@ -18,6 +18,9 @@ edgecore,oap102) | |||||||
|         ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt" |         ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt" | ||||||
|         ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt" |         ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt" | ||||||
| 	;; | 	;; | ||||||
|  | cybertan,eww631-b1) | ||||||
|  | 	ucidef_set_led_default "power" "POWER" "sys:blue" "on" | ||||||
|  | 	;; | ||||||
| esac | esac | ||||||
|  |  | ||||||
| board_config_flush | board_config_flush | ||||||
|   | |||||||
| @@ -16,9 +16,9 @@ ath11k_generate_macs() { | |||||||
| 	echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs | 	echo -ne \\x${mac3//:/\\x} >> /lib/firmware/ath11k-macs | ||||||
| } | } | ||||||
|  |  | ||||||
| ath11k_generate_macs_wf194() { | ath11k_generate_macs_wf196() { | ||||||
| 	touch /lib/firmware/ath11k-macs | 	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) | 	eth=$(macaddr_canonicalize $mac) | ||||||
| 	mac1=$(macaddr_add $eth 2) | 	mac1=$(macaddr_add $eth 2) | ||||||
| 	mac2=$(macaddr_add $eth 3) | 	mac2=$(macaddr_add $eth 3) | ||||||
| @@ -92,8 +92,32 @@ ath11k-macs) | |||||||
| 	edgecore,eap106) | 	edgecore,eap106) | ||||||
| 		ath11k_generate_macs | 		ath11k_generate_macs | ||||||
| 		;; | 		;; | ||||||
| 	cig,wf194c) | 	cig,wf196) | ||||||
| 		ath11k_generate_macs_wf194 | 		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 | 	esac | ||||||
| 	;; | 	;; | ||||||
|   | |||||||
| @@ -10,7 +10,8 @@ boot() { | |||||||
| 		;;		 | 		;;		 | ||||||
| 	edgecore,eap101|\ | 	edgecore,eap101|\ | ||||||
| 	edgecore,eap102|\ | 	edgecore,eap102|\ | ||||||
| 	edgecore,oap102) | 	edgecore,oap102|\ | ||||||
|  | 	edgecore.eap104) | ||||||
| 		avail=$(fw_printenv -n upgrade_available) | 		avail=$(fw_printenv -n upgrade_available) | ||||||
| 		[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1 | 		[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1 | ||||||
| 		fw_setenv bootcount 0 | 		fw_setenv bootcount 0 | ||||||
|   | |||||||
| @@ -247,8 +247,8 @@ nand_do_upgrade_success() { | |||||||
| 	local conf_tar="/tmp/sysupgrade.tgz" | 	local conf_tar="/tmp/sysupgrade.tgz" | ||||||
| 	sync | 	sync | ||||||
| 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | 	[ "$CI_BOOTCFG" = 1 ] && nand_qca_update_bootconfig | ||||||
|  | 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" && sync | ||||||
| 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | 	[ -n "$CI_FWSETENV" ] && fw_setenv $CI_FWSETENV | ||||||
| 	[ -f "$conf_tar" ] && nand_restore_config "$conf_tar" |  | ||||||
| 	echo "sysupgrade successful" | 	echo "sysupgrade successful" | ||||||
| 	umount -a | 	umount -a | ||||||
| 	reboot -f | 	reboot -f | ||||||
|   | |||||||
| @@ -61,12 +61,16 @@ platform_do_upgrade() { | |||||||
| 		if [ "$(find_mtd_chardev rootfs)" ]; then | 		if [ "$(find_mtd_chardev rootfs)" ]; then | ||||||
| 			CI_UBIPART="rootfs" | 			CI_UBIPART="rootfs" | ||||||
| 		else | 		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" | 				CI_UBIPART="rootfs2" | ||||||
| 				fw_setenv active 2 || exit 1 | 				CI_FWSETENV="active 2" | ||||||
| 			else | 			else | ||||||
| 				CI_UBIPART="rootfs1" | 				CI_UBIPART="rootfs1" | ||||||
| 				fw_setenv active 1 || exit 1 | 				CI_FWSETENV="active 1" | ||||||
| 			fi | 			fi | ||||||
| 		fi | 		fi | ||||||
| 		nand_upgrade_tar "$1" | 		nand_upgrade_tar "$1" | ||||||
|   | |||||||
| @@ -29,8 +29,79 @@ | |||||||
| 		stdout-path = "serial0"; | 		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 { | 	soc { | ||||||
| 		pinctrl@1000000 { | 		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 { | 			button_pins: button_pins { | ||||||
| 				reset_button { | 				reset_button { | ||||||
| 					pins = "gpio66"; | 					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 { | 			mdio_pins: mdio_pinmux { | ||||||
| 				mux_0 { | 				mux_0 { | ||||||
| 					pins = "gpio68"; | 					pins = "gpio68"; | ||||||
| @@ -170,19 +217,6 @@ | |||||||
| 			status = "ok"; | 			status = "ok"; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		phy@84000 { |  | ||||||
| 			status = "ok"; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		phy@86000 { |  | ||||||
| 			status = "ok"; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		pci@20000000 { |  | ||||||
| 			perst-gpio = <&tlmm 58 1>; |  | ||||||
| 			status = "ok"; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		gpio_keys { | 		gpio_keys { | ||||||
| 			compatible = "gpio-keys"; | 			compatible = "gpio-keys"; | ||||||
| 			pinctrl-0 = <&button_pins>; | 			pinctrl-0 = <&button_pins>; | ||||||
|   | |||||||
| @@ -29,8 +29,79 @@ | |||||||
| 		stdout-path = "serial0"; | 		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 { | 	soc { | ||||||
| 		pinctrl@1000000 { | 		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 { | 			button_pins: button_pins { | ||||||
| 				reset_button { | 				reset_button { | ||||||
| 					pins = "gpio66"; | 					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 { | 			mdio_pins: mdio_pinmux { | ||||||
| 				mux_0 { | 				mux_0 { | ||||||
| 					pins = "gpio68"; | 					pins = "gpio68"; | ||||||
| @@ -170,19 +217,6 @@ | |||||||
| 			status = "ok"; | 			status = "ok"; | ||||||
| 		}; | 		}; | ||||||
|  |  | ||||||
| 		phy@84000 { |  | ||||||
| 			status = "ok"; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		phy@86000 { |  | ||||||
| 			status = "ok"; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		pci@20000000 { |  | ||||||
| 			perst-gpio = <&tlmm 58 1>; |  | ||||||
| 			status = "ok"; |  | ||||||
| 		}; |  | ||||||
|  |  | ||||||
| 		gpio_keys { | 		gpio_keys { | ||||||
| 			compatible = "gpio-keys"; | 			compatible = "gpio-keys"; | ||||||
| 			pinctrl-0 = <&button_pins>; | 			pinctrl-0 = <&button_pins>; | ||||||
|   | |||||||
| @@ -16,6 +16,7 @@ | |||||||
|  |  | ||||||
| 	aliases { | 	aliases { | ||||||
| 		serial0 = &blsp1_uart5; | 		serial0 = &blsp1_uart5; | ||||||
|  | 		serial1 = &blsp1_uart3; | ||||||
| 		/* Aliases as required by u-boot to patch MAC addresses */ | 		/* Aliases as required by u-boot to patch MAC addresses */ | ||||||
| 		ethernet0 = "/soc/dp1"; | 		ethernet0 = "/soc/dp1"; | ||||||
| 		ethernet1 = "/soc/dp2"; | 		ethernet1 = "/soc/dp2"; | ||||||
| @@ -29,6 +30,17 @@ | |||||||
| 		stdout-path = "serial0"; | 		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 { | 	reserved-memory { | ||||||
| /* No Pine attach in 256M profile */ | /* No Pine attach in 256M profile */ | ||||||
| #if !defined(__IPQ_MEM_PROFILE_256_MB__) | #if !defined(__IPQ_MEM_PROFILE_256_MB__) | ||||||
| @@ -130,6 +142,26 @@ | |||||||
|  |  | ||||||
| 	soc { | 	soc { | ||||||
| 		pinctrl@1000000 { | 		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 { | 			button_pins: button_pins { | ||||||
| 				wps_button { | 				wps_button { | ||||||
| 					pins = "gpio67"; | 					pins = "gpio67"; | ||||||
| @@ -688,6 +720,12 @@ | |||||||
| 	}; | 	}; | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | &blsp1_uart3 { | ||||||
|  | 	pinctrl-0 = <&mcu_uart>; | ||||||
|  | 	pinctrl-names = "default"; | ||||||
|  | 	status = "ok"; | ||||||
|  | }; | ||||||
|  |  | ||||||
| &npu_cpr { | &npu_cpr { | ||||||
| 	status = "disabled"; | 	status = "disabled"; | ||||||
| }; | }; | ||||||
|   | |||||||
| @@ -9,29 +9,17 @@ define Device/cig_wf194c4 | |||||||
| endef | endef | ||||||
| TARGET_DEVICES += cig_wf194c4 | TARGET_DEVICES += cig_wf194c4 | ||||||
|  |  | ||||||
| define Device/cig_wf196_us | define Device/cig_wf196 | ||||||
|   DEVICE_TITLE := CIG WF196 |   DEVICE_TITLE := CIG WF196 | ||||||
|   DEVICE_DTS := qcom-ipq807x-wf196 |   DEVICE_DTS := qcom-ipq807x-wf196 | ||||||
|   DEVICE_DTS_CONFIG=config@hk14 |   DEVICE_DTS_CONFIG=config@hk14 | ||||||
|   SUPPORTED_DEVICES := cig,wf196 |   SUPPORTED_DEVICES := cig,wf196 | ||||||
|   BLOCKSIZE := 256k |   BLOCKSIZE := 256k | ||||||
|   PAGESIZE := 4096 |   PAGESIZE := 4096 | ||||||
|   DEVICE_PACKAGES := ath11k-wifi-cig-wf196-us aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 \ |   DEVICE_PACKAGES := ath11k-wifi-cig-wf196 aq-fw-download uboot-envtools kmod-usb3 kmod-usb2 \ | ||||||
|   	ath11k-firmware-qcn9000 ath11k-wifi-cig-wf196_6g-us |   	ath11k-firmware-qcn9000 | ||||||
| endef | endef | ||||||
| TARGET_DEVICES += cig_wf196_us | TARGET_DEVICES += cig_wf196 | ||||||
|  |  | ||||||
| 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 |  | ||||||
|  |  | ||||||
| define Device/edgecore_eap102 | define Device/edgecore_eap102 | ||||||
|   DEVICE_TITLE := Edgecore EAP102 |   DEVICE_TITLE := Edgecore EAP102 | ||||||
|   | |||||||
| @@ -56,4 +56,16 @@ endef | |||||||
|  |  | ||||||
| $(eval $(call KernelPackage,diag-char)) | $(eval $(call KernelPackage,diag-char)) | ||||||
|  |  | ||||||
|  | define KernelPackage/bootconfig | ||||||
|  |   SUBMENU:=Other modules | ||||||
|  |   TITLE:=Bootconfig partition for failsafe | ||||||
|  |   KCONFIG:=CONFIG_BOOTCONFIG_PARTITION | ||||||
|  |   FILES:=$(LINUX_DIR)/drivers/platform/ipq/bootconfig.ko@ge4.4 | ||||||
|  |   AUTOLOAD:=$(call AutoLoad,56,bootconfig,1) | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | define KernelPackage/bootconfig/description | ||||||
|  |   Bootconfig partition for failsafe | ||||||
|  | endef | ||||||
|  |  | ||||||
|  | $(eval $(call KernelPackage,bootconfig)) | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								feeds/ipq807x_v5.4/ipq807x/patches/300-bootconfig.patch
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								feeds/ipq807x_v5.4/ipq807x/patches/300-bootconfig.patch
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | |||||||
|  | Index: linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/platform/ipq/bootconfig.c | ||||||
|  | =================================================================== | ||||||
|  | --- linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d.orig/drivers/platform/ipq/bootconfig.c | ||||||
|  | +++ linux-5.4.164-qsdk-26349818b464f8c7b52d59ce73579d9f3dd6bd5d/drivers/platform/ipq/bootconfig.c | ||||||
|  | @@ -366,7 +366,7 @@ static int __init bootconfig_partition_i | ||||||
|  |  			continue; | ||||||
|  |   | ||||||
|  |  		partname_dir[i] = proc_mkdir(part_info[i].name, boot_info_dir); | ||||||
|  | -		if (partname_dir != NULL) { | ||||||
|  | +		if (partname_dir[i] != NULL) { | ||||||
|  |  			proc_create_data("primaryboot", S_IRUGO, | ||||||
|  |  					   partname_dir[i], | ||||||
|  |  					   &primaryboot_ops, | ||||||
							
								
								
									
										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,11 @@ | |||||||
|  | --- a/net/mac80211/sta_info.c | ||||||
|  | +++ b/net/mac80211/sta_info.c | ||||||
|  | @@ -2157,7 +2157,7 @@ static void sta_stats_decode_rate(struct | ||||||
|  |   | ||||||
|  |  		sband = local->hw.wiphy->bands[band]; | ||||||
|  |   | ||||||
|  | -		if (WARN_ON_ONCE(!sband->bitrates)) | ||||||
|  | +		if (WARN_ON_ONCE(!sband || !sband->bitrates)) | ||||||
|  |  			break; | ||||||
|  |   | ||||||
|  |  		brate = sband->bitrates[rate_idx].bitrate; | ||||||
| @@ -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. |   stack. | ||||||
| endef | endef | ||||||
|  |  | ||||||
|  |  | ||||||
| QCASSDK_CONFIG_OPTS+= TOOL_PATH=$(TOOLCHAIN_DIR)/bin/ \ | QCASSDK_CONFIG_OPTS+= TOOL_PATH=$(TOOLCHAIN_DIR)/bin/ \ | ||||||
|                 SYS_PATH=$(LINUX_DIR) \ |                 SYS_PATH=$(LINUX_DIR) \ | ||||||
|                 TOOLPREFIX=$(TARGET_CROSS) \ |                 TOOLPREFIX=$(TARGET_CROSS) \ | ||||||
|   | |||||||
| @@ -2,7 +2,7 @@ INCLUDE_DIR +=  include -I src | |||||||
| LIB	:= -lpthread -shared | LIB	:= -lpthread -shared | ||||||
| LDFLAGS +=  -Llib/ -ldiag -lpthread -pie | LDFLAGS +=  -Llib/ -ldiag -lpthread -pie | ||||||
| FLAGS = -fPIC -g -DUSE_MUSL | 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 | sample_cliobj	:= dci_client/diag_dci_sample.c | ||||||
| klogobj		:= klog/diag_klog.c | klogobj		:= klog/diag_klog.c | ||||||
| mdobj		:= mdlog/diag_mdlog.c | mdobj		:= mdlog/diag_mdlog.c | ||||||
|   | |||||||
| @@ -123,17 +123,23 @@ when       who     what, where, why | |||||||
|  |  | ||||||
| #define GUID_LEN 16 | #define GUID_LEN 16 | ||||||
|  |  | ||||||
| #ifdef ANDROID | #if defined (ANDROID) || defined (USE_ANDROID_LOGGING) | ||||||
| 	#define LOG_TAG "Diag_Lib" | 	#define LOG_TAG "Diag_Lib" | ||||||
| 	#define DIAG_LOGE(...)  { \ | 	#define DIAG_LOGE(...)  { \ | ||||||
| 		ALOGE(__VA_ARGS__); \ | 		ALOGE(__VA_ARGS__); \ | ||||||
| 		if (!diag_disable_console) \ | 		if (!diag_disable_console) \ | ||||||
| 			printf(__VA_ARGS__); \ | 			printf(__VA_ARGS__); \ | ||||||
| 	} | 	} | ||||||
| 	#include <cutils/log.h> | 	#define DIAG_LOGD(...)  { \ | ||||||
|         #include "common_log.h" | 		ALOGE(__VA_ARGS__); \ | ||||||
|  | 		if (!diag_disable_console) \ | ||||||
|  | 			printf(__VA_ARGS__); \ | ||||||
|  | 	} | ||||||
|  | 	#include <log/log.h> | ||||||
|  |     #include "common_log.h" | ||||||
| #else | #else | ||||||
| 	#define DIAG_LOGE(...) printf (__VA_ARGS__) | 	#define DIAG_LOGE(...) printf (__VA_ARGS__) | ||||||
|  | 	#define DIAG_LOGD(...) printf (__VA_ARGS__) | ||||||
| #endif | #endif | ||||||
| #include <pthread.h> | #include <pthread.h> | ||||||
| #include <stdio.h> | #include <stdio.h> | ||||||
| @@ -167,6 +173,12 @@ typedef enum { | |||||||
| 	DB_PARSER_STATE_CLOSE, | 	DB_PARSER_STATE_CLOSE, | ||||||
| } qsr4_db_file_parser_state; | } 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 |  * 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. |  * 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 PID_DIR "/root/diag_logs" | ||||||
| #define MAX_CHAN	4 | #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 ip_addr_name[FILE_NAME_LEN] = "192.168.0.10"; | ||||||
| static char port_number_string[FILE_NAME_LEN] = "2500"; | static char port_number_string[FILE_NAME_LEN] = "2500"; | ||||||
| static int port_number = 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 read_socket(struct diag_socket *socket) | ||||||
| { | { | ||||||
| 	int num_read; | 	int num_read; | ||||||
|  | 	int status; | ||||||
|  |  | ||||||
|  | repeat: | ||||||
| 	/* Read from the socket */ | 	/* Read from the socket */ | ||||||
| 	memset(read_buf, 0, 4096); | 	memset(read_buf[socket->id], 0, 4096); | ||||||
| 	num_read = recv(socket->fd, (unsigned char *)read_buf, 4096, 0); | 	num_read = recv(socket->fd, (unsigned char *)read_buf[socket->id], 4096, 0); | ||||||
| 	if (num_read > 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) { | 	} else if (num_read == -1) { | ||||||
| 		DIAG_LOGE("diag_socket_log: Read socket error: %s, errno: %d\n", | 		DIAG_LOGE("diag_socket_log: Read socket error: %s, errno: %d\n", | ||||||
| 				strerror(errno), errno); | 				strerror(errno), errno); | ||||||
|   | |||||||
| @@ -89,6 +89,9 @@ when       who    what, where, why | |||||||
|  |  | ||||||
| #define MAX_CHANNELS 4 | #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_HEADER_LENGTH	sizeof(int) | ||||||
| #define DCI_LEN_FIELD_LENGTH	sizeof(int) | #define DCI_LEN_FIELD_LENGTH	sizeof(int) | ||||||
| #define DCI_EVENT_OFFSET	sizeof(uint16) | #define DCI_EVENT_OFFSET	sizeof(uint16) | ||||||
| @@ -134,6 +137,13 @@ when       who    what, where, why | |||||||
| 	char dir_name[FILE_NAME_LEN]; | 	char dir_name[FILE_NAME_LEN]; | ||||||
| 	char peripheral_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 struct diag_callback_tbl_t cb_clients[NUM_PROC]; | ||||||
| static int socket_inited = 0; | static int socket_inited = 0; | ||||||
| static int (*socket_cb_ptr)(void *socket_cb_data_ptr, int socket_id); | 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) | int diag_send_socket_data(int id, unsigned char buf[], int num_bytes) | ||||||
| { | { | ||||||
| 	unsigned char send_buf[4100]; | 	static unsigned char send_buf[MAX_CHANNELS][MAX_USER_PKT_SIZE]; | ||||||
| 	unsigned char offset = 4; | 	static unsigned char extra_header = USER_SPACE_DATA_TYPE_SIZE; | ||||||
| 	int i; | 	static unsigned char tmp_header[DIAG_NON_HDLC_HEADER_SIZE]; | ||||||
| 	int start = 0; | 	static diag_pkt_states pkt_state = PKT_START; | ||||||
| 	int end = 0; | 	static int hdlc_pkt_pending = FALSE; | ||||||
| 	int copy_bytes; | 	static uint32_t total_pkt_size = 0; | ||||||
| 	int success; | 	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)) { | 	if ((id < 0) || id >= MAX_CHANNELS) { | ||||||
| 		*(int *)send_buf = USER_SPACE_DATA_TYPE; | 		DIAG_LOGE("diag_socket_log: %s: Error sending socket data. socket id: %d, num_bytes: %d\n", | ||||||
| 		if (socket_token[id] != 0 ) { | 			__func__, id, num_bytes); | ||||||
| 			*(int *)(send_buf + offset) = socket_token[id]; | 		return PKT_PROCESS_DONE; | ||||||
| 			offset += 4; |  | ||||||
| 		} |  | ||||||
|  |  | ||||||
| 		for (i = 0; i < num_bytes; i++) { |  | ||||||
| 			if (hdlc_disabled) { |  | ||||||
| 				if (buf[i] == CONTROL_CHAR && i == 0) { |  | ||||||
| 					end = end + 1; |  | ||||||
| 					continue; |  | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 			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; |  | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return success; | 	for (i = 0; i < num_bytes; i++) { | ||||||
|  | 		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; | ||||||
|  | 						} | ||||||
|  | 					} 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); | ||||||
|  | 						} | ||||||
|  | 						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 status; | ||||||
| } | } | ||||||
|  |  | ||||||
| /*========================================================================== | /*========================================================================== | ||||||
| @@ -2300,6 +2510,7 @@ int diag_read_mask_file(void) | |||||||
| 		if (!found_cmd) { | 		if (!found_cmd) { | ||||||
| 			DIAG_LOGE("Sorry, could not find valid commands in the mask file," | 			DIAG_LOGE("Sorry, could not find valid commands in the mask file," | ||||||
| 					"please check the mask file again\n"); | 					"please check the mask file again\n"); | ||||||
|  | 			fclose(read_mask_fp); | ||||||
| 			return -1; | 			return -1; | ||||||
| 		} | 		} | ||||||
| 	} else { | 	} else { | ||||||
| @@ -2321,6 +2532,7 @@ int diag_read_mask_file(void) | |||||||
| 			if (mask_buf[count_mask_bytes] != CONTROL_CHAR && i == 0) { | 			if (mask_buf[count_mask_bytes] != CONTROL_CHAR && i == 0) { | ||||||
| 				DIAG_LOGE("Sorry, the mask file doesn't adhere to framing definition," | 				DIAG_LOGE("Sorry, the mask file doesn't adhere to framing definition," | ||||||
| 					"please check the mask file again\n"); | 					"please check the mask file again\n"); | ||||||
|  | 				fclose(read_mask_fp); | ||||||
| 				return -1; | 				return -1; | ||||||
| 			} | 			} | ||||||
| 			if (count_mask_bytes > payload && mask_buf[count_mask_bytes] == CONTROL_CHAR && i != 0) { | 			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 DIAG_MDLOG_PID_FILE_SZ  100 | ||||||
| #define NUM_PROC 10 | #define NUM_PROC 10 | ||||||
| #define HDLC_DISABLE	1 | #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 diag_fd; | ||||||
| extern int fd_md[NUM_PROC]; | extern int fd_md[NUM_PROC]; | ||||||
| extern int gdwClientID; | 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) | 	if (entry->head == NULL) | ||||||
| 		entry->head = file_block_offset; | 		entry->head = file_block_offset; | ||||||
|  | 	else | ||||||
|  | 		free(file_block_offset); | ||||||
|  |  | ||||||
| 	return TRUE; | 	return TRUE; | ||||||
|  |  | ||||||
|   | |||||||
| @@ -1,11 +1,11 @@ | |||||||
| include $(TOPDIR)/rules.mk | include $(TOPDIR)/rules.mk | ||||||
|  |  | ||||||
| PKG_NAME:=ath12k-firmware | PKG_NAME:=ath12k-firmware | ||||||
|  | PKG_MIRROR_HASH:=a325f86b1d613f713d2e015abca4a9ff86c8448d4cd540fa022866da2c5aa042 | ||||||
| PKG_SOURCE_PROTO:=git | PKG_SOURCE_PROTO:=git | ||||||
| PKG_BRANCH:=main | PKG_BRANCH:=main | ||||||
| PKG_SOURCE_URL:=https://github.com/quic/upstream-wifi-fw.git | PKG_SOURCE_URL:=https://github.com/quic/upstream-wifi-fw.git | ||||||
| PKG_MIRROR_HASH:=ade4287ff2935ad1d54e5dabb8e6de28f648d0974fa76238fcc1616235e6773e | PKG_SOURCE_VERSION:=e90d32aaa149800ea79760639cb5ac9ddcfc8281 | ||||||
| PKG_SOURCE_VERSION:=3417bb86645c5ff4c58258db7cc33e43260b4222 |  | ||||||
|  |  | ||||||
| PKG_MAINTAINER:=John Crispin <john@phrozen.org> | PKG_MAINTAINER:=John Crispin <john@phrozen.org> | ||||||
|  |  | ||||||
| @@ -18,20 +18,59 @@ define Package/ath12k-firmware-default | |||||||
|   DEPENDS:= |   DEPENDS:= | ||||||
| endef | 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 | define Package/ath12k-firmware-qcn92xx | ||||||
|   $(Package/ath12k-firmware-default) |   $(Package/ath12k-firmware-default) | ||||||
|   TITLE:=ath12k firmware for qcn92xx devices |   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 | endef | ||||||
|  |  | ||||||
| define Build/Compile | define Build/Compile | ||||||
|  |  | ||||||
| endef | 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 | define Package/ath12k-firmware-qcn92xx/install | ||||||
| 	$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw2.0 | 	$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0 | ||||||
| 	$(INSTALL_DATA) $(PKG_BUILD_DIR)/ath12k-firmware/QCN9274/hw2.0/1.1.1/WLAN.WBE.1.1.1-00126-QCAHKSWPL_SILICONZ-1/* \ | 	$(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/hw2.0 | 		$(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 | endef | ||||||
|  |  | ||||||
| $(eval $(call BuildPackage,ath12k-firmware-qcn92xx)) | $(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 |   SUBMENU:=ath12k Board-Specific Overrides | ||||||
|   SECTION:=firmware |   SECTION:=firmware | ||||||
|   CATEGORY:=Firmware |   CATEGORY:=Firmware | ||||||
|   DEPENDS:=@TARGET_qcn9274 |   DEPENDS:=@(TARGET_qcn9274||TARGET_ipq53xx) | ||||||
|   TITLE:=Custom Board |   TITLE:=Custom Board | ||||||
| endef | 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 | 	$(INSTALL_DATA) ./board-2.bin.QCN9274 $(1)/lib/firmware/ath12k/QCN9274/hw1.0/board-2.bin | ||||||
| endef | 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-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 | include $(TOPDIR)/rules.mk | ||||||
|  |  | ||||||
| PKG_NAME:=hostapd | PKG_NAME:=hostapd | ||||||
| PKG_RELEASE:=$(AUTORELEASE) | PKG_VERSION:=2023-02-21-ath12.3-cs | ||||||
|  |  | ||||||
| PKG_SOURCE_URL:=http://w1.fi/hostap.git | PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 | ||||||
| PKG_SOURCE_PROTO:=git | PKG_HASH:=6153bacd614d9bb2dfba634dd698a698e37c043e08543a0802903718238a12fa | ||||||
| PKG_SOURCE_DATE:=2021-12-13 | PKG_SOURCE_URL:=@KERNEL/software/utils/dtc | ||||||
| PKG_SOURCE_VERSION:=b26f5c0fe3 |  | ||||||
| PKG_MIRROR_HASH:=2c5b72056b6efc3a16ca912118b324371527c7ac79c4b997349d94680538a7d8 |  | ||||||
|  |  | ||||||
| PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name> | ||||||
| PKG_LICENSE:=BSD-3-Clause | PKG_LICENSE:=BSD-3-Clause | ||||||
|   | |||||||
| @@ -126,6 +126,7 @@ hostapd_common_add_device_config() { | |||||||
| 	config_add_int airtime_mode | 	config_add_int airtime_mode | ||||||
|  |  | ||||||
| 	config_add_boolean multiple_bssid rnr_beacon he_co_locate ema | 	config_add_boolean multiple_bssid rnr_beacon he_co_locate ema | ||||||
|  | 	config_add_boolean mlo | ||||||
|  |  | ||||||
| 	hostapd_add_log_config | 	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 \ | 		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 \ | 		rts_threshold beacon_rate rssi_reject_assoc_rssi rssi_ignore_probe_request maxassoc \ | ||||||
| 		multiple_bssid he_co_locate rnr_beacon ema acs_exclude_dfs \ | 		multiple_bssid he_co_locate rnr_beacon ema acs_exclude_dfs \ | ||||||
| 		maxassoc_ignore_probe | 		maxassoc_ignore_probe mlo | ||||||
|  |  | ||||||
| 	hostapd_set_log_options base_cfg | 	hostapd_set_log_options base_cfg | ||||||
|  |  | ||||||
| @@ -155,6 +156,7 @@ hostapd_prepare_device_config() { | |||||||
| 	set_default multiple_bssid 0 | 	set_default multiple_bssid 0 | ||||||
| 	set_default ema 0 | 	set_default ema 0 | ||||||
| 	set_default acs_exclude_dfs 0 | 	set_default acs_exclude_dfs 0 | ||||||
|  | 	set_default mlo 0 | ||||||
|  |  | ||||||
| 	[ -n "$country" ] && { | 	[ -n "$country" ] && { | ||||||
| 		append base_cfg "country_code=$country" "$N" | 		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" | #	[ "$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" | 	[ "$multiple_bssid" -gt 0 ] && append base_cfg "multiple_bssid=$multiple_bssid" "$N" | ||||||
| 	[ "$ema" -gt 0 ] && append base_cfg "ema=$ema" "$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" | 	[ "$acs_exclude_dfs" -gt 0 ] && append base_cfg "acs_exclude_dfs=$acs_exclude_dfs" "$N" | ||||||
|  |  | ||||||
| 	json_get_values opts hostapd_options | 	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_init.o | ||||||
|  OBJS += ../src/ap/vlan_ifconfig.o |  OBJS += ../src/ap/vlan_ifconfig.o | ||||||
|  OBJS += ../src/ap/vlan.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 |  OBJS += ../src/ap/mbo_ap.o | ||||||
|  endif |  endif | ||||||
|   |   | ||||||
| @@ -36,7 +36,7 @@ | |||||||
|  LIBS += $(DRV_AP_LIBS) |  LIBS += $(DRV_AP_LIBS) | ||||||
|   |   | ||||||
|  ifdef CONFIG_L2_PACKET |  ifdef CONFIG_L2_PACKET | ||||||
| @@ -1277,6 +1283,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) | @@ -1380,6 +1386,12 @@ install: $(addprefix $(DESTDIR)$(BINDIR) | ||||||
|  _OBJS_VAR := OBJS |  _OBJS_VAR := OBJS | ||||||
|  include ../src/objs.mk |  include ../src/objs.mk | ||||||
|   |   | ||||||
| @@ -49,7 +49,7 @@ | |||||||
|  hostapd: $(OBJS) |  hostapd: $(OBJS) | ||||||
|  	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) |  	$(Q)$(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) | ||||||
|  	@$(E) "  LD " $@ |  	@$(E) "  LD " $@ | ||||||
| @@ -1351,6 +1363,12 @@ include ../src/objs.mk | @@ -1460,6 +1472,12 @@ include ../src/objs.mk | ||||||
|  _OBJS_VAR := SOBJS |  _OBJS_VAR := SOBJS | ||||||
|  include ../src/objs.mk |  include ../src/objs.mk | ||||||
|   |   | ||||||
| @@ -64,15 +64,15 @@ | |||||||
|  	@$(E) "  LD " $@ |  	@$(E) "  LD " $@ | ||||||
| --- a/wpa_supplicant/Makefile | --- a/wpa_supplicant/Makefile | ||||||
| +++ b/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 |  EXTRA_TARGETS=dynamic_eap_methods | ||||||
|   |   | ||||||
|  CONFIG_FILE=.config |  CONFIG_FILE=.config | ||||||
| +-include $(if $(MULTICALL),../hostapd/.config) | +-include $(if $(MULTICALL),../hostapd/.config) | ||||||
|  include ../src/build.rules |  include ../src/build.rules | ||||||
|   |   | ||||||
|  ifdef LIBS |  ifdef CONFIG_BUILD_PASN_SO | ||||||
| @@ -354,7 +355,9 @@ endif | @@ -382,7 +383,9 @@ endif | ||||||
|  ifdef CONFIG_IBSS_RSN |  ifdef CONFIG_IBSS_RSN | ||||||
|  NEED_RSN_AUTHENTICATOR=y |  NEED_RSN_AUTHENTICATOR=y | ||||||
|  CFLAGS += -DCONFIG_IBSS_RSN |  CFLAGS += -DCONFIG_IBSS_RSN | ||||||
| @@ -82,7 +82,7 @@ | |||||||
|  OBJS += ibss_rsn.o |  OBJS += ibss_rsn.o | ||||||
|  endif |  endif | ||||||
|   |   | ||||||
| @@ -886,6 +889,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS | @@ -924,6 +927,10 @@ ifdef CONFIG_DYNAMIC_EAP_METHODS | ||||||
|  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS |  CFLAGS += -DCONFIG_DYNAMIC_EAP_METHODS | ||||||
|  LIBS += -ldl -rdynamic |  LIBS += -ldl -rdynamic | ||||||
|  endif |  endif | ||||||
| @@ -93,7 +93,7 @@ | |||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef CONFIG_AP |  ifdef CONFIG_AP | ||||||
| @@ -893,9 +900,11 @@ NEED_EAP_COMMON=y | @@ -931,9 +938,11 @@ NEED_EAP_COMMON=y | ||||||
|  NEED_RSN_AUTHENTICATOR=y |  NEED_RSN_AUTHENTICATOR=y | ||||||
|  CFLAGS += -DCONFIG_AP |  CFLAGS += -DCONFIG_AP | ||||||
|  OBJS += ap.o |  OBJS += ap.o | ||||||
| @@ -105,7 +105,7 @@ | |||||||
|  OBJS += ../src/ap/hostapd.o |  OBJS += ../src/ap/hostapd.o | ||||||
|  OBJS += ../src/ap/wpa_auth_glue.o |  OBJS += ../src/ap/wpa_auth_glue.o | ||||||
|  OBJS += ../src/ap/utils.o |  OBJS += ../src/ap/utils.o | ||||||
| @@ -975,6 +984,12 @@ endif | @@ -1022,6 +1031,12 @@ endif | ||||||
|  ifdef CONFIG_HS20 |  ifdef CONFIG_HS20 | ||||||
|  OBJS += ../src/ap/hs20.o |  OBJS += ../src/ap/hs20.o | ||||||
|  endif |  endif | ||||||
| @@ -118,7 +118,7 @@ | |||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef CONFIG_MBO |  ifdef CONFIG_MBO | ||||||
| @@ -983,7 +998,9 @@ CFLAGS += -DCONFIG_MBO | @@ -1030,7 +1045,9 @@ CFLAGS += -DCONFIG_MBO | ||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef NEED_RSN_AUTHENTICATOR |  ifdef NEED_RSN_AUTHENTICATOR | ||||||
| @@ -128,7 +128,7 @@ | |||||||
|  NEED_AES_WRAP=y |  NEED_AES_WRAP=y | ||||||
|  OBJS += ../src/ap/wpa_auth.o |  OBJS += ../src/ap/wpa_auth.o | ||||||
|  OBJS += ../src/ap/wpa_auth_ie.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 |  _OBJS_VAR := OBJS | ||||||
|  include ../src/objs.mk |  include ../src/objs.mk | ||||||
| @@ -141,7 +141,7 @@ | |||||||
|  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) |  wpa_supplicant: $(BCHECK) $(OBJS) $(EXTRA_progs) | ||||||
|  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) |  	$(Q)$(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) | ||||||
|  	@$(E) "  LD " $@ |  	@$(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' $< >$@ |  	$(Q)sed -e 's|\@BINDIR\@|$(BINDIR)|g' $< >$@ | ||||||
|  	@$(E) "  sed" $< |  	@$(E) "  sed" $< | ||||||
|   |   | ||||||
| @@ -156,7 +156,7 @@ | |||||||
|  wpa_cli.exe: wpa_cli |  wpa_cli.exe: wpa_cli | ||||||
| --- a/src/drivers/driver.h | --- a/src/drivers/driver.h | ||||||
| +++ b/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 |   * Driver wrapper code should call this function whenever an event is received | ||||||
|   * from the driver. |   * from the driver. | ||||||
|   */ |   */ | ||||||
| @@ -167,7 +167,7 @@ | |||||||
|   |   | ||||||
|  /** |  /** | ||||||
|   * wpa_supplicant_event_global - Report a driver event for wpa_supplicant |   * 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 |   * Same as wpa_supplicant_event(), but we search for the interface in | ||||||
|   * wpa_global. |   * wpa_global. | ||||||
|   */ |   */ | ||||||
| @@ -178,7 +178,7 @@ | |||||||
|  /* |  /* | ||||||
| --- a/src/ap/drv_callbacks.c | --- a/src/ap/drv_callbacks.c | ||||||
| +++ b/src/ap/drv_callbacks.c | +++ b/src/ap/drv_callbacks.c | ||||||
| @@ -1827,8 +1827,8 @@ err: | @@ -2184,8 +2184,8 @@ err: | ||||||
|  #endif /* CONFIG_OWE */ |  #endif /* CONFIG_OWE */ | ||||||
|   |   | ||||||
|   |   | ||||||
| @@ -189,7 +189,7 @@ | |||||||
|  { |  { | ||||||
|  	struct hostapd_data *hapd = ctx; |  	struct hostapd_data *hapd = ctx; | ||||||
|  #ifndef CONFIG_NO_STDOUT_DEBUG |  #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; |  	struct hapd_interfaces *interfaces = ctx; | ||||||
| --- a/wpa_supplicant/wpa_priv.c | --- a/wpa_supplicant/wpa_priv.c | ||||||
| +++ b/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; |  	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) |  				 union wpa_event_data *data) | ||||||
|  { |  { | ||||||
|  	struct wpa_priv_global *global = ctx; |  	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()) |  	if (os_program_init()) | ||||||
|  		return -1; |  		return -1; | ||||||
|   |   | ||||||
| @@ -231,7 +231,7 @@ | |||||||
|  	os_memset(&global, 0, sizeof(global)); |  	os_memset(&global, 0, sizeof(global)); | ||||||
| --- a/wpa_supplicant/events.c | --- a/wpa_supplicant/events.c | ||||||
| +++ b/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; |  	struct wpa_supplicant *wpa_s = ctx; | ||||||
|  	int resched; |  	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; |  	struct wpa_supplicant *wpa_s; | ||||||
| --- a/wpa_supplicant/wpa_supplicant.c | --- a/wpa_supplicant/wpa_supplicant.c | ||||||
| +++ b/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; |  	return NULL; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -261,7 +261,7 @@ | |||||||
|  /** |  /** | ||||||
|   * wpa_supplicant_match_existing - Match existing interfaces |   * wpa_supplicant_match_existing - Match existing interfaces | ||||||
|   * @global: Pointer to global data from wpa_supplicant_init() |   * @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 */ |  #endif /* CONFIG_MATCH_IFACE */ | ||||||
|   |   | ||||||
| @@ -273,7 +273,7 @@ | |||||||
|   |   | ||||||
|  /** |  /** | ||||||
|   * wpa_supplicant_add_iface - Add a new network interface |   * 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 |  #ifndef CONFIG_NO_WPA_MSG | ||||||
|  	wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); |  	wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb); | ||||||
|  #endif /* CONFIG_NO_WPA_MSG */ |  #endif /* CONFIG_NO_WPA_MSG */ | ||||||
| @@ -284,7 +284,7 @@ | |||||||
|  		wpa_debug_open_file(params->wpa_debug_file_path); |  		wpa_debug_open_file(params->wpa_debug_file_path); | ||||||
| --- a/hostapd/main.c | --- a/hostapd/main.c | ||||||
| +++ b/hostapd/main.c | +++ b/hostapd/main.c | ||||||
| @@ -590,6 +590,11 @@ fail: | @@ -698,6 +698,11 @@ fail: | ||||||
|  	return -1; |  	return -1; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -296,14 +296,14 @@ | |||||||
|   |   | ||||||
|  #ifdef CONFIG_WPS |  #ifdef CONFIG_WPS | ||||||
|  static int gen_uuid(const char *txt_addr) |  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; |  		return -1; | ||||||
|  #endif /* CONFIG_DPP */ |  #endif /* CONFIG_DPP */ | ||||||
|   |   | ||||||
| +	wpa_supplicant_event = hostapd_wpa_event; | +	wpa_supplicant_event = hostapd_wpa_event; | ||||||
| +	wpa_supplicant_event_global = hostapd_wpa_event_global; | +	wpa_supplicant_event_global = hostapd_wpa_event_global; | ||||||
|  	for (;;) { |  	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) |  		if (c < 0) | ||||||
| --- a/src/drivers/drivers.c | --- a/src/drivers/drivers.c | ||||||
| +++ b/src/drivers/drivers.c | +++ b/src/drivers/drivers.c | ||||||
| @@ -320,7 +320,7 @@ | |||||||
|  { |  { | ||||||
| --- a/wpa_supplicant/eapol_test.c | --- a/wpa_supplicant/eapol_test.c | ||||||
| +++ b/wpa_supplicant/eapol_test.c | +++ b/wpa_supplicant/eapol_test.c | ||||||
| @@ -30,7 +30,12 @@ | @@ -31,7 +31,12 @@ | ||||||
|  #include "ctrl_iface.h" |  #include "ctrl_iface.h" | ||||||
|  #include "pcsc_funcs.h" |  #include "pcsc_funcs.h" | ||||||
|  #include "wpas_glue.h" |  #include "wpas_glue.h" | ||||||
| @@ -333,7 +333,7 @@ | |||||||
|   |   | ||||||
|  const struct wpa_driver_ops *const wpa_drivers[] = { NULL }; |  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"); |  	       "option several times.\n"); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -344,7 +344,7 @@ | |||||||
|   |   | ||||||
|  int main(int argc, char *argv[]) |  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()) |  	if (os_program_init()) | ||||||
|  		return -1; |  		return -1; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/hostapd/config_file.c | --- a/hostapd/config_file.c | ||||||
| +++ b/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) |  		if (bss->ocv && !bss->ieee80211w) | ||||||
|  			bss->ieee80211w = 1; |  			bss->ieee80211w = 1; | ||||||
|  #endif /* CONFIG_OCV */ |  #endif /* CONFIG_OCV */ | ||||||
| @@ -13,7 +13,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "ht_capab") == 0) { |  	} else if (os_strcmp(buf, "ht_capab") == 0) { | ||||||
| --- a/src/ap/ap_config.h | --- a/src/ap/ap_config.h | ||||||
| +++ b/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; |  	int ht_op_mode_fixed; | ||||||
|  	u16 ht_capab; |  	u16 ht_capab; | ||||||
| @@ -24,7 +24,7 @@ | |||||||
|  	int no_pri_sec_switch; |  	int no_pri_sec_switch; | ||||||
| --- a/src/ap/hw_features.c | --- a/src/ap/hw_features.c | ||||||
| +++ b/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; |  	int ret; | ||||||
|   |   | ||||||
|  	/* Check that HT40 is used and PRI / SEC switch is allowed */ |  	/* Check that HT40 is used and PRI / SEC switch is allowed */ | ||||||
| @@ -36,7 +36,7 @@ | |||||||
|  	hostapd_set_state(iface, HAPD_IFACE_HT_SCAN); |  	hostapd_set_state(iface, HAPD_IFACE_HT_SCAN); | ||||||
| --- a/src/ap/ieee802_11_ht.c | --- a/src/ap/ieee802_11_ht.c | ||||||
| +++ b/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; |  		return; | ||||||
|  	} |  	} | ||||||
|   |   | ||||||
| @@ -46,7 +46,7 @@ | |||||||
|  	if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) { |  	if (len < IEEE80211_HDRLEN + 2 + sizeof(*bc_ie)) { | ||||||
|  		wpa_printf(MSG_DEBUG, |  		wpa_printf(MSG_DEBUG, | ||||||
|  			   "Ignore too short 20/40 BSS Coexistence Management frame"); |  			   "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) |  	if (iface->current_mode->mode != HOSTAPD_MODE_IEEE80211G) | ||||||
|  		return; |  		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 | --- a/wpa_supplicant/wpa_supplicant.c | ||||||
| +++ b/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) |  	if (wpa_s == NULL) | ||||||
|  		return NULL; |  		return NULL; | ||||||
|  	wpa_s->scan_req = INITIAL_SCAN_REQ; |  	wpa_s->scan_req = INITIAL_SCAN_REQ; | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/drivers/drivers.mak | --- a/src/drivers/drivers.mak | ||||||
| +++ b/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_AP_MLME=y | ||||||
|  NEED_NETLINK=y |  NEED_NETLINK=y | ||||||
|  NEED_LINUX_IOCTL=y |  NEED_LINUX_IOCTL=y | ||||||
| @@ -8,7 +8,7 @@ | |||||||
|  NEED_RADIOTAP=y |  NEED_RADIOTAP=y | ||||||
|  NEED_LIBNL=y |  NEED_LIBNL=y | ||||||
|  endif |  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 |  CONFIG_WIRELESS_EXTENSION=y | ||||||
|  NEED_NETLINK=y |  NEED_NETLINK=y | ||||||
|  NEED_LINUX_IOCTL=y |  NEED_LINUX_IOCTL=y | ||||||
| @@ -16,7 +16,7 @@ | |||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef CONFIG_DRIVER_NDIS |  ifdef CONFIG_DRIVER_NDIS | ||||||
| @@ -133,7 +131,6 @@ endif | @@ -137,7 +135,6 @@ endif | ||||||
|  ifdef CONFIG_WIRELESS_EXTENSION |  ifdef CONFIG_WIRELESS_EXTENSION | ||||||
|  DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION |  DRV_WPA_CFLAGS += -DCONFIG_WIRELESS_EXTENSION | ||||||
|  DRV_WPA_OBJS += ../src/drivers/driver_wext.o |  DRV_WPA_OBJS += ../src/drivers/driver_wext.o | ||||||
| @@ -24,7 +24,7 @@ | |||||||
|  endif |  endif | ||||||
|   |   | ||||||
|  ifdef NEED_NETLINK |  ifdef NEED_NETLINK | ||||||
| @@ -142,6 +139,7 @@ endif | @@ -146,6 +143,7 @@ endif | ||||||
|   |   | ||||||
|  ifdef NEED_RFKILL |  ifdef NEED_RFKILL | ||||||
|  DRV_OBJS += ../src/drivers/rfkill.o |  DRV_OBJS += ../src/drivers/rfkill.o | ||||||
|   | |||||||
| @@ -1,8 +1,8 @@ | |||||||
| --- a/src/drivers/driver_nl80211.c | --- a/src/drivers/driver_nl80211.c | ||||||
| +++ b/src/drivers/driver_nl80211.c | +++ b/src/drivers/driver_nl80211.c | ||||||
| @@ -4919,7 +4919,7 @@ static int nl80211_set_channel(struct i8 | @@ -5407,7 +5407,7 @@ static int nl80211_set_channel(struct i8 | ||||||
|  		   freq->freq, freq->ht_enabled, freq->vht_enabled, freq->he_enabled, |  		   freq->he_enabled, freq->eht_enabled, freq->bandwidth, | ||||||
|  		   freq->bandwidth, freq->center_freq1, freq->center_freq2); |  		   freq->center_freq1, freq->center_freq2); | ||||||
|   |   | ||||||
| -	msg = nl80211_drv_msg(drv, 0, set_chan ? NL80211_CMD_SET_CHANNEL : | -	msg = nl80211_drv_msg(drv, 0, set_chan ? NL80211_CMD_SET_CHANNEL : | ||||||
| +	msg = nl80211_bss_msg(bss, 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 | Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ap.c | ||||||
| +++ b/wpa_supplicant/ap.c | =================================================================== | ||||||
| @@ -1513,15 +1513,35 @@ int ap_switch_channel(struct wpa_supplic | --- 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 |  #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, | +static int __ap_ctrl_iface_chanswitch(struct hostapd_iface *iface, | ||||||
| +				      struct csa_settings *settings) | +				      struct csa_settings *settings) | ||||||
| +{ |  { | ||||||
|  | -	struct csa_settings settings; | ||||||
|  | -	int ret; | ||||||
| +#ifdef NEED_AP_MLME | +#ifdef NEED_AP_MLME | ||||||
| +	if (!iface || !iface->bss[0]) | +	if (!iface || !iface->bss[0]) | ||||||
| +		return 0; | +		return 0; | ||||||
| @@ -17,17 +22,25 @@ | |||||||
| +	return -1; | +	return -1; | ||||||
| +#endif | +#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]) && | +	if (!(wpa_s->ap_iface && wpa_s->ap_iface->bss[0]) && | ||||||
| +	    !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0])) | +	    !(wpa_s->ifmsh && wpa_s->ifmsh->bss[0])) | ||||||
| +		return -1; | +		return -1; | ||||||
| + |   | ||||||
| +	ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings); | +	ret = __ap_ctrl_iface_chanswitch(wpa_s->ap_iface, &settings); | ||||||
|  	if (ret) |  	if (ret) | ||||||
|  		return 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 | Index: hostapd-2023-02-21-ath12.3-cs/hostapd/Makefile | ||||||
| +++ b/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 | @@ -221,6 +221,9 @@ endif | ||||||
|  ifdef CONFIG_NO_CTRL_IFACE |  ifdef CONFIG_NO_CTRL_IFACE | ||||||
|  CFLAGS += -DCONFIG_NO_CTRL_IFACE |  CFLAGS += -DCONFIG_NO_CTRL_IFACE | ||||||
| @@ -10,9 +12,11 @@ | |||||||
|  ifeq ($(CONFIG_CTRL_IFACE), udp) |  ifeq ($(CONFIG_CTRL_IFACE), udp) | ||||||
|  CFLAGS += -DCONFIG_CTRL_IFACE_UDP |  CFLAGS += -DCONFIG_CTRL_IFACE_UDP | ||||||
|  else |  else | ||||||
| --- a/hostapd/ctrl_iface.c | Index: hostapd-2023-02-21-ath12.3-cs/hostapd/ctrl_iface.c | ||||||
| +++ b/hostapd/ctrl_iface.c | =================================================================== | ||||||
| @@ -3388,6 +3388,7 @@ static int hostapd_ctrl_iface_receive_pr | --- 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); |  						      reply_size); | ||||||
|  	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { |  	} else if (os_strcmp(buf, "STATUS-DRIVER") == 0) { | ||||||
|  		reply_len = hostapd_drv_status(hapd, reply, reply_size); |  		reply_len = hostapd_drv_status(hapd, reply, reply_size); | ||||||
| @@ -20,7 +24,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "MIB") == 0) { |  	} else if (os_strcmp(buf, "MIB") == 0) { | ||||||
|  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size); |  		reply_len = ieee802_11_get_mib(hapd, reply, reply_size); | ||||||
|  		if (reply_len >= 0) { |  		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) { |  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { | ||||||
|  		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, |  		reply_len = hostapd_ctrl_iface_sta_next(hapd, buf + 9, reply, | ||||||
|  							reply_size); |  							reply_size); | ||||||
| @@ -28,9 +32,11 @@ | |||||||
|  	} else if (os_strcmp(buf, "ATTACH") == 0) { |  	} else if (os_strcmp(buf, "ATTACH") == 0) { | ||||||
|  		if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL)) |  		if (hostapd_ctrl_iface_attach(hapd, from, fromlen, NULL)) | ||||||
|  			reply_len = -1; |  			reply_len = -1; | ||||||
| --- a/wpa_supplicant/Makefile | Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/Makefile | ||||||
| +++ b/wpa_supplicant/Makefile | =================================================================== | ||||||
| @@ -942,6 +942,9 @@ ifdef CONFIG_FILS | --- 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 |  OBJS += ../src/ap/fils_hlp.o | ||||||
|  endif |  endif | ||||||
|  ifdef CONFIG_CTRL_IFACE |  ifdef CONFIG_CTRL_IFACE | ||||||
| @@ -40,9 +46,11 @@ | |||||||
|  OBJS += ../src/ap/ctrl_iface_ap.o |  OBJS += ../src/ap/ctrl_iface_ap.o | ||||||
|  endif |  endif | ||||||
|   |   | ||||||
| --- a/wpa_supplicant/ctrl_iface.c | Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ctrl_iface.c | ||||||
| +++ b/wpa_supplicant/ctrl_iface.c | =================================================================== | ||||||
| @@ -2294,7 +2294,7 @@ static int wpa_supplicant_ctrl_iface_sta | --- 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; |  			pos += ret; | ||||||
|  		} |  		} | ||||||
|   |   | ||||||
| @@ -51,7 +59,7 @@ | |||||||
|  		if (wpa_s->ap_iface) { |  		if (wpa_s->ap_iface) { | ||||||
|  			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, |  			pos += ap_ctrl_iface_wpa_get_status(wpa_s, pos, | ||||||
|  							    end - 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; |  			reply_len = -1; | ||||||
|  	} else if (os_strncmp(buf, "NOTE ", 5) == 0) { |  	} else if (os_strncmp(buf, "NOTE ", 5) == 0) { | ||||||
|  		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); |  		wpa_printf(MSG_INFO, "NOTE: %s", buf + 5); | ||||||
| @@ -59,7 +67,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "MIB") == 0) { |  	} else if (os_strcmp(buf, "MIB") == 0) { | ||||||
|  		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); |  		reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size); | ||||||
|  		if (reply_len >= 0) { |  		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); |  				reply_size - reply_len); | ||||||
|  #endif /* CONFIG_MACSEC */ |  #endif /* CONFIG_MACSEC */ | ||||||
|  		} |  		} | ||||||
| @@ -67,7 +75,7 @@ | |||||||
|  	} else if (os_strncmp(buf, "STATUS", 6) == 0) { |  	} else if (os_strncmp(buf, "STATUS", 6) == 0) { | ||||||
|  		reply_len = wpa_supplicant_ctrl_iface_status( |  		reply_len = wpa_supplicant_ctrl_iface_status( | ||||||
|  			wpa_s, buf + 6, reply, reply_size); |  			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( |  		reply_len = wpa_supplicant_ctrl_iface_bss( | ||||||
|  			wpa_s, buf + 4, reply, reply_size); |  			wpa_s, buf + 4, reply, reply_size); | ||||||
|  #ifdef CONFIG_AP |  #ifdef CONFIG_AP | ||||||
| @@ -75,7 +83,7 @@ | |||||||
|  	} else if (os_strcmp(buf, "STA-FIRST") == 0) { |  	} else if (os_strcmp(buf, "STA-FIRST") == 0) { | ||||||
|  		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); |  		reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size); | ||||||
|  	} else if (os_strncmp(buf, "STA ", 4) == 0) { |  	} 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) { |  	} else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) { | ||||||
|  		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, |  		reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply, | ||||||
|  						   reply_size); |  						   reply_size); | ||||||
| @@ -91,17 +99,19 @@ | |||||||
|  	} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { |  	} else if (os_strncmp(buf, "CHAN_SWITCH ", 12) == 0) { | ||||||
|  		if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12)) |  		if (ap_ctrl_iface_chanswitch(wpa_s, buf + 12)) | ||||||
|  			reply_len = -1; |  			reply_len = -1; | ||||||
| --- a/src/ap/ctrl_iface_ap.c | Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ctrl_iface_ap.c | ||||||
| +++ b/src/ap/ctrl_iface_ap.c | =================================================================== | ||||||
| @@ -25,6 +25,7 @@ | --- hostapd-2023-02-21-ath12.3-cs.orig/src/ap/ctrl_iface_ap.c | ||||||
|  #include "mbo_ap.h" | +++ hostapd-2023-02-21-ath12.3-cs/src/ap/ctrl_iface_ap.c | ||||||
|  | @@ -26,6 +26,7 @@ | ||||||
|  #include "taxonomy.h" |  #include "taxonomy.h" | ||||||
|  |  #include "wnm_ap.h" | ||||||
|   |   | ||||||
| +#ifdef CONFIG_CTRL_IFACE_MIB | +#ifdef CONFIG_CTRL_IFACE_MIB | ||||||
|   |   | ||||||
|  static size_t hostapd_write_ht_mcs_bitmask(char *buf, size_t buflen, |  typedef enum { | ||||||
|  					   size_t curr_len, const u8 *mcs_set) |  	BAND_UNII_1 = 1, | ||||||
| @@ -451,6 +452,7 @@ int hostapd_ctrl_iface_sta_next(struct h | @@ -760,6 +761,7 @@ int hostapd_ctrl_iface_sta_next(struct h | ||||||
|  	return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); |  	return hostapd_ctrl_iface_sta_mib(hapd, sta->next, buf, buflen); | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -109,7 +119,7 @@ | |||||||
|   |   | ||||||
|  #ifdef CONFIG_P2P_MANAGER |  #ifdef CONFIG_P2P_MANAGER | ||||||
|  static int p2p_manager_disconnect(struct hostapd_data *hapd, u16 stype, |  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; |  			return len; | ||||||
|  		len += ret; |  		len += ret; | ||||||
|  	} |  	} | ||||||
| @@ -124,9 +134,11 @@ | |||||||
|  	if (iface->current_rates && iface->num_rates) { |  	if (iface->current_rates && iface->num_rates) { | ||||||
|  		ret = os_snprintf(buf + len, buflen - len, "supported_rates="); |  		ret = os_snprintf(buf + len, buflen - len, "supported_rates="); | ||||||
|  		if (os_snprintf_error(buflen - len, ret)) |  		if (os_snprintf_error(buflen - len, ret)) | ||||||
| --- a/src/ap/ieee802_1x.c | Index: hostapd-2023-02-21-ath12.3-cs/src/ap/ieee802_1x.c | ||||||
| +++ b/src/ap/ieee802_1x.c | =================================================================== | ||||||
| @@ -2712,6 +2712,7 @@ static const char * bool_txt(bool val) | --- 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"; |  	return val ? "TRUE" : "FALSE"; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -134,7 +146,7 @@ | |||||||
|   |   | ||||||
|  int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen) |  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; |  	return len; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -142,9 +154,11 @@ | |||||||
|   |   | ||||||
|  #ifdef CONFIG_HS20 |  #ifdef CONFIG_HS20 | ||||||
|  static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) |  static void ieee802_1x_wnm_notif_send(void *eloop_ctx, void *timeout_ctx) | ||||||
| --- a/src/ap/wpa_auth.c | Index: hostapd-2023-02-21-ath12.3-cs/src/ap/wpa_auth.c | ||||||
| +++ b/src/ap/wpa_auth.c | =================================================================== | ||||||
| @@ -4503,6 +4503,7 @@ static const char * wpa_bool_txt(int val | --- 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"; |  	return val ? "TRUE" : "FALSE"; | ||||||
|  } |  } | ||||||
|   |   | ||||||
| @@ -152,7 +166,7 @@ | |||||||
|   |   | ||||||
|  #define RSN_SUITE "%02x-%02x-%02x-%d" |  #define RSN_SUITE "%02x-%02x-%02x-%d" | ||||||
|  #define RSN_SUITE_ARG(s) \ |  #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; |  	return len; | ||||||
|  } |  } | ||||||
| @@ -161,9 +175,11 @@ | |||||||
|   |   | ||||||
|  void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) |  void wpa_auth_countermeasures_start(struct wpa_authenticator *wpa_auth) | ||||||
|  { |  { | ||||||
| --- a/src/rsn_supp/wpa.c | Index: hostapd-2023-02-21-ath12.3-cs/src/rsn_supp/wpa.c | ||||||
| +++ b/src/rsn_supp/wpa.c | =================================================================== | ||||||
| @@ -2763,6 +2763,8 @@ static u32 wpa_key_mgmt_suite(struct wpa | --- 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 "%02x-%02x-%02x-%d" | ||||||
|  #define RSN_SUITE_ARG(s) \ |  #define RSN_SUITE_ARG(s) \ | ||||||
|  ((s) >> 24) & 0xff, ((s) >> 16) & 0xff, ((s) >> 8) & 0xff, (s) & 0xff |  ((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; |  	return (int) len; | ||||||
|  } |  } | ||||||
| @@ -180,9 +196,11 @@ | |||||||
|  #endif /* CONFIG_CTRL_IFACE */ |  #endif /* CONFIG_CTRL_IFACE */ | ||||||
|   |   | ||||||
|   |   | ||||||
| --- a/wpa_supplicant/ap.c | Index: hostapd-2023-02-21-ath12.3-cs/wpa_supplicant/ap.c | ||||||
| +++ b/wpa_supplicant/ap.c | =================================================================== | ||||||
| @@ -1364,7 +1364,7 @@ int wpas_ap_wps_nfc_report_handover(stru | --- 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 */ |  #endif /* CONFIG_WPS */ | ||||||
|   |   | ||||||
|   |   | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/hostapd/hostapd_cli.c | --- a/hostapd/hostapd_cli.c | ||||||
| +++ b/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'; |  	buf[len] = '\0'; | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/src/common/wpa_common.c | --- a/src/common/wpa_common.c | ||||||
| +++ b/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, |  int wpa_compare_rsn_ie(int ft_initial_assoc, | ||||||
|  		       const u8 *ie1, size_t ie1len, |  		       const u8 *ie1, size_t ie1len, | ||||||
|  		       const u8 *ie2, size_t ie2len) |  		       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) |  	if (ie1 == NULL || ie2 == NULL) | ||||||
|  		return -1; |  		return -1; | ||||||
|   |   | ||||||
|   | |||||||
| @@ -11,7 +11,7 @@ | |||||||
|  			bss->wpa_pairwise |= WPA_CIPHER_TKIP; |  			bss->wpa_pairwise |= WPA_CIPHER_TKIP; | ||||||
|  #endif /* CONFIG_NO_TKIP */ |  #endif /* CONFIG_NO_TKIP */ | ||||||
|  		bss->rsn_pairwise = bss->wpa_pairwise; |  		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)) { |  					  WPA_CIPHER_GCMP_256)) { | ||||||
|  			wps->encr_types |= WPS_ENCR_AES; |  			wps->encr_types |= WPS_ENCR_AES; | ||||||
|  			wps->encr_types_rsn |= WPS_ENCR_AES; |  			wps->encr_types_rsn |= WPS_ENCR_AES; | ||||||
|   | |||||||
| @@ -60,7 +60,7 @@ | |||||||
|  #ifdef CONFIG_DEBUG_FILE |  #ifdef CONFIG_DEBUG_FILE | ||||||
|  static char *last_path = NULL; |  static char *last_path = NULL; | ||||||
|  #endif /* CONFIG_DEBUG_FILE */ |  #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; |  	va_list ap; | ||||||
|  	char *buf; |  	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; |  	char *buf; | ||||||
| --- a/src/utils/wpa_debug.h | --- a/src/utils/wpa_debug.h | ||||||
| +++ b/src/utils/wpa_debug.h | +++ b/src/utils/wpa_debug.h | ||||||
| @@ -50,6 +50,17 @@ int wpa_debug_reopen_file(void); | @@ -51,6 +51,17 @@ void wpa_debug_close_file(void); | ||||||
|  void wpa_debug_close_file(void); |  | ||||||
|  void wpa_debug_setup_stdout(void); |  void wpa_debug_setup_stdout(void); | ||||||
|  |  void wpa_debug_stop_log(void); | ||||||
|   |   | ||||||
| +/* internal */ | +/* internal */ | ||||||
| +void _wpa_hexdump(int level, const char *title, const u8 *buf, | +void _wpa_hexdump(int level, const char *title, const u8 *buf, | ||||||
| @@ -98,7 +98,7 @@ | |||||||
|  /** |  /** | ||||||
|   * wpa_debug_printf_timestamp - Print timestamp for debug output |   * 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. |   * 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 |   * wpa_hexdump - conditional hex dump | ||||||
|   * @level: priority level (MSG_*) of the message |   * @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 |   * output may be directed to stdout, stderr, and/or syslog based on | ||||||
|   * configuration. The contents of buf is printed out has hex dump. |   * 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, |  static inline void wpa_hexdump_buf(int level, const char *title, | ||||||
|  				   const struct wpabuf *buf) |  				   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, |   * like wpa_hexdump(), but by default, does not include secret keys (passwords, | ||||||
|   * etc.) in debug output. |   * etc.) in debug output. | ||||||
|   */ |   */ | ||||||
| @@ -145,7 +145,7 @@ | |||||||
|   |   | ||||||
|  static inline void wpa_hexdump_buf_key(int level, const char *title, |  static inline void wpa_hexdump_buf_key(int level, const char *title, | ||||||
|  				       const struct wpabuf *buf) |  				       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 |   * the hex numbers and ASCII characters (for printable range) are shown. 16 | ||||||
|   * bytes per line will be shown. |   * bytes per line will be shown. | ||||||
|   */ |   */ | ||||||
| @@ -162,7 +162,7 @@ | |||||||
|   |   | ||||||
|  /** |  /** | ||||||
|   * wpa_hexdump_ascii_key - conditional hex dump, hide keys |   * 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 |   * 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. |   * 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 |   * 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. |   * 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 |   * 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 |   * attached ctrl_iface monitors. In other words, it can be used for frequent | ||||||
|   * events that do not need to be sent to syslog. |   * events that do not need to be sent to syslog. | ||||||
|   */ |   */ | ||||||
|   | |||||||
| @@ -1,23 +1,24 @@ | |||||||
| --- a/hostapd/main.c | --- a/hostapd/main.c | ||||||
| +++ b/hostapd/main.c | +++ b/hostapd/main.c | ||||||
| @@ -15,6 +15,7 @@ | @@ -31,7 +31,7 @@ | ||||||
|  #include "utils/common.h" |  #include "config_file.h" | ||||||
|  #include "utils/eloop.h" |  #include "eap_register.h" | ||||||
|  #include "utils/uuid.h" |  #include "ctrl_iface.h" | ||||||
| +#include "utils/build_features.h" | - | ||||||
|  #include "crypto/random.h" | +#include "build_features.h" | ||||||
|  #include "crypto/tls.h" |   | ||||||
|  #include "common/version.h" |  struct hapd_global { | ||||||
| @@ -691,7 +692,7 @@ int main(int argc, char *argv[]) |  	void **drv_priv; | ||||||
|  | @@ -799,7 +799,7 @@ int main(int argc, char *argv[]) | ||||||
|  	wpa_supplicant_event = hostapd_wpa_event; |  	wpa_supplicant_event = hostapd_wpa_event; | ||||||
|  	wpa_supplicant_event_global = hostapd_wpa_event_global; |  	wpa_supplicant_event_global = hostapd_wpa_event_global; | ||||||
|  	for (;;) { |  	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"); | ||||||
| +		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:v::"); | +		c = getopt(argc, argv, "b:Bde:f:hi:KP:sSTtu:g:G:qv::"); | ||||||
|  		if (c < 0) |  		if (c < 0) | ||||||
|  			break; |  			break; | ||||||
|  		switch (c) { |  		switch (c) { | ||||||
| @@ -728,6 +729,8 @@ int main(int argc, char *argv[]) | @@ -836,6 +836,8 @@ int main(int argc, char *argv[]) | ||||||
|  			break; |  			break; | ||||||
|  #endif /* CONFIG_DEBUG_LINUX_TRACING */ |  #endif /* CONFIG_DEBUG_LINUX_TRACING */ | ||||||
|  		case 'v': |  		case 'v': | ||||||
| @@ -25,7 +26,7 @@ | |||||||
| +				exit(!has_feature(optarg)); | +				exit(!has_feature(optarg)); | ||||||
|  			show_version(); |  			show_version(); | ||||||
|  			exit(1); |  			exit(1); | ||||||
|  			break; |  		case 'g': | ||||||
| --- a/wpa_supplicant/main.c | --- a/wpa_supplicant/main.c | ||||||
| +++ b/wpa_supplicant/main.c | +++ b/wpa_supplicant/main.c | ||||||
| @@ -12,6 +12,7 @@ | @@ -12,6 +12,7 @@ | ||||||
| @@ -33,10 +34,10 @@ | |||||||
|   |   | ||||||
|  #include "common.h" |  #include "common.h" | ||||||
| +#include "build_features.h" | +#include "build_features.h" | ||||||
|  |  #include "crypto/crypto.h" | ||||||
|  #include "fst/fst.h" |  #include "fst/fst.h" | ||||||
|  #include "wpa_supplicant_i.h" |  #include "wpa_supplicant_i.h" | ||||||
|  #include "driver_i.h" | @@ -202,7 +203,7 @@ int main(int argc, char *argv[]) | ||||||
| @@ -201,7 +202,7 @@ int main(int argc, char *argv[]) |  | ||||||
|   |   | ||||||
|  	for (;;) { |  	for (;;) { | ||||||
|  		c = getopt(argc, argv, |  		c = getopt(argc, argv, | ||||||
| @@ -45,7 +46,7 @@ | |||||||
|  		if (c < 0) |  		if (c < 0) | ||||||
|  			break; |  			break; | ||||||
|  		switch (c) { |  		switch (c) { | ||||||
| @@ -301,8 +302,12 @@ int main(int argc, char *argv[]) | @@ -302,8 +303,12 @@ int main(int argc, char *argv[]) | ||||||
|  			break; |  			break; | ||||||
|  #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ |  #endif /* CONFIG_CTRL_IFACE_DBUS_NEW */ | ||||||
|  		case 'v': |  		case 'v': | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| --- a/hostapd/hostapd_cli.c | --- a/hostapd/hostapd_cli.c | ||||||
| +++ b/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, |  static int hostapd_cli_cmd_signature(struct wpa_ctrl *ctrl, int argc, | ||||||
|  				     char *argv[]) |  				     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]); |  	os_snprintf(buf, sizeof(buf), "SIGNATURE %s", argv[0]); | ||||||
|  	return wpa_ctrl_command(ctrl, buf); |  	return wpa_ctrl_command(ctrl, buf); | ||||||
|  } |  } | ||||||
| @@ -16,7 +16,7 @@ | |||||||
|   |   | ||||||
|   |   | ||||||
|  static int hostapd_cli_cmd_sa_query(struct wpa_ctrl *ctrl, int argc, |  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, |  static int hostapd_cli_cmd_wps_pin(struct wpa_ctrl *ctrl, int argc, | ||||||
|  				   char *argv[]) |  				   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]); |  			 ssid_hex, argv[1]); | ||||||
|  	return wpa_ctrl_command(ctrl, buf); |  	return wpa_ctrl_command(ctrl, buf); | ||||||
|  } |  } | ||||||
| @@ -32,7 +32,7 @@ | |||||||
|   |   | ||||||
|   |   | ||||||
|  static int hostapd_cli_cmd_disassoc_imminent(struct wpa_ctrl *ctrl, int argc, |  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, |  	{ "disassociate", hostapd_cli_cmd_disassociate, | ||||||
|  	  hostapd_complete_stations, |  	  hostapd_complete_stations, | ||||||
|  	  "<addr> = disassociate a station" }, |  	  "<addr> = disassociate a station" }, | ||||||
| @@ -46,7 +46,7 @@ | |||||||
|  	{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL, |  	{ "wps_pin", hostapd_cli_cmd_wps_pin, NULL, | ||||||
|  	  "<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" }, |  	  "<uuid> <pin> [timeout] [addr] = add WPS Enrollee PIN" }, | ||||||
|  	{ "wps_check_pin", hostapd_cli_cmd_wps_check_pin, NULL, |  	{ "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" }, |  	  "<SSID> <auth> <encr> <key> = configure AP" }, | ||||||
|  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, |  	{ "wps_get_status", hostapd_cli_cmd_wps_get_status, NULL, | ||||||
|  	  "= show current WPS status" }, |  	  "= show current WPS status" }, | ||||||
|   | |||||||
Some files were not shown because too many files have changed in this diff Show More
		Reference in New Issue
	
	Block a user