Compare commits

..

676 Commits

Author SHA1 Message Date
jaspreetsachdev
18ba90f5b4 Merge pull request #613 from Telecominfraproject/v3.0.0-release
V3.0.0 release
2023-12-15 18:09:18 -05:00
John Crispin
9e5d1ae848 ip807x: backport bridge port forwarding patch
Fixes: WIFI-13234
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-15 15:04:07 +01:00
John Crispin
01240ada80 ucentral-schema: update to latest HEAD
e77cd3f radio: force auto channel if a STA is present

Signed-off-by: John Crispin <john@phrozen.org>
2023-12-14 12:14:32 +01:00
John Crispin
7fae3ebb90 ucentral-schema: update to latest HEAD
fd4d755 only check for port usage duplication on non-swconfig devices

Signed-off-by: John Crispin <john@phrozen.org>
2023-12-13 15:31:24 +01:00
John Crispin
00efc6f224 uspot: terminate ACCT sessions upon logoff request
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-13 10:57:35 +01:00
John Crispin
5bf9d31001 ucentral-schema: update to latest HEAD
e2cef05 return a success message before triggering FW upgrade

Signed-off-by: John Crispin <john@phrozen.org>
2023-12-13 10:07:12 +01:00
John Crispin
118dd7d224 ucentral-client: upgrade to latest HEAD
6ca7b2e do not immediatley reply to upgrade commands

Signed-off-by: John Crispin <john@phrozen.org>
2023-12-13 10:06:40 +01:00
John Crispin
559e67036d ucentral-schema: update to latest HEAD
9338ea9 bridge-vlan: track wan ports behind swconfig

Signed-off-by: John Crispin <john@phrozen.org>
2023-12-12 15:26:45 +01:00
John Crispin
c66a1f1fa6 ipq50xx: fix cig wf186h image path
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
John Crispin
9b77fb297c ipq807x: use US country code as default on wf196
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
John Crispin
95dae95031 ipq50xx: Add wf186h to CI builds
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
Arif Alam
a29aadbc90 uspot: fix uam CHAP password and challenge
Add missing last byte in uam CHAP password and challenge

Fixes WIFI-13178

Signed-off-by: Arif Alam <arif.alam@netexperience.com>
2023-12-11 07:37:13 +01:00
OutBack Dingo
753967bf6b ipq807x: remove all Xu related and add OptimCloud support
Signed-off-by: OutBack Dingo <outbackdingo@gmail.com>
2023-12-11 07:37:13 +01:00
John Crispin
9a9f9e1cb9 ucentral-state: reuse timers
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
Ken
4db54ce3d9 ipq50xx: CIG-WF-186W - LEDs are not configurable
Signed-off-by: Ken <xshi@actiontec.com>
2023-12-11 07:37:13 +01:00
Ken
f7f913ab14 ipq50xx: CIG-WF-186W - LEDs are not configurable
Signed-off-by: Ken <xshi@actiontec.com>
2023-12-11 07:37:13 +01:00
John Crispin
6d4788c26f ucentral-state: properly track online state
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
John Crispin
6872bd6964 ucentral-schema: fix stray character in the default config
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
John Crispin
a4a9a7692c netifd: fix vlan-awareness reload
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
John Crispin
c22ad0089c ramips: add yuncore_ax820.yml to CI
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-11 07:37:13 +01:00
Esha Aggarwal
14c6a1a482 ipq50xx: HFCL-ion4x_w Kernel/Firmware upgrade
Fixes: WIFI-13048
Signed-off-by: Esha Aggarwal <esha.aggarwal@hfcl.com>
2023-12-11 07:37:11 +01:00
Esha Aggarwal
984faeae9a ipq60xx: HFCL-ion4x Kernel/Firmware upgrade
Fixes: WIFI-13051
Signed-off-by: Esha Aggarwal <esha.aggarwal@hfcl.com>
2023-12-11 07:37:06 +01:00
Esha Aggarwal
c98c7edc6a ipq60xx: HFCL-ion4x_2 Kernel/Firmware upgrade
Fixes: WIFI-13193
Signed-off-by: Esha Aggarwal <esha.aggarwal@hfcl.com>
2023-12-11 07:37:03 +01:00
Esha Aggarwal
e8b3a76fd9 ipq60xx: HFCL-ion4xi Kernel/Firmware upgrade
Fixes: WIFI-13053
Signed-off-by: Esha Aggarwal <esha.aggarwal@hfcl.com>
2023-12-11 07:36:58 +01:00
Esha Aggarwal
140d8ba1e6 ipq60xx: HFCL-ion4xe Kernel/Firmware upgrade
Fixes: WIFI-13052
Signed-off-by: Esha Aggarwal <esha.aggarwal@hfcl.com>
2023-12-11 07:36:48 +01:00
John Crispin
c4bdf03787 hostapd: fix wpa3 regression
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-01 11:50:25 +01:00
John Crispin
371b287db4 ucentral-schema: update to latest HEAD
75222fe udevstats: fix UCI generation for swconfig ports

Signed-off-by: John Crispin <john@phrozen.org>
2023-12-01 09:59:15 +01:00
John Crispin
3ed959bf25 ipq807x: revert yuncore fap655 back to v4.4 kernel
the BDF is too old to make DFS channels work

Signed-off-by: John Crispin <john@phrozen.org>
2023-12-01 09:56:40 +01:00
HaiBac
0e077cf39a ipq807x: add support for OptimCloud D series
Since QC only supports IPQ5018 + QCN9000 combination perfectly in kernel
4.4, thus remove OptimCloud D series support in ipq807x_v5.4 and migrate
  to ipq807x

Signed-off-by: HaiBac <mail@bacnh.com>
2023-12-01 09:06:10 +01:00
John Crispin
ef0d3c6fdd ipq50xx: fix uncore fap655 base mac
Signed-off-by: John Crispin <john@phrozen.org>
2023-12-01 09:06:10 +01:00
John Crispin
5ca04b5fb8 ipq50xx: fix 5G wifi on yuncore fap655
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-30 12:10:29 +01:00
John Crispin
98453fce9b ath79: fix indio um-305ac compile
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-26 16:53:10 +01:00
John Crispin
f6d6341ba0 ipq807x: fix CIG profile names
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-25 09:45:22 +01:00
jaspreetsachdev
8301bfbf89 Merge pull request #601 from Telecominfraproject/v3.0.0-release
ipq807x: enable CIG wf188/196 for RC1
2023-11-24 14:58:21 -05:00
John Crispin
1e844e2668 ipq807x: enable CIG wf188/196 for RC1
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-24 19:06:22 +01:00
John Crispin
7fa9861cfc ipq807x: update several image paths
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-24 09:31:23 +01:00
John Crispin
6500b62920 hostapd: always create a dummy psk file
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-24 09:24:31 +01:00
John Crispin
9423f9d6ab ipq8074: make the v5.4 profile default for supported boards
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-24 06:15:24 +01:00
John Crispin
75374d2765 hostapd: fix dynamic_vlan
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-22 18:37:43 +01:00
jaspreetsachdev
c8c5f14071 Update build-dev.yml 2023-11-22 14:11:52 +01:00
jaspreetsachdev
f12bbe2cac Update build-dev.yml 2023-11-22 14:11:52 +01:00
Piotr Dymacz
2ed8df9b10 ipq807x: v5.4: eap104: export MCU related pins
Export MCU related 'reset' and 'serial bootloader' pins in sysfs using
'gpio-export' as 'mcu-enable' and 'mcu-bootloader'.

Default configuration of MCU related pins will keep MCU in reset state,
with the serial bootloader enabled.

While at it, fix also trailing white space error in 'gpio_keys' node.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-11-22 13:17:22 +01:00
Piotr Dymacz
85374fbbe6 ipq807x: v5.4: eap104: add pin configs for MCU
This adds configuration for 'reset' and 'serial bootloader' dedicated
pins connected to the on-board CC2652R MCU.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-11-22 13:17:22 +01:00
Piotr Dymacz
4348221b62 ipq807x: v5.4: eap104: fix I2C interface pin configuration
Use correct (taken from 4.4 based sources) pin and bus numbers for the
I2C interface.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-11-22 13:17:22 +01:00
Piotr Dymacz
0036dba689 ipq807x: v5.4: eap104: drop unused audio related nodes
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-11-22 13:17:22 +01:00
Piotr Dymacz
c1a1c21643 ipq807x: v5.4: eap104: enable 'blsp1_uart2'
The 'blsp1_uart2' interface is connected with the on-board MCU.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-11-22 13:17:22 +01:00
Piotr Dymacz
4c495e7be2 ipq807x: eap104: export MCU related pins
Export MCU related 'reset' and 'serial bootloader' pins in sysfs using
'gpio-export' as 'mcu-enable' and 'mcu-bootloader'.

Default configuration of MCU related pins will keep MCU in reset state,
with the serial bootloader enabled.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-11-22 13:17:22 +01:00
Piotr Dymacz
42239fb1ba ipq807x: eap104: add pin configs for MCU
This adds configuration for 'reset' and 'serial bootloader' dedicated
pins connected to the on-board CC2652R MCU. While at it, drop probably
unused 'ble_coex_grant' pin configuration node.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-11-22 13:17:22 +01:00
Scott V. Kamp
89766b187d ipq807x: remove XU series
Signed-off-by: Scott V. Kamp <scott.kamp@optimcloud.com>
2023-11-22 13:16:42 +01:00
John Crispin
eaa9e8585d netifd: backport bridge_isolate patches
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-22 12:17:32 +01:00
John Crispin
89b3f9c6a9 ucentral-schema: update to latest HEAD
f8608f6 enable bridge port isolation for wifi devices

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-22 12:16:15 +01:00
John Crispin
ecfaf9a263 ucentral-state: fix periodic interval on v4.4 kernel
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-22 06:55:43 +01:00
John Crispin
5d43925874 mediatek: fix mac addr assignment on eap111
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-21 14:57:25 +01:00
John Crispin
d2af552c5a rrmd: make the global_ban option default:true
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-20 14:09:48 +01:00
John Crispin
b60c18ea3d hostapd: add back the wds 4aadr mode hack
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-20 11:53:56 +01:00
John Crispin
2e3de0eb66 hostapd: sync built-in version
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-20 08:34:25 +01:00
John Crispin
49dcafdbff ucode: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-20 08:32:58 +01:00
John Crispin
3beecaa683 libubox: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-20 08:32:46 +01:00
John Crispin
5240ac395f hostapd: fix wpa3 modes
the latest netifd update sets auth_type differently. adapt hostapd.sh for this.

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-17 16:48:42 +01:00
John Crispin
56e0b3b50c hostapd: globally ban clients when they are kicked
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-17 08:54:26 +01:00
John Crispin
daf67c582f ucentral-state: trigger state and health using the new uloop.interval API
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-16 16:33:41 +01:00
John Crispin
dfbbb01ea9 ipq50xx: update the ath11k-macs patch
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-16 09:05:59 +01:00
John Crispin
b4faeefc29 ucentral-schema: update to latest HEAD
29d6715 make it possible to set vlan_awareness for STA interfaces

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-15 15:59:27 +01:00
John Crispin
2416019d87 mac80211: apply wds fix
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-15 11:23:24 +01:00
John Crispin
d3c0df1a4f netifd: update to latest HEAD
fixes various STA issues

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-15 11:22:33 +01:00
John Crispin
009c003b48 mediatek: add factory image support for eap111
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-14 16:55:16 +01:00
John Crispin
8f7369a71c rrmd: allow kicking clients globally of from the AP
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-14 16:54:09 +01:00
John Crispin
78eb88ed26 ucentral-schema: update to latest HEAD
950bd83 fix NTP enable logic

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-14 15:58:31 +01:00
John Crispin
a48e7ce72e ucentral-schema: update to latest HEAD
b6da915 make interface.isolate-hosts imply bridge port and ap isolation

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-14 12:33:56 +01:00
HaiBac
d804a61cd6 ipq50xx: add optimcloud D series support
Signed-off-by: HaiBac <mail@bacnh.com>
2023-11-14 11:09:27 +01:00
John Crispin
04f10325a1 switch-fabric: fix port mirroring
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-14 11:08:19 +01:00
John Crispin
2f5b612837 busybox: fix udhcpc endless loop
if the interface is down due to ip-collide detection, config apply
fail as the dnsmasq init script would loop endlessly.

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-09 12:30:29 +01:00
John Crispin
b0ef1b3221 ucentral-schema: update to latest HEAD
b287fee prevent duplicate usage of untagged ports

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-09 08:54:47 +01:00
John Crispin
6d3cc970da ucentral-schema: update to latest HEAD
16ef7bc tip name and serial fields are swapped when triggering a wifi scan

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-09 07:28:48 +01:00
John Crispin
2e5c9fbeb8 ucentral-schema: update to latest HEAD
7615f04 allow preventing downstream interfaces from reaching rfc1918 subnets

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-07 14:05:29 +01:00
John Crispin
546a7df54d ucentral-schema: update to latest HEAD
2b884b3 fix state messages on single port devices

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-07 11:29:37 +01:00
John Crispin
b1c9f75fc8 ucentral-schema: update to latest HEAD
eff094d ipv4/dhcp - allow setting a DNS server that clients shall use

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-07 11:13:30 +01:00
John Crispin
14ba074b95 firstcontact: also write server to UCI
the server is now stored in /etc/ucentral/gateway.json. keep old
behaviour aswell.

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-07 07:06:04 +01:00
John Crispin
4612fcfa00 ucentral-schema: update to latest HEAD
7b4cb42 always enable rrm until the new data model is added
3d9bd65 add channel utilization and assoc count to wifi scan results

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-07 07:01:37 +01:00
John Crispin
e32a9de55f uspot: add ipt script that was accidentally dropped
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-06 14:55:12 +01:00
John Crispin
0c4f7e9e9d netifd: update to latest HEAD
40ed736 device: fix build error on 32 bit systems

Signed-off-by: John Crispin <john@phrozen.org>
2023-11-06 14:39:23 +01:00
John Crispin
af9a47ad72 hostapd: add ieee8021x wired patches to v4.4 kernel
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-06 06:02:41 +01:00
Ken
d6f0a1a2cf ipq50xx: CIG-WF186h Kernel/Firmware upgrade
Upgrade to 5018 ath11k 12.0 wireless driver +  kernel 5.4

Fixes: WIFI-13038
Signed-off-by: Ken <xshi@actiontec.com>
2023-11-03 10:02:59 +01:00
wingate.chi
2b8e68551e ipq5018: Update EWW631-B1 to support 512M Memory
Signed-off-by: wingate.chi <wingate.chi@cybertan.com.tw>
2023-11-03 10:00:10 +01:00
John Crispin
b2ad71e97d ieee8021x: replace c code with ucode
Signed-off-by: John Crispin <john@phrozen.org>
2023-11-03 09:39:38 +01:00
John Crispin
f1363f70e9 ucentral-schema: update to latest HEAD
a473a2d fix CS1/UP1 WMM mapping

Fixes: WIFI-13004
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-23 10:08:37 +02:00
John Crispin
10c765076c ipq50xx: make 5G radio work on eap104
Fixes: WIFI-13098
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-23 09:22:32 +02:00
John Crispin
35c36a9bff ucentral-schema: update to latest HEAD
6b85f3f add channel survey to state messages

Fixes: WIFI-13099
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-23 09:01:34 +02:00
Piotr Dymacz
bd1ff8c649 Revert "feeds: ucentral: include BlueZ 5.66"
This reverts commit 8111566f35.

After switching to 'OpenWrt 23.05' release tree we no longer need
separate BlueZ 5.66 package as it's available in upstream feed.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-10-23 08:38:45 +02:00
Piotr Dymacz
e976d56575 ipq807x: ipq5018: fix EdgeCore EAP104 pinctrl configuration
Drop 'phy_led_pins' node which duplicates configuration for 'gpio46',
used in different place ('led_cloud' node). This solves below error:

'pin GPIO_46 already requested by 1000000.pinctrl; cannot claim for leds'

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-10-23 08:38:26 +02:00
John Crispin
99f6881a36 hostapd: add internal radius server
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-23 08:38:02 +02:00
John Crispin
de2fb200a2 hostapd: add rate-limit to FT
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-23 08:38:02 +02:00
John Crispin
c8835ec6ba ipq807x: enable HEARTBEAT trigger by defaukt
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-06 12:40:54 +02:00
John Crispin
7e52502793 ucentral-schema: update to latest HEAD
01e80a6 add delta counters for upstream vlan interfaces
0aaefff fix generation of udevstats config

Signed-off-by: John Crispin <john@phrozen.org>
2023-10-05 10:27:13 +02:00
Tanya Singh
e2f0258407 ipq50xx: Update ETH port MAC address assignment for OAP101 series APs
Fixes: WIFI-12980
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-10-05 10:26:47 +02:00
John Crispin
64cfe870ec hostapd: make the ubus binding aware of the wired driver
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-05 09:53:22 +02:00
John Crispin
265c289235 qca-kernel: disable SWITCHDEV
this broke wired ports that are not part of a bridge

Signed-off-by: John Crispin <john@phrozen.org>
2023-10-05 09:52:48 +02:00
John Crispin
f822dce124 .github/workflows: drop wifi-4 targets
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-04 06:18:33 +02:00
John Crispin
7d090a8363 ipq807x: fix edgecore OAP102 image name
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-04 06:17:46 +02:00
John Crispin
1a889b1ebe uspot: improve CoA handling in case of a hostapd restart
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-04 06:17:22 +02:00
John Crispin
0df37f97d8 profiles: fix ath10k includes
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-03 18:53:42 +02:00
John Crispin
fa1c620df3 ucentral-schema: update to latest HEAD
d42d7c0 add delta counters to state messages

Fixes: WIFI-12914
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-03 10:00:49 +02:00
John Crispin
ad6f4241c4 gen_config.py: automatically flush target feeds
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-03 07:22:49 +02:00
John Crispin
dba8d27d19 23.05: rebase on 23.05-rc4
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-03 07:22:31 +02:00
John Crispin
f7c79205e9 hostapd: sync hot-reload with latest upstream
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-03 07:21:51 +02:00
John Crispin
1205d0e5b6 .github/workflows: disable OAP100
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-03 06:31:34 +02:00
John Crispin
b4f73f165d ucode: enable NL80211_ATTR_NOT_IMPLEMENTED for ipq40xx
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-03 06:30:57 +02:00
John Crispin
ebdce386e4 uspot: make CoA work with radius-gw-proxy
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 18:50:52 +02:00
John Crispin
fcc7b8dfac hostapd: drop hostapd-common dependency
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 17:55:20 +02:00
John Crispin
9a04d5cb66 uspot: add CoA support
Fixes: WIFI-12103
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 17:20:45 +02:00
Tanya Singh
e185a49c5b ipq807x: Support OAP102
Fixes: WIFI-12794
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-10-02 12:55:33 +02:00
John Crispin
11bc8c143e mediatek: fix eap111 uboot-env and image meta-data
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 12:38:13 +02:00
John Crispin
05bab57b1d netifd: remove stray patch
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 11:22:31 +02:00
John Crispin
773040e099 ustream: switch to openssl
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 11:20:16 +02:00
John Crispin
47fe3e420e ipq950xx 2023-10-02 11:19:50 +02:00
John Crispin
2e0301cacb ucode: add EHT support
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 11:19:22 +02:00
Ken
3c868746a0 ipq807x: CIG WF186w: support port and autoNego setting from user space
Fixes: WIFI-12963
Signed-off-by: Ken <xshi@actiontec.com>
2023-10-02 11:09:00 +02:00
John Crispin
4cdb20fea4 ipq50xx: fix cig wf186w support
Fixes: WIFI-12962
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 11:07:40 +02:00
John Crispin
08ded0c3f9 ucentral-schema: update to latest HEAD
aa79c72 add EHT support to data model
0a77e9c add EHT detection to phy.uc

Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 11:07:40 +02:00
John Crispin
0080a5fb15 ipq95xx: make the target work with the full stack
Signed-off-by: John Crispin <john@phrozen.org>
2023-10-02 11:07:40 +02:00
Tanya Singh
bd67a6646a WIFI-12964: Update rootfs for OAP101 series AP
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-10-01 14:38:37 +02:00
John Crispin
8706a596e1 ipq9574: update kernel and network drivers to v5.4
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-29 15:32:38 +02:00
John Crispin
aa245da361 ipq9574: add wifi hot-reload
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-29 13:22:13 +02:00
Tanya Singh
171607a03d ipq8074: Fix sysupgrade for OAP101 series
Fixes: WIFI-12960
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-09-28 14:52:07 +02:00
John Crispin
9ec40d6baa rrm: add background scanning
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
d824ff4cf5 libwebsockets: add back library package
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
81862f70db hostapd: update to latest hot-reload
ipq807x_v5.4/hostapd/0001-hostapd-fix-client-ban_time.patch
ipq807x_v5.4/hostapd/0002-hostapd-use-phy-name-for-hostapd-interfaces-instead-.patch
ipq807x_v5.4/hostapd/0003-hostapd-fix-ewma-for-mgmt-frame-signal-strength.patch
ipq807x_v5.4/hostapd/0004-hostapd-enable-coredumps.patch
ipq807x_v5.4/hostapd/0005-hostapd-fix-crash-on-disabling-an-interface-during-c.patch

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
0f0a861a6d ipq50xx: add qcom-ipq5018-cig-wf186w.dts
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
Tanya Singh
c4b49e5190 ipq50xx: Support OAP101 and OAP101e-6E (update board files for OAP101e and OAP101e-6E)
Fixes: WIFI-12943
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-09-28 14:52:07 +02:00
John Crispin
5f787d92bb ucentral-client: update to latest HEAD
3025bf9 add certupdate command

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
ee30e1c9c1 ucentral-schema: update to latest HEAD
4cfe432 add certupdate command handler

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
1841c74d16 certificates: improve the certupdate script
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
1c2e5c91d9 usteer2: rename to rrmd
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
203f5ca2e6 ucentral-schema: update to latest HEAD
1fe5413 add transfer command handler

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:07 +02:00
John Crispin
75be792560 firstcontact: convert to using gateway.json
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:52:05 +02:00
Felix Fietkau
d321c9c3a9 ipq807x_v5.4: fix kernel live renaming patch
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-28 14:51:48 +02:00
John Crispin
98d0f7b285 ucentral-schema: update to latest HEAD
41e3b03 revert "public_ip_lookup" patch
a711d79 add wifi-bands to admin-ui
a83832d trigger ucentral-state reload once apply is complete
cbb858d add admin-ui support
a1ff9ba unify the state uci file
aae470c set default port for uhttpd
acb08a4 trigger health/state via the new state daemon

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:47 +02:00
John Crispin
0cbe985599 ucentral-client: update commit hash after rebase
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00
John Crispin
e61b923048 maverick: remove old code
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00
John Crispin
39ca4eedaa ucentral-state: add admin_ui support
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00
John Crispin
ce20001751 certificates: decouple mount and copy logic
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00
Tanya Singh
3b68f33298 ipq50xx: Support OAP101 and OAP101e-6E
Fixes: WIFI-12943
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-09-28 14:51:28 +02:00
John Crispin
aea4c20bfa ucentral-schema: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00
John Crispin
79d5972643 23.05: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00
John Crispin
539e288247 ipq807x: add cig-wf186w support to v5.4 kernel
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:28 +02:00
John Crispin
5ff383df91 ucentral-state: add unified state management
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:51:26 +02:00
John Crispin
eef130b2fe 23.05: update to latest release branch
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
6517fff793 mediatek: add edgecore eap111 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
2c6cc0d1d7 luci: remove dependency on ancient commit
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
ba5fd5f252 unetd: set proper dependencies
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
eb1003f215 ucentral-client: 23.05 time_t format fix
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
ec613bb6f7 usb-console: drop unused code
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
ce1448b770 udevmand: make it work with latest musl
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
8801e89090 ipq40xx: add target feed
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:27 +02:00
John Crispin
2947136db9 ipq807x: make the target work on 23.05
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
554e4fd90f ipq807x: add kernel modules Makefiles
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
771fc7f369 profiles: fixes and cleanups
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
0a2cc59f49 23.05: various ipq807x_v5.4 fixes
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
1617b399c1 23.05: drop ucode-mod-bpf backport
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
4dae21fbdb 23.05: drop firewall4 backport
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
0dd9f0e042 23.05: drop ucode backport
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
49959b644b 23.05: drop the libwebsockets backport
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
5236542275 23.05: point the config at the latest openwrt release
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
73d949cf3f 23.05: update patches
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-28 14:50:26 +02:00
John Crispin
d9f237b450 hostapd: update to latest hot reload
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-25 11:52:41 +02:00
John Crispin
4f5a3b0c2b ucentral-schema: update to latest HEAD
Fixes: WIFI-12956
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-25 07:10:33 +02:00
John Crispin
007cfe9c16 ipq807x: update ifname rename patches
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-19 06:44:06 +02:00
Ken
52884b2835 ipq807x: CIG wf660ag: support both EMMC and SPI NOR+EMCC H/W
Using one firmware to support the board which has EMMC only and SPI NOR+EMMC equipped

Fixes: WIFI-12941
Signed-off-by: Ken <xshi@actiontec.com>
2023-09-18 16:19:17 +02:00
John Crispin
6a6af16f48 hostapd: add CSA event
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-18 15:58:39 +02:00
John Crispin
2818722b19 usteer2: improve gateway command handling
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-18 15:58:39 +02:00
John Crispin
194eba2d21 ucentral-schema: update to latest HEAD
e99eaf9 add rrm cmd handler

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-18 15:58:39 +02:00
John Crispin
3d41a22fba ucentral-client: update to latest HEAD
3bbcd36 handle rrm command

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-18 09:56:50 +02:00
John Crispin
acd4b79dd4 ipq807x: backport latest wifi hot-reload to v5.4 kernel
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-17 06:50:23 +02:00
John Crispin
befac1e065 netifd: backport vlan rewrite
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-16 17:29:49 +02:00
John Crispin
7e4e221ccb netifd: add dynamic interface patch
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-16 17:29:49 +02:00
Felix Fietkau
1d9b69ee6f hostapd: add vlan reload support and ap+sta fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-16 17:29:49 +02:00
Felix Fietkau
018f20119d netifd: add wireless vlan/sta fix
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-16 17:29:49 +02:00
Felix Fietkau
9a6e41adb8 hostapd: fix ucode reload issues
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-16 17:29:49 +02:00
Felix Fietkau
970b22856f mac80211: fix reconfiguration on DFS channels in non-ETSI regdomains
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-16 17:29:49 +02:00
Felix Fietkau
95032994fe hostapd: move ubus.c changes from patches to src
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-09-16 17:29:49 +02:00
John Crispin
48cda63dc5 hostapd: backport latest reload patches
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-16 17:29:49 +02:00
Ken
8e9f79964a ipq807x: Apply CE TX power to wf-186w
Apply CE TX power for WF186w and WF186H include FCC as well.

Fixes: WIFI-12920
Signed-off-by: Ken <xshi@actiontec.com>
2023-09-16 17:20:11 +02:00
John Crispin
3c7df86373 certificates: fix mounting on cig,wf186w|cig,wf186h
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-16 17:20:11 +02:00
Ken
38e6aee074 ipq807x: BSP patch for WF-186H
Fixes: WIFI-12922
Signed-off-by: Ken <xshi@actiontec.com>
2023-09-16 17:19:55 +02:00
John Crispin
0a13684bb6 ipq807x: fix certificates mounting in dual-boot scenario on yuncore,fap655
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-16 17:17:15 +02:00
John Crispin
e7ca6e8455 hostapd: fix ft-anonce behavior for broken clients
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-13 16:37:12 +02:00
John Crispin
f17e635d34 ucentral-schema: update to latest HEAD
f113e61 fix uci for network devices that have a dot in the name

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-13 16:35:50 +02:00
John Crispin
90e78c6068 ucentral-schema: update to latest HEAD
58d7d72 fix beacon rates

Fixes: WIFI-12935
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-12 16:58:23 +02:00
John Crispin
550bb6fb7e hostapd: update the snooping patch
Fixes: WIFI-12929
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-12 16:18:01 +02:00
John Crispin
b3a0ebe534 ipq807x: disable SWITCHDEV support
It is not used by the firmware.

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-12 16:16:43 +02:00
John Crispin
6d16e50bbe ipq807x: do not include kmod-qca-nss-drv-bridge-mgr
This was causing issues with bridge-vlans that have mixed tagged and untagged ports.

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-12 16:16:04 +02:00
Paul White
513eec1c5f ipq807x: cig.wf186w: Add MPSK Dynamic VLAN support
When a MPSK VLAN netdev is created on the cig.wf186w board, this script
will configure switch0 via swconfig for the corresponding VLAN

Signed-off-by: Paul White <paul@shasta.cloud>
2023-09-12 04:15:24 +02:00
Paul White
6a797e8a64 ucentral-schema: cig.wf186w: wan_port set to eth0
Reset the ucentral UCI config 'event.config.wan_port' to eth0 for
the WF186W board

Signed-off-by: Paul White <paul@shasta.cloud>
2023-09-12 04:15:24 +02:00
John Crispin
082134bc43 ucentral-schema: update to latest HEAD
fd6a079 dhcp-relay: dhcp relay option 82 parameters

Signed-off-by: John Crispin <john@phrozen.org>
2023-09-11 07:31:55 +02:00
Arif Alam
03ec2de777 ucentral-event: dhcp relay option 82 parameters
Add the ability to configure circuit-id and remote-id sub-options.

Signed-off-by: Arif Alam <arif.alam@netexperience.com>
2023-09-11 07:29:17 +02:00
John Crispin
989d39d1f2 ucentral-schema: update to latest HEAD
a4c8a13 increase reassociation_deadline to 3s when using multi-psk

Fixes: WIFI-12598
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-06 16:15:11 +02:00
John Crispin
b6b298ad68 hostapd: fix association of clients on Open/VLAN SSIDs
Fixes: WIFI-12929
Signed-off-by: John Crispin <john@phrozen.org>
2023-09-06 16:14:42 +02:00
Ken
be1cb862f1 ipq807x: CIG WF-186w - Adjust the LAN ID to match printed labels
Fixes: WIFI-12915
Signed-off-by: Ken <xshi@actiontec.com>
2023-09-06 11:55:01 +02:00
John Crispin
eb6e95f760 hostapd: add proxy-state to DAS frames
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
f04eb1d604 netifd: revert upstream wpa3 cypher fixes
Fixes: WIFI-12906
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
cc1512e42a CI: fix oap101_/-e profile name
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
88d6633c85 ipq807x: update the eap101 BDF
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
1773435a2c .github/workflows: drop ununsed targets
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
cf12abc92e ucentral-schema: update to latest HEAD
708b1de override dynamic_authorization settings when radius-gw-proxy is enabled

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
d8c4b1f0e2 ucentral-schema: update to latest HEAD
81a786d add radius support to the ieee8021x service
ee0a87c ethernet port UCI sections should be named to prevent duplicate sections

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
45cbd5d93a ipq95xx: fix sysupgrade on reference kit
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
2646db0826 ipq807x: update NSS patch
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
0289ea7293 ipq95xx: basic uci support for wifi-7
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
c02c293651 ipq95xx: enable wifi-7
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
e6786115cc ipq807x: add more v5.4 profiles
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:36 +02:00
John Crispin
89b9596e27 ipq807x: fix edgecore_oap101_6e profile name
Fixes: WIFI-12882
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
23cd3b3e99 ucentral-schema: update to latest HEAD
e5ff553 channel 40 was not set correctly during wifi-scan

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
5a8cf73137 mac80211: fix ath11k mimo/nss calculation
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
79dfb1e861 ieee8021x: update to latest HEAD
560fe30 allow the use of an external AAA server

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
4eb30ba080 mac80211: drop hostapd dependency
This fixes build dependency errors introduced by the latest wifi hot reload update.

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
1829c9c96f hostapd: update builtin version to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
fa2424750b netifd: update to latest HEAD
Fixes: WIFI-12878
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
441cb82d32 ucentral-schema: update to latest HEAD
0220fbc fix a null expression in capabilities code

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
c34d346b57 hostapd: update v5.4 version to latest hot-reload version
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
Ken
f7a766be20 ipq807x: CIG WF188n: wrong wan mac address
eth0 is configured as WAN but set with LAN mac.

Fixes: WIFI-12869
Signed-off-by: Ken <xshi@actiontec.com>
2023-08-31 16:08:35 +02:00
Ken
54e8411980 ipq807x: CIG-WF Apply FCC TX power to 660a (20230804)
Add new FCC tx power, MD5 79a4b5cd48bcd8de82d3f0d30cc57cca

Fixes: WIFI-12873
Signed-off-by: Ken <xshi@actiontec.com>
2023-08-31 16:08:35 +02:00
John Crispin
09ebd5f406 hostapd: more hot-reload backports
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
44aef94d82 ath11k: fix capability recalc when changing the mimo mask
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
aeac214236 hostapd: backport more hot-reload fixes
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
81f8a368d1 hostapd: mimo was not always applied correctly
Fixes: WIFI-12854
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
cde9d148b8 netifd: update to latest HEAD
Fixes: WIFI-12854
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
b1bf054d74 ucentral-schema: update to latest HEAD
2defc8e fix mimo 3x3 calculation

Fixes: WIFI-12854
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
wingate.chi
18100e0b4e ipq807x: update qca-thermald
Let qca thermald support IPQ50xx platform and has cooling function to limit the
duty cycle of tx queues

Signed-off-by: wingate5678 <wingate.chi@cybertan.com.tw>
2023-08-31 16:08:35 +02:00
John Crispin
42f0c520da ucentral-schema: update to latest HEAD
5df48b7 fix malformed beacon when enabling TIP OUI

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
fbee159481 hostapd: backport 2 hot-reload fixes
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
ca4a4365d6 ucentral-schema: update to latest HEAD
ea269d6 add strict validation support

Fixes: WIFI-12852
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
54ffbadc2d ipq807x: enable dual-boot on cig,wf186w
Fixes: WIFI-12761
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
Ken
a4cd9cb03b ipq807x: Apply FCC TX power to 186w and 660a
Fixes: WIFI-12864
Signed-off-by: Ken <xshi@actiontec.com>
2023-08-31 16:08:35 +02:00
John Crispin
f3406891b2 ucentral-client: update to latest HEAD
d898a7a prevent ip-collide script and apply task running in parallel

Fixes: WIFI-12849
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
6f7c5995ad ipq807x: fix eap102-ath12 image path
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
8046c336c3 ipq807x: add more ath12 profiles to CI
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
c39f92eea7 ucentral-schema: update to latest HEAD
5746d3d make the wifi scanning code aware of the TIP OUI

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
37d1da8b01 ucentral-event: always respawn the service
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
6f65229d66 ucentral-event: fix possible null pointer deref
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
7bf62b76bd hostapd: fix stray unused interfaces in the hot reload code
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
693e147cd9 ucentral-schema: update to latest HEAD
122135c add becaon-adverrtisment support using TIP IE

Fixes: WIFI-12535
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
eab2445d14 mac80211: hot-reload backport added an unknown option
acs_survey is not known by the QCA hapd, revert to the previous value

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
5c53054de9 mac80211: hot reload was not working reliably when going from single STA to any other mode
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
1866ffcccc ipq807x: make cig wf-188n work on v5.4 kernel
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
5c7fe1a0fa mac80211: hot reload was not working reliably when going from single STA to any other mode
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
672578af01 mac80211: update v5.4 patches
add recent patches made to the v4.4 kernel to the v5.4 kernel

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
9c27a4b878 unetd: improve kernel dependencies for v5.4 kernel
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
4cf4a5152e ipq807x: update v5.4 patches
add recent patches made to the v4.4 kernel to the v5.4 kernel

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
7daf37be9e ucentral-schema: update to latest HEAD
fa2cdb2 add tip-information-element support

Fixes: WIFI-12535
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
7975de1101 ipq807x: add eap102 v5.4 profile
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
Gg
2d1bbeedd9 ipq807x: Add the corresponding software content for the <wallys-dr5018> hardware device
Fixes: WIFI-12804
Signed-off-by: Gg <gxg@wallystech.com>
2023-08-31 16:08:35 +02:00
John Crispin
e0fc96b950 ucentral-schema: add qos-class example
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
835909f3cc hostapd: fix a use-after-free bug
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
Felix Fietkau
e02d9261df add missing patch for hostapd update
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-08-31 16:08:35 +02:00
John Crispin
2f7a1e5952 ucentral-event: fix dynamic vlan
since the latest netifd update, dynamic vlans need to be set to untagged explicitly

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
0ad0aa8255 netifd: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
4db35c127b ucentral-schema: update to latest HEAD
6de905f add QoS classes and services

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
f6ae95da15 qosify: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
daec2bef52 hostapd: fix compile error introduced by recent update
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
4e5e483743 ucentral-schema: update to latest HEAD
249788e fix state messages when no devices are configured

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
ea1cb7a4a6 ucentral-schema: update to latest HEAD
36f815c fix static upstream interfaces

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
ce33b86c6f hostapd: update wifi-reload code
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
8e0e4d81d8 netifd: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
74616bda9a qca-ssdk: fix max vlan support on qca8337
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
47afa20ff1 ipq807x_v5.4: fix maple/oap101-(6)e support
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
b4c68157c8 ath11k-wifi: add new wf188n BDF files
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:35 +02:00
John Crispin
5dd721b206 ucentral-schema: update to latest HEAD
19f4910 allow setting proto: none on ipv4 interfaces
3f98df2 Fix definitions, to match other schema yml definitions

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
9ef59ba079 ucentral-schema: update to latest HEAD
f56f754 allow multiple fixe country codes on an AP

Fixes: WIFI-12744
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
fafb5cbffd ucentral-schema: update to latest HEAD
77031d1 swconfig: fix interfaces with mixed switch and raw ports

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
Ken
dca6ea517f ipq807x: CIG WF-186w : Fixed the vlan issue when add two vlan interface into one bridge
Fixes: WIFI-12743
Signed-off-by: Ken <xshi@actiontec.com>
2023-08-31 16:08:34 +02:00
John Crispin
43436e4726 ucentral-schema: update to latest HEAD
2d702af add swconfig support

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
18c6087d56 wifi-ax: backport hostapd reload support - fixes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-08-31 16:08:34 +02:00
John Crispin
a5eaccb29a ipq807x: enable 4k vlan by default on realtek switches
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
ee090f6230 ucentral-schema: update to latest HEAD
2c8fb4a enable wifi hot-reload on all phys

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
Felix Fietkau
5b397d54ce wifi-ax: backport hostapd reload support
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-08-31 16:08:34 +02:00
Felix Fietkau
323dc65770 ucode: update to the latest version
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-08-31 16:08:34 +02:00
John Crispin
bccdb175b0 ucentral-schema: update to latest HEAD
5255152 use logical names instead of linux netdev ones inside state messages
f129469 remove outdated test cases
57e1ff5 149 is not a 160mhz channel

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
esha
92f59a3f22 Add Support for hfcl_ion4xi_w, hfcl_ion4x_w and hfcl_ion4xi_HMR
Fixes: WIFI-12710
Signed-off-by: Esha Aggarwal <esha.aggarwal@hfcl.com>
2023-08-31 16:08:34 +02:00
John Crispin
ccdca73cd6 mac80211: add the HTC+ / iPhone fix
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
Ken
3fde7d88fb ipq807x: add stty to configure the uart on CIG 660A
Fixes: WIFI-12712
Signed-off-by: Ken <xshi@actiontec.com>
2023-08-31 16:08:34 +02:00
John Crispin
79dcd8a900 ucentral-schema: update to latest HEAD
6085276 reject upstream interfaces with invalid config

Fixes: WIFI-12695
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
3d851f6343 libubox: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
ed3142aa10 bridger: update to latest HEAD
3159bbe improve isolation when selecting a fixed output port

Fixes: WIFI-12577
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
5d0a5e377e ath11k: disable HE160/80+80 on cypress/hawkeye
[  307.970726] qcom-q6v5-wcss-pil cd00000.qcom_q6v5_wcss: fatal error received:
[  307.970726] QC Image Version: QC_IMAGE_VERSION_STRING=WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
[  307.970726] Image Variant : IMAGE_VARIANT_STRING=6018.wlanfw.evalQ
[  307.970726]
[  307.970726] phyrf_reset.c:1131 Assertion (boardOpFlags == WHAL_WLAN_11AG_CAPABILITY) || ((boardOpFlags == WHALparam0 :zero, param1 :zero, param2 :zero.
[  307.970726] Thread ID      : 0x00000068  Thread name    : WLAN RT0  Process ID     : 0
[  307.970726] Register:
[  307.970726] SP : 0x4bb6e720
[  307.970726] FP : 0x4bb6e728
[  307.970726] PC : 0x4ac8d44c
[  307.970726] SSR : 0x00000008
[  307.970726] BADVA : 0x00020000
[  307.970726] LR : 0x4ac8cbe8
[  307.970726]
[  307.970726] Stack Dump
[  307.970726] from : 0x4bb6e720
[  307.970726] to   : 0x4bb6eec0
[  307.970726]
[  308.023043] remoteproc remoteproc0: crash detected in cd00000.qcom_q6v5_wcss: type fatal error
[  308.045307] remoteproc remoteproc0: handling crash #1 in cd00000.qcom_q6v5_wcss
[  308.053681] remoteproc remoteproc0: recovering cd00000.qcom_q6v5_wcss

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
439c386506 ucentral-schema: update to latest HEAD
0c0a741 fix 160 and 80+80 modes
dbc38ab start bridger early

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
1371a9d3d8 ucentral-event: add option82 handling
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
Felix Fietkau
52f6189c10 udhcpsnoop: allow processing other hooks after ingress mirror
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-08-31 16:08:34 +02:00
John Crispin
cf63cb94aa udhcprelay: add new package
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
94a442abcf ucentral-schema: update to latest HEAD
0986e5a improve vlan-awareness support

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
6cf990f142 netifd: update to latest HEAD
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
8422d572e7 ipq807x: add profiles/hfcl_ion4xi_w.yml
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
659e7c52ba ipq807x: fix xunison-d50 leds
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
2536cfdc9e ipq807x: fix xunison-d50 BDF files
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
e9b64b0dfd ipq807x: fix certificates on hfcl-ion4xi_w
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
b4ed6a8367 ipq807x: fix hfcl-ion4xi_w ethernet ports
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
5362455444 ipq807x: fix hfcl-ion4xi_w calibration data
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
eff55cc055 ipq807x: fix hfcl-ion4xi_w board files
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
295a81450b ipq807x: fix hfcl-ion4xi_w wifi macs
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
ad48758229 ipq807x: fix hfcl-ion4xi_w wifi firmware selection
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
0f5302044d ipq807x: add hfcl-ion4xi_w support
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
398e17a583 hostapd: add usteer2 patches
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
b303909c83 ipq807x: add xunison-d50 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
d7c88de1a7 ucentral-schema: update to latest HEAD
e156652 FWsignature->signature
d324707 fix typo
08ee70c add vlan-awareness support

Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
c144aeed12 usteer2: WIP
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
John Crispin
b3d791b34e base-files/ipq807x: allow setting the dual boot env in the sysupgrade sucess handler
Signed-off-by: John Crispin <john@phrozen.org>
2023-08-31 16:08:34 +02:00
Stephane Bourque
9b77f6ed22 Update x64_vm-build-test.yml
Reverting a bad commit
2023-07-16 21:15:42 -07:00
Stephane Bourque
7eb5d45bb8 Update x64_vm-build-test.yml
xx
2023-07-16 20:48:49 -07:00
Stephane Bourque
8b64db3c7a Update x64_vm-build-test.yml
x
2023-07-16 20:48:17 -07:00
John Crispin
cd461e555e ucentral-schema: update to latest HEAD
9797d7e allow using a shared service->captive for multiple instances
ad7eb8e rename strict-isolation -> strict-forwarding
43c44c1 force spotfilter off prior to config apply
11fffcf captive: fix credentials configuration

Signed-off-by: John Crispin <john@phrozen.org>
2023-06-26 16:24:08 +02:00
John Crispin
9195806206 ucentral-event: rename strict-isolation -> strict-forwarding
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-26 16:20:14 +02:00
John Crispin
9621c21535 spotfilter: add a delay after setting up a captive portal
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-26 16:20:14 +02:00
John Crispin
f74cee802b uspot: fix rate limiting in captive portal/UAM
Fixes: WIFI-12305
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
Ken
0c7aecde9f ipq807x: CIG WF-186w / update uart pin setting for commucation between ble and soc
Fixes: WIFI-12679
Signed-off-by: Ken <xshi@actiontec.com>
2023-06-15 16:22:27 +02:00
John Crispin
9ab2f5ede9 ucentral-schema: update to latest HEAD
9637b4a disable bridger by default

Fixes: WIFI-12670
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
a7fe885dc5 radius-gw-proxy: improve header length sanity check
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
105e55c01a ucentral-schema: update to latest HEAD
48ee8f0 fix cpu core utilisation

Fixes: WIFI-12440
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
200b759d6f ipq807x: update ion4x_wp dts config
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
5da87dc07d uspot: fix a typo int he CHAP/PAP handler code
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
25f42bdcaf ucentral-schema: update to latest HEAD
47f39e9 cmd_upgrade: signature requirement was not properly detected

Fixes: WIFI-12675
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
43361d0ee7 ucentral-schema: update to latest HEAD
4ddcb12 properly indicate apply errors via an exit() call

Fixes: WIFI-12673
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
93a8a764a8 ucentral-schema: update to latest HEAD
eea75b3 do not enable vlan accounting for untagged interfaces

Fixes: WIFI-12674
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
1e515ed1e1 ucentral-schema: update to latest HEAD
04ce23b fix udevstats counters

Fixes: WIFI-12674
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
78388a8ecf ucentral-event: fix radius rate limiting
Fixes: WIFI-12665
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
1e1c286f06 ipq40xx: disable the unused container feed
Fixes: WIFI-12672
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
81f7d7d7ce ramips: enable vlan offloading
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-15 16:22:27 +02:00
John Crispin
2403eb2a87 ipq807x: do not bounce arp frames back in proxy_arp mode
Fixes: WIFI-12653
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-08 11:13:23 +02:00
John Crispin
5a686344e8 ipq807x: update wf-186 5GHz BDF
Fixes: WIFI-12656
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-08 06:32:38 +02:00
Thibaut VARÈNE
ff1214b1dc uspot: portal: avoid null dereference, always define ctx.ssid
This commit fixes a bug where the SSID value would be set to "unknown"
in spotfilter data when the hostapd call returned without SSID data; but
this value  was not propagated internally, resulting in a null value
being used in other parts of the portal code. Furthermore, if the
hostapd call returned null data, the spotfilter assignment correctly
handled this case but not the subsequent internal assignment, resulting
in a potential null dereference and crash.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-06 17:51:37 +02:00
Thibaut VARÈNE
cf8769e4b5 uspot: def_captive may not exist
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 19:28:38 +02:00
Thibaut VARÈNE
f770253a52 uspot: don't use CONNMARK
This commit removes CONNMARK marking of all authenticated clients
packets. In client_kick() we now delete all conntrack entries for the
client.

This simplifies firewall.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
bb4b7cb95c uspot: handler-uam: fix CHAP challenge
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
d3f4afd4a7 uspot: handler.uc: remove unused payload attribute
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
35e1cbd15b uspot: use a single fwmark
Default firewall rules apply to unauthenticated clients, there is no
need to specifically fwmark their packets. This reduces the firewall
complexity and makes very clear what happens "by default".

Add a preliminary README with a sample firewall illustrating this setup.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
cf2f80fd3c uspot: handle_request: abort on spotfilter error
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
56549a44ea uspot: rename accounting.uc -> uspot.uc
This file is run by /etc/init.d/uspot, uses /etc/config/uspot and
basically handles uspot state (beyond mere accounting).

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
59b3387ece uspot: handle client removal in accounting.uc
mirror the client_add call

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
1ebc3f59ba uspot: regroup ratelimiting start/stop under accounting
Avoid again having the init and exit stages of a specific subsystem
spread across multiple modules.

We no longer need to lowercase the MAC address and can use the
spotfilter native (uppercase) format for ratelimit calls.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
5d93a1ddc0 uspot: accounting: cleanup ratelimit rules on removal
When a client is removed, call ratelimit client_delete to remove any
lingering related bandwidth limits.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
5d0f75f68e uspot: handler: use Call-Check for MAC auth
Reading [1] and [2], it appears that the hard-coded value "2" is
incorrect and "10" should be used instead. [1] provides that:

  Checks for the presence of a Service-Type == 'Call-Check' AVP as an
  explicit indication that the NAS wants to do Mac-Auth.

"Call-Check" is defined in [2] as value 10.

[1]: https://wiki.freeradius.org/guide/mac-auth#web-auth-safe-mac-auth
[2]: https://freeradius.org/rfc/rfc2865.html#Service-Type

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
eeec28eb4a uspot: remove references to radius accounting
Now that accounting is entirely handled in accounting.uc, the rest of
the system no longer needs to carry around that information.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
1c38559cf0 uspot: handle accounting start in accounting.uc
This commit introduces an "acct_start" ubus endpoint for accounting.uc
that is used to register a new client and start accounting.

This moves the entirety of accounting management under accounting.uc,
instead of having e.g. the RADIUS Start call separate in handler-uam.uc.

Furthermore, accounting.uc no longer needs to poll for new clients: they
are now registered from portal.allow_client().

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
c9b2877de1 uspot: accounting: use provided nas_port_type
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
21d79d1a9e uspot: portal: increase sessionid uniqueness
RFC[1] says that Acct-Session-Id should be an UTF-8-encoded string.
Increase uniqueness by using hex values instead of decimal ones.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
95a7b6d54d uspot: accounting: implement Accounting-On/Off
The RFC[1] says about Acct-Status-Type:

    It MAY be used by the client to mark the start of accounting (for
    example, upon booting) by specifying Accounting-On and to mark the
    end of accounting (for example, just before a scheduled reboot) by
    specifying Accounting-Off.

The RFC errata[2] further specifies that Accounting-On and
Accounting-Off messages apply to the whole NAS.

The RFC also mandates that[3]:

    Either NAS-IP-Address or NAS-Identifier MUST be present in a
    RADIUS Accounting-Request.  It SHOULD contain a NAS-Port or NAS-
    Port-Type attribute or both unless the service does not involve a
    port or the NAS does not distinguish among its ports.

And[4]:

    An Accounting-Request packet MUST have an Acct-Session-Id.
    The Acct-Session-Id SHOULD contain UTF-8 encoded 10646 characters.

Finally the freeRADIUS recommendations here[5] suggest that:

 1. Acct-Status-Type = Accounting-On should not be used to indicate
    sub-system reboot.
 2. IANA should allocate two new values for Acct-Status-Type:
    Subsystem-On, and Subsystem-Off. These values have meaning similar
    to Accounting-On and Accounting-Off, except that they apply to a
    subystem of the NAS.
 3. NASes should use these new values to indicate subsystem on/off.
 4. The Called-Station-Id attribute should contain values unique to each
    subsystem.
 5. The NAS should signal that the entire system has rebooted by using
    the existing Accounting-On and Accounting-Off values, with a value
    for Called-Station-Id that is global to the NAS, or to omit it
    entirely.

In order to reconcile all this, this commit implements Accounting-On and
Accounting-Off requests as follows:

- When accounting.uc is started, it loops through each uspot interface
  and keeps track of the acct_server seen for each interface. Then for
  each interface that do not use a previously seen server, it generates
  a unique session ID, and sends an Accounting-On request to the
  RADIUS server, using this session ID and the configured NAS-ID.
- When accounting.uc stops, it sends an Accounting-Off request for each
  uspot interface for which an Accounting-On message was previously sent,
  using the same global session ID.

If/when the Subsystem-On/Subsystem-Off values are implemented, this
commit can be revisited to simply lift the restriction on unique servers
and change the acct_type value accordingly.

Finally, it appears that while NAS-ID is provided in the request thus
making NAS-IP unnecessary, libradcli still includes this field in the
request. Likewise, it also insists on sending a NAS-Port attribute.

[1]: https://datatracker.ietf.org/doc/html/rfc2866#section-5.1
[2]: https://www.rfc-editor.org/errata_search.php?rfc=2866
[3]: https://datatracker.ietf.org/doc/html/rfc2866#section-4.1
[4]: https://datatracker.ietf.org/doc/html/rfc2866#section-5.5
[5]: https://freeradius.org/rfc/acct_status_type_subsystem.html

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
a647368f15 uspot: accounting: allow radius calls from non-clients
In order to send RADIUS accounting requests at the NAS level (for e.g.
Accounting-On/Off), radius_init() and radius_call() are made to accept a
null mac argument.

For radius_call() we fall back to the acct_session value (which is
required to be present per RFC) to construct the temporary file name.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
97f641a16b uspot: accounting: quote syslog() logger argument
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
1252ca6778 uspot: accounting: use NAS-ID from settings
NAS-ID is a mandatory setting in configuration. This will be useful to
support Accounting-Off frames.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
e561f4a82e uspot: don't publish radius secrets
Now that accounting.uc no longer needs the per-client radius server
information, there is no reason to publish these sensitive secrets in
cleartext in spotfiler data.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
395e98dc66 uspot: accounting: build radius payload from settings
Address RADIUS accounting server from the global settings, and call
client_interim() only if accounting is globally enabled for that
interface.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
b5e33cec05 uspot: accouting: save interface-wide settings
Before this commit, interface-wide settings (mainly radius) were stored
per client, resulting in duplicate data.

This commit runs a first pass that renames the "clients" global variable
to "interfaces" which is expected to have the following content:

interfaces {
	settings {},
	clients {},
}

Thus the settings are stored per interface now, and the list of clients
belonging to that interface is stored within the object.

This change enables us to also remove direct calls to uci configuration
in the code and thus we no longer need to store it locally.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
ec924ea3d7 uspot: accounting: send RADIUS acct Stop on disconnect
If a client "disappears" from wireless, spotfilter eventually wipes
their state data before the accounting removal occurs. Thus in
radius_acct(), the ubus call returns empty and no RADIUS accounting Stop
frame is sent in this condition, leaving a dangling accounting for the
client.

This commit solves this issue by maintaining a local copy of the most
recent accounting data and sending that when the live data is no longer
available.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
e30cfbf36b spotfilter: move accounting totals to "acct_data" table
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
39510a6728 uspot: accounting: relax loop timer
For accounting purposes, a 10s resolution seems adequate. Accounting
session start is handled asynchronously in handler-uam.uc anyway.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
0abc0c17ff uspot: accounting: refactor interim reporting
Instead of running one timer per client, handle interim reports in the
main loop through a simple comparison between current time and expected
time of next report.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
3375803a26 uspot: accounting: add_client(): fix integer types
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
16e06ad7aa uspot: accounting: remove on logoff, reset on idle
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
a12f43e912 uspot: accounting: s/client_flush/client_reset/g
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
a6a9ef6c1b uspot: add nftables firewall snippet
This enables CONNMARK'ing allowed traffic, and is used by accounting to
selectively delete conntrack entries on client removal.

To be used with the following fw4 config:

config include
	option type 'nftables'
	option path '/usr/share/uspot/firewall.nft'
	option position 'chain-post'
	option chain 'mangle_postrouting'

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
866583625b uspot: accounting: local config overrides Acct-Interim-Interval
Per RFC: https://www.rfc-editor.org/rfc/rfc2869.html#section-2.1

   It is also possible to statically configure an interim value on the
   NAS itself. Note that a locally configured value on the NAS MUST
   override the value found in an Access-Accept.

Don't start the interim reporting timer if no interval is configured.

Also add the config option to the documented config template

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
4c272fe5f5 uspot: accounting: setup interim only when needed
There is no point in setting up the interim timer if the relevant radius
data is not available. Furthermore, the return value check would only
fail if the client was unknown to spotfilter at the query time, which
isn't a failure to *send* data.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
45def78972 uspot: accounting: coalesce radius stop requests
Define constants for terminate causes, see:
https://www.iana.org/assignments/radius-types/radius-types.xhtml#radius-types-12

Use "Lost Carrier" for disconnected client (matching Chilli).

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
f1c4a39540 uspot: accounting: correctly handle ipv4/v6 conntrack
Only run conntrack deletion on defined client IP(s) and process both
IPv4 and IPv6.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
a9df4b8549 uspot: accounting: use variables instead of function calls
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
4d8bc3c5bd uspot: accounting: client timeouts are always defined
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
245b062db8 uspot: accounting: fix loop logic
When looping through known clients:
- removal of client in spotfilter list is checked first
- checks for known client existence are redundant by construction

Also format the max_total check similarly to the timeout one

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
c6d07ca178 uspot: accounting: use explicit variable names
And avoid enumerating unused values in k,v pairs

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
60c708dce9 uspot: accounting: s/radius_stop/client_kick/
radius_stop() had nothing to do with RADIUS.
Simplify the function prototype by handling spotfilter args internally.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
dfdf25834c uspot: accounting: remove redundant function
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
1e82a24192 uspot: accounting: radius_stop(): reduce args redundancy
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
ce20be0b3b uspot: accounting: config[interface] is always defined
By construction:
- interface is one of clients[] keys
- clients[] is built from config uspot 'interface'

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
3e483bd524 uspot: accounting: avoid redundant assignments
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
1cded2e983 uspot: radius: regroup redundant checks
Clarifies intent.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
3219fceb48 uspot: move RADIUS NAS_PORT_TYPE to portal.uc
Currently still hardcoded to "19" aka Wireless.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
78c7a3cbfa uspot: handler-uam: improve auth-client()
Simplify the query string parsing logic, allow empty password.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
0a390bea0b uspot: rename common.uc -> portal.uc
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
cad21f394e ucentral-tools: remove dictionary.CoovaChilli
This dictionary uses vendor 14122, which is the WISPr vendor code. The
first few attributes defined in this dictionary as integers masked their
WISPr string counterparts, resulting in truncated attributes in RADIUS
requests.

From a quick Google Search, there is no CoovaChilli RADIUS vendor ID, it
seems to use the ChilliSpot ones:
https://support.ignitenet.com/portal/en/kb/articles/what-are-the-supported-radius-attributes-in-coovachilli-captive-portal

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
3384986bef uspot: support ChilliSpot radius ratelimits
This commit introduces a helper function "ratelimit_client()", invoked
from allow_client(), which parses the radius reply for known
ratelimiting attributes:

- WISPr-Bandwidth-Max-{Up,Down}
- ChilliSpot-Bandwidth-Max-{Up,Down}

WISPr attributes are expressed in bits/s, ChilliSpot in kbits/s.

If none of the attributes are present, the function is a NOP.
If any of the -Up or -Down is missing, the corresponding limit is not
set. NB: ratelimit currently does not support setting only up OR down
ratelimiting if defaults are not set.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
Thibaut VARÈNE
23073a8ae5 uspot: captive: restart(): include uspot accounting
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-06-05 13:19:19 +02:00
John Crispin
3ab700de32 ipq807x: fix yuncore fap655 filename
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-04 18:04:41 +02:00
John Crispin
454856e5c2 ipq807x: always power on phys when an interface is started
Fixes: WIFI-12648
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-04 17:14:18 +02:00
John Crispin
7e4030c0bc ipq807x: add yuncore fap655 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-04 12:36:46 +02:00
John Crispin
1deab06c09 ucentral-schema: update to latest HEAD
1279e7c fix section names for swconfig devices

Signed-off-by: John Crispin <john@phrozen.org>
2023-06-04 12:34:24 +02:00
John Crispin
a4bc2913e1 ipq807x: add edgecore OAP101e support
Fixes: WIFI-12617
Signed-off-by: tanya.singh <tanya.singh@4ipnet.com>
2023-06-01 10:06:39 +02:00
Ken
87dbd3e289 ipq807x: various improvements for CIG-WF-186w
1. Using rtl8367c.c file for rtl8367S switch driver  to support vlan 
2. Configure eth0.1 as WAN and eth0.2 as LAN
3. Add mdio read/write in smi driver  followed 5.4 kernel driver
4. add mido clock setting followed 5.4 kernel driver for 186w board
5. Add eth and wifi mac address allocation based of BaseMacAddress
6. Update new bdf for 2G radio

Fixes: WIFI-12650
Signed-off-by: Ken <xshi@actiontec.com>
2023-06-01 08:58:14 +02:00
John Crispin
3f79bc76ac ucentral-schema: update to latest HEAD
137615d add vlan_id to uci sections

Signed-off-by: John Crispin <john@phrozen.org>
2023-06-01 08:58:14 +02:00
John Crispin
4820218fc2 netifd: backport 2 status fixes
Fixes: WIFI-12513
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-01 08:58:14 +02:00
John Crispin
b30bcf501a ramips: fix fap640 mac addresses
Signed-off-by: John Crispin <john@phrozen.org>
2023-06-01 08:58:14 +02:00
John Crispin
d9e62da73d ucentral-client: update to latest HEAD
feadd83 handle configuration load/parse error

Fixes: WIFI-12380
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
404a3a4813 ucentral-schema: add strict-isolation example
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
e9f5aec955 ucentral-schema: update to latest HEAD
c3d8380 add new dhcp-relay render code
a39410a remove old dhcp-relay code

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
9eada6166c ucentral-event: add dhcp-relay support
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
e8875a7375 ucode: backport uci.foreach fix
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
33c4c732c9 dnsmasq: drop old option 82 patch
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
2c8e736fa8 ucentral-schema: update to latest HEAD
84f53b2 add strict_isolation support

Fixes: WIFI-12577
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
e18d485bdc ucentral-schema: update to latest HEAD
11d7374 always set the developer mode flag when generating capabilities

Fixes: WIFI-12270
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
a1678619be ucentral-client: update to latest HEAD
ffd9d6f indicate crashlog inside the connect reason

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
eec945417d ucentral-schema: upodate to latest HEAD
3afde47 fix generation of bridger block list

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
cd3fb41eb0 ipq807x: update wf196ca 6G BDF file
Fixes: WIFI-12538
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
0445caf2b8 ipa807x: various fixes for wf186
Fixes: WIFI-12616
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
Venkat Chimata
3bb4304fe4 cybertan: Specify correct images in cybertan profiles
Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
2023-05-30 07:56:09 +02:00
Venkat Chimata
2edf5d750c cybertan: Fix build issues with Cybertan APs
Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
2023-05-30 07:56:09 +02:00
John Crispin
89d1213f39 ucentral-client: update to latest HEAD
cb5030f crashlog->rebootlog

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
3eb13481c9 ucentral-schema: update to latest HEAD
27b1d45 cmd_upgrade: create /ucentral.upgrade
7109e62 add captive portal devices to the bridger block list

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
e2ffc6650c bridger: re-enable inside default images
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
42be849af8 generic: use latest kernel headers when building eBPF tools
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
Felix Fietkau
d9adc8f7a1 hostapd: fix double free in coa-multi patch
Fixes: WIFI-12586
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-05-30 07:56:09 +02:00
John Crispin
399f862bb9 ipq807x: various cig,wf660a improvements
* fix wifi macs
* reset button had the wrong polarity

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
e73633402c ipq807x: whitespace cleanup
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
Felix Fietkau
acc3d67cff wifi-ax: fix mac80211 crash when dealing with AP vlans
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-05-30 07:56:09 +02:00
John Crispin
c3ab147246 ucentral-schema: update to latest HEAD
694fd64 convert vlan_ifaces to an array

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
8cbc9e4fb1 bridger: do not include in builds until it is used
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
John Crispin
3fc4414a84 uspot: fix compile error in radius.c for older GCC
/openwrt/build_dir/target-arm_cortex-a7_musl_eabi/uspot/radius.c:264:4: error: label at end of compound statement
    default:
    ^
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
5d7650a69c uspot: radius.c: use rc_apply_config()
This is required per documentation and may result in segfault if not
used.
Also remove the "servers" settings which is unnecessary in the context
of a single server.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
e4d81ee5b9 uspot: add support for radius location name
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
8ec07e0588 uspot: partial rewrite of radius-client
Streamline the code to make it easier to extend supported attributes,
and to clarify code flow. Improve error checking.

Add licensing information (with permission from John Crispin, original
author).

NB: a few things are still hardcoded toward the end of radius(), to be
revisited.

Cc: John Crispin <john@phrozen.org>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
8262342e1c uspot: initial documentation of config options
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
a7341b418e uspot: introduce mac_passwd and mac_suffix options
This carries over two Chilli options used during mac authentication:

- macpasswd, which sets a static password when performing mac-auth
- macsuffix, which allows suffixing the mac address provided as username

These options are implemented in config uspot section as:

- option mac_passwd 'password'
- option mac_suffix 'suffix'

If unset, this commit is a NOP.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
fc80a4aa84 uspot: radius_call: unlink tmp file after exec
If debug is disabled, this commit deletes the temporary json files
passed to radius-client.

Furthermore, to reduce the risk of collision, use a different prefix in
accounting.uc ('uacct') vs common.uc ('acct').

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
db37e3727d uspot: captive: honor 'debugoff'
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
d667c2e2b9 uspot: correctly honor "debug=0" configs
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
b7f8c7e788 uspot: accouting: spell out config load failure
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
243f42454f uspot/spotfilter: implement captive generate
For basic uspot setups, this commit implements a 'generate' verb to
uspot /usr/bin/captive that takes a config uspot section name, and
parses the following extra options to generate the relevant spotfilter
config:

  option generate_spotfilter (bool) # if unset/false, generate is a NOP
  option interface 'name' # config/network interface name to redirect to
  option client_autoremove (bool) # if set/true, sets client_autoremove
  list wl_hosts '*.example.com' # optional list of whitelist hostnames
  list wl_addrs '1.2.3.4' # optional list of whitelist IPs

"captive generate" is called in spotfilter.init to optionally (depending
on 'generate_spotfilter') create the required spotfilter-XXX.json before
starting spotfilter.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
74651831ef uspot: configure devices ifnames in section uspot
The current uspot config uses a single named section to assign ifnames
to uspot interfaces like so:

config devices 'devices'
	option wlanc0 'hotspot1'
	option wlanc1 'hotspot1'

Where 'wlanc0' and 'wlanc1' are physical ifnames.

Code in common.uc also hardcodes a check to match ifnames with 'wlanc*'.

This comit gets rid of the "config device" sections and accepts in the
"config uspot" sections e.g.:

	option ifname 'wlanc0'
or
	list ifname 'wlanc0'
	list ifname 'wlanc1'

The listed devices are then associated with the current uspot config
exactly as they were with the previous configuration system.

The hardcoded check in common.uc is also removed, allowing arbitrary
ifnames to be used.

Malformed sections are ignored with a warning. Subsequent duplicate
entries for a given ifname are be ignored with a warning.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
b44c7b09db uspot: track client sessionid and provide it to UAM
This commit moves session id creation outside of radius_init() and
stores the identifier in ctx and client data, making it available to
various handlers.

The id is added to the list of uam_url parameters to be sent to the
backend.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
ecc8829a01 uspot: handler: correctly honor mac_auth setting
Suggested-by: John Crispin <john@phrozen.org>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
8029c318d0 uspot: handler-uam: stop processing after error
The current code would still issue a radius request after showing the
error boilerplate.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
16cf91b3d2 uspot: fix malformed hex string and buffer overflow
Because _md[32] is defined as "char" instead of "unsigned char" in
uc_md5() and sprintf() is used instead of snprintf(), the resulting
string can be malformed (padded with FF for negative values) and
can overflow the target buffer, producing strings like:

21FFFF0D12FFFF6A48651050FFFF4CFFFFFFBA
FFFFFF16FF3EFF7C6560FFFF6BFFFFFFFFFFE7

The same issue affects the hex_to_str() helper function which uc_md5()
does not use.

This commit addresses these issues by:
- refactoring hex_to_str():
  - accept a const void * input buffer internally cast to uchar
  - use snprintf() and the correct format length modifier 'hh'
- use hex_to_str() in uc_md5()
- adjust uses in other callers to pass sizeof(inbuf)/2 instead of a
  hardcoded number

str_to_hex() is also refactored with the same guidelines to simplify the
code and minimally address sscanf() failures by ending conversion.

While there, document these two helpers.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
7bbad0ed50 uspot: handler-uam.uc: use ctx.config.uam_port/logoff
Remove hardcoded port and specify the actual logoff request endpoint.

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:09 +02:00
Thibaut VARÈNE
c89b054324 uspot: accounting.uc: fix typo
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:08 +02:00
Thibaut VARÈNE
e2abfd7b72 spotfilter: adjust DEPENDS
Add missing kmod-ifb
Remove unused kmod-sched-cake

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:08 +02:00
Thibaut VARÈNE
e55abc109c uspot: fix missing DEPENDS
Add missing:
- ratelimit
- ucode-mod-math
- ucode-mod-nl8011
- ucode-mod-rtnl
- ucode-mod-uloop

Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
2023-05-30 07:56:08 +02:00
John Crispin
7d68d6d5c3 ucentral-schema: update to latest HEAD
e30b05f propagate reboot_cause
11dff2a add dynamic vlans to state messages
505ac1a fix captive uci code for latest captive PR

Fixes: WIFI-12590
Fixes: WIFI-12582
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
d16b3d6919 ucentra-client: update to latest HEAD
cca938b send connect reason

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
e91f49bdbd udevstats: add support for dynamic vlans
Fixes: WIFI-12582
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
4688ba6996 bridger: add new package
Fixes: WIFI-12577
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
Venkata Chimata
4a6bc07d61 ipq50xx: Addp support for Cybertan EWW631-A1 and EWW631-B1 APs
EWW631-A1 (Ceiling mount)

Specifications are:

* CPU: Qualcomm IPQ5018
* RAM: 512 MB
* Storage:  256MB NAND-optional.
* Ethernet: 1x GbE
* UART header
* WLAN: 2.4GHz: IPQ5018, 5GHz:  QCN6102
* 3x LED-s à R/G/B PWM control

 Installation instructions:
Connect to UART, pins are like this

XA/XB PCBA UART :
PIN #5   |  #4 |  #3  |  #2  |  #1
GND | x | RX | TX | VCC

XC PCBA UART : (next version hardware board)
PIN  #4  |   #3  |  #2   |  #1
GND | RX | TX | VCC

Settings are 115200 8n1

1. Copy openwrt-ipq807x-cybertan_eww631_a1-squashfs-nand-factory.bin onto the board into /tmp/
2. At board's command prompt, issue sysupgrade -n /tmp/openwrt-ipq807x-cybertan_eww631_a1-squashfs-nand-factory.bin

-----------------------------------------------------------------------

EWW631-B1 (Wall mount)

Specifications are:

* CPU: Qualcomm IPQ5000
* RAM: 256 MB (IPQ5000 inside)
* Storage:  256MB NAND-optional.
* Ethernet: 4x GbE
* UART header
* WLAN: 2.4GHz: IPQ5000, 5GHz:  QCN6102
* 3x LED-s à R/G/B PWM control

Installation instructions:
Connect to UART, pins are like this

Fixes: WIFI-12579
Signed-off-by: Venkata Chimata <venkata@shasta.cloud>
2023-05-30 07:56:08 +02:00
John Crispin
6f5f7bf068 ipq807x: fix reset button on wf666a
Fixes: WIFI-12591
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
5b27dc31fc ipq807x: fix dualboot on emmc flash chips
Fixes: WIFI-12537
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
d9d0ae77e9 ipq807x: turn bootconfig into a module
Fixes: WIFI-12537
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
a195b9e316 ucentral-schema: update to latest HEAD
689b111 make crashlog handler generic for pstore items

Fixes: WIFI-12590
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
e211647656 ucentral-schema: update to latest HEAD
5d8e9b0 add boot time to the state message

Fixes: WIFI-12593
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
64b248fad1 ipq807x: various improvements to cig,wf660a
Fixes: WIFI-12592
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
d792176347 ucentral-schema: update to latest HEAD
4b86496 fix generation of upgrade.tgz

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
John Crispin
5bd7b4bc51 ucentral-schema: update to latest HEAD
c112a0c rtty: allow configuration of the mutual tls feature

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-30 07:56:08 +02:00
Felix Fietkau
929ca004c4 ipq807x: backport act_pedit changes
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-05-08 12:19:38 +02:00
John Crispin
848b09b6e1 ucentral-schema: update to latest HEAD
37d7a26 add per core cpu_load to the state message

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-08 10:56:18 +02:00
John Crispin
1061890189 ucentral-client: update to latest HEAD
5597621 improve the logic that detects stale gateway connections

Signed-off-by: John Crispin <john@phrozen.org>
2023-05-08 10:56:18 +02:00
Kishan Shukla
39b1211541 ipq807x: Add ION4XI_WP support
Fixes: WIFI-12581
Signed-off-by: Kishan Shukla <kishan.shukla@hfcl.com>
2023-05-08 10:56:18 +02:00
Piotr Dymacz
08e976af26 ipq807x: include support for dual-image in YunCore AX840
This adds support for dual-image ('rootfs' partitions rotation), for
the YunCore AX840 board. Implementation details are included in the
'base-files' patch this commit adds:

  0060-base-files-minimal-support-for-QCA-runtime-failsafe.patch

Fixes: WIFI-12537
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-05-08 10:56:18 +02:00
Piotr Dymacz
b89ba787fe ipq807x: enable BOOTCONFIG partition support in kernel
This is required for dual-image support ('rootfs' partitions rotation)
used for example on the YunCore AX840.

Fixes: WIFI-12537
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-05-08 09:16:32 +02:00
John Crispin
1548fac62a ipq807x: add dosilicon nand flash support
Fixes: WIFI-12580
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-06 09:21:12 +02:00
John Crispin
3dafdff716 ipq807x: make pstore/pmsg work
Fixes: WIFI-12578
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-04 12:57:52 +02:00
John Crispin
5cd786fb9a ucentral-event: do not flush rate-limit on captive interfaces
Fixes: WIFI-12305
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-04 09:09:21 +02:00
John Crispin
be67c7fa07 ucentral-client: update to latest HEAD
a94e2df added the support to remove old public IP file once it is connected successfully to controller

Fixes: WIFI-12474
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-03 08:57:09 +02:00
John Crispin
5f3f788955 ucentral-client: update to latest HEAD
c500514 reduce PING interval to 60s

Fixes: WIFI-12573
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-02 18:49:35 +02:00
John Crispin
8667eecdcf ucentral-schema: update to latest HEAD
0af4f34 Added support of retrieval of public IP if not existed and reporting in state msg

Fixes: WIFI-12474
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-02 17:46:43 +02:00
John Crispin
47b396873b ucentral-schema: update to latest HEAD
99cd625 captive: allow mutliple instances

Fixes: WIFI-12366
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-02 17:42:17 +02:00
John Crispin
74dd8fc89e uspot: add support for multiple captive portals
Fixes: WIFI-12366
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-02 17:42:17 +02:00
John Crispin
2a75855f23 ucentral-schema: update to latest HEAD
f2a7137 add roaming 'auto' button to data model

Fixes: WIFI-12570
Signed-off-by: John Crispin <john@phrozen.org>
2023-05-02 17:42:17 +02:00
John Crispin
7895a40487 ipq807x: disable GRO by default
Fixes: WIFI-12526
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-25 16:20:54 +02:00
John Crispin
1f9a41b386 mac80211/ath11k: fix num_iface_combinations
Fixes: WIFI-12019
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-24 17:51:34 +02:00
John Crispin
efb57bcc5a ucentral-schema: update to latest HEAD
d7dbe23 allow passing hex values as radius request attributes

Fixes: WIFI-12534
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-24 08:21:07 +02:00
John Crispin
70cdfe7103 ipq807x: update 6G CA BDF
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-12 06:57:02 +02:00
John Crispin
082e96d546 ip807x: fix ath11k-fwtest on cig wf196
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-12 06:57:02 +02:00
John Crispin
3aa1ff70bb certificates: add a mount_cert helper script
Fixes: WIFI-12461
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-12 06:57:02 +02:00
John Crispin
28623fb4b3 ucentral-schema: update to latest HEAD
b918e6a state: some devices will report temperature in milli celssius

Fixes: WIFI-12500
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-12 06:57:02 +02:00
John Crispin
e35aacca4b profiles: update profiles to allow v4.4 and v5.4 to co-exist in CI
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-12 06:57:02 +02:00
John Crispin
91e3140f5a .github/workflows: add additional CI jobs
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:49 +02:00
Ken
5c84541011 ipq807x: Add WF-186w support
Add WF-186w support

Signed-off-by: Ken <xshi@actiontec.com>
2023-04-10 14:25:48 +02:00
John Crispin
b9b03a6e38 ipq95xx: add Qualcomm wifi-7 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00
John Crispin
3b6582117b ipq807x: add ath12 / v5.4 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00
John Crispin
50cbd4688b ipq807x: make v4.4 and v5.4 co-exist
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00
John Crispin
354089a7f2 base-files: fix target feeds
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00
John Crispin
f669fdaddc cleanup: drop obselete code
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00
John Crispin
267147f971 edgecore: add TPM support
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00
John Crispin
63e8acadfc bluetooth-cc2652: update feed to latest version
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:48 +02:00
John Crispin
690d7655a0 ucentral-event: fix dynamic vlan for devices where the WAN port is not eth0
Fixes: WIFI-12372
Signed-off-by: John Crispin <john@phrozen.org>
2023-04-10 14:25:22 +02:00
jaspreetsachdev
52c39cd3bf Merge pull request #539 from Telecominfraproject/staging-fix-nns-feed
ipq807x: fix qca-nss-clients feed
2023-04-01 08:05:35 -04:00
Arif Alam
ebd7c79e65 ipq807x: fix qca-nss-clients feed
Signed-off-by: Arif Alam <arif.alam@netexperience.com>
2023-03-31 18:36:56 -04:00
Piotr Dymacz
560e9f326d mcu: fix host support for multi-slot UART based MCUs
In case of MCU with multiple firmware slots support, change of active
slot requires reset. This obviously results in MCU entering the serial
recovery mode in bootloader, with 5 sec timeout, which in case of UART
based MCUs isn't automatically detected and handled in the same way as
USB based devices (hotplug).

Starting host side support script when the MCU is waiting for MCUmgr
commands during recovery is wrong. This fixes the problem by requesting
UART based MCU to boot the firmware after active slot change followed by
reset. While at it, change also how single slot type MCUs are handled
during upgrade (always request reset after the upgrade).

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-23 08:06:42 +01:00
John Crispin
3da1530926 ratelimit: SSIDs with spaces failed to be configured
Fixes: WIFI-12421
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-23 07:39:11 +01:00
Arif Alam
abcf6dd1fd ipq807x: fix mac address assignment
Signed-off-by: Arif Alam <arif.alam@netexperience.com>
2023-03-21 07:57:13 +01:00
Chaitanya Kiran Godavarthi
2bcedafe0d ipa807x: generate an ath11k-macs file on eap104
Signed-off-by: Chaitanya Kiran Godavarthi <chaitanya.kiran@netexperience.com>
2023-03-21 06:23:39 +01:00
Piotr Dymacz
c0cf066900 mcu-firmware: include host support for 'hci_uart' firmware
This includes shell script for host side support of the 'hci_uart' MCU
firmware type. The script calls 'btattach' with matching tty interface
and baud rate as arguments, resulting in new Bluetooth HCI controller
registration in the system. Both UART and USB interfaces are supported.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-20 08:26:50 +01:00
Piotr Dymacz
6462efd6bc mcu: execute host side support script for firmware type
This adds support for executing a host side support script per firmware
type (in our case, full MCU firmware name is a combination of two terms:
'version__type', e.g. 'zephyr-v3.3.x__hci_uart') which currently runs on
the MCU. Additionally, support for calling the init script with 'stop'
argument is included.

The host side support scripts will be placed in '/etc/mcu.d/' and should
have executable flag set and be named after the firmware type, with 'sh'
extension (e.g. 'hci_uart.sh'). This solution assumes also that PID of a
running, related service will be stored in '/var/run/mcu.SN.pid' where
'SN' is the associated MCU serial number.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-20 08:26:50 +01:00
Piotr Dymacz
0bce7dc7a4 mcu-firmware: update 'zephyr-main' to 'cf50a3c570bb' (2023-03-10)
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-20 08:26:50 +01:00
Piotr Dymacz
a3f0fb23b7 mcu-firmware: add support for host side support packages
In case of some of the MCU firmware types, additional setup on the host
side is required before the target application can be used. Example of
such a requirement is a BLE HCI controller on UART bus (firmware type:
'hci_uart') which, before can be registered in system, needs to be
attached to Bluetooth stack (with e.g. 'btattach').

This includes code for generating hidden packages under 'mcu-firmware'
with all the files required for host side support (stored in directory
with the same name as firmware type, under local 'files' directory),
for a selected MCU firmware. For example, below tree:

  ./feeds/mcu/mcu-firmware/files/hci_uart/etc/...

would result in creation of new package 'zephyr-hci_uart-host-support',
included in dependencies lists for all MCU firmware versions of the
'hci_uart' type, with everything from '.../files/hci_uart/'.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-20 08:26:50 +01:00
Piotr Dymacz
b9d20e083c mcu: simplify and fix 'mcu.sh' and 'mcu.hotplug' scripts
This reduces amount of helper functions and fixes also global variables
handle inside 'mcu.sh' and 'mcu.hotplug' shell scripts. While at it,
provide additional debug information when fetching images list and
system information.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-20 08:26:50 +01:00
Piotr Dymacz
725899248a mcu: update MCU if firmware hash doesn't match
This includes simple upgrade (downgrade) capability in the MCU support
package. If hash of firmware installed on the MCU doesn't match the one
available on host's local file system, it will get upgraded.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-20 08:26:50 +01:00
John Crispin
c8685f2352 ucentral-schema: update to latest HEAD
caac3f1 add support for secondary radius server

Fixes: WIFI-11979
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-20 08:26:35 +01:00
John Crispin
7d10d77e35 udevmand: update to latest HEAD
979aca4 mac addresses were never flushed

Fixes: WIFI-11973
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-16 17:08:59 +01:00
John Crispin
96c391eaac ucentral-event: fix captive portal rate-limiting
Fixes: WIFI-12305
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-16 17:08:14 +01:00
John Crispin
c700795895 ipq807x: add cig_wf660a to the CI workflow
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-16 08:30:28 +01:00
John Crispin
8bcb4c2063 ucentral-schema: update to latest HEAD
59c8214 hostapd parses psk-files in reverse order

Fixes: WIFI-12383
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-15 18:23:28 +01:00
John Crispin
ea95356ebd rtty: improve patch indenting
Newer version of GCC complained about inconsistent indenting.

Signed-off-by: John Crispin <john@phrozen.org>
2023-03-15 09:56:09 +01:00
Piotr Dymacz
8111566f35 feeds: ucentral: include BlueZ 5.66
Copy 'bluez' package from OpenWrt's packages master branch to 'ucentral'
feed so that we can use latest version and add custom, local changes.

Keep this within 'ucentral' feeds directory to override version provided
by community based 'packages' feed from OpenWrt 21.02.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-14 15:53:43 +01:00
John Crispin
c952b34858 ucentral-schema: update to latest HEAD
54453a6 cmd_script: custom scripts with no uri failed to send the stdout to the server

Fixes: WIFI-12358
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-14 14:52:23 +01:00
John Crispin
792e3a8a2e rtty: throttle the amount of data being pushed to the server
The socket died when too much data was sent too fast

Fixes: WIFI-12334
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-14 14:41:08 +01:00
John Crispin
ae75067938 ucentral-schema: default to 32 STA max assoc if the driver does not report a valid value
Fixes: WIFI-12355
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-13 15:03:24 +01:00
John Crispin
81b66ad44b dnsmasq: fix handling of option 38
Fixes: WIFI-12260
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-13 11:55:28 +01:00
John Crispin
e193250291 ucentral-schema: update to latest HEAD
5e08879 add additional event types

Signed-off-by: John Crispin <john@phrozen.org>
2023-03-13 07:49:54 +01:00
Piotr Dymacz
dc0dae6284 mcu: select host dependencies based on MCU firmware type
In case of some types of MCU firmware, additional tools, daemons, kernel
drivers, etc. are required on the host side. For example, for Bluetooth
HCI controller, at least kernel module and BlueZ should be included.

This adds a simple recipe which generates dependencies list per firmware
type/name and for existing 'hci_usb' and 'hci_uart', selects 3 packages:
'bluez-daemon', 'kmod-bluetooth' and 'kmod-crypto-user'.

Kernel crypto interface in user space has to be also included because
the BlueZ isn't able to create static address for LE-only controller
without it, which results in no registration of new BT interface:

  bluetoothd[668]: src/adapter.c:get_static_addr() Failed to open crypto
  bluetoothd[668]: No Bluetooth address for index 0

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-10 12:11:06 +01:00
John Crispin
7c535de60d ucentral-schema: update to latest HEAD
204341f state: add port_id and port_desc to lldp state

Fixes: WIFI-11975
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-09 16:40:58 +01:00
John Crispin
26192989cd ipq807x: add CIG WF196 BDF
split the image into 2 SKUs for CA/US.

Fixes: WIFI-12357
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-09 15:14:36 +01:00
John Crispin
317aaadcbd ucentral-schema: update to latest HEAD
0f40765 turn telemetry and realtime filter into an enum

Signed-off-by: John Crispin <john@phrozen.org>
2023-03-08 17:35:43 +01:00
Satya-sc
c670733ea5 ucentral-event: added support to queue the events when there is no ucentral client is running and send those once it is available
Signed-off-by: Satya-sc <Satya@shasta.cloud>
2023-03-08 17:20:21 +01:00
John Crispin
f92617f24a ipq807x: add zephyr specific profiles
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-08 17:18:53 +01:00
Piotr Dymacz
337a68cf1d mcu: ipq807x: add support for CIG WF-196
This includes default configuration for the on-board Nordic nRF52833 MCU
in CIG WF-196. A Zephyr based sample 'hci_uart' firmware is selected.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
e09633fc2a ipq807x: add Zephyr HCI UART MCU firmware to CIG WF-196
Include Zephyr v3.3.x based Bluetooth LE HCI UART firmware package in
default packages list for the CIG WF-196. This brings initial support
for the on-board nRF52833 MCU.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
d838391850 profiles: cig_wf196: include 'mcu' feed
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
d59e58b794 mcu: ipq807x: add support for EdgeCore EAP102
This includes default configuration for the on-board Nordic nRF52840 MCU
in EdgeCore EAP102. A Zephyr based sample 'hci_usb' firmware is selected.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
ee7bf9671a ipq807x: add Zephyr HCI USB MCU firmware to EdgeCore EAP102
Include Zephyr v3.3.x based Bluetooth LE HCI USB firmware package in
default packages list for the EdgeCore EAP102. This brings initial
support for the on-board nRF52840 MCU.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
c4f0f367bc profiles: edgecore_eap102: include 'mcu' feed
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
5f649ea1f4 mcu-firmware: include firmware based on latest Zephyr
This adds Zephyr firmware builds from custom git branch based on the
latest's upstream branch name 'main': 'main__mcu-on-wifi-boards'.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
397c6df34a feeds: mcu: introduce 'mcu-firmware' package
The new 'mcu-firmware' package will provide binary firmware dedicated
for MCU embedded on Wi-Fi boards (and also standalone, e.g. USB based),
supported by the OpenWrt/OpenWiFi projects. Currently, only Zephyr RTOS
based sample firmware ('BLE HCI controller' and 'hello world') files are
provided, for Wi-Fi boards and one standalone development module, listed
below:

- CIG WF-196 (Nordic nRF52833, UART bus)
- EdgeCore EAP102 (Nordic nRF52840, USB bus)
- Nordic nRF52840 Dongle (Nordic nRF52840, USB bus)

Different firmware types planned in future include Nordic's nRF Connect
SDK, OpenThread and others.

The Zephyr based firmware comes from a custom fork available in GitLab:
'https://gitlab.com/pepe2k/zephyr' (firmware in this package were built
from a v3.3.0 release based branch 'zephyr-v3.3.x__mcu-on-wifi-boards').

MCU firmware from this package is compatible only with OpenWrt/OpenWiFi
generic MCU support stack which, among others, assumes availability of
compatible bootloader (MCUboot is currently the only one supported) and
e.g. multiple firmware slots. MCUboot fork development takes part in git
repository hosted in GitLab: 'https://gitlab.com/pepe2k/mcuboot/'.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
7a37e9bf0b mcu: support default configuration with uci-defaults
This adds support for creating initial MCU configuration with use of
'uci-defaults' in a same was as for example 'uboot-envtools' package.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
e4ed881dd7 mcu: support OpenWiFi with uCentral
On device running OpenWiFi with uCentral, additional copy of the initial
UCI configuration will be generated in '/etc/config-shadow/'. As part of
the MCU configuration is done during runtime, after the 'config-shadow'
is created, we should update it as well to keep everything in sync.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
9aff26b7fb mcu: provide example UCI configuration file
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
5603442a37 feeds: mcu: introduce 'mcu' package
This introduces new package 'mcu' which is a collection of shell based
scripts used as glue code for generic MCU configuration and management.

The scripts are responsible for communicating with embedded MCU running
compatible MCUboot bootloader version over MCUmgr/SMP protocol.
The communication is realized based on usage of the introduced earlier
dedicated CLI tool called 'umcumgr.

The most important function of this package is a simple MCU's firmware
management (checking firmware available in the MCU's internal flash,
uploading new and selecting active on multi-firmware slot capable MCU).

This solution requires MCU running modified version of MCUboot,
available in GitLab: https://gitlab.com/pepe2k/mcuboot

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Piotr Dymacz
8a86ae3b7d feeds: add mcu feed with 'umcumgr' package
The 'umcumgr' is a simple command line tool for MCU firmware management
over MCUmgr/SMP protocol. It will be used together with MCUboot running
on the on-board (or external, e.g. in form of a dongle) MCU.

While at it, add also dedicated 'mcu.yml' profile file.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-07 11:08:39 +01:00
Ken
9997af10a5 CIG WF-660A : Add WF-660a support [patch 3]
Fixed caldata.bin can NOT be generated with EMMC issue.
2023-03-06 10:41:39 +01:00
John Crispin
5fec90d4ca uspot: fix userurl and allow cleartext password
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-06 09:37:17 +01:00
Piotr Dymacz
f1a56edd09 ipq807x: backport some additional fixes for Bluetooth
This backports more fixes for the Bluetooth subsystem from 4.9.
They were found missing during some initial Bluetooth LE testing.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-02 16:43:05 +01:00
Piotr Dymacz
3f03cfa7c4 ipq807x: backport fix for Bluetooth LE-only HCI controllers
This backports an essential fix for Bluetooth LE-only HCI devices from
kernel 4.9: 39385cb5f327 ("Bluetooth: Fix using the correct source
address type").

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-03-02 16:43:05 +01:00
John Crispin
f34db0bb24 ucentral-schema: update to latest HEAD
5517c1c wifiscan: add additional options to the periodic scan feature

Fixes: WIFI-11993
Signed-off-by: John Crispin <john@phrozen.org>
2023-03-01 17:36:38 +01:00
John Crispin
94d154c628 qca-ssdk: reduce log noise
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-28 16:08:59 +01:00
John Crispin
071962440e ucentral-schema: update to latest HEAD
5287f72 fix wifiscan channel

Fixes: WIFI-11993
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-28 12:21:17 +01:00
John Crispin
5171b52570 hostapd: do not use ubus return codes as auth/assoc errors
Fixes: WIFI-12330
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-27 13:06:32 +01:00
John Crispin
fb282e2aff qca-ssdk: fix UE Roaming between vlans
Fixes: WIFI-11886
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-27 11:52:40 +01:00
John Crispin
5013b9c7fe ipq807x: update WF196 BDF files
Fixes: WIFI-12333
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-24 15:14:50 +01:00
John Crispin
0e2fcfcb95 ucentral-schema: update to latest HEAD
86dc187 the developer mode indication should be in the top level of the capa dictionary
f4aca9b indicate secure-rtty by default

Signed-off-by: John Crispin <john@phrozen.org>
2023-02-24 15:08:32 +01:00
John Crispin
a7ea6ef398 ucentral-event: fix ubus notification and band detect
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-24 15:06:56 +01:00
John Crispin
b4a2291dce ucentral-event: fix boot detection
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-23 11:35:49 +01:00
John Crispin
9348c426e5 ipq807x: fixup yuncore fap650 support
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-23 09:21:12 +01:00
John Crispin
678c4db8f0 ucentral-schema: update to latest HEAD
35cf7bf add more verbose error code to the script command

Signed-off-by: John Crispin <john@phrozen.org>
2023-02-22 15:21:29 +01:00
John Crispin
e979df64d1 ucentral-schema: update to latest HEAD
2ee157f fix health.uc: the events patch left a stray sprintf( breaking compile
ac9e8cf capabilities: add developer mode info to restrictions

Signed-off-by: John Crispin <john@phrozen.org>
2023-02-22 10:57:41 +01:00
Ken
43fa167f14 ipq807x: Add WF-660a support
Fixes: WIFI-12280
Signed-off-by: Ken <xshi@actiontec.com>
2023-02-22 10:03:05 +01:00
John Crispin
2a8858a3a2 uspot: fix an exception in the idle timeout handler
Fixes: WIFI-12282
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-22 09:41:48 +01:00
John Crispin
977d16557a ucentral-event: do not reset rate limit for captive clients
Fixes: WIFI-12305
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-21 15:56:19 +01:00
Satya-sc
3db254c306 ucentral-event: add unit boot-up event 2023-02-20 15:40:30 +01:00
John Crispin
9274c3a719 rtty: enable mTLS support
Fixes: WIFI-10516
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-20 15:40:30 +01:00
John Crispin
993ff2624e ucentral-event: add wired events
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-20 15:40:30 +01:00
John Crispin
60f6565d18 ucentral-event: make the ssh event payload a dictionary
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-20 10:41:14 +01:00
John Crispin
924d30af74 ucentral-event: add bssid to wifi events
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-20 10:40:08 +01:00
John Crispin
c55d19c3c5 ucentral-event: fix polled telemetry stream
Fixes: WIFI-12341
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-20 10:35:53 +01:00
John Crispin
9221c3e7e7 ucentral-schema: update to latest HEAD
bf8c384 properly stream state in telemetry mode

Fixes: WIFI-12314
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-20 10:33:03 +01:00
John Crispin
eb862cf2d2 ucentral-client: update to latest HEAD
2917158 ubus fix dump all telemetry

Fixes: WIFI-12314
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-20 10:32:19 +01:00
John Crispin
1e3cef1a26 mac80211: backport 230-get_txpower.patch
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-15 15:46:39 +01:00
Piotr Dymacz
50fd49fd3d ipq807x: eap102: keep MCU disabled by default
This would simplify MCU setup after bootup.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-02-15 15:21:45 +01:00
Piotr Dymacz
8e8a763485 ipq807x: eap102: export more USB related pins
This exports USB related pins in sysfs using 'gpio-export' as:
- usb-rear-power
- usb-side-power
- usb-hub-enable (renamed from 'usb-enable')

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-02-15 15:21:45 +01:00
Piotr Dymacz
ab47566e82 ipq807x: eap102: add more pin configs for USB and MCU
This adds few more pin configs for USB (rear and side ports power) and
MCU (reserved pin, apparently used by device vendor for DTM enable).

While at it, align labels and nodes names with staging branch.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-02-15 15:21:45 +01:00
Piotr Dymacz
e9a834c205 ipq807x: wf196: keep MCU disabled by default
This would simplify MCU setup after bootup.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-02-15 15:21:45 +01:00
Piotr Dymacz
6dc524e67b ipq807x: wf196: export MCU reset pin
This exports MCU reset pin as 'mcu-enable' in sysfs with 'gpio-export'.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-02-15 15:21:45 +01:00
Piotr Dymacz
b61b3aa06f ipq807x: wf196: add pin config for MCU reset
This adds config for nRF52833 MCU reset pin on the CIG WF-196.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-02-15 15:21:45 +01:00
Piotr Dymacz
b9d43eb897 ipq807x: tidy up CIG WF-196 DTS file
This change focuses on the I/O related cleanups for the CIG WF-196 DTS
file. Most of the removed definitions come from QCA reference files and
should have been adjusted for a custom board. List of changes:

1. Drop 'btcoex' pinctrl mux define
   WF-196 includes nRF52833 MCU which doesn't have dedicated PTA coex
   hardware interface (see [1] for software based solution in Nordic's
   nRF Connect SDK). Based on the real hardware research, defined pins
   from 'btcoex' mux aren't routed to nRF52833 MCU.

2. Drop 'spi_3' pinctrl mux define
   Defined label isn't used as reference in any other node and defined
   GPIOs most likely aren't used as well.

3. Drop GPIO 46 and 47 from hsuart pinctrl mux define
   It turned out that only UART TX and RX lines are routed between the
   main SOC (IPQ8072A) and the MCU (nRF52833).

While at it, fix also some broken indentation and redundant new lines.

[1] https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/mpsl/doc/bluetooth_coex.html

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2023-02-15 15:21:45 +01:00
John Crispin
c069ba71cc ucentral-schema: update to latest HEAD
8c71638 fix listing mesh interfaces inside state
c3f6981 sysupgrade: GW sends FWsignature and not signature
94543ee state: cleanup and document the data model
6056d32 state: add [ avg, max ] cpu thermal sensor
900ce67 add phy temperature to state messages

Signed-off-by: John Crispin <john@phrozen.org>
2023-02-13 17:15:08 +01:00
John Crispin
df01a9acc0 ucentral-event: fix rtnl support
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-13 17:13:37 +01:00
Felix Fietkau
e0aa0eec98 ucode: add refcount fixes for rtnl/nl80211
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2023-02-13 15:24:52 +01:00
Tanya Singh
2a145ba46a WIFI-12182: Support Edgecore OAP100e
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-02-13 09:13:57 +01:00
John Crispin
9f34e57df8 ucentral-event: fix typo in events.json
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-08 09:04:30 +01:00
John Crispin
9c8affad09 ucode: backport rtnl notifications
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-08 08:43:31 +01:00
John Crispin
cd76797336 ucentral-schema: update to latest HEAD
17e7a3e fix lldp_description

Fixes: WIFI-12269
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-08 08:42:21 +01:00
John Crispin
feb26f21fd ucentral-event: add wifi-scan service
Fixes: WIFI-11993
Signed-off-by: John Crispin <john@phrozen.org>
2023-02-06 11:52:46 +01:00
Tanya Singh
5ff23ce3cf busybox: Fix Zero touch provisioning with DHCP option 138
Fixes: WIFI-12260
Signed-off-by: Tanya Singh <tanya_singh@accton.com>
2023-02-06 07:47:17 +01:00
Ravi Vaishnav
cacb8a23dd hostapd: Code for secondary RADIUS
Signed-off-by: Ravi Vaishnav <ravi.vaishnav@netexperience.com>
2023-02-05 09:41:55 +01:00
John Crispin
f5604d42f6 upgs: add package to default package selection
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 15:55:21 +01:00
John Crispin
8f74933b37 ucentral-schema: update to latest HEAD
f4f2e69 add cig_sha256

Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 14:32:15 +01:00
Venkat Chimata
2d92eeab07 openssl is needed to verify the command signatures 1. Enable openssl in AP firmware 2. Copy /certificates/sign_pubkey.pem into /etc/ucentral at boot time
Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
2023-01-27 14:29:54 +01:00
John Crispin
c44ab8b4e6 ugps: update to latest HEAD
Fixes: WIFI-12238
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 14:25:41 +01:00
John Crispin
d3ad594940 ucentral-schema: update to latest HEAD
242a1a1 gps: add support to the data model

Fixes: WIFI-12238
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 13:41:58 +01:00
John Crispin
8f53da4f79 hostapd: make radius rate-limit work with new event listener framework
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
1cc9673e8c disable none active services
Fixes: WIFI-12237
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
Ravi Vaishnav
258e484d5f uboot-envtools: Fix syntax on number of sectors
ProblemStatement: On EAP104, "fw_setenv" fails with the error "MTD erase error on /dev/mtd10: Invalid argument"
RootCause: uboot-envtools expects hex format for the number of sectors while the config file (/etc/fw_env.config) contains a decimal number format for the number of sectors. This leads to out-of-boundary size calculation within the function "environment_end()".
Solution: Update the scripts to write a hex value instead of a decimal value in the config file.

Reference for the expected format from the config file: Please check the function "get_config" in the file "fw_env.c", where the function uses sscanf to read the parameters from the config file.

Fixes: WIFI-12189
Signed-off-by: Ravi Vaishnav <ravi.vaishnav@netexperience.com>
2023-01-27 12:18:37 +01:00
John Crispin
7edbe99599 ucentral-schema: update to latest HEAD
cd97d41 make sure that restricted country code errors get propagated

Fixes: WIFI-12001
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
fbcfddfbdc initial events support
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
0e75b82eb6 uspot: allow adding IPs to the walled-garden
Fixes: WIFI-12032
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
492db67f64 base-files: sysupgrade: always imply -n if -f is not provided
This ensures that no random config giles get carried over.

Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
6129f525d5 udevstats: add new package
This package uses eBPF to do traffic accounting ont he WAN port

Fixes: WIFI-12183
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
Oleksandr Mazur
2ec381534e ucentral-client: health: remove redundant check for zero value
config_get is issued with a default (120) parameter, which makes a check for 0
a redundant.
It can be safely removed, as the check for "[ "$interval" -eq 0 ]" is
always non-zero.

Fixes 396e2bd06c ("ucentral-client: cleanup health parameter")

Tested on virtual Wlan-AP img: no syntax error occured.

Signed-off-by: Oleksandr Mazur <cahbua@gmail.com>
2023-01-27 12:18:37 +01:00
John Crispin
29d6d9f1ea ucentral-schema: update to latest HEAD
47b470f make captive portal radius-gw-proxy aware

Fixes: WIFI-11705
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
a530af9354 uspot: fix endless STOP frames and add radius-gw-proxy
Fixes: WIFI-12044
Fixes: WIFI-11705
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
e42fd1e3a4 ucentral-client: update to latest HEAD
568a84a do not enforce CN validation when in self-signed mode

Fixes: WIFI-12099
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
30cfc34e1c opennds: drop package
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
0737a706ec ubpf: drop feed
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
b3589c92dc p4: drop feed
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
0f40cb8e77 ucentral-schema: update to latest HEAD
7f77f02 state: add [ avg, max ] cpu thermal sensor
e635ab8 add phy temperature to state messages

Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
a051edcd00 ucentral-client: remove sysupgrade preserved config
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
18b19c92be ucentral-wifi: deprecate package
Fixes: WIFI-11926
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
a2eabf35e3 ucentral-schema: update to latest HEAD
9dc66d7 fix listing mesh interfaces inside state
ad84690 only set port counter if they are available

Fixes: WIFI-11994
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
Johann Hoffmann
0dfe43f1e6 Add patches/x86 directory to config.yml
Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2023-01-27 12:18:37 +01:00
John Crispin
20cda84f47 netifd: allow disabling unicast_to_multicast conversion on bridged wifi
Fixes: WIFI-11550
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
0228173d53 uspot: add mac-auth support
Fixes: WIFI-11895
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-27 12:18:37 +01:00
John Crispin
0db604ad1e Revert "ucentral-schema: update to latest HEAD"
This reverts commit e8bd819e39.
2023-01-16 16:46:48 +01:00
John Crispin
c53d342b6a uspot: fix exception during rediret
Fixes: WIFI-11995
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-16 14:56:17 +01:00
John Crispin
42e77e6f5a ipq807x: fix MAC assignment on WF188n
Fixes: WIFI-12090
Signed-off-by: John Crispin <john@phrozen.org>
2023-01-16 12:57:15 +01:00
John Crispin
e8bd819e39 ucentral-schema: update to latest HEAD
ec657b5 improve stability of reading counters

Signed-off-by: John Crispin <john@phrozen.org>
2023-01-13 14:09:25 +01:00
John Crispin
0c03b63c0f ucentral-schema: update to latest HEAD
ad84690 only set port counter if they are available

Signed-off-by: John Crispin <john@phrozen.org>
2023-01-12 06:02:39 +01:00
jaspreetsachdev
5ed2f1d964 Merge pull request #509 from Telecominfraproject/v2.8.0-rc4
V2.8.0 rc4
2022-12-20 10:16:06 -05:00
Jaspreet Sachdev
515793450e Merge branch 'main' into v2.8.0 2022-12-20 10:14:56 -05:00
John Crispin
541e9b0b4f ucentral-schema: update to latest HEAD
4278dfb gre: add dont fragment flag

Signed-off-by: John Crispin <john@phrozen.org>
2022-12-20 11:00:42 +01:00
jaspreetsachdev
24611df4c6 Merge pull request #508 from Telecominfraproject/v2.8.0-rc3
V2.8.0 rc3
2022-12-19 17:47:11 -05:00
Jaspreet Sachdev
083010d43c Merge branch 'main' into v2.8.0 2022-12-19 13:38:29 -05:00
John Crispin
f9b46fd6b0 ucentral-schema: update to latest HEAD
39dad34 wireguard: fix reload after reboot

Fixes: WIFI-12002
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-19 13:02:46 +01:00
John Crispin
74eb6f96ab atfpolicy: reduce ubus_wait timeout to 2s
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-19 13:01:49 +01:00
John Crispin
4967fcd2be hostapd: improve multi CoA support
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-18 15:25:27 +01:00
John Crispin
e973110de7 ath11k: fix mac assignment on cig wf196
Fixes: WIFI-11976
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-17 10:43:04 +01:00
John Crispin
a62503328b .github/workflows: add cig,wf194c4
Fixes: WIFI-11983
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-16 16:15:47 +01:00
John Crispin
e42051d3a9 hostapd: add dynamic_own_ip support
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-15 12:03:31 +01:00
John Crispin
e5336b7351 ucentral-schema: update to latest HEAD
b539203 include APVLAN associations inside state messages

Fixes: WIFI-11861
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-14 17:09:46 +01:00
John Crispin
5469af35f1 ucentral-schema: update to latest HEAD
6049cd7 various state improvements

Fixes: WIFI-11967
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-14 11:53:51 +01:00
John Crispin
8c9cd8f9d2 ratelimit: fix syntax error during parsing of wlanX-Y
Fixes: WIFI-11965
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-13 16:50:58 +01:00
John Crispin
8b3ac5ea36 uspot: purge pending flows during flush
Fixes: WIFI-11908
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-12 11:46:09 +01:00
John Crispin
c230825486 uspot: do not send accounting off upon logoff
Fixes: WIFI-11907
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-12 11:45:57 +01:00
John Crispin
e8b0f5da60 ucentral-schema: update to latest HEAD
53e3bb4 radio.channel should not be an array

Signed-off-by: John Crispin <john@phrozen.org>
2022-12-12 10:43:34 +01:00
John Crispin
bc45e11824 ucentral-schema: update to latest HEAD
e336aa4 add username to captive state

Fixes: WIFI-11896
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-12 08:22:56 +01:00
John Crispin
d6b3e97c34 ucentral-schema: update to latest HEAD
195ed80 fix multicast to unicast conversion on wifi

Fixes: WIFI-11550
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-12 07:44:48 +01:00
jaspreetsachdev
d35a12b4f4 Merge pull request #506 from Telecominfraproject/v2.8.0-rc2
V2.8.0 rc2
2022-12-09 13:33:12 -05:00
John Crispin
a42f103500 .github/workflows/: add yuncore fap640 to CI builds
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-08 18:14:44 +01:00
John Crispin
dc2a48c515 ucentral-schema: update to latest HEAD
f3c9972 state: add ssid counters
0329b38 state: make the tid-stats opt-in

Fixes: WIFI-11234
Fixes: WIFI-11928
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-08 18:09:20 +01:00
John Crispin
db617e23f0 ipq807x: do no keep uboot-env config during sysupgrade
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-08 15:31:30 +01:00
John Crispin
71189b1b74 ramips: add yuncore fap640 support
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-08 15:31:13 +01:00
John Crispin
5567de89e6 ipq807x: add yuncore fap650
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-08 10:12:54 +01:00
John Crispin
5430d79f53 .github/workflows/: add yuncore devices to CI
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-08 07:45:19 +01:00
John Crispin
9d82d88a0c ucentral-schema: update to latest HEAD
084fa1a use ucode handler to get channel survey
870a719 improve DFS channel restrictions

Signed-off-by: John Crispin <john@phrozen.org>
2022-12-07 17:48:18 +01:00
John Crispin
0e264203de luci-mod-ucentral: add diagnostic download button
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-07 17:47:33 +01:00
John Crispin
469443da2a profiles: fix indio image paths
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-07 12:03:04 +01:00
John Crispin
692958d2fd uspot: fix idle-timeout handling
Fixes: WIFI-11208
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-07 11:55:20 +01:00
Kishan Shukla
e65fa74071 ucentral-schema: add gre6 example config
Signed-off by: Kishan Shukla <kishan.shukla@hfcl.com>
2022-12-05 18:49:29 +01:00
Sohail Ahmad
fb64d45c39 From: Sohail Ahmad <sohail@indionetworks.com> Date: Mon Dec 5 02:58:36 2022 +0000 Subject: [PATCH] dnsmasq: enabled EDNS configuration options- CPE ID and subnet
Signed-off-by: Sohail Ahmad <sohail@indionetworks.com>
2022-12-05 11:45:06 +01:00
John Crispin
71e5c8f441 ucentral-schema: update to latest HEAD
c6ba7ce add diagnostic script support
5d70069 cmd_script: add an additional return json when upload was triggered

Signed-off-by: John Crispin <john@phrozen.org>
2022-12-05 11:13:46 +01:00
John Crispin
8e34f6653c .github/workflows/: add Indio's 11ax 2x2 models (indoor and outdoor) targets
Signed-off-by: Sohail Ahmad <sohail@indionetworks.com>
2022-12-02 14:45:06 +01:00
Rick Sommerville
bee060b9bb udhcpsnoop: snoop clients in GRE tunnel
Fixes WIFI-11710

Signed-off-by: Rick Sommerville <rick.sommerville@netexperience.com>
2022-12-02 14:16:01 +01:00
Arif Alam
e3e94fe520 base-files: make EAP104 switch ports configurable
Fixes WIFI-11709

Signed-off-by: Arif Alam <arif.alam@netexperience.com>
2022-12-02 14:14:41 +01:00
John Crispin
237c090cb4 uspot: add max octet support
Signed-off-by: John Crispin <john@phrozen.org>
2022-12-02 14:06:43 +01:00
John Crispin
74ea7a7a1e ucentral-schema: update to latest HEAD
efd60c9 add maximum_clients_ignore_probe support

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-29 14:30:54 +01:00
John Crispin
330dbd49e6 uspot: properly set the ssid inside a UEs state
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-29 14:30:54 +01:00
John Crispin
a84b047061 ucode: fix a memory corruption
the uloop binding was not closing the uloop epoll fd correcttl when forking.

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-29 14:30:54 +01:00
John Crispin
3795060bf2 uspot: properly terminate Acct when /logoff happens
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-29 14:30:54 +01:00
Johann Hoffmann
e61ab97815 .github/: Patch workflows with regard to deprecated Github actions commands (#502)
* Update checkout action version and replace set-output command
* Put whole echo statement in double quotes
* Replace set-output commands in action as well

Signed-off-by: Johann Hoffmann <johann.hoffmann@mailbox.org>
2022-11-29 14:30:34 +01:00
Piotr Dymacz
0162828df8 ipq807x: eap102: export MCU and USB reset pins
This exports MCU and USB reset pins in sysfs using 'gpio-export' as
'mcu-enable' and 'usb-enable'.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-11-23 14:55:03 +01:00
Piotr Dymacz
73cfef1203 ipq807x: eap102: add pin configs for USB and MCU reset
This adds configuration for reset pins connected with nRF52840 MCU and
the GL850G USB HUB on the EdgeCore EAP102.

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-11-23 14:54:53 +01:00
Piotr Dymacz
3eb6360054 ipq807x: tidy up EdgeCore EAP102 DTS file
This change focuses on the I/O related cleanups for the EdgeCore EAP102
DTS file. Most of the removed definitions come from QCA reference files
and should have been adjusted for a custom board. List of changes:

1. Drop 'btcoex' pinctrl mux define
   EAP102 includes nRF52840 MCU which doesn't have dedicated PTA coex
   hardware interface (see [1] for software based solution in Nordic's
   nRF Connect SDK). Based on the real hardware research, defined pins
   from 'btcoex' mux aren't routed to nRF52840 MCU.

2. Drop 'hsuart' pinctrl mux define and 'serial_blsp2' node
   Only one UART interface is used on the EAP102.

3. Drop 'usb_mux_sel' pinctrl mux
   Defined label isn't use as reference in any other node and defined
   GPIO most likely isn't used as well.

4. Disable 'pcie0' and remove 'pcie0' pinctrl mux
   EAP102 doesn't use of any of the IPQ8071A PCIe buses.

[1] https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrfxlib/mpsl/doc/bluetooth_coex.html

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-11-23 14:54:49 +01:00
Piotr Dymacz
47e4bc585a ipq807x: add named gpio exports
Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-11-23 14:54:12 +01:00
John Crispin
3746722a4d uspot: redirect to UAM server upon /logoff
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 13:34:31 +01:00
John Crispin
5828971cfe uspot: add support for propagating the Class VAP (25)
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
dd911cbf21 uncentral-schema: update to latest HEAD
74fc62b captive: add /logout as a valid logoff path
18f7d08 captive: block remaining non-auth traffic in NAT mode
eb0c25c add signature verification wrapper
ef06d00 Add Support for EOGREv6

Fixes: WIFI-10887
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
f167553348 spotfilter: do not flush ip addresses upon logoff
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
d483c55c14 uspot: allow /logout in addition to /logoff
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
d9815c0f62 radius-gw-proxy: fix possible memory corruption
Fixes: WIFI-10964
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
daadf043d8 spotfilter: fix idle detection
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
1a56d5820d ratelimit: improve hotplug trigger
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
8e2f2fcce3 hostapd: add dynamic_probe_resp support
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-23 09:00:38 +01:00
John Crispin
fc5a841563 ucentral-schema: update to latest HEAD
c72603f wifi.station: code was incorrectly reporting MCS value inside NSS field

Fixes: WIFI-11599
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 16:05:36 +01:00
John Crispin
d511a338df uspot: add userurl to uam redirect parameters
Fixes: WIFI-11539
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 10:44:14 +01:00
John Crispin
a3d348b664 ipq807x: add initial support for MUXI AP3220L
Hardware:
* SoC: Qcom IPQ5018
* RAM: 512MB
* Flash: 4MB Nor + 128MB Nand
* Ethernet: 2x GbE
* WLAN: 2x2 2.4GHz 574Mbps(builtin) + 2x2 5GHz 2400Mbps(qcn6122)
* BT: BT5.1(builtin) / nrf52840(option)
* LEDS: 1x power, 1x 2G, 1x 5G
* Buttons: 1x reset
* USB: 1x 2.0(Type-A)
* Power: DC 12V/2A, PoE 48V/0.6A
* UART: 1x RJ45

Flash instruction under U-Boot:
tftpboot 0x44000000 openwrt-ipq807x-muxi_ap3220l-squashfs-nand-factory.bin
imxtract 0x44000000 ubi
flash rootfs
reset

Signed-off-by: angliu-muxi <ang.liu@muxi-connect.com>
2022-11-14 09:21:06 +01:00
Kishan
b48506b156 ip807x: HFCL WiFi6 ION4X and ION4X_2 target addition
Fixes: WIFI-11576
Signed-off by: Kishan Shukla <kishan.shukla@hfcl.com>
2022-11-14 08:19:36 +01:00
Isaev Ruslan
17bb88b67a ipq807x: wifi-ax/ath11-firmware/Makefile yuncore ax840 fix This define recipe for yuncore ax840 device to copy firmware to the correct location.
Signed-off-by: Isaev Ruslan <legale.legale@gmail.com>
2022-11-14 07:47:20 +01:00
John Crispin
578a616b00 ipq807x: ipq6018 based boards caldata size fix
This fixes size of the caldata for ipq60xx based boards and moves the
YunCore AX840 to correct case block (the board is IPQ60xx based, so
the driver looks for ath11k/IPQ6018/hw1.0/caldata.bin,
not ath11k/IPQ8074/hw2.0/caldata.bin). Without this fix, the driver
isn't able to fetch caldata:
[ 16.792551] ath11k c000000.wifi: qmi failed to load CAL data file:caldata.bin

Signed-off-by: Isaev Ruslan <legale.legale@gmail.com>
2022-11-14 07:47:20 +01:00
Piotr Dymacz
93f603e27c base-files: fix foreign sysupgrade detection
Backups are gzipped, include the missing 'z' parameter in 'tar' call.
While at it, make 'grep' call quiet (add 'q' parameter).

Signed-off-by: Piotr Dymacz <pepe2k@gmail.com>
2022-11-14 07:47:20 +01:00
John Crispin
09b513550c ucentral-schema: update to latest HEAD
b4b8e19 fix wifi unicast conversion
83761f9 fix dtim-period handling

Fixes: WIFI-11550
Fixes: WIFI-11546
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
5e451461cf central-client: update to latest HEAD
5f69da7 send restricted=1 on locked units

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
fd33396acb ucentral-schema: update to latest HEAD
129d75a add final-redirect-rul for cpative portal support

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
3bdfa68ff5 dnsmasq: ignore dhcp events on spotfilter-ifb
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
3dbc070f2c uspot: add final-redirect-url
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
b48e5eb057 ucentral-schema: add ASB bundle.uc
Fixes: WIFI-10967
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
3501bd9c11 ucentral-schema: update to latest HEAD
a509308 rssi thresholds are iface and not bss options

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
70635ac911 ucentral-schema: update to latest HEAD
85698d2 move health_check settings tp the metric deictionary

Fixes: WIFI-11262
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
f9a00b7ebd ucentral-schema: update to latest HEAD
9968cb6 cmd_trace: limit maximum file size to 25% of free mem

Fixes: WIFI-11224
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
5bec28b7e5 ucentral-client: update to latest HEAD
6e774f6 upload: delete files after the upload completed

Fixes: WIFI-11224
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
Venkat Chimata
e41818470f Updating the board files for Liteon WPX8324.
Signed-off-by: Venkat Chimata <venkata@shasta.cloud>
2022-11-14 07:47:20 +01:00
John Crispin
a31422d3d7 ucentral-schema: update to latest HEAD
f941f47 healthcheck: set 60s as the minimum interval
85495ab wifi.iface was not converting 6G channels correctly

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
bea3d2c4f8 usteer2: add new package
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
4c4cb58027 ucentral-schema: update to latest HEAD
8d4384b add session-timeout to captive support
516829a add client kick threshold support
5a5085b add uci_section to wifi uci

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
4312a42b62 ucentral-client: update to latest HEAD
e39e9c2 add wildcard CN validation

Fixes: WIFI-10419
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
011e5b6e1a ucentral-schema: update to latest HEAD
0856cd5 add support for wifi mac acl

Signed-off-by: John Crispin <john@phrozen.org>
2022-11-14 07:47:20 +01:00
John Crispin
8233c10569 .github: add wallys_dr6018_v4 to the build pipeline
Signed-off-by: John Crispin <john@phrozen.org>
2022-11-04 11:20:07 +01:00
3988 changed files with 921365 additions and 356448 deletions

View File

@@ -15,7 +15,7 @@ runs:
id: import_snapshot
shell: bash
run: |
echo ::set-output name=import_task_id::$(aws ec2 import-snapshot --description '${{ inputs.firmware_image_name }}' --disk-container 'Format=raw,UserBucket={S3Bucket=${{ inputs.firmware_image_s3_bucket }},S3Key=${{ inputs.firmware_image_name }}}' | jq -r '.ImportTaskId')
echo "import_task_id=$(aws ec2 import-snapshot --description '${{ inputs.firmware_image_name }}' --disk-container 'Format=raw,UserBucket={S3Bucket=${{ inputs.firmware_image_s3_bucket }},S3Key=${{ inputs.firmware_image_name }}}' | jq -r '.ImportTaskId')" >> $GITHUB_OUTPUT
- name: Wait for import task to complete and get snapshot ID
id: get_snapshot_id
@@ -26,7 +26,7 @@ runs:
IMPORT_TASK_STATUS=$(aws ec2 describe-import-snapshot-tasks --import-task-ids ${{ steps.import_snapshot.outputs.import_task_id }} | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.Status')
echo "Import task status is $IMPORT_TASK_STATUS, waiting for completion."
done
echo ::set-output name=id::$(aws ec2 describe-import-snapshot-tasks --import-task-ids ${{ steps.import_snapshot.outputs.import_task_id }} | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.SnapshotId')
echo "id=$(aws ec2 describe-import-snapshot-tasks --import-task-ids ${{ steps.import_snapshot.outputs.import_task_id }} | jq -r '.ImportSnapshotTasks[].SnapshotTaskDetail.SnapshotId')" >> $GITHUB_OUTPUT
- name: Tag snapshot with image name
shell: bash

View File

@@ -21,10 +21,15 @@ jobs:
strategy:
fail-fast: false
matrix:
target: ['actiontec_web7200', 'cig_wf188n', 'cig_wf196', 'cig_wf610d', 'cig_wf808', 'cybertan_eww622-a1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'liteon_wpx8324', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_ssw2ac2600', 'edgecore_spw2ac1200', 'edgecore_spw2ac1200-lan-poe', 'hfcl_ion4', 'hfcl_ion4xe', 'hfcl_ion4xi', 'indio_um-305ac', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'linksys_ea6350-v4', 'linksys_e8450-ubi', 'linksys_ea8300', 'meshpp_s618_cp03', 'meshpp_s618_cp01', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'x64_vm' ]
target: [ 'cig_wf186h', 'cig_wf186w', 'cig_wf188n', 'cig_wf196', 'cig_wf660a', 'cybertan_eww622-a1', 'cybertan_eww631-a1', 'cybertan_eww631-b1', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_eap104', 'edgecore_eap111', 'edgecore_ecw5211', 'edgecore_oap101', 'edgecore_oap101-6e', 'edgecore_oap101e', 'edgecore_oap101e-6e', 'edgecore_oap102', 'hfcl_ion4','hfcl_ion4xi_wp', 'hfcl_ion4xe', 'hfcl_ion4xi', 'hfcl_ion4x', 'hfcl_ion4x_2', 'hfcl_ion4xi_w', 'hfcl_ion4xi_HMR', 'hfcl_ion4x_w', 'indio_um-305ax', 'indio_um-325ac', 'indio_um-510ac-v3', 'indio_um-550ac', 'indio_um-310ax-v1', 'indio_um-510axp-v1', 'indio_um-510axm-v1', 'udaya_a5-id2', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018_v4', 'yuncore_ax820', 'yuncore_ax840', 'yuncore_fap640', 'yuncore_fap650', 'yuncore_fap655' ]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
# Clean unnecessary files to save disk space
- name: clean unncessary files to save space
run: |
docker rmi `docker images -q`
- name: Build image for ${{ matrix.target }}
id: build
@@ -72,7 +77,7 @@ jobs:
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$JSON_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
if [ ${{ matrix.target }} == 'x64_vm' ]; then
echo ::set-output name=x64_vm_image_name::"$(echo $IMG_NAME)"
echo "x64_vm_image_name=$(echo $IMG_NAME)" >> $GITHUB_OUTPUT
fi
trigger-testing:
@@ -93,7 +98,7 @@ jobs:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use create-ami-from-image composite action
uses: ./.github/actions/create-ami-from-image

View File

@@ -22,14 +22,14 @@ jobs:
target: ['x64_vm']
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Build image for ${{ matrix.target }}
id: build
run: |
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
make -j TARGET=${{ matrix.target }}
make -j TARGET=${{ matrix.target }} make -j TARGET=${{ matrix.target }}
- name: Package and upload image for ${{ matrix.target }}
id: package_and_upload_image
@@ -70,14 +70,14 @@ jobs:
[ -f openwrt/tmp/image-file ] && aws s3api put-object-tagging --bucket "$AWS_S3_BUCKET_NAME" --key "$JSON_NAME" --tagging "{\"TagSet\":[{\"Key\":\"release\",\"Value\":\"$IS_RELEASE\"}]}"
if [[ ${{ matrix.target }} == 'x64_vm' ]]; then
echo ::set-output name=x64_vm_image_name::"$(echo $IMG_NAME)"
echo "x64_vm_image_name=$(echo $IMG_NAME)" >> $GITHUB_OUTPUT
fi
create-x64_vm-ami:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
ref: WIFI-7206-add-workflow-to-build-virtual-ap-image

View File

@@ -1,16 +1,7 @@
repo: https://github.com/openwrt/openwrt.git
branch: openwrt-21.02
revision: c67509efd7d0c43eb3f622f06c8a31aa28d22f6e
branch: openwrt-23.05
revision: e92cf0c46ffe3ac7fca936c18577bfb19eb4ce9e
output_dir: ./output
patch_folders:
- patches/backports/
- patches/base
- patches/wifi
- patches/ath79
- patches/ramips
- patches/ipq40xx
- patches/ipq806x
- patches/ipq807x
- patches/rtkmipsel
- patches/rest
- patches

View File

@@ -0,0 +1,29 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ble_scan
PKG_VERSION:=1.0
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/ble_scan
SECTION:=base
CATEGORY:=Utilities
TITLE:=ble_scan
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Package/ble_scan/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/ble_scan $(1)/bin/
endef
define Package/ble_scan/extra_provides
echo "libc.so.6";
endef
$(eval $(call BuildPackage,ble_scan))

View File

@@ -0,0 +1,47 @@
#all: ble_scan
#ble_scan: ble_scan.o
# $(CC) $(LDFLAGS) ble_scan.o -o ble_scan
#blescan.o: ble_scan.c
# $(CC) $(CFLAGS) -c ble_scan.c
#clean:
# rm *.o ble_scan
#
#
# Author: Teunis van Beelen
#
# email: teuniz@protonmail.com
#
#
#CROSS-COMPILE:=../../../../../qsdk/staging_dir/toolchain-arm/bin/arm-openwrt-linux-
#CC:=$(CROSS-COMPILE)gcc
CC = gcc
CFLAGS = -Wall -Wextra -Wshadow -Wformat-nonliteral -Wformat-security -Wtype-limits -O2
objects = rs232.o
all: ble_scan
ble_scan : $(objects) ble_scan.o
$(CC) $(CFLAGS) $(objects) ble_scan.o -o ble_scan
ble_scan.o : ble_scan.c rs232.h
$(CC) $(CFLAGS) -c ble_scan.c -o ble_scan.o
rs232.o : rs232.h rs232.c
$(CC) $(CFLAGS) -c rs232.c -o rs232.o
clean :
$(RM) ble_scan $(objects) ble_scan.o
#
#
#
#

View File

@@ -0,0 +1,387 @@
/**************************************************
file: ble_scan.c
purpose: Send HCI command to do BLE scan
compile with the command: gcc ble_scan.c rs232.c -Wall -Wextra -o2 -o ble_scan
**************************************************/
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#ifdef _WIN32
#include <Windows.h>
#else
#include <unistd.h>
#endif
#include "rs232.h"
#define TX 0
#define RX 1
#define BUF_SIZE 4095
#define FULL_BUF_SIZE BUF_SIZE*4
//#define DEBUG
#ifdef DEBUG
#else
#endif
int print_hex(int mode, unsigned char *buf, int size);
int rx_pkt_parser(unsigned char *buf, int size);
struct rx_packet_h{
unsigned char rxType;
unsigned char rxEventCode;
unsigned char rxDataLen;
unsigned char Event[2];
unsigned char Status;
};
struct event_cmd_st_h{
unsigned char OpCode[2];
unsigned char DataLength;
};
struct event_scn_evnt_rep_h{
unsigned char EventId[4];
unsigned char AdvRptEventType;
unsigned char AddressType;
unsigned char Address[6];
unsigned char PrimaryPHY;
unsigned char SecondaryPHY;
unsigned char AdvSid;
unsigned char TxPower;
unsigned char RSSI;
unsigned char DirectAddrType;
unsigned char DirectAddr[6];
unsigned char PeriodicAdvInt[2];
unsigned char DataLength[2];
//unsigned char *DataPtr;
};
int main()
{
int cport_nr,bdrate,n;
//cport_nr=0, /* /dev/ttyS0 (COM1 on windows) */
//bdrate=9600; /* 9600 baud */
cport_nr=39, /* (ttyMSM1 : 39) */
bdrate=115200; /* 115200 baud */
#ifdef DEBUG
clock_t t;
#endif
char mode[]={'8','N','1',0};
unsigned char buf[BUF_SIZE];
unsigned char full_buf[FULL_BUF_SIZE];
int full_buf_ptr = 0;
unsigned char HCIExt_ResetSystemCmd[] = {0x01, 0x1D, 0xFC, 0x01, 0x00 };
int HCIExt_ResetSystemCmd_length = 5;
unsigned char GAP_DeviceInitCmd[] = {0x01, 0x00, 0xFE, 0x08, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
int GAP_DeviceInitCmd_length = 12;
unsigned char GapScan_enableCmd[] = {0x01, 0x51, 0xFE, 0x06, 0x00, 0x00, 0xF4, 0x01, 0x28, 0x00 };
int GapScan_enableCmd_length = 10;
if(RS232_OpenComport(cport_nr, bdrate, mode, 0))
{
printf("Can not open comport\n");
return(0);
}
RS232_flushRXTX(cport_nr);
// send reset command
#ifdef DEBUG
t=clock();
print_hex(TX, HCIExt_ResetSystemCmd, HCIExt_ResetSystemCmd_length);
t=clock()-t;
printf("t=%ld\n",t); //60
#else
/* sleep for 60ms */
usleep(60000);
#endif
RS232_SendBuf(cport_nr, HCIExt_ResetSystemCmd, HCIExt_ResetSystemCmd_length);
/* sleep for 1 Second */
#ifdef DEBUG
t=clock();
#endif
usleep(1000000);
#ifdef DEBUG
t=clock()-t;
printf("CLOCKS_PER_SEC=%ld\n",t);
#endif
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
#ifdef DEBUG
t=clock();
print_hex(RX, buf, n);
t=clock()-t;
printf("t=%ld\n",t);
#else
/* sleep for 300ms */
usleep(300000);
#endif
// send device initial command
#ifdef DEBUG
t=clock();
print_hex(TX, GAP_DeviceInitCmd, GAP_DeviceInitCmd_length);
t=clock()-t;
printf("t=%ld\n",t);
#else
/* sleep for 250 ms */
usleep(250000);
#endif
RS232_SendBuf(cport_nr, GAP_DeviceInitCmd, GAP_DeviceInitCmd_length);
/* sleep for 0.5 Second */
usleep(500000);
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
#ifdef DEBUG
t=clock();
print_hex(RX, buf, n);
t=clock()-t;
printf("t=%ld\n",t);
#else
/* sleep for 500 ms */
usleep(500000);
#endif
// send scan command
#ifdef DEBUG
t=clock();
print_hex(TX, GapScan_enableCmd, GapScan_enableCmd_length);
t=clock()-t;
printf("t=%ld\n",t);
#else
/* sleep for 30ms */
usleep(30000);
#endif
RS232_SendBuf(cport_nr, GapScan_enableCmd, GapScan_enableCmd_length);
//read scan respone
while (n > 0)
{
/* sleep for 400 mS */
usleep(400000);
n = RS232_PollComport(cport_nr, buf, BUF_SIZE);
#ifdef DEBUG
t=clock();
print_hex(RX, buf, n);
t=clock()-t;
printf("t=%ld\n",t);
#endif
if (full_buf_ptr+n>FULL_BUF_SIZE)
{
#ifdef DEBUG
printf("buffer full. break.\n");
#endif
break;
}
memcpy(full_buf+full_buf_ptr, buf, n);
full_buf_ptr+=n;
#ifdef DEBUG
printf("n:%d, full_buf_ptr:%d\n",n, full_buf_ptr);
#endif
}
#ifdef DEBUG
print_hex(RX, full_buf, full_buf_ptr);
#endif
rx_pkt_parser( full_buf, full_buf_ptr);
#ifdef DEBUG
printf("n:%d, full_buf_ptr:%d\n",n, full_buf_ptr);
#endif
RS232_flushRXTX(cport_nr);
RS232_CloseComport(cport_nr);
return(0);
}
/**************************************************
Print buffer in HEX
**************************************************/
int print_hex(int mode, unsigned char *buf, int size)
{
int ii,jj;
if (mode == TX)
printf("TX: ");
else
printf("RX: ");
for(ii=0,jj=0; ii < size; ii++,jj++)
{
printf("%02X ",buf[ii]);
if (jj==15)
{
printf("\n");
jj = 0;
}
}
printf("\n");
return(0);
}
int rx_pkt_parser(unsigned char *buf, int size)
{
int pkt_index=0;
int pkt_size=0;
int temp_event=0;
int temp_EventId=0;
int total_device_count=0;
char szAddress[18];
struct rx_packet_h *rx_packet;
struct event_scn_evnt_rep_h *event_scn_evnt_rep;
#ifdef DEBUG
int dump_i=0;
unsigned char *pkt_ptr;
#endif
if(size<=0){printf("size error\n");return -1;}
printf("BLE scan start:\n");
rx_packet = (struct rx_packet_h *)(buf);
while(pkt_index<size)
{
#ifdef DEBUG
printf("--------------------------------------------------------------------\n");
printf("-Type : 0x%02X (%s)\n",rx_packet->rxType,rx_packet->rxType==0x4?"Event":"Unknown");
if(rx_packet->rxType!=0x4)
{
printf(" Type unknown, rxType:0x%02X, pkt_index:%d\n",rx_packet->rxType,pkt_index);
}
printf("-EventCode : 0x%02X (%s)\n",rx_packet->rxEventCode,rx_packet->rxEventCode==0xff?"HCI_LE_ExtEvent":"Unknown");
if(rx_packet->rxEventCode!=0xff)
{
printf(" EventCode unknown, rxEventCode:0x%02X, pkt_index:%d\n",rx_packet->rxEventCode,pkt_index);
}
printf("-Data Length : 0x%02X (%d) bytes(s)\n",rx_packet->rxDataLen,rx_packet->rxDataLen);
#endif
temp_event = (rx_packet->Event[1]<<8)+rx_packet->Event[0] ;
#ifdef DEBUG
printf(" Event : 0x%02X%02X (%d) ",rx_packet->Event[1],rx_packet->Event[0],temp_event);
if(temp_event==0x067F)
{
printf("(GAP_HCI_ExtentionCommandStatus)\n");
}
else if(temp_event==0x0600)
{
printf("(GAP_DeviceInitDone)\n");
}
else if(temp_event==0x0613)
{
printf("(GAP_AdvertiserScannerEvent)\n");
}
else
{
printf(" Event unknown, Event:0x%04X, pkt_index:%d\n",temp_event,pkt_index);
}
printf(" Status : 0x%02X (%d) (%s)\n",rx_packet->Status,rx_packet->Status,rx_packet->Status==0?"SUCCESS":"FAIL");
#endif
if(temp_event==0x0613)
{
event_scn_evnt_rep = (struct event_scn_evnt_rep_h *)(&(rx_packet->Status) + 1);
temp_EventId = (event_scn_evnt_rep->EventId[3]<<24) + (event_scn_evnt_rep->EventId[2]<<16) +
(event_scn_evnt_rep->EventId[1]<<8) + (event_scn_evnt_rep->EventId[0]) ;
#ifdef DEBUG
printf(" EventId : 0x%02X%02X%02X%02X (%d) ", event_scn_evnt_rep->EventId[3],
event_scn_evnt_rep->EventId[2],
event_scn_evnt_rep->EventId[1],
event_scn_evnt_rep->EventId[0],temp_EventId);
if(temp_EventId==0x00010000)
{
printf("(GAP_EVT_SCAN_ENABLED)\n");
}
else if(temp_EventId==0x00020000)
{
printf("(GAP_EVT_SCAN_DISABLED)\n");
}
else if(temp_EventId==0x00400000)
{
printf("(GAP_EVT_ADV_REPORT)\n");
}
else
{
printf(" EventId unknown, EventId:0x%08X, pkt_index:%d\n",temp_EventId,pkt_index);
}
#endif
if(temp_EventId==0x00400000)
{
sprintf(szAddress,"%02X:%02X:%02X:%02X:%02X:%02X", event_scn_evnt_rep->Address[5],
event_scn_evnt_rep->Address[4],
event_scn_evnt_rep->Address[3],
event_scn_evnt_rep->Address[2],
event_scn_evnt_rep->Address[1],
event_scn_evnt_rep->Address[0]);
#ifdef DEBUG
printf("%04d", total_device_count);
printf(" Address : %s", szAddress);
printf(" RSSI : 0x%02X (%d)(%d)",event_scn_evnt_rep->RSSI,event_scn_evnt_rep->RSSI,event_scn_evnt_rep->RSSI-256);
#else
printf(" Address: %s RSSI: %d", szAddress, event_scn_evnt_rep->RSSI-256);
#endif
printf("\n");
total_device_count++;
}
}
pkt_size = 3+rx_packet->rxDataLen;
#ifdef DEBUG
pkt_ptr = (unsigned char *)rx_packet;
printf(" <Info > Dump(Rx):");
for(dump_i=0; dump_i < pkt_size; dump_i++)
{
if (dump_i%16==0)
{
printf("\n");
printf("%04x:",dump_i);
}
printf("%02X ",pkt_ptr[dump_i]);
}
printf("\n");
#endif
pkt_index+=pkt_size;
#ifdef DEBUG
printf(" pkt_size:%d, pkt_index:%d\n",pkt_size,pkt_index);
#endif
rx_packet = (struct rx_packet_h *)(&(rx_packet->rxDataLen) + rx_packet->rxDataLen + 1);
}
printf("Total: %d Device found.\n",total_device_count);
return 0;
}

View File

@@ -0,0 +1,879 @@
/*
***************************************************************************
*
* Author: Teunis van Beelen
*
* Copyright (C) 2005 - 2021 Teunis van Beelen
*
* Email: teuniz@protonmail.com
*
***************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
***************************************************************************
*/
/* Last revision: February 9, 2021 */
/* For more info and how to use this library, visit: http://www.teuniz.net/RS-232/ */
#include "rs232.h"
#if defined(__linux__) || defined(__FreeBSD__) /* Linux & FreeBSD */
#define RS232_PORTNR 40
int Cport[RS232_PORTNR],
error;
struct termios new_port_settings,
old_port_settings[RS232_PORTNR];
const char *comports[RS232_PORTNR]={"/dev/ttyS0","/dev/ttyS1","/dev/ttyS2","/dev/ttyS3","/dev/ttyS4","/dev/ttyS5",
"/dev/ttyS6","/dev/ttyS7","/dev/ttyS8","/dev/ttyS9","/dev/ttyS10","/dev/ttyS11",
"/dev/ttyS12","/dev/ttyS13","/dev/ttyS14","/dev/ttyS15","/dev/ttyUSB0",
"/dev/ttyUSB1","/dev/ttyUSB2","/dev/ttyUSB3","/dev/ttyUSB4","/dev/ttyUSB5",
"/dev/ttyAMA0","/dev/ttyAMA1","/dev/ttyACM0","/dev/ttyACM1",
"/dev/rfcomm0","/dev/rfcomm1","/dev/ircomm0","/dev/ircomm1",
"/dev/cuau0","/dev/cuau1","/dev/cuau2","/dev/cuau3",
"/dev/cuaU0","/dev/cuaU1","/dev/cuaU2","/dev/cuaU3",
"/dev/ttyMSM0","/dev/ttyMSM1"};
int RS232_OpenComport(int comport_number, int baudrate, const char *mode, int flowctrl)
{
int baudr,
status;
if((comport_number>=RS232_PORTNR)||(comport_number<0))
{
printf("illegal comport number\n");
return(1);
}
switch(baudrate)
{
case 50 : baudr = B50;
break;
case 75 : baudr = B75;
break;
case 110 : baudr = B110;
break;
case 134 : baudr = B134;
break;
case 150 : baudr = B150;
break;
case 200 : baudr = B200;
break;
case 300 : baudr = B300;
break;
case 600 : baudr = B600;
break;
case 1200 : baudr = B1200;
break;
case 1800 : baudr = B1800;
break;
case 2400 : baudr = B2400;
break;
case 4800 : baudr = B4800;
break;
case 9600 : baudr = B9600;
break;
case 19200 : baudr = B19200;
break;
case 38400 : baudr = B38400;
break;
case 57600 : baudr = B57600;
break;
case 115200 : baudr = B115200;
break;
case 230400 : baudr = B230400;
break;
case 460800 : baudr = B460800;
break;
#if defined(__linux__)
case 500000 : baudr = B500000;
break;
case 576000 : baudr = B576000;
break;
case 921600 : baudr = B921600;
break;
case 1000000 : baudr = B1000000;
break;
case 1152000 : baudr = B1152000;
break;
case 1500000 : baudr = B1500000;
break;
case 2000000 : baudr = B2000000;
break;
case 2500000 : baudr = B2500000;
break;
case 3000000 : baudr = B3000000;
break;
case 3500000 : baudr = B3500000;
break;
case 4000000 : baudr = B4000000;
break;
#endif
default : printf("invalid baudrate\n");
return(1);
break;
}
int cbits=CS8,
cpar=0,
ipar=IGNPAR,
bstop=0;
if(strlen(mode) != 3)
{
printf("invalid mode \"%s\"\n", mode);
return(1);
}
switch(mode[0])
{
case '8': cbits = CS8;
break;
case '7': cbits = CS7;
break;
case '6': cbits = CS6;
break;
case '5': cbits = CS5;
break;
default : printf("invalid number of data-bits '%c'\n", mode[0]);
return(1);
break;
}
switch(mode[1])
{
case 'N':
case 'n': cpar = 0;
ipar = IGNPAR;
break;
case 'E':
case 'e': cpar = PARENB;
ipar = INPCK;
break;
case 'O':
case 'o': cpar = (PARENB | PARODD);
ipar = INPCK;
break;
default : printf("invalid parity '%c'\n", mode[1]);
return(1);
break;
}
switch(mode[2])
{
case '1': bstop = 0;
break;
case '2': bstop = CSTOPB;
break;
default : printf("invalid number of stop bits '%c'\n", mode[2]);
return(1);
break;
}
/*
http://pubs.opengroup.org/onlinepubs/7908799/xsh/termios.h.html
http://man7.org/linux/man-pages/man3/termios.3.html
*/
Cport[comport_number] = open(comports[comport_number], O_RDWR | O_NOCTTY | O_NDELAY);
if(Cport[comport_number]==-1)
{
perror("unable to open comport ");
return(1);
}
/* lock access so that another process can't also use the port */
if(flock(Cport[comport_number], LOCK_EX | LOCK_NB) != 0)
{
close(Cport[comport_number]);
perror("Another process has locked the comport.");
return(1);
}
error = tcgetattr(Cport[comport_number], old_port_settings + comport_number);
if(error==-1)
{
close(Cport[comport_number]);
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
perror("unable to read portsettings ");
return(1);
}
memset(&new_port_settings, 0, sizeof(new_port_settings)); /* clear the new struct */
new_port_settings.c_cflag = cbits | cpar | bstop | CLOCAL | CREAD;
if(flowctrl)
{
new_port_settings.c_cflag |= CRTSCTS;
}
new_port_settings.c_iflag = ipar;
new_port_settings.c_oflag = 0;
new_port_settings.c_lflag = 0;
new_port_settings.c_cc[VMIN] = 0; /* block untill n bytes are received */
new_port_settings.c_cc[VTIME] = 0; /* block untill a timer expires (n * 100 mSec.) */
cfsetispeed(&new_port_settings, baudr);
cfsetospeed(&new_port_settings, baudr);
error = tcsetattr(Cport[comport_number], TCSANOW, &new_port_settings);
if(error==-1)
{
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
close(Cport[comport_number]);
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
perror("unable to adjust portsettings ");
return(1);
}
/* http://man7.org/linux/man-pages/man4/tty_ioctl.4.html */
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
{
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
perror("unable to get portstatus");
return(1);
}
status |= TIOCM_DTR; /* turn on DTR */
status |= TIOCM_RTS; /* turn on RTS */
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
{
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
perror("unable to set portstatus");
return(1);
}
return(0);
}
int RS232_PollComport(int comport_number, unsigned char *buf, int size)
{
int n;
n = read(Cport[comport_number], buf, size);
if(n < 0)
{
if(errno == EAGAIN) return 0;
}
return(n);
}
int RS232_SendByte(int comport_number, unsigned char byte)
{
int n = write(Cport[comport_number], &byte, 1);
if(n < 0)
{
if(errno == EAGAIN)
{
return 0;
}
else
{
return 1;
}
}
return(0);
}
int RS232_SendBuf(int comport_number, unsigned char *buf, int size)
{
int n = write(Cport[comport_number], buf, size);
if(n < 0)
{
if(errno == EAGAIN)
{
return 0;
}
else
{
return -1;
}
}
return(n);
}
void RS232_CloseComport(int comport_number)
{
int status;
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
{
perror("unable to get portstatus");
}
status &= ~TIOCM_DTR; /* turn off DTR */
status &= ~TIOCM_RTS; /* turn off RTS */
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
{
perror("unable to set portstatus");
}
tcsetattr(Cport[comport_number], TCSANOW, old_port_settings + comport_number);
close(Cport[comport_number]);
flock(Cport[comport_number], LOCK_UN); /* free the port so that others can use it. */
}
/*
Constant Description
TIOCM_LE DSR (data set ready/line enable)
TIOCM_DTR DTR (data terminal ready)
TIOCM_RTS RTS (request to send)
TIOCM_ST Secondary TXD (transmit)
TIOCM_SR Secondary RXD (receive)
TIOCM_CTS CTS (clear to send)
TIOCM_CAR DCD (data carrier detect)
TIOCM_CD see TIOCM_CAR
TIOCM_RNG RNG (ring)
TIOCM_RI see TIOCM_RNG
TIOCM_DSR DSR (data set ready)
http://man7.org/linux/man-pages/man4/tty_ioctl.4.html
*/
int RS232_IsDCDEnabled(int comport_number)
{
int status;
ioctl(Cport[comport_number], TIOCMGET, &status);
if(status&TIOCM_CAR) return(1);
else return(0);
}
int RS232_IsRINGEnabled(int comport_number)
{
int status;
ioctl(Cport[comport_number], TIOCMGET, &status);
if(status&TIOCM_RNG) return(1);
else return(0);
}
int RS232_IsCTSEnabled(int comport_number)
{
int status;
ioctl(Cport[comport_number], TIOCMGET, &status);
if(status&TIOCM_CTS) return(1);
else return(0);
}
int RS232_IsDSREnabled(int comport_number)
{
int status;
ioctl(Cport[comport_number], TIOCMGET, &status);
if(status&TIOCM_DSR) return(1);
else return(0);
}
void RS232_enableDTR(int comport_number)
{
int status;
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
{
perror("unable to get portstatus");
}
status |= TIOCM_DTR; /* turn on DTR */
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
{
perror("unable to set portstatus");
}
}
void RS232_disableDTR(int comport_number)
{
int status;
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
{
perror("unable to get portstatus");
}
status &= ~TIOCM_DTR; /* turn off DTR */
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
{
perror("unable to set portstatus");
}
}
void RS232_enableRTS(int comport_number)
{
int status;
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
{
perror("unable to get portstatus");
}
status |= TIOCM_RTS; /* turn on RTS */
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
{
perror("unable to set portstatus");
}
}
void RS232_disableRTS(int comport_number)
{
int status;
if(ioctl(Cport[comport_number], TIOCMGET, &status) == -1)
{
perror("unable to get portstatus");
}
status &= ~TIOCM_RTS; /* turn off RTS */
if(ioctl(Cport[comport_number], TIOCMSET, &status) == -1)
{
perror("unable to set portstatus");
}
}
void RS232_flushRX(int comport_number)
{
tcflush(Cport[comport_number], TCIFLUSH);
}
void RS232_flushTX(int comport_number)
{
tcflush(Cport[comport_number], TCOFLUSH);
}
void RS232_flushRXTX(int comport_number)
{
tcflush(Cport[comport_number], TCIOFLUSH);
}
#else /* windows */
#define RS232_PORTNR 32
HANDLE Cport[RS232_PORTNR];
const char *comports[RS232_PORTNR]={"\\\\.\\COM1", "\\\\.\\COM2", "\\\\.\\COM3", "\\\\.\\COM4",
"\\\\.\\COM5", "\\\\.\\COM6", "\\\\.\\COM7", "\\\\.\\COM8",
"\\\\.\\COM9", "\\\\.\\COM10", "\\\\.\\COM11", "\\\\.\\COM12",
"\\\\.\\COM13", "\\\\.\\COM14", "\\\\.\\COM15", "\\\\.\\COM16",
"\\\\.\\COM17", "\\\\.\\COM18", "\\\\.\\COM19", "\\\\.\\COM20",
"\\\\.\\COM21", "\\\\.\\COM22", "\\\\.\\COM23", "\\\\.\\COM24",
"\\\\.\\COM25", "\\\\.\\COM26", "\\\\.\\COM27", "\\\\.\\COM28",
"\\\\.\\COM29", "\\\\.\\COM30", "\\\\.\\COM31", "\\\\.\\COM32"};
char mode_str[128];
int RS232_OpenComport(int comport_number, int baudrate, const char *mode, int flowctrl)
{
if((comport_number>=RS232_PORTNR)||(comport_number<0))
{
printf("illegal comport number\n");
return(1);
}
switch(baudrate)
{
case 110 : strcpy(mode_str, "baud=110");
break;
case 300 : strcpy(mode_str, "baud=300");
break;
case 600 : strcpy(mode_str, "baud=600");
break;
case 1200 : strcpy(mode_str, "baud=1200");
break;
case 2400 : strcpy(mode_str, "baud=2400");
break;
case 4800 : strcpy(mode_str, "baud=4800");
break;
case 9600 : strcpy(mode_str, "baud=9600");
break;
case 19200 : strcpy(mode_str, "baud=19200");
break;
case 38400 : strcpy(mode_str, "baud=38400");
break;
case 57600 : strcpy(mode_str, "baud=57600");
break;
case 115200 : strcpy(mode_str, "baud=115200");
break;
case 128000 : strcpy(mode_str, "baud=128000");
break;
case 256000 : strcpy(mode_str, "baud=256000");
break;
case 500000 : strcpy(mode_str, "baud=500000");
break;
case 921600 : strcpy(mode_str, "baud=921600");
break;
case 1000000 : strcpy(mode_str, "baud=1000000");
break;
case 1500000 : strcpy(mode_str, "baud=1500000");
break;
case 2000000 : strcpy(mode_str, "baud=2000000");
break;
case 3000000 : strcpy(mode_str, "baud=3000000");
break;
default : printf("invalid baudrate\n");
return(1);
break;
}
if(strlen(mode) != 3)
{
printf("invalid mode \"%s\"\n", mode);
return(1);
}
switch(mode[0])
{
case '8': strcat(mode_str, " data=8");
break;
case '7': strcat(mode_str, " data=7");
break;
case '6': strcat(mode_str, " data=6");
break;
case '5': strcat(mode_str, " data=5");
break;
default : printf("invalid number of data-bits '%c'\n", mode[0]);
return(1);
break;
}
switch(mode[1])
{
case 'N':
case 'n': strcat(mode_str, " parity=n");
break;
case 'E':
case 'e': strcat(mode_str, " parity=e");
break;
case 'O':
case 'o': strcat(mode_str, " parity=o");
break;
default : printf("invalid parity '%c'\n", mode[1]);
return(1);
break;
}
switch(mode[2])
{
case '1': strcat(mode_str, " stop=1");
break;
case '2': strcat(mode_str, " stop=2");
break;
default : printf("invalid number of stop bits '%c'\n", mode[2]);
return(1);
break;
}
if(flowctrl)
{
strcat(mode_str, " xon=off to=off odsr=off dtr=on rts=off");
}
else
{
strcat(mode_str, " xon=off to=off odsr=off dtr=on rts=on");
}
/*
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363145%28v=vs.85%29.aspx
http://technet.microsoft.com/en-us/library/cc732236.aspx
https://docs.microsoft.com/en-us/windows/desktop/api/winbase/ns-winbase-_dcb
*/
Cport[comport_number] = CreateFileA(comports[comport_number],
GENERIC_READ|GENERIC_WRITE,
0, /* no share */
NULL, /* no security */
OPEN_EXISTING,
0, /* no threads */
NULL); /* no templates */
if(Cport[comport_number]==INVALID_HANDLE_VALUE)
{
printf("unable to open comport\n");
return(1);
}
DCB port_settings;
memset(&port_settings, 0, sizeof(port_settings)); /* clear the new struct */
port_settings.DCBlength = sizeof(port_settings);
if(!BuildCommDCBA(mode_str, &port_settings))
{
printf("unable to set comport dcb settings\n");
CloseHandle(Cport[comport_number]);
return(1);
}
if(flowctrl)
{
port_settings.fOutxCtsFlow = TRUE;
port_settings.fRtsControl = RTS_CONTROL_HANDSHAKE;
}
if(!SetCommState(Cport[comport_number], &port_settings))
{
printf("unable to set comport cfg settings\n");
CloseHandle(Cport[comport_number]);
return(1);
}
COMMTIMEOUTS Cptimeouts;
Cptimeouts.ReadIntervalTimeout = MAXDWORD;
Cptimeouts.ReadTotalTimeoutMultiplier = 0;
Cptimeouts.ReadTotalTimeoutConstant = 0;
Cptimeouts.WriteTotalTimeoutMultiplier = 0;
Cptimeouts.WriteTotalTimeoutConstant = 0;
if(!SetCommTimeouts(Cport[comport_number], &Cptimeouts))
{
printf("unable to set comport time-out settings\n");
CloseHandle(Cport[comport_number]);
return(1);
}
return(0);
}
int RS232_PollComport(int comport_number, unsigned char *buf, int size)
{
int n;
/* added the void pointer cast, otherwise gcc will complain about */
/* "warning: dereferencing type-punned pointer will break strict aliasing rules" */
if(!ReadFile(Cport[comport_number], buf, size, (LPDWORD)((void *)&n), NULL))
{
return -1;
}
return(n);
}
int RS232_SendByte(int comport_number, unsigned char byte)
{
int n;
if(!WriteFile(Cport[comport_number], &byte, 1, (LPDWORD)((void *)&n), NULL))
{
return(1);
}
if(n<0) return(1);
return(0);
}
int RS232_SendBuf(int comport_number, unsigned char *buf, int size)
{
int n;
if(WriteFile(Cport[comport_number], buf, size, (LPDWORD)((void *)&n), NULL))
{
return(n);
}
return(-1);
}
void RS232_CloseComport(int comport_number)
{
CloseHandle(Cport[comport_number]);
}
/*
http://msdn.microsoft.com/en-us/library/windows/desktop/aa363258%28v=vs.85%29.aspx
*/
int RS232_IsDCDEnabled(int comport_number)
{
int status;
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
if(status&MS_RLSD_ON) return(1);
else return(0);
}
int RS232_IsRINGEnabled(int comport_number)
{
int status;
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
if(status&MS_RING_ON) return(1);
else return(0);
}
int RS232_IsCTSEnabled(int comport_number)
{
int status;
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
if(status&MS_CTS_ON) return(1);
else return(0);
}
int RS232_IsDSREnabled(int comport_number)
{
int status;
GetCommModemStatus(Cport[comport_number], (LPDWORD)((void *)&status));
if(status&MS_DSR_ON) return(1);
else return(0);
}
void RS232_enableDTR(int comport_number)
{
EscapeCommFunction(Cport[comport_number], SETDTR);
}
void RS232_disableDTR(int comport_number)
{
EscapeCommFunction(Cport[comport_number], CLRDTR);
}
void RS232_enableRTS(int comport_number)
{
EscapeCommFunction(Cport[comport_number], SETRTS);
}
void RS232_disableRTS(int comport_number)
{
EscapeCommFunction(Cport[comport_number], CLRRTS);
}
/*
https://msdn.microsoft.com/en-us/library/windows/desktop/aa363428%28v=vs.85%29.aspx
*/
void RS232_flushRX(int comport_number)
{
PurgeComm(Cport[comport_number], PURGE_RXCLEAR | PURGE_RXABORT);
}
void RS232_flushTX(int comport_number)
{
PurgeComm(Cport[comport_number], PURGE_TXCLEAR | PURGE_TXABORT);
}
void RS232_flushRXTX(int comport_number)
{
PurgeComm(Cport[comport_number], PURGE_RXCLEAR | PURGE_RXABORT);
PurgeComm(Cport[comport_number], PURGE_TXCLEAR | PURGE_TXABORT);
}
#endif
void RS232_cputs(int comport_number, const char *text) /* sends a string to serial port */
{
while(*text != 0) RS232_SendByte(comport_number, *(text++));
}
/* return index in comports matching to device name or -1 if not found */
int RS232_GetPortnr(const char *devname)
{
int i;
char str[32];
#if defined(__linux__) || defined(__FreeBSD__) /* Linux & FreeBSD */
strcpy(str, "/dev/");
#else /* windows */
strcpy(str, "\\\\.\\");
#endif
strncat(str, devname, 16);
str[31] = 0;
for(i=0; i<RS232_PORTNR; i++)
{
if(!strcmp(comports[i], str))
{
return i;
}
}
return -1; /* device not found */
}

View File

@@ -0,0 +1,85 @@
/*
***************************************************************************
*
* Author: Teunis van Beelen
*
* Copyright (C) 2005 - 2021 Teunis van Beelen
*
* Email: teuniz@protonmail.com
*
***************************************************************************
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
***************************************************************************
*/
/* For more info and how to use this library, visit: http://www.teuniz.net/RS-232/ */
#ifndef rs232_INCLUDED
#define rs232_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <string.h>
#if defined(__linux__) || defined(__FreeBSD__)
#include <termios.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <limits.h>
#include <sys/file.h>
#include <errno.h>
#else
#include <windows.h>
#endif
int RS232_OpenComport(int, int, const char *, int);
int RS232_PollComport(int, unsigned char *, int);
int RS232_SendByte(int, unsigned char);
int RS232_SendBuf(int, unsigned char *, int);
void RS232_CloseComport(int);
void RS232_cputs(int, const char *);
int RS232_IsDCDEnabled(int);
int RS232_IsRINGEnabled(int);
int RS232_IsCTSEnabled(int);
int RS232_IsDSREnabled(int);
void RS232_enableDTR(int);
void RS232_disableDTR(int);
void RS232_enableRTS(int);
void RS232_disableRTS(int);
void RS232_flushRX(int);
void RS232_flushTX(int);
void RS232_flushRXTX(int);
int RS232_GetPortnr(const char *);
#ifdef __cplusplus
} /* extern "C" */
#endif
#endif

View File

@@ -25,21 +25,12 @@ define Build/Prepare
endef
define Package/cc2652/install
$(INSTALL_DIR) $(1)/etc/init.d
$(INSTALL_BIN) ./files/tisbl.init $(1)/etc/init.d/tisbl
$(INSTALL_DIR) $(1)/etc/tifirmware
$(INSTALL_BIN) ./files/firmware/* $(1)/etc/tifirmware/
$(INSTALL_DIR) $(1)/lib/firmware/cc2562
$(INSTALL_BIN) ./files/firmware/* $(1)/lib/firmware/cc2562
$(INSTALL_DIR) $(1)/usr/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/tisbl $(1)/usr/bin/
$(INSTALL_BIN) ./files/*.sh $(1)/usr/bin/
$(INSTALL_DIR) $(1)/etc/config
$(INSTALL_BIN) ./files/tisbl.config $(1)/etc/config/tisbl
$(INSTALL_DIR) $(1)/etc/uci-defaults
$(INSTALL_BIN) ./files/tisbl.defaults $(1)/etc/uci-defaults
endef
$(eval $(call BuildPackage,cc2652))

View File

@@ -1,124 +0,0 @@
#!/usr/bin/lua
--[[
ByteCnt: 1 1 1 2 1 4
---- --------- ---------- ----- ------ -------
FieldName:Type EventCode DataLength Event Status EventId
--]]
--Type
Command = 0x01
Event = 0x04
--OpCode
GapScan_enable = 0xFE51
--EventCode
HCI_LE_ExtEvent = 0xff
--Status
SUCCESS = 0x00
--Event
GAP_HCI_ExtentionCommandStatus = 0x067F
GAP_AdvertiserScannerEvent = 0x0613
--EventId
GAP_EVT_ADV_REPORT = 0x00400000
GAP_EVT_SCAN_ENABLED = 0x00010000
local write = io.write
function print(...)
local n = select("#",...)
for i = 1,n do
local v = tostring(select(i,...))
write(v)
if i~=n then write'\t' end
end
-- write'\n'
end
function printf(str, ...)
return print(str:format(...))
end
function lshift(x, by)
return x * 2 ^ by
end
function GetUint8(Payload, position)
return string.byte(Payload, position)
end
function GetUint32(Payload, position)
return (lshift(string.byte(Payload, position+3),24) + lshift(string.byte(Payload, position+2),16) + lshift(string.byte(Payload, position+1),8) + string.byte(Payload, position))
end
function GetUint16(Payload, position)
return (lshift(string.byte(Payload, position+1),8) + string.byte(Payload, position))
end
function hexdump(Payload,separator)
for i=1,Payload:len(), 1 do
io.write(string.format("%02X", Payload:byte(i)))
if (i< Payload:len()) then
io.write(separator)
end
end
end
ibeacon_hdr=string.char(0x1A,0xFF,0x4C,0x00,0x02,0x15)
function DumpAdvertiserData(Payload)
--[[
Len(1byte)+Type(1byte)+Data(Len bytes)
--]]
while( Payload:len() > 0 ) do
local Len = GetUint8(Payload,1)
if (GetUint8(Payload,2) == 0xff) then -- manufacturer data
print(" MFR=")
hexdump(Payload:sub(1,Len+1),'')
if (Payload:sub(1,6) == ibeacon_hdr) then
print(" [ibeacon]")
end
end
Payload = string.sub(Payload,Len+2,-1)
end
end
function DumpAdvertiserScannerEvent(Payload)
local Status = GetUint8(Payload,3)
local EventId = GetUint32(Payload,4)
if((EventId==GAP_EVT_ADV_REPORT) and (Status==SUCCESS))
then
local MAC = string.sub(Payload,10,15)
local TxPower = GetUint8(Payload,19)
local RSSI = GetUint8(Payload,20)
printf("MAC=%02X%02X%02X%02X%02X%02X RSI=%d PWR=%d",string.byte(MAC,6),string.byte(MAC,5),string.byte(MAC,4),
string.byte(MAC,3),string.byte(MAC,2),string.byte(MAC,1),RSSI,TxPower)
local DataLength = GetUint16(Payload,30)
DumpAdvertiserData(string.sub(Payload,32,-1))
print("\n")
end
end
function hci_event_paser()
while true do
local Header = io.read(3)
if not Header then break end
local EventType = GetUint8(Header,1)
local EventCode = GetUint8(Header,2)
local DataLength = GetUint8(Header,3)
local Data = io.read(DataLength)
local Event = GetUint16(Data,1)
-- print(EventType,EventCode,DataLength,Event)
if not Data then break end
if(Event==GAP_AdvertiserScannerEvent)
then
DumpAdvertiserScannerEvent(Data)
-- hexdump(ibeacon_hdr)
end
end
end
hci_event_paser()

View File

@@ -1,8 +0,0 @@
#!/bin/sh
com-wr.sh /dev/ttyMSM1 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this command dealy time must >= 3, if small then 3, the following commands will be something wrong
com-wr.sh /dev/ttyMSM1 1 "\x01\x00\xFE\x08\x08\x00\x00\x00\x00\x00\x00\x00" > /dev/null
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x02" > /dev/null
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x03" > /dev/null
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x04" > /dev/null
com-wr.sh /dev/ttyMSM1 1 "\x01\x61\xFE\x02\x01\x05" > /dev/null
com-wr.sh /dev/ttyMSM1 3 "\x01\x51\xFE\x06\x00\x00\xF4\x01\x28\x00" | tee /tmp/blescan.data | ble-scan-rx-parser.sh

View File

@@ -0,0 +1,13 @@
#!/bin/sh
if [ -f /sys/class/gpio/ble_enable/value ]; then
echo 1 > /sys/class/gpio/ble_enable/value
fi
echo 0 > /sys/class/gpio/ble_backdoor/value
echo 1 > /sys/class/gpio/ble_reset/value
echo 0 > /sys/class/gpio/ble_reset/value
sleep 1
echo 1 > /sys/class/gpio/ble_reset/value
sleep 1
echo 1 > /sys/class/gpio/ble_backdoor/value
tisbl /dev/ttyMSM1 115200 2652 /lib/firmware/cc2562/simple_broadcaster_bd9.bin

View File

@@ -0,0 +1,13 @@
#!/bin/sh
if [ -f /sys/class/gpio/ble_enable/value ]; then
echo 1 > /sys/class/gpio/ble_enable/value
fi
echo 0 > /sys/class/gpio/ble_backdoor/value
echo 1 > /sys/class/gpio/ble_reset/value
echo 0 > /sys/class/gpio/ble_reset/value
sleep 1
echo 1 > /sys/class/gpio/ble_reset/value
sleep 1
echo 1 > /sys/class/gpio/ble_backdoor/value
tisbl /dev/ttyMSM1 115200 2652 /lib/firmware/cc2562/ble5_host_test_bd9.bin

View File

@@ -0,0 +1,10 @@
#!/bin/sh
if [ -f /sys/class/gpio/ble_enable/value ]; then
echo 1 > /sys/class/gpio/ble_enable/value
fi
echo 1 > /sys/class/gpio/ble_backdoor/value
echo 1 > /sys/class/gpio/ble_reset/value
sleep 1
echo 1 > /sys/class/gpio/ble_reset/value
sleep 1

View File

@@ -1,11 +0,0 @@
#!/usr/bin/lua
local block = 16
while true do
local bytes = io.read(block)
if not bytes then break end
for b in string.gfind(bytes, ".") do
io.write(string.format("%02X ", string.byte(b)))
end
io.write(string.rep(" ", block - string.len(bytes) + 1))
io.write(string.gsub(bytes, "%c", "."), "\n")
end

View File

@@ -1,20 +1,28 @@
#!/bin/sh
# script---------------- UUID---------------------------------------------------------------------- MAJOR----- MINOR----- POWER-
#example: ibeacon-broadcaster.sh "\xE2\x0A\x39\xF4\x73\xF5\x4B\xC4\xA1\x2F\x17\xD1\xAD\x07\xA9\x61" "\x01\x23" "\x45\x67" "\xC8"
if [ "$#" -eq 4 ]; then
UUID=$1
MAJOR=$2
MINOR=$3
POWER=$4
else
UUID="\xE2\x0A\x39\xF4\x73\xF5\x4B\xC4\xA1\x2F\x17\xD1\xAD\x07\xA9\x61"
MAJOR="\x01\x23"
MINOR="\x45\x67"
POWER="\xC8"
fi
function iBeconScan() {
if [ "$#" -eq 4 ]; then
UUID=$1
MAJOR=$2
MINOR=$3
POWER=$4
else
UUID="\xE2\x0A\x39\xF4\x73\xF5\x4B\xC4\xA1\x2F\x17\xD1\xAD\x07\xA9\x61"
MAJOR="\x01\x23"
MINOR="\x45\x67"
POWER="\xC8"
fi
com-wr.sh /dev/ttyMSM1 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this command dealy time must >= 3, if small then 3, the following commands will be something wrong
com-wr.sh /dev/ttyMSM1 1 "\x01\x00\xFE\x08\x01\x00\x00\x00\x00\x00\x00\x00" > /dev/null
com-wr.sh /dev/ttyMSM1 1 "\x01\x3E\xFE\x15\x12\x00\xA0\x00\x00\xA0\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x7F\x01\x01\x00" > /dev/null
com-wr.sh /dev/ttyMSM1 1 "\x09\x44\xFE\x23\x00\x00\x00\x1E\x00\x02\x01\x1A\x1A\xFF\x4C\x00\x02\x15${UUID}${MAJOR}${MINOR}${POWER}\x00" > /dev/null
com-wr.sh /dev/ttyMSM1 1 "\x01\x3F\xFE\x04\x00\x00\x00\x00" | hexdump.sh
cc2562-wr.sh /dev/ttyMSM1 3 "\x01\x1D\xFC\x01\x00" > /dev/null # this command dealy time must >= 3, if small then 3, the following commands will be something wrong
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x00\xFE\x08\x01\x00\x00\x00\x00\x00\x00\x00" > /dev/null
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x3E\xFE\x15\x12\x00\xA0\x00\x00\xA0\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x00\x7F\x01\x01\x00" > /dev/null
cc2562-wr.sh /dev/ttyMSM1 1 "\x09\x44\xFE\x23\x00\x00\x00\x1E\x00\x02\x01\x1A\x1A\xFF\x4C\x00\x02\x15${UUID}${MAJOR}${MINOR}${POWER}\x00" > /dev/null
cc2562-wr.sh /dev/ttyMSM1 1 "\x01\x3F\xFE\x04\x00\x00\x00\x00"
}
cc2562-reset.sh
while true
do
iBeconScan
sleep 1
done

View File

@@ -1,5 +0,0 @@
#!/bin/sh
killall -9 ser2net
tisbl.sh /dev/ttyMSM1 115200 2652 /etc/tifirmware/ble5_host_test_bd9.bin 79 34
echo "7000:telnet:0:/dev/ttyMSM1:115200 8DATABITS NONE 1STOPBIT remctl" > /tmp/ser2net.conf
ser2net -c /tmp/ser2net.conf

View File

@@ -1,7 +0,0 @@
config tisbl 'tisbl'
option firmware '/etc/tifirmware/ble5_host_test_bd9.bin'
option tty '/dev/ttyMSM1'
option tichip '2652'
option baudrate '115200'
option resetpin '79'
option backdoorpin '34'

View File

@@ -1,13 +0,0 @@
#!/bin/sh
. /lib/functions.sh
. /lib/functions/system.sh
board=$(board_name)
case $board in
edgecore,eap104)
uci set tisbl.tisbl.backdoorpin=31
uci set tisbl.tisbl.resetpin=35
;;
esac

View File

@@ -1,21 +0,0 @@
#!/bin/sh /etc/rc.common
# Copyright (C) 2007 OpenWrt.org
#start after dbus (60)
START=62
USE_PROCD=1
start_service() {
firmware="$(uci -q get tisbl.tisbl.firmware)"
tty="$(uci -q get tisbl.tisbl.tty)"
tichip="$(uci -q get tisbl.tisbl.tichip)"
baudrate="$(uci -q get tisbl.tisbl.baudrate)"
resetpin="$(uci -q get tisbl.tisbl.resetpin)"
backdoorpin="$(uci -q get tisbl.tisbl.backdoorpin)"
tisbl.sh $tty $baudrate $tichip $firmware $resetpin $backdoorpin
}
service_triggers()
{
procd_add_reload_trigger "tisbl"
}

View File

@@ -1,43 +0,0 @@
#!/bin/sh
# tisbl.sh $tty $baudrate $tichip $firmware $resetpin $backdoorpin
# tisbl.sh /dev/ttyMSM1 115200 2652 /etc/tifirmware/blinky_bd13.bin 79 67
#assumption: resetpin and backdoorpin are low active
tty=$1
baudrate=$2
tichip=$3
firmware=$4
resetpin=$5
backdoorpin=$6
ti_reset() #assumption:resetpin is low active
{
if [ ! -e /sys/class/gpio/gpio${resetpin} ]; then
echo ${resetpin} > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio${resetpin}/direction
echo 1 > /sys/class/gpio/gpio${resetpin}/value
echo 0 > /sys/class/gpio/gpio${resetpin}/value
sleep 1
echo 1 > /sys/class/gpio/gpio${resetpin}/value
}
ti_goto_bootloader() #assumption:backdoorpin is low active
{
if [ ! -e /sys/class/gpio/gpio${backdoorpin} ]; then
echo ${backdoorpin} > /sys/class/gpio/export
fi
echo out > /sys/class/gpio/gpio${backdoorpin}/direction
echo 0 > /sys/class/gpio/gpio${backdoorpin}/value
ti_reset
sleep 1
echo 1 > /sys/class/gpio/gpio${backdoorpin}/value
}
if [ -e $firmware ]; then
ti_goto_bootloader
tisbl $tty $baudrate $tichip $firmware #try to upgrade firmware
fi

View File

@@ -5,7 +5,8 @@ START=80
boot() {
. /lib/functions/system.sh
case $(board_name) in
edgecore,eap102)
edgecore,eap102|\
edgecore,oap102)
echo 54 > /sys/class/gpio/export
echo out > /sys/class/gpio/gpio54/direction
echo 0 > /sys/class/gpio/gpio54/value

View File

@@ -0,0 +1,29 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=eltt2
PKG_VERSION:=1.0
PKG_BUILD_DIR:= $(BUILD_DIR)/$(PKG_NAME)
include $(INCLUDE_DIR)/package.mk
define Package/eltt2
SECTION:=base
CATEGORY:=Utilities
TITLE:=eltt2
endef
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
$(CP) ./src/* $(PKG_BUILD_DIR)/
endef
define Package/eltt2/install
$(INSTALL_DIR) $(1)/bin
$(INSTALL_BIN) $(PKG_BUILD_DIR)/eltt2 $(1)/bin/
endef
define Package/eltt2/extra_provides
echo "libc.so.6";
endef
$(eval $(call BuildPackage,eltt2))

View File

@@ -0,0 +1,27 @@
Copyright (c) 2014, Infineon Technologies AG
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@@ -0,0 +1,15 @@
# Makefile for Embedded Linux TPM Toolbox 2 (ELTT2)
# Copyright (c) Infineon Technologies AG
#CROSS-COMPILE:=../../../../../qsdk/staging_dir/toolchain-arm/bin/arm-openwrt-linux-
#CC:=$(CROSS-COMPILE)gcc
CC = gcc
CFLAGS=-Wall -Wextra -std=c99 -g
all: eltt2
eltt2: eltt2.c eltt2.h
$(CC) $(CFLAGS) eltt2.c -o eltt2
clean:
rm -rf eltt2

View File

@@ -0,0 +1,230 @@
# ELTT2 - Infineon Embedded Linux TPM Toolbox 2 for TPM 2.0
All information in this document is Copyright (c) 2014-2022, Infineon Technologies AG <br>
All rights reserved.
# 1. Welcome
Welcome to Embedded Linux TPM Toolbox 2 (ELTT2). ELTT2 is a single-file executable program intended for testing, performing diagnosis and basic state changes of the Infineon Technologies TPM 2.0.
## 1.1 Prerequisites
To build and run ELTT2 you need GCC and a Linux system capable of hosting a TPM.
ELTT2 may run on many other little-endian hardware and software configurations capable of running Linux and hosting a TPM, but this has not been tested.
ELTT2 does not support machines with a big-endian CPU.
## 1.2 Getting Started
A TPM 2.0 evaluation board can be ordered in the [Hitex Webshop](https://www.ehitex.de/evaluation-boards/infineon/2564/iridium-9670-tpm2.0-spi).
<p align="center">
<img src="https://cloud.githubusercontent.com/assets/19730245/25651091/77a84744-2fe1-11e7-91bd-a2e39678202d.JPG" width="350"/>
</p>
In order to execute ELTT2, you need to compile it first:
1. Switch to the directory with the ELTT2 source code
2. Compile the source code by typing the following command:
make
Due to hardware (and thus TPM) access restrictions for normal users, ELTT2 requires root (aka superuser or administrator) privileges. They can be obtained e.g. by using the 'sudo' command on Debian Linux derivates.
The Infineon [TPM 2.0 Application Note](https://www.infineon.com/dgdl/Infineon-App-Note-SLx9670-TPM2.0_Embedded_RPi_DI_SLx-AN-v01_20-EN.pdf?fileId=5546d46267c74c9a01684b96e69f5d7b) shows how the TPM device driver can be set up (e.g. for Linux Kernel 4.14).
# 2. Usage of ELTT2
## 2.1 Generic Usage
ELTT2 is operated as follows:
Call: `./eltt2 <option(s)>`
For example: `./eltt2 -g` or `./eltt2 -gc`
For getting an overview of the possible commands, run `./eltt2 -h`
Some options require the TPM to be in a specific state. This state is shown in brackets ("[]") behind each command line option in the list below:
\[-\]: none <br>
\[\*\]: the TPM platform hierarchy authorization value is not set (i.e., empty buffer) <br>
\[l\]: the required PCR bank is allocated <br>
\[u\]: started <br>
To get the TPM into the required state, call ELTT2 with the corresponding commands ("x" for a state means that whether this state is required or not depends on the actual command or the command parameters sent eventually to the TPM).
Command line option | Explanation | Precondition
--- | --- | ---
`-a [hash algorithm] <data bytes>` | Hash Sequence SHA-1/256/384 \[default: SHA-1\] | \[u\]
`-A <data bytes>` | Hash Sequence SHA-256 | \[u\]
`-b <command bytes>` | Enter your own TPM command | \[u\]
`-c` | Read Clock | \[u\]
`-d <shutdown type>` | Shutdown | \[u\]
`-e [hash algorithm] <PCR index> <PCR digest>` | PCR Extend SHA-1/256/384 \[default: SHA-1\] | \[u\], \[l\]
`-E <PCR index> <PCR digest>` | PCR Extend SHA-256 | \[u\], \[l\]
`-g` | Get fixed capability values | \[u\]
`-v` | Get variable capability values | \[u\]
`-G <data length>` | Get Random | \[u\]
`-h` | Help | \[-\]
`-l <hash algorithm>` | PCR Allocate SHA-1/256/384 | \[u\], \[\*\]
`-r [hash algorithm] <PCR index>` | PCR Read SHA-1/256/384 \[default: SHA-1\] | \[u\], \[l\]
`-R <PCR index>` | PCR Read SHA-256 | \[u\], \[l\]
`-s [hash algorithm] <data bytes>` | Hash SHA-1/256/384 \[default: SHA-1\] | \[u\]
`-S <data bytes>` | Hash SHA-256 | \[u\]
`-t <test type>` | Self Test | \[u\]
`-T` | Get Test Result | \[u\]
`-u <startup type>` | Startup | \[-\]
`-z <PCR index>` | PCR Reset | \[u\]
Additional information:
`-a`: <br>
With the "-a" command you can hash given data with the SHA-1/256/384 hash algorithm. This hash sequence sends 3 commands \[start, update, complete\] to the TPM and allows to hash an arbitrary amount of data. For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
`./eltt2 -a 41624364` Hash given data with SHA-1 hash algorithm. <br>
or <br>
`./eltt2 -a sha1 41624364` Hash given data with SHA-1 hash algorithm. <br>
`./eltt2 -a sha256 41624364` Hash given data with SHA-256 hash algorithm. <br>
`./eltt2 -a sha384 41624364` Hash given data with SHA-384 hash algorithm. <br>
`-A`: <br>
With the "-A" command you can hash given data with the SHA-256 hash algorithm. This hash sequence sends 3 commands \[start, update, complete\] to the TPM and allows to hash an arbitrary amount of data. For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
`./eltt2 -A 41624364`
`-b`: <br>
With the "-b" command you can enter your own TPM command bytes and read the TPM response. For example, use the following command to send a TPM2_Startup with startup type CLEAR to the TPM: <br>
`./eltt2 -b 80010000000C000001440000`
`-c`: <br>
With the "-c" command you can read the clock values of the TPM.
`-d`: <br>
With the "-d" command you can issue a TPM shutdown. It has 2 options: <br>
`./eltt2 -d` <br>
or <br>
`./eltt2 -d clear` send a TPM2_Shutdown command with shutdown type CLEAR to the TPM. <br>
`./eltt2 -d state` send a TPM2_Shutdown command with shutdown type STATE to the TPM. <br>
`-e`: <br>
With the "-e" command you can extend bytes in the selected PCR with SHA-1/256/384. To do so, you have to enter the index of PCR in hexadecimal that you like to extend and the digest you want to extend the selected PCR with. Note that you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest must have a length of 20/32/48 bytes (will be padded with 0 if necessary). The TPM then builds an SHA-1/256/384 hash over the PCR data in the selected PCR and the digest you provided and writes the result back to the selected PCR. For example, use the following command to extend PCR 23 (0x17) with the byte sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}: <br>
`./eltt2 -e 17 41624364` Extend bytes in PCR 23 with SHA-1. <br>
or <br>
`./eltt2 -e sha1 17 41624364` Extend bytes in PCR 23 with SHA-1. <br>
`./eltt2 -e sha256 17 41624364` Extend bytes in PCR 23 with SHA-256. <br>
`./eltt2 -e sha384 17 41624364` Extend bytes in PCR 23 with SHA-384. <br>
`-E`: <br>
With the "-E" command you can extend bytes in the selected PCR with SHA-256. To do so, you have to enter the index of PCR in hexadecimal that you like to extend and the digest you want to extend the selected PCR with. Note that you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest must have a length of 32 bytes (will be padded with 0 if necessary). The TPM then builds an SHA-256 hash over the PCR data in the selected PCR and the digest you provided and writes the result back to the selected PCR. For example, use the following command to extend PCR 23 (0x17) with the byte sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}: <br>
`./eltt2 -E 17 41624364`
`-g`: <br>
With the "-g" command you can read the TPM's fixed properties.
`-v`: <br>
With the "-v" command you can read the TPM's variable properties.
`-G`: <br>
With the "-G" command you can get a given amount of random bytes. Note that you can only request a maximum amount of 32 random bytes at once. For example, use the following command to get 20 (0x14) random bytes: <br>
`./eltt2 -G 14`
`-l`: <br>
With the "-l" command you can allocate the SHA-1/256/384 PCR bank. Take note of two things. Firstly, the command requires a platform authorization value and it is set to an empty buffer; hence the command cannot be used if the TPM platform authorization value is set (e.g., by UEFI). Secondly, when the command is executed successfully a TPM reset has to follow for it to take effect. For example, use the following command to allocate a PCR bank: <br>
`./eltt2 -l sha1` Allocate SHA-1 PCR bank. <br>
`./eltt2 -l sha256` Allocate SHA-256 PCR bank. <br>
`./eltt2 -l sha384` Allocate SHA-384 PCR bank. <br>
`-r`: <br>
With the "-r" command you can read data from a selected SHA-1/256/384 PCR. For example, use the following command to read data from PCR 23 (0x17): <br>
`./eltt2 -r 17` Read data from SHA-1 PCR 23. <br>
or <br>
`./eltt2 -r sha1 17` Read data from SHA-1 PCR 23. <br>
`./eltt2 -r sha256 17` Read data from SHA-256 PCR 23. <br>
`./eltt2 -r sha384 17` Read data from SHA-384 PCR 23. <br>
`-R`: <br>
With the "-R" command you can read data from a selected SHA-256 PCR. For example, use the following command to read data from PCR 23 (0x17): <br>
`./eltt2 -R 17`
`-s`: <br>
With the "-s" command you can hash given data with the SHA-1/256/384 hash algorithm. This command only allows a limited amount of data to be hashed (depending on the TPM's maximum input buffer size). For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
`./eltt2 -s 41624364` Hash given data with SHA-1 hash algorithm. <br>
or <br>
`./eltt2 -s sha1 41624364` Hash given data with SHA-1 hash algorithm. <br>
`./eltt2 -s sha256 41624364` Hash given data with SHA-256 hash algorithm. <br>
`./eltt2 -s sha384 41624364` Hash given data with SHA-384 hash algorithm. <br>
`-S`: <br>
With the "-S" command you can hash given data with the SHA-256 hash algorithm. This command only allows a limited amount of data to be hashed (depending on the TPM input buffer size). For example, use the following command to hash the byte sequence {0x41, 0x62, 0x43, 0x64}: <br>
`./eltt2 -S 41624364`
`-t`: <br>
With the "-t" command you can issue a TPM selftest. It has 3 options: <br>
`./eltt2 -t` <br>
or<br>
`./eltt2 -t not_full` Perform a partial TPM2_Selftest to test previously untested TPM capabilities. <br>
`./eltt2 -t full` Perform a full TPM2_Selftest to test all TPM capabilities. <br>
`./eltt2 -t incremental` Perform a test of selected algorithms.
`-T`: <br>
With the "-T" command you can read the results of a previously run selftest.
`-u`: <br>
With the "-u" command you can issue a TPM startup command. It has 2 options: <br>
`./eltt2 -u` <br>
or <br>
`./eltt2 -u clear` send a TPM2_Startup with startup type CLEAR to the TPM. <br>
`./eltt2 -u state` send a TPM2_Startup with startup type STATE to the TPM.
`-z`: <br>
With the "-z" command you can reset a selected PCR. Note that you can only reset PCRs 16 and 23. For example, use the following command to reset PCR 23 (0x17): <br>
`./eltt2 -z 17`
## 2.2 Examples:
In order to work with the TPM, perform the following steps:
- Send the TPM2_Startup command: `./eltt2 -u`
# 3. If you have questions
If you have any questions or problems, please read the section "FAQ and
Troubleshooting" in this document.
In case you still have questions, contact your local Infineon
Representative.
Further information is available at <https://www.infineon.com/tpm>.
# 4. FAQ and Troubleshooting
If you encounter any error, please make sure that
- the TPM is properly connected.
- the TPM driver is loaded, i.e. check that "/dev/tpm0" exists. In case of driver loading problems (e.g. shown by "Error opening device"), reboot your system and try to load the driver again.
- ELTT2 has been started with root permissions. Please note that ELTT2 needs root permissions for all commands.
- the TPM is started. (See section 2.2 in this document on how to do this.)
The following list shows the most common errors and their solution:
The ELTT2 response is "Error opening the device.":
- You need to load a TPM driver before you can work with ELTT2.
- You need to start ELTT2 with root permissions.
The ELTT2 responds with error code 0x100.
- You need to send the TPM2_Startup command, or you did send it twice. In
case you have not sent it yet, do so with `./eltt2 -u`.
The TPM does not change any of the permanent flags shown by sending the "-g"
command , e.g. after a force clear.
- The TPM requires a reset in order to change any of the permanent flags.
Press the reset button or disconnect the TPM to do so.
The value of a PCR does not change after sending PCR extend or reset.
- With the application permissions you cannot modify every PCR. For more
details, please refer to the description for the different PCR commands
in this file.

View File

@@ -0,0 +1,362 @@
--------------------------------------------------------------------------------
Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0 v1.1
Infineon Technologies AG
All information in this document is Copyright (c) 2014, Infineon Technologies AG
All rights reserved.
--------------------------------------------------------------------------------
Contents:
1. Welcome
1.1 Prerequisites
1.2 Contents of the package
1.3 Getting Started
2. Usage of Embedded Linux TPM Toolbox 2 (ELTT2)
2.1 Generic Usage
2.2 Examples
3. If you have questions
4. Release Info
5. FAQ
================================================================================
1. Welcome
Welcome to Embedded Linux TPM Toolbox 2 (ELTT2).
ELTT2 is a single-file executable program intended for testing, performing
diagnosis and basic state changes of the Infineon Technologies TPM 2.0.
1.1 Prerequisites
To build and run ELTT2 you need GCC and a Linux system capable of hosting a
TPM 2.0.
Tested PC Platforms (x86):
- Ubuntu (R) Linux 12.04 LTS - 64 bit (modified Kernel 3.15.4)
with Infineon TPM 2.0 SLB9665 Firmware 5.22
Tested Embedded Platforms (ARM):
- Android 6.0 "Marshmallow" - 64 bit (modified Kernel 3.18.0+) on HiKey
with Prototype Infineon I2C TPM 2.0 for Embedded Platforms
ELTT2 may run on many other little-endian hardware and software
configurations capable of running Linux and hosting a TPM 2.0, but this has
not been tested.
ELTT2 does not support machines with a big-endian CPU.
1.2 Contents of Package
ELTT2 consists of the following files:
- eltt2.c
Contains all method implementations of ELTT2.
- eltt2.h
Contains all constant definitions, method and command byte declarations
for the operation of ELTT2.
- License.txt
Contains the license agreement for ELTT2.
- Makefile
Contains the command to compile ELTT2.
- README.txt
This file.
1.3 Getting Started
In order to execute ELTT2, you need to compile it first:
1. Switch to the directory with the ELTT2 source code
2. Compile the source code by typing the following command:
make
Due to hardware (and thus TPM) access restrictions for normal users, ELTT2
requires root (aka superuser or administrator) privileges. They can be
obtained e.g. by using the 'sudo' command on Debian Linux derivates.
2. Usage of ELTT2
2.1 Generic Usage
ELTT2 is operated as follows:
Call: ./eltt2 <option(s)>
For example: ./eltt2 -g or ./eltt2 -gc
For getting an overview of the possible commands, run ./eltt2 -h
Some options require the TPM to be in a specific state. This state is shown
in brackets ("[]") behind each command line option in the list below:
[-]: none
[*]: the TPM platform hierarchy authorization value is not set (i.e., empty buffer)
[l]: the required PCR bank is allocated
[u]: started
To get the TPM into the required state, call ELTT2 with the corresponding
commands ("x" for a state means that whether this state is required or not
depends on the actual command or the command parameters sent eventually to
the TPM).
Command line options: Preconditions:
-a [hash algorithm] <data bytes>: Hash Sequence SHA-1/256/384 [default: SHA-1] [u]
-A <data bytes>: Hash Sequence SHA-256 [u]
-b <command bytes>: Enter your own TPM command [u]
-c: Read Clock [u]
-d <shutdown type>: Shutdown [u]
-e [hash algorithm] <PCR index> <PCR digest>: PCR Extend SHA-1/256/384 [default: SHA-1] [u], [l]
-E <PCR index> <PCR digest>: PCR Extend SHA-256 [u], [l]
-g: Get fixed capability values [u]
-v: Get variable capability values [u]
-G <data length>: Get Random [u]
-h: Help [-]
-l <hash algorithm>: PCR Allocate SHA-1/256/384 [u], [*]
-r [hash algorithm] <PCR index>: PCR Read SHA-1/256/384 [default: SHA-1] [u], [l]
-R <PCR index>: PCR Read SHA-256 [u], [l]
-s [hash algorithm] <data bytes>: Hash SHA-1/SHA256 [default: SHA-1] [u]
-S <data bytes>: Hash SHA-256 [u]
-t <test type>: Self Test [u]
-T: Get Test Result [u]
-u <startup type>: Startup [-]
-z <PCR index>: PCR Reset [u]
Additional information:
-a:
With the "-a" command you can hash given data with the SHA-1/256/384 hash
algorithm. This hash sequence sends 3 commands [start, update, complete]
to the TPM and allows to hash an arbitrary amount of data.
For example, use the following command to hash the byte sequence {0x41,
0x62, 0x43, 0x64}:
./eltt2 -a 41624364 Hash given data with SHA-1 hash algorithm.
or
./eltt2 -a sha1 41624364 Hash given data with SHA-1 hash algorithm.
./eltt2 -a sha256 41624364 Hash given data with SHA-256 hash algorithm.
-A:
With the "-A" command you can hash given data with the SHA-256 hash
algorithm. This hash sequence sends 3 commands [start, update, complete] to
the TPM and allows to hash an arbitrary amount of data.
For example, use the following command to hash the byte sequence {0x41,
0x62, 0x43, 0x64}:
./eltt2 -A 41624364
-b:
With the "-b" command you can enter your own TPM command bytes and read the
TPM response.
For example, use the following command to send a TPM2_Startup with startup
type CLEAR to the TPM:
./eltt2 -b 80010000000C000001440000
-c:
With the "-c" command you can read the clock values of the TPM.
-d:
With the "-d" command you can issue a TPM shutdown. It has 2 options:
./eltt2 -d
or
./eltt2 -d clear send a TPM2_Shutdown command with shutdown type CLEAR to
the TPM.
./eltt2 -d state send a TPM2_Shutdown command with shutdown type STATE to
the TPM.
-e:
With the "-e" command you can extend bytes in the selected PCR with SHA-1/256/384.
To do so, you have to enter the index of PCR in hexadecimal that you like to
extend and the digest you want to extend the selected PCR with. Note that
you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest
must have a length of 20/32/48 bytes (will be padded with 0 if necessary).
The TPM then builds an SHA-1/256/384 hash over the PCR data in the selected PCR
and the digest you provided and writes the result back to the selected PCR.
For example, use the following command to extend PCR 23 (0x17) with the byte
sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}:
./eltt2 -e 17 41624364 Extend bytes in PCR 23 with SHA-1.
or
./eltt2 -e sha1 17 41624364 Extend bytes in PCR 23 with SHA-1.
./eltt2 -e sha256 17 41624364 Extend bytes in PCR 23 with SHA-256.
-E:
With the "-E" command you can extend bytes in the selected PCR with SHA-256.
To do so, you have to enter the index of PCR in hexadecimal that you like to
extend and the digest you want to extend the selected PCR with. Note that
you can only extend PCRs with index 0 to 16 and PCR 23 and that the digest
must have a length of 32 bytes (will be padded with 0 if necessary).
The TPM then builds an SHA-256 hash over the PCR data in the selected PCR
and the digest you provided and writes the result back to the selected PCR.
For example, use the following command to extend PCR 23 (0x17) with the byte
sequence {0x41, 0x62, 0x43, 0x64, 0x00, ... (will be filled with 0x00)}:
./eltt2 -E 17 41624364
-g:
With the "-g" command you can read the TPM's fixed properties.
-v:
With the "-v" command you can read the TPM's variable properties.
-G:
With the "-G" command you can get a given amount of random bytes. Note that
you can only request a maximum amount of 32 random bytes at once.
For example, use the following command to get 20 (0x14) random bytes:
./eltt2 -G 14
-l:
With the "-l" command you can allocate the SHA-1/256/384 PCR bank.
Take note of two things. Firstly, the command requires a platform
authorization value and it is set to an empty buffer; hence the command
cannot be used if the TPM platform authorization value is set (e.g., by UEFI).
Secondly, when the command is executed successfully a TPM reset has to
follow for it to take effect. For example, use the following command to
allocate a PCR bank:
./eltt2 -l sha1 Allocate SHA-1 PCR bank.
./eltt2 -l sha256 Allocate SHA-256 PCR bank.
./eltt2 -l sha384 Allocate SHA-384 PCR bank.
-r:
With the "-r" command you can read data from a selected SHA-1/256/384 PCR.
For example, use the following command to read data from PCR 23 (0x17):
./eltt2 -r 17 Read data from SHA-1 PCR 23.
or
./eltt2 -r sha1 17 Read data from SHA-1 PCR 23.
./eltt2 -r sha256 17 Read data from SHA-256 PCR 23.
-R:
With the "-R" command you can read data from a selected SHA-256 PCR.
For example, use the following command to read data from PCR 23 (0x17):
./eltt2 -R 17
-s:
With the "-s" command you can hash given data with the SHA-1/256/384 hash
algorithm. This command only allows a limited amount of data to be hashed
(depending on the TPM's maximum input buffer size).
For example, use the following command to hash the byte sequence {0x41,
0x62, 0x43, 0x64}:
./eltt2 -s 41624364 Hash given data with SHA-1 hash algorithm.
or
./eltt2 -s sha1 41624364 Hash given data with SHA-1 hash algorithm.
./eltt2 -s sha256 41624364 Hash given data with SHA-256 hash algorithm.
-S:
With the "-S" command you can hash given data with the SHA-256 hash
algorithm. This command only allows a limited amount of data to be hashed
(depending on the TPM input buffer size).
For example, use the following command to hash the byte sequence {0x41,
0x62, 0x43, 0x64}:
./eltt2 -S 41624364
-t:
With the "-t" command you can issue a TPM selftest. It has 3 options:
./eltt2 -t
or
./eltt2 -t not_full Perform a partial TPM2_Selftest to test previously
untested TPM capabilities.
./eltt2 -t full Perform a full TPM2_Selftest to test all TPM
capabilities.
./eltt2 -t incremental Perform a test of selected algorithms.
-T:
With the "-T" command you can read the results of a previously run selftest.
-u:
With the "-u" command you can issue a TPM startup command. It has 2 options:
./eltt2 -u
or
./eltt2 -u clear send a TPM2_Startup with startup type CLEAR to the TPM.
./eltt2 -u state send a TPM2_Startup with startup type STATE to the TPM.
-z:
With the "-z" command you can reset a selected PCR. Note that you can only
reset PCRs 16 and 23 and that the PCR is going to be reset in both banks
(SHA-1 and SHA-256).
For example, use the following command to reset PCR 23 (0x17):
./eltt2 -z 17
2.2 Examples:
In order to work with the TPM, perform the following steps:
- Send the TPM2_Startup command: ./eltt2 -u
3. If you have questions
If you have any questions or problems, please read the section "FAQ and
Troubleshooting" in this document.
In case you still have questions, contact your local Infineon
Representative.
Further information is available at http://www.infineon.com/tpm.
4. Release Info
This is version 1.1. This version is a general release.
5. FAQ and Troubleshooting
If you encounter any error, please make sure that
- the TPM is properly connected.
- the TPM driver is loaded, i.e. check that "/dev/tpm0" exists. In case of
driver loading problems (e.g. shown by "Error opening device"), reboot
your system and try to load the driver again.
- ELTT2 has been started with root permissions. Please note that ELTT2 needs
root permissions for all commands.
- the TPM is started. (See section 2.2 in this document on how to do this.)
- Trousers do not run anymore. In some cases the Kernel starts Trousers by
booting.
Shut down Trousers by entering the following command:
sudo pkill tcsd
The following list shows the most common errors and their solution:
The ELTT2 response is "Error opening the device.":
- You need to load a TPM driver before you can work with ELTT2.
- You need to start ELTT2 with root permissions.
The ELTT2 responds with error code 0x100.
- You need to send the TPM2_Startup command, or you did send it twice. In
case you have not sent it yet, do so with "./eltt2 -u".
The TPM does not change any of the permanent flags shown by sending the "-g"
command , e.g. after a force clear.
- The TPM requires a reset in order to change any of the permanent flags.
Press the reset button or disconnect the TPM to do so.
The value of a PCR does not change after sending PCR extend or reset.
- With the application permissions you cannot modify every PCR. For more
details, please refer to the description for the different PCR commands
in this file.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,634 @@
#ifndef _ELTT2_H_
#define _ELTT2_H_
/**
* @brief Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0
* @details eltt2.h implements all TPM byte commands and the prototype declarations for eltt2.c.
* @file eltt2.h
* @date 2014/06/26
* @copyright Copyright (c) 2014 - 2017 Infineon Technologies AG ( www.infineon.com ).\n
* All rights reserved.\n
* \n
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
* conditions are met:\n
* \n
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.\n
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.\n
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.\n
* \n
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
// this is the main page for doxygen documentation.
/** @mainpage Infineon Embedded Linux TPM Toolbox 2 (ELTT2) for TPM 2.0 Documentation
*
* @section Welcome
* Welcome to Infineon TPM 2.0 Software-Tool "Embedded Linux TPM Toolbox 2 (ELTT2)".\n
* \n
* @section Introduction
* ELTT2 is a single file-executable program
* intended for test, diagnosis and basic state changes of the Infineon
* Technologies TPM 2.0.\n
* \n
* @section Copyright
* Copyright (c) 2014 - 2017 Infineon Technologies AG ( www.infineon.com ).\n
* All rights reserved.\n
* \n
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
* conditions are met:\n
* \n
* 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
* disclaimer.\n
* 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided with the distribution.\n
* 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.\n
* \n
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <getopt.h>
#include <ctype.h>
#include <string.h>
#include <strings.h>
#include <inttypes.h>
//-------------"Defines"-------------
#define TPM_RESP_MAX_SIZE 4096 ///< This is the maximum possible TPM response size in bytes.
#define TPM_REQ_MAX_SIZE 1024 ///< This is the maximum possible TPM request size in bytes. TBD: Find out correct value.
#define ERR_COMMUNICATION -1 ///< Return error check for read and write to the TPM.
#define ERR_BAD_CMD -2 ///< Error code for a bad command line argument or option.
#define TPM_SHA1_DIGEST_SIZE 20 ///< For all SHA-1 operations the digest's size is always 20 bytes.
#define TPM_SHA256_DIGEST_SIZE 32 ///< For all SHA-256 operations the digest's size is always 32 bytes.
#define TPM_SHA384_DIGEST_SIZE 48 ///< For all SHA-384 operations the digest's size is always 48 bytes.
#define TPM_CMD_HEADER_SIZE 10 ///< The size of a standard TPM command header is 10 bytes.
#define TPM_CMD_SIZE_OFFSET 2 ///< The offset of a TPM command's size value is 2 bytes.
#define HEX_BYTE_STRING_LENGTH 2 ///< A byte can be represented by two hexadecimal characters.
#ifndef INT_MAX
#define INT_MAX 0x7FFFFFF ///< The maximum value of a signed 32-bit integer.
#endif
// TPM Return codes
#define TPM_RC_SUCCESS 0x00000000 ///< The response error code for TPM_SUCCESS.
#define TPM_RC_BAD_TAG 0x0000001E ///< The response error code for TPM_RC_BAD_TAG.
#define TPM_RC_SIZE 0x00000095 ///< The response error code for TPM_RC_SIZE.
#define TPM_RC_INITIALIZE 0x00000100 ///< The response error code for TPM_RC_INITIALIZE.
#define TPM_RC_FAILURE 0x00000101 ///< The response error code for TPM_RC_FAILURE.
#define TPM_RC_LOCALITY 0x00000907 ///< The response error code for TPM_RC_LOCALITY.
#define FU_FIRMWARE_VALID_FLAG 4 ///< If this flag is set, the firmware is valid.
#define FU_OWNER_FLAG 1 ///< If this flag is set, the owner is set.
// print_response_buf options
#define PRINT_RESPONSE_CLEAR 1 ///< Prints response unformatted.
#define PRINT_RESPONSE_HEADERBLOCKS 2 ///< Prints response in commented blocks.
#define PRINT_RESPONSE_HEX_BLOCK 3 ///< Prints response in rows of 16 bytes and shows the line number.
#define PRINT_RESPONSE_HASH 4 ///< Prints response of Hash
#define PRINT_RESPONSE_WITHOUT_HEADER 12 ///< Prints the response buffer from byte 12.
#define PRINT_RESPONSE_HASH_WITHOUT_HEADER 16 ///< Prints the response buffer from byte 16.
#define PRINT_RESPONSE_WITH_HEADER 0 ///< Prints the response buffer from byte 0.
#define PRINT_RESPONSE_PCR_WITHOUT_HEADER 30 ///< Prints the pcr buffer from pcr_read.
// time conversion
#define YEAR_SECONDS 31536000 ///< Number of seconds in one year
#define DAY_SECONDS 86400 ///< Number of seconds in one day
#define HOUR_SECONDS 3600 ///< Number of seconds in one hour
#define MINUTE_SECONDS 60 ///< Number of seconds in one minute
#define MILISECOND_TO_SECOND 1000 ///< Convertion from miliseconds to seconds
// hash
#define STD_CC_HASH_SIZE 18 ///< Hash command size
// TPM_PT constants
#define PT_FIXED_SELECTOR 1 ///< Fixed GetCapability Flags
#define PT_VAR_SELECTOR 2 ///< Variable GetCapability Flags
//-------------"Macros"-------------
// Null pointer check
#define NULL_POINTER_CHECK(x) if (NULL == x) { ret_val = EINVAL; fprintf(stderr, "Error: Invalid argument.\n"); break; } ///< Argument NULL check.
#define MALLOC_ERROR_CHECK(x) if (NULL == x) { ret_val = errno; fprintf(stderr, "Error (re)allocating memory.\n"); break; } ///< Malloc error check.
#define MEMSET_FREE(x, y) if (NULL != x) { memset(x, 0, y); free(x); x = NULL; } ///< Sets memory to 0, frees memory and sets pointer to NULL.
// Return value check
#define RET_VAL_CHECK(x) if (EXIT_SUCCESS != x) { break; } ///< Return value check
// Command line option parser for hash algorithm
#define HASH_ALG_PARSER(o, c) \
do { \
if (o == option) \
{ \
if (c == argc) \
{ \
hash_algo = ALG_SHA1; \
} \
else \
{ \
if (0 == strcasecmp(optarg, "sha1")) \
{ \
hash_algo = ALG_SHA1; \
} \
else if (0 == strcasecmp(optarg, "sha256")) \
{ \
hash_algo = ALG_SHA256; \
} \
else if (0 == strcasecmp(optarg, "sha384")) \
{ \
hash_algo = ALG_SHA384; \
} \
else \
{ \
ret_val = ERR_BAD_CMD; \
fprintf(stderr, "Unknown option. Use '-h' for more information.\n"); \
break; \
} \
if (argc > optind) \
{ \
optarg = argv[optind++]; \
} \
} \
} \
else \
{ \
hash_algo = ALG_SHA256; \
} \
} while (0)
//--------------"Enums"--------------
// Hash algorithms
typedef enum hash_algo_enum
{
ALG_NULL,
ALG_SHA1,
ALG_SHA256,
ALG_SHA384,
} hash_algo_enum;
//-------------"Methods"-------------
/**
* @brief Convert (max.) 8 byte buffer to an unsigned 64-bit integer.
* @param [in] *input_buffer Input buffer. Make sure that its size is at least as high as offset + length.
* @param [in] offset Start byte for conversion.
* @param [in] length Amount of bytes to be converted.
* @param [out] *output_value Return the converted unsigned 64-bit integer.
* @param [in] input_buffer_size Size of input_buffer in bytes.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer or length is greater than 8.
* @retval EXIT_SUCCESS In case of success.
* @date 2014/06/26
*/
static int buf_to_uint64(uint8_t *input_buffer, uint32_t offset, uint32_t length, uint64_t *output_value, uint32_t input_buffer_size);
/**
* @brief Convert a hexadecimal string representation of bytes like "0A1F" and
returns an array containing the actual byte values as an array (e.g. { 0x0A, 0x1F }).
* @param [in] *byte_string Incoming bytes as string.
* @param [out] *byte_values Byte array representation of given input string.
* Must be allocated by caller with the length given in byte_values_size.
* @param [in] byte_values_size Size of byte_values array.
* @return One of the listed return codes.
* @retval EXIT_SUCCESS In case of success.
* @retval EINVAL In case of a NULL pointer.
* @retval value of errno In case parsing error.
* @date 2014/06/26
*/
static int hexstr_to_bytearray(char *byte_string, uint8_t *byte_values, size_t byte_values_size);
/**
* @brief Convert a number to a byte buffer.
* @param [in] input User input.
* @param [in] input_size Size of input data type in bytes.
* @param [out] *output_byte Return buffer for the converted integer.
Must be allocated by the caller with at least a size of 'input_size'.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @date 2014/06/26
*/
static int int_to_bytearray(uint64_t input, uint32_t input_size, uint8_t *output_byte);
/**
* @brief Create the PCR_Extend command.
* @param [in] *pcr_index_str User input string for PCR index.
* @param [in] *pcr_digest_str User input string of value to extend the selected PCR with.
* @param [out] *pcr_cmd_buf Return buffer for the complete command. Must be allocated by caller.
* @param [in] *pcr_cmd_buf_size Size of memory allocated at pcr_cmd_buf in bytes.
* @param [in] hash_algo Set to ALG_SHA1 for extending with SHA-1,
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer or an invalid option.
* @retval EXIT_SUCCESS In case of success.
* @retval ERR_BAD_CMD In case of bad user input.
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
* @date 2014/06/26
*/
static int pcr_extend(char *pcr_index_str, char *pcr_digest_str, uint8_t *pcr_cmd_buf, size_t pcr_cmd_buf_size, hash_algo_enum hash_algo);
/**
* @brief Create the PCR_Allocate command.
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
* @param [in] hash_algo Set to ALG_SHA1 to allocate SHA-1,
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer or an invalid option.
* @retval EXIT_SUCCESS In case of success.
* @date 2022/05/09
*/
static int pcr_allocate(uint8_t *pcr_cmd_buf, hash_algo_enum hash_algo);
/**
* @brief Create the PCR_Read command.
* @param [in] *pcr_index_str User input string for PCR index.
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
* @param [in] hash_algo Set to ALG_SHA1 for reading with SHA-1,
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer or an invalid option.
* @retval EXIT_SUCCESS In case of success.
* @retval ERR_BAD_CMD In case of bad user input.
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
* @date 2014/06/26
*/
static int pcr_read(char *pcr_index_str, uint8_t *pcr_cmd_buf, hash_algo_enum hash_algo);
/**
* @brief Create the PCR_Reset command.
* @param [in] *pcr_index_str User input string for PCR index.
* @param [out] *pcr_cmd_buf Return buffer for the complete command.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @retval ERR_BAD_CMD In case of bad user input.
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
* @date 2014/06/26
*/
static int pcr_reset(char *pcr_index_str, uint8_t *pcr_cmd_buf);
/**
* @brief Print the command line usage and switches.
* @date 2014/06/26
*/
static void print_help();
/**
* @brief Print the response buffer in different formats.
* @param [in] *response_buf TPM response.
* @param [in] resp_size TPM response size.
* @param [in] offset Starting point for printing buffer.
* @param [in] format Select the output format.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer or an unknown output format has been transfered.
* @retval EXIT_SUCCESS In case of success.
* @retval buf_to_uint64 All error codes from buf_to_uint64.
* @date 2014/06/26
*/
static int print_response_buf(uint8_t *response_buf, size_t resp_size, uint32_t offset, int format);
/**
* @brief Print a TPM response.
* @param [in] *response_buf TPM response.
* @param [in] resp_size TPM response size.
* @param [in] option Defines appearance of output. Can have the following values:\n
- PRINT_RESPONSE_CLEAR
- PRINT_RESPONSE_HEADERBLOCKS
- PRINT_RESPONSE_HEX_BLOCK
- PRINT_RESPONSE_WITHOUT_HEADER
- PRINT_RESPONSE_WITH_HEADER
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @retval print_response_buf All error codes from print_response_buf.
* @retval print_clock_info All error codes from print_clock_info.
* @retval print_capability_flags All error codes from print_capability_flags.
* @date 2014/06/26
*/
static int response_print(uint8_t *response_buf, size_t resp_size, int option);
/**
* @brief Check a TPM response for errors.
* @param [in] *response_buf TPM response. Must have at least a size of TPM_CMD_HEADER_SIZE bytes.
* @return Returns the TPM return code extracted from the given TPM response or one of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval buf_to_uint64 All error codes from buf_to_uint64.
* @retval EXIT_SUCCESS In case of success.
* @date 2014/06/26
*/
static int return_error_handling(uint8_t *response_buf);
/**
* @brief Transmit TPM command to /dev/tpm0 and get the response.
* @param [in] *buf TPM request.
* @param [in] length TPM request length.
* @param [out] *response TPM response.
* @param [out] *resp_length TPM response length.
* @return One of the listed return codes or the error code stored in the global errno system variable.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @date 2014/06/26
*/
static int tpmtool_transmit(const uint8_t *buf, ssize_t length, uint8_t *response, ssize_t *resp_length);
/**
* @brief Print the capability flags.
* @param [in] *response_buf TPM response.
* @param [in] cap_selector Type of capabilities to print.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @retval buf_to_uint64 All error codes from buf_to_uint64.
* @date 2014/06/26
*/
static int print_capability_flags(uint8_t *response_buf, uint8_t cap_selector);
/**
* @brief Print the clock info.
* @param [in] *response_buf TPM response.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @retval buf_to_uint64 All error codes from buf_to_uint64.
* @date 2014/06/26
*/
static int print_clock_info(uint8_t *response_buf);
/**
* @brief Create the get_random command.
* @param [in] *data_length_string User input string for random data length.
* @param [out] *response_buf Return buffer for the complete command.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @retval ERR_BAD_CMD In case of bad user input.
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
* @date 2014/06/26
*/
static int get_random(char *data_length_string, uint8_t *response_buf);
/**
* @brief Create the simple hash command.
* @param [in] *data_string User input string of data to be hashed.
* @param [in] hash_algo Set to ALG_SHA1 for hashing with SHA-1,
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
* @param [out] *hash_cmd_buf Return buffer for the complete command.
* @param [in] hash_cmd_buf_size Return buffer size.
* @return One of the listed return codes.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
* @retval int_to_bytearray All error codes from int_to_bytearray.
* @date 2014/06/26
*/
static int create_hash(char *data_string, hash_algo_enum hash_algo, uint8_t *hash_cmd_buf, uint32_t hash_cmd_buf_size);
/**
* @brief Create and transmit a sequence of TPM commands for hashing larger amounts of data.
* @param [in] *data_string User input string of data to be hashed.
* @param [in] hash_algo Set to ALG_SHA1 for hashing with SHA-1,
ALG_SHA256 for SHA-256, and ALG_SHA384 for SHA-384.
* @param [out] *tpm_response_buf TPM response.
* @param [out] *tpm_response_buf_size Size of tpm_response_buf.
* @return One of the listed return codes or the error code stored in the global errno system variable.
* @retval EINVAL In case of a NULL pointer.
* @retval EXIT_SUCCESS In case of success.
* @retval value of errno In case of memory allocation error.
* @retval buf_to_uint64 All error codes from buf_to_uint64.
* @retval hexstr_to_bytearray All error codes from hexstr_to_bytearray.
* @retval int_to_bytearray All error codes from int_to_bytearray.
* @retval tpmtool_transmit All error codes from tpmtool_transmit.
* @retval print_response_buf All error codes from print_response_buf
* @date 2014/06/26
*/
static int create_hash_sequence(char *data_string, hash_algo_enum hash_algo, uint8_t *tpm_response_buf, ssize_t *tpm_response_buf_size);
//-------------"command bytes"-------------
static const uint8_t tpm2_startup_clear[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0C, // commandSize
0x00, 0x00, 0x01, 0x44, // TPM_CC_Startup
0x00, 0x00 // TPM_SU_CLEAR
};
static const uint8_t tpm2_startup_state[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0C, // commandSize
0x00, 0x00, 0x01, 0x44, // TPM_CC_Startup
0x00, 0x01 // TPM_SU_STATE
};
static const uint8_t tpm_cc_shutdown_clear[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0C, // commandSize
0x00, 0x00, 0x01, 0x45, // TPM_CC_Shutdown
0x00, 0x00 // TPM_SU_CLEAR
};
static const uint8_t tpm_cc_shutdown_state[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0C, // commandSize
0x00, 0x00, 0x01, 0x45, // TPM_CC_Shutdown
0x00, 0x01 // TPM_SU_STATE
};
static const uint8_t tpm2_self_test[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0B, // commandSize
0x00, 0x00, 0x01, 0x43, // TPM_CC_SelfTest
0x00 // fullTest=No
};
static const uint8_t tpm2_self_test_full[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0B, // commandSize
0x00, 0x00, 0x01, 0x43, // TPM_CC_SelfTest
0x01 // fullTest=Yes
};
static const uint8_t tpm_cc_get_test_result[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0A, // commandSize
0x00, 0x00, 0x01, 0x7C // TPM_CC_GetTestResult
};
static const uint8_t tpm2_self_test_incremental[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x2A, // commandSize
0x00, 0x00, 0x01, 0x42, // TPM_CC_IncrementalSelfTest
0x00, 0x00, 0x00, 0x0E, // Count of Algorithm
0x00, 0x01, 0x00, 0x04, // Algorithm two per line
0x00, 0x05, 0x00, 0x06,
0x00, 0x08, 0x00, 0x0A,
0x00, 0x0B, 0x00, 0x14,
0x00, 0x15, 0x00, 0x16,
0x00, 0x17, 0x00, 0x22,
0x00, 0x25, 0x00, 0x43
};
static const uint8_t tpm2_getrandom[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0C, // commandSize
0x00, 0x00, 0x01, 0x7B, // TPM_CC_GetRandom
0x00, 0x00 // bytesRequested (will be set later)
};
static const uint8_t tpm_cc_readclock[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0A, // commandSize
0x00, 0x00, 0x01, 0x81 // TPM_CC_ReadClock
};
static const uint8_t tpm2_getcapability_fixed[] ={
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x16, // commandSize
0x00, 0x00, 0x01, 0x7A, // TPM_CC_GetCapability
0x00, 0x00, 0x00, 0x06, // TPM_CAP_TPM_PROPERTIES (Property Type: TPM_PT)
0x00, 0x00, 0x01, 0x00, // Property: TPM_PT_FAMILY_INDICATOR: PT_GROUP * 1 + 0
0x00, 0x00, 0x00, 0x66 // PropertyCount 102 (from 100 - 201)
};
static const uint8_t tpm2_getcapability_var[] ={
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x16, // commandSize
0x00, 0x00, 0x01, 0x7A, // TPM_CC_GetCapability
0x00, 0x00, 0x00, 0x06, // TPM_CAP_TPM_PROPERTIES (Property Type: TPM_PT)
0x00, 0x00, 0x02, 0x00, // Property: TPM_PT_FAMILY_INDICATOR: PT_GROUP * 2 + 0
0x00, 0x00, 0x00, 0x02 // PropertyCount 02 (from 200 - 201)
};
// Hash
static const uint8_t tpm2_hash[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0e, // commandSize
0x00, 0x00, 0x01, 0x7D, // TPM_CC_Hash
0x00, 0x00, // size (will be set later)
// buffer (will be added later)
0x00, 0x00, // hashAlg (will be added later)
0x00, 0x00, 0x00, 0x00 // hierarchy of the ticket (TPM_RH_NULL; will be added later)
};
// HashSequence
static uint8_t tpm2_hash_sequence_start[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x0e, // commandSize
0x00, 0x00, 0x01, 0x86, // TPM_CC_HashSequenceStart
0x00, 0x00, // authSize (NULL Password)
// null (indicate a NULL Password)
0x00, 0x00 // hashAlg (will be set later)
};
static uint8_t tpm2_sequence_update[] = {
0x80, 0x02, // TPM_ST_SESSIONS
0x00, 0x00, 0x00, 0x00, // commandSize (will be set later)
0x00, 0x00, 0x01, 0x5c, // TPM_CC_SequenceUpdate
0x00, 0x00, 0x00, 0x00, // sequenceHandle (will be set later)
0x00, 0x00, // authSize (NULL Password)
// null (indicate a NULL Password)
0x00, 0x09, // authSize (password authorization session)
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00 // size (will be set later)
// buffer (will be added later)
};
static uint8_t tpm2_sequence_complete[] = {
0x80, 0x02, // TPM_ST_SESSIONS
0x00, 0x00, 0x00, 0x21, // commandSize
0x00, 0x00, 0x01, 0x3e, // TPM_CC_SequenceComplete
0x00, 0x00, 0x00, 0x00, // sequenceHandle (will be set later)
0x00, 0x00, // authSize (NULL Password)
// null (indicate a NULL Password)
0x00, 0x09, // authSize (password authorization session)
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, // size (NULL buffer)
// null (indicate an empty buffer buffer)
0x40, 0x00, 0x00, 0x07 // hierarchy of the ticket (TPM_RH_NULL)
};
static const uint8_t sha1_alg[] = {
0x00, 0x04 // command for sha1 alg
};
static const uint8_t sha256_alg[] = {
0x00, 0x0B // command for sha256 alg
};
static const uint8_t sha384_alg[] = {
0x00, 0x0C // command for sha384 alg
};
static const uint8_t tpm_cc_hash_hierarchy[] = {
0x40, 0x00, 0x00, 0x07 // hierarchy of the ticket (TPM_RH_NULL)
};
//PCR_Command
static const uint8_t tpm2_pcr_allocate[] = {
0x80, 0x02, // TPM_ST_SESSIONS
0x00, 0x00, 0x00, 0x31, // commandSize
0x00, 0x00, 0x01, 0x2B, // TPM_CC_PCR_Allocate
0x40, 0x00, 0x00, 0x0C, // TPM_RH_PLATFORM
0x00, 0x00, // authSize (NULL Password)
// null (indicate a NULL Password)
0x00, 0x09, // authSize (password authorization session)
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x03, // count (TPML_PCR_SELECTION)
0x00, 0x04, // hash (TPMS_PCR_SELECTION; SHA-1)
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
0x00, 0x00, 0x00, // pcrSelect (TPMS_PCR_SELECTION; will be set later)
0x00, 0x0B, // hash (TPMS_PCR_SELECTION; SHA-256)
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
0x00, 0x00, 0x00, // pcrSelect (TPMS_PCR_SELECTION; will be set later)
0x00, 0x0C, // hash (TPMS_PCR_SELECTION; SHA-384)
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
0x00, 0x00, 0x00 // pcrSelect (TPMS_PCR_SELECTION; will be set later)
};
static const uint8_t tpm2_pcr_read[] = {
0x80, 0x01, // TPM_ST_NO_SESSIONS
0x00, 0x00, 0x00, 0x14, // commandSize
0x00, 0x00, 0x01, 0x7E, // TPM_CC_PCR_Read
0x00, 0x00, 0x00, 0x01, // count (TPML_PCR_SELECTION)
0x00, 0x00, // hash (TPMS_PCR_SELECTION; will be set later)
0x03, // sizeofSelect (TPMS_PCR_SELECTION)
0x00, 0x00, 0x00 // pcrSelect (TPMS_PCR_SELECTION)
};
static const uint8_t tpm2_pcr_extend[] = {
0x80, 0x02, // TPM_ST_SESSIONS
0x00, 0x00, 0x00, 0x00, // commandSize (will be set later)
0x00, 0x00, 0x01, 0x82, // TPM_CC_PCR_Extend
0x00, 0x00, 0x00, 0x00, // {PCR_FIRST:PCR_LAST} (TPMI_DH_PCR)
0x00, 0x00, // authSize (NULL Password)
// null (indicate a NULL Password)
0x00, 0x09, // authSize (password authorization session)
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
0x00, 0x00, 0x01, 0x00, 0x00,
0x00, 0x00, 0x00, 0x01, // count (TPML_DIGEST_VALUES)
0x00, 0x00 // hashAlg (TPMT_HA; will be set later)
// digest (TPMT_HA; will be added later)
};
static const uint8_t tpm2_pcr_reset[] = {
0x80, 0x02, // TPM_ST_SESSIONS
0x00, 0x00, 0x00, 0x1B, // commandSize
0x00, 0x00, 0x01, 0x3D, // TPM_CC_PCR_Reset
0x00, 0x00, 0x00, 0x00, // {PCR_FIRST:PCR_LAST} (TPMI_DH_PCR)
0x00, 0x00, // authSize (NULL Password)
// null (indicate a NULL Password)
0x00, 0x09, // authSize (password authorization session)
0x40, 0x00, 0x00, 0x09, // TPM_RS_PW (indicate a password authorization session)
0x00, 0x00, 0x01, 0x00, 0x00
};
#endif /* _ELTT2_H_ */

View File

@@ -0,0 +1,701 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ath10k-ct-firmware
PKG_VERSION:=2020-10-07
PKG_RELEASE:=2
CTVER1=021
CTVER2=021
# From fw_lede.bash, or can do it manually as well.
H988XFC=a4c3d1e2fb80f6b8b9738c7189795ab9505e6c09efc12ba5f08ee7f49e934239
H988XFCH=93108bd0870652860cdb57749f5a12205ecb15bb1f129d916ad73b6f06406c82
H9887FC=459692deb186a63ab8eeddb7ad5d54779266e68ca686e7c46062554db6dca12b
H9887FCH=fd126a457d0927d0c8ea10d66ef5b67d5e1e0741f8692bb3016bb602d0af3098
H9980FC=52300e9d128c3d506e0b133d7a7964df3115f9511f1b574ef2a0767972c063bd
H9980FCH=9c20c3a44b701f8fef0fe02f156e382b36b717fb56c76d540f6eac2077ec189b
H9980CH=55f27045e7cf87a6a5656a050771d6d7a6197153a0737288a702c0836d5c6572
H9980FHQ=add509b2a15ba90869f403c2e4440dbb91bd7037188d8468249cf1263adfd44e
H9984FC=e6354a1547a308b4b0fe4cbc29693848c234acedd9e7a483a1b4fb5f9bbf0dc0
H9984FCH=6e19ecd0b001ffb594a8b033deb2007595b8c0402402789b7de55b208639ebec
H9984CH=7b6fdf3d970f3eff7c34df476c934a9bebb4f289b7968067950d31b82c71bb07
H9984FHQ=f6a5d5a3a7b2c9267dc31673a19ee3b5312a2f84f26123cb5e8c000428ed76d2
H4019FC=cde992cb328680e81cf85e195554699bcceef065c0c696ce4ef90c3311ab11fb
H4019FCH=818afeb1226389357dfde754d641f936fb82ebe78607f10e15efd5c952a54f48
H4019CH=30ba10f0d82116c6617cb58c3df5cc81e5ed8f29dbc8f95c0ca9c5013ce4f702
H4019FHQ=8e4161f7bed5bd56513ca5caab582a6eee64e9e14a69f4de67587563b7b4d735
H9888FC=d24e66bdb2f1098a2e06ff20fe037e31937e1a483e87c68827830513b4233b5d
H9888FCH=5891e1c184da433ecc12ca0176ca89a77f7bc2b675576698b69bc93d46b77042
H9888CH=b94f46cdda6171e5f566b1cdd6aafd68ff1a4f7e8a27762b90eb5d4f03839d99
H9888FHQ=3cc81f8707bf5ba63bc9ffc14578c77637cae0e15766ae146af02eefb9ab7bfd
include $(INCLUDE_DIR)/package.mk
ATH10K_FIRMWARE_REV:=d622d160e9f552ead68d9ae81b715422892dc2ef
ATH10K_FIRMWARE_URL:=@GITHUB/kvalo/ath10k-firmware/$(ATH10K_FIRMWARE_REV)
QCA9887_BOARD_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca9887-board.bin
define Download/qca9887-board
FILE:=$(QCA9887_BOARD_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA9887/hw1.0
URL_FILE:=board.bin
HASH:=cf4df099f6ee05c181f55ce17297a1d32c61d725eb96246fd315ad5587c42426
endef
$(eval $(call Download,qca9887-board))
QCA988X_BOARD_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca988x-board.bin
define Download/qca988x-board
FILE:=$(QCA988X_BOARD_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA988X/hw2.0
URL_FILE:=board.bin
HASH:=5b5b380333c2dd3b6ce67f30e2f7008f4020bf594970d3b464fd8d4a80fcd880
endef
$(eval $(call Download,qca988x-board))
QCA99X0_BOARD_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca99x0-board.bin
define Download/qca99x0-board
FILE:=$(QCA99X0_BOARD_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA99X0/hw2.0
URL_FILE:=boardData_AR900B_CUS239_5G_v2_001.bin
HASH:=3bf7561ee373b369025dcd366d276d038a97d3397ccae41ce841d98a58b30aff
endef
$(eval $(call Download,qca99x0-board))
QCA99X0_BOARD2_REV:=ddcec9efd245da9365c474f513a855a55f3ac7fe
QCA99X0_BOARD2_FILE:=ath10k-firmware-$(QCA99X0_BOARD2_REV)-qca99x0-board-2.bin
define Download/qca99x0-board2
FILE:=$(QCA99X0_BOARD2_FILE)
URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0
URL_FILE:=board-2.bin?id=$(QCA99X0_BOARD2_REV)
HASH:=03711ac21e60ef59d3815e235eb721c0c22851b5410299411085aa6f2af45401
endef
$(eval $(call Download,qca99x0-board2))
QCA9984_BOARD2_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca9984-board-2.bin
define Download/qca9984-board2
FILE:=$(QCA9984_BOARD2_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA9984/hw1.0
URL_FILE:=board-2.bin
HASH:=0d6d46cf0467185e3959ce3cb69e2415be6e48ab8a4bee3eb400edbe48cb9c25
endef
$(eval $(call Download,qca9984-board2))
QCA4019_BOARD2_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca4019-board-2.bin
define Download/qca4019-board2
FILE:=$(QCA4019_BOARD2_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA4019/hw1.0
URL_FILE:=board-2.bin
HASH:=94b66aa4ddbed5110a96364d3c7b4ebcb320e3ac4e8697660b277e76077bc338
endef
$(eval $(call Download,qca4019-board2))
QCA9888_BOARD2_FILE:=ath10k-firmware-$(ATH10K_FIRMWARE_REV)-qca9888-board-2.bin
define Download/qca9888-board2
FILE:=$(QCA9888_BOARD2_FILE)
URL:=$(ATH10K_FIRMWARE_URL)/QCA9888/hw2.0
URL_FILE:=board-2.bin
HASH:=5b871bb567f64525ca45adb88063211de472015d09e0f9aa3fa61ab71c8fdfd3
endef
$(eval $(call Download,qca9888-board2))
CT_FIRMWARE_FILE = $(1)-$($(1)_FIRMWARE_FILE_CT)
CT_FIRMWARE_FILE_FULL_HTT = $(1)-$($(1)_FIRMWARE_FILE_CT_FULL_HTT)
CT_FIRMWARE_FILE_HTT = $(1)-$($(1)_FIRMWARE_FILE_CT_HTT)
define Download/ct-firmware
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT)
endef
define Download/ct-firmware-full-htt
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE_FULL_HTT,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT_FULL_HTT)
endef
define Download/ct-firmware-htt
URL:=https://www.candelatech.com/downloads/$(2)
FILE:=$(call CT_FIRMWARE_FILE_HTT,$(1))
URL_FILE:=$($(1)_FIRMWARE_FILE_CT_HTT)
endef
QCA988X_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.$(CTVER1)
define Download/ath10k-firmware-qca988x-ct
$(call Download/ct-firmware,QCA988X,)
HASH:=$(H988XFC)
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct))
QCA988X_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.$(CTVER1)
define Download/ath10k-firmware-qca988x-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA988X,)
HASH:=$(H988XFCH)
endef
$(eval $(call Download,ath10k-firmware-qca988x-ct-full-htt))
QCA9887_FIRMWARE_FILE_CT:=firmware-2-ct-full-community-22.bin.lede.$(CTVER1)
define Download/ath10k-firmware-qca9887-ct
$(call Download/ct-firmware,QCA9887,ath10k-9887)
HASH:=$(H9887FC)
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct))
QCA9887_FIRMWARE_FILE_CT_FULL_HTT:=firmware-2-ct-full-htt-mgt-community-22.bin.lede.$(CTVER1)
define Download/ath10k-firmware-qca9887-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9887,ath10k-9887)
HASH:=$(H9887FCH)
endef
$(eval $(call Download,ath10k-firmware-qca9887-ct-full-htt))
QCA99X0_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca99x0-ct
$(call Download/ct-firmware,QCA99X0,ath10k-10-4b)
HASH:=$(H9980FC)
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct))
QCA99X0_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca99x0-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA99X0,ath10k-10-4b)
HASH:=$(H9980FCH)
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-full-htt))
QCA99X0_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca99x0-ct-htt
$(call Download/ct-firmware-htt,QCA99X0,ath10k-10-4b)
HASH:=$(H9980CH)
endef
$(eval $(call Download,ath10k-firmware-qca99x0-ct-htt))
QCA9984_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca9984-ct
$(call Download/ct-firmware,QCA9984,ath10k-9984-10-4b)
HASH:=$(H9984FC)
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct))
QCA9984_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca9984-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9984,ath10k-9984-10-4b)
HASH:=$(H9984FCH)
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-full-htt))
QCA9984_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca9984-ct-htt
$(call Download/ct-firmware-htt,QCA9984,ath10k-9984-10-4b)
HASH:=$(H9984CH)
endef
$(eval $(call Download,ath10k-firmware-qca9984-ct-htt))
QCA4019_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca4019-ct
$(call Download/ct-firmware,QCA4019,ath10k-4019-10-4b)
HASH:=$(H4019FC)
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct))
QCA4019_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca4019-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA4019,ath10k-4019-10-4b)
HASH:=$(H4019FCH)
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-full-htt))
QCA4019_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca4019-ct-htt
$(call Download/ct-firmware-htt,QCA4019,ath10k-4019-10-4b)
HASH:=$(H4019CH)
endef
$(eval $(call Download,ath10k-firmware-qca4019-ct-htt))
QCA9888_FIRMWARE_FILE_CT:=firmware-5-ct-full-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca9888-ct
$(call Download/ct-firmware,QCA9888,ath10k-9888-10-4b)
HASH:=$(H9888FC)
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct))
QCA9888_FIRMWARE_FILE_CT_FULL_HTT:=firmware-5-ct-full-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca9888-ct-full-htt
$(call Download/ct-firmware-full-htt,QCA9888,ath10k-9888-10-4b)
HASH:=$(H9888FCH)
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-full-htt))
QCA9888_FIRMWARE_FILE_CT_HTT:=firmware-5-ct-htt-mgt-community-12.bin-lede.$(CTVER2)
define Download/ath10k-firmware-qca9888-ct-htt
$(call Download/ct-firmware-htt,QCA9888,ath10k-9888-10-4b)
HASH:=$(H9888CH)
endef
$(eval $(call Download,ath10k-firmware-qca9888-ct-htt))
define Package/ath10k-ct-firmware-default
SECTION:=firmware
CATEGORY:=Firmware
URL:=https://www.candelatech.com/ath10k.php
DEPENDS:=
endef
define Package/ath10k-firmware-qca988x-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 firmware for QCA988x devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca988x
endef
define Package/ath10k-firmware-qca988x-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 full-htt-mgt fw for QCA988x
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca988x
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9887-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 firmware for QCA9887 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9887
endef
define Package/ath10k-firmware-qca9887-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.1 full-htt-mgt fw for QCA9887
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9887
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca99x0-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA99x0 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
endef
define Package/ath10k-firmware-qca99x0-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt fw for QCA99x0
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca99x0-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA99x0
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca99x0
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9984-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA9984 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
endef
define Package/ath10k-firmware-qca9984-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt fw for QCA9984
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9984-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA9984
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9984
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca4019-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 firmware for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
endef
define Package/ath10k-firmware-qca4019-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca4019-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt for QCA4018/9
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca4019
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9888-ct
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 fw for QCA9886/8 devices
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
endef
define Package/ath10k-firmware-qca9888-ct-full-htt
$(Package/ath10k-ct-firmware-default)
TITLE:=ath10k CT 10.4 full-htt-mgt fw for QCA9886/8
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9888-ct-htt
$(Package/ath10k-firmware-default)
TITLE:=ath10k CT 10.4 htt-mgt fw for QCA9886/8
SECTION:=firmware
CATEGORY:=Firmware
PROVIDES:=ath10k-firmware-qca9888
DEPENDS:=+!PACKAGE_kmod-ath10k-ct-smallbuffers:kmod-ath10k-ct
endef
define Package/ath10k-firmware-qca9887-ct/description
Alternative ath10k firmware for QCA9887 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware conflicts with the standard 9887 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9887-ct-full-htt/description
Alternative ath10k firmware for QCA9887 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and fixes .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca988x-ct/description
Alternative ath10k firmware for QCA988X from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware will NOT be used unless the standard ath10k-firmware-qca988x
is un-selected since the driver will try to load firmware-5.bin before
firmware-2.bin
endef
define Package/ath10k-firmware-qca988x-ct-full-htt/description
Alternative ath10k firmware for QCA988X from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and fixes .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.1.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca99x0-ct/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 99x0 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca99x0-ct-full-htt/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca99x0-ct-htt/description
Alternative ath10k firmware for QCA99x0 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9984-ct/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 9984 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9984-ct-full-htt/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9984-ct-htt/description
Alternative ath10k firmware for QCA9984 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca4019-ct/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Enables IBSS and other features. Works with standard or ath10k-ct driver.
See: http://www.candelatech.com/ath10k-10.4.php
endef
define Package/ath10k-firmware-qca4019-ct-full-htt/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features.
See: http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca4019-ct-htt/description
Alternative ath10k firmware for IPQ4019 radio from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features.
See: http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9888-ct/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware conflicts with the standard 9886 and 9888 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9888-ct-full-htt/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Package/ath10k-firmware-qca9888-ct-htt/description
Alternative ath10k firmware for QCA9886 and QCA9888 from Candela Technologies.
Uses normal HTT TX data path for management frames, which improves
stability in busy networks and may be required for .11r authentication.
This firmware lacks a lot of features that ath10k does not use, saving
a lot of resources.
Enables IBSS and other features. See:
http://www.candelatech.com/ath10k-10.4.php
This firmware selects and requires the ath10k-ct driver.
endef
define Build/Compile
endef
define Package/ath10k-firmware-qca9887-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9887) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9887_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
define Package/ath10k-firmware-qca9887-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA9887) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/ct-firmware-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9887_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
define Package/ath10k-firmware-qca988x-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA988X_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA988X) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-2.bin
endef
define Package/ath10k-firmware-qca988x-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA988X_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA988X) \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/ct-firmware-2.bin
endef
define Package/ath10k-firmware-qca99x0-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca99x0-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca99x0-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA99X0) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9984_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9984_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9984-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9984_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9984) \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA4019_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA4019_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca4019-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA4019_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA4019) \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9888_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct-full-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9888_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_FULL_HTT,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin
endef
define Package/ath10k-firmware-qca9888-ct-htt/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
ln -s \
../../cal-pci-0000:01:00.0.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA9888_BOARD2_FILE) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(DL_DIR)/$(call CT_FIRMWARE_FILE_HTT,QCA9888) \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/ct-firmware-5.bin
endef
$(eval $(call BuildPackage,ath10k-firmware-qca9887-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9887-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca988x-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca99x0-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9984-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca4019-ct-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct-full-htt))
$(eval $(call BuildPackage,ath10k-firmware-qca9888-ct-htt))

View File

@@ -0,0 +1,122 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=ath10k-ct
PKG_RELEASE=1
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
PKG_MIRROR_HASH:=37b4f00231cb0ae00f63da1c94ae53c940c76d047ce0fb081c08a35fffbfd2c0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2021-05-22b
PKG_SOURCE_VERSION:=54a9ac02f1139596ea4361ebbc3e444955d86cfd
#PKG_MIRROR_HASH:=97cf22a4a57381c7eb7a9b8a8b1e347e9711ce51c89db971b4ab9a35af476ece
# Build the 5.4 ath10k-ct driver version. Other option is "-4.19".
# Probably this should match as closely as
# possible to whatever mac80211 backports version is being used.
CT_KVER="-5.7"
PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
PKG_BUILD_PARALLEL:=1
PKG_EXTMOD_SUBDIRS:=ath10k$(CT_KVER)
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/ath10k-ct
SUBMENU:=Wireless Drivers
TITLE:=ath10k-ct driver optimized for CT ath10k firmware
DEPENDS:=+kmod-mac80211 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT @PCI_SUPPORT +kmod-hwmon-core
FILES:=\
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
$(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
AUTOLOAD:=$(call AutoProbe,ath10k_pci)
PROVIDES:=kmod-ath10k
VARIANT:=regular
endef
define KernelPackage/ath10k-ct/config
config ATH10K-CT_LEDS
bool "Enable LED support"
default y
depends on PACKAGE_kmod-ath10k-ct || PACKAGE_kmod-ath10k-ct-smallbuffers
endef
define KernelPackage/ath10k-ct-smallbuffers
$(call KernelPackage/ath10k-ct)
TITLE+= (small buffers for low-RAM devices)
VARIANT:=smallbuffers
endef
NOSTDINC_FLAGS = \
-I$(PKG_BUILD_DIR) \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-include backport/autoconf.h \
-include backport/backport.h
ifdef CONFIG_PACKAGE_MAC80211_MESH
NOSTDINC_FLAGS += -DCONFIG_MAC80211_MESH
endif
CT_MAKEDEFS += CONFIG_ATH10K=m CONFIG_ATH10K_PCI=m CONFIG_ATH10K_CE=y
# This AHB logic is needed for IPQ4019 radios
CT_MAKEDEFS += CONFIG_ATH10K_AHB=m
NOSTDINC_FLAGS += -DCONFIG_ATH10K_AHB
NOSTDINC_FLAGS += -DSTANDALONE_CT
ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
CT_MAKEDEFS += CONFIG_ATH10K_DEBUGFS=y CONFIG_MAC80211_DEBUGFS=y
NOSTDINC_FLAGS += -DCONFIG_MAC80211_DEBUGFS
NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUGFS
endif
ifdef CONFIG_PACKAGE_ATH_DEBUG
NOSTDINC_FLAGS += -DCONFIG_ATH10K_DEBUG
endif
ifdef CONFIG_PACKAGE_ATH_DFS
NOSTDINC_FLAGS += -DCONFIG_ATH10K_DFS_CERTIFIED
endif
ifdef CONFIG_PACKAGE_ATH_SPECTRAL
CT_MAKEDEFS += CONFIG_ATH10K_SPECTRAL=y
NOSTDINC_FLAGS += -DCONFIG_ATH10K_SPECTRAL
endif
ifeq ($(CONFIG_ATH10K-CT_LEDS),y)
CT_MAKEDEFS += CONFIG_ATH10K_LEDS=y
NOSTDINC_FLAGS += -DCONFIG_ATH10K_LEDS
endif
ifeq ($(BUILD_VARIANT),smallbuffers)
NOSTDINC_FLAGS += -DCONFIG_ATH10K_SMALLBUFFERS
endif
define Build/Configure
cp $(STAGING_DIR)/usr/include/mac80211/ath/*.h $(PKG_BUILD_DIR)
endef
ifneq ($(findstring c,$(OPENWRT_VERBOSE)),)
CT_MAKEDEFS += V=1
endif
define Build/Compile
+$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
modules
endef
$(eval $(call KernelPackage,ath10k-ct))
$(eval $(call KernelPackage,ath10k-ct-smallbuffers))

View File

@@ -0,0 +1,37 @@
From: Sven Eckelmann <sven@narfation.org>
Date: Tue, 26 Feb 2019 08:06:35 +0100
Subject: ath10k-ct: apply mac80211 rates to ath10k-ct rate state
The rates from mac80211 have to be copied to the state of ath10k-ct or
otherwise the ath10k_check_apply_special_rates function overwrites
them again with some default values. This breaks for example the
mcast_rate set for a wifi-iface.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -6793,6 +6793,7 @@ static void ath10k_bss_info_changed(stru
"mac vdev %d mcast_rate %x\n",
arvif->vdev_id, rate);
+ arvif->mcast_rate[band] = rate;
vdev_param = ar->wmi.vdev_param->mcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6801,6 +6802,7 @@ static void ath10k_bss_info_changed(stru
"failed to set mcast rate on vdev %i: %d\n",
arvif->vdev_id, ret);
+ arvif->bcast_rate[band] = rate;
vdev_param = ar->wmi.vdev_param->bcast_data_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id,
vdev_param, rate);
@@ -6827,6 +6829,7 @@ static void ath10k_bss_info_changed(stru
return;
}
+ arvif->mgt_rate[def.chan->band] = hw_rate_code;
vdev_param = ar->wmi.vdev_param->mgmt_rate;
ret = ath10k_wmi_vdev_set_param(ar, arvif->vdev_id, vdev_param,
hw_rate_code);

View File

@@ -0,0 +1,598 @@
From: Sebastian Gottschall <s.gottschall@newmedia-net.de>
Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based
chipsets with on chipset connected led's using WMI Firmware API. The LED
device will get available named as "ath10k-phyX" at sysfs and can be controlled
with various triggers. adds also debugfs interface for gpio control.
This patch is specific for OpenWRt base, as is use old backported package
with old wireless source. Support for QCA9984 is removed.
Reworked to use ath10k-ct custom source
Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
[kvalo: major reorg and cleanup]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
---
v13:
* only compile tested!
* fix all checkpatch warnings
* fix commit log
* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio)
* unsigned -> unsigned int
* remove GPIOLIB code, that should be added in a separate patch
* rename gpio.c to leds.c
* add leds.h
* rename some functions:
ath10k_attach_led() -> ath10k_leds_register()
ath10k_unregister_led() -> ath10k_leds_unregister()
ath10k_reset_led_pin() -> ath10k_leds_start()
* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering
* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c
* rename struct ath10k_gpiocontrol as anonymous function under struct
ath10k::leds, no need for memory allocation
* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller
* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it
* Kconfig help text improvement and move it lower in the menu, also don't enable it by default
* switch to set_brightness_blocking() so that the callback can sleep,
then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex
to access ar->state
* don't touch ath10k_wmi_pdev_get_temperature()
* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface
* remove debugfs interface, that should be added in another patch
* cleanup includes
ath10k-5.4/Kconfig | 10 +++
ath10k-5.4/Makefile | 1 +
ath10k-5.4/core.c | 22 +++++++
ath10k-5.4/core.h | 9 ++-
ath10k-5.4/hw.h | 1 +
ath10k-5.4/leds.c | 103 ++++++++++++++++++++++++++++++
ath10k-5.4/leds.h | 45 +++++++++++++
ath10k-5.4/mac.c | 1 +
ath10k-5.4/wmi-ops.h | 32 ++++++++++
ath10k-5.4/wmi-tlv.c | 2 +
ath10k-5.4/wmi.c | 54 ++++++++++++++++
ath10k-5.4/wmi.h | 35 ++++++++++
12 files changed, 314 insertions(+), 1 deletion(-)
create mode 100644 ath10k-5.4/leds.c
create mode 100644 ath10k-5.4/leds.h
--- a/ath10k-5.4/Kconfig
+++ b/ath10k-5.4/Kconfig
@@ -66,6 +66,16 @@ config ATH10K_DEBUGFS
If unsure, say Y to make it easier to debug problems.
+config ATH10K_LEDS
+ bool "Atheros ath10k LED support"
+ depends on ATH10K
+ select MAC80211_LEDS
+ select LEDS_CLASS
+ select NEW_LEDS
+ default y
+ ---help---
+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
+
config ATH10K_SPECTRAL
bool "Atheros ath10k spectral scan support"
depends on ATH10K_DEBUGFS
--- a/ath10k-5.4/Makefile
+++ b/ath10k-5.4/Makefile
@@ -19,6 +19,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) +=
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
ath10k_core-$(CONFIG_THERMAL) += thermal.o
+ath10k_core-$(CONFIG_ATH10K_LEDS) += leds.o
ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
ath10k_core-$(CONFIG_PM) += wow.o
ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
--- a/ath10k-5.4/core.c
+++ b/ath10k-5.4/core.c
@@ -25,6 +25,7 @@
#include "testmode.h"
#include "wmi-ops.h"
#include "coredump.h"
+#include "leds.h"
/* Disable ath10k-ct DBGLOG output by default */
unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG;
@@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA988X_2_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca988x hw2.0",
+ .led_pin = 1,
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
@@ -137,6 +139,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA9887_1_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca9887 hw1.0",
+ .led_pin = 1,
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
@@ -344,6 +347,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA99X0_2_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca99x0 hw2.0",
+ .led_pin = 17,
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.otp_exe_param = 0x00000700,
@@ -385,6 +389,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA9984_1_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca9984/qca9994 hw1.0",
+ .led_pin = 17,
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
@@ -433,6 +438,7 @@ static const struct ath10k_hw_params ath
.dev_id = QCA9888_2_0_DEVICE_ID,
.bus = ATH10K_BUS_PCI,
.name = "qca9888 hw2.0",
+ .led_pin = 17,
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
.uart_pin = 7,
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
@@ -3573,6 +3579,10 @@ int ath10k_core_start(struct ath10k *ar,
ath10k_wmi_check_apply_board_power_ctl_table(ar);
}
+ status = ath10k_leds_start(ar);
+ if (status)
+ goto err_hif_stop;
+
return 0;
err_hif_stop:
@@ -3829,9 +3839,18 @@ static void ath10k_core_register_work(st
goto err_spectral_destroy;
}
+ status = ath10k_leds_register(ar);
+ if (status) {
+ ath10k_err(ar, "could not register leds: %d\n",
+ status);
+ goto err_thermal_unregister;
+ }
+
set_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags);
return;
+err_thermal_unregister:
+ ath10k_thermal_unregister(ar);
err_spectral_destroy:
ath10k_spectral_destroy(ar);
err_debug_destroy:
@@ -3891,6 +3910,8 @@ void ath10k_core_unregister(struct ath10
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
return;
+ ath10k_leds_unregister(ar);
+
ath10k_thermal_unregister(ar);
/* Stop spectral before unregistering from mac80211 to remove the
* relayfs debugfs file cleanly. Otherwise the parent debugfs tree
--- a/ath10k-5.4/core.h
+++ b/ath10k-5.4/core.h
@@ -14,6 +14,7 @@
#include <linux/pci.h>
#include <linux/uuid.h>
#include <linux/time.h>
+#include <linux/leds.h>
#include "htt.h"
#include "htc.h"
@@ -1469,6 +1470,13 @@ struct ath10k {
} testmode;
struct {
+ struct gpio_led wifi_led;
+ struct led_classdev cdev;
+ char label[48];
+ u32 gpio_state_pin;
+ } leds;
+
+ struct {
/* protected by data_lock */
u32 fw_crash_counter;
u32 fw_warm_reset_counter;
--- a/ath10k-5.4/hw.h
+++ b/ath10k-5.4/hw.h
@@ -518,6 +518,7 @@ struct ath10k_hw_params {
const char *name;
u32 patch_load_addr;
int uart_pin;
+ int led_pin;
u32 otp_exe_param;
/* Type of hw cycle counter wraparound logic, for more info
--- /dev/null
+++ b/ath10k-5.4/leds.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
+ * Copyright (c) 2018, 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 <linux/leds.h>
+
+#include "core.h"
+#include "wmi.h"
+#include "wmi-ops.h"
+
+#include "leds.h"
+
+static int ath10k_leds_set_brightness_blocking(struct led_classdev *led_cdev,
+ enum led_brightness brightness)
+{
+ struct ath10k *ar = container_of(led_cdev, struct ath10k,
+ leds.cdev);
+ struct gpio_led *led = &ar->leds.wifi_led;
+
+ mutex_lock(&ar->conf_mutex);
+
+ if (ar->state != ATH10K_STATE_ON)
+ goto out;
+
+ ar->leds.gpio_state_pin = (brightness != LED_OFF) ^ led->active_low;
+ ath10k_wmi_gpio_output(ar, led->gpio, ar->leds.gpio_state_pin);
+
+out:
+ mutex_unlock(&ar->conf_mutex);
+
+ return 0;
+}
+
+int ath10k_leds_start(struct ath10k *ar)
+{
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return 0;
+
+ /* under some circumstances, the gpio pin gets reconfigured
+ * to default state by the firmware, so we need to
+ * reconfigure it this behaviour has only ben seen on
+ * QCA9984 and QCA99XX devices so far
+ */
+ ath10k_wmi_gpio_config(ar, ar->hw_params.led_pin, 0,
+ WMI_GPIO_PULL_NONE, WMI_GPIO_INTTYPE_DISABLE);
+ ath10k_wmi_gpio_output(ar, ar->hw_params.led_pin, 1);
+
+ return 0;
+}
+
+int ath10k_leds_register(struct ath10k *ar)
+{
+ int ret;
+
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return 0;
+
+ snprintf(ar->leds.label, sizeof(ar->leds.label), "ath10k-%s",
+ wiphy_name(ar->hw->wiphy));
+ ar->leds.wifi_led.active_low = 1;
+ ar->leds.wifi_led.gpio = ar->hw_params.led_pin;
+ ar->leds.wifi_led.name = ar->leds.label;
+ ar->leds.wifi_led.default_state = LEDS_GPIO_DEFSTATE_KEEP;
+
+ ar->leds.cdev.name = ar->leds.label;
+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
+
+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+
+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
+ if (ret)
+ return ret;
+
+ return 0;
+}
+
+void ath10k_leds_unregister(struct ath10k *ar)
+{
+ if (ar->hw_params.led_pin == 0)
+ /* leds not supported */
+ return;
+
+ led_classdev_unregister(&ar->leds.cdev);
+}
+
--- /dev/null
+++ b/ath10k-5.4/leds.h
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2018, 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.
+ */
+#ifndef _LEDS_H_
+#define _LEDS_H_
+
+#include "core.h"
+
+#ifdef CONFIG_ATH10K_LEDS
+void ath10k_leds_unregister(struct ath10k *ar);
+int ath10k_leds_start(struct ath10k *ar);
+int ath10k_leds_register(struct ath10k *ar);
+#else
+static inline void ath10k_leds_unregister(struct ath10k *ar)
+{
+}
+
+static inline int ath10k_leds_start(struct ath10k *ar)
+{
+ return 0;
+}
+
+static inline int ath10k_leds_register(struct ath10k *ar)
+{
+ return 0;
+}
+
+#endif
+#endif /* _LEDS_H_ */
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -24,6 +24,7 @@
#include "wmi-tlv.h"
#include "wmi-ops.h"
#include "wow.h"
+#include "leds.h"
/*********/
/* Rates */
--- a/ath10k-5.4/wmi-ops.h
+++ b/ath10k-5.4/wmi-ops.h
@@ -218,7 +218,10 @@ struct wmi_ops {
struct sk_buff *(*gen_bb_timing)
(struct ath10k *ar,
const struct wmi_bb_timing_cfg_arg *arg);
+ struct sk_buff *(*gen_gpio_config)(struct ath10k *ar, u32 gpio_num,
+ u32 input, u32 pull_type, u32 intr_mode);
+ struct sk_buff *(*gen_gpio_output)(struct ath10k *ar, u32 gpio_num, u32 set);
};
int ath10k_wmi_cmd_send(struct ath10k *ar, struct sk_buff *skb, u32 cmd_id);
@@ -1105,6 +1108,35 @@ ath10k_wmi_force_fw_hang(struct ath10k *
return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->force_fw_hang_cmdid);
}
+static inline int ath10k_wmi_gpio_config(struct ath10k *ar, u32 gpio_num,
+ u32 input, u32 pull_type, u32 intr_mode)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_gpio_config)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_gpio_config(ar, gpio_num, input, pull_type, intr_mode);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_config_cmdid);
+}
+
+static inline int ath10k_wmi_gpio_output(struct ath10k *ar, u32 gpio_num, u32 set)
+{
+ struct sk_buff *skb;
+
+ if (!ar->wmi.ops->gen_gpio_config)
+ return -EOPNOTSUPP;
+
+ skb = ar->wmi.ops->gen_gpio_output(ar, gpio_num, set);
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
+
+ return ath10k_wmi_cmd_send(ar, skb, ar->wmi.cmd->gpio_output_cmdid);
+}
+
static inline int
ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
{
--- a/ath10k-5.4/wmi-tlv.c
+++ b/ath10k-5.4/wmi-tlv.c
@@ -4364,6 +4364,8 @@ static const struct wmi_ops wmi_tlv_ops
.gen_echo = ath10k_wmi_tlv_op_gen_echo,
.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
.gen_vdev_spectral_enable = ath10k_wmi_tlv_op_gen_vdev_spectral_enable,
+ /* .gen_gpio_config not implemented */
+ /* .gen_gpio_output not implemented */
};
static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
--- a/ath10k-5.4/wmi.c
+++ b/ath10k-5.4/wmi.c
@@ -8295,6 +8295,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
return skb;
}
+static struct sk_buff *ath10k_wmi_op_gen_gpio_config(struct ath10k *ar,
+ u32 gpio_num, u32 input,
+ u32 pull_type, u32 intr_mode)
+{
+ struct wmi_gpio_config_cmd *cmd;
+ struct sk_buff *skb;
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_gpio_config_cmd *)skb->data;
+ cmd->pull_type = __cpu_to_le32(pull_type);
+ cmd->gpio_num = __cpu_to_le32(gpio_num);
+ cmd->input = __cpu_to_le32(input);
+ cmd->intr_mode = __cpu_to_le32(intr_mode);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_config gpio_num 0x%08x input 0x%08x pull_type 0x%08x intr_mode 0x%08x\n",
+ gpio_num, input, pull_type, intr_mode);
+
+ return skb;
+}
+
+static struct sk_buff *ath10k_wmi_op_gen_gpio_output(struct ath10k *ar,
+ u32 gpio_num, u32 set)
+{
+ struct wmi_gpio_output_cmd *cmd;
+ struct sk_buff *skb;
+
+ skb = ath10k_wmi_alloc_skb(ar, sizeof(*cmd));
+ if (!skb)
+ return ERR_PTR(-ENOMEM);
+
+ cmd = (struct wmi_gpio_output_cmd *)skb->data;
+ cmd->gpio_num = __cpu_to_le32(gpio_num);
+ cmd->set = __cpu_to_le32(set);
+
+ ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi gpio_output gpio_num 0x%08x set 0x%08x\n",
+ gpio_num, set);
+
+ return skb;
+}
+
static struct sk_buff *
ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
enum wmi_sta_ps_mode psmode)
@@ -10094,6 +10137,9 @@ static const struct wmi_ops wmi_ops = {
.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
+
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -10164,6 +10210,8 @@ static const struct wmi_ops wmi_10_1_ops
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
.gen_echo = ath10k_wmi_op_gen_echo,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -10243,6 +10291,8 @@ static const struct wmi_ops wmi_10_2_ops
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_pdev_enable_adaptive_cca not implemented */
};
@@ -10314,6 +10364,8 @@ static const struct wmi_ops wmi_10_2_4_o
ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
.gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
/* .gen_bcn_tmpl not implemented */
/* .gen_prb_tmpl not implemented */
/* .gen_p2p_go_bcn_ie not implemented */
@@ -10395,6 +10447,8 @@ static const struct wmi_ops wmi_10_4_ops
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
.gen_echo = ath10k_wmi_op_gen_echo,
.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
+ .gen_gpio_config = ath10k_wmi_op_gen_gpio_config,
+ .gen_gpio_output = ath10k_wmi_op_gen_gpio_output,
};
int ath10k_wmi_attach(struct ath10k *ar)
--- a/ath10k-5.4/wmi.h
+++ b/ath10k-5.4/wmi.h
@@ -3110,6 +3110,41 @@ enum wmi_10_4_feature_mask {
};
+/* WMI_GPIO_CONFIG_CMDID */
+enum {
+ WMI_GPIO_PULL_NONE,
+ WMI_GPIO_PULL_UP,
+ WMI_GPIO_PULL_DOWN,
+};
+
+enum {
+ WMI_GPIO_INTTYPE_DISABLE,
+ WMI_GPIO_INTTYPE_RISING_EDGE,
+ WMI_GPIO_INTTYPE_FALLING_EDGE,
+ WMI_GPIO_INTTYPE_BOTH_EDGE,
+ WMI_GPIO_INTTYPE_LEVEL_LOW,
+ WMI_GPIO_INTTYPE_LEVEL_HIGH
+};
+
+/* WMI_GPIO_CONFIG_CMDID */
+struct wmi_gpio_config_cmd {
+ __le32 gpio_num; /* GPIO number to be setup */
+ __le32 input; /* 0 - Output/ 1 - Input */
+ __le32 pull_type; /* Pull type defined above */
+ __le32 intr_mode; /* Interrupt mode defined above (Input) */
+} __packed;
+
+/* WMI_GPIO_OUTPUT_CMDID */
+struct wmi_gpio_output_cmd {
+ __le32 gpio_num; /* GPIO number to be setup */
+ __le32 set; /* Set the GPIO pin*/
+} __packed;
+
+/* WMI_GPIO_INPUT_EVENTID */
+struct wmi_gpio_input_event {
+ __le32 gpio_num; /* GPIO number which changed state */
+} __packed;
+
struct wmi_ext_resource_config_10_4_cmd {
/* contains enum wmi_host_platform_type */
__le32 host_platform_config;

View File

@@ -0,0 +1,53 @@
From 79c9d7aabae1d1da9eea97d83b61e1517a8a2221 Mon Sep 17 00:00:00 2001
From: Mathias Kresin <dev@kresin.me>
Date: Fri, 22 Jun 2018 18:59:44 +0200
Subject: [PATCH] ath10k: use tpt LED trigger by default
Use the tpt LED trigger for each created phy led. Ths way LEDs attached
to the ath10k GPIO pins are indicating the phy status and blink on
traffic.
Signed-off-by: Mathias Kresin <dev@kresin.me>
---
ath10k-5.4/core.h | 4 ++++
ath10k-5.4/leds.c | 4 +---
ath10k-5.4/mac.c | 2 +-
3 files changed, 6 insertions(+), 4 deletions(-)
--- a/ath10k-5.4/core.h
+++ b/ath10k-5.4/core.h
@@ -1573,6 +1573,10 @@ struct ath10k {
u8 csi_data[4096];
u16 csi_data_len;
+#ifdef CPTCFG_MAC80211_LEDS
+ const char *led_default_trigger;
+#endif
+
/* must be last */
u8 drv_priv[0] __aligned(sizeof(void *));
};
--- a/ath10k-5.4/leds.c
+++ b/ath10k-5.4/leds.c
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
ar->leds.cdev.name = ar->leds.label;
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
-
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
if (ret)
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -10367,7 +10367,7 @@ int ath10k_mac_register(struct ath10k *a
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
#ifdef CPTCFG_MAC80211_LEDS
- ieee80211_create_tpt_led_trigger(ar->hw,
+ ar->led_default_trigger = ieee80211_create_tpt_led_trigger(ar->hw,
IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink,
ARRAY_SIZE(ath10k_tpt_blink));
#endif

View File

@@ -0,0 +1,10 @@
--- a/ath10k-5.4/mac.c
+++ b/ath10k-5.4/mac.c
@@ -10180,6 +10180,7 @@ int ath10k_mac_register(struct ath10k *a
wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_VHT_IBSS);
wiphy_ext_feature_set(ar->hw->wiphy,
NL80211_EXT_FEATURE_SET_SCAN_DWELL);
+ wiphy_ext_feature_set(ar->hw->wiphy, NL80211_EXT_FEATURE_AQL);
if (test_bit(WMI_SERVICE_TX_DATA_ACK_RSSI, ar->wmi.svc_map) ||
test_bit(WMI_SERVICE_HTT_MGMT_TX_COMP_VALID_FLAGS, ar->wmi.svc_map))

View File

@@ -0,0 +1,14 @@
--- a/ath10k-5.4/htt.h
+++ b/ath10k-5.4/htt.h
@@ -225,7 +225,11 @@ enum htt_rx_ring_flags {
};
#define HTT_RX_RING_SIZE_MIN 128
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
#define HTT_RX_RING_SIZE_MAX 2048
+#else
+#define HTT_RX_RING_SIZE_MAX 512
+#endif
#define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
#define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
#define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)

View File

@@ -0,0 +1,50 @@
--- a/ath10k-5.4/pci.c
+++ b/ath10k-5.4/pci.c
@@ -131,7 +131,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_htc_rx_cb,
},
@@ -140,7 +144,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 64,
+#endif
.recv_cb = ath10k_pci_htc_rx_cb,
},
@@ -167,7 +175,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 512,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 512,
+#else
+ .dest_nentries = 128,
+#endif
.recv_cb = ath10k_pci_htt_rx_cb,
},
@@ -192,7 +204,11 @@ static struct ce_attr host_ce_config_wla
.flags = CE_ATTR_FLAGS,
.src_nentries = 0,
.src_sz_max = 2048,
+#ifndef CONFIG_ATH10K_SMALLBUFFERS
.dest_nentries = 128,
+#else
+ .dest_nentries = 96,
+#endif
.recv_cb = ath10k_pci_pktlog_rx_cb,
},

View File

@@ -0,0 +1,22 @@
diff -Naur a/ath10k-5.7/mac.c b/ath10k-5.7/mac.c
--- a/ath10k-5.7/mac.c 2021-06-09 16:30:17.793556032 -0400
+++ b/ath10k-5.7/mac.c 2021-06-09 17:38:08.587733979 -0400
@@ -7103,13 +7103,15 @@
scan_timeout = min_t(u32, arg.max_rest_time *
(arg.n_channels - 1) + (req->duration +
ATH10K_SCAN_CHANNEL_SWITCH_WMI_EVT_OVERHEAD) *
- arg.n_channels, arg.max_scan_time + 200);
+ arg.n_channels, arg.max_scan_time);
} else {
- /* Add a 200ms margin to account for event/command processing */
- scan_timeout = arg.max_scan_time + 200;
+ scan_timeout = arg.max_scan_time;
}
+ /* Add a 200ms margin to account for event/command processing */
+ scan_timeout += 200;
+
ret = ath10k_start_scan(ar, &arg);
if (ret) {
ath10k_warn(ar, "failed to start hw scan: %d\n", ret);

View File

@@ -0,0 +1,11 @@
--- a/ath10k-5.7/mac.c 2021-07-06 11:12:56.022146449 -0700
+++ b/ath10k-5.7/mac.c 2021-07-06 19:37:52.352753693 -0700
@@ -8286,7 +8286,7 @@
struct ieee80211_channel *channel)
{
int ret;
- enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ_CLEAR;
+ enum wmi_bss_survey_req_type type = WMI_BSS_SURVEY_REQ_TYPE_READ;
lockdep_assert_held(&ar->conf_mutex);

View File

@@ -0,0 +1,31 @@
--- a/ath10k-5.7/wmi.c
+++ b/ath10k-5.7/wmi.c
@@ -6347,16 +6347,18 @@
survey = &ar->survey[idx];
- survey->noise = noise_floor;
- survey->time = div_u64(total, cc_freq_hz);
- survey->time_busy = div_u64(busy, cc_freq_hz);
- survey->time_rx = div_u64(rx_bss, cc_freq_hz);
- survey->time_tx = div_u64(tx, cc_freq_hz);
- survey->filled |= (SURVEY_INFO_NOISE_DBM |
- SURVEY_INFO_TIME |
- SURVEY_INFO_TIME_BUSY |
- SURVEY_INFO_TIME_RX |
- SURVEY_INFO_TIME_TX);
+ survey->noise = noise_floor;
+ survey->time = div_u64(total, cc_freq_hz);
+ survey->time_busy = div_u64(busy, cc_freq_hz);
+ survey->time_rx = div_u64(rx, cc_freq_hz);
+ survey->time_bss_rx = div_u64(rx_bss, cc_freq_hz);
+ survey->time_tx = div_u64(tx, cc_freq_hz);
+ survey->filled |= (SURVEY_INFO_NOISE_DBM |
+ SURVEY_INFO_TIME |
+ SURVEY_INFO_TIME_BUSY |
+ SURVEY_INFO_TIME_RX |
+ SURVEY_INFO_TIME_TX |
+ SURVEY_INFO_TIME_BSS_RX);
exit:
spin_unlock_bh(&ar->data_lock);
complete(&ar->bss_survey_done);

View File

@@ -0,0 +1,14 @@
Index: ath10k-ct-2021-05-22b-54a9ac02/ath10k-5.7/core.c
===================================================================
--- ath10k-ct-2021-05-22b-54a9ac02.orig/ath10k-5.7/core.c
+++ ath10k-ct-2021-05-22b-54a9ac02/ath10k-5.7/core.c
@@ -4146,6 +4146,9 @@ struct ath10k *ath10k_core_create(size_t
INIT_WORK(&ar->stop_scan_work, ath10k_wmi_stop_scan_work);
init_dummy_netdev(&ar->napi_dev);
+ snprintf(ar->napi_dev.name, sizeof(ar->napi_dev.name), "%s",
+ wiphy_name(ar->hw->wiphy));
+ ar->napi_dev.threaded = 1;
ret = ath10k_coredump_create(ar);
if (ret)

View File

@@ -0,0 +1,182 @@
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=ath10k-firmware
PKG_SOURCE_DATE:=2019-10-03
PKG_SOURCE_VERSION:=d622d160e9f552ead68d9ae81b715422892dc2ef
PKG_MIRROR_HASH:=2e504e071c3f896d629c4cfffe7ff4b5f1acdb4fecd3f01e8ff8c73e87a67cc7
PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/kvalo/ath10k-firmware.git
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
include $(INCLUDE_DIR)/package.mk
define Package/ath10k-firmware-default
SECTION:=firmware
CATEGORY:=Firmware
URL:=$(PKG_SOURCE_URL)
DEPENDS:=
endef
define Package/ath10k-firmware-qca9887
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA9887 devices
endef
define Package/ath10k-firmware-qca9888
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA9888 devices
endef
define Package/ath10k-firmware-qca988x
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA988x devices
SECTION:=firmware
CATEGORY:=Firmware
endef
define Package/ath10k-firmware-qca99x0
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA99x0 devices
SECTION:=firmware
CATEGORY:=Firmware
endef
define Package/ath10k-firmware-qca99x0/description
Standard ath10k firmware for QCA99x0 from QCA
This firmware conflicts with the CT 99x0 firmware, so select only
one.
endef
define Package/ath10k-firmware-qca9984
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA9984 devices
SECTION:=firmware
CATEGORY:=Firmware
endef
define Package/ath10k-firmware-qca4019
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for IPQ/QCA4019 devices
SECTION:=firmware
CATEGORY:=Firmware
endef
define Package/ath10k-firmware-qca6174
$(Package/ath10k-firmware-default)
TITLE:=ath10k firmware for QCA6174 devices
SECTION:=firmware
CATEGORY:=Firmware
endef
QCA99X0_BOARD_REV:=ddcec9efd245da9365c474f513a855a55f3ac7fe
QCA99X0_BOARD_FILE:=board-2.bin.$(QCA99X0_BOARD_REV)
define Download/qca99x0-board
URL:=https://source.codeaurora.org/quic/qsdk/oss/firmware/ath10k-firmware/plain/ath10k/QCA99X0/hw2.0
URL_FILE:=board-2.bin?id=$(QCA99X0_BOARD_REV)
FILE:=$(QCA99X0_BOARD_FILE)
HASH:=03711ac21e60ef59d3815e235eb721c0c22851b5410299411085aa6f2af45401
endef
$(eval $(call Download,qca99x0-board))
define Build/Compile
endef
define Package/ath10k-firmware-qca4019/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA4019/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA4019/hw1.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA4019/hw1.0/3.5.3/firmware-5.bin_10.4-3.5.3-00057 \
$(1)/lib/firmware/ath10k/QCA4019/hw1.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9887/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9887/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9887/hw1.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00047 \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/firmware-5.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9887/hw1.0/board.bin \
$(1)/lib/firmware/ath10k/QCA9887/hw1.0/board.bin
endef
define Package/ath10k-firmware-qca9888/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9888/hw2.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9888/hw2.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9888/hw2.0/3.5.3/firmware-5.bin_10.4-3.5.3-00053 \
$(1)/lib/firmware/ath10k/QCA9888/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca988x/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA988X/hw2.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA988X/hw2.0/board.bin \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA988X/hw2.0/10.2.4-1.0/firmware-5.bin_10.2.4-1.0-00047 \
$(1)/lib/firmware/ath10k/QCA988X/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca6174/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA6174/hw2.1
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA6174/hw2.1/board-2.bin \
$(1)/lib/firmware/ath10k/QCA6174/hw2.1/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA6174/hw2.1/firmware-5.bin_SW_RM.1.1.1-00157-QCARMSWPZ-1 \
$(1)/lib/firmware/ath10k/QCA6174/hw2.1/firmware-5.bin
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA6174/hw3.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA6174/hw3.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA6174/hw3.0/
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA6174/hw3.0/4.4.1.c1/firmware-6.bin_RM.4.4.1.c1-00042-QCARMSWP-1 \
$(1)/lib/firmware/ath10k/QCA6174/hw3.0/firmware-6.bin
endef
define Package/ath10k-firmware-qca99x0/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA99X0/hw2.0
$(INSTALL_DATA) \
$(DL_DIR)/$(QCA99X0_BOARD_FILE) \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board-2.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA99X0/hw2.0/boardData_AR900B_CUS239_5G_v2_001.bin \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/board.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA99X0/hw2.0/firmware-5.bin_10.4.1.00030-1 \
$(1)/lib/firmware/ath10k/QCA99X0/hw2.0/firmware-5.bin
endef
define Package/ath10k-firmware-qca9984/install
$(INSTALL_DIR) $(1)/lib/firmware/ath10k/QCA9984/hw1.0
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9984/hw1.0/board-2.bin \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/board-2.bin
$(INSTALL_DATA) \
$(PKG_BUILD_DIR)/QCA9984/hw1.0/3.5.3/firmware-5.bin_10.4-3.5.3-00053 \
$(1)/lib/firmware/ath10k/QCA9984/hw1.0/firmware-5.bin
endef
$(eval $(call BuildPackage,ath10k-firmware-qca9887))
#$(eval $(call BuildPackage,ath10k-firmware-qca9888))
$(eval $(call BuildPackage,ath10k-firmware-qca988x))
#$(eval $(call BuildPackage,ath10k-firmware-qca99x0))
#$(eval $(call BuildPackage,ath10k-firmware-qca6174))
#$(eval $(call BuildPackage,ath10k-firmware-qca9984))
#$(eval $(call BuildPackage,ath10k-firmware-qca4019))

View File

@@ -0,0 +1,231 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=batctl
PKG_VERSION:=2020.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_HASH:=d29cdb53ee68abd5027eae07d9fd645b3f154e0d577efa2666c1334bb6d60efd
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(BUILD_VARIANT)/$(PKG_NAME)-$(PKG_VERSION)
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
PKG_LICENSE:=GPL-2.0-only ISC MIT
PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT LICENSES/deprecated/ISC
include $(INCLUDE_DIR)/package.mk
define Package/batctl/Default
SECTION:=net
CATEGORY:=Network
URL:=https://www.open-mesh.org/
DEPENDS:=+libnl-tiny +libc +librt
PROVIDES:=batctl
endef
define Package/batctl/description
batctl is a more intuitive managment utility for B.A.T.M.A.N.-Advanced.
It is an easier method for configuring batman-adv and provides some
additional tools for debugging as well. This package builds
version $(PKG_VERSION) of the user space utility.
endef
define Package/batctl-tiny
$(call Package/batctl/Default)
TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Minimal)
VARIANT:=tiny
ALTERNATIVES:=100:/usr/sbin/batctl:/usr/libexec/batctl-tiny
endef
define Package/batctl-tiny/description
$(Package/batctl/description)
Only configuration relevant subcommands are enabled.
endef
define Package/batctl-default
$(call Package/batctl/Default)
TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Default)
VARIANT:=default
ALTERNATIVES:=200:/usr/sbin/batctl:/usr/libexec/batctl-default
endef
define Package/batctl-default/description
$(Package/batctl/description)
Standard subcommands for configuration and online debugging are enabled.
endef
define Package/batctl-full
$(call Package/batctl/Default)
TITLE:=B.A.T.M.A.N. Advanced user space configuration tool (Full)
VARIANT:=full
ALTERNATIVES:=300:/usr/sbin/batctl:/usr/libexec/batctl-full
endef
define Package/batctl-full/description
$(Package/batctl/description)
Subcommands for configuration, online and offline debugging are enabled.
endef
# The linker can identify unused sections of a binary when each symbol is stored
# in a separate section. This mostly removes unused linker sections and reduces
# the size by ~3% on mipsel.
TARGET_CFLAGS += -ffunction-sections -fdata-sections
TARGET_LDFLAGS += -Wl,--gc-sections
# Link-time optimization allows to move parts of the optimization from the single
# source file to the global source view. This is done by emitting the GIMPLE
# representation in each object file and analyzing it again during the link step.
TARGET_CFLAGS += -flto
TARGET_LDFLAGS += -fuse-linker-plugin
MAKE_VARS += \
LIBNL_NAME="libnl-tiny" \
LIBNL_GENL_NAME="libnl-tiny"
MAKE_FLAGS += \
REVISION="$(PKG_VERSION)-openwrt-$(PKG_RELEASE)"
config-n := \
aggregation \
ap_isolation \
backbonetable \
bisect_iv \
bonding \
bridge_loop_avoidance \
claimtable \
dat_cache \
distributed_arp_table \
elp_interval \
event \
fragmentation \
gateways \
gw_mode \
hop_penalty \
interface \
isolation_mark \
loglevel \
mcast_flags \
multicast_fanout \
multicast_forceflood \
multicast_mode \
nc_nodes \
neighbors \
network_coding \
orig_interval \
originators \
ping \
routing_algo \
statistics \
tcpdump \
throughput_override \
throughputmeter \
traceroute \
transglobal \
translate \
translocal \
config-settings := \
aggregation \
ap_isolation \
bonding \
bridge_loop_avoidance \
distributed_arp_table \
elp_interval \
fragmentation \
gw_mode \
hop_penalty \
interface \
isolation_mark \
loglevel \
multicast_fanout \
multicast_forceflood \
multicast_mode \
network_coding \
orig_interval \
routing_algo \
throughput_override \
config-tables := \
backbonetable \
claimtable \
dat_cache \
gateways \
loglevel \
nc_nodes \
neighbors \
originators \
statistics \
transglobal \
translocal \
config-tools := \
event \
ping \
tcpdump \
throughputmeter \
traceroute \
translate \
config-extratools := \
bisect_iv \
ifeq ($(BUILD_VARIANT),tiny)
config-y := \
$(config-settings) \
endif
ifeq ($(BUILD_VARIANT),default)
config-y := \
$(config-settings) \
$(config-tables) \
$(config-tools) \
endif
ifeq ($(BUILD_VARIANT),full)
config-y := \
$(config-settings) \
$(config-tables) \
$(config-tools) \
$(config-extratools) \
endif
define ConfigVars
$(subst $(space),,$(foreach opt,$(config-$(1)),CONFIG_$(opt)=$(1)
))
endef
define batctl_config
$(call ConfigVars,n)$(call ConfigVars,y)
endef
$(eval $(call shexport,batctl_config))
MAKE_FLAGS += $$$$$(call shvar,batctl_config)
define Package/batctl-tiny/install
$(INSTALL_DIR) $(1)/usr/libexec
$(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-tiny
endef
define Package/batctl-default/install
$(INSTALL_DIR) $(1)/usr/libexec
$(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-default
endef
define Package/batctl-full/install
$(INSTALL_DIR) $(1)/usr/libexec
$(INSTALL_BIN) $(PKG_BUILD_DIR)/batctl $(1)/usr/libexec/batctl-full
endef
$(eval $(call BuildPackage,batctl-default))
$(eval $(call BuildPackage,batctl-tiny))
$(eval $(call BuildPackage,batctl-full))

View File

@@ -0,0 +1,110 @@
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2007-2019 B.A.T.M.A.N. contributors:
#
# Marek Lindner, Simon Wunderlich
#
# B.A.T.M.A.N meshing protocol
#
config BATMAN_ADV_BATMAN_V
bool "B.A.T.M.A.N. V protocol"
depends on PACKAGE_kmod-batman-adv
default y
help
This option enables the B.A.T.M.A.N. V protocol, the successor
of the currently used B.A.T.M.A.N. IV protocol. The main
changes include splitting of the OGM protocol into a neighbor
discovery protocol (Echo Location Protocol, ELP) and a new OGM
Protocol OGMv2 for flooding protocol information through the
network, as well as a throughput based metric.
B.A.T.M.A.N. V is currently considered experimental and not
compatible to B.A.T.M.A.N. IV networks.
config BATMAN_ADV_BLA
bool "Bridge Loop Avoidance"
depends on PACKAGE_kmod-batman-adv
select PACKAGE_kmod-lib-crc16
default y
help
This option enables BLA (Bridge Loop Avoidance), a mechanism
to avoid Ethernet frames looping when mesh nodes are connected
to both the same LAN and the same mesh. If you will never use
more than one mesh node in the same LAN, you can safely remove
this feature and save some space.
config BATMAN_ADV_DAT
bool "Distributed ARP Table"
depends on PACKAGE_kmod-batman-adv
default y
help
This option enables DAT (Distributed ARP Table), a DHT based
mechanism that increases ARP reliability on sparse wireless
mesh networks. If you think that your network does not need
this option you can safely remove it and save some space.
config BATMAN_ADV_NC
bool "Network Coding"
depends on PACKAGE_kmod-batman-adv
help
This option enables network coding, a mechanism that aims to
increase the overall network throughput by fusing multiple
packets in one transmission.
Note that interfaces controlled by batman-adv must be manually
configured to have promiscuous mode enabled in order to make
network coding work.
If you think that your network does not need this feature you
can safely disable it and save some space.
config BATMAN_ADV_MCAST
bool "Multicast optimisation"
depends on PACKAGE_kmod-batman-adv
default y
help
This option enables the multicast optimisation which aims to
reduce the air overhead while improving the reliability of
multicast messages.
config BATMAN_ADV_DEBUGFS
bool "batman-adv debugfs entries"
depends on PACKAGE_kmod-batman-adv
select KERNEL_DEBUG_FS
help
Enable this to export routing related debug tables via debugfs.
The information for each soft-interface and used hard-interface can be
found under batman_adv/
If unsure, say N.
config BATMAN_ADV_DEBUG
bool "B.A.T.M.A.N. debugging"
depends on PACKAGE_kmod-batman-adv
help
This is an option for use by developers; most people should
say N here. This enables compilation of support for
outputting debugging information to the debugfs log or tracing
buffer. The output is controlled via the batadv netdev specific
log_level setting.
config BATMAN_ADV_SYSFS
bool "batman-adv sysfs entries"
depends on PACKAGE_kmod-batman-adv
help
Say Y here if you want to enable batman-adv device configuration and
status interface through sysfs attributes. It is replaced by the
batadv generic netlink family but still used by various userspace
tools and scripts.
If unsure, say Y.
config BATMAN_ADV_TRACING
bool "B.A.T.M.A.N. tracing support"
depends on PACKAGE_kmod-batman-adv
select KERNEL_FTRACE
select KERNEL_ENABLE_DEFAULT_TRACERS
help
This is an option for use by developers; most people should
say N here. Select this option to gather traces like the debug
messages using the generic tracing infrastructure of the kernel.
BATMAN_ADV_DEBUG must also be selected to get trace events for
batadv_dbg.

View File

@@ -0,0 +1,91 @@
# SPDX-License-Identifier: GPL-2.0-only
include $(TOPDIR)/rules.mk
PKG_NAME:=batman-adv
PKG_VERSION:=2020.2
PKG_RELEASE:=1
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://downloads.open-mesh.org/batman/releases/batman-adv-$(PKG_VERSION)
PKG_HASH:=a73f5ce72c6efa9dd7bd7cc8daa667d0982e12e40811c978bb652607bb5666a3
PKG_EXTMOD_SUBDIRS:=net/batman-adv
PKG_MAINTAINER:=Simon Wunderlich <sw@simonwunderlich.de>
PKG_LICENSE:=GPL-2.0-only MIT
PKG_LICENSE_FILES:=LICENSES/preferred/GPL-2.0 LICENSES/preferred/MIT
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/batman-adv
SUBMENU:=Network Support
TITLE:=B.A.T.M.A.N. Adv
URL:=https://www.open-mesh.org/
DEPENDS:=+BATMAN_ADV_BLA:kmod-lib-crc16 +kmod-lib-crc32c +kmod-cfg80211 +batctl
FILES:=$(PKG_BUILD_DIR)/net/batman-adv/batman-adv.$(LINUX_KMOD_SUFFIX)
AUTOLOAD:=$(call AutoProbe,batman-adv)
endef
define KernelPackage/batman-adv/description
B.A.T.M.A.N. (better approach to mobile ad-hoc networking) is
a routing protocol for multi-hop ad-hoc mesh networks. The
networks may be wired or wireless. See
https://www.open-mesh.org/ for more information and user space
tools. This package builds version $(PKG_VERSION) of the kernel
module.
endef
define KernelPackage/batman-adv/config
source "$(SOURCE)/Config.in"
endef
define Package/kmod-batman-adv/conffiles
/etc/config/batman-adv
endef
PKG_EXTRA_KCONFIG:= \
CONFIG_BATMAN_ADV=m \
CONFIG_BATMAN_ADV_DEBUG=$(if $(CONFIG_BATMAN_ADV_DEBUG),y,n) \
CONFIG_BATMAN_ADV_DEBUGFS=$(if $(CONFIG_BATMAN_ADV_DEBUGFS),y,n) \
CONFIG_BATMAN_ADV_BLA=$(if $(CONFIG_BATMAN_ADV_BLA),y,n) \
CONFIG_BATMAN_ADV_DAT=$(if $(CONFIG_BATMAN_ADV_DAT),y,n) \
CONFIG_BATMAN_ADV_MCAST=$(if $(CONFIG_BATMAN_ADV_MCAST),y,n) \
CONFIG_BATMAN_ADV_NC=$(if $(CONFIG_BATMAN_ADV_NC),y,n) \
CONFIG_BATMAN_ADV_BATMAN_V=$(if $(CONFIG_BATMAN_ADV_BATMAN_V),y,n) \
CONFIG_BATMAN_ADV_SYSFS=$(if $(CONFIG_BATMAN_ADV_SYSFS),y,n) \
CONFIG_BATMAN_ADV_TRACING=$(if $(CONFIG_BATMAN_ADV_TRACING),y,n) \
PKG_EXTRA_CFLAGS:= \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=m,%,$(filter %=m,$(PKG_EXTRA_KCONFIG)))) \
$(patsubst CONFIG_%, -DCONFIG_%=1, $(patsubst %=y,%,$(filter %=y,$(PKG_EXTRA_KCONFIG)))) \
NOSTDINC_FLAGS = \
-I$(PKG_BUILD_DIR)/net/batman-adv \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-I$(PKG_BUILD_DIR)/include/ \
-include backport/autoconf.h \
-include backport/backport.h \
-include $(PKG_BUILD_DIR)/compat-hacks.h \
-DBATADV_SOURCE_VERSION=\\\"$(PKG_VERSION)-openwrt-$(PKG_RELEASE)\\\"
define Build/Compile
$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)/net/batman-adv" \
$(PKG_EXTRA_KCONFIG) \
EXTRA_CFLAGS="$(PKG_EXTRA_CFLAGS)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
modules
endef
define KernelPackage/batman-adv/install
$(CP) ./files/. $(1)/
endef
$(eval $(call KernelPackage,batman-adv))

View File

@@ -0,0 +1,97 @@
#!/bin/sh
# This UCI-Defaults script will split the batadv proto network interfaces
# in batadv_hardif and batadv proto. The configuration options from
# /etc/config/batman-adv will be moved to the latter.
. /lib/functions.sh
proto_batadv_to_batadv_hardif() {
local section="$1"
local proto
local mesh
local routing_algo
config_get proto "${section}" proto
config_get mesh "${section}" mesh
config_get routing_algo "${section}" routing_algo
if [ -z "$mesh" -o "${proto}" != "batadv" ]; then
continue
fi
uci set network."${section}".proto="batadv_hardif"
uci rename network."${section}".mesh="master"
uci delete network."${section}".routing_algo
# create new section or adjust existing one
uci set network."${mesh}"=interface
uci set network."${mesh}".proto=batadv
[ -n "${routing_algo}" ] && uci set network."${mesh}".routing_algo="${routing_algo}"
}
mv_batadv_config_section() {
local section="$1"
local aggregated_ogms
local ap_isolation
local bonding
local bridge_loop_avoidance
local distributed_arp_table
local fragmentation
local gw_bandwidth
local gw_mode
local gw_sel_class
local hop_penalty
local isolation_mark
local log_level
local multicast_mode
local network_coding
local orig_interval
config_get aggregated_ogms "${section}" aggregated_ogms
config_get ap_isolation "${section}" ap_isolation
config_get bonding "${section}" bonding
config_get bridge_loop_avoidance "${section}" bridge_loop_avoidance
config_get distributed_arp_table "${section}" distributed_arp_table
config_get fragmentation "${section}" fragmentation
config_get gw_bandwidth "${section}" gw_bandwidth
config_get gw_mode "${section}" gw_mode
config_get gw_sel_class "${section}" gw_sel_class
config_get hop_penalty "${section}" hop_penalty
config_get isolation_mark "${section}" isolation_mark
config_get log_level "${section}" log_level
config_get multicast_mode "${section}" multicast_mode
config_get network_coding "${section}" network_coding
config_get orig_interval "${section}" orig_interval
# update section in case it exists
[ -n "${aggregated_ogms}" ] && uci set network."${section}".aggregated_ogms="${aggregated_ogms}"
[ -n "${ap_isolation}" ] && uci set network."${section}".ap_isolation="${ap_isolation}"
[ -n "${bonding}" ] && uci set network."${section}".bonding="${bonding}"
[ -n "${bridge_loop_avoidance}" ] && uci set network."${section}".bridge_loop_avoidance="${bridge_loop_avoidance}"
[ -n "${distributed_arp_table}" ] && uci set network."${section}".distributed_arp_table="${distributed_arp_table}"
[ -n "${fragmentation}" ] && uci set network."${section}".fragmentation="${fragmentation}"
[ -n "${gw_bandwidth}" ] && uci set network."${section}".gw_bandwidth="${gw_bandwidth}"
[ -n "${gw_mode}" ] && uci set network."${section}".gw_mode="${gw_mode}"
[ -n "${gw_sel_class}" ] && uci set network."${section}".gw_sel_class="${gw_sel_class}"
[ -n "${hop_penalty}" ] && uci set network."${section}".hop_penalty="${hop_penalty}"
[ -n "${isolation_mark}" ] && uci set network."${section}".isolation_mark="${isolation_mark}"
[ -n "${log_level}" ] && uci set network."${section}".log_level="${log_level}"
[ -n "${multicast_mode}" ] && uci set network."${section}".multicast_mode="${multicast_mode}"
[ -n "${network_coding}" ] && uci set network."${section}".network_coding="${network_coding}"
[ -n "${orig_interval}" ] && uci set network."${section}".orig_interval="${orig_interval}"
}
if [ -f /etc/config/batman-adv ]; then
config_load network
config_foreach proto_batadv_to_batadv_hardif 'interface'
uci commit network
config_load batman-adv
config_foreach mv_batadv_config_section 'mesh'
uci commit network
rm -f /etc/config/batman-adv
fi
exit 0

View File

@@ -0,0 +1,123 @@
#!/bin/sh
[ -n "$INCLUDE_ONLY" ] || {
. /lib/functions.sh
. ../netifd-proto.sh
init_proto "$@"
}
proto_batadv_init_config() {
no_device=1
available=1
proto_config_add_boolean 'aggregated_ogms:bool'
proto_config_add_boolean 'ap_isolation:bool'
proto_config_add_boolean 'bonding:bool'
proto_config_add_boolean 'bridge_loop_avoidance:bool'
proto_config_add_boolean 'distributed_arp_table:bool'
proto_config_add_boolean 'fragmentation:bool'
proto_config_add_string 'gw_bandwidth'
proto_config_add_string 'gw_mode'
proto_config_add_int 'gw_sel_class'
proto_config_add_int 'hop_penalty'
proto_config_add_string 'isolation_mark'
proto_config_add_string 'log_level'
proto_config_add_int 'multicast_fanout'
proto_config_add_boolean 'multicast_mode:bool'
proto_config_add_boolean 'network_coding:bool'
proto_config_add_int 'orig_interval'
proto_config_add_string 'routing_algo'
}
proto_batadv_setup() {
local config="$1"
local iface="$config"
local aggregated_ogms
local ap_isolation
local bonding
local bridge_loop_avoidance
local distributed_arp_table
local fragmentation
local gw_bandwidth
local gw_mode
local gw_sel_class
local hop_penalty
local isolation_mark
local log_level
local multicast_fanout
local multicast_mode
local network_coding
local orig_interval
local routing_algo
json_get_vars aggregated_ogms
json_get_vars ap_isolation
json_get_vars bonding
json_get_vars bridge_loop_avoidance
json_get_vars distributed_arp_table
json_get_vars fragmentation
json_get_vars gw_bandwidth
json_get_vars gw_mode
json_get_vars gw_sel_class
json_get_vars hop_penalty
json_get_vars isolation_mark
json_get_vars log_level
json_get_vars multicast_fanout
json_get_vars multicast_mode
json_get_vars network_coding
json_get_vars orig_interval
json_get_vars routing_algo
set_default routing_algo 'BATMAN_IV'
batctl routing_algo "$routing_algo"
batctl meshif "$iface" interface create
[ -n "$aggregated_ogms" ] && batctl meshif "$iface" aggregation "$aggregated_ogms"
[ -n "$ap_isolation" ] && batctl meshif "$iface" ap_isolation "$ap_isolation"
[ -n "$bonding" ] && batctl meshif "$iface" bonding "$bonding"
[ -n "$bridge_loop_avoidance" ] && batctl meshif "$iface" bridge_loop_avoidance "$bridge_loop_avoidance" 2>&-
[ -n "$distributed_arp_table" ] && batctl meshif "$iface" distributed_arp_table "$distributed_arp_table" 2>&-
[ -n "$fragmentation" ] && batctl meshif "$iface" fragmentation "$fragmentation"
case "$gw_mode" in
server)
if [ -n "$gw_bandwidth" ]; then
batctl meshif "$iface" gw_mode "server" "$gw_bandwidth"
else
batctl meshif "$iface" gw_mode "server"
fi
;;
client)
if [ -n "$gw_sel_class" ]; then
batctl meshif "$iface" gw_mode "client" "$gw_sel_class"
else
batctl meshif "$iface" gw_mode "client"
fi
;;
*)
batctl meshif "$iface" gw_mode "off"
;;
esac
[ -n "$hop_penalty" ] && batctl meshif "$iface" hop_penalty "$hop_penalty"
[ -n "$isolation_mark" ] && batctl meshif "$iface" isolation_mark "$isolation_mark"
[ -n "$multicast_fanout" ] && batctl meshif "$iface" multicast_fanout "$multicast_fanout"
[ -n "$multicast_mode" ] && batctl meshif "$iface" multicast_mode "$multicast_mode" 2>&-
[ -n "$network_coding" ] && batctl meshif "$iface" network_coding "$network_coding" 2>&-
[ -n "$log_level" ] && batctl meshif "$iface" loglevel "$log_level" 2>&-
[ -n "$orig_interval" ] && batctl meshif "$iface" orig_interval "$orig_interval"
proto_init_update "$iface" 1
proto_send_update "$config"
}
proto_batadv_teardown() {
local config="$1"
local iface="$config"
batctl meshif "$iface" interface destroy
}
add_protocol batadv

View File

@@ -0,0 +1,49 @@
#!/bin/sh
[ -n "$INCLUDE_ONLY" ] || {
. /lib/functions.sh
. ../netifd-proto.sh
init_proto "$@"
}
proto_batadv_hardif_init_config() {
proto_config_add_int 'elp_interval'
proto_config_add_string "master"
proto_config_add_string 'throughput_override'
}
proto_batadv_hardif_setup() {
local config="$1"
local iface="$2"
local elp_interval
local master
local throughput_override
json_get_vars elp_interval
json_get_vars master
json_get_vars throughput_override
( proto_add_host_dependency "$config" '' "$master" )
batctl meshif "$master" interface -M add "$iface"
[ -n "$elp_interval" ] && batctl hardif "$iface" elp_interval "$elp_interval"
[ -n "$throughput_override" ] && batctl hardif "$iface" throughput_override "$throughput_override"
proto_init_update "$iface" 1
proto_send_update "$config"
}
proto_batadv_hardif_teardown() {
local config="$1"
local iface="$2"
local master
json_get_vars master
batctl meshif "$master" interface -M del "$iface" || true
}
add_protocol batadv_hardif

View File

@@ -0,0 +1,25 @@
#!/bin/sh
. /lib/functions.sh
. ../netifd-proto.sh
init_proto "$@"
proto_batadv_vlan_init_config() {
proto_config_add_boolean 'ap_isolation:bool'
}
proto_batadv_vlan_setup() {
local config="$1"
local iface="$2"
# batadv_vlan options
local ap_isolation
json_get_vars ap_isolation
[ -n "$ap_isolation" ] && batctl vlan "$iface" ap_isolation "$ap_isolation"
proto_init_update "$iface" 1
proto_send_update "$config"
}
add_protocol batadv_vlan

View File

@@ -0,0 +1,181 @@
/* Please avoid adding hacks here - instead add it to mac80211/backports.git */
#undef CONFIG_MODULE_STRIPPED
#include <linux/version.h> /* LINUX_VERSION_CODE */
#include <linux/types.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
#include <linux/netdevice.h>
#define netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info, extack) ({\
BUILD_BUG_ON(extack != NULL); \
netdev_master_upper_dev_link(dev, upper_dev, upper_priv, upper_info); \
})
#endif /* < KERNEL_VERSION(4, 15, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
#ifndef sizeof_field
#define sizeof_field(TYPE, MEMBER) sizeof((((TYPE *)0)->MEMBER))
#endif
#endif /* < KERNEL_VERSION(4, 16, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
#include_next <linux/igmp.h>
#include_next <net/addrconf.h>
static inline int batadv_ipv6_mc_check_mld1(struct sk_buff *skb)
{
return ipv6_mc_check_mld(skb, NULL);
}
static inline int batadv_ipv6_mc_check_mld2(struct sk_buff *skb,
struct sk_buff **skb_trimmed)
{
return ipv6_mc_check_mld(skb, skb_trimmed);
}
#define ipv6_mc_check_mld_get(_1, _2, ipv6_mc_check_mld_name, ...) ipv6_mc_check_mld_name
#define ipv6_mc_check_mld(...) \
ipv6_mc_check_mld_get(__VA_ARGS__, batadv_ipv6_mc_check_mld2, batadv_ipv6_mc_check_mld1)(__VA_ARGS__)
static inline int batadv_ip_mc_check_igmp1(struct sk_buff *skb)
{
return ip_mc_check_igmp(skb, NULL);
}
static inline int batadv_ip_mc_check_igmp2(struct sk_buff *skb,
struct sk_buff **skb_trimmed)
{
return ip_mc_check_igmp(skb, skb_trimmed);
}
#define ip_mc_check_igmp_get(_1, _2, ip_mc_check_igmp_name, ...) ip_mc_check_igmp_name
#define ip_mc_check_igmp(...) \
ip_mc_check_igmp_get(__VA_ARGS__, batadv_ip_mc_check_igmp2, batadv_ip_mc_check_igmp1)(__VA_ARGS__)
#endif /* < KERNEL_VERSION(5, 1, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
#define batadv_softif_slave_add(__dev, __slave_dev, __extack) \
batadv_softif_slave_add(__dev, __slave_dev)
#endif /* < KERNEL_VERSION(4, 15, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
static inline int batadv_access_ok(int type, const void __user *p,
unsigned long size)
{
return access_ok(type, p, size);
}
#ifdef access_ok
#undef access_ok
#endif
#define access_ok_get(_1, _2, _3 , access_ok_name, ...) access_ok_name
#define access_ok(...) \
access_ok_get(__VA_ARGS__, access_ok3, access_ok2)(__VA_ARGS__)
#define access_ok2(addr, size) batadv_access_ok(VERIFY_WRITE, (addr), (size))
#define access_ok3(type, addr, size) batadv_access_ok((type), (addr), (size))
#endif /* < KERNEL_VERSION(5, 0, 0) */
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0)
#ifndef fallthrough
#if __GNUC__ > 7 && !defined(__CHECKER__)
# define fallthrough __attribute__((__fallthrough__))
#else
# define fallthrough do {} while (0) /* fallthrough */
#endif
#endif
#endif /* < KERNEL_VERSION(5, 4, 0) */
/* <DECLARE_EWMA> */
#include <linux/version.h>
#include_next <linux/average.h>
#include <linux/bug.h>
#ifdef DECLARE_EWMA
#undef DECLARE_EWMA
#endif /* DECLARE_EWMA */
/*
* Exponentially weighted moving average (EWMA)
*
* This implements a fixed-precision EWMA algorithm, with both the
* precision and fall-off coefficient determined at compile-time
* and built into the generated helper funtions.
*
* The first argument to the macro is the name that will be used
* for the struct and helper functions.
*
* The second argument, the precision, expresses how many bits are
* used for the fractional part of the fixed-precision values.
*
* The third argument, the weight reciprocal, determines how the
* new values will be weighed vs. the old state, new values will
* get weight 1/weight_rcp and old values 1-1/weight_rcp. Note
* that this parameter must be a power of two for efficiency.
*/
#define DECLARE_EWMA(name, _precision, _weight_rcp) \
struct ewma_##name { \
unsigned long internal; \
}; \
static inline void ewma_##name##_init(struct ewma_##name *e) \
{ \
BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
/* \
* Even if you want to feed it just 0/1 you should have \
* some bits for the non-fractional part... \
*/ \
BUILD_BUG_ON((_precision) > 30); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
e->internal = 0; \
} \
static inline unsigned long \
ewma_##name##_read(struct ewma_##name *e) \
{ \
BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
BUILD_BUG_ON((_precision) > 30); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
return e->internal >> (_precision); \
} \
static inline void ewma_##name##_add(struct ewma_##name *e, \
unsigned long val) \
{ \
unsigned long internal = READ_ONCE(e->internal); \
unsigned long weight_rcp = ilog2(_weight_rcp); \
unsigned long precision = _precision; \
\
BUILD_BUG_ON(!__builtin_constant_p(_precision)); \
BUILD_BUG_ON(!__builtin_constant_p(_weight_rcp)); \
BUILD_BUG_ON((_precision) > 30); \
BUILD_BUG_ON_NOT_POWER_OF_2(_weight_rcp); \
\
WRITE_ONCE(e->internal, internal ? \
(((internal << weight_rcp) - internal) + \
(val << precision)) >> weight_rcp : \
(val << precision)); \
}
/* </DECLARE_EWMA> */

View File

@@ -0,0 +1,151 @@
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/version.mk
PKG_NAME:=ipq-wifi
PKG_RELEASE:=1
PKG_FLAGS:=nonshared
include $(INCLUDE_DIR)/package.mk
define Build/Prepare
mkdir -p $(PKG_BUILD_DIR)
endef
define Build/Compile
endef
# Use ath10k-bdencoder from https://github.com/qca/qca-swiss-army-knife.git
# to generate the board-* files here.
#
# 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>
ALLWIFIBOARDS:= \
8dev_habanero-dvk \
aruba_ap-303 \
avm_fritzrepeater-1200 \
buffalo_wtr-m2133hp \
cellc_rtl30vw \
devolo_magic-2-wifi-next \
dlink_dap2610 \
edgecore_ecw5410 \
edgecore_ssw2ac2600 \
edgecore_oap100 \
engenius_eap2200 \
engenius_emd1 \
engenius_emr3500 \
ezviz_cs-w3-wd1200g-eup \
glinet_gl-ap1300 \
glinet_gl-s1300 \
linksys_ea8300 \
linksys_mr8300-v0 \
luma_wrtq-329acn \
mikrotik_hap-ac2 \
mikrotik_sxtsq-5-ac \
mobipromo_cm520-79f \
nec_wg2600hp3 \
plasmacloud_pa1200 \
plasmacloud_pa2200 \
qxwlan_e2600ac \
cig_wf610d \
wallys_dr40x9 \
tp-link_ec420-g1 \
udaya-a5-id2 \
hfcl_ion4
ALLWIFIPACKAGES:=$(foreach BOARD,$(ALLWIFIBOARDS),ipq-wifi-$(BOARD))
define Package/ipq-wifi-default
SUBMENU:=ath10k Board-Specific Overrides
SECTION:=firmware
CATEGORY:=Firmware
DEPENDS:=@(TARGET_ipq40xx||TARGET_ipq806x)
TITLE:=Custom Board
endef
define ipq-wifi-install-one-to
$(INSTALL_DIR) $(2)/lib/firmware/ath10k/$(3)/
$(INSTALL_DATA) $(1) $(2)/lib/firmware/ath10k/$(3)/board-2.bin
endef
define ipq-wifi-install-one
$(if $(filter $(suffix $(1)),.QCA4019 .qca4019),\
$(call ipq-wifi-install-one-to,$(1),$(2),QCA4019/hw1.0),\
$(if $(filter $(suffix $(1)),.QCA9888 .qca9888),\
$(call ipq-wifi-install-one-to,$(1),$(2),QCA9888/hw2.0),\
$(if $(filter $(suffix $(1)),.QCA9984 .qca9984),\
$(call ipq-wifi-install-one-to,$(1),$(2),QCA9984/hw1.0),\
$(error Unrecognized board-file suffix '$(suffix $(1))' for '$(1)')\
)))
endef
# Blank line required at end of above define due to foreach context
define generate-ipq-wifi-package
define Package/ipq-wifi-$(1)
$(call Package/ipq-wifi-default)
TITLE:=board-2.bin Overrides for $(2)
CONFLICTS:=$(PREV_BOARD)
endef
define Package/ipq-wifi-$(1)/description
The $(2) requires board-specific, reference ("cal") data
that is not yet present in the upstream wireless firmware distribution.
This package supplies board-2.bin file(s) that, in the interim,
overwrite those supplied by the ath10k-firmware-* packages.
This is package is only necessary for the $(2).
Do not install it for any other device!
endef
define Package/ipq-wifi-$(1)/install-overlay
$$$$(foreach IPQ_WIFI_BOARD_FILE,$$$$(wildcard board-$(1).*),\
$$$$(call ipq-wifi-install-one,$$$$(IPQ_WIFI_BOARD_FILE),$$(1)))
endef
PREV_BOARD+=ipq-wifi-$(1)
endef
# Add board name to ALLWIFIBOARDS
# Place files in this directory as board-<devicename>.<qca4019|qca9888|qca9984>
# Add $(eval $(call generate-ipq-wifi-package,<devicename>,<display name>))
$(eval $(call generate-ipq-wifi-package,8dev_habanero-dvk,8devices Habanero DVK))
$(eval $(call generate-ipq-wifi-package,aruba_ap-303,Aruba AP-303))
$(eval $(call generate-ipq-wifi-package,avm_fritzrepeater-1200,AVM FRITZRepeater 1200))
$(eval $(call generate-ipq-wifi-package,buffalo_wtr-m2133hp,Buffalo WTR-M2133HP))
$(eval $(call generate-ipq-wifi-package,cellc_rtl30vw, Cell C RTL30VW))
$(eval $(call generate-ipq-wifi-package,devolo_magic-2-wifi-next,devolo Magic 2 WiFi next))
$(eval $(call generate-ipq-wifi-package,dlink_dap2610,D-Link DAP-2610))
$(eval $(call generate-ipq-wifi-package,edgecore_ecw5410,Edgecore ECW5410))
$(eval $(call generate-ipq-wifi-package,edgecore_ssw2ac2600,Edgecore SSW2AC2600))
$(eval $(call generate-ipq-wifi-package,edgecore_oap100,Edgecore OAP100))
$(eval $(call generate-ipq-wifi-package,engenius_eap2200,EnGenius EAP2200))
$(eval $(call generate-ipq-wifi-package,engenius_emd1,EnGenius EMD1))
$(eval $(call generate-ipq-wifi-package,engenius_emr3500,EnGenius EMR3500))
$(eval $(call generate-ipq-wifi-package,ezviz_cs-w3-wd1200g-eup,EZVIZ CS-W3-WD1200G EUP))
$(eval $(call generate-ipq-wifi-package,glinet_gl-ap1300,GL.iNet GL-AP1300))
$(eval $(call generate-ipq-wifi-package,glinet_gl-s1300,GL.iNet GL-S1300))
$(eval $(call generate-ipq-wifi-package,linksys_ea8300,Linksys EA8300))
$(eval $(call generate-ipq-wifi-package,linksys_mr8300-v0,Linksys MR8300))
$(eval $(call generate-ipq-wifi-package,luma_wrtq-329acn,Luma WRTQ-329ACN))
$(eval $(call generate-ipq-wifi-package,mikrotik_hap-ac2,Mikrotik hAP ac2))
$(eval $(call generate-ipq-wifi-package,mikrotik_sxtsq-5-ac,MikroTik SXTsq 5 ac))
$(eval $(call generate-ipq-wifi-package,mobipromo_cm520-79f,MobiPromo CM520-79F))
$(eval $(call generate-ipq-wifi-package,nec_wg2600hp3,NEC Platforms WG2600HP3))
$(eval $(call generate-ipq-wifi-package,plasmacloud_pa1200,Plasma Cloud PA1200))
$(eval $(call generate-ipq-wifi-package,plasmacloud_pa2200,Plasma Cloud PA2200))
$(eval $(call generate-ipq-wifi-package,qxwlan_e2600ac,Qxwlan E2600AC))
$(eval $(call generate-ipq-wifi-package,cig_wf610d,CIG WF_610D))
$(eval $(call generate-ipq-wifi-package,tp-link_ec420-g1,tp-link EC420-G1))
$(eval $(call generate-ipq-wifi-package,wallys_dr40x9,Wallys DR40X9))
$(eval $(call generate-ipq-wifi-package,hfcl_ion4,HFCL ION4))
$(eval $(call generate-ipq-wifi-package,udaya-a5-id2,udaya A5 ID2))
$(foreach PACKAGE,$(ALLWIFIPACKAGES),$(eval $(call BuildPackage,$(PACKAGE))))

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,25 @@
include $(TOPDIR)/rules.mk
ARCH:=arm
BOARD:=ipq40xx
BOARDNAME:=Qualcomm Atheros IPQ40XX
FEATURES:=squashfs fpu ramdisk nand
CPU_TYPE:=cortex-a7
CPU_SUBTYPE:=neon-vfpv4
SUBTARGETS:=generic mikrotik
KERNEL_PATCHVER:=5.4
KERNEL_TESTING_PATCHVER:=5.4
DEVICE_TYPE:=qsdk
KERNELNAME:=zImage Image dtbs
include $(INCLUDE_DIR)/target.mk
DEFAULT_PACKAGES += \
kmod-usb-dwc3-qcom \
kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
kmod-ath10k-ct wpad-basic-wolfssl \
kmod-usb3 kmod-usb-dwc3 ath10k-firmware-qca4019-ct \
uboot-envtools
$(eval $(call BuildTarget))

View File

@@ -0,0 +1,91 @@
#!/bin/sh
#
# Copyright (C) 2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
alfa-network,ap120c-ac)
ucidef_set_led_netdev "wan" "WAN" "amber:wan" "eth1"
;;
asus,rt-ac58u)
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
ucidef_set_led_switch "lan" "LAN" "blue:lan" "switch0" "0x1e"
;;
avm,fritzbox-4040)
ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt" "phy1tpt"
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
ucidef_set_led_switch "lan" "LAN" "green:lan" "switch0" "0x1e"
;;
avm,fritzbox-7530 |\
glinet,gl-b1300)
ucidef_set_led_wlan "wlan" "WLAN" "green:wlan" "phy0tpt"
;;
edgecore,oap100 |\
edgecore,oap100e)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "blue:wlan5g" "phy1tpt"
;;
engenius,eap1300)
ucidef_set_led_netdev "lan" "LAN" "blue:lan" "eth0"
ucidef_set_led_wlan "wlan2g" "WLAN2G" "blue:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "yellow:wlan5g" "phy1tpt"
ucidef_set_led_default "mesh" "MESH" "blue:mesh" "0"
;;
engenius,eap2200)
ucidef_set_led_netdev "lan1" "LAN1" "blue:lan1" "eth0"
ucidef_set_led_netdev "lan2" "LAN2" "blue:lan2" "eth1"
;;
engenius,ens620ext)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt"
ucidef_set_led_netdev "lan1" "LAN1" "green:lan1" "eth0"
ucidef_set_led_netdev "lan2" "LAN2" "green:lan2" "eth1"
;;
mikrotik,sxtsq-5-ac)
ucidef_set_rssimon "wlan0" "200000" "1"
ucidef_set_led_rssi "rssilow" "rssilow" "green:rssilow" "wlan0" "1" "100"
ucidef_set_led_rssi "rssimediumlow" "rssimediumlow" "green:rssimediumlow" "wlan0" "21" "100"
ucidef_set_led_rssi "rssimedium" "rssimedium" "green:rssimedium" "wlan0" "41" "100"
ucidef_set_led_rssi "rssimediumhigh" "rssimediumhigh" "green:rssimediumhigh" "wlan0" "61" "100"
ucidef_set_led_rssi "rssihigh" "rssihigh" "green:rssihigh" "wlan0" "81" "100"
;;
mobipromo,cm520-79f)
ucidef_set_led_netdev "wan" "WAN" "blue:wan" "eth1"
ucidef_set_led_switch "lan1" "LAN1" "blue:lan1" "switch0" "0x10"
ucidef_set_led_switch "lan2" "LAN2" "blue:lan2" "switch0" "0x08"
;;
netgear,ex6100v2 |\
netgear,ex6150v2)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:router" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:client" "phy1tpt"
;;
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2)
ucidef_set_led_wlan "wlan2g" "WLAN0" "green:wlan0" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN1" "green:wlan1" "phy1tpt"
;;
edgecore,ecw5211 |\
edgecore,spw2ac1200 |\
edgecore,spw2ac1200-lan-poe |\
cig,wf610d |\
zyxel,nbg6617 |\
zyxel,wre6606)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "green:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "green:wlan5g" "phy1tpt"
;;
hfcl,ion4)
ucidef_set_led_wlan "wlan2g" "WLAN2G" "yellow:wlan2g" "phy0tpt"
ucidef_set_led_wlan "wlan5g" "WLAN5G" "red:wlan5g" "phy1tpt"
;;
esac
board_config_flush
exit 0

View File

@@ -0,0 +1,211 @@
#!/bin/sh
#
# Copyright (c) 2015 The Linux Foundation. All rights reserved.
# Copyright (c) 2011-2015 OpenWrt.org
#
. /lib/functions/uci-defaults.sh
. /lib/functions/system.sh
ipq40xx_setup_interfaces()
{
local board="$1"
case "$board" in
8dev,habanero-dvk|\
8dev,jalapeno|\
alfa-network,ap120c-ac|\
edgecore,spw2ac1200-lan-poe |\
engenius,emr3500|\
engenius,ens620ext|\
luma,wrtq-329acn|\
plasmacloud,pa1200|\
plasmacloud,pa2200|\
wallys,dr40x9)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
;;
aruba,ap-303|\
aruba,ap-365|\
avm,fritzrepeater-1200|\
dlink,dap-2610 |\
engenius,eap1300|\
engenius,emd1|\
meraki,mr33|\
mikrotik,sxtsq-5-ac|\
netgear,ex6100v2|\
netgear,ex6150v2|\
tp-link,ec420-g1|\
hfcl,ion4|\
zyxel,wre6606)
ucidef_set_interface_wan "eth0"
;;
aruba,ap-303h)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "2:lan:1" "3:lan:2" "4:lan:3" "0u@eth1" "5:wan"
;;
asus,map-ac2200|\
cilab,meshpoint-one|\
cig,wf610d|\
edgecore,ecw5211|\
edgecore,spw2ac1200 |\
edgecore,oap100|\
edgecore,oap100e|\
udaya,a5-id2|\
openmesh,a42|\
openmesh,a62)
ucidef_set_interfaces_lan_wan "eth1" "eth0"
;;
asus,rt-ac58u|\
mikrotik,hap-ac2|\
zyxel,nbg6617)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan:4" "2:lan:3" "3:lan:2" "4:lan:1"
;;
avm,fritzbox-4040|\
linksys,ea6350v3|\
linksys,ea8300|\
linksys,mr8300)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
;;
avm,fritzbox-7530)
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan"
;;
avm,fritzrepeater-3000)
ucidef_add_switch "switch0" \
"0u@eth0" "4:lan:1" "5:lan:2"
;;
compex,wpj419|\
compex,wpj428|\
engenius,eap2200)
ucidef_set_interface_lan "eth0 eth1"
;;
buffalo,wtr-m2133hp)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1"
;;
cellc,rtl30vw)
ucidef_set_interface_lan "eth0"
ucidef_add_switch "switch0" \
"0u@eth0" "3:lan" "4:lan"
;;
devolo,magic-2-wifi-next)
ucidef_set_interface_lan "eth0 eth1 eth2"
;;
ezviz,cs-w3-wd1200g-eup)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "2:lan:3" "3:lan:2" "4:lan:1" "0u@eth1" "5:wan"
;;
glinet,gl-ap1300 |\
glinet,gl-b1300 |\
glinet,gl-s1300)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "3:lan" "4:lan"
;;
mobipromo,cm520-79f)
ucidef_add_switch "switch0" \
"0u@eth0" "3:lan:2" "4:lan:1"
ucidef_set_interface_wan "eth1"
;;
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "3:lan" "4:lan" "0u@eth1" "5:wan"
;;
unielec,u4019-32m)
ucidef_set_interfaces_lan_wan "eth0" "eth1"
ucidef_add_switch "switch0" \
"0u@eth0" "1:lan" "2:lan" "3:lan" "4:lan" "0u@eth1" "5:wan"
;;
um-325ac |\
um-510ac-v3 |\
um-550ac)
ucidef_set_interface_wan "eth0"
ucidef_set_interface_lan "eth1"
;;
*)
echo "Unsupported hardware. Network interfaces not initialized"
;;
esac
}
ipq40xx_setup_macs()
{
local board="$1"
local lan_mac=""
local wan_mac=""
local label_mac=""
case "$board" in
8dev,habanero-dvk)
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;;
asus,rt-ac58u)
CI_UBIPART=UBI_DEV
wan_mac=$(mtd_get_mac_binary_ubi Factory 0x1006)
lan_mac=$(mtd_get_mac_binary_ubi Factory 0x5006)
label_mac=$wan_mac
;;
cilab,meshpoint-one)
label_mac=$(mtd_get_mac_binary "ART" 0x1006)
;;
devolo,magic-2-wifi-next)
lan_mac=$(mtd_get_mac_ascii APPSBLENV MacAddress0)
label_mac=$lan_mac
;;
dlink,dap-2610)
lan_mac=$(mtd_get_mac_ascii bdcfg lanmac)
label_mac=$lan_mac
;;
engenius,eap2200|\
engenius,emd1)
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
label_mac=$lan_mac
;;
engenius,emr3500)
wan_mac=$(mtd_get_mac_ascii 0:APPSBLENV wanaddr)
lan_mac=$(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
label_mac=$wan_mac
;;
engenius,ens620ext)
wan_mac=$(mtd_get_mac_ascii u-boot-env ethaddr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
ezviz,cs-w3-wd1200g-eup)
label_mac=$(mtd_get_mac_binary "ART" 0x6)
;;
linksys,ea6350v3)
wan_mac=$(mtd_get_mac_ascii devinfo hw_mac_addr)
lan_mac=$(macaddr_add "$wan_mac" 1)
;;
mikrotik,hap-ac2)
wan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
lan_mac=$(macaddr_add $wan_mac 1)
label_mac="$wan_mac"
;;
mikrotik,sxtsq-5-ac)
lan_mac=$(cat /sys/firmware/mikrotik/hard_config/mac_base)
label_mac="$lan_mac"
;;
esac
[ -n "$lan_mac" ] && ucidef_set_interface_macaddr "lan" $lan_mac
[ -n "$wan_mac" ] && ucidef_set_interface_macaddr "wan" $wan_mac
[ -n "$label_mac" ] && ucidef_set_label_macaddr $label_mac
}
board_config_update
board=$(board_name)
ipq40xx_setup_interfaces $board
ipq40xx_setup_macs $board
board_config_flush
exit 0

View File

@@ -0,0 +1,29 @@
#!/bin/sh
. /lib/functions/uci-defaults.sh
board_config_update
board=$(board_name)
case "$board" in
cellc,rtl30vw)
ucidef_add_gpio_switch "w_disable" "W_DISABLE mPCIE pin" "398" "1"
ucidef_add_gpio_switch "pmd_resin_n" "PMD_RESIN_N pin" "399" "1"
ucidef_add_gpio_switch "mcpie_vcc" "LTE power" "400" "0"
ucidef_add_gpio_switch "usb_vcc" "USB power" "401" "0"
;;
cilab,meshpoint-one)
ucidef_add_gpio_switch "poe_passtrough" "POE passtrough enable" "413" "1"
;;
compex,wpj428)
ucidef_add_gpio_switch "sim_card_select" "SIM card select" "3" "0"
;;
wallys,dr40x9)
ucidef_add_gpio_switch "sim_card_select" "SIM card select" "423" "0"
;;
esac
board_config_flush
exit 0

View File

@@ -0,0 +1,315 @@
#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
. /lib/functions/caldata.sh
board=$(board_name)
case "$FIRMWARE" in
"ath10k/cal-pci-0000:01:00.0.bin")
case "$board" in
meraki,mr33)
caldata_extract_ubi "ART" 0x9000 0x844
caldata_valid "4408" || caldata_extract "ART" 0x9000 0x844
ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +1)
;;
esac
;;
"ath10k/pre-cal-pci-0000:01:00.0.bin")
case "$board" in
asus,map-ac2200)
caldata_extract_ubi "Factory" 0x9000 0x2f20
ln -sf /lib/firmware/ath10k/pre-cal-pci-0000\:00\:00.0.bin \
/lib/firmware/ath10k/QCA9888/hw2.0/board.bin
;;
avm,fritzrepeater-3000)
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x212 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
buffalo,wtr-m2133hp)
caldata_extract "ART" 0x9000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x32)
;;
engenius,eap2200 |\
openmesh,a62 |\
plasmacloud,pa2200)
caldata_extract "0:ART" 0x9000 0x2f20
;;
linksys,ea8300 |\
linksys,mr8300)
caldata_extract "ART" 0x9000 0x2f20
# OEM assigns 4 sequential MACs
ath10k_patch_mac $(macaddr_setbit_la $(macaddr_add "$(cat /sys/class/net/eth0/address)" 4))
;;
tp-link,ec420-g1)
caldata_extract "0:ART" 0x9000 0x2f20
;;
esac
;;
"ath10k/pre-cal-ahb-a000000.wifi.bin")
case "$board" in
8dev,habanero-dvk |\
8dev,jalapeno |\
alfa-network,ap120c-ac |\
cilab,meshpoint-one |\
ezviz,cs-w3-wd1200g-eup |\
glinet,gl-ap1300 |\
glinet,gl-b1300 |\
glinet,gl-s1300 |\
linksys,ea6350v3 |\
mobipromo,cm520-79f |\
udaya,a5-id2 |\
qcom,ap-dk01.1-c1)
caldata_extract "ART" 0x1000 0x2f20
;;
aruba,ap-303 |\
aruba,ap-303h |\
aruba,ap-365)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary mfginfo 0x1D)
;;
asus,map-ac2200)
caldata_extract_ubi "Factory" 0x1000 0x2f20
;;
asus,rt-ac58u)
CI_UBIPART=UBI_DEV
caldata_extract_ubi "Factory" 0x1000 0x2f20
;;
avm,fritzbox-4040)
/usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config")
;;
avm,fritzbox-7530 |\
avm,fritzrepeater-1200 |\
avm,fritzrepeater-3000)
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x207 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
buffalo,wtr-m2133hp)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x26)
;;
cig,wf610d)
caldata_extract "0:ART" 0x1000 0x2f20
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +2)
;;
cellc,rtl30vw |\
compex,wpj419 |\
compex,wpj428 |\
edgecore,ecw5211 |\
edgecore,spw2ac1200 |\
edgecore,spw2ac1200-lan-poe |\
edgecore,oap100 |\
edgecore,oap100e |\
engenius,eap1300 |\
engenius,eap2200 |\
luma,wrtq-329acn|\
openmesh,a42 |\
openmesh,a62 |\
plasmacloud,pa1200 |\
plasmacloud,pa2200 |\
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2 |\
unielec,u4019-32m |\
wallys,dr40x9)
caldata_extract "0:ART" 0x1000 0x2f20
;;
devolo,magic-2-wifi-next)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress0)
;;
dlink,dap-2610)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac)
;;
engenius,emd1)
caldata_extract "0:ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr)
;;
engenius,emr3500)
caldata_extract "0:ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii 0:APPSBLENV ethaddr)
;;
engenius,ens620ext)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +2)
;;
linksys,ea8300 |\
linksys,mr8300)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 2)
;;
meraki,mr33)
caldata_extract_ubi "ART" 0x1000 0x2f20
caldata_valid "202f" || caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +2)
;;
mikrotik,hap-ac2)
wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x0 0x2f20 ) || \
( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_0" 0x0 0x2f20 )
;;
netgear,ex6100v2 |\
netgear,ex6150v2)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary dnidata 0x0)
;;
zyxel,nbg6617 |\
zyxel,wre6606)
caldata_extract "ART" 0x1000 0x2f20
ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -2)
;;
tp-link,ec420-g1)
caldata_extract "0:ART" 0x1000 0x2f20
;;
hfcl,ion4)
caldata_extract "0:ART" 4096 12064
ath10k_patch_mac $(mtd_get_mac_ascii 0:ART WLAN0_BASEMAC)
;;
um-325ac |\
um-510ac-v3 |\
um-550ac)
caldata_extract "ART" 0x1000 0x2f20
;;
esac
;;
"ath10k/pre-cal-ahb-a800000.wifi.bin")
case "$board" in
8dev,habanero-dvk |\
8dev,jalapeno |\
alfa-network,ap120c-ac |\
cilab,meshpoint-one |\
ezviz,cs-w3-wd1200g-eup |\
glinet,gl-ap1300 |\
glinet,gl-b1300 |\
glinet,gl-s1300 |\
linksys,ea6350v3 |\
mobipromo,cm520-79f |\
udaya,a5-id2 |\
qcom,ap-dk01.1-c1)
caldata_extract "ART" 0x5000 0x2f20
;;
aruba,ap-303 |\
aruba,ap-303h |\
aruba,ap-365)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_binary mfginfo 0x1D) +1)
;;
asus,map-ac2200)
caldata_extract_ubi "Factory" 0x5000 0x2f20
;;
asus,rt-ac58u)
CI_UBIPART=UBI_DEV
caldata_extract_ubi "Factory" 0x5000 0x2f20
;;
avm,fritzbox-4040)
/usr/bin/fritz_cal_extract -i 1 -s 0x400 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader_config")
;;
avm,fritzbox-7530 |\
avm,fritzrepeater-1200 |\
avm,fritzrepeater-3000)
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader0") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C800 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3D000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1") || \
/usr/bin/fritz_cal_extract -i 1 -s 0x3C000 -e 0x208 -l 12064 -o /lib/firmware/$FIRMWARE $(find_mtd_chardev "urlader1")
;;
buffalo,wtr-m2133hp)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary ORGDATA 0x2c)
;;
cig,wf610d)
caldata_extract "0:ART" 0x5000 0x2f20
ath10kcal_patch_mac_crc $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +3)
;;
cellc,rtl30vw |\
compex,wpj419 |\
compex,wpj428 |\
edgecore,ecw5211 |\
edgecore,spw2ac1200 |\
edgecore,spw2ac1200-lan-poe |\
edgecore,oap100 |\
edgecore,oap100e |\
engenius,eap1300 |\
engenius,eap2200 |\
luma,wrtq-329acn|\
openmesh,a42 |\
openmesh,a62 |\
plasmacloud,pa1200 |\
plasmacloud,pa2200 |\
qxwlan,e2600ac-c1 |\
qxwlan,e2600ac-c2 |\
unielec,u4019-32m |\
wallys,dr40x9)
caldata_extract "0:ART" 0x5000 0x2f20
;;
devolo,magic-2-wifi-next)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii APPSBLENV WiFiMacAddress1)
;;
dlink,dap-2610)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_ascii bdcfg wlanmac_a)
;;
engenius,emd1)
caldata_extract "0:ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV wlanaddr) +1)
;;
engenius,emr3500)
caldata_extract "0:ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii 0:APPSBLENV ethaddr) +1)
;;
engenius,ens620ext)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(mtd_get_mac_ascii u-boot-env ethaddr) +3)
;;
linksys,ea8300 |\
linksys,mr8300)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add "$(cat /sys/class/net/eth0/address)" 3)
;;
meraki,mr33)
caldata_extract_ubi "ART" 0x5000 0x2f20
caldata_valid "202f" || caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(get_mac_binary "/sys/bus/i2c/devices/0-0050/eeprom" 0x66) +3)
;;
mikrotik,hap-ac2|\
mikrotik,sxtsq-5-ac)
wlan_data="/sys/firmware/mikrotik/hard_config/wlan_data"
( [ -f "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data" 0x8000 0x2f20 ) || \
( [ -d "$wlan_data" ] && caldata_sysfsload_from_file "$wlan_data/data_2" 0x0 0x2f20 )
;;
netgear,ex6100v2 |\
netgear,ex6150v2)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(mtd_get_mac_binary dnidata 0xc)
;;
zyxel,nbg6617 |\
zyxel,wre6606)
caldata_extract "ART" 0x5000 0x2f20
ath10k_patch_mac $(macaddr_add $(cat /sys/class/net/eth0/address) -1)
;;
hfcl,ion4)
caldata_extract "0:ART" 20480 12064
ath10k_patch_mac $(mtd_get_mac_ascii 0:ART WLAN1_BASEMAC)
;;
um-325ac |\
um-510ac-v3 |\
um-550ac)
caldata_extract "ART" 0x5000 0x2f20
;;
esac
;;
*)
exit 1
;;
esac

View File

@@ -0,0 +1,32 @@
#!/bin/sh
[ -e /lib/firmware/$FIRMWARE ] && exit 0
fwcfg_symlink() {
local chip=$1
local path=$2
ln -s /lib/firmware/ath10k/fwcfg-${chip}.txt /lib/firmware/${FIRMWARE}
}
case "$FIRMWARE" in
ath10k/fwcfg-ahb-a000000.wifi.txt|\
ath10k/fwcfg-ahb-a800000.wifi.txt)
fwcfg_symlink ipq4019
;;
ath10k/fwcfg-pci-0000:01:00.0.txt)
case "$(board_name)" in
linksys,ea8300)
fwcfg_symlink qca9888
;;
tp-link,ap2220|\
tp-link,ec420-g1)
fwcfg_symlink qca9984
;;
esac
;;
esac
exit 0

View File

@@ -0,0 +1,67 @@
#!/bin/sh
[ "$ACTION" = add ] || exit
NPROCS="$(grep -c "^processor.*:" /proc/cpuinfo)"
[ "$NPROCS" -gt 1 ] || exit
PROC_MASK="$(( (1 << $NPROCS) - 1 ))"
find_irq_cpu() {
local dev="$1"
local match="$(grep -m 1 "$dev\$" /proc/interrupts)"
local cpu=0
[ -n "$match" ] && {
set -- $match
shift
for cur in `seq 1 $NPROCS`; do
[ "$1" -gt 0 ] && {
cpu=$(($cur - 1))
break
}
shift
done
}
echo "$cpu"
}
set_hex_val() {
local file="$1"
local val="$2"
val="$(printf %x "$val")"
[ -n "$DEBUG" ] && echo "$file = $val"
echo "$val" > "$file"
}
default_ps="$(uci get "network.@globals[0].default_ps")"
[ -n "$default_ps" -a "$default_ps" != 1 ] && exit 0
exec 512>/var/lock/smp_tune.lock
flock 512 || exit 1
for dev in /sys/class/net/*; do
[ -d "$dev" ] || continue
# ignore virtual interfaces
[ -n "$(ls "${dev}/" | grep '^lower_')" ] && continue
[ -d "${dev}/device" ] || continue
device="$(readlink "${dev}/device")"
device="$(basename "$device")"
irq_cpu="$(find_irq_cpu "$device")"
irq_cpu_mask="$((1 << $irq_cpu))"
for q in ${dev}/queues/rx-*; do
set_hex_val "$q/rps_cpus" "$(($PROC_MASK & ~$irq_cpu_mask))"
done
ntxq="$(ls -d ${dev}/queues/tx-* | wc -l)"
idx=$(($irq_cpu + 1))
for q in ${dev}/queues/tx-*; do
set_hex_val "$q/xps_cpus" "$((1 << $idx))"
let "idx = idx + 1"
[ "$idx" -ge "$NPROCS" ] && idx=0
done
done

View File

@@ -0,0 +1,36 @@
#!/bin/sh /etc/rc.common
START=99
boot() {
case $(board_name) in
alfa-network,ap120c-ac)
[ -n "$(fw_printenv bootcount changed 2>/dev/null)" ] &&\
echo -e "bootcount\nchanged\n" | /usr/sbin/fw_setenv -s -
;;
linksys,ea6350v3|\
linksys,ea8300|\
linksys,mr8300)
mtd resetbc s_env || true
;;
edgecore,ecw5211)
part="$(awk -F 'ubi.mtd=' '{printf $2}' /proc/cmdline | cut -d " " -f1)"
case "$part" in
rootfs1|\
rootfs2)
avail=$(fw_printenv -n upgrade_available)
[ ${avail} -ne 1 ] && fw_setenv upgrade_available 1
fw_setenv bootcount 0
;;
esac
;;
edgecore,spw2ac1200|\
edgecore,spw2ac1200-lan-poe)
avail=$(fw_printenv -n upgrade_available)
[ ${avail} -eq 0 ] || {
fw_setenv upgrade_available 0
fw_setenv bootcount 0
}
;;
esac
}

View File

@@ -0,0 +1,5 @@
# Copyright (c) 2013 The Linux Foundation. All rights reserved.
::sysinit:/etc/init.d/rcS S boot
::shutdown:/etc/init.d/rcS K shutdown
ttyMSM0::askfirst:/usr/libexec/login.sh
ttyMSM1::askfirst:/usr/libexec/login.sh

View File

@@ -0,0 +1,19 @@
. /lib/functions/migrations.sh
board=$(board_name)
case "$board" in
engenius,emr3500)
migrate_leds "emr3500:="
;;
engenius,ens620ext|\
zyxel,nbg6617)
migrate_leds ":wlan2G=:wlan2g" ":wlan5G=:wlan5g"
;;
esac
remove_devicename_leds
migrations_apply system
exit 0

View File

@@ -0,0 +1,15 @@
vdevs = 8
peers = 147
active_peers = 147
stations = 147
rate_ctrl_objs = 7
#regdom = 840
#fwname = firmware-5-htt-mgt-b.bin
#fwver = 5
nohwcrypt = 0
ct_sta_mode = 0
tx_desc = 2000
#max_nss = 3
tids = 450
skid_limit = 360
max_amsdus = 3

Some files were not shown because too many files have changed in this diff Show More