mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Compare commits
64 Commits
v3.2.1
...
staging-WI
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e0d3acbfb | ||
|
|
e9f69e74e0 | ||
|
|
3b8df41c2c | ||
|
|
4d569ed907 | ||
|
|
b4a7cca81d | ||
|
|
dbdc16804d | ||
|
|
98375061da | ||
|
|
e3edb1fdd5 | ||
|
|
68cf54d9f7 | ||
|
|
28161aff6e | ||
|
|
c2ea273bea | ||
|
|
9d611028fd | ||
|
|
24dbba4c5a | ||
|
|
4c84a3dbdd | ||
|
|
664fa78572 | ||
|
|
26e782627b | ||
|
|
9105d688b9 | ||
|
|
a9694847cd | ||
|
|
426943c1c0 | ||
|
|
6014103032 | ||
|
|
56eee37052 | ||
|
|
7374c39dea | ||
|
|
b77e80cf14 | ||
|
|
7544c1921b | ||
|
|
2d45944ba3 | ||
|
|
58d0932dee | ||
|
|
4f0f25ad05 | ||
|
|
b74f824b3a | ||
|
|
3e7fd62fc2 | ||
|
|
4050db8ed6 | ||
|
|
8b5a449f6d | ||
|
|
55e3e90513 | ||
|
|
0d1ea98328 | ||
|
|
aaaef76d7d | ||
|
|
4b09108f72 | ||
|
|
c02b5922d9 | ||
|
|
9d54cda767 | ||
|
|
1f10af2355 | ||
|
|
0df07d514e | ||
|
|
9587fb3fee | ||
|
|
4d4d356c1f | ||
|
|
64b1f96721 | ||
|
|
f3f070acb1 | ||
|
|
aa909d9ab8 | ||
|
|
1de1426a80 | ||
|
|
8279bae9db | ||
|
|
3554480103 | ||
|
|
e4b535f6cb | ||
|
|
ed7e047514 | ||
|
|
7ced0ea2cc | ||
|
|
a3a957f688 | ||
|
|
afcaa6dea2 | ||
|
|
605406e191 | ||
|
|
d639c02ec1 | ||
|
|
cf45b65214 | ||
|
|
258c26e7e6 | ||
|
|
ed4f03a1a9 | ||
|
|
7477963b1f | ||
|
|
1cf48ae6d9 | ||
|
|
77144209e9 | ||
|
|
71315b140a | ||
|
|
8332ba86e1 | ||
|
|
6a94323a59 | ||
|
|
3d43f4fc95 |
11
.github/workflows/build-dev.yml
vendored
11
.github/workflows/build-dev.yml
vendored
@@ -15,21 +15,20 @@ on:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
outputs:
|
||||
x64_vm_image_name: ${{ steps.package_and_upload_image.outputs.x64_vm_image_name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf189', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'cybertan_rap63xc-211g','sonicfi_rap630c-311g', 'sonicfi_rap630w-311g', 'sonicfi_rap630w-211g', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap105', 'edgecore_eap111', 'edgecore_eap112', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'sercomm_ap72tip', 'udaya_a6-id2', 'udaya_a6-od2', 'wallys_dr5018', 'wallys_dr6018', 'wallys_dr6018-v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
|
||||
|
||||
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'cybertan_rap630w-312g', 'cybertan_rap63xc-211g', 'sonicfi_rap630c-311g', 'sonicfi_rap630w-311g', 'sonicfi_rap630w-211g', 'sonicfi_rap7110c-341x', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap105', 'edgecore_eap111', 'edgecore_eap112', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4x_3', 'hfcl_ion4xi_w', 'hfcl_ion4x_w', 'indio_um-305ax', 'senao_iap4300m', 'senao_jeap6500', 'sercomm_ap72tip', 'udaya_a6-id2', 'udaya_a6-od2', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# Clean unnecessary files to save disk space
|
||||
- name: clean unncessary files to save space
|
||||
run: |
|
||||
docker rmi `docker images -q`
|
||||
docker rmi `docker images -q` || true
|
||||
|
||||
- name: Build image for ${{ matrix.target }}
|
||||
id: build
|
||||
@@ -81,7 +80,7 @@ jobs:
|
||||
fi
|
||||
|
||||
trigger-testing:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
@@ -94,7 +93,7 @@ jobs:
|
||||
client-payload: '{"ref": "${GITHUB_REF#refs/tags/}", "sha": "${{ github.sha }}"}'
|
||||
|
||||
create-x64_vm-ami:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-22.04
|
||||
needs: build
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
steps:
|
||||
|
||||
33
feeds/indio/indio/Makefile
Normal file
33
feeds/indio/indio/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=indio
|
||||
PKG_VERSION:=1.0
|
||||
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
define Package/indio
|
||||
SECTION:=base
|
||||
CATEGORY:=Utilities
|
||||
TITLE:=indio Package
|
||||
DEPENDS:=+base-files
|
||||
endef
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile/Default
|
||||
|
||||
endef
|
||||
|
||||
Build/Compile = $(Build/Compile/Default)
|
||||
|
||||
define Package/indio/install
|
||||
cp -rf ./files/* $(1)
|
||||
$(INSTALL_DIR) $(1)/etc
|
||||
$(INSTALL_DATA) ./files/rc.local $(1)/etc/rc.local
|
||||
$(INSTALL_DATA) ./files/sys_led.sh $(1)/bin/sys_led.sh
|
||||
$(INSTALL_DATA) ./files/hwwatchdog.sh $(1)/bin/hwwatchdog.sh
|
||||
endef
|
||||
$(eval $(call BuildPackage,indio))
|
||||
8
feeds/indio/indio/files/bin/hwwatchdog.sh
Executable file
8
feeds/indio/indio/files/bin/hwwatchdog.sh
Executable file
@@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
while [ 1 ]; do
|
||||
echo 1 > /sys/class/leds/hwwatchdog/brightness
|
||||
sleep 1
|
||||
echo 0 > /sys/class/leds/hwwatchdog/brightness
|
||||
sleep 1
|
||||
done
|
||||
|
||||
69
feeds/indio/indio/files/bin/sys_led.sh
Executable file
69
feeds/indio/indio/files/bin/sys_led.sh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Maximum number of retries
|
||||
max_retries=5
|
||||
|
||||
# Delay between retries (in seconds)
|
||||
retry_delay=1
|
||||
|
||||
# Function to turn on the LED (green)
|
||||
turn_on_green_led()
|
||||
{
|
||||
echo "1" > /sys/class/leds/led_2g/brightness
|
||||
echo "0" > /sys/class/leds/led_5g/brightness
|
||||
echo "0" > /sys/class/leds/led_sys/brightness
|
||||
|
||||
}
|
||||
|
||||
# Function to turn on the LED (red)
|
||||
turn_on_blue_led()
|
||||
{
|
||||
echo "1" > /sys/class/leds/led_2g/brightness
|
||||
echo "1" > /sys/class/leds/led_5g/brightness
|
||||
echo "0" > /sys/class/leds/led_sys/brightness
|
||||
}
|
||||
|
||||
turn_on_pink_led()
|
||||
{
|
||||
|
||||
echo "0" > /sys/class/leds/led_2g/brightness
|
||||
echo "1" > /sys/class/leds/led_5g/brightness
|
||||
echo "1" > /sys/class/leds/led_sys/brightness
|
||||
}
|
||||
|
||||
# Function to check internet connectivity
|
||||
check_internet()
|
||||
{
|
||||
if ping -q -c 1 -W 1 8.8.8.8 > /dev/null; then
|
||||
# echo "Internet is working"
|
||||
return 0
|
||||
else
|
||||
# echo "Internet is not working"
|
||||
return 1
|
||||
fi
|
||||
}
|
||||
|
||||
# Main loop to continuously check internet connectivity
|
||||
while true; do
|
||||
# Attempt to check internet connectivity with retries
|
||||
attempt=1
|
||||
while [ $attempt -le $max_retries ]; do
|
||||
#echo "Attempt $attempt:"
|
||||
if check_internet; then
|
||||
turn_on_green_led
|
||||
break # Exit the retry loop if internet is working
|
||||
fi
|
||||
attempt=$(( attempt + 1 ))
|
||||
sleep $retry_delay
|
||||
|
||||
done
|
||||
|
||||
# If all attempts fail, turn on red LED and continue loop
|
||||
if [ $attempt -gt $max_retries ]; then
|
||||
turn_on_blue_led
|
||||
fi
|
||||
|
||||
# Sleep before the next iteration
|
||||
sleep 10
|
||||
done
|
||||
|
||||
5
feeds/indio/indio/files/etc/rc.local
Executable file
5
feeds/indio/indio/files/etc/rc.local
Executable file
@@ -0,0 +1,5 @@
|
||||
# Put your custom commands here that should be executed once
|
||||
# the system init finished. By default this file does nothing.
|
||||
/bin/sh /bin/hwwatchdog.sh &
|
||||
/bin/sh /bin/sys_led.sh &
|
||||
exit 0
|
||||
@@ -45,6 +45,7 @@ ALLWIFIBOARDS:= \
|
||||
indio-um-310ax-v1 \
|
||||
indio-um-510axp-v1 \
|
||||
indio-um-510axm-v1 \
|
||||
indio-um-525axm \
|
||||
muxi-ap3220l \
|
||||
plasmacloud-pax1800 \
|
||||
wallys-dr5018 \
|
||||
@@ -404,6 +405,7 @@ $(eval $(call generate-ath11k-wifi-package,edgecore-oap102,Edgecore OAP102))
|
||||
$(eval $(call generate-ath11k-wifi-package,edgecore-eap104,Edgecore EAP104))
|
||||
$(eval $(call generate-ath11k-wifi-package,liteon-wpx8324,Liteon WPX8324))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-310ax-v1,Indio UM-310AX V1))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-525axm,Indio UM-525AXM))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-510axp-v1,Indio UM-510AXP V1))
|
||||
$(eval $(call generate-ath11k-wifi-package,indio-um-510axm-v1,Indio UM-510AXM V1))
|
||||
$(eval $(call generate-ath11k-wifi-package,sonicfi-rap630c-311g,Sonicfi RAP630C 311G))
|
||||
|
||||
Binary file not shown.
Binary file not shown.
BIN
feeds/ipq807x_v5.4/ath11k-wifi/board-indio-um-525axm.bin.IPQ5018
Normal file
BIN
feeds/ipq807x_v5.4/ath11k-wifi/board-indio-um-525axm.bin.IPQ5018
Normal file
Binary file not shown.
BIN
feeds/ipq807x_v5.4/ath11k-wifi/board-indio-um-525axm.bin.QCN6122
Normal file
BIN
feeds/ipq807x_v5.4/ath11k-wifi/board-indio-um-525axm.bin.QCN6122
Normal file
Binary file not shown.
@@ -10,11 +10,12 @@ case "$board" in
|
||||
wallys,dr5018)
|
||||
ucidef_set_led_netdev "wan" "wan" "green:uplink" "eth0"
|
||||
;;
|
||||
edgecore,eap104)
|
||||
edgecore,eap104|\
|
||||
indio,um-525axm)
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy1tpt"
|
||||
ucidef_set_led_netdev "wan" "wan" "yellow:uplink" "eth0"
|
||||
ucidef_set_led_default "power" "POWER" "green:power" "on"
|
||||
# ucidef_set_led_default "power" "POWER" "green:power" "on"
|
||||
;;
|
||||
cig,wf186h|\
|
||||
cig,wf186w)
|
||||
|
||||
@@ -27,10 +27,6 @@ qcom_setup_interfaces()
|
||||
cybertan,eww631-b1)
|
||||
ucidef_add_switch "switch1" "5:wan" "2:lan" "3:lan" "4:lan" "6@eth0"
|
||||
;;
|
||||
cybertan,rap630w-312g)
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
||||
;;
|
||||
udaya,a6-id2)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_set_interface_lan "eth0"
|
||||
@@ -52,6 +48,12 @@ qcom_setup_interfaces()
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
||||
;;
|
||||
indio,um-525axm)
|
||||
ucidef_set_interface_wan "eth1"
|
||||
ucidef_set_interface_lan "eth0"
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth1" "1:lan" "2:lan" "3:lan" "4:lan"
|
||||
;;
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w)
|
||||
ucidef_set_interface_wan "eth0"
|
||||
@@ -63,6 +65,7 @@ qcom_setup_interfaces()
|
||||
ucidef_set_interface_wan "eth0"
|
||||
ucidef_set_interface_lan "eth1"
|
||||
;;
|
||||
cybertan,rap630w-312g|\
|
||||
yuncore,fap655)
|
||||
ucidef_add_switch "switch1" \
|
||||
"6@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "5:wan"
|
||||
|
||||
@@ -131,6 +131,7 @@ ath11k/IPQ5018/hw1.0/caldata.bin)
|
||||
edgecore,oap101e-6e|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w|\
|
||||
indio,um-525xm|\
|
||||
optimcloud,d60|\
|
||||
optimcloud,d60-5g|\
|
||||
optimcloud,d50|\
|
||||
@@ -171,7 +172,8 @@ ath11k/qcn6122/hw1.0/caldata_2.bin)
|
||||
wallys,dr5018|\
|
||||
edgecore,eap104|\
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e-6e)
|
||||
edgecore,oap101e-6e|\
|
||||
indio,um-525axm)
|
||||
caldata_extract "0:ART" 0x4c000 0x20000
|
||||
;;
|
||||
sonicfi,rap630c-311g|\
|
||||
@@ -220,7 +222,8 @@ ath11k-macs)
|
||||
optimcloud,d50|\
|
||||
optimcloud,d50-5g|\
|
||||
cybertan,rap630w-312g|\
|
||||
yuncore,fap655)
|
||||
yuncore,fap655|\
|
||||
indio,um-525axm)
|
||||
ath11k_generate_macs
|
||||
;;
|
||||
hfcl,ion4x_w|\
|
||||
|
||||
@@ -79,6 +79,7 @@ platform_check_image() {
|
||||
wallys,dr5018|\
|
||||
hfcl,ion4x_w|\
|
||||
hfcl,ion4xi_w|\
|
||||
indio,um-525axm|\
|
||||
optimcloud,d60|\
|
||||
optimcloud,d60-5g|\
|
||||
optimcloud,d50|\
|
||||
@@ -109,7 +110,8 @@ platform_do_upgrade() {
|
||||
edgecore,oap101-6e|\
|
||||
edgecore,oap101e|\
|
||||
edgecore,oap101e-6e|\
|
||||
edgecore,eap104)
|
||||
edgecore,eap104|\
|
||||
indio,um-525axm)
|
||||
CI_UBIPART="rootfs1"
|
||||
[ "$(find_mtd_chardev rootfs)" ] && CI_UBIPART="rootfs"
|
||||
nand_upgrade_tar "$1"
|
||||
|
||||
3
feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-a1.dts
Normal file → Executable file
3
feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-a1.dts
Normal file → Executable file
@@ -817,10 +817,9 @@
|
||||
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-addr = <0x4D300000 0x4D300000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
1235
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
|
||||
78
feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-b1.dts
Normal file → Executable file
78
feeds/ipq807x_v5.4/ipq50xx/files/arch/arm64/boot/dts/qcom/qcom-ipq5018-eww631-b1.dts
Normal file → Executable file
@@ -173,40 +173,40 @@
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* | Caldb | 0x4D300000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* | data | 0x4D500000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* | Caldb | 0x4E400000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* | data | 0x4E900000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* | M3 Dump | 0x4F600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* | QDSS | 0x4F700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* | Caldb | 0x4F800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
@@ -215,7 +215,7 @@
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
reg = <0x0 0x4B000000 0x0 0x4D00000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
@@ -225,62 +225,62 @@
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
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_etr_region: q6_etr_dump@4D300000 {
|
||||
q6_caldb_region: q6_caldb_region@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
reg = <0x0 0x4D300000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D500000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
reg = <0x0 0x4D500000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
reg = <0x0 0x4E900000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
reg = <0x0 0x4F600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
reg = <0x0 0x4F700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4F800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -883,8 +883,8 @@
|
||||
#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,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
|
||||
@@ -0,0 +1,940 @@
|
||||
/dts-v1/;
|
||||
/* Copyright (c) 2018-2020, The Linux Foundation. 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"
|
||||
#include <dt-bindings/input/input.h>
|
||||
|
||||
/ {
|
||||
#address-cells = <0x2>;
|
||||
#size-cells = <0x2>;
|
||||
model = "Indio UM-525axm";
|
||||
compatible = "indio,um-525axm", "qcom,ipq5018-mp03.5-c1", "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";
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
bootargs-append = " swiotlb=1";
|
||||
#else
|
||||
bootargs-append = " swiotlb=1 coherent_pool=2M";
|
||||
#endif
|
||||
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 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4E400000 | 15MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4F300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4F400000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
* | |
|
||||
* +===================================================+
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x4500000>;
|
||||
};
|
||||
|
||||
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 0xF00000>;
|
||||
};
|
||||
|
||||
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_data2: q6_qcn6122_data2@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E400000 0x0 0xF00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4F400000 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 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";
|
||||
};
|
||||
};
|
||||
ess-switch1@1 {
|
||||
compatible = "qcom,ess-switch-qca83xx";
|
||||
device_id = <1>;
|
||||
switch_access_mode = "mdio";
|
||||
mdio-bus = <&mdio1>;
|
||||
reset_gpio = <0x28>;
|
||||
switch_cpu_bmp = <0x40>; /* cpu port bitmap */
|
||||
switch_lan_bmp = <0x1e>; /* 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 = <28>;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
|
||||
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,test@0 {
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
nss-macsec1 {
|
||||
compatible = "qcom,nss-macsec";
|
||||
phy_addr = <0x1c>;
|
||||
mdiobus = <&mdio1>;
|
||||
};
|
||||
|
||||
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 &phy_led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
blsp0_uart_pins: 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 = "gpio22", "gpio24", "gpio23", "gpio25";
|
||||
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_0 {
|
||||
pins = "gpio7";
|
||||
function = "qspi0";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_1 {
|
||||
pins = "gpio6";
|
||||
function = "qspi1";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_2 {
|
||||
pins = "gpio5";
|
||||
function = "qspi2";
|
||||
drive-strength = <8>;
|
||||
bias-disable;
|
||||
};
|
||||
qspi_data_3 {
|
||||
pins = "gpio4";
|
||||
function = "qspi3";
|
||||
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 = "gpio38";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
audio_pins: audio_pinmux {
|
||||
};
|
||||
leds_pins: leds_pins {
|
||||
led_5g {
|
||||
pins = "gpio34";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_2g {
|
||||
pins = "gpio33";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_sys {
|
||||
pins = "gpio26";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
hwwatchdog {
|
||||
pins = "gpio27";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_onekey {
|
||||
pins = "gpio28";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
&soc {
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
button@1 {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 38 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@33 {
|
||||
label = "led_5g";
|
||||
gpios = <&tlmm 34 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_5g";
|
||||
default-state = "off";
|
||||
};
|
||||
led@34 {
|
||||
label = "led_2g";
|
||||
gpios = <&tlmm 33 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_2g";
|
||||
default-state = "off";
|
||||
};
|
||||
led@26 {
|
||||
label = "led_sys";
|
||||
gpios = <&tlmm 26 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_sys";
|
||||
default-state = "on";
|
||||
};
|
||||
hwwatchdog {
|
||||
label = "hwwatchdog";
|
||||
gpios = <&tlmm 27 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "hwwatchdog";
|
||||
default-state = "on";
|
||||
};
|
||||
led@28 {
|
||||
label = "led_onekey";
|
||||
gpios = <&tlmm 28 GPIO_ACTIVE_LOW>;
|
||||
linux,default-trigger = "led_onekey";
|
||||
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 = "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 = <0x4D400000 0x4D400000 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_userpd2";
|
||||
qcom,rproc = <&q6_wcss_pd2>;
|
||||
#ifdef __IPQ_MEM_PROFILE_256_MB__
|
||||
qcom,tgt-mem-mode = <2>;
|
||||
#else
|
||||
qcom,tgt-mem-mode = <1>;
|
||||
#endif
|
||||
qcom,board_id = <0x50>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4D600000 0x4D600000 0x4D300000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4E800000 0x4E800000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data1>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data1>;
|
||||
#endif
|
||||
status = "disabled";
|
||||
};
|
||||
|
||||
&wifi2 {
|
||||
/* QCN6122 6G */
|
||||
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 = <0xb0>;
|
||||
#ifdef __CNSS2__
|
||||
qcom,bdf-addr = <0x4ED00000 0x4ED00000 0x4E400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4FF00000 0x4FF00000 0 0 0>;
|
||||
qcom,caldb-size = <0x500000>;
|
||||
mem-region = <&q6_qcn6122_data2>;
|
||||
#else
|
||||
memory-region = <&q6_qcn6122_data2>;
|
||||
#endif
|
||||
status = "ok";
|
||||
};
|
||||
|
||||
|
||||
&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 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 18 1>;
|
||||
perst-gpio = <&tlmm 18 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
&pcie_x2 {
|
||||
#status = "disabled";
|
||||
#perst-gpio = <&tlmm 15 1>;
|
||||
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 >;
|
||||
|
||||
};
|
||||
};
|
||||
|
||||
@@ -816,10 +816,9 @@
|
||||
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-addr = <0x4D300000 0x4D300000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
1235
|
||||
#else
|
||||
memory-region = <&q6_ipq5018_data>;
|
||||
#endif
|
||||
|
||||
@@ -175,40 +175,40 @@
|
||||
* | data | | |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | data | 0x4C400000 | 14MB |
|
||||
* | data | 0x4C400000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | M3 Dump | 0x4D200000 | 1MB |
|
||||
* | M3 Dump | 0x4D100000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | QDSS | 0x4D300000 | 1MB |
|
||||
* | QDSS | 0x4D200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | IPQ5018 | | |
|
||||
* | Caldb | 0x4D400000 | 2MB |
|
||||
* | Caldb | 0x4D300000 | 2MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | data | 0x4D600000 | 16MB |
|
||||
* | data | 0x4D500000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | M3 Dump | 0x4E600000 | 1MB |
|
||||
* | M3 Dump | 0x4E200000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | QDSS | 0x4E700000 | 1MB |
|
||||
* | QDSS | 0x4E300000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_1| | |
|
||||
* | Caldb | 0x4E800000 | 5MB |
|
||||
* | Caldb | 0x4E400000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | data | 0x4ED00000 | 16MB |
|
||||
* | data | 0x4E900000 | 13MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | M3 Dump | 0x4FD00000 | 1MB |
|
||||
* | M3 Dump | 0x4F600000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | QDSS | 0x4FE00000 | 1MB |
|
||||
* | QDSS | 0x4F700000 | 1MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | QCN6122_2| | |
|
||||
* | Caldb | 0x4FF00000 | 5MB |
|
||||
* | Caldb | 0x4F800000 | 5MB |
|
||||
* +----------+--------------+-------------------------+
|
||||
* | |
|
||||
* | Rest of the memory for Linux |
|
||||
@@ -217,7 +217,7 @@
|
||||
*/
|
||||
q6_mem_regions: q6_mem_regions@4B000000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4B000000 0x0 0x5400000>;
|
||||
reg = <0x0 0x4B000000 0x0 0x4D00000>;
|
||||
};
|
||||
|
||||
q6_code_data: q6_code_data@4B000000 {
|
||||
@@ -227,62 +227,62 @@
|
||||
|
||||
q6_ipq5018_data: q6_ipq5018_data@4C400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4C400000 0x0 0xE00000>;
|
||||
reg = <0x0 0x4C400000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump: m3_dump@4D200000 {
|
||||
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_etr_region: q6_etr_dump@4D300000 {
|
||||
q6_caldb_region: q6_caldb_region@4D300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D300000 0x0 0x100000>;
|
||||
reg = <0x0 0x4D300000 0x0 0x200000>;
|
||||
};
|
||||
|
||||
q6_caldb_region: q6_caldb_region@4D400000 {
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D500000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D400000 0x0 0x200000>;
|
||||
reg = <0x0 0x4D500000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data1: q6_qcn6122_data1@4D600000 {
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E200000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4D600000 0x0 0x1000000>;
|
||||
reg = <0x0 0x4E200000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_1: m3_dump_qcn6122_1@4E600000 {
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E300000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E600000 0x0 0x100000>;
|
||||
reg = <0x0 0x4E300000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_1: q6_qcn6122_etr_1@4E700000 {
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E400000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_1: q6_qcn6122_caldb_1@4E800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4E800000 0x0 0x500000>;
|
||||
reg = <0x0 0x4E400000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_data2: q6_qcn6122_data2@4E900000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4ED00000 0x0 0x1000000>;
|
||||
reg = <0x0 0x4E900000 0x0 0xD00000>;
|
||||
};
|
||||
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4FD00000 {
|
||||
m3_dump_qcn6122_2: m3_dump_qcn6122_2@4F600000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FD00000 0x0 0x100000>;
|
||||
reg = <0x0 0x4F600000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4FE00000 {
|
||||
q6_qcn6122_etr_2: q6_qcn6122_etr_2@4F700000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FE00000 0x0 0x100000>;
|
||||
reg = <0x0 0x4F700000 0x0 0x100000>;
|
||||
};
|
||||
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4FF00000 {
|
||||
q6_qcn6122_caldb_2: q6_qcn6122_caldb_2@4F800000 {
|
||||
no-map;
|
||||
reg = <0x0 0x4FF00000 0x0 0x500000>;
|
||||
reg = <0x0 0x4F800000 0x0 0x500000>;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -894,8 +894,8 @@
|
||||
#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,bdf-addr = <0x4C400000 0x4C400000 0x4C400000 0x0 0x0>;
|
||||
qcom,caldb-addr = <0x4D300000 0x4D300000 0 0 0>;
|
||||
qcom,caldb-size = <0x200000>;
|
||||
mem-region = <&q6_ipq5018_data>;
|
||||
#else
|
||||
|
||||
@@ -30,8 +30,7 @@
|
||||
sdhc1 = &sdhc_1; /* SDC1 eMMC slot */
|
||||
serial0 = &blsp1_uart1;
|
||||
serial1 = &blsp1_uart2;
|
||||
ethernet0 = "/soc/dp1";
|
||||
ethernet1 = "/soc/dp2";
|
||||
ethernet1 = "/soc/dp1";
|
||||
|
||||
led-boot = &led_power;
|
||||
led-failsafe = &led_power;
|
||||
@@ -375,7 +374,7 @@
|
||||
port_id = <1>;
|
||||
phy_address = <7>;
|
||||
phy_dac = <0x10 0x10>;
|
||||
mdiobus = <&mdio0>;
|
||||
mdio-bus = <&mdio0>;
|
||||
};
|
||||
port@1 {
|
||||
mdio-bus = <&mdio0>;
|
||||
@@ -441,22 +440,6 @@
|
||||
};
|
||||
|
||||
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";
|
||||
};
|
||||
|
||||
dp2 {
|
||||
device_type = "network";
|
||||
compatible = "qcom,nss-dp";
|
||||
clocks = <&gcc GCC_SNOC_GMAC1_AXI_CLK>;
|
||||
|
||||
@@ -82,6 +82,15 @@ define Device/edgecore_eap104
|
||||
endef
|
||||
TARGET_DEVICES += edgecore_eap104
|
||||
|
||||
define Device/indio_um-525axm
|
||||
DEVICE_TITLE := Indio UM-525axm
|
||||
DEVICE_DTS := qcom-ipq5018-indio-um-525axm
|
||||
SUPPORTED_DEVICES := indio,um-525axm
|
||||
DEVICE_PACKAGES := ath11k-wifi-indio-um-525axm ath11k-firmware-ipq50xx-spruce ath11k-firmware-qcn6122
|
||||
DEVICE_DTS_CONFIG := config@mp03.5-c1
|
||||
endef
|
||||
TARGET_DEVICES += indio_um-525axm
|
||||
|
||||
define Device/udaya_a6_id2
|
||||
DEVICE_TITLE := Udaya A6 - ID2
|
||||
DEVICE_DTS := qcom-ipq5018-udaya-a6-id2
|
||||
|
||||
@@ -15,6 +15,9 @@ cig,wf188n)
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt"
|
||||
ucidef_set_led_default "power" "POWER" "green:power" "on"
|
||||
;;
|
||||
cig,wf660a)
|
||||
ucidef_set_led_default "power" "POWER" "status:blue" "on"
|
||||
;;
|
||||
edgecore,eap101)
|
||||
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wifi5" "phy0tpt"
|
||||
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wifi2" "phy1tpt"
|
||||
|
||||
@@ -11,7 +11,7 @@ boot() {
|
||||
edgecore,eap101|\
|
||||
edgecore,eap102|\
|
||||
edgecore,oap102|\
|
||||
edgecore.eap104)
|
||||
edgecore,eap104)
|
||||
avail=$(fw_printenv -n upgrade_available)
|
||||
[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1
|
||||
fw_setenv bootcount 0
|
||||
|
||||
@@ -145,7 +145,13 @@ platform_do_upgrade() {
|
||||
cig,wf660a)
|
||||
spi_nor_emmc_do_upgrade_bootconfig $1
|
||||
;;
|
||||
cig,wf188n|\
|
||||
cig,wf188n)
|
||||
[ -f /proc/boot_info/rootfs/upgradepartition ] && {
|
||||
CI_UBIPART="$(cat /proc/boot_info/rootfs/upgradepartition)"
|
||||
CI_BOOTCFG=1
|
||||
}
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
glinet,ax1800|\
|
||||
glinet,axt1800|\
|
||||
wallys,dr6018|\
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "ipq6018-cpr-regulator.dtsi"
|
||||
#include <dt-bindings/input/input.h>
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
#include <dt-bindings/pwm/pwm.h>
|
||||
|
||||
/ {
|
||||
compatible = "cig,wf660a", "qcom,ipq6018-ap-cp01", "qcom,ipq6018";
|
||||
@@ -29,6 +28,11 @@
|
||||
ethernet2 = "/soc/dp3";
|
||||
ethernet3 = "/soc/dp4";
|
||||
ethernet4 = "/soc/dp5";
|
||||
|
||||
led-boot = &led_power;
|
||||
led-failsafe = &led_power;
|
||||
led-running = &led_power;
|
||||
led-upgrade = &led_power;
|
||||
};
|
||||
|
||||
chosen {
|
||||
@@ -155,6 +159,21 @@
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
|
||||
button_pins: button_pins {
|
||||
wps_button {
|
||||
pins = "gpio9";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
reset_button {
|
||||
pins = "gpio19";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-up;
|
||||
};
|
||||
};
|
||||
|
||||
mdio_pins: mdio_pinmux {
|
||||
mux_0 {
|
||||
@@ -181,20 +200,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
pwm_pins: pwm_pinmux {
|
||||
led_pins: led_pins {
|
||||
mux_1 {
|
||||
pins = "gpio22";
|
||||
function = "pwm02";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_2 {
|
||||
pins = "gpio23";
|
||||
function = "pwm12";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
mux_3 {
|
||||
pins = "gpio24";
|
||||
function = "pwm22";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
};
|
||||
};
|
||||
@@ -208,27 +227,6 @@
|
||||
};
|
||||
};
|
||||
|
||||
leds_pins: leds_pins {
|
||||
led_5g {
|
||||
pins = "gpio35";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_2g {
|
||||
pins = "gpio37";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
led_usb0 {
|
||||
pins = "gpio50";
|
||||
function = "gpio";
|
||||
drive-strength = <8>;
|
||||
bias-pull-down;
|
||||
};
|
||||
};
|
||||
|
||||
btcoex_pins: btcoex_pins {
|
||||
mux_0 {
|
||||
pins = "gpio51";
|
||||
@@ -390,36 +388,38 @@
|
||||
mdiobus = <&mdio>;
|
||||
};
|
||||
|
||||
pwm {
|
||||
pinctrl-0 = <&pwm_pins>;
|
||||
gpio_keys {
|
||||
compatible = "gpio-keys";
|
||||
pinctrl-0 = <&button_pins>;
|
||||
pinctrl-names = "default";
|
||||
used-pwm-indices = <1>, <1>, <1>, <0>;
|
||||
dft-pwm-status = <0>, <1>, <0>, <0>;
|
||||
status = "ok";
|
||||
|
||||
reset {
|
||||
label = "reset";
|
||||
linux,code = <KEY_RESTART>;
|
||||
gpios = <&tlmm 19 GPIO_ACTIVE_LOW>;
|
||||
linux,input-type = <1>;
|
||||
debounce-interval = <60>;
|
||||
};
|
||||
};
|
||||
|
||||
leds {
|
||||
compatible = "gpio-leds";
|
||||
pinctrl-0 = <&leds_pins>;
|
||||
pinctrl-0 = <&led_pins>;
|
||||
pinctrl-names = "default";
|
||||
|
||||
led@35 {
|
||||
label = "led_5g";
|
||||
gpios = <&tlmm 35 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "led_5g";
|
||||
default-state = "off";
|
||||
led_power: led@22 {
|
||||
label = "status:blue";
|
||||
gpios = <&tlmm 22 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
led@37 {
|
||||
label = "led_2g";
|
||||
gpios = <&tlmm 37 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "led_2g";
|
||||
default-state = "off";
|
||||
|
||||
led@23 {
|
||||
label = "status:green";
|
||||
gpios = <&tlmm 23 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
led@50 {
|
||||
label = "led_usb0";
|
||||
gpios = <&tlmm 50 GPIO_ACTIVE_HIGH>;
|
||||
linux,default-trigger = "usb-host";
|
||||
default-state = "off";
|
||||
|
||||
led@24 {
|
||||
label = "status:red";
|
||||
gpios = <&tlmm 24 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- a/drivers/mmc/host/sdhci.c
|
||||
+++ b/drivers/mmc/host/sdhci.c
|
||||
@@ -367,7 +367,7 @@ static void __sdhci_led_deactivate(struc
|
||||
sdhci_writeb(host, ctrl, SDHCI_HOST_CONTROL);
|
||||
}
|
||||
|
||||
-#if IS_REACHABLE(CONFIG_LEDS_CLASS)
|
||||
+#if 0
|
||||
static void sdhci_led_control(struct led_classdev *led,
|
||||
enum led_brightness brightness)
|
||||
{
|
||||
@@ -11,7 +11,7 @@ boot() {
|
||||
edgecore,eap101|\
|
||||
edgecore,eap102|\
|
||||
edgecore,oap102|\
|
||||
edgecore.eap104)
|
||||
edgecore,eap104)
|
||||
avail=$(fw_printenv -n upgrade_available)
|
||||
[ ${avail} -eq 0 ] && fw_setenv upgrade_available 1
|
||||
fw_setenv bootcount 0
|
||||
|
||||
@@ -46,8 +46,14 @@ platform_do_upgrade() {
|
||||
tplink,ex227)
|
||||
qca_do_upgrade "$1"
|
||||
;;
|
||||
cig,wf196)
|
||||
[ -f /proc/boot_info/rootfs/upgradepartition ] && {
|
||||
CI_UBIPART="$(cat /proc/boot_info/rootfs/upgradepartition)"
|
||||
CI_BOOTCFG=1
|
||||
}
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
cig,wf194c4|\
|
||||
cig,wf196|\
|
||||
tplink,ex447)
|
||||
nand_upgrade_tar "$1"
|
||||
;;
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
--- a/drivers/net/wireless/ath/ath11k/peer.c
|
||||
+++ b/drivers/net/wireless/ath/ath11k/peer.c
|
||||
@@ -93,6 +93,25 @@ struct ath11k_peer *ath11k_peer_find_by_
|
||||
return NULL;
|
||||
}
|
||||
|
||||
+struct ath11k_peer *ath11k_peer_find_by_pdev_idx(struct ath11k_base *ab,
|
||||
+ u8 pdev_idx, const u8 *addr)
|
||||
+{
|
||||
+ struct ath11k_peer *peer;
|
||||
+
|
||||
+ lockdep_assert_held(&ab->base_lock);
|
||||
+
|
||||
+ list_for_each_entry(peer, &ab->peers, list) {
|
||||
+ if (peer->pdev_idx != pdev_idx)
|
||||
+ continue;
|
||||
+ if (!ether_addr_equal(peer->addr, addr))
|
||||
+ continue;
|
||||
+
|
||||
+ return peer;
|
||||
+ }
|
||||
+
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
struct ath11k_peer *ath11k_peer_find_by_ast(struct ath11k_base *ab,
|
||||
int ast_hash)
|
||||
{
|
||||
@@ -867,13 +886,21 @@ int ath11k_peer_create(struct ath11k *ar
|
||||
return -ENOBUFS;
|
||||
}
|
||||
|
||||
+ mutex_lock(&ar->ab->tbl_mtx_lock);
|
||||
spin_lock_bh(&ar->ab->base_lock);
|
||||
- peer = ath11k_peer_find_by_addr(ar->ab, param->peer_addr);
|
||||
+ peer = ath11k_peer_find_by_pdev_idx(ar->ab, ar->pdev_idx, param->peer_addr);
|
||||
if (peer) {
|
||||
spin_unlock_bh(&ar->ab->base_lock);
|
||||
+ mutex_unlock(&ar->ab->tbl_mtx_lock);
|
||||
return -EINVAL;
|
||||
}
|
||||
+
|
||||
+ peer = ath11k_peer_find_by_addr(ar->ab, param->peer_addr);
|
||||
+ if (peer)
|
||||
+ ath11k_peer_rhash_delete(ar->ab, peer);
|
||||
+
|
||||
spin_unlock_bh(&ar->ab->base_lock);
|
||||
+ mutex_unlock(&ar->ab->tbl_mtx_lock);
|
||||
|
||||
ret = ath11k_wmi_send_peer_create_cmd(ar, param);
|
||||
if (ret) {
|
||||
@@ -76,4 +76,17 @@ endef
|
||||
|
||||
$(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@ge5.4
|
||||
AUTOLOAD:=$(call AutoLoad,56,bootconfig,1)
|
||||
endef
|
||||
|
||||
define KernelPackage/bootconfig/description
|
||||
Bootconfig partition for failsafe
|
||||
endef
|
||||
|
||||
$(eval $(call KernelPackage,bootconfig))
|
||||
|
||||
|
||||
@@ -1,56 +0,0 @@
|
||||
From de4d3e25a555dedd70793d0362b1e501ed1a77f1 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Lin <benjamin-jw.lin@mediatek.com>
|
||||
Date: Tue, 30 Apr 2024 10:28:29 +0800
|
||||
Subject: [PATCH] mac80211: mtk: fix inconsistent QoS mapping between AP and
|
||||
AP_VLAN VIFs
|
||||
|
||||
Fix inconsistent QoS mapping between AP and AP_VLAN IFs.
|
||||
Specifically, when WDS AP IF is connected by a WDS STA, the QoS map of the AP_VLAN VIF is NULL.
|
||||
So the QoS types of packets to the WDS STA will be determined using the default mapping rule.
|
||||
However, SoftMAC driver uses the QoS map of the AP VIF, which may already be set.
|
||||
Therefore, it is possible that the QoS mappings of SW and HW are inconsistent.
|
||||
Thus, sync QoS map of AP VIF to that of AP_VLAN VIF.
|
||||
|
||||
Signed-off-by: Benjamin Lin <benjamin-jw.lin@mediatek.com>
|
||||
---
|
||||
net/mac80211/iface.c | 23 ++++++++++++++++++++++-
|
||||
1 file changed, 22 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c
|
||||
index ef32d53..138ad79 100644
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -297,8 +297,29 @@ static int ieee80211_check_concurrent_iface(struct ieee80211_sub_if_data *sdata,
|
||||
* can only add VLANs to enabled APs
|
||||
*/
|
||||
if (iftype == NL80211_IFTYPE_AP_VLAN &&
|
||||
- nsdata->vif.type == NL80211_IFTYPE_AP)
|
||||
+ nsdata->vif.type == NL80211_IFTYPE_AP) {
|
||||
+ struct mac80211_qos_map *old_qos_map, *new_qos_map = NULL;
|
||||
+
|
||||
sdata->bss = &nsdata->u.ap;
|
||||
+
|
||||
+ rcu_read_lock();
|
||||
+ old_qos_map = rcu_dereference(nsdata->qos_map);
|
||||
+ if (old_qos_map) {
|
||||
+ new_qos_map = kzalloc(sizeof(*new_qos_map), GFP_KERNEL);
|
||||
+ if (!new_qos_map) {
|
||||
+ rcu_read_unlock();
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+ memcpy(&new_qos_map->qos_map, &old_qos_map->qos_map,
|
||||
+ sizeof(new_qos_map->qos_map));
|
||||
+ }
|
||||
+ rcu_read_unlock();
|
||||
+
|
||||
+ old_qos_map = sdata_dereference(sdata->qos_map, sdata);
|
||||
+ rcu_assign_pointer(sdata->qos_map, new_qos_map);
|
||||
+ if (old_qos_map)
|
||||
+ kfree_rcu(old_qos_map, rcu_head);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.18.0
|
||||
|
||||
@@ -456,190 +456,6 @@ static ssize_t pppq_toggle_write(struct file *file, const char __user *ptr,
|
||||
return len;
|
||||
}
|
||||
|
||||
int pse_info_usage(struct seq_file *m, void *private)
|
||||
{
|
||||
pr_info("====================Advanced Settings====================\n");
|
||||
pr_info("Usage: echo [port] [option] > /sys/kernel/debug/mtketh/pse_info\n");
|
||||
pr_info(" 0~15 0~2 Show PSE info\n");
|
||||
pr_info(" 3 Show PSE legacy info\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pse_info_open(struct inode *inode, struct file *file)
|
||||
{
|
||||
return single_open(file, pse_info_usage, inode->i_private);
|
||||
}
|
||||
|
||||
void pse_lgc_info_get_v2(struct mtk_eth *eth, int port, u32 dbg1, u32 dbg2)
|
||||
{
|
||||
struct mtk_pse_fs_lgc_info_v2 *info;
|
||||
u64 val;
|
||||
|
||||
info = (struct mtk_pse_fs_lgc_info_v2 *)&val;
|
||||
|
||||
val = mtk_r32(eth, dbg1);
|
||||
val |= ((u64)mtk_r32(eth, dbg2) << 32);
|
||||
|
||||
pr_info("PSE port%d legacy FS info (v2)\n", port);
|
||||
pr_info("=========================================\n");
|
||||
pr_info("sport=%d, fport=%d, dr_idx=%d, ppe_crsn=%d\n",
|
||||
info->sport, info->fport, info->dr_idx, info->ppe_crsn);
|
||||
pr_info("l2_len=%d, l3_len=%d, l3_pidx=%d\n",
|
||||
info->l2_len, info->l3_len, info->l3_pidx);
|
||||
pr_info("is_l4f=%d, is_l4vld=%d, is_tack=%d\n",
|
||||
info->is_l4f, info->is_l4vld, info->is_tack);
|
||||
pr_info("is_ip4f=%d, is_ip4=%d, is_ip6=%d\n",
|
||||
info->is_ip4f, info->is_ip4, info->is_ip6);
|
||||
pr_info("=========================================\n");
|
||||
}
|
||||
|
||||
void pse_lgc_info_get_v3(struct mtk_eth *eth, int port, u32 dbg1, u32 dbg2)
|
||||
{
|
||||
struct mtk_pse_fs_lgc_info_v3 *info;
|
||||
u64 val;
|
||||
|
||||
info = (struct mtk_pse_fs_lgc_info_v3 *)&val;
|
||||
|
||||
val = mtk_r32(eth, dbg1);
|
||||
val |= ((u64)mtk_r32(eth, dbg2) << 32);
|
||||
|
||||
pr_info("PSE port%d legacy FS info (v3)\n", port);
|
||||
pr_info("=========================================\n");
|
||||
pr_info("sport=%d, fport=%d, ppe_crsn=%d\n",
|
||||
info->sport, info->fport, info->ppe_crsn);
|
||||
pr_info("l2_len=%d, l3_len=%d, l3_pidx=%d\n",
|
||||
info->l2_len, info->l3_len, info->l3_pidx);
|
||||
pr_info("is_l4f=%d, is_l4vld=%d, is_tack=%d\n",
|
||||
info->is_l4f, info->is_l4vld, info->is_tack);
|
||||
pr_info("is_ip4f=%d, is_ip4=%d, is_ip6=%d\n",
|
||||
info->is_ip4f, info->is_ip4, info->is_ip6);
|
||||
pr_info("is_snap=%d, vofst=%d, pl_end=%d\n",
|
||||
info->is_snap, info->vofst, info->pl_end);
|
||||
pr_info("is_err_pkt=%d, err_pkt_action=%d\n",
|
||||
info->is_err_pkt, info->err_pkt_action);
|
||||
pr_info("=========================================\n");
|
||||
}
|
||||
|
||||
void pse_info_get_gdm(struct mtk_eth *eth, int port, int index, int options)
|
||||
{
|
||||
u32 dbg1[2] = {MTK_FE_GDM1_DBG1, MTK_FE_GDM2_DBG1};
|
||||
u32 dbg2[2] = {MTK_FE_GDM1_DBG2, MTK_FE_GDM2_DBG2};
|
||||
|
||||
if (index < 0 || index > 1)
|
||||
return;
|
||||
|
||||
if (options == 3)
|
||||
pse_lgc_info_get_v2(eth, port, dbg1[index], dbg2[index]);
|
||||
else
|
||||
pr_info("Not supported\n");
|
||||
}
|
||||
|
||||
void pse_info_get_cdm(struct mtk_eth *eth, int port, int index, int options)
|
||||
{
|
||||
u32 dbg1[7] = {MTK_FE_CDM1_DBG1, MTK_FE_CDM2_DBG1, MTK_FE_CDM3_DBG1,
|
||||
MTK_FE_CDM4_DBG1, MTK_FE_CDM5_DBG1, MTK_FE_CDM6_DBG1,
|
||||
MTK_FE_CDM7_DBG1};
|
||||
u32 dbg2[7] = {MTK_FE_CDM1_DBG2, MTK_FE_CDM2_DBG2, MTK_FE_CDM3_DBG2,
|
||||
MTK_FE_CDM4_DBG2, MTK_FE_CDM5_DBG2, MTK_FE_CDM6_DBG2,
|
||||
MTK_FE_CDM7_DBG2};
|
||||
|
||||
if (index < 0 || index > 6)
|
||||
return;
|
||||
|
||||
if (options == 3) {
|
||||
#if defined(CONFIG_MEDIATEK_NETSYS_V3)
|
||||
if (index > 1 && index < 7)
|
||||
return pse_lgc_info_get_v3(eth, port, dbg1[index], dbg2[index]);
|
||||
#endif
|
||||
pse_lgc_info_get_v2(eth, port, dbg1[index], dbg2[index]);
|
||||
} else
|
||||
pr_info("Not supported\n");
|
||||
}
|
||||
|
||||
int pse_info_get(struct mtk_eth *eth, int port, int options)
|
||||
{
|
||||
switch (port) {
|
||||
case PSE_GDM1_PORT:
|
||||
pse_info_get_gdm(eth, port, 0, options);
|
||||
break;
|
||||
case PSE_GDM2_PORT:
|
||||
pse_info_get_gdm(eth, port, 1, options);
|
||||
break;
|
||||
case PSE_ADMA_PORT:
|
||||
pse_info_get_cdm(eth, port, 0, options);
|
||||
break;
|
||||
case PSE_QDMA_TX_PORT:
|
||||
case PSE_QDMA_RX_PORT:
|
||||
pse_info_get_cdm(eth, port, 1, options);
|
||||
break;
|
||||
case PSE_WDMA0_PORT:
|
||||
pse_info_get_cdm(eth, port, 2, options);
|
||||
break;
|
||||
case PSE_WDMA1_PORT:
|
||||
pse_info_get_cdm(eth, port, 3, options);
|
||||
break;
|
||||
case PSE_WDMA2_PORT:
|
||||
pse_info_get_cdm(eth, port, 4, options);
|
||||
break;
|
||||
case PSE_TDMA_PORT:
|
||||
pse_info_get_cdm(eth, port, 5, options);
|
||||
break;
|
||||
case PSE_EIP197_PORT:
|
||||
pse_info_get_cdm(eth, port, 6, options);
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
pr_info("Not supported\n");
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t pse_info_write(struct file *file, const char __user *buffer,
|
||||
size_t count, loff_t *off)
|
||||
{
|
||||
struct seq_file *m = file->private_data;
|
||||
struct mtk_eth *eth = m->private;
|
||||
long arg0 = 0, arg1 = 0;
|
||||
char buf[32];
|
||||
char *p_buf;
|
||||
char *p_token = NULL;
|
||||
char *p_delimiter = " \t";
|
||||
u32 len = count;
|
||||
int ret;
|
||||
|
||||
if (len >= sizeof(buf)) {
|
||||
pr_info("input handling fail!\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
if (copy_from_user(buf, buffer, len))
|
||||
return -EFAULT;
|
||||
|
||||
buf[len] = '\0';
|
||||
|
||||
p_buf = buf;
|
||||
p_token = strsep(&p_buf, p_delimiter);
|
||||
if (!p_token)
|
||||
arg0 = 0;
|
||||
else
|
||||
ret = kstrtol(p_token, 10, &arg0);
|
||||
|
||||
if (arg0 >= 0 && arg0 <= 15) {
|
||||
p_token = strsep(&p_buf, p_delimiter);
|
||||
if (!p_token)
|
||||
arg1 = 0;
|
||||
else
|
||||
ret = kstrtol(p_token, 10, &arg1);
|
||||
}
|
||||
|
||||
pse_info_get(eth, arg0, arg1);
|
||||
|
||||
return len;
|
||||
}
|
||||
|
||||
static const struct file_operations fops_reg_w = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = simple_open,
|
||||
@@ -663,15 +479,6 @@ static const struct file_operations fops_pppq_toggle = {
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static const struct file_operations fops_pse_info = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = pse_info_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.write = pse_info_write,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static const struct file_operations fops_mt7530sw_reg_w = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = simple_open,
|
||||
@@ -694,8 +501,6 @@ int mtketh_debugfs_init(struct mtk_eth *eth)
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
|
||||
debugfs_create_file("pse_info", 0444,
|
||||
eth_debug.root, eth, &fops_pse_info);
|
||||
debugfs_create_file("pppq_toggle", 0444,
|
||||
eth_debug.root, eth, &fops_pppq_toggle);
|
||||
debugfs_create_file("phy_regs", S_IRUGO,
|
||||
|
||||
@@ -30,24 +30,6 @@
|
||||
#define MTK_FE_GDM1_FSM 0x228
|
||||
#define MTK_FE_GDM2_FSM 0x22C
|
||||
#define MTK_FE_GDM3_FSM 0x23C
|
||||
#define MTK_FE_CDM1_DBG1 0x200
|
||||
#define MTK_FE_CDM1_DBG2 0x204
|
||||
#define MTK_FE_CDM2_DBG1 0x208
|
||||
#define MTK_FE_CDM2_DBG2 0x20C
|
||||
#define MTK_FE_CDM3_DBG1 0x230
|
||||
#define MTK_FE_CDM3_DBG2 0x234
|
||||
#define MTK_FE_CDM4_DBG1 0x290
|
||||
#define MTK_FE_CDM4_DBG2 0x294
|
||||
#define MTK_FE_CDM5_DBG1 0x310
|
||||
#define MTK_FE_CDM5_DBG2 0x314
|
||||
#define MTK_FE_CDM6_DBG1 0x320
|
||||
#define MTK_FE_CDM6_DBG2 0x324
|
||||
#define MTK_FE_CDM7_DBG1 0x330
|
||||
#define MTK_FE_CDM7_DBG2 0x334
|
||||
#define MTK_FE_GDM1_DBG1 0x210
|
||||
#define MTK_FE_GDM1_DBG2 0x214
|
||||
#define MTK_FE_GDM2_DBG1 0x218
|
||||
#define MTK_FE_GDM2_DBG2 0x21C
|
||||
#define MTK_FE_PSE_FREE 0x240
|
||||
#define MTK_FE_DROP_FQ 0x244
|
||||
#define MTK_FE_DROP_FC 0x248
|
||||
@@ -193,46 +175,6 @@
|
||||
mtk_w32(eth, reg_val, MTK_LRO_CTRL_DW2_CFG(x)); \
|
||||
}
|
||||
|
||||
struct mtk_pse_fs_lgc_info_v2 {
|
||||
u32 rev3 : 14;
|
||||
u32 ppe_crsn: 5;
|
||||
u32 sport : 4;
|
||||
u32 is_l4f: 1;
|
||||
u32 is_l4vld: 1;
|
||||
u32 is_tack : 1;
|
||||
u32 is_ip4f : 1;
|
||||
u32 is_ip4 : 1;
|
||||
u32 is_ip6 : 1;
|
||||
u32 dr_idx : 2;
|
||||
u32 rev2 : 4;
|
||||
u32 l3_pidx : 2;
|
||||
u32 rev : 2;
|
||||
u32 fport : 4;
|
||||
u32 l2_len : 7;
|
||||
u32 l3_len : 14;
|
||||
} __packed;
|
||||
|
||||
struct mtk_pse_fs_lgc_info_v3 {
|
||||
u32 is_snap : 1;
|
||||
u32 vofst : 3;
|
||||
u32 l3_pidx : 2;
|
||||
u32 pse_sport : 4;
|
||||
u32 fport : 4;
|
||||
u32 ppe_crsn: 5;
|
||||
u32 sport : 4;
|
||||
u32 is_l4f: 1;
|
||||
u32 is_l4vld: 1;
|
||||
u32 is_tack : 1;
|
||||
u32 is_ip4f : 1;
|
||||
u32 is_ip4 : 1;
|
||||
u32 is_ip6 : 1;
|
||||
u32 is_err_pkt : 1;
|
||||
u32 err_pkt_action : 2;
|
||||
u32 pl_end : 11;
|
||||
u32 l2_len : 7;
|
||||
u32 l3_len : 14;
|
||||
} __packed;
|
||||
|
||||
struct mtk_lro_alt_v1_info0 {
|
||||
u32 dtp : 16;
|
||||
u32 stp : 16;
|
||||
|
||||
@@ -1158,9 +1158,10 @@ static void mtk_mac_link_up(struct phylink_config *config, unsigned int mode,
|
||||
}
|
||||
|
||||
/* Configure duplex */
|
||||
mcr |= MAC_MCR_FORCE_DPX;
|
||||
if (duplex == DUPLEX_HALF &&
|
||||
interface == PHY_INTERFACE_MODE_GMII)
|
||||
if (duplex == DUPLEX_FULL ||
|
||||
interface == PHY_INTERFACE_MODE_SGMII)
|
||||
mcr |= MAC_MCR_FORCE_DPX;
|
||||
else if (interface == PHY_INTERFACE_MODE_GMII)
|
||||
mcr |= MAC_MCR_PRMBL_LMT_EN;
|
||||
|
||||
/* Configure pause modes -
|
||||
@@ -3867,9 +3868,17 @@ static int mtk_start_dma(struct mtk_eth *eth)
|
||||
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) {
|
||||
val = mtk_r32(eth, reg_map->qdma.glo_cfg);
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2) ||
|
||||
MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3)) {
|
||||
if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V3)) {
|
||||
val &= ~(MTK_RESV_BUF_MASK | MTK_DMA_SIZE_MASK);
|
||||
mtk_w32(eth,
|
||||
val | MTK_TX_DMA_EN | MTK_RX_DMA_EN |
|
||||
MTK_DMA_SIZE_16DWORDS | MTK_TX_WB_DDONE |
|
||||
MTK_NDP_CO_PRO | MTK_MUTLI_CNT |
|
||||
MTK_RESV_BUF | MTK_WCOMP_EN |
|
||||
MTK_DMAD_WR_WDONE | MTK_CHK_DDONE_EN |
|
||||
MTK_RX_2B_OFFSET, reg_map->qdma.glo_cfg);
|
||||
} else if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) {
|
||||
val &= ~MTK_RESV_BUF_MASK;
|
||||
mtk_w32(eth,
|
||||
val | MTK_TX_DMA_EN | MTK_RX_DMA_EN |
|
||||
MTK_DMA_SIZE_32DWORDS | MTK_TX_WB_DDONE |
|
||||
@@ -4409,7 +4418,7 @@ static int mtk_hw_init(struct mtk_eth *eth, u32 type)
|
||||
|
||||
/* GDM and CDM Threshold */
|
||||
mtk_w32(eth, 0x00000004, MTK_CDM2_THRES);
|
||||
mtk_w32(eth, 0x08000707, MTK_CDMW0_THRES);
|
||||
mtk_w32(eth, 0x00000707, MTK_CDMW0_THRES);
|
||||
mtk_w32(eth, 0x00000077, MTK_CDMW1_THRES);
|
||||
|
||||
/* Disable GDM1 RX CRC stripping */
|
||||
|
||||
@@ -119,7 +119,7 @@ void cr_set_field(void __iomem *reg, u32 field, u32 val)
|
||||
}
|
||||
|
||||
/*boundary entry can't be used to accelerate data flow*/
|
||||
void exclude_boundary_entry(struct foe_entry *foe_table_cpu)
|
||||
static void exclude_boundary_entry(struct foe_entry *foe_table_cpu)
|
||||
{
|
||||
int entry_base = 0;
|
||||
int bad_entry, i, j;
|
||||
|
||||
@@ -145,7 +145,6 @@
|
||||
#define HASH_MODE (0x3 << 14) /* RW */
|
||||
#define SCAN_MODE (0x3 << 16) /* RW */
|
||||
#define XMODE (0x3 << 18) /* RW */
|
||||
#define HASH_DBG (0x3 << 21) /* RW */
|
||||
#define TICK_SEL (0x1 << 24) /* RW */
|
||||
#define DSCP_TRFC_ECN_EN (0x1 << 25) /* RW */
|
||||
|
||||
@@ -1147,7 +1146,6 @@ enum FoeIpAct {
|
||||
#define NR_WDMA1_PORT 9
|
||||
#define NR_WDMA2_PORT 13
|
||||
#define NR_GMAC3_PORT 15
|
||||
#define NR_QDMA_TPORT 1
|
||||
#define LAN_DEV_NAME hnat_priv->lan
|
||||
#define LAN2_DEV_NAME hnat_priv->lan2
|
||||
#define IS_WAN(dev) \
|
||||
@@ -1312,7 +1310,6 @@ int hnat_enable_hook(void);
|
||||
int hnat_disable_hook(void);
|
||||
void hnat_cache_ebl(int enable);
|
||||
void hnat_qos_shaper_ebl(u32 id, u32 enable);
|
||||
void exclude_boundary_entry(struct foe_entry *foe_table_cpu);
|
||||
void set_gmac_ppe_fwd(int gmac_no, int enable);
|
||||
int entry_detail(u32 ppe_id, int index);
|
||||
int entry_delete_by_mac(u8 *mac);
|
||||
|
||||
@@ -755,7 +755,6 @@ int cr_set_usage(int level)
|
||||
pr_info(" 5 0~255 Set TCP keep alive interval\n");
|
||||
pr_info(" 6 0~255 Set UDP keep alive interval\n");
|
||||
pr_info(" 7 0~1 Set hnat counter update to nf_conntrack\n");
|
||||
pr_info(" 8 0~6 Set PPE hash debug mode\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -867,56 +866,6 @@ int set_nf_update_toggle(int toggle)
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
int set_hash_dbg_mode(int dbg_mode)
|
||||
{
|
||||
static const char * const hash_dbg_mode[] = {
|
||||
"Normal", "Source port[15:0]",
|
||||
"IPv4 source IP[15:0]", "IPv6 source IP[15:0]", "Destination port[15:0]",
|
||||
"IPv4 destination IP[15:0]", "IPv6 destination IP[15:0]" };
|
||||
unsigned int foe_table_sz, foe_acct_tb_sz, ppe_id, i;
|
||||
|
||||
if (dbg_mode < 0 || dbg_mode > 6) {
|
||||
pr_info("Invalid hash debug mode %d\n", dbg_mode);
|
||||
pr_info("[debug mode]\n");
|
||||
for (i = 0; i <= 6; i++)
|
||||
pr_info(" %d %s\n", i, hash_dbg_mode[i]);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
foe_table_sz = hnat_priv->foe_etry_num * sizeof(struct foe_entry);
|
||||
foe_acct_tb_sz = hnat_priv->foe_etry_num * sizeof(struct hnat_accounting);
|
||||
|
||||
/* send all traffic back to the DMA engine */
|
||||
set_gmac_ppe_fwd(NR_GMAC1_PORT, 0);
|
||||
set_gmac_ppe_fwd(NR_GMAC2_PORT, 0);
|
||||
set_gmac_ppe_fwd(NR_GMAC3_PORT, 0);
|
||||
|
||||
for (ppe_id = 0; ppe_id < CFG_PPE_NUM; ppe_id++) {
|
||||
cr_set_field(hnat_priv->ppe_base[ppe_id] + PPE_TB_CFG,
|
||||
HASH_DBG, dbg_mode);
|
||||
|
||||
memset(hnat_priv->foe_table_cpu[ppe_id], 0, foe_table_sz);
|
||||
|
||||
if (hnat_priv->data->version == MTK_HNAT_V1_1)
|
||||
exclude_boundary_entry(hnat_priv->foe_table_cpu[ppe_id]);
|
||||
|
||||
if (hnat_priv->data->per_flow_accounting)
|
||||
memset(hnat_priv->acct[ppe_id], 0, foe_acct_tb_sz);
|
||||
}
|
||||
|
||||
/* clear HWNAT cache */
|
||||
hnat_cache_ebl(1);
|
||||
|
||||
set_gmac_ppe_fwd(NR_GMAC1_PORT, 1);
|
||||
set_gmac_ppe_fwd(NR_GMAC2_PORT, 1);
|
||||
set_gmac_ppe_fwd(NR_GMAC3_PORT, 1);
|
||||
|
||||
pr_info("Hash debug mode enabled, set to %s mode\n", hash_dbg_mode[dbg_mode]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const debugfs_write_func hnat_set_func[] = {
|
||||
[0] = hnat_set_usage,
|
||||
[1] = hnat_cpu_reason,
|
||||
@@ -938,7 +887,6 @@ static const debugfs_write_func cr_set_func[] = {
|
||||
[2] = tcp_bind_lifetime, [3] = fin_bind_lifetime,
|
||||
[4] = udp_bind_lifetime, [5] = tcp_keep_alive,
|
||||
[6] = udp_keep_alive, [7] = set_nf_update_toggle,
|
||||
[8] = set_hash_dbg_mode,
|
||||
};
|
||||
|
||||
int read_mib(struct mtk_hnat *h, u32 ppe_id,
|
||||
@@ -1949,7 +1897,6 @@ ssize_t hnat_setting_write(struct file *file, const char __user *buffer,
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
p_token = strsep(&p_buf, p_delimiter);
|
||||
if (!p_token)
|
||||
arg1 = 0;
|
||||
|
||||
@@ -1614,7 +1614,7 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
|
||||
IS_LAN_GRP(dev)) ||
|
||||
(IS_PPPQ_MODE &&
|
||||
IS_PPPQ_PATH(dev, skb)))
|
||||
entry.ipv4_hnapt.tport_id = NR_QDMA_TPORT;
|
||||
entry.ipv4_hnapt.tport_id = 1;
|
||||
else
|
||||
entry.ipv4_hnapt.tport_id = 0;
|
||||
#else
|
||||
@@ -1813,8 +1813,7 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
|
||||
entry.ipv4_hnapt.iblk2.fqos = 0;
|
||||
else
|
||||
#if defined(CONFIG_MEDIATEK_NETSYS_V3)
|
||||
entry.ipv4_hnapt.tport_id = HQOS_FLAG(dev, skb, qid) ?
|
||||
NR_QDMA_TPORT : 0;
|
||||
entry.ipv4_hnapt.tport_id = HQOS_FLAG(dev, skb, qid) ? 1 : 0;
|
||||
#else
|
||||
entry.ipv4_hnapt.iblk2.fqos = HQOS_FLAG(dev, skb, qid) ? 1 : 0;
|
||||
#endif
|
||||
@@ -1854,16 +1853,16 @@ static unsigned int skb_to_hnat_info(struct sk_buff *skb,
|
||||
case IPV4_MAP_E:
|
||||
case IPV4_MAP_T:
|
||||
entry.ipv4_mape.tport_id =
|
||||
HQOS_FLAG(dev, skb, qid) ? NR_QDMA_TPORT : 0;
|
||||
HQOS_FLAG(dev, skb, qid) ? 1 : 0;
|
||||
break;
|
||||
case IPV6_HNAPT:
|
||||
case IPV6_HNAT:
|
||||
entry.ipv6_hnapt.tport_id =
|
||||
HQOS_FLAG(dev, skb, qid) ? NR_QDMA_TPORT : 0;
|
||||
HQOS_FLAG(dev, skb, qid) ? 1 : 0;
|
||||
break;
|
||||
default:
|
||||
entry.ipv6_5t_route.tport_id =
|
||||
HQOS_FLAG(dev, skb, qid) ? NR_QDMA_TPORT : 0;
|
||||
HQOS_FLAG(dev, skb, qid) ? 1 : 0;
|
||||
break;
|
||||
}
|
||||
#else
|
||||
@@ -2002,7 +2001,7 @@ int mtk_sw_nat_hook_tx(struct sk_buff *skb, int gmac_no)
|
||||
entry.ipv4_hnapt.winfo.bssid = skb_hnat_bss_id(skb);
|
||||
entry.ipv4_hnapt.winfo.wcid = skb_hnat_wc_id(skb);
|
||||
#if defined(CONFIG_MEDIATEK_NETSYS_V3)
|
||||
entry.ipv4_hnapt.tport_id = IS_HQOS_DL_MODE ? NR_QDMA_TPORT : 0;
|
||||
entry.ipv4_hnapt.tport_id = IS_HQOS_DL_MODE ? 1 : 0;
|
||||
entry.ipv4_hnapt.iblk2.rxid = skb_hnat_rx_id(skb);
|
||||
entry.ipv4_hnapt.iblk2.winfoi = 1;
|
||||
entry.ipv4_hnapt.winfo_pao.usr_info =
|
||||
@@ -2060,7 +2059,7 @@ int mtk_sw_nat_hook_tx(struct sk_buff *skb, int gmac_no)
|
||||
entry.ipv6_hnapt.winfo_pao.is_sp = skb_hnat_is_sp(skb);
|
||||
entry.ipv6_hnapt.winfo_pao.hf = skb_hnat_hf(skb);
|
||||
entry.ipv6_hnapt.winfo_pao.amsdu = skb_hnat_amsdu(skb);
|
||||
entry.ipv6_hnapt.tport_id = IS_HQOS_DL_MODE ? NR_QDMA_TPORT : 0;
|
||||
entry.ipv6_hnapt.tport_id = IS_HQOS_DL_MODE ? 1 : 0;
|
||||
#endif
|
||||
} else {
|
||||
entry.ipv6_5t_route.iblk2.fqos = 0;
|
||||
@@ -2076,7 +2075,7 @@ int mtk_sw_nat_hook_tx(struct sk_buff *skb, int gmac_no)
|
||||
case IPV4_MAP_T:
|
||||
entry.ipv4_mape.winfo.bssid = skb_hnat_bss_id(skb);
|
||||
entry.ipv4_mape.winfo.wcid = skb_hnat_wc_id(skb);
|
||||
entry.ipv4_mape.tport_id = IS_HQOS_DL_MODE ? NR_QDMA_TPORT : 0;
|
||||
entry.ipv4_mape.tport_id = IS_HQOS_DL_MODE ? 1 : 0;
|
||||
entry.ipv4_mape.iblk2.rxid = skb_hnat_rx_id(skb);
|
||||
entry.ipv4_mape.iblk2.winfoi = 1;
|
||||
entry.ipv4_mape.winfo_pao.usr_info =
|
||||
@@ -2097,7 +2096,7 @@ int mtk_sw_nat_hook_tx(struct sk_buff *skb, int gmac_no)
|
||||
default:
|
||||
entry.ipv6_5t_route.winfo.bssid = skb_hnat_bss_id(skb);
|
||||
entry.ipv6_5t_route.winfo.wcid = skb_hnat_wc_id(skb);
|
||||
entry.ipv6_5t_route.tport_id = IS_HQOS_DL_MODE ? NR_QDMA_TPORT : 0;
|
||||
entry.ipv6_5t_route.tport_id = IS_HQOS_DL_MODE ? 1 : 0;
|
||||
entry.ipv6_5t_route.iblk2.rxid = skb_hnat_rx_id(skb);
|
||||
entry.ipv6_5t_route.iblk2.winfoi = 1;
|
||||
entry.ipv6_5t_route.winfo_pao.usr_info =
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,9 @@
|
||||
// SPDX-License-Identifier: GPL-2.0
|
||||
/* FILE NAME: an8801.h
|
||||
* PURPOSE:
|
||||
* Define Airoha phy driver function
|
||||
/*SPDX-License-Identifier: GPL-2.0*/
|
||||
/*FILE NAME: an8801.h
|
||||
*PURPOSE:
|
||||
*Define Airoha phy driver function
|
||||
*
|
||||
* NOTES:
|
||||
*NOTES:
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -12,12 +12,13 @@
|
||||
|
||||
/* NAMING DECLARATIONS
|
||||
*/
|
||||
#define AN8801_DRIVER_VERSION "1.1.0"
|
||||
#define AN8801_DRIVER_VERSION "1.1.4"
|
||||
|
||||
#define DEBUGFS_COUNTER "counter"
|
||||
#define DEBUGFS_DRIVER_INFO "driver_info"
|
||||
#define DEBUGFS_INFO "driver_info"
|
||||
#define DEBUGFS_PBUS_OP "pbus_op"
|
||||
#define DEBUGFS_POLARITY "polarity"
|
||||
#define DEBUGFS_MDIO "mdio"
|
||||
|
||||
#define AN8801_MDIO_PHY_ID 0x1
|
||||
#define AN8801_PHY_ID1 0xc0ff
|
||||
@@ -97,6 +98,7 @@
|
||||
|
||||
#define PHY_PRE_SPEED_REG (0x2b)
|
||||
|
||||
#define MMD_DEV_VSPEC1 (0x1E)
|
||||
#define MMD_DEV_VSPEC2 (0x1F)
|
||||
|
||||
#define RGMII_DELAY_STEP_MASK 0x7
|
||||
@@ -202,6 +204,8 @@ struct an8801_priv {
|
||||
#ifdef AN8801SB_DEBUGFS
|
||||
struct dentry *debugfs_root;
|
||||
#endif
|
||||
int pol;
|
||||
int surge;
|
||||
};
|
||||
|
||||
enum an8801_polarity {
|
||||
@@ -211,4 +215,10 @@ enum an8801_polarity {
|
||||
AIR_POL_TX_REV_RX_NOR,
|
||||
};
|
||||
|
||||
enum air_surge {
|
||||
AIR_SURGE_0R,
|
||||
AIR_SURGE_5R,
|
||||
AIR_SURGE_LAST = 0xff
|
||||
};
|
||||
|
||||
#endif /* End of __AN8801_H */
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#define PHY_AUX_SPEED_MASK GENMASK(4, 2)
|
||||
|
||||
/* Registers on MDIO_MMD_VEND1 */
|
||||
#define MTK_PHY_LINK_STATUS_MISC (0xa2)
|
||||
#define MTK_PHY_FDX_ENABLE BIT(5)
|
||||
#define MTK_PHY_LINK_STATUS_MISC (0xa2)
|
||||
#define MTK_PHY_FDX_ENABLE BIT(5)
|
||||
|
||||
#define MTK_PHY_LPI_PCS_DSP_CTRL (0x121)
|
||||
#define MTK_PHY_LPI_SIG_EN_LO_THRESH100_MASK GENMASK(12, 8)
|
||||
@@ -46,20 +46,10 @@
|
||||
|
||||
#define MTK_EXT_PAGE_ACCESS 0x1f
|
||||
#define MTK_PHY_PAGE_STANDARD 0x0000
|
||||
#define MTK_PHY_PAGE_EXTENDED_1 0x1
|
||||
#define MTK_PHY_AUX_CTRL_AND_STATUS (0x14)
|
||||
#define MTK_PHY_ENABLE_DOWNSHIFT BIT(4)
|
||||
|
||||
/* Registers on Token Ring debug nodes */
|
||||
#define MTK_PHY_PAGE_EXTENDED_52B5 0x52b5
|
||||
|
||||
/* ch_addr = 0x0, node_addr = 0xf, data_addr = 0x3c */
|
||||
#define AUTO_NP_10XEN BIT(6)
|
||||
|
||||
struct mtk_i2p5ge_phy_priv {
|
||||
bool fw_loaded;
|
||||
u16 tr_low;
|
||||
u16 tr_high;
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -69,67 +59,6 @@ enum {
|
||||
PHY_AUX_SPD_2500,
|
||||
};
|
||||
|
||||
static void tr_access(struct phy_device *phydev, bool read, u8 ch_addr, u8 node_addr, u8 data_addr)
|
||||
{
|
||||
u16 tr_cmd = BIT(15); /* bit 14 & 0 are reserved */
|
||||
|
||||
if (read)
|
||||
tr_cmd |= BIT(13);
|
||||
|
||||
tr_cmd |= (((ch_addr & 0x3) << 11) |
|
||||
((node_addr & 0xf) << 7) |
|
||||
((data_addr & 0x3f) << 1));
|
||||
dev_dbg(&phydev->mdio.dev, "tr_cmd: 0x%x\n", tr_cmd);
|
||||
__phy_write(phydev, 0x10, tr_cmd);
|
||||
}
|
||||
|
||||
static void __tr_read(struct phy_device *phydev, u8 ch_addr, u8 node_addr, u8 data_addr)
|
||||
{
|
||||
struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
|
||||
tr_access(phydev, true, ch_addr, node_addr, data_addr);
|
||||
priv->tr_low = __phy_read(phydev, 0x11);
|
||||
priv->tr_high = __phy_read(phydev, 0x12);
|
||||
dev_dbg(&phydev->mdio.dev, "tr_high read: 0x%x, tr_low read: 0x%x\n",
|
||||
priv->tr_high, priv->tr_low);
|
||||
}
|
||||
|
||||
static void tr_read(struct phy_device *phydev, u8 ch_addr, u8 node_addr, u8 data_addr)
|
||||
{
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
__tr_read(phydev, ch_addr, node_addr, data_addr);
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
}
|
||||
|
||||
static void __tr_write(struct phy_device *phydev, u8 ch_addr, u8 node_addr, u8 data_addr,
|
||||
u32 tr_data)
|
||||
{
|
||||
__phy_write(phydev, 0x11, tr_data & 0xffff);
|
||||
__phy_write(phydev, 0x12, tr_data >> 16);
|
||||
tr_access(phydev, false, ch_addr, node_addr, data_addr);
|
||||
}
|
||||
|
||||
static void tr_write(struct phy_device *phydev, u8 ch_addr, u8 node_addr, u8 data_addr, u32 tr_data)
|
||||
{
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
__tr_write(phydev, ch_addr, node_addr, data_addr, tr_data);
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
}
|
||||
|
||||
static void tr_modify(struct phy_device *phydev, u8 ch_addr, u8 node_addr, u8 data_addr,
|
||||
u32 mask, u32 set)
|
||||
{
|
||||
u32 tr_data;
|
||||
struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
__tr_read(phydev, ch_addr, node_addr, data_addr);
|
||||
tr_data = (priv->tr_high << 16) | priv->tr_low;
|
||||
tr_data = (tr_data & ~mask) | set;
|
||||
__tr_write(phydev, ch_addr, node_addr, data_addr, tr_data);
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
}
|
||||
|
||||
static int mtk_2p5ge_phy_read_page(struct phy_device *phydev)
|
||||
{
|
||||
return __phy_read(phydev, MTK_EXT_PAGE_ACCESS);
|
||||
@@ -142,14 +71,14 @@ static int mtk_2p5ge_phy_write_page(struct phy_device *phydev, int page)
|
||||
|
||||
static int mt7988_2p5ge_phy_probe(struct phy_device *phydev)
|
||||
{
|
||||
struct mtk_i2p5ge_phy_priv *priv;
|
||||
struct mtk_i2p5ge_phy_priv *phy_priv;
|
||||
|
||||
priv = devm_kzalloc(&phydev->mdio.dev,
|
||||
phy_priv = devm_kzalloc(&phydev->mdio.dev,
|
||||
sizeof(struct mtk_i2p5ge_phy_priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
if (!phy_priv)
|
||||
return -ENOMEM;
|
||||
|
||||
phydev->priv = priv;
|
||||
phydev->priv = phy_priv;
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -162,11 +91,11 @@ static int mt7988_2p5ge_phy_config_init(struct phy_device *phydev)
|
||||
struct device_node *np;
|
||||
void __iomem *pmb_addr;
|
||||
void __iomem *md32_en_cfg_base;
|
||||
struct mtk_i2p5ge_phy_priv *priv = phydev->priv;
|
||||
struct mtk_i2p5ge_phy_priv *phy_priv = phydev->priv;
|
||||
u16 reg;
|
||||
struct pinctrl *pinctrl;
|
||||
|
||||
if (!priv->fw_loaded) {
|
||||
if (!phy_priv->fw_loaded) {
|
||||
np = of_find_compatible_node(NULL, NULL, "mediatek,2p5gphy-fw");
|
||||
if (!np)
|
||||
return -ENOENT;
|
||||
@@ -202,11 +131,9 @@ static int mt7988_2p5ge_phy_config_init(struct phy_device *phydev)
|
||||
writew(reg & ~MD32_EN, md32_en_cfg_base);
|
||||
writew(reg | MD32_EN, md32_en_cfg_base);
|
||||
phy_set_bits(phydev, 0, BIT(15));
|
||||
/* We need a delay here to stabilize initialization of MCU */
|
||||
usleep_range(7000, 8000);
|
||||
dev_info(dev, "Firmware loading/trigger ok.\n");
|
||||
|
||||
priv->fw_loaded = true;
|
||||
phy_priv->fw_loaded = true;
|
||||
}
|
||||
|
||||
/* Setup LED */
|
||||
@@ -227,12 +154,10 @@ static int mt7988_2p5ge_phy_config_init(struct phy_device *phydev)
|
||||
MTK_PHY_LPI_SIG_EN_LO_THRESH100_MASK, 0);
|
||||
|
||||
/* Enable 16-bit next page exchange bit if 1000-BT isn't advertizing */
|
||||
tr_modify(phydev, 0x0, 0xf, 0x3c, AUTO_NP_10XEN,
|
||||
FIELD_PREP(AUTO_NP_10XEN, 0x1));
|
||||
|
||||
/* Enable downshift */
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_1);
|
||||
__phy_set_bits(phydev, MTK_PHY_AUX_CTRL_AND_STATUS, MTK_PHY_ENABLE_DOWNSHIFT);
|
||||
phy_select_page(phydev, MTK_PHY_PAGE_EXTENDED_52B5);
|
||||
__phy_write(phydev, 0x11, 0xfbfa);
|
||||
__phy_write(phydev, 0x12, 0xc3);
|
||||
__phy_write(phydev, 0x10, 0x87f8);
|
||||
phy_restore_page(phydev, MTK_PHY_PAGE_STANDARD, 0);
|
||||
|
||||
return 0;
|
||||
@@ -298,7 +223,6 @@ static int mt7988_2p5ge_phy_get_features(struct phy_device *phydev)
|
||||
static int mt7988_2p5ge_phy_read_status(struct phy_device *phydev)
|
||||
{
|
||||
int ret;
|
||||
u16 status;
|
||||
|
||||
ret = genphy_update_link(phydev);
|
||||
if (ret)
|
||||
@@ -323,35 +247,32 @@ static int mt7988_2p5ge_phy_read_status(struct phy_device *phydev)
|
||||
linkmode_zero(phydev->lp_advertising);
|
||||
}
|
||||
|
||||
status = phy_read(phydev, MII_BMSR);
|
||||
if (status & BMSR_LSTATUS) {
|
||||
ret = phy_read(phydev, PHY_AUX_CTRL_STATUS);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
ret = phy_read(phydev, PHY_AUX_CTRL_STATUS);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
switch (FIELD_GET(PHY_AUX_SPEED_MASK, ret)) {
|
||||
case PHY_AUX_SPD_10:
|
||||
phydev->speed = SPEED_10;
|
||||
break;
|
||||
case PHY_AUX_SPD_100:
|
||||
phydev->speed = SPEED_100;
|
||||
break;
|
||||
case PHY_AUX_SPD_1000:
|
||||
phydev->speed = SPEED_1000;
|
||||
break;
|
||||
case PHY_AUX_SPD_2500:
|
||||
phydev->speed = SPEED_2500;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_LINK_STATUS_MISC);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
phydev->duplex = (ret & MTK_PHY_FDX_ENABLE) ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
/* FIXME: The current firmware always enables rate adaptation mode. */
|
||||
phydev->rate_matching = RATE_MATCH_PAUSE;
|
||||
switch (FIELD_GET(PHY_AUX_SPEED_MASK, ret)) {
|
||||
case PHY_AUX_SPD_10:
|
||||
phydev->speed = SPEED_10;
|
||||
break;
|
||||
case PHY_AUX_SPD_100:
|
||||
phydev->speed = SPEED_100;
|
||||
break;
|
||||
case PHY_AUX_SPD_1000:
|
||||
phydev->speed = SPEED_1000;
|
||||
break;
|
||||
case PHY_AUX_SPD_2500:
|
||||
phydev->speed = SPEED_2500;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = phy_read_mmd(phydev, MDIO_MMD_VEND1, MTK_PHY_LINK_STATUS_MISC);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
phydev->duplex = (ret & MTK_PHY_FDX_ENABLE) ? DUPLEX_FULL : DUPLEX_HALF;
|
||||
/* FIXME: The current firmware always enables rate adaptation mode. */
|
||||
phydev->rate_matching = RATE_MATCH_PAUSE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
#define CK_TOP_F26M 48
|
||||
#define CK_TOP_AUD_L 49
|
||||
#define CK_TOP_A_TUNER 50
|
||||
#define CLK_TOP_CONN_MCUSYS_SEL 50
|
||||
#define CK_TOP_U2U3_REF 51
|
||||
#define CK_TOP_U2U3_SYS 52
|
||||
#define CK_TOP_U2U3_XHCI 53
|
||||
@@ -121,6 +122,7 @@
|
||||
#define CK_TOP_PWM_SEL 60
|
||||
#define CK_TOP_I2C_SEL 61
|
||||
#define CK_TOP_PEXTP_TL_SEL 62
|
||||
#define CLK_TOP_AP2CNN_HOST_SEL 62
|
||||
#define CK_TOP_EMMC_250M_SEL 63
|
||||
#define CK_TOP_EMMC_416M_SEL 64
|
||||
#define CK_TOP_F_26M_ADC_SEL 65
|
||||
|
||||
18
feeds/mediatek-sdk/mediatek/mt7981/base-files/etc/board.d/03_gpio_switches
Executable file
18
feeds/mediatek-sdk/mediatek/mt7981/base-files/etc/board.d/03_gpio_switches
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/bin/sh
|
||||
|
||||
. /lib/functions/uci-defaults.sh
|
||||
|
||||
board_config_update
|
||||
|
||||
board=$(board_name)
|
||||
|
||||
case $board in
|
||||
edgecore,eap112)
|
||||
ucidef_add_gpio_switch "gpio_lte_reset" "LTE_reset" "457" "1"
|
||||
ucidef_add_gpio_switch "gpio_lte_power" "LTE_power" "458" "1"
|
||||
;;
|
||||
esac
|
||||
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
@@ -39,7 +39,16 @@ mediatek_setup_macs()
|
||||
|
||||
case $board in
|
||||
senao,iap4300m)
|
||||
up_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
hw_mac_addr=$(mtd_get_mac_ascii u-boot-env ethaddr)
|
||||
lan_mac="$hw_mac_addr"
|
||||
wan_mac=$(macaddr_add $hw_mac_addr 1)
|
||||
if [ -n "$lan_mac" ]; then
|
||||
ucidef_set_interface_macaddr "lan" "$lan_mac"
|
||||
fi
|
||||
if [ -n "$wan_mac" ]; then
|
||||
ucidef_set_interface_macaddr "wan" "$wan_mac"
|
||||
ucidef_set_label_macaddr "$wan_mac"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
lan_mac_offset="0x2A"
|
||||
|
||||
@@ -1,397 +0,0 @@
|
||||
--- a/drivers/crypto/inside-secure/safexcel.c
|
||||
+++ b/drivers/crypto/inside-secure/safexcel.c
|
||||
@@ -1222,6 +1222,7 @@ static struct safexcel_alg_template *saf
|
||||
&safexcel_alg_cfb_aes,
|
||||
&safexcel_alg_ofb_aes,
|
||||
&safexcel_alg_ctr_aes,
|
||||
+ &safexcel_alg_basic_ctr_aes,
|
||||
&safexcel_alg_md5,
|
||||
&safexcel_alg_sha1,
|
||||
&safexcel_alg_sha224,
|
||||
--- a/drivers/crypto/inside-secure/safexcel.h
|
||||
+++ b/drivers/crypto/inside-secure/safexcel.h
|
||||
@@ -930,6 +930,7 @@ extern struct safexcel_alg_template safe
|
||||
extern struct safexcel_alg_template safexcel_alg_cfb_aes;
|
||||
extern struct safexcel_alg_template safexcel_alg_ofb_aes;
|
||||
extern struct safexcel_alg_template safexcel_alg_ctr_aes;
|
||||
+extern struct safexcel_alg_template safexcel_alg_basic_ctr_aes;
|
||||
extern struct safexcel_alg_template safexcel_alg_md5;
|
||||
extern struct safexcel_alg_template safexcel_alg_sha1;
|
||||
extern struct safexcel_alg_template safexcel_alg_sha224;
|
||||
--- a/drivers/crypto/inside-secure/safexcel_cipher.c
|
||||
+++ b/drivers/crypto/inside-secure/safexcel_cipher.c
|
||||
@@ -51,6 +51,8 @@ struct safexcel_cipher_ctx {
|
||||
u8 xcm; /* 0=authenc, 1=GCM, 2 reserved for CCM */
|
||||
u8 aadskip;
|
||||
u8 blocksz;
|
||||
+ bool basic_ctr;
|
||||
+ u32 processed;
|
||||
u32 ivmask;
|
||||
u32 ctrinit;
|
||||
|
||||
@@ -79,7 +81,7 @@ struct safexcel_cipher_req {
|
||||
static int safexcel_skcipher_iv(struct safexcel_cipher_ctx *ctx, u8 *iv,
|
||||
struct safexcel_command_desc *cdesc)
|
||||
{
|
||||
- if (ctx->mode == CONTEXT_CONTROL_CRYPTO_MODE_CTR_LOAD) {
|
||||
+ if (ctx->mode == CONTEXT_CONTROL_CRYPTO_MODE_CTR_LOAD && !(ctx->basic_ctr)) {
|
||||
cdesc->control_data.options |= EIP197_OPTION_4_TOKEN_IV_CMD;
|
||||
/* 32 bit nonce */
|
||||
cdesc->control_data.token[0] = ctx->nonce;
|
||||
@@ -513,8 +515,8 @@ static int safexcel_aead_setkey(struct c
|
||||
memcpy(ctx->opad, &ostate.state, ctx->state_sz);
|
||||
|
||||
memzero_explicit(&keys, sizeof(keys));
|
||||
- return 0;
|
||||
|
||||
+ return 0;
|
||||
badkey:
|
||||
memzero_explicit(&keys, sizeof(keys));
|
||||
return err;
|
||||
@@ -622,6 +624,43 @@ static int safexcel_context_control(stru
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int safexcel_queue_req(struct crypto_async_request *base,
|
||||
+ struct safexcel_cipher_req *sreq,
|
||||
+ enum safexcel_cipher_direction dir)
|
||||
+{
|
||||
+ struct safexcel_cipher_ctx *ctx = crypto_tfm_ctx(base->tfm);
|
||||
+ struct safexcel_crypto_priv *priv = ctx->priv;
|
||||
+ int ret, ring;
|
||||
+
|
||||
+ sreq->needs_inv = false;
|
||||
+ sreq->direction = dir;
|
||||
+
|
||||
+ if (ctx->base.ctxr) {
|
||||
+ if (priv->flags & EIP197_TRC_CACHE && ctx->base.needs_inv) {
|
||||
+ sreq->needs_inv = true;
|
||||
+ ctx->base.needs_inv = false;
|
||||
+ }
|
||||
+ } else {
|
||||
+ ctx->base.ring = safexcel_select_ring(priv);
|
||||
+ ctx->base.ctxr = dma_pool_zalloc(priv->context_pool,
|
||||
+ EIP197_GFP_FLAGS(*base),
|
||||
+ &ctx->base.ctxr_dma);
|
||||
+ if (!ctx->base.ctxr)
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ ring = ctx->base.ring;
|
||||
+
|
||||
+ spin_lock_bh(&priv->ring[ring].queue_lock);
|
||||
+ ret = crypto_enqueue_request(&priv->ring[ring].queue, base);
|
||||
+ spin_unlock_bh(&priv->ring[ring].queue_lock);
|
||||
+
|
||||
+ queue_work(priv->ring[ring].workqueue,
|
||||
+ &priv->ring[ring].work_data.work);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static int safexcel_handle_req_result(struct safexcel_crypto_priv *priv, int ring,
|
||||
struct crypto_async_request *async,
|
||||
struct scatterlist *src,
|
||||
@@ -635,6 +674,7 @@ static int safexcel_handle_req_result(st
|
||||
struct safexcel_cipher_ctx *ctx = crypto_skcipher_ctx(skcipher);
|
||||
struct safexcel_result_desc *rdesc;
|
||||
int ndesc = 0;
|
||||
+ int flag;
|
||||
|
||||
*ret = 0;
|
||||
|
||||
@@ -677,7 +717,13 @@ static int safexcel_handle_req_result(st
|
||||
crypto_skcipher_ivsize(skcipher)));
|
||||
}
|
||||
|
||||
- *should_complete = true;
|
||||
+ if (ctx->basic_ctr && ctx->processed != cryptlen) {
|
||||
+ *should_complete = false;
|
||||
+ flag = safexcel_queue_req(async, sreq, sreq->direction);
|
||||
+ } else {
|
||||
+ *should_complete = true;
|
||||
+ ctx->processed = 0;
|
||||
+ }
|
||||
|
||||
return ndesc;
|
||||
}
|
||||
@@ -700,12 +746,16 @@ static int safexcel_send_req(struct cryp
|
||||
unsigned int totlen;
|
||||
unsigned int totlen_src = cryptlen + assoclen;
|
||||
unsigned int totlen_dst = totlen_src;
|
||||
+ unsigned int pass_byte = 0;
|
||||
+ unsigned int pass;
|
||||
struct safexcel_token *atoken;
|
||||
int n_cdesc = 0, n_rdesc = 0;
|
||||
int queued, i, ret = 0;
|
||||
bool first = true;
|
||||
|
||||
- sreq->nr_src = sg_nents_for_len(src, totlen_src);
|
||||
+ pass_byte = ctx->processed;
|
||||
+ pass = pass_byte;
|
||||
+ sreq->nr_src = sg_nents_for_len(src, totlen_src + pass_byte);
|
||||
|
||||
if (ctx->aead) {
|
||||
/*
|
||||
@@ -736,7 +786,7 @@ static int safexcel_send_req(struct cryp
|
||||
crypto_skcipher_ivsize(skcipher)));
|
||||
}
|
||||
|
||||
- sreq->nr_dst = sg_nents_for_len(dst, totlen_dst);
|
||||
+ sreq->nr_dst = sg_nents_for_len(dst, totlen_dst + pass_byte);
|
||||
|
||||
/*
|
||||
* Remember actual input length, source buffer length may be
|
||||
@@ -798,14 +848,23 @@ static int safexcel_send_req(struct cryp
|
||||
for_each_sg(src, sg, sreq->nr_src, i) {
|
||||
int len = sg_dma_len(sg);
|
||||
|
||||
+ if (pass) {
|
||||
+ if (pass >= len) {
|
||||
+ pass -= len;
|
||||
+ continue;
|
||||
+ }
|
||||
+ len = len - pass;
|
||||
+ }
|
||||
/* Do not overflow the request */
|
||||
if (queued < len)
|
||||
len = queued;
|
||||
|
||||
cdesc = safexcel_add_cdesc(priv, ring, !n_cdesc,
|
||||
- !(queued - len),
|
||||
- sg_dma_address(sg), len, totlen,
|
||||
- ctx->base.ctxr_dma, &atoken);
|
||||
+ !(queued - len),
|
||||
+ sg_dma_address(sg) + pass, len,
|
||||
+ totlen, ctx->base.ctxr_dma, &atoken);
|
||||
+ pass = 0;
|
||||
+
|
||||
if (IS_ERR(cdesc)) {
|
||||
/* No space left in the command descriptor ring */
|
||||
ret = PTR_ERR(cdesc);
|
||||
@@ -820,6 +879,7 @@ static int safexcel_send_req(struct cryp
|
||||
if (!queued)
|
||||
break;
|
||||
}
|
||||
+
|
||||
skip_cdesc:
|
||||
/* Add context control words and token to first command descriptor */
|
||||
safexcel_context_control(ctx, base, sreq, first_cdesc);
|
||||
@@ -831,11 +891,20 @@ skip_cdesc:
|
||||
safexcel_skcipher_token(ctx, iv, first_cdesc, atoken,
|
||||
cryptlen);
|
||||
|
||||
+ pass = pass_byte;
|
||||
/* result descriptors */
|
||||
for_each_sg(dst, sg, sreq->nr_dst, i) {
|
||||
bool last = (i == sreq->nr_dst - 1);
|
||||
u32 len = sg_dma_len(sg);
|
||||
|
||||
+ if (pass) {
|
||||
+ if (pass >= len) {
|
||||
+ pass -= len;
|
||||
+ continue;
|
||||
+ }
|
||||
+ len -= pass;
|
||||
+ }
|
||||
+
|
||||
/* only allow the part of the buffer we know we need */
|
||||
if (len > totlen_dst)
|
||||
len = totlen_dst;
|
||||
@@ -855,9 +924,11 @@ skip_cdesc:
|
||||
len - assoclen);
|
||||
assoclen = 0;
|
||||
} else {
|
||||
+
|
||||
rdesc = safexcel_add_rdesc(priv, ring, first, last,
|
||||
- sg_dma_address(sg),
|
||||
- len);
|
||||
+ sg_dma_address(sg) + pass,
|
||||
+ len);
|
||||
+ pass = 0;
|
||||
}
|
||||
if (IS_ERR(rdesc)) {
|
||||
/* No space left in the result descriptor ring */
|
||||
@@ -892,6 +963,7 @@ skip_cdesc:
|
||||
|
||||
*commands = n_cdesc;
|
||||
*results = n_rdesc;
|
||||
+
|
||||
return 0;
|
||||
|
||||
rdesc_rollback:
|
||||
@@ -1033,6 +1105,26 @@ static int safexcel_cipher_send_inv(stru
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static void accum_iv(u8 *iv, u32 blocks)
|
||||
+{
|
||||
+ u32 *counter;
|
||||
+ int i;
|
||||
+
|
||||
+ for (i = 12; i >= 0; i = i - 4) {
|
||||
+ counter = (u32 *) &iv[i];
|
||||
+ if (be32_to_cpu(*counter) + blocks >= be32_to_cpu(*counter)) {
|
||||
+ *counter = cpu_to_be32(be32_to_cpu(*counter) + blocks);
|
||||
+ blocks = 0;
|
||||
+ } else {
|
||||
+ *counter = cpu_to_be32(be32_to_cpu(*counter) + blocks);
|
||||
+ blocks = 1;
|
||||
+ }
|
||||
+
|
||||
+ if (blocks == 0)
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static int safexcel_skcipher_send(struct crypto_async_request *async, int ring,
|
||||
int *commands, int *results)
|
||||
{
|
||||
@@ -1049,6 +1141,8 @@ static int safexcel_skcipher_send(struct
|
||||
} else {
|
||||
struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req);
|
||||
u8 input_iv[AES_BLOCK_SIZE];
|
||||
+ u32 blocks;
|
||||
+ u32 *counter;
|
||||
|
||||
/*
|
||||
* Save input IV in case of CBC decrypt mode
|
||||
@@ -1056,9 +1150,29 @@ static int safexcel_skcipher_send(struct
|
||||
*/
|
||||
memcpy(input_iv, req->iv, crypto_skcipher_ivsize(skcipher));
|
||||
|
||||
- ret = safexcel_send_req(async, ring, sreq, req->src,
|
||||
+ if (ctx->mode == CONTEXT_CONTROL_CRYPTO_MODE_CTR_LOAD && ctx->basic_ctr) {
|
||||
+ counter = (u32 *) &req->iv[12];
|
||||
+ blocks = (req->cryptlen / ctx->blocksz) - (ctx->processed / 16);
|
||||
+ if (req->cryptlen % ctx->blocksz)
|
||||
+ blocks++;
|
||||
+ if (be32_to_cpu(*counter) + blocks < be32_to_cpu(*counter)) {
|
||||
+ blocks = 0 - be32_to_cpu(*counter);
|
||||
+ ret = safexcel_send_req(async, ring, sreq, req->src,
|
||||
+ req->dst, min(blocks * AES_BLOCK_SIZE, req->cryptlen), 0, 0, input_iv,
|
||||
+ commands, results);
|
||||
+ ctx->processed += min(blocks * AES_BLOCK_SIZE, req->cryptlen);
|
||||
+ } else {
|
||||
+ ret = safexcel_send_req(async, ring, sreq, req->src,
|
||||
+ req->dst, req->cryptlen - ctx->processed,
|
||||
+ 0, 0, input_iv, commands, results);
|
||||
+ ctx->processed = req->cryptlen;
|
||||
+ }
|
||||
+ accum_iv(req->iv, blocks);
|
||||
+ } else {
|
||||
+ ret = safexcel_send_req(async, ring, sreq, req->src,
|
||||
req->dst, req->cryptlen, 0, 0, input_iv,
|
||||
commands, results);
|
||||
+ }
|
||||
}
|
||||
|
||||
sreq->rdescs = *results;
|
||||
@@ -1152,43 +1266,6 @@ static int safexcel_aead_exit_inv(struct
|
||||
return safexcel_cipher_exit_inv(tfm, &req->base, sreq, &result);
|
||||
}
|
||||
|
||||
-static int safexcel_queue_req(struct crypto_async_request *base,
|
||||
- struct safexcel_cipher_req *sreq,
|
||||
- enum safexcel_cipher_direction dir)
|
||||
-{
|
||||
- struct safexcel_cipher_ctx *ctx = crypto_tfm_ctx(base->tfm);
|
||||
- struct safexcel_crypto_priv *priv = ctx->priv;
|
||||
- int ret, ring;
|
||||
-
|
||||
- sreq->needs_inv = false;
|
||||
- sreq->direction = dir;
|
||||
-
|
||||
- if (ctx->base.ctxr) {
|
||||
- if (priv->flags & EIP197_TRC_CACHE && ctx->base.needs_inv) {
|
||||
- sreq->needs_inv = true;
|
||||
- ctx->base.needs_inv = false;
|
||||
- }
|
||||
- } else {
|
||||
- ctx->base.ring = safexcel_select_ring(priv);
|
||||
- ctx->base.ctxr = dma_pool_zalloc(priv->context_pool,
|
||||
- EIP197_GFP_FLAGS(*base),
|
||||
- &ctx->base.ctxr_dma);
|
||||
- if (!ctx->base.ctxr)
|
||||
- return -ENOMEM;
|
||||
- }
|
||||
-
|
||||
- ring = ctx->base.ring;
|
||||
-
|
||||
- spin_lock_bh(&priv->ring[ring].queue_lock);
|
||||
- ret = crypto_enqueue_request(&priv->ring[ring].queue, base);
|
||||
- spin_unlock_bh(&priv->ring[ring].queue_lock);
|
||||
-
|
||||
- queue_work(priv->ring[ring].workqueue,
|
||||
- &priv->ring[ring].work_data.work);
|
||||
-
|
||||
- return ret;
|
||||
-}
|
||||
-
|
||||
static int safexcel_encrypt(struct skcipher_request *req)
|
||||
{
|
||||
return safexcel_queue_req(&req->base, skcipher_request_ctx(req),
|
||||
@@ -1216,6 +1293,8 @@ static int safexcel_skcipher_cra_init(st
|
||||
ctx->base.send = safexcel_skcipher_send;
|
||||
ctx->base.handle_result = safexcel_skcipher_handle_result;
|
||||
ctx->ivmask = EIP197_OPTION_4_TOKEN_IV_CMD;
|
||||
+ ctx->basic_ctr = false;
|
||||
+ ctx->processed = 0;
|
||||
ctx->ctrinit = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -1496,6 +1575,44 @@ struct safexcel_alg_template safexcel_al
|
||||
},
|
||||
};
|
||||
|
||||
+static int safexcel_skcipher_basic_aes_ctr_cra_init(struct crypto_tfm *tfm)
|
||||
+{
|
||||
+ struct safexcel_cipher_ctx *ctx = crypto_tfm_ctx(tfm);
|
||||
+
|
||||
+ safexcel_skcipher_cra_init(tfm);
|
||||
+ ctx->alg = SAFEXCEL_AES;
|
||||
+ ctx->blocksz = AES_BLOCK_SIZE;
|
||||
+ ctx->mode = CONTEXT_CONTROL_CRYPTO_MODE_CTR_LOAD;
|
||||
+ ctx->basic_ctr = true;
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+struct safexcel_alg_template safexcel_alg_basic_ctr_aes = {
|
||||
+ .type = SAFEXCEL_ALG_TYPE_SKCIPHER,
|
||||
+ .algo_mask = SAFEXCEL_ALG_AES,
|
||||
+ .alg.skcipher = {
|
||||
+ .setkey = safexcel_skcipher_aes_setkey,
|
||||
+ .encrypt = safexcel_encrypt,
|
||||
+ .decrypt = safexcel_decrypt,
|
||||
+ .min_keysize = AES_MIN_KEY_SIZE,
|
||||
+ .max_keysize = AES_MAX_KEY_SIZE,
|
||||
+ .ivsize = AES_BLOCK_SIZE,
|
||||
+ .base = {
|
||||
+ .cra_name = "ctr(aes)",
|
||||
+ .cra_driver_name = "safexcel-basic-ctr-aes",
|
||||
+ .cra_priority = SAFEXCEL_CRA_PRIORITY,
|
||||
+ .cra_flags = CRYPTO_ALG_ASYNC |
|
||||
+ CRYPTO_ALG_KERN_DRIVER_ONLY,
|
||||
+ .cra_blocksize = 1,
|
||||
+ .cra_ctxsize = sizeof(struct safexcel_cipher_ctx),
|
||||
+ .cra_alignmask = 0,
|
||||
+ .cra_init = safexcel_skcipher_basic_aes_ctr_cra_init,
|
||||
+ .cra_exit = safexcel_skcipher_cra_exit,
|
||||
+ .cra_module = THIS_MODULE,
|
||||
+ },
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
static int safexcel_des_setkey(struct crypto_skcipher *ctfm, const u8 *key,
|
||||
unsigned int len)
|
||||
{
|
||||
@@ -1724,6 +1841,9 @@ static int safexcel_aead_cra_init(struct
|
||||
ctx->aead = true;
|
||||
ctx->base.send = safexcel_aead_send;
|
||||
ctx->base.handle_result = safexcel_aead_handle_result;
|
||||
+ ctx->basic_ctr = false;
|
||||
+ ctx->processed = 0;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -1,58 +0,0 @@
|
||||
From b241c6831557c3141801dc2f87e839269ef7bad1 Mon Sep 17 00:00:00 2001
|
||||
From: Howard Hsu <howard-yh.hsu@mediatek.com>
|
||||
Date: Fri, 19 Apr 2024 15:43:23 +0800
|
||||
Subject: [PATCH] wifi: mt76: mt7915: adjust rx filter
|
||||
|
||||
Adjust rx filter setting to drop the packet that we do not need to
|
||||
receive.
|
||||
|
||||
Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets")
|
||||
Signed-off-by: Howard Hsu <howard-yh.hsu@mediatek.com>
|
||||
---
|
||||
mt7915/main.c | 11 +++++++----
|
||||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/mt7915/main.c b/mt7915/main.c
|
||||
index 26f9a5a..137e09a 100644
|
||||
--- a/mt7915/main.c
|
||||
+++ b/mt7915/main.c
|
||||
@@ -489,7 +489,8 @@ static int mt7915_config(struct ieee80211_hw *hw, u32 changed)
|
||||
rxfilter |= MT_WF_RFCR_DROP_OTHER_UC;
|
||||
dev->monitor_mask &= ~BIT(band);
|
||||
} else {
|
||||
- rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC;
|
||||
+ rxfilter &= ~(MT_WF_RFCR_DROP_A2_BSSID |
|
||||
+ MT_WF_RFCR_DROP_OTHER_UC);
|
||||
dev->monitor_mask |= BIT(band);
|
||||
}
|
||||
|
||||
@@ -552,13 +553,14 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,
|
||||
MT_WF_RFCR_DROP_MCAST |
|
||||
MT_WF_RFCR_DROP_BCAST |
|
||||
MT_WF_RFCR_DROP_DUPLICATE |
|
||||
- MT_WF_RFCR_DROP_A2_BSSID |
|
||||
MT_WF_RFCR_DROP_UNWANTED_CTL |
|
||||
MT_WF_RFCR_DROP_STBC_MULTI);
|
||||
+ phy->rxfilter |= MT_WF_RFCR_DROP_VERSION;
|
||||
|
||||
MT76_FILTER(OTHER_BSS, MT_WF_RFCR_DROP_OTHER_TIM |
|
||||
MT_WF_RFCR_DROP_A3_MAC |
|
||||
- MT_WF_RFCR_DROP_A3_BSSID);
|
||||
+ MT_WF_RFCR_DROP_A3_BSSID |
|
||||
+ MT_WF_RFCR_DROP_A2_BSSID);
|
||||
|
||||
MT76_FILTER(FCSFAIL, MT_WF_RFCR_DROP_FCSFAIL);
|
||||
|
||||
@@ -569,7 +571,8 @@ static void mt7915_configure_filter(struct ieee80211_hw *hw,
|
||||
*total_flags = flags;
|
||||
rxfilter = phy->rxfilter;
|
||||
if (hw->conf.flags & IEEE80211_CONF_MONITOR)
|
||||
- rxfilter &= ~MT_WF_RFCR_DROP_OTHER_UC;
|
||||
+ rxfilter &= ~(MT_WF_RFCR_DROP_A2_BSSID |
|
||||
+ MT_WF_RFCR_DROP_OTHER_UC);
|
||||
else
|
||||
rxfilter |= MT_WF_RFCR_DROP_OTHER_UC;
|
||||
mt76_wr(dev, MT_WF_RFCR(band), rxfilter);
|
||||
--
|
||||
2.18.0
|
||||
|
||||
53
feeds/qca-wifi-7/ath12k-firmware/Makefile
Normal file
53
feeds/qca-wifi-7/ath12k-firmware/Makefile
Normal file
@@ -0,0 +1,53 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=ath12k-firmware
|
||||
PKG_RELEASE:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
RSTRIP:=:
|
||||
STRIP:=:
|
||||
|
||||
define Package/ath12k-firmware-default
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
URL:=$(PKG_SOURCE_URL)
|
||||
DEPENDS:=
|
||||
endef
|
||||
|
||||
define Package/ath12k-firmware-qcn92xx
|
||||
$(Package/ath12k-firmware-default)
|
||||
TITLE:=ath12k firmware for QCN92XX devices
|
||||
endef
|
||||
|
||||
define Package/ath12k-firmware-qcn92xx/description
|
||||
Standard ath12k firmware for QCN92XX from QCA
|
||||
endef
|
||||
|
||||
define Package/ath12k-firmware-ipq5332
|
||||
$(Package/ath12k-firmware-default)
|
||||
TITLE:=ath12k firmware for IPQ5332 devices
|
||||
endef
|
||||
|
||||
define Package/ath12k-firmware-ipq5332/description
|
||||
Standard ath12k firmware for IPQ5332 from QCA
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
|
||||
endef
|
||||
|
||||
define Package/ath12k-firmware-qcn92xx/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/
|
||||
$(INSTALL_DATA) ./files/QCN92XX/* \
|
||||
$(1)/lib/firmware/ath12k/QCN92XX/hw1.0/
|
||||
endef
|
||||
|
||||
define Package/ath12k-firmware-ipq5332/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/IPQ5332/
|
||||
$(INSTALL_DATA) ./files/IPQ5332/* \
|
||||
$(1)/lib/firmware/IPQ5332/
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ath12k-firmware-qcn92xx))
|
||||
$(eval $(call BuildPackage,ath12k-firmware-ipq5332))
|
||||
13257
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/Data.msc
Executable file
13257
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/Data.msc
Executable file
File diff suppressed because it is too large
Load Diff
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.b00
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.b00
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.b01
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.b01
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.b02
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.b02
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.mdt
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/iu_fw.mdt
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b00
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b00
Executable file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b06
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b06
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b07
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b07
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b08
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b08
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b09
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b09
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b11
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw0.b11
Executable file
Binary file not shown.
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw1.b00
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw1.b00
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw1.b01
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw1.b01
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw1.b02
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/IPQ5332/q6_fw1.b02
Executable file
Binary file not shown.
Binary file not shown.
13798
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/Data.msc
Executable file
13798
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/Data.msc
Executable file
File diff suppressed because it is too large
Load Diff
13768
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/Data_dualmac.msc
Executable file
13768
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/Data_dualmac.msc
Executable file
File diff suppressed because it is too large
Load Diff
BIN
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/amss.bin
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/amss.bin
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/amss_dualmac.bin
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/amss_dualmac.bin
Executable file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/m3.bin
Executable file
BIN
feeds/qca-wifi-7/ath12k-firmware/files/QCN92XX/m3.bin
Executable file
Binary file not shown.
61
feeds/qca-wifi-7/ath12k-wifi/Makefile
Normal file
61
feeds/qca-wifi-7/ath12k-wifi/Makefile
Normal file
@@ -0,0 +1,61 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/version.mk
|
||||
|
||||
PKG_NAME:=ath12k-wifi
|
||||
PKG_RELEASE:=1
|
||||
PKG_FLAGS:=nonshared
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
RSTRIP:=:
|
||||
STRIP:=:
|
||||
|
||||
define Build/Prepare
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
endef
|
||||
|
||||
#
|
||||
# This is intended to be used on an interim basis until device-specific
|
||||
# board data for new devices is available through the upstream compilation
|
||||
#
|
||||
# Please send a mail with your device-specific board files upstream.
|
||||
# You can find instructions and examples on the linux-wireless wiki:
|
||||
# <https://wireless.wiki.kernel.org/en/users/drivers/ath10k/boardfiles>
|
||||
#
|
||||
|
||||
define Package/ath12k-wifi-default
|
||||
SUBMENU:=ath12k Board-Specific Overrides
|
||||
SECTION:=firmware
|
||||
CATEGORY:=Firmware
|
||||
TITLE:=Custom Board
|
||||
endef
|
||||
|
||||
define Package/ath12k-wifi-edgecore-eap105
|
||||
$(call Package/ath12k-wifi-default)
|
||||
TITLE:=board-2.bin for EAP105
|
||||
endef
|
||||
|
||||
define Package/ath12k-wifi-sonicfi-rap7110c-341x
|
||||
$(call Package/ath12k-wifi-default)
|
||||
TITLE:=board-2.bin for RAP7710c_341x
|
||||
endef
|
||||
|
||||
define Package/ath12k-wifi-edgecore-eap105/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/
|
||||
$(INSTALL_DATA) ./board-2.bin.eap105.QCN92XX $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/board-2.bin
|
||||
$(INSTALL_DATA) ./board-2.bin.eap105.IPQ5332 $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/board-2.bin
|
||||
endef
|
||||
|
||||
define Package/ath12k-wifi-sonicfi-rap7110c-341x/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/
|
||||
$(INSTALL_DATA) ./board-2.bin.rap7110c_341x.QCN92XX $(1)/lib/firmware/ath12k/QCN92XX/hw1.0/board-2.bin
|
||||
$(INSTALL_DATA) ./board-2.bin.rap7110c_341x.IPQ5332 $(1)/lib/firmware/ath12k/IPQ5332/hw1.0/board-2.bin
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,ath12k-wifi-edgecore-eap105))
|
||||
$(eval $(call BuildPackage,ath12k-wifi-sonicfi-rap7110c-341x))
|
||||
20
feeds/qca-wifi-7/ath12k-wifi/board-2-eap105-IPQ5332.json
Normal file
20
feeds/qca-wifi-7/ath12k-wifi/board-2-eap105-IPQ5332.json
Normal file
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"board": [
|
||||
{
|
||||
"names": [
|
||||
"bus=ahb,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "eap105-IPQ5332.bin"
|
||||
}
|
||||
],
|
||||
"regdb": [
|
||||
{
|
||||
"names": [
|
||||
"bus=ahb,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "ipq5332.regdb"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
20
feeds/qca-wifi-7/ath12k-wifi/board-2-eap105-QCN92XX.json
Normal file
20
feeds/qca-wifi-7/ath12k-wifi/board-2-eap105-QCN92XX.json
Normal file
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"board": [
|
||||
{
|
||||
"names": [
|
||||
"bus=pci,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "eap105-QCN92XX.bin"
|
||||
}
|
||||
],
|
||||
"regdb": [
|
||||
{
|
||||
"names": [
|
||||
"bus=pci,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "qcn92xx.regdb"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"board": [
|
||||
{
|
||||
"names": [
|
||||
"bus=ahb,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "rap7110c_341x-IPQ5332.bin"
|
||||
}
|
||||
],
|
||||
"regdb": [
|
||||
{
|
||||
"names": [
|
||||
"bus=ahb,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "ipq5332.regdb"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,20 @@
|
||||
[
|
||||
{
|
||||
"board": [
|
||||
{
|
||||
"names": [
|
||||
"bus=pci,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "rap7110c_341x-QCN92xx.bin"
|
||||
}
|
||||
],
|
||||
"regdb": [
|
||||
{
|
||||
"names": [
|
||||
"bus=pci,qmi-chip-id=0,qmi-board-id=255"
|
||||
],
|
||||
"data": "qcn92xx.regdb"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.eap105.IPQ5332
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.eap105.IPQ5332
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.eap105.QCN92XX
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.eap105.QCN92XX
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.rap7110c_341x.IPQ5332
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.rap7110c_341x.IPQ5332
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.rap7110c_341x.QCN92XX
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/board-2.bin.rap7110c_341x.QCN92XX
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/eap105-IPQ5332.bin
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/eap105-IPQ5332.bin
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/eap105-QCN92XX.bin
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/eap105-QCN92XX.bin
Normal file
Binary file not shown.
11
feeds/qca-wifi-7/ath12k-wifi/generate.sh
Executable file
11
feeds/qca-wifi-7/ath12k-wifi/generate.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# https://github.com/qca/qca-swiss-army-knife.git
|
||||
|
||||
encoder=/code/qca/qca-swiss-army-knife/tools/scripts/ath12k/ath12k-bdencoder
|
||||
|
||||
$encoder -c board-2-eap105-IPQ5332.json -o board-2.bin.eap105.IPQ5332
|
||||
$encoder -c board-2-eap105-QCN92XX.json -o board-2.bin.eap105.QCN92XX
|
||||
|
||||
$encoder -c board-2-rap7110c_341x-IPQ5332.json -o board-2.bin.rap7110c_341x.IPQ5332
|
||||
$encoder -c board-2-rap7110c_341x-QCN92XX.json -o board-2.bin.rap7110c_341x.QCN92XX
|
||||
BIN
feeds/qca-wifi-7/ath12k-wifi/ipq5332.regdb
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/ipq5332.regdb
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/qcn92xx.regdb
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/qcn92xx.regdb
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/rap7110c_341x-IPQ5332.bin
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/rap7110c_341x-IPQ5332.bin
Normal file
Binary file not shown.
BIN
feeds/qca-wifi-7/ath12k-wifi/rap7110c_341x-QCN92xx.bin
Normal file
BIN
feeds/qca-wifi-7/ath12k-wifi/rap7110c_341x-QCN92xx.bin
Normal file
Binary file not shown.
881
feeds/qca-wifi-7/hostapd/Makefile
Normal file
881
feeds/qca-wifi-7/hostapd/Makefile
Normal file
@@ -0,0 +1,881 @@
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# Copyright (C) 2006-2021 OpenWrt.org
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=hostapd
|
||||
PKG_RELEASE:=6
|
||||
|
||||
PKG_SOURCE_URL:=http://w1.fi/hostap.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2023-06-22
|
||||
PKG_SOURCE_VERSION:=599d00be9de2846c6ea18c1487d8329522ade22b
|
||||
PKG_MIRROR_HASH:=828810c558ea181e45ed0c8b940f5c41e55775e2979a15aed8cf0ab17dd7723c
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_CPE_ID:=cpe:/a:w1.fi:hostapd
|
||||
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
PKG_ASLR_PIE_REGULAR:=1
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_kmod-ath9k \
|
||||
CONFIG_PACKAGE_kmod-cfg80211 \
|
||||
CONFIG_PACKAGE_hostapd \
|
||||
CONFIG_PACKAGE_hostapd-basic \
|
||||
CONFIG_PACKAGE_hostapd-mini \
|
||||
CONFIG_WPA_RFKILL_SUPPORT \
|
||||
CONFIG_DRIVER_WEXT_SUPPORT \
|
||||
CONFIG_DRIVER_11AC_SUPPORT \
|
||||
CONFIG_DRIVER_11AX_SUPPORT \
|
||||
CONFIG_WPA_ENABLE_WEP
|
||||
|
||||
PKG_BUILD_FLAGS:=gc-sections lto
|
||||
|
||||
EAPOL_TEST_PROVIDERS:=eapol-test eapol-test-openssl eapol-test-wolfssl
|
||||
|
||||
SUPPLICANT_PROVIDERS:=
|
||||
HOSTAPD_PROVIDERS:=
|
||||
|
||||
LOCAL_TYPE=$(strip \
|
||||
$(if $(findstring wpad,$(BUILD_VARIANT)),wpad, \
|
||||
$(if $(findstring supplicant,$(BUILD_VARIANT)),supplicant, \
|
||||
hostapd \
|
||||
)))
|
||||
|
||||
LOCAL_AND_LIB_VARIANT=$(patsubst hostapd-%,%,\
|
||||
$(patsubst wpad-%,%,\
|
||||
$(patsubst supplicant-%,%,\
|
||||
$(BUILD_VARIANT)\
|
||||
)))
|
||||
|
||||
LOCAL_VARIANT=$(patsubst %-internal,%,\
|
||||
$(patsubst %-openssl,%,\
|
||||
$(patsubst %-wolfssl,%,\
|
||||
$(patsubst %-mbedtls,%,\
|
||||
$(LOCAL_AND_LIB_VARIANT)\
|
||||
))))
|
||||
|
||||
SSL_VARIANT=$(strip \
|
||||
$(if $(findstring openssl,$(LOCAL_AND_LIB_VARIANT)),openssl,\
|
||||
$(if $(findstring wolfssl,$(LOCAL_AND_LIB_VARIANT)),wolfssl,\
|
||||
$(if $(findstring mbedtls,$(LOCAL_AND_LIB_VARIANT)),mbedtls,\
|
||||
internal\
|
||||
))))
|
||||
|
||||
CONFIG_VARIANT:=$(LOCAL_VARIANT)
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
CONFIG_VARIANT:=full
|
||||
endif
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
STAMP_CONFIGURED:=$(STAMP_CONFIGURED)_$(CONFIG_WPA_MSG_MIN_PRIORITY)
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11AC_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AC:=y
|
||||
endif
|
||||
|
||||
ifneq ($(CONFIG_DRIVER_11AX_SUPPORT),)
|
||||
HOSTAPD_IEEE80211AX:=y
|
||||
endif
|
||||
|
||||
CORE_DEPENDS = +libubus +libucode +ucode-mod-fs +ucode-mod-nl80211 +ucode-mod-ubus +ucode-mod-uloop +libblobmsg-json +ucode-mod-rtnl
|
||||
|
||||
DRIVER_MAKEOPTS= \
|
||||
CONFIG_ACS=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_DRIVER_NL80211=$(CONFIG_PACKAGE_kmod-cfg80211) \
|
||||
CONFIG_IEEE80211AC=$(HOSTAPD_IEEE80211AC) \
|
||||
CONFIG_IEEE80211AX=$(HOSTAPD_IEEE80211AX) \
|
||||
CONFIG_DRIVER_WEXT=$(CONFIG_DRIVER_WEXT_SUPPORT) \
|
||||
CONFIG_MBO=$(CONFIG_WPA_MBO_SUPPORT) \
|
||||
CONFIG_UCODE=y
|
||||
|
||||
ifeq ($(SSL_VARIANT),openssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=openssl CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lcrypto -lssl
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SSL_VARIANT),wolfssl)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=wolfssl CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lwolfssl
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(SSL_VARIANT),mbedtls)
|
||||
DRIVER_MAKEOPTS += CONFIG_TLS=mbedtls CONFIG_SAE=y
|
||||
TARGET_LDFLAGS += -lmbedcrypto -lmbedx509 -lmbedtls
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),basic)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),mesh)
|
||||
DRIVER_MAKEOPTS += CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
ifeq ($(LOCAL_VARIANT),full)
|
||||
DRIVER_MAKEOPTS += CONFIG_OWE=y CONFIG_SUITEB192=y CONFIG_AP=y CONFIG_MESH=y CONFIG_WPS_NFC=1
|
||||
endif
|
||||
endif
|
||||
|
||||
ifneq ($(LOCAL_TYPE),hostapd)
|
||||
ifdef CONFIG_WPA_RFKILL_SUPPORT
|
||||
DRIVER_MAKEOPTS += NEED_RFKILL=y
|
||||
endif
|
||||
endif
|
||||
|
||||
DRV_DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny
|
||||
|
||||
define Package/hostapd/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Authenticator
|
||||
URL:=http://hostap.epitest.fi/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=hostapd
|
||||
CONFLICTS:=$(HOSTAPD_PROVIDERS)
|
||||
HOSTAPD_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/hostapd
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=full-internal
|
||||
endef
|
||||
|
||||
define Package/hostapd/description
|
||||
This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
|
||||
Authenticator.
|
||||
endef
|
||||
|
||||
define Package/hostapd-openssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=full-openssl
|
||||
DEPENDS+=+PACKAGE_hostapd-openssl:libopenssl
|
||||
endef
|
||||
|
||||
Package/hostapd-openssl/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-macsec
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (macsec)
|
||||
DEPENDS+= @TARGET_ipq||TARGET_ipq50xx||TARGET_ipq60xx||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_ipq807x +kmod-nss-macsec +libopenssl
|
||||
PROVIDES:=hostapd-macsec
|
||||
CONFLICTS:=
|
||||
VARIANT:=macsec
|
||||
endef
|
||||
|
||||
define Package/hostapd-macsec/description
|
||||
This package is Hostapd Authenticator for macsec support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-wolfssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=full-wolfssl
|
||||
DEPENDS+=+PACKAGE_hostapd-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
Package/hostapd-wolfssl/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-mbedtls
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=full-mbedtls
|
||||
DEPENDS+=+PACKAGE_hostapd-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
Package/hostapd-mbedtls/description = $(Package/hostapd/description)
|
||||
|
||||
define Package/hostapd-basic
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r, 11w)
|
||||
VARIANT:=basic
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-openssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-openssl
|
||||
DEPENDS+=+PACKAGE_hostapd-basic-openssl:libopenssl
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-openssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-wolfssl
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-wolfssl
|
||||
DEPENDS+=+PACKAGE_hostapd-basic-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-wolfssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-mbedtls
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r and 11w)
|
||||
VARIANT:=basic-mbedtls
|
||||
DEPENDS+=+PACKAGE_hostapd-basic-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/hostapd-basic-mbedtls/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/hostapd-mini
|
||||
$(call Package/hostapd/Default,$(1))
|
||||
TITLE+= (WPA-PSK only)
|
||||
VARIANT:=mini
|
||||
endef
|
||||
|
||||
define Package/hostapd-mini/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator (WPA-PSK only).
|
||||
endef
|
||||
|
||||
|
||||
define Package/wpad/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Auth/Supplicant (QCA)
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus $(CORE_DEPENDS)
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
URL:=http://hostap.epitest.fi/
|
||||
PROVIDES:=hostapd wpa-supplicant
|
||||
CONFLICTS:=$(HOSTAPD_PROVIDERS) $(SUPPLICANT_PROVIDERS)
|
||||
HOSTAPD_PROVIDERS+=$(1)
|
||||
SUPPLICANT_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/wpad
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=wpad-full-internal
|
||||
endef
|
||||
|
||||
define Package/wpad/description
|
||||
This package contains a full featured IEEE 802.1x/WPA/EAP/RADIUS
|
||||
Authenticator and Supplicant
|
||||
endef
|
||||
|
||||
define Package/wpad-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=wpad-full-openssl
|
||||
DEPENDS+=+PACKAGE_wpad-openssl:libopenssl
|
||||
endef
|
||||
|
||||
Package/wpad-openssl/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-wolfssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=wpad-full-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpad-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
Package/wpad-wolfssl/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-mbedtls
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=wpad-full-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpad-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
Package/wpad-mbedtls/description = $(Package/wpad/description)
|
||||
|
||||
define Package/wpad-basic
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (WPA-PSK, 11r, 11w)
|
||||
VARIANT:=wpad-basic
|
||||
endef
|
||||
|
||||
define Package/wpad-basic/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-openssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11r, 11w)
|
||||
VARIANT:=wpad-basic-openssl
|
||||
DEPENDS+=+PACKAGE_wpad-basic-openssl:libopenssl
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-openssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-wolfssl
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (wolfSSL, 11r, 11w)
|
||||
VARIANT:=wpad-basic-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpad-basic-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-wolfssl/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-mbedtls
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (mbedTLS, 11r, 11w)
|
||||
VARIANT:=wpad-basic-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpad-basic-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/wpad-basic-mbedtls/description
|
||||
This package contains a basic IEEE 802.1x/WPA Authenticator and Supplicant with WPA-PSK, SAE (WPA3-Personal), 802.11r and 802.11w support.
|
||||
endef
|
||||
|
||||
define Package/wpad-mini
|
||||
$(call Package/wpad/Default,$(1))
|
||||
TITLE+= (WPA-PSK only)
|
||||
VARIANT:=wpad-mini
|
||||
endef
|
||||
|
||||
define Package/wpad-mini/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only).
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh
|
||||
$(call Package/wpad/Default,$(1))
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh wpad-mesh
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh/description
|
||||
This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (with 802.11s mesh and SAE support).
|
||||
endef
|
||||
|
||||
define Package/wpad-mesh-openssl
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
DEPENDS+=+PACKAGE_wpad-mesh-openssl:libopenssl
|
||||
VARIANT:=wpad-mesh-openssl
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-openssl/description = $(Package/wpad-mesh/description)
|
||||
|
||||
define Package/wpad-mesh-wolfssl
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (wolfSSL, 11s, SAE)
|
||||
DEPENDS+=+PACKAGE_wpad-mesh-wolfssl:libwolfssl
|
||||
VARIANT:=wpad-mesh-wolfssl
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-wolfssl/description = $(Package/wpad-mesh/description)
|
||||
|
||||
define Package/wpad-mesh-mbedtls
|
||||
$(call Package/wpad-mesh,$(1))
|
||||
TITLE+= (mbedTLS, 11s, SAE)
|
||||
DEPENDS+=+PACKAGE_wpad-mesh-mbedtls:libmbedtls
|
||||
VARIANT:=wpad-mesh-mbedtls
|
||||
endef
|
||||
|
||||
Package/wpad-mesh-mbedtls/description = $(Package/wpad-mesh/description)
|
||||
|
||||
|
||||
define Package/wpa-supplicant/Default
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=WPA Supplicant
|
||||
URL:=http://hostap.epitest.fi/wpa_supplicant/
|
||||
DEPENDS:=$(DRV_DEPENDS) +hostapd-common +libubus
|
||||
EXTRA_DEPENDS:=hostapd-common (=$(PKG_VERSION)-$(PKG_RELEASE))
|
||||
USERID:=network=101:network=101
|
||||
PROVIDES:=wpa-supplicant
|
||||
CONFLICTS:=$(SUPPLICANT_PROVIDERS)
|
||||
SUPPLICANT_PROVIDERS+=$(1)
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=supplicant-full-internal
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-openssl
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-openssl:libopenssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-wolfssl
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=supplicant-full-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mbedtls
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=supplicant-full-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/hostapd-common/config
|
||||
source "$(SOURCE)/Config.in"
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-macsec
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE:=WPA Supplicant (MACSEC)
|
||||
DEPENDS+= @TARGET_ipq||TARGET_ipq50xx||TARGET_ipq60xx||TARGET_ipq95xx||TARGET_ipq53xx||TARGET_ipq807x +kmod-nss-macsec +libopenssl
|
||||
PROVIDES:=wpa-supplicant-macsec
|
||||
CONFLICTS:=
|
||||
VARIANT:=supplicant-macsec
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-macsec/Description
|
||||
WPA Supplicant with MACSEC support.
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-p2p
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (Wi-Fi P2P support)
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211
|
||||
VARIANT:=supplicant-p2p-internal
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh/Default
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
DEPENDS+=@PACKAGE_kmod-cfg80211 @(!TARGET_uml||BROKEN)
|
||||
PROVIDES+=wpa-supplicant-mesh
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-openssl
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (OpenSSL, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-openssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-openssl:libopenssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-wolfssl
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (wolfSSL, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-wolfssl
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-wolfssl:libwolfssl
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mesh-mbedtls
|
||||
$(call Package/wpa-supplicant-mesh/Default,$(1))
|
||||
TITLE+= (mbedTLS, 11s, SAE)
|
||||
VARIANT:=supplicant-mesh-mbedtls
|
||||
DEPENDS+=+PACKAGE_wpa-supplicant-mesh-mbedtls:libmbedtls
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-basic
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (11r, 11w)
|
||||
VARIANT:=supplicant-basic
|
||||
endef
|
||||
|
||||
define Package/wpa-supplicant-mini
|
||||
$(call Package/wpa-supplicant/Default,$(1))
|
||||
TITLE+= (minimal)
|
||||
VARIANT:=supplicant-mini
|
||||
endef
|
||||
|
||||
|
||||
define Package/hostapd-common
|
||||
TITLE:=hostapd/wpa_supplicant common support files
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
endef
|
||||
|
||||
define Package/hostapd-utils
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
TITLE:=IEEE 802.1x Authenticator (utils)
|
||||
URL:=http://hostap.epitest.fi/
|
||||
DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(HOSTAPD_PROVIDERS),PACKAGE_$(pkg)))
|
||||
VARIANT:=*
|
||||
endef
|
||||
|
||||
define Package/hostapd-utils/description
|
||||
This package contains a command line utility to control the
|
||||
IEEE 802.1x/WPA/EAP/RADIUS Authenticator.
|
||||
endef
|
||||
|
||||
define Package/wpa-cli
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
SUBMENU:=WirelessAPD
|
||||
DEPENDS:=@$(subst $(space),||,$(foreach pkg,$(SUPPLICANT_PROVIDERS),PACKAGE_$(pkg)))
|
||||
TITLE:=WPA Supplicant command line control utility
|
||||
VARIANT:=*
|
||||
endef
|
||||
|
||||
define Package/eapol-test/Default
|
||||
TITLE:=802.1x auth test utility
|
||||
SECTION:=net
|
||||
SUBMENU:=WirelessAPD
|
||||
CATEGORY:=Network
|
||||
DEPENDS:=$(DRV_DEPENDS) +libubus
|
||||
endef
|
||||
|
||||
define Package/eapol-test
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (built-in full)
|
||||
VARIANT:=supplicant-full-internal
|
||||
endef
|
||||
|
||||
define Package/eapol-test-openssl
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (OpenSSL full)
|
||||
VARIANT:=supplicant-full-openssl
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(EAPOL_TEST_PROVIDERS))
|
||||
DEPENDS+=+PACKAGE_eapol-test-openssl:libopenssl
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
define Package/eapol-test-wolfssl
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (wolfSSL full)
|
||||
VARIANT:=supplicant-full-wolfssl
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-wolfssl ,$(EAPOL_TEST_PROVIDERS)))
|
||||
DEPENDS+=+PACKAGE_eapol-test-wolfssl:libwolfssl
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
define Package/eapol-test-mbedtls
|
||||
$(call Package/eapol-test/Default,$(1))
|
||||
TITLE+= (mbedTLS full)
|
||||
VARIANT:=supplicant-full-mbedtls
|
||||
CONFLICTS:=$(filter-out eapol-test-openssl ,$(filter-out eapol-test-mbedtls ,$(EAPOL_TEST_PROVIDERS)))
|
||||
DEPENDS+=+PACKAGE_eapol-test-mbedtls:libmbedtls
|
||||
PROVIDES:=eapol-test
|
||||
endef
|
||||
|
||||
|
||||
ifneq ($(wildcard $(PKG_BUILD_DIR)/.config_*),$(subst .configured_,.config_,$(STAMP_CONFIGURED)))
|
||||
define Build/Configure/rebuild
|
||||
$(FIND) $(PKG_BUILD_DIR) -name \*.o -or -name \*.a | $(XARGS) rm -f
|
||||
rm -f $(PKG_BUILD_DIR)/hostapd/hostapd
|
||||
rm -f $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant
|
||||
rm -f $(PKG_BUILD_DIR)/.config_*
|
||||
touch $(subst .configured_,.config_,$(STAMP_CONFIGURED))
|
||||
endef
|
||||
endif
|
||||
|
||||
EXTERNAL_PATCH_DIR:=.
|
||||
|
||||
define Build/Configure
|
||||
$(Build/Configure/rebuild)
|
||||
$(if $(wildcard $(EXTERNAL_PATCH_DIR)/files/hostapd-$(CONFIG_VARIANT).config), \
|
||||
$(CP) $(EXTERNAL_PATCH_DIR)/files/hostapd-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/hostapd/.config \
|
||||
)
|
||||
$(if $(wildcard $(EXTERNAL_PATCH_DIR)/files/wpa_supplicant-$(CONFIG_VARIANT).config), \
|
||||
$(CP) $(EXTERNAL_PATCH_DIR)/files/wpa_supplicant-$(CONFIG_VARIANT).config $(PKG_BUILD_DIR)/wpa_supplicant/.config
|
||||
)
|
||||
endef
|
||||
|
||||
TARGET_CPPFLAGS := \
|
||||
-I$(STAGING_DIR)/usr/include/libnl-tiny \
|
||||
-I$(PKG_BUILD_DIR)/src/crypto \
|
||||
$(TARGET_CPPFLAGS) \
|
||||
-D_GNU_SOURCE \
|
||||
$(if $(CONFIG_WPA_MSG_MIN_PRIORITY),-DCONFIG_MSG_MIN_PRIORITY=$(CONFIG_WPA_MSG_MIN_PRIORITY))
|
||||
|
||||
TARGET_CFLAGS += -ffunction-sections -fdata-sections -flto
|
||||
TARGET_LDFLAGS += -Wl,--gc-sections -flto=jobserver -fuse-linker-plugin -lubox -lubus -lucode -lblobmsg_json -ljson-c
|
||||
|
||||
ifdef CONFIG_PACKAGE_kmod-cfg80211
|
||||
TARGET_LDFLAGS += -lm -lnl-tiny
|
||||
endif
|
||||
|
||||
ifdef CONFIG_WPA_ENABLE_WEP
|
||||
DRIVER_MAKEOPTS += CONFIG_WEP=y
|
||||
endif
|
||||
|
||||
ifeq ($(LOCAL_VARIANT),macsec)
|
||||
TARGET_LDFLAGS += -lcrypto -lssl -lfal -L$(STAGING_DIR)/usr/lib
|
||||
TARGET_CPPFLAGS += \
|
||||
-I$(STAGING_DIR)/usr/include/qca-nss-macsec
|
||||
endif
|
||||
|
||||
define Build/RunMake
|
||||
CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
|
||||
$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)/$(1) \
|
||||
$(TARGET_CONFIGURE_OPTS) \
|
||||
$(DRIVER_MAKEOPTS) \
|
||||
LIBS="$(TARGET_LDFLAGS)" \
|
||||
LIBS_c="$(TARGET_LDFLAGS_C)" \
|
||||
AR="$(TARGET_CROSS)gcc-ar" \
|
||||
BCHECK= \
|
||||
$(if $(findstring s,$(OPENWRT_VERBOSE)),V=1) \
|
||||
$(2)
|
||||
endef
|
||||
|
||||
define Build/Compile/wpad
|
||||
echo ` \
|
||||
$(call Build/RunMake,hostapd,-s MULTICALL=1 dump_cflags); \
|
||||
$(call Build/RunMake,wpa_supplicant,-s MULTICALL=1 dump_cflags) | \
|
||||
sed -e 's,-n ,,g' -e 's^$(TARGET_CFLAGS)^^' \
|
||||
` > $(PKG_BUILD_DIR)/.cflags
|
||||
sed -i 's/"/\\"/g' $(PKG_BUILD_DIR)/.cflags
|
||||
+$(call Build/RunMake,hostapd, \
|
||||
CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
|
||||
MULTICALL=1 \
|
||||
hostapd_cli hostapd_multi.a \
|
||||
)
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
CFLAGS="$$$$(cat $(PKG_BUILD_DIR)/.cflags)" \
|
||||
MULTICALL=1 \
|
||||
wpa_cli wpa_supplicant_multi.a \
|
||||
)
|
||||
+export MAKEFLAGS="$(MAKE_JOBSERVER)"; $(TARGET_CC) -o $(PKG_BUILD_DIR)/wpad \
|
||||
$(TARGET_CFLAGS) \
|
||||
./files/multicall.c \
|
||||
$(PKG_BUILD_DIR)/hostapd/hostapd_multi.a \
|
||||
$(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant_multi.a \
|
||||
$(TARGET_LDFLAGS)
|
||||
endef
|
||||
|
||||
define Build/Compile/hostapd
|
||||
+$(call Build/RunMake,hostapd, \
|
||||
hostapd hostapd_cli \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
wpa_cli wpa_supplicant \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-internal
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-openssl
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-wolfssl
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile/supplicant-full-mbedtls
|
||||
+$(call Build/RunMake,wpa_supplicant, \
|
||||
eapol_test \
|
||||
)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(Build/Compile/$(LOCAL_TYPE))
|
||||
$(Build/Compile/$(BUILD_VARIANT))
|
||||
endef
|
||||
|
||||
define Install/hostapd
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Install/supplicant
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
endef
|
||||
|
||||
define Package/hostapd-common/install
|
||||
$(INSTALL_DIR) $(1)/etc/capabilities $(1)/etc/rc.button $(1)/etc/hotplug.d/ieee80211 $(1)/etc/init.d $(1)/lib/netifd $(1)/usr/share/acl.d
|
||||
$(INSTALL_DATA) ./files/hostapd.sh $(1)/lib/netifd/hostapd.sh
|
||||
$(INSTALL_BIN) ./files/wpad.init $(1)/etc/init.d/wpad
|
||||
$(INSTALL_BIN) ./files/wps-hotplug.sh $(1)/etc/rc.button/wps
|
||||
$(INSTALL_DATA) ./files/wpad_acl.json $(1)/usr/share/acl.d
|
||||
$(INSTALL_DATA) ./files/wpad.json $(1)/etc/capabilities
|
||||
$(INSTALL_DIR) $(1)/usr/share/hostap/
|
||||
$(INSTALL_DATA) ./files/*.uc $(1)/usr/share/hostap/
|
||||
$(INSTALL_BIN) ./files/mpskd $(1)/usr/share/hostap/
|
||||
$(INSTALL_BIN) ./files/mpskd.init $(1)/etc/init.d/mpskd
|
||||
# $(CP) ./files-iwinfo/* $(1)/
|
||||
endef
|
||||
|
||||
define Package/hostapd/install
|
||||
$(call Install/hostapd,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/
|
||||
endef
|
||||
|
||||
Package/hostapd-basic/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-openssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-wolfssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-basic-mbedtls/install = $(Package/hostapd/install)
|
||||
Package/hostapd-mini/install = $(Package/hostapd/install)
|
||||
Package/hostapd-openssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-wolfssl/install = $(Package/hostapd/install)
|
||||
Package/hostapd-mbedtls/install = $(Package/hostapd/install)
|
||||
|
||||
define Package/hostapd-macsec/install
|
||||
$(call Install/hostapd,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd $(1)/usr/sbin/hostapd-macsec
|
||||
endef
|
||||
|
||||
ifneq ($(LOCAL_TYPE),supplicant)
|
||||
ifneq ($(LOCAL_VARIANT),macsec)
|
||||
define Package/hostapd-utils/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/hostapd/hostapd_cli $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
|
||||
define Package/wpad/install
|
||||
$(call Install/hostapd,$(1))
|
||||
$(call Install/supplicant,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wpad $(1)/usr/sbin/
|
||||
$(LN) wpad $(1)/usr/sbin/hostapd
|
||||
$(LN) wpad $(1)/usr/sbin/wpa_supplicant
|
||||
endef
|
||||
Package/wpad-basic/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-basic-mbedtls/install = $(Package/wpad/install)
|
||||
Package/wpad-mini/install = $(Package/wpad/install)
|
||||
Package/wpad-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mbedtls/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-openssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-wolfssl/install = $(Package/wpad/install)
|
||||
Package/wpad-mesh-mbedtls/install = $(Package/wpad/install)
|
||||
|
||||
define Package/wpa-supplicant/install
|
||||
$(call Install/supplicant,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/
|
||||
endef
|
||||
Package/wpa-supplicant-basic/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mini/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-p2p/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-openssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-wolfssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mbedtls/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-openssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-wolfssl/install = $(Package/wpa-supplicant/install)
|
||||
Package/wpa-supplicant-mesh-mbedtls/install = $(Package/wpa-supplicant/install)
|
||||
|
||||
define Package/wpa-supplicant-macsec/install
|
||||
$(call Install/supplicant,$(1))
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_supplicant $(1)/usr/sbin/wpa_supplicant-macsec
|
||||
endef
|
||||
|
||||
ifneq ($(LOCAL_TYPE),hostapd)
|
||||
ifneq ($(LOCAL_VARIANT),macsec)
|
||||
define Package/wpa-cli/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/wpa_cli $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-internal)
|
||||
define Package/eapol-test/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-openssl)
|
||||
define Package/eapol-test-openssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-wolfssl)
|
||||
define Package/eapol-test-wolfssl/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
ifeq ($(BUILD_VARIANT),supplicant-full-mbedtls)
|
||||
define Package/eapol-test-mbedtls/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(CP) $(PKG_BUILD_DIR)/wpa_supplicant/eapol_test $(1)/usr/sbin/
|
||||
endef
|
||||
endif
|
||||
|
||||
# Build hostapd-common before its dependents, to avoid
|
||||
# spurious rebuilds when building multiple variants.
|
||||
$(eval $(call BuildPackage,hostapd-common))
|
||||
#$(eval $(call BuildPackage,hostapd))
|
||||
#$(eval $(call BuildPackage,hostapd-basic))
|
||||
#$(eval $(call BuildPackage,hostapd-basic-openssl))
|
||||
#$(eval $(call BuildPackage,hostapd-basic-wolfssl))
|
||||
#$(eval $(call BuildPackage,hostapd-basic-mbedtls))
|
||||
#$(eval $(call BuildPackage,hostapd-mini))
|
||||
$(eval $(call BuildPackage,hostapd-openssl))
|
||||
#$(eval $(call BuildPackage,hostapd-wolfssl))
|
||||
#$(eval $(call BuildPackage,hostapd-mbedtls))
|
||||
#$(eval $(call BuildPackage,wpad))
|
||||
#$(eval $(call BuildPackage,wpad-mesh-openssl))
|
||||
#$(eval $(call BuildPackage,wpad-mesh-wolfssl))
|
||||
#$(eval $(call BuildPackage,wpad-mesh-mbedtls))
|
||||
#$(eval $(call BuildPackage,wpad-basic))
|
||||
#$(eval $(call BuildPackage,wpad-basic-openssl))
|
||||
#$(eval $(call BuildPackage,wpad-basic-wolfssl))
|
||||
#$(eval $(call BuildPackage,wpad-basic-mbedtls))
|
||||
#$(eval $(call BuildPackage,wpad-mini))
|
||||
$(eval $(call BuildPackage,wpad-openssl))
|
||||
#$(eval $(call BuildPackage,wpad-wolfssl))
|
||||
#$(eval $(call BuildPackage,wpad-mbedtls))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-mesh-openssl))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-mesh-wolfssl))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-mesh-mbedtls))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-basic))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-mini))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-p2p))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-openssl))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-wolfssl))
|
||||
#$(eval $(call BuildPackage,wpa-supplicant-mbedtls))
|
||||
$(eval $(call BuildPackage,wpa-cli))
|
||||
$(eval $(call BuildPackage,hostapd-utils))
|
||||
$(eval $(call BuildPackage,eapol-test))
|
||||
$(eval $(call BuildPackage,eapol-test-openssl))
|
||||
$(eval $(call BuildPackage,eapol-test-wolfssl))
|
||||
$(eval $(call BuildPackage,eapol-test-mbedtls))
|
||||
$(eval $(call BuildPackage,hostapd-macsec))
|
||||
$(eval $(call BuildPackage,wpa-supplicant-macsec))
|
||||
421
feeds/qca-wifi-7/hostapd/files/common.uc
Normal file
421
feeds/qca-wifi-7/hostapd/files/common.uc
Normal file
@@ -0,0 +1,421 @@
|
||||
import * as nl80211 from "nl80211";
|
||||
import * as rtnl from "rtnl";
|
||||
import { readfile, glob, basename, readlink, open } from "fs";
|
||||
|
||||
const iftypes = {
|
||||
ap: nl80211.const.NL80211_IFTYPE_AP,
|
||||
mesh: nl80211.const.NL80211_IFTYPE_MESH_POINT,
|
||||
sta: nl80211.const.NL80211_IFTYPE_STATION,
|
||||
adhoc: nl80211.const.NL80211_IFTYPE_ADHOC,
|
||||
monitor: nl80211.const.NL80211_IFTYPE_MONITOR,
|
||||
};
|
||||
|
||||
const mesh_params = {
|
||||
mesh_retry_timeout: "retry_timeout",
|
||||
mesh_confirm_timeout: "confirm_timeout",
|
||||
mesh_holding_timeout: "holding_timeout",
|
||||
mesh_max_peer_links: "max_peer_links",
|
||||
mesh_max_retries: "max_retries",
|
||||
mesh_ttl: "ttl",
|
||||
mesh_element_ttl: "element_ttl",
|
||||
mesh_auto_open_plinks: "auto_open_plinks",
|
||||
mesh_hwmp_max_preq_retries: "hwmp_max_preq_retries",
|
||||
mesh_path_refresh_time: "path_refresh_time",
|
||||
mesh_min_discovery_timeout: "min_discovery_timeout",
|
||||
mesh_hwmp_active_path_timeout: "hwmp_active_path_timeout",
|
||||
mesh_hwmp_preq_min_interval: "hwmp_preq_min_interval",
|
||||
mesh_hwmp_net_diameter_traversal_time: "hwmp_net_diam_trvs_time",
|
||||
mesh_hwmp_rootmode: "hwmp_rootmode",
|
||||
mesh_hwmp_rann_interval: "hwmp_rann_interval",
|
||||
mesh_gate_announcements: "gate_announcements",
|
||||
mesh_sync_offset_max_neighor: "sync_offset_max_neighbor",
|
||||
mesh_rssi_threshold: "rssi_threshold",
|
||||
mesh_hwmp_active_path_to_root_timeout: "hwmp_path_to_root_timeout",
|
||||
mesh_hwmp_root_interval: "hwmp_root_interval",
|
||||
mesh_hwmp_confirmation_interval: "hwmp_confirmation_interval",
|
||||
mesh_awake_window: "awake_window",
|
||||
mesh_plink_timeout: "plink_timeout",
|
||||
mesh_fwding: "forwarding",
|
||||
mesh_power_mode: "power_mode",
|
||||
mesh_nolearn: "nolearn"
|
||||
};
|
||||
|
||||
function wdev_remove(name)
|
||||
{
|
||||
nl80211.request(nl80211.const.NL80211_CMD_DEL_INTERFACE, 0, { dev: name });
|
||||
}
|
||||
|
||||
function __phy_is_fullmac(phyidx)
|
||||
{
|
||||
let data = nl80211.request(nl80211.const.NL80211_CMD_GET_WIPHY, 0, { wiphy: phyidx });
|
||||
|
||||
return !data.software_iftypes.monitor;
|
||||
}
|
||||
|
||||
function phy_is_fullmac(phy)
|
||||
{
|
||||
let phyidx = int(trim(readfile(`/sys/class/ieee80211/${phy}/index`)));
|
||||
|
||||
return __phy_is_fullmac(phyidx);
|
||||
}
|
||||
|
||||
function find_reusable_wdev(phyidx)
|
||||
{
|
||||
if (!__phy_is_fullmac(phyidx))
|
||||
return null;
|
||||
|
||||
let data = nl80211.request(
|
||||
nl80211.const.NL80211_CMD_GET_INTERFACE,
|
||||
nl80211.const.NLM_F_DUMP,
|
||||
{ wiphy: phyidx });
|
||||
for (let res in data)
|
||||
if (trim(readfile(`/sys/class/net/${res.ifname}/operstate`)) == "down")
|
||||
return res.ifname;
|
||||
return null;
|
||||
}
|
||||
|
||||
function wdev_set_radio_mask(name, mask)
|
||||
{
|
||||
nl80211.request(nl80211.const.NL80211_CMD_SET_INTERFACE, 0, {
|
||||
dev: name,
|
||||
vif_radio_mask: mask
|
||||
});
|
||||
}
|
||||
|
||||
function wdev_create(phy, name, data)
|
||||
{
|
||||
let phyidx = int(readfile(`/sys/class/ieee80211/${phy}/index`));
|
||||
|
||||
wdev_remove(name);
|
||||
|
||||
if (!iftypes[data.mode])
|
||||
return `Invalid mode: ${data.mode}`;
|
||||
|
||||
let req = {
|
||||
wiphy: phyidx,
|
||||
ifname: name,
|
||||
iftype: iftypes[data.mode],
|
||||
};
|
||||
|
||||
if (data["4addr"])
|
||||
req["4addr"] = data["4addr"];
|
||||
if (data.macaddr)
|
||||
req.mac = data.macaddr;
|
||||
if (data.radio != null && data.radio >= 0)
|
||||
req.vif_radio_mask = 1 << data.radio;
|
||||
|
||||
nl80211.error();
|
||||
|
||||
let reuse_ifname = find_reusable_wdev(phyidx);
|
||||
if (reuse_ifname &&
|
||||
(reuse_ifname == name ||
|
||||
rtnl.request(rtnl.const.RTM_SETLINK, 0, { dev: reuse_ifname, ifname: name}) != false)) {
|
||||
req.dev = req.ifname;
|
||||
delete req.ifname;
|
||||
nl80211.request(nl80211.const.NL80211_CMD_SET_INTERFACE, 0, req);
|
||||
} else {
|
||||
nl80211.request(
|
||||
nl80211.const.NL80211_CMD_NEW_INTERFACE,
|
||||
nl80211.const.NLM_F_CREATE,
|
||||
req);
|
||||
}
|
||||
|
||||
let error = nl80211.error();
|
||||
if (error)
|
||||
return error;
|
||||
|
||||
if (data.powersave != null) {
|
||||
nl80211.request(nl80211.const.NL80211_CMD_SET_POWER_SAVE, 0,
|
||||
{ dev: name, ps_state: data.powersave ? 1 : 0});
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
function wdev_set_mesh_params(name, data)
|
||||
{
|
||||
let mesh_cfg = {};
|
||||
|
||||
for (let key in mesh_params) {
|
||||
let val = data[key];
|
||||
if (val == null)
|
||||
continue;
|
||||
mesh_cfg[mesh_params[key]] = int(val);
|
||||
}
|
||||
|
||||
if (!length(mesh_cfg))
|
||||
return null;
|
||||
|
||||
nl80211.request(nl80211.const.NL80211_CMD_SET_MESH_CONFIG, 0,
|
||||
{ dev: name, mesh_params: mesh_cfg });
|
||||
|
||||
return nl80211.error();
|
||||
}
|
||||
|
||||
function wdev_set_up(name, up)
|
||||
{
|
||||
rtnl.request(rtnl.const.RTM_SETLINK, 0, { dev: name, change: 1, flags: up ? 1 : 0 });
|
||||
}
|
||||
|
||||
function phy_sysfs_file(phy, name)
|
||||
{
|
||||
return trim(readfile(`/sys/class/ieee80211/${phy}/${name}`));
|
||||
}
|
||||
|
||||
function macaddr_split(str)
|
||||
{
|
||||
return map(split(str, ":"), (val) => hex(val));
|
||||
}
|
||||
|
||||
function macaddr_join(addr)
|
||||
{
|
||||
return join(":", map(addr, (val) => sprintf("%02x", val)));
|
||||
}
|
||||
|
||||
function wdev_macaddr(wdev)
|
||||
{
|
||||
return trim(readfile(`/sys/class/net/${wdev}/address`));
|
||||
}
|
||||
|
||||
const phy_proto = {
|
||||
macaddr_init: function(used, options) {
|
||||
this.macaddr_options = options ?? {};
|
||||
this.macaddr_list = {};
|
||||
|
||||
if (type(used) == "object")
|
||||
for (let addr in used)
|
||||
this.macaddr_list[addr] = used[addr];
|
||||
else
|
||||
for (let addr in used)
|
||||
this.macaddr_list[addr] = -1;
|
||||
|
||||
this.for_each_wdev((wdev) => {
|
||||
let macaddr = wdev_macaddr(wdev);
|
||||
this.macaddr_list[macaddr] ??= -1;
|
||||
});
|
||||
|
||||
return this.macaddr_list;
|
||||
},
|
||||
|
||||
macaddr_generate: function(data) {
|
||||
let phy = this.phy;
|
||||
let radio_idx = this.radio;
|
||||
let idx = int(data.id ?? 0);
|
||||
let mbssid = int(data.mbssid ?? 0) > 0;
|
||||
let num_global = int(data.num_global ?? 1);
|
||||
let use_global = !mbssid && idx < num_global;
|
||||
|
||||
let base_addr = phy_sysfs_file(phy, "macaddress");
|
||||
if (!base_addr)
|
||||
return null;
|
||||
|
||||
let base_mask = phy_sysfs_file(phy, "address_mask");
|
||||
if (!base_mask)
|
||||
return null;
|
||||
|
||||
if (base_mask == "00:00:00:00:00:00")
|
||||
base_mask = "ff:ff:ff:ff:ff:ff";
|
||||
|
||||
if (data.macaddr_base)
|
||||
base_addr = data.macaddr_base;
|
||||
else if (base_mask == "ff:ff:ff:ff:ff:ff" &&
|
||||
(radio_idx > 0 || idx >= num_global)) {
|
||||
let addrs = split(phy_sysfs_file(phy, "addresses"), "\n");
|
||||
|
||||
if (radio_idx != null) {
|
||||
if (radio_idx && radio_idx < length(addrs))
|
||||
base_addr = addrs[radio_idx];
|
||||
else
|
||||
idx += radio_idx * 16;
|
||||
} else {
|
||||
if (idx < length(addrs))
|
||||
return addrs[idx];
|
||||
}
|
||||
}
|
||||
|
||||
if (!idx && !mbssid)
|
||||
return base_addr;
|
||||
|
||||
let addr = macaddr_split(base_addr);
|
||||
let mask = macaddr_split(base_mask);
|
||||
let type;
|
||||
|
||||
if (mbssid)
|
||||
type = "b5";
|
||||
else if (use_global)
|
||||
type = "add";
|
||||
else if (mask[0] > 0)
|
||||
type = "b1";
|
||||
else if (mask[5] < 0xff)
|
||||
type = "b5";
|
||||
else
|
||||
type = "add";
|
||||
|
||||
switch (type) {
|
||||
case "b1":
|
||||
if (!(addr[0] & 2))
|
||||
idx--;
|
||||
addr[0] |= 2;
|
||||
addr[0] ^= idx << 2;
|
||||
break;
|
||||
case "b5":
|
||||
if (mbssid)
|
||||
addr[0] |= 2;
|
||||
addr[5] ^= idx;
|
||||
break;
|
||||
default:
|
||||
for (let i = 5; i > 0; i--) {
|
||||
addr[i] += idx;
|
||||
if (addr[i] < 256)
|
||||
break;
|
||||
addr[i] %= 256;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return macaddr_join(addr);
|
||||
},
|
||||
|
||||
macaddr_next: function(val) {
|
||||
let data = this.macaddr_options ?? {};
|
||||
let list = this.macaddr_list;
|
||||
|
||||
for (let i = 0; i < 32; i++) {
|
||||
data.id = i;
|
||||
|
||||
let mac = this.macaddr_generate(data);
|
||||
if (!mac)
|
||||
return null;
|
||||
|
||||
if (list[mac] != null)
|
||||
continue;
|
||||
|
||||
list[mac] = val != null ? val : -1;
|
||||
return mac;
|
||||
}
|
||||
},
|
||||
|
||||
wdev_add: function(name, data) {
|
||||
let phydev = this;
|
||||
wdev_create(this.phy, name, {
|
||||
...data,
|
||||
radio: this.radio,
|
||||
});
|
||||
},
|
||||
|
||||
for_each_wdev: function(cb) {
|
||||
let wdevs = nl80211.request(
|
||||
nl80211.const.NL80211_CMD_GET_INTERFACE,
|
||||
nl80211.const.NLM_F_DUMP,
|
||||
{ wiphy: this.idx }
|
||||
);
|
||||
|
||||
let mac_wdev = {};
|
||||
for (let wdev in wdevs) {
|
||||
if (wdev.iftype == nl80211.const.NL80211_IFTYPE_AP_VLAN)
|
||||
continue;
|
||||
if (this.radio != null && wdev.vif_radio_mask != null &&
|
||||
!(wdev.vif_radio_mask & (1 << this.radio)))
|
||||
continue;
|
||||
mac_wdev[wdev.mac] = wdev;
|
||||
}
|
||||
|
||||
for (let wdev in wdevs) {
|
||||
if (!mac_wdev[wdev.mac])
|
||||
continue;
|
||||
|
||||
cb(wdev.ifname);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
function phy_open(phy, radio)
|
||||
{
|
||||
let phyidx = readfile(`/sys/class/ieee80211/${phy}/index`);
|
||||
if (!phyidx)
|
||||
return null;
|
||||
|
||||
let name = phy;
|
||||
if (radio === "" || radio < 0)
|
||||
radio = null;
|
||||
if (radio != null)
|
||||
name += "." + radio;
|
||||
|
||||
return proto({
|
||||
phy, name, radio,
|
||||
idx: int(phyidx),
|
||||
}, phy_proto);
|
||||
}
|
||||
|
||||
const vlist_proto = {
|
||||
update: function(values, arg) {
|
||||
let data = this.data;
|
||||
let cb = this.cb;
|
||||
let seq = { };
|
||||
let new_data = {};
|
||||
let old_data = {};
|
||||
|
||||
this.data = new_data;
|
||||
|
||||
if (type(values) == "object") {
|
||||
for (let key in values) {
|
||||
old_data[key] = data[key];
|
||||
new_data[key] = values[key];
|
||||
delete data[key];
|
||||
}
|
||||
} else {
|
||||
for (let val in values) {
|
||||
let cur_key = val[0];
|
||||
let cur_obj = val[1];
|
||||
|
||||
old_data[cur_key] = data[cur_key];
|
||||
new_data[cur_key] = val[1];
|
||||
delete data[cur_key];
|
||||
}
|
||||
}
|
||||
|
||||
for (let key in data) {
|
||||
cb(null, data[key], arg);
|
||||
delete data[key];
|
||||
}
|
||||
for (let key in new_data)
|
||||
cb(new_data[key], old_data[key], arg);
|
||||
}
|
||||
};
|
||||
|
||||
function is_equal(val1, val2) {
|
||||
let t1 = type(val1);
|
||||
|
||||
if (t1 != type(val2))
|
||||
return false;
|
||||
|
||||
if (t1 == "array") {
|
||||
if (length(val1) != length(val2))
|
||||
return false;
|
||||
|
||||
for (let i = 0; i < length(val1); i++)
|
||||
if (!is_equal(val1[i], val2[i]))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
} else if (t1 == "object") {
|
||||
for (let key in val1)
|
||||
if (!is_equal(val1[key], val2[key]))
|
||||
return false;
|
||||
for (let key in val2)
|
||||
if (val1[key] == null)
|
||||
return false;
|
||||
return true;
|
||||
} else {
|
||||
return val1 == val2;
|
||||
}
|
||||
}
|
||||
|
||||
function vlist_new(cb) {
|
||||
return proto({
|
||||
cb: cb,
|
||||
data: {}
|
||||
}, vlist_proto);
|
||||
}
|
||||
|
||||
export { wdev_remove, wdev_create, wdev_set_mesh_params, wdev_set_radio_mask, wdev_set_up, is_equal, vlist_new, phy_is_fullmac, phy_open };
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user