mirror of
https://github.com/Telecominfraproject/wlan-ap.git
synced 2025-10-29 17:42:41 +00:00
Compare commits
78 Commits
release/v2
...
release/v2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d9d4ab47a | ||
|
|
0406b7cb95 | ||
|
|
211e9c39e9 | ||
|
|
64009d7d2a | ||
|
|
70e922f609 | ||
|
|
b41b53b9d8 | ||
|
|
92d03f5283 | ||
|
|
8529d7471a | ||
|
|
02c0af4bb4 | ||
|
|
8c987c4949 | ||
|
|
a686beebbb | ||
|
|
ec8d056cc8 | ||
|
|
1d4b8ab7ff | ||
|
|
f87960eadc | ||
|
|
769e8c5c0b | ||
|
|
04c3325710 | ||
|
|
7c1fd79ceb | ||
|
|
1e950be127 | ||
|
|
5fc7ac166a | ||
|
|
87be030169 | ||
|
|
b0688f097b | ||
|
|
ae77be4e5c | ||
|
|
efac512c90 | ||
|
|
bcde3ee6d7 | ||
|
|
7b0ef7f265 | ||
|
|
670f9fee14 | ||
|
|
4c7ee4bf6d | ||
|
|
90868338c7 | ||
|
|
7a20f558e1 | ||
|
|
9b8c1f8449 | ||
|
|
002880c3fa | ||
|
|
3de5c91e6c | ||
|
|
679e20af39 | ||
|
|
191081e46f | ||
|
|
8f7a66f1ac | ||
|
|
c93b14ca7a | ||
|
|
16176a1cc3 | ||
|
|
a4806f740d | ||
|
|
35740f321d | ||
|
|
74c148e905 | ||
|
|
a77d881147 | ||
|
|
065539bbb3 | ||
|
|
e2d90a7b06 | ||
|
|
8bb9816e2b | ||
|
|
9673329c07 | ||
|
|
2571ae5210 | ||
|
|
8caffe46b4 | ||
|
|
25641d5199 | ||
|
|
2b3cc2a5cf | ||
|
|
12cc29265c | ||
|
|
34a6f06bd9 | ||
|
|
c343d5e629 | ||
|
|
501907eeda | ||
|
|
ba406fe01b | ||
|
|
d61d5cd35e | ||
|
|
68d544c9af | ||
|
|
5d86871253 | ||
|
|
460785cbe3 | ||
|
|
1cace058c5 | ||
|
|
5aaf734732 | ||
|
|
9d3768a68d | ||
|
|
975aae507b | ||
|
|
cc0576886a | ||
|
|
9c36b155f6 | ||
|
|
28ac14ccc4 | ||
|
|
e18e7fc8f6 | ||
|
|
04d78d3334 | ||
|
|
a9fd11ed8a | ||
|
|
839f43c010 | ||
|
|
f599a42618 | ||
|
|
8bc7bee3bc | ||
|
|
53004cc39c | ||
|
|
9a1c8cff9f | ||
|
|
2d0e2bccbf | ||
|
|
70c2c36e0f | ||
|
|
11ed0b089c | ||
|
|
29058df59b | ||
|
|
e840bab8cc |
2
.github/workflows/build-dev.yml
vendored
2
.github/workflows/build-dev.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target: ['cig_wf188n', 'cig_wf194c', 'cig_wf194c4', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', 'edgecore_ecs4100-12ph', 'edgecore_ecw5211', 'edgecore_ecw5410', 'edgecore_oap100', 'edgecore_ssw2ac2600', 'edgecore_spw2ac1200', 'edgecore_spw2ac1200-lan-poe', 'hfcl_ion4.yml', 'indio_um-305ac', 'linksys_ea6350-v4', 'linksys_e8450-ubi', 'linksys_ea8300', 'tp-link_ec420-g1', 'tplink_ex227', 'tplink_ex228', 'tplink_ex447', 'wallys_dr40x9' ]
|
||||
target: ['cig_wf188n', 'cig_wf194c', 'cig_wf194c4', 'cig_wf160d', 'edgecore_eap101', 'edgecore_eap102', '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', 'linksys_ea6350-v4', 'linksys_e8450-ubi', 'linksys_ea8300', 'tp-link_ec420-g1', 'tplink_ex227', 'tplink_ex228', 'tplink_ex447', 'wallys_dr40x9', 'wallys_dr6018', 'wallys_dr6018_v4' ]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 2af08d2e85ee946de5f53bbd0ddf239de9b78f6d Mon Sep 17 00:00:00 2001
|
||||
From bb797fc82f8ade2a1c0b7a68dd7c920eae2f531f Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Tue, 18 May 2021 10:46:43 +0200
|
||||
Subject: [PATCH 12/27] libubox: update to latest HEAD
|
||||
Subject: [PATCH 01/74] libubox: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
@@ -9,7 +9,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile
|
||||
index d2c07783e1..33aa73eef7 100644
|
||||
index d2c07783e1..3b01930d6c 100644
|
||||
--- a/package/libs/libubox/Makefile
|
||||
+++ b/package/libs/libubox/Makefile
|
||||
@@ -5,9 +5,9 @@ PKG_RELEASE=2
|
||||
@@ -19,9 +19,9 @@ index d2c07783e1..33aa73eef7 100644
|
||||
-PKG_MIRROR_HASH:=7dd1db1e0074a9c7c722db654cce3111b3bd3cff0bfd791c4497cb0f6c22d3ca
|
||||
-PKG_SOURCE_DATE:=2021-05-16
|
||||
-PKG_SOURCE_VERSION:=b14c4688612c05c78ce984d7bde633bce8703b1e
|
||||
+PKG_MIRROR_HASH:=1cdb91ac0ee925f133ee9f70eac131a99def312fe7cf0aed44df84eb1762e30b
|
||||
+PKG_MIRROR_HASH:=82d84fb97e725b0a18ceac639cae0c17d922754bb648ff58c62069d92798a6cd
|
||||
+PKG_SOURCE_DATE:=2021-08-19
|
||||
+PKG_SOURCE_VERSION:=d716ac4bc4236031d4c3cc1ed362b502e20e3787
|
||||
+PKG_SOURCE_VERSION:=c86a894ec63d83ecf2c373bbf9dc8fba9713d942
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
From c9e9ca475bc2eb90beb23a2c67c39389f8cb2527 Mon Sep 17 00:00:00 2001
|
||||
From 1496ca5ceb941ba725311c6c0366193092035f32 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Thu, 27 May 2021 13:24:47 +0200
|
||||
Subject: [PATCH 01/58] netifd: update to latest HEAD
|
||||
Subject: [PATCH 01/60] netifd: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/network/config/netifd/Makefile | 8 ++--
|
||||
.../netifd/patches/002-fix-dhcp-issue.patch | 17 +++++++++
|
||||
.../config/netifd/patches/100-script.patch | 21 +++++++++++
|
||||
.../config/netifd/patches/hairpin.patch | 37 +++++++++++++++++++
|
||||
4 files changed, 78 insertions(+), 5 deletions(-)
|
||||
create mode 100644 package/network/config/netifd/patches/002-fix-dhcp-issue.patch
|
||||
3 files changed, 61 insertions(+), 5 deletions(-)
|
||||
create mode 100644 package/network/config/netifd/patches/100-script.patch
|
||||
create mode 100644 package/network/config/netifd/patches/hairpin.patch
|
||||
|
||||
@@ -38,29 +36,6 @@ index 4b5f110da2..d41bddfd56 100644
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
diff --git a/package/network/config/netifd/patches/002-fix-dhcp-issue.patch b/package/network/config/netifd/patches/002-fix-dhcp-issue.patch
|
||||
new file mode 100644
|
||||
index 0000000000..6f1d2e708e
|
||||
--- /dev/null
|
||||
+++ b/package/network/config/netifd/patches/002-fix-dhcp-issue.patch
|
||||
@@ -0,0 +1,17 @@
|
||||
+Index: netifd-2019-08-05-5e02f944/interface.c
|
||||
+===================================================================
|
||||
+--- netifd-2019-08-05-5e02f944.orig/interface.c
|
||||
++++ netifd-2019-08-05-5e02f944/interface.c
|
||||
+@@ -424,7 +424,11 @@ interface_main_dev_cb(struct device_user
|
||||
+ interface_set_link_state(iface, false);
|
||||
+ break;
|
||||
+ case DEV_EVENT_TOPO_CHANGE:
|
||||
+- interface_proto_event(iface->proto, PROTO_CMD_RENEW, false);
|
||||
++ /* This renews the dhcp lease when the bridge adds/deletes a
|
||||
++ * new interface. It causes some dhcp servers to fail in
|
||||
++ * case where there are many interfaces being added to the
|
||||
++ * bridge frequently. Disabling this for now. */
|
||||
++ /* interface_proto_event(iface->proto, PROTO_CMD_RENEW, false); */
|
||||
+ return;
|
||||
+ default:
|
||||
+ break;
|
||||
diff --git a/package/network/config/netifd/patches/100-script.patch b/package/network/config/netifd/patches/100-script.patch
|
||||
new file mode 100644
|
||||
index 0000000000..e7ba83f4bb
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
From 6718e9786f18dd1380e5977d224d13a5ff3df619 Mon Sep 17 00:00:00 2001
|
||||
From 3feca6da7b0571cf17afc9f0e40d0ede9059c271 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Sat, 4 Sep 2021 05:47:27 +0200
|
||||
Subject: [PATCH 02/58] mac80211: update to latest HEAD
|
||||
Subject: [PATCH 01/72] mac80211: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
@@ -9,7 +9,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
package/kernel/mac80211/ath.mk | 5 +-
|
||||
package/kernel/mac80211/broadcom.mk | 4 +-
|
||||
.../mac80211/files/lib/netifd/mac80211.sh | 36 -
|
||||
.../files/lib/netifd/wireless/mac80211.sh | 186 ++-
|
||||
.../files/lib/netifd/wireless/mac80211.sh | 214 ++-
|
||||
.../mac80211/files/lib/wifi/mac80211.sh | 110 +-
|
||||
.../patches/ath/120-owl-loader-compat.patch | 53 -
|
||||
.../patches/ath/402-ath_regd_optional.patch | 2 +-
|
||||
@@ -75,7 +75,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
...eck-per-vif-offload_flags-in-Tx-path.patch | 26 +
|
||||
.../500-mac80211_configure_antenna_gain.patch | 16 +-
|
||||
...the-dst-buffer-to-of_get_mac_address.patch | 237 +++
|
||||
70 files changed, 2752 insertions(+), 1160 deletions(-)
|
||||
70 files changed, 2777 insertions(+), 1163 deletions(-)
|
||||
delete mode 100644 package/kernel/mac80211/files/lib/netifd/mac80211.sh
|
||||
delete mode 100644 package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch
|
||||
rename package/kernel/mac80211/patches/{ath => ath10k}/080-ath10k_thermal_config.patch (97%)
|
||||
@@ -286,7 +286,7 @@ index 92e5c0e395..0000000000
|
||||
- done
|
||||
-}
|
||||
diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
|
||||
index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
index 9a9c35fb5f..97c567031e 100644
|
||||
--- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
|
||||
+++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh
|
||||
@@ -1,7 +1,6 @@
|
||||
@@ -310,7 +310,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
config_add_boolean noscan ht_coex acs_exclude_dfs
|
||||
config_add_array ht_capab
|
||||
config_add_array channels
|
||||
@@ -44,11 +43,24 @@ drv_mac80211_init_device_config() {
|
||||
@@ -44,11 +43,26 @@ drv_mac80211_init_device_config() {
|
||||
su_beamformee \
|
||||
mu_beamformer \
|
||||
mu_beamformee \
|
||||
@@ -326,6 +326,8 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
+ he_spr_sr_control \
|
||||
+ he_twt_required
|
||||
+ config_add_int \
|
||||
+ beamformer_antennas \
|
||||
+ beamformee_antennas \
|
||||
+ vht_max_a_mpdu_len_exp \
|
||||
+ vht_max_mpdu \
|
||||
+ vht_link_adapt \
|
||||
@@ -337,7 +339,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
config_add_boolean \
|
||||
ldpc \
|
||||
greenfield \
|
||||
@@ -96,6 +108,23 @@ mac80211_add_capabilities() {
|
||||
@@ -96,6 +110,23 @@ mac80211_add_capabilities() {
|
||||
export -n -- "$__var=$__out"
|
||||
}
|
||||
|
||||
@@ -361,7 +363,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
mac80211_hostapd_setup_base() {
|
||||
local phy="$1"
|
||||
|
||||
@@ -119,6 +148,9 @@ mac80211_hostapd_setup_base() {
|
||||
@@ -119,6 +150,9 @@ mac80211_hostapd_setup_base() {
|
||||
[ "$noscan" -gt 0 ] && hostapd_noscan=1
|
||||
[ "$tx_burst" = 0 ] && tx_burst=
|
||||
|
||||
@@ -371,7 +373,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
ieee80211n=1
|
||||
ht_capab=
|
||||
case "$htmode" in
|
||||
@@ -126,7 +158,7 @@ mac80211_hostapd_setup_base() {
|
||||
@@ -126,7 +160,7 @@ mac80211_hostapd_setup_base() {
|
||||
HT40*|VHT40|VHT80|VHT160|HE40|HE80|HE160)
|
||||
case "$hwmode" in
|
||||
a)
|
||||
@@ -380,7 +382,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
1) ht_capab="[HT40+]";;
|
||||
0) ht_capab="[HT40-]";;
|
||||
esac
|
||||
@@ -200,7 +232,7 @@ mac80211_hostapd_setup_base() {
|
||||
@@ -200,7 +234,7 @@ mac80211_hostapd_setup_base() {
|
||||
case "$htmode" in
|
||||
VHT20|HE20) enable_ac=1;;
|
||||
VHT40|HE40)
|
||||
@@ -389,7 +391,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
1) idx=$(($channel + 2));;
|
||||
0) idx=$(($channel - 2));;
|
||||
esac
|
||||
@@ -208,7 +240,7 @@ mac80211_hostapd_setup_base() {
|
||||
@@ -208,7 +242,7 @@ mac80211_hostapd_setup_base() {
|
||||
vht_center_seg0=$idx
|
||||
;;
|
||||
VHT80|HE80)
|
||||
@@ -398,7 +400,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
1) idx=$(($channel + 6));;
|
||||
2) idx=$(($channel + 2));;
|
||||
3) idx=$(($channel - 2));;
|
||||
@@ -219,15 +251,35 @@ mac80211_hostapd_setup_base() {
|
||||
@@ -219,15 +253,35 @@ mac80211_hostapd_setup_base() {
|
||||
vht_center_seg0=$idx
|
||||
;;
|
||||
VHT160|HE160)
|
||||
@@ -438,7 +440,35 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
[ "$hwmode" = "a" ] || enable_ac=0
|
||||
|
||||
if [ "$enable_ac" != "0" ]; then
|
||||
@@ -337,16 +389,62 @@ mac80211_hostapd_setup_base() {
|
||||
@@ -242,6 +296,8 @@ mac80211_hostapd_setup_base() {
|
||||
mu_beamformee:1 \
|
||||
vht_txop_ps:1 \
|
||||
htc_vht:1 \
|
||||
+ beamformee_antennas:4 \
|
||||
+ beamformer_antennas:4 \
|
||||
rx_antenna_pattern:1 \
|
||||
tx_antenna_pattern:1 \
|
||||
vht_max_a_mpdu_len_exp:7 \
|
||||
@@ -282,6 +338,18 @@ mac80211_hostapd_setup_base() {
|
||||
RX-STBC-123:0x700:0x300:1 \
|
||||
RX-STBC-1234:0x700:0x400:1 \
|
||||
|
||||
+ [ "$(($vht_cap & 0x800))" -gt 0 -a "$su_beamformer" -gt 0 ] && {
|
||||
+ cap_ant="$(( ( ($vht_cap >> 16) & 3 ) + 1 ))"
|
||||
+ [ "$cap_ant" -gt "$beamformer_antennas" ] && cap_ant="$beamformer_antennas"
|
||||
+ [ "$cap_ant" -gt 1 ] && vht_capab="$vht_capab[SOUNDING-DIMENSION-$cap_ant]"
|
||||
+ }
|
||||
+
|
||||
+ [ "$(($vht_cap & 0x1000))" -gt 0 -a "$su_beamformee" -gt 0 ] && {
|
||||
+ cap_ant="$(( ( ($vht_cap >> 13) & 3 ) + 1 ))"
|
||||
+ [ "$cap_ant" -gt "$beamformee_antennas" ] && cap_ant="$beamformee_antennas"
|
||||
+ [ "$cap_ant" -gt 1 ] && vht_capab="$vht_capab[BF-ANTENNA-$cap_ant]"
|
||||
+ }
|
||||
+
|
||||
# supported Channel widths
|
||||
vht160_hw=0
|
||||
[ "$(($vht_cap & 12))" -eq 4 -a 1 -le "$vht160" ] && \
|
||||
@@ -337,16 +405,62 @@ mac80211_hostapd_setup_base() {
|
||||
esac
|
||||
|
||||
if [ "$enable_ax" != "0" ]; then
|
||||
@@ -504,9 +534,23 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
fi
|
||||
|
||||
hostapd_prepare_device_config "$hostapd_conf_file" nl80211
|
||||
@@ -426,7 +524,11 @@ mac80211_generate_mac() {
|
||||
local oIFS="$IFS"; IFS=":"; set -- $ref; IFS="$oIFS"
|
||||
@@ -401,6 +515,7 @@ mac80211_get_addr() {
|
||||
|
||||
mac80211_generate_mac() {
|
||||
local phy="$1"
|
||||
+ local multiple_bssid="$2"
|
||||
local id="${macidx:-0}"
|
||||
|
||||
local ref="$(cat /sys/class/ieee80211/${phy}/macaddress)"
|
||||
@@ -424,9 +539,16 @@ mac80211_generate_mac() {
|
||||
local mask6=$6
|
||||
|
||||
local oIFS="$IFS"; IFS=":"; set -- $ref; IFS="$oIFS"
|
||||
-
|
||||
+ [ "$multiple_bssid" -eq 1 ] && {
|
||||
+ printf "02:%s:%s:%s:%s:%02x" $b1 $2 $3 $4 $5 $macidx
|
||||
+ return
|
||||
+ }
|
||||
macidx=$(($id + 1))
|
||||
- [ "$((0x$mask1))" -gt 0 ] && {
|
||||
+
|
||||
@@ -517,7 +561,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
b1="0x$1"
|
||||
[ "$id" -gt 0 ] && \
|
||||
b1=$(($b1 ^ ((($id - !($b1 & 2)) << 2)) | 0x2))
|
||||
@@ -434,7 +536,7 @@ mac80211_generate_mac() {
|
||||
@@ -434,7 +556,7 @@ mac80211_generate_mac() {
|
||||
return
|
||||
}
|
||||
|
||||
@@ -526,7 +570,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
printf "%s:%s:%s:%s:%s:%02x" $1 $2 $3 $4 $5 $(( 0x$6 ^ $id ))
|
||||
return
|
||||
}
|
||||
@@ -449,7 +551,7 @@ mac80211_generate_mac() {
|
||||
@@ -449,7 +571,7 @@ mac80211_generate_mac() {
|
||||
find_phy() {
|
||||
[ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0
|
||||
[ -n "$path" ] && {
|
||||
@@ -535,7 +579,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
[ -n "$phy" ] && return 0
|
||||
}
|
||||
[ -n "$macaddr" ] && {
|
||||
@@ -528,7 +630,7 @@ mac80211_iw_interface_add() {
|
||||
@@ -528,11 +650,12 @@ mac80211_iw_interface_add() {
|
||||
rc="$?"
|
||||
}
|
||||
|
||||
@@ -544,7 +588,21 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
return $rc
|
||||
}
|
||||
|
||||
@@ -689,14 +791,8 @@ mac80211_prepare_iw_htmode() {
|
||||
mac80211_prepare_vif() {
|
||||
+ local multiple_bssid=$1
|
||||
json_select config
|
||||
|
||||
json_get_vars ifname mode ssid wds powersave macaddr enable wpa_psk_file vlan_file
|
||||
@@ -546,7 +669,7 @@ mac80211_prepare_vif() {
|
||||
json_select ..
|
||||
|
||||
[ -n "$macaddr" ] || {
|
||||
- macaddr="$(mac80211_generate_mac $phy)"
|
||||
+ macaddr="$(mac80211_generate_mac $phy $multiple_bssid)"
|
||||
macidx="$(($macidx + 1))"
|
||||
}
|
||||
|
||||
@@ -689,14 +812,8 @@ mac80211_prepare_iw_htmode() {
|
||||
case "$htmode" in
|
||||
VHT20|HT20) iw_htmode=HT20;;
|
||||
HT40*|VHT40|VHT160)
|
||||
@@ -561,7 +619,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
case "$htmode" in
|
||||
HT40+) iw_htmode="HT40+";;
|
||||
HT40-) iw_htmode="HT40-";;
|
||||
@@ -709,6 +805,12 @@ mac80211_prepare_iw_htmode() {
|
||||
@@ -709,6 +826,12 @@ mac80211_prepare_iw_htmode() {
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
@@ -574,7 +632,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
esac
|
||||
[ "$auto_channel" -gt 0 ] && iw_htmode="HT40+"
|
||||
;;
|
||||
@@ -818,7 +920,6 @@ mac80211_setup_vif() {
|
||||
@@ -818,7 +941,6 @@ mac80211_setup_vif() {
|
||||
mesh)
|
||||
wireless_vif_parse_encryption
|
||||
[ -z "$htmode" ] && htmode="NOHT";
|
||||
@@ -582,7 +640,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ] || chan_is_dfs "$phy" "$channel"; then
|
||||
mac80211_setup_supplicant $vif_enable || failed=1
|
||||
else
|
||||
@@ -832,7 +933,6 @@ mac80211_setup_vif() {
|
||||
@@ -832,7 +954,6 @@ mac80211_setup_vif() {
|
||||
adhoc)
|
||||
wireless_vif_parse_encryption
|
||||
if [ "$wpa" -gt 0 -o "$auto_channel" -gt 0 ]; then
|
||||
@@ -590,7 +648,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
mac80211_setup_supplicant_noctl $vif_enable || failed=1
|
||||
else
|
||||
mac80211_setup_adhoc $vif_enable
|
||||
@@ -849,10 +949,30 @@ mac80211_setup_vif() {
|
||||
@@ -849,10 +970,30 @@ mac80211_setup_vif() {
|
||||
|
||||
get_freq() {
|
||||
local phy="$1"
|
||||
@@ -623,17 +681,18 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
chan_is_dfs() {
|
||||
local phy="$1"
|
||||
local chan="$2"
|
||||
@@ -896,7 +1016,8 @@ drv_mac80211_setup() {
|
||||
@@ -896,7 +1037,9 @@ drv_mac80211_setup() {
|
||||
country chanbw distance \
|
||||
txpower antenna_gain \
|
||||
rxantenna txantenna \
|
||||
- frag rts beacon_int:100 htmode
|
||||
+ frag rts beacon_int:100 htmode \
|
||||
+ multiple_bssid:0 \
|
||||
+ num_global_macaddr
|
||||
json_get_values basic_rate_list basic_rate
|
||||
json_get_values scan_list scan_list
|
||||
json_select ..
|
||||
@@ -933,7 +1054,7 @@ drv_mac80211_setup() {
|
||||
@@ -933,7 +1076,7 @@ drv_mac80211_setup() {
|
||||
done
|
||||
|
||||
# convert channel to frequency
|
||||
@@ -642,7 +701,7 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
|
||||
[ -n "$country" ] && {
|
||||
iw reg get | grep -q "^country $country:" || {
|
||||
@@ -958,6 +1079,7 @@ drv_mac80211_setup() {
|
||||
@@ -958,6 +1101,7 @@ drv_mac80211_setup() {
|
||||
set_default txantenna 0xffffffff
|
||||
set_default distance 0
|
||||
set_default antenna_gain 0
|
||||
@@ -650,6 +709,15 @@ index 9a9c35fb5f..a25e4ff9b2 100644
|
||||
|
||||
[ "$txantenna" = "all" ] && txantenna=0xffffffff
|
||||
[ "$rxantenna" = "all" ] && rxantenna=0xffffffff
|
||||
@@ -989,7 +1133,7 @@ drv_mac80211_setup() {
|
||||
mac80211_prepare_iw_htmode
|
||||
for_each_interface "sta adhoc mesh monitor" mac80211_prepare_vif
|
||||
NEWAPLIST=
|
||||
- for_each_interface "ap" mac80211_prepare_vif
|
||||
+ for_each_interface "ap" mac80211_prepare_vif ${multiple_bssid}
|
||||
NEW_MD5=$(test -e "${hostapd_conf_file}" && md5sum ${hostapd_conf_file})
|
||||
OLD_MD5=$(uci -q -P /var/state get wireless._${phy}.md5)
|
||||
if [ "${NEWAPLIST}" != "${OLDAPLIST}" ]; then
|
||||
diff --git a/package/kernel/mac80211/files/lib/wifi/mac80211.sh b/package/kernel/mac80211/files/lib/wifi/mac80211.sh
|
||||
index 3e99f06693..6aa46b0c74 100644
|
||||
--- a/package/kernel/mac80211/files/lib/wifi/mac80211.sh
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
From beaf8ac8acf93bc617d3ed141c750fe1d4f2b047 Mon Sep 17 00:00:00 2001
|
||||
From 6e3370a4c785c2c245b77832960f1dbed2736192 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Sat, 4 Sep 2021 05:48:27 +0200
|
||||
Subject: [PATCH 01/56] hostapd: update to latest HEAD
|
||||
Subject: [PATCH 01/70] hostapd: update to latest HEAD
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/network/services/hostapd/Makefile | 15 +-
|
||||
.../hostapd/files/hostapd-basic.config | 2 +-
|
||||
.../hostapd/files/hostapd-full.config | 4 +-
|
||||
.../network/services/hostapd/files/hostapd.sh | 181 +++++++++---
|
||||
.../network/services/hostapd/files/hostapd.sh | 188 +++++++++---
|
||||
...-fix-frequency-setup-with-HE-enabled.patch | 196 -------------
|
||||
...> 001-wolfssl-init-RNG-with-ECC-key.patch} | 11 +-
|
||||
...-init-order-disable-pri-sec-channel-.patch | 126 --------
|
||||
@@ -73,7 +73,7 @@ Signed-off-by: John Crispin <john@phrozen.org>
|
||||
.../services/hostapd/src/src/ap/ubus.c | 214 +++++++++++++-
|
||||
.../services/hostapd/src/src/ap/ubus.h | 16 +
|
||||
.../hostapd/src/src/utils/build_features.h | 2 -
|
||||
68 files changed, 1336 insertions(+), 2347 deletions(-)
|
||||
68 files changed, 1343 insertions(+), 2347 deletions(-)
|
||||
delete mode 100644 package/network/services/hostapd/patches/001-HE-VHT-fix-frequency-setup-with-HE-enabled.patch
|
||||
rename package/network/services/hostapd/patches/{802-wolfssl-init-RNG-with-ECC-key.patch => 001-wolfssl-init-RNG-with-ECC-key.patch} (76%)
|
||||
delete mode 100644 package/network/services/hostapd/patches/002-mesh-fix-channel-init-order-disable-pri-sec-channel-.patch
|
||||
@@ -181,7 +181,7 @@ index df272e443a..61b6daf861 100644
|
||||
# EAP-SAKE for the integrated EAP server
|
||||
#CONFIG_EAP_SAKE=y
|
||||
diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh
|
||||
index aa72e09eba..0265c0518a 100644
|
||||
index aa72e09eba..fe6af98f4d 100644
|
||||
--- a/package/network/services/hostapd/files/hostapd.sh
|
||||
+++ b/package/network/services/hostapd/files/hostapd.sh
|
||||
@@ -48,13 +48,17 @@ hostapd_append_wpa_key_mgmt() {
|
||||
@@ -276,7 +276,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
config_add_string 'owe_transition_bssid:macaddr' 'owe_transition_ssid:string'
|
||||
|
||||
@@ -319,23 +336,33 @@ hostapd_common_add_bss_config() {
|
||||
@@ -319,23 +336,35 @@ hostapd_common_add_bss_config() {
|
||||
config_add_int iw_ipaddr_type_availability iw_gas_address3
|
||||
config_add_string iw_hessid iw_network_auth_type iw_qos_map_set
|
||||
config_add_array iw_roaming_consortium iw_domain_name iw_anqp_3gpp_cell_net iw_nai_realm
|
||||
@@ -310,10 +310,12 @@ index aa72e09eba..0265c0518a 100644
|
||||
+
|
||||
+ config_add_int eap_server
|
||||
+ config_add_string eap_user_file ca_cert server_cert private_key private_key_passwd server_id
|
||||
+
|
||||
+ config_add_boolean ratelimit
|
||||
}
|
||||
|
||||
hostapd_set_vlan_file() {
|
||||
@@ -387,7 +414,7 @@ append_iw_anqp_3gpp_cell_net() {
|
||||
@@ -387,7 +416,7 @@ append_iw_anqp_3gpp_cell_net() {
|
||||
if [ -z "$iw_anqp_3gpp_cell_net_conf" ]; then
|
||||
iw_anqp_3gpp_cell_net_conf="$1"
|
||||
else
|
||||
@@ -322,7 +324,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -399,10 +426,22 @@ append_iw_nai_realm() {
|
||||
@@ -399,10 +428,22 @@ append_iw_nai_realm() {
|
||||
[ -n "$1" ] && append bss_conf "nai_realm=$1" "$N"
|
||||
}
|
||||
|
||||
@@ -345,7 +347,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
append_osu_provider_service_desc() {
|
||||
append bss_conf "osu_service_desc=$1" "$N"
|
||||
}
|
||||
@@ -450,6 +489,7 @@ append_osu_provider() {
|
||||
@@ -450,6 +491,7 @@ append_osu_provider() {
|
||||
append bss_conf "osu_method_list=$osu_method_list" "$N"
|
||||
|
||||
config_list_foreach "$1" osu_service_desc append_osu_provider_service_desc
|
||||
@@ -353,7 +355,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
config_list_foreach "$1" osu_icon append_osu_icon
|
||||
|
||||
append bss_conf "$N"
|
||||
@@ -459,6 +499,14 @@ append_hs20_conn_capab() {
|
||||
@@ -459,6 +501,14 @@ append_hs20_conn_capab() {
|
||||
[ -n "$1" ] && append bss_conf "hs20_conn_capab=$1" "$N"
|
||||
}
|
||||
|
||||
@@ -368,7 +370,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
append_airtime_sta_weight() {
|
||||
[ -n "$1" ] && append bss_conf "airtime_sta_weight=$1" "$N"
|
||||
}
|
||||
@@ -482,10 +530,12 @@ hostapd_set_bss_options() {
|
||||
@@ -482,10 +532,12 @@ hostapd_set_bss_options() {
|
||||
macfilter ssid utf8_ssid wmm uapsd hidden short_preamble rsn_preauth \
|
||||
iapp_interface eapol_version dynamic_vlan ieee80211w nasid \
|
||||
acct_server acct_secret acct_port acct_interval \
|
||||
@@ -383,7 +385,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
set_default isolate 0
|
||||
set_default maxassoc 0
|
||||
@@ -506,6 +556,7 @@ hostapd_set_bss_options() {
|
||||
@@ -506,6 +558,7 @@ hostapd_set_bss_options() {
|
||||
set_default multi_ap 0
|
||||
set_default airtime_bss_weight 0
|
||||
set_default airtime_bss_limit 0
|
||||
@@ -391,7 +393,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
append bss_conf "ctrl_interface=/var/run/hostapd"
|
||||
if [ "$isolate" -gt 0 ]; then
|
||||
@@ -532,6 +583,7 @@ hostapd_set_bss_options() {
|
||||
@@ -532,6 +585,7 @@ hostapd_set_bss_options() {
|
||||
append bss_conf "uapsd_advertisement_enabled=$uapsd" "$N"
|
||||
append bss_conf "utf8_ssid=$utf8_ssid" "$N"
|
||||
append bss_conf "multi_ap=$multi_ap" "$N"
|
||||
@@ -399,7 +401,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
[ "$tdls_prohibit" -gt 0 ] && append bss_conf "tdls_prohibit=$tdls_prohibit" "$N"
|
||||
|
||||
@@ -550,19 +602,21 @@ hostapd_set_bss_options() {
|
||||
@@ -550,19 +604,21 @@ hostapd_set_bss_options() {
|
||||
append bss_conf "acct_server_shared_secret=$acct_secret" "$N"
|
||||
[ -n "$acct_interval" ] && \
|
||||
append bss_conf "radius_acct_interim_interval=$acct_interval" "$N"
|
||||
@@ -423,7 +425,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
local vlan_possible=""
|
||||
|
||||
@@ -599,12 +653,12 @@ hostapd_set_bss_options() {
|
||||
@@ -599,12 +655,12 @@ hostapd_set_bss_options() {
|
||||
vlan_possible=1
|
||||
wps_possible=1
|
||||
;;
|
||||
@@ -438,7 +440,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
# radius can provide VLAN ID for clients
|
||||
vlan_possible=1
|
||||
@@ -616,18 +670,22 @@ hostapd_set_bss_options() {
|
||||
@@ -616,18 +672,22 @@ hostapd_set_bss_options() {
|
||||
|
||||
set_default auth_port 1812
|
||||
set_default dae_port 3799
|
||||
@@ -465,7 +467,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
[ -n "$ownip" ] && append bss_conf "own_ip_addr=$ownip" "$N"
|
||||
[ -n "$radius_client_addr" ] && append bss_conf "radius_client_addr=$radius_client_addr" "$N"
|
||||
@@ -699,7 +757,8 @@ hostapd_set_bss_options() {
|
||||
@@ -699,7 +759,8 @@ hostapd_set_bss_options() {
|
||||
}
|
||||
|
||||
append bss_conf "ssid=$ssid" "$N"
|
||||
@@ -475,7 +477,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
[ -n "$iapp_interface" ] && {
|
||||
local ifname
|
||||
network_get_device ifname "$iapp_interface" || ifname="$iapp_interface"
|
||||
@@ -740,7 +799,7 @@ hostapd_set_bss_options() {
|
||||
@@ -740,7 +801,7 @@ hostapd_set_bss_options() {
|
||||
append bss_conf "ftm_responder=1" "$N"
|
||||
[ "$stationary_ap" -eq "1" ] && append bss_conf "stationary_ap=1" "$N"
|
||||
[ -n "$lci" ] && append bss_conf "lci=$lci" "$N"
|
||||
@@ -484,7 +486,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
}
|
||||
fi
|
||||
|
||||
@@ -764,6 +823,7 @@ hostapd_set_bss_options() {
|
||||
@@ -764,6 +825,7 @@ hostapd_set_bss_options() {
|
||||
;;
|
||||
esac
|
||||
|
||||
@@ -492,7 +494,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
append bss_conf "mobility_domain=$mobility_domain" "$N"
|
||||
append bss_conf "ft_psk_generate_local=$ft_psk_generate_local" "$N"
|
||||
append bss_conf "ft_over_ds=$ft_over_ds" "$N"
|
||||
@@ -778,6 +838,13 @@ hostapd_set_bss_options() {
|
||||
@@ -778,6 +840,13 @@ hostapd_set_bss_options() {
|
||||
set_default r0_key_lifetime 10000
|
||||
set_default pmk_r1_push 0
|
||||
|
||||
@@ -506,7 +508,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
[ -n "$r1_key_holder" ] && append bss_conf "r1_key_holder=$r1_key_holder" "$N"
|
||||
append bss_conf "r0_key_lifetime=$r0_key_lifetime" "$N"
|
||||
append bss_conf "pmk_r1_push=$pmk_r1_push" "$N"
|
||||
@@ -822,7 +889,16 @@ hostapd_set_bss_options() {
|
||||
@@ -822,7 +891,16 @@ hostapd_set_bss_options() {
|
||||
json_get_vars ieee80211w_mgmt_cipher ieee80211w_max_timeout ieee80211w_retry_timeout
|
||||
append bss_conf "ieee80211w=$ieee80211w" "$N"
|
||||
[ "$ieee80211w" -gt "0" ] && {
|
||||
@@ -524,7 +526,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
[ -n "$ieee80211w_max_timeout" ] && \
|
||||
append bss_conf "assoc_sa_query_max_timeout=$ieee80211w_max_timeout" "$N"
|
||||
[ -n "$ieee80211w_retry_timeout" ] && \
|
||||
@@ -863,13 +939,17 @@ hostapd_set_bss_options() {
|
||||
@@ -863,13 +941,17 @@ hostapd_set_bss_options() {
|
||||
}
|
||||
|
||||
[ -n "$vlan_possible" -a -n "$dynamic_vlan" ] && {
|
||||
@@ -544,7 +546,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
[ -n "$vlan_tagged_interface" ] && \
|
||||
append bss_conf "vlan_tagged_interface=$vlan_tagged_interface" "$N"
|
||||
[ -n "$vlan_file" ] && {
|
||||
@@ -882,6 +962,7 @@ hostapd_set_bss_options() {
|
||||
@@ -882,6 +964,7 @@ hostapd_set_bss_options() {
|
||||
json_get_vars iw_hessid iw_venue_group iw_venue_type iw_network_auth_type
|
||||
json_get_vars iw_roaming_consortium iw_domain_name iw_anqp_3gpp_cell_net iw_nai_realm
|
||||
json_get_vars iw_anqp_elem iw_qos_map_set iw_ipaddr_type_availability iw_gas_address3
|
||||
@@ -552,7 +554,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
set_default iw_enabled 0
|
||||
if [ "$iw_enabled" = "1" ]; then
|
||||
@@ -905,11 +986,12 @@ hostapd_set_bss_options() {
|
||||
@@ -905,11 +988,12 @@ hostapd_set_bss_options() {
|
||||
[ -n "$iw_network_auth_type" ] && \
|
||||
append bss_conf "network_auth_type=$iw_network_auth_type" "$N"
|
||||
[ -n "$iw_gas_address3" ] && append bss_conf "gas_address3=$iw_gas_address3" "$N"
|
||||
@@ -566,12 +568,16 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
iw_domain_name_conf=
|
||||
json_for_each_item append_iw_domain_name iw_domain_name
|
||||
@@ -921,14 +1003,18 @@ hostapd_set_bss_options() {
|
||||
[ -n "$iw_anqp_3gpp_cell_net_conf" ] && \
|
||||
@@ -922,13 +1006,22 @@ hostapd_set_bss_options() {
|
||||
append bss_conf "anqp_3gpp_cell_net=$iw_anqp_3gpp_cell_net_conf" "$N"
|
||||
fi
|
||||
+ [ -n "$iw_qos_map_set" ] && append bss_conf "qos_map_set=$iw_qos_map_set" "$N"
|
||||
|
||||
+ set_default iw_qos_map_set 0,0,2,16,1,1,255,255,18,22,24,38,40,40,44,46,48,56
|
||||
+ case "$iw_qos_map_set" in
|
||||
+ *,*);;
|
||||
+ *) iw_qos_map_set="";;
|
||||
+ esac
|
||||
+ [ -n "$iw_qos_map_set" ] && append bss_conf "qos_map_set=$iw_qos_map_set" "$N"
|
||||
|
||||
local hs20 disable_dgaf osen anqp_domain_id hs20_deauth_req_timeout \
|
||||
- osu_ssid hs20_wan_metrics hs20_operating_class hs20_t_c_filename hs20_t_c_timestamp
|
||||
@@ -587,7 +593,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
set_default disable_dgaf $hs20
|
||||
set_default osen 0
|
||||
set_default anqp_domain_id 0
|
||||
@@ -936,6 +1022,7 @@ hostapd_set_bss_options() {
|
||||
@@ -936,6 +1029,7 @@ hostapd_set_bss_options() {
|
||||
if [ "$hs20" = "1" ]; then
|
||||
append bss_conf "hs20=1" "$N"
|
||||
append_hs20_icons
|
||||
@@ -595,7 +601,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
append bss_conf "disable_dgaf=$disable_dgaf" "$N"
|
||||
append bss_conf "osen=$osen" "$N"
|
||||
append bss_conf "anqp_domain_id=$anqp_domain_id" "$N"
|
||||
@@ -945,16 +1032,31 @@ hostapd_set_bss_options() {
|
||||
@@ -945,16 +1039,31 @@ hostapd_set_bss_options() {
|
||||
[ -n "$hs20_operating_class" ] && append bss_conf "hs20_operating_class=$hs20_operating_class" "$N"
|
||||
[ -n "$hs20_t_c_filename" ] && append bss_conf "hs20_t_c_filename=$hs20_t_c_filename" "$N"
|
||||
[ -n "$hs20_t_c_timestamp" ] && append bss_conf "hs20_t_c_timestamp=$hs20_t_c_timestamp" "$N"
|
||||
@@ -628,7 +634,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
set_default per_sta_vif 0
|
||||
if [ "$per_sta_vif" -gt 0 ]; then
|
||||
@@ -1079,16 +1181,16 @@ wpa_supplicant_set_fixed_freq() {
|
||||
@@ -1079,16 +1188,16 @@ wpa_supplicant_set_fixed_freq() {
|
||||
append network_data "frequency=$freq" "$N$T"
|
||||
case "$htmode" in
|
||||
NOHT) append network_data "disable_ht=1" "$N$T";;
|
||||
@@ -649,7 +655,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
*) append network_data "disable_vht=1" "$N$T";;
|
||||
esac
|
||||
}
|
||||
@@ -1106,19 +1208,21 @@ wpa_supplicant_add_network() {
|
||||
@@ -1106,19 +1215,21 @@ wpa_supplicant_add_network() {
|
||||
ssid bssid key \
|
||||
basic_rate mcast_rate \
|
||||
ieee80211w ieee80211r \
|
||||
@@ -674,7 +680,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
local key_mgmt='NONE'
|
||||
local network_data=
|
||||
@@ -1150,7 +1254,10 @@ wpa_supplicant_add_network() {
|
||||
@@ -1150,7 +1261,10 @@ wpa_supplicant_add_network() {
|
||||
scan_ssid=""
|
||||
}
|
||||
|
||||
@@ -686,7 +692,7 @@ index aa72e09eba..0265c0518a 100644
|
||||
|
||||
case "$auth_type" in
|
||||
none) ;;
|
||||
@@ -1186,7 +1293,7 @@ wpa_supplicant_add_network() {
|
||||
@@ -1186,7 +1300,7 @@ wpa_supplicant_add_network() {
|
||||
fi
|
||||
append network_data "$passphrase" "$N$T"
|
||||
;;
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
From aab305d662fa77ef4495574c096cb1e065c1908a Mon Sep 17 00:00:00 2001
|
||||
From 006abf1773051ad355b52d70095f63f44a496b13 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Sun, 25 Jul 2021 13:32:37 +0200
|
||||
Subject: [PATCH 20/27] procd: add uxc support
|
||||
Subject: [PATCH 02/70] procd: add uxc support
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
package/system/procd/Makefile | 12 ++---
|
||||
package/system/procd/Makefile | 15 +++---
|
||||
package/system/procd/files/procd.sh | 79 +++++++++++++++++++++++++++++
|
||||
package/system/procd/files/uxc.init | 4 ++
|
||||
3 files changed, 89 insertions(+), 6 deletions(-)
|
||||
3 files changed, 90 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/package/system/procd/Makefile b/package/system/procd/Makefile
|
||||
index 30d5adf427..98f1ed1775 100644
|
||||
index 30d5adf427..b831f86639 100644
|
||||
--- a/package/system/procd/Makefile
|
||||
+++ b/package/system/procd/Makefile
|
||||
@@ -12,9 +12,9 @@ PKG_RELEASE:=$(AUTORELEASE)
|
||||
@@ -21,9 +21,9 @@ index 30d5adf427..98f1ed1775 100644
|
||||
-PKG_SOURCE_DATE:=2021-02-23
|
||||
-PKG_SOURCE_VERSION:=37eed131e9967a35f47bacb3437a9d3c8a57b3f4
|
||||
-PKG_MIRROR_HASH:=2b0131ff9055ccf987cbeb5f36c2c2585dc780999df6be312fbbbcd61ce676d4
|
||||
+PKG_SOURCE_DATE:=2021-08-15
|
||||
+PKG_SOURCE_VERSION:=104b49d6ab25a8cf067e6d8d1f2da7defb9876d4
|
||||
+PKG_MIRROR_HASH:=d13b566a14e84f6babe8b7d3dfb88e34c3dff0e97d7770d6fe71174685bca628
|
||||
+PKG_MIRROR_HASH:=0d51642d82d7bb4150355a6986e54504dce171c6fcb7eeff312d20a5d106bad8
|
||||
+PKG_SOURCE_DATE:=2021-11-04
|
||||
+PKG_SOURCE_VERSION:=0ee8e734a7f67220cf4a3412b60ff674b5fb20dd
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
@@ -36,21 +36,30 @@ index 30d5adf427..98f1ed1775 100644
|
||||
endif
|
||||
|
||||
CMAKE_OPTIONS += -DEARLY_PATH="$(TARGET_INIT_PATH)"
|
||||
@@ -82,7 +82,7 @@ endef
|
||||
@@ -68,7 +68,7 @@ define Package/procd-ujail
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
DEPENDS:=@KERNEL_NAMESPACES +@KERNEL_UTS_NS +@KERNEL_IPC_NS +@KERNEL_PID_NS \
|
||||
- +libubox +libubus +libblobmsg-json
|
||||
+ +libubox +libubus +libuci +libblobmsg-json
|
||||
TITLE:=OpenWrt process jail helper
|
||||
endef
|
||||
|
||||
@@ -82,15 +82,14 @@ endef
|
||||
define Package/procd-seccomp
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
- DEPENDS:=@(arm||armeb||mips||mipsel||i386||powerpc||x86_64) @!TARGET_uml \
|
||||
+ DEPENDS:=@(aarch64||arm||armeb||mips||mipsel||i386||powerpc||x86_64) @!TARGET_uml \
|
||||
@KERNEL_SECCOMP +libubox +libblobmsg-json
|
||||
- @KERNEL_SECCOMP +libubox +libblobmsg-json
|
||||
+ DEPENDS:=@SECCOMP +libubox +libblobmsg-json
|
||||
TITLE:=OpenWrt process seccomp helper + utrace
|
||||
endef
|
||||
@@ -90,7 +90,7 @@ endef
|
||||
|
||||
define Package/uxc
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
- DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json
|
||||
+ DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json +blockd +rpcd
|
||||
+ DEPENDS:=+procd-ujail +libubus +libubox +libblobmsg-json +blockd +PACKAGE_uxc:rpcd
|
||||
TITLE:=OpenWrt container management
|
||||
MAINTAINER:=Daniel Golle <daniel@makrotopia.org>
|
||||
endef
|
||||
|
||||
35
backports/0031-ubus-update-to-the-latest-version.patch
Normal file
35
backports/0031-ubus-update-to-the-latest-version.patch
Normal file
@@ -0,0 +1,35 @@
|
||||
From d4e24006e05474b6dbe582f7c56a505cc0c45e81 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 1 Nov 2021 11:59:41 +0100
|
||||
Subject: [PATCH] ubus: update to the latest version
|
||||
|
||||
b743a331421d ubusd: log ACL init errors
|
||||
2099bb3ad997 libubus: use list_empty/list_first_entry in ubus_process_pending_msg
|
||||
ef038488edc3 libubus: process pending messages in data handler if stack depth is 0
|
||||
a72457b61df0 libubus: increase stack depth for processing obj msgs
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
package/system/ubus/Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile
|
||||
index 8a3fd1de7b..d5f86b6850 100644
|
||||
--- a/package/system/ubus/Makefile
|
||||
+++ b/package/system/ubus/Makefile
|
||||
@@ -5,9 +5,9 @@ PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/ubus.git
|
||||
-PKG_SOURCE_DATE:=2021-06-30
|
||||
-PKG_SOURCE_VERSION:=4fc532c8a55ba8217ad67d7fd47c5eb9a8aba044
|
||||
-PKG_MIRROR_HASH:=a5c8205f2e2b2f1f9ad687592e66a6e2bf8900dc54cfe3ceefe6c297d18971a8
|
||||
+PKG_SOURCE_DATE:=2021-08-09
|
||||
+PKG_SOURCE_VERSION:=a72457b61df045d3c499a6211362b751710590d7
|
||||
+PKG_MIRROR_HASH:=ac617577bcb2ff3dbc3039ad67200afcce910840223a2de15977d3224e6557fd
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
34
backports/0032-rpcd-bump-to-git-HEAD.patch
Normal file
34
backports/0032-rpcd-bump-to-git-HEAD.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From 49ceb8a8d7009e5c81599c68b8aacc16d17d2e62 Mon Sep 17 00:00:00 2001
|
||||
From: Stijn Tintel <stijn@linux-ipv6.be>
|
||||
Date: Tue, 9 Nov 2021 17:20:41 +0100
|
||||
Subject: [PATCH] rpcd: bump to git HEAD
|
||||
|
||||
20bf958 session: use uloop_timeout_remaining64
|
||||
d11ffe9 session: use blobmsg_get_u64 for RPC_DUMP_EXPIRES
|
||||
|
||||
Signed-off-by: Stijn Tintel <stijn@linux-ipv6.be>
|
||||
---
|
||||
package/system/rpcd/Makefile | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/package/system/rpcd/Makefile b/package/system/rpcd/Makefile
|
||||
index 0896a7dada..af788dcfaa 100644
|
||||
--- a/package/system/rpcd/Makefile
|
||||
+++ b/package/system/rpcd/Makefile
|
||||
@@ -12,10 +12,10 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/rpcd.git
|
||||
-PKG_SOURCE_DATE:=2021-03-11
|
||||
-PKG_SOURCE_VERSION:=ccb75178cf6a726896729c6904bd623636aa0b29
|
||||
+PKG_MIRROR_HASH:=98071b4a1ce983a0e738d7e4a2f6e52b7f6db19f99510ddef430093314134ca4
|
||||
+PKG_SOURCE_DATE:=2021-11-04
|
||||
+PKG_SOURCE_VERSION:=d11ffe9383ae0ec34836421926364b24c1d891ca
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
-PKG_MIRROR_HASH:=87b1839275c209f9767057d6da5272cae973a064767fa28f380a37fb65e2e643
|
||||
|
||||
PKG_LICENSE:=ISC
|
||||
PKG_LICENSE_FILES:=
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
From 705ea724f1dc4083665746a1cf4c9b0f317667ec Mon Sep 17 00:00:00 2001
|
||||
From 3937223beab0c3e4284fd916c0c3b6548c287e03 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 26 Oct 2021 20:41:22 +0200
|
||||
Subject: [PATCH] bpf-headers: add a package with kernel headers for ebpf
|
||||
Subject: [PATCH 050/102] bpf-headers: add a package with kernel headers for
|
||||
ebpf
|
||||
|
||||
In order to genererate suitable kernel headers, a 5.10 kernel tree is
|
||||
prepared with a default config for mips. The arch is forced to mips in
|
||||
@@ -11,27 +12,32 @@ It also has the advantage of supporting both endian types
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/bpf.mk | 60 +++++++++++
|
||||
include/bpf.mk | 65 ++++++++++++
|
||||
package/kernel/bpf-headers/Makefile | 99 +++++++++++++++++++
|
||||
.../src/include/generated/bounds.h | 14 +++
|
||||
3 files changed, 173 insertions(+)
|
||||
3 files changed, 178 insertions(+)
|
||||
create mode 100644 include/bpf.mk
|
||||
create mode 100644 package/kernel/bpf-headers/Makefile
|
||||
create mode 100644 package/kernel/bpf-headers/src/include/generated/bounds.h
|
||||
|
||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
||||
new file mode 100644
|
||||
index 0000000000..4e227a11d0
|
||||
index 0000000000..3dc65c7685
|
||||
--- /dev/null
|
||||
+++ b/include/bpf.mk
|
||||
@@ -0,0 +1,60 @@
|
||||
+ifeq ($(CONFIG_BUILD_LLVM_BPF),)
|
||||
+export PATH:=/usr/local/opt/llvm/bin:$(PATH)
|
||||
+CLANG:=$(firstword $(shell PATH='$(PATH)' which clang clang-13 clang-12 clang-11 clang-10 clang-9))
|
||||
+LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
|
||||
@@ -0,0 +1,65 @@
|
||||
+ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
|
||||
+ BPF_TOOLCHAIN_HOST_PATH:=$(call qstrip,$(CONFIG_BPF_TOOLCHAIN_HOST_PATH))
|
||||
+ ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
||||
+ BPF_PATH:=$(BPF_TOOLCHAIN_HOST_PATH)/bin:$(PATH)
|
||||
+ else
|
||||
+ BPF_PATH:=$(BPF_PATH)
|
||||
+ endif
|
||||
+ CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' which clang clang-13 clang-12 clang-11))
|
||||
+ LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
|
||||
+else
|
||||
+CLANG:=$(STAGING_DIR_HOST)/bin/clang
|
||||
+LLVM_VER:=
|
||||
+ CLANG:=$(STAGING_DIR_HOST)/bin/clang
|
||||
+ LLVM_VER:=
|
||||
+endif
|
||||
+
|
||||
+LLVM_PATH:=$(dir $(CLANG))
|
||||
29
backports/0051-bpf-headers-unset-PKG_CONFIG_PATH.patch
Normal file
29
backports/0051-bpf-headers-unset-PKG_CONFIG_PATH.patch
Normal file
@@ -0,0 +1,29 @@
|
||||
From 32243b2148fd0dacd0630affaea59345c64df79a Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 2 Nov 2021 10:36:14 +0100
|
||||
Subject: [PATCH 051/102] bpf-headers: unset PKG_CONFIG_PATH
|
||||
|
||||
This fixes an issue where the kernel would pick up an incompatible target
|
||||
libyaml for building host tools
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
package/kernel/bpf-headers/Makefile | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/package/kernel/bpf-headers/Makefile b/package/kernel/bpf-headers/Makefile
|
||||
index 5f5b89370d..df24bfa13f 100644
|
||||
--- a/package/kernel/bpf-headers/Makefile
|
||||
+++ b/package/kernel/bpf-headers/Makefile
|
||||
@@ -41,6 +41,8 @@ define Package/bpf-headers
|
||||
HIDDEN:=1
|
||||
endef
|
||||
|
||||
+PKG_CONFIG_PATH:=
|
||||
+
|
||||
export HOST_EXTRACFLAGS=-I$(STAGING_DIR_HOST)/include
|
||||
|
||||
KERNEL_MAKE := \
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
From 1eb36bc2be4b54e4e4e4ceffc01be78d996205f0 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sun, 17 Oct 2021 17:50:53 +0200
|
||||
Subject: [PATCH 052/102] tools/llvm-bpf: add llvm+clang build suitable for
|
||||
compiling code to eBPF
|
||||
|
||||
Preparation for building packages that ship eBPF code
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
toolchain/Config.in | 7 +++++++
|
||||
tools/Makefile | 2 ++
|
||||
tools/llvm-bpf/Makefile | 36 ++++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 45 insertions(+)
|
||||
create mode 100644 tools/llvm-bpf/Makefile
|
||||
|
||||
diff --git a/toolchain/Config.in b/toolchain/Config.in
|
||||
index 6dda9af92d..9062d6f65e 100644
|
||||
--- a/toolchain/Config.in
|
||||
+++ b/toolchain/Config.in
|
||||
@@ -37,6 +37,13 @@ menuconfig TARGET_OPTIONS
|
||||
|
||||
Most people will answer N.
|
||||
|
||||
+config BUILD_LLVM_BPF
|
||||
+ bool "Build LLVM toolchain for eBPF" if DEVEL
|
||||
+ help
|
||||
+ If enabled, a LLVM toolchain for building eBPF binaries will be built.
|
||||
+ If this is not enabled, eBPF packages can only be built if the host
|
||||
+ has a suitable toolchain
|
||||
+
|
||||
|
||||
menuconfig EXTERNAL_TOOLCHAIN
|
||||
bool
|
||||
diff --git a/tools/Makefile b/tools/Makefile
|
||||
index a2665dbc9a..83147014c6 100644
|
||||
--- a/tools/Makefile
|
||||
+++ b/tools/Makefile
|
||||
@@ -35,6 +35,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
|
||||
tools-$(CONFIG_TARGET_tegra) += cbootimage cbootimage-configs
|
||||
tools-$(CONFIG_USES_MINOR) += kernel2minor
|
||||
tools-$(CONFIG_USE_SPARSE) += sparse
|
||||
+tools-$(CONFIG_BUILD_LLVM_BPF) += llvm-bpf
|
||||
|
||||
# builddir dependencies
|
||||
$(curdir)/autoconf/compile := $(curdir)/m4/compile
|
||||
@@ -57,6 +58,7 @@ $(curdir)/libelf/compile := $(curdir)/libtool/compile
|
||||
$(curdir)/libressl/compile := $(curdir)/pkgconf/compile
|
||||
$(curdir)/libtool/compile := $(curdir)/m4/compile $(curdir)/autoconf/compile $(curdir)/automake/compile $(curdir)/missing-macros/compile
|
||||
$(curdir)/lzma-old/compile := $(curdir)/zlib/compile
|
||||
+$(curdir)/llvm-bpf/compile := $(curdir)/cmake/compile
|
||||
$(curdir)/make-ext4fs/compile := $(curdir)/zlib/compile
|
||||
$(curdir)/missing-macros/compile := $(curdir)/autoconf/compile
|
||||
$(curdir)/mkimage/compile += $(curdir)/libressl/compile
|
||||
diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile
|
||||
new file mode 100644
|
||||
index 0000000000..a5ba2a4cb7
|
||||
--- /dev/null
|
||||
+++ b/tools/llvm-bpf/Makefile
|
||||
@@ -0,0 +1,36 @@
|
||||
+#
|
||||
+# Copyright (C) 2006-2016 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:=llvm-project
|
||||
+PKG_VERSION:=13.0.0
|
||||
+PKG_RELEASE:=1
|
||||
+
|
||||
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).src.tar.xz
|
||||
+PKG_SOURCE_URL:=https://github.com/llvm/llvm-project/releases/download/llvmorg-$(PKG_VERSION)
|
||||
+PKG_HASH:=6075ad30f1ac0e15f07c1bf062c1e1268c241d674f11bd32cdf0e040c71f2bf3
|
||||
+
|
||||
+HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_VERSION).src
|
||||
+
|
||||
+HOST_BUILD_PARALLEL:=1
|
||||
+
|
||||
+CMAKE_BINARY_SUBDIR := build
|
||||
+CMAKE_SOURCE_SUBDIR := llvm
|
||||
+
|
||||
+include $(INCLUDE_DIR)/host-build.mk
|
||||
+include $(INCLUDE_DIR)/cmake.mk
|
||||
+
|
||||
+CMAKE_HOST_OPTIONS += \
|
||||
+ -DLLVM_ENABLE_BINDINGS=OFF \
|
||||
+ -DLLVM_INCLUDE_DOCS=OFF \
|
||||
+ -DLLVM_INCLUDE_EXAMPLES=OFF \
|
||||
+ -DLLVM_INCLUDE_TESTS=OFF \
|
||||
+ -DLLVM_ENABLE_PROJECTS="clang;lld" \
|
||||
+ -DLLVM_TARGETS_TO_BUILD=BPF \
|
||||
+ -DCLANG_BUILD_EXAMPLES=OFF
|
||||
+
|
||||
+$(eval $(call HostBuild))
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
From 103a743e7ca4a2e98969d0f60d8aeb6cc7641f67 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 2 Nov 2021 19:38:12 +0100
|
||||
Subject: [PATCH 053/102] llvm-bpf: move to staging_dir/host/llvm-bpf
|
||||
|
||||
This makes it easier to package it up for the download server
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
tools/llvm-bpf/Makefile | 8 +++++++-
|
||||
1 file changed, 7 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/tools/llvm-bpf/Makefile b/tools/llvm-bpf/Makefile
|
||||
index a5ba2a4cb7..ae279d26d2 100644
|
||||
--- a/tools/llvm-bpf/Makefile
|
||||
+++ b/tools/llvm-bpf/Makefile
|
||||
@@ -24,6 +24,8 @@ CMAKE_SOURCE_SUBDIR := llvm
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
+CMAKE_HOST_INSTALL_PREFIX = $(STAGING_DIR_HOST)/llvm-bpf
|
||||
+
|
||||
CMAKE_HOST_OPTIONS += \
|
||||
-DLLVM_ENABLE_BINDINGS=OFF \
|
||||
-DLLVM_INCLUDE_DOCS=OFF \
|
||||
@@ -31,6 +33,10 @@ CMAKE_HOST_OPTIONS += \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_ENABLE_PROJECTS="clang;lld" \
|
||||
-DLLVM_TARGETS_TO_BUILD=BPF \
|
||||
- -DCLANG_BUILD_EXAMPLES=OFF
|
||||
+ -DCLANG_BUILD_EXAMPLES=OFF \
|
||||
+ -DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
|
||||
+ -DLLVM_LINK_LLVM_DYLIB=ON \
|
||||
+ -DLLVM_TOOLCHAIN_TOOLS="llvm-objcopy;llvm-objdump;llvm-readelf;llvm-strip;llvm-ar;llvm-as;llvm-dis;llvm-link;llvm-nm;llvm-ranlib;llc;opt" \
|
||||
+ -DCMAKE_SKIP_RPATH=OFF
|
||||
|
||||
$(eval $(call HostBuild))
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,103 @@
|
||||
From a368d456ba1e9198fd8f473b7e82c0e066e4eb82 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 1 Nov 2021 18:40:03 +0100
|
||||
Subject: [PATCH 054/102] build: fix bpf toolchain dependency for qosify
|
||||
|
||||
Add hidden symbols to fix defaults with CONFIG_DEVEL unset
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/bpf.mk | 2 ++
|
||||
toolchain/Config.in | 45 +++++++++++++++++++++++++++++++++++++++++++++
|
||||
tools/Makefile | 2 +-
|
||||
3 files changed, 48 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
||||
index 3dc65c7685..5211ec4434 100644
|
||||
--- a/include/bpf.mk
|
||||
+++ b/include/bpf.mk
|
||||
@@ -1,3 +1,5 @@
|
||||
+BPF_DEPENDS := @HAS_BPF_TOOLCHAIN
|
||||
+
|
||||
ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
|
||||
BPF_TOOLCHAIN_HOST_PATH:=$(call qstrip,$(CONFIG_BPF_TOOLCHAIN_HOST_PATH))
|
||||
ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
||||
diff --git a/toolchain/Config.in b/toolchain/Config.in
|
||||
index 9062d6f65e..997cff59e4 100644
|
||||
--- a/toolchain/Config.in
|
||||
+++ b/toolchain/Config.in
|
||||
@@ -44,6 +44,32 @@ config BUILD_LLVM_BPF
|
||||
If this is not enabled, eBPF packages can only be built if the host
|
||||
has a suitable toolchain
|
||||
|
||||
+ choice BPF_TOOLCHAIN
|
||||
+ prompt "BPF toolchain" if DEVEL
|
||||
+ default BPF_TOOLCHAIN_NONE
|
||||
+
|
||||
+ config BPF_TOOLCHAIN_NONE
|
||||
+ bool "None"
|
||||
+
|
||||
+ config BPF_TOOLCHAIN_HOST
|
||||
+ select USE_LLVM_HOST
|
||||
+ bool "Use host LLVM toolchain"
|
||||
+
|
||||
+ config BPF_TOOLCHAIN_BUILD_LLVM
|
||||
+ select USE_LLVM_BUILD
|
||||
+ bool "Build LLVM toolchain for eBPF"
|
||||
+ help
|
||||
+ If enabled, a LLVM toolchain for building eBPF binaries will be built.
|
||||
+ If this is not enabled, eBPF packages can only be built if the host
|
||||
+ has a suitable toolchain
|
||||
+ endchoice
|
||||
+
|
||||
+ config BPF_TOOLCHAIN_HOST_PATH
|
||||
+ string
|
||||
+ depends on BPF_TOOLCHAIN_HOST
|
||||
+ prompt "Host LLVM toolchain path (prefix)" if DEVEL
|
||||
+ default "/usr/local/opt/llvm" if HOST_OS_MACOS
|
||||
+ default ""
|
||||
|
||||
menuconfig EXTERNAL_TOOLCHAIN
|
||||
bool
|
||||
@@ -266,6 +292,25 @@ config GDB
|
||||
help
|
||||
Enable if you want to build the gdb.
|
||||
|
||||
+config GDB_PYTHON
|
||||
+ bool
|
||||
+ depends on GDB
|
||||
+ prompt "Build gdb with python binding"
|
||||
+
|
||||
+ help
|
||||
+ Enable the python bindings for GDB to allow using python in the gdb shell.
|
||||
+
|
||||
+config HAS_BPF_TOOLCHAIN
|
||||
+ bool
|
||||
+
|
||||
+config USE_LLVM_HOST
|
||||
+ select HAS_BPF_TOOLCHAIN
|
||||
+ bool
|
||||
+
|
||||
+config USE_LLVM_BUILD
|
||||
+ select HAS_BPF_TOOLCHAIN
|
||||
+ bool
|
||||
+
|
||||
config USE_GLIBC
|
||||
default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc)
|
||||
bool
|
||||
diff --git a/tools/Makefile b/tools/Makefile
|
||||
index 83147014c6..ae3cc5dfd6 100644
|
||||
--- a/tools/Makefile
|
||||
+++ b/tools/Makefile
|
||||
@@ -35,7 +35,7 @@ tools-$(CONFIG_TARGET_mxs) += elftosb sdimage
|
||||
tools-$(CONFIG_TARGET_tegra) += cbootimage cbootimage-configs
|
||||
tools-$(CONFIG_USES_MINOR) += kernel2minor
|
||||
tools-$(CONFIG_USE_SPARSE) += sparse
|
||||
-tools-$(CONFIG_BUILD_LLVM_BPF) += llvm-bpf
|
||||
+tools-$(CONFIG_USE_LLVM_BUILD) += llvm-bpf
|
||||
|
||||
# builddir dependencies
|
||||
$(curdir)/autoconf/compile := $(curdir)/m4/compile
|
||||
--
|
||||
2.25.1
|
||||
|
||||
26
backports/0055-include-bpf.mk-fix-typo.patch
Normal file
26
backports/0055-include-bpf.mk-fix-typo.patch
Normal file
@@ -0,0 +1,26 @@
|
||||
From 2ae5b19a52da190ea342ec4210523407837c58ea Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 2 Nov 2021 09:56:10 +0100
|
||||
Subject: [PATCH 055/102] include/bpf.mk: fix typo
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/bpf.mk | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
||||
index 5211ec4434..6223648c5d 100644
|
||||
--- a/include/bpf.mk
|
||||
+++ b/include/bpf.mk
|
||||
@@ -5,7 +5,7 @@ ifneq ($(CONFIG_BPF_TOOLCHAIN_HOST),)
|
||||
ifneq ($(BPF_TOOLCHAIN_HOST_PATH),)
|
||||
BPF_PATH:=$(BPF_TOOLCHAIN_HOST_PATH)/bin:$(PATH)
|
||||
else
|
||||
- BPF_PATH:=$(BPF_PATH)
|
||||
+ BPF_PATH:=$(PATH)
|
||||
endif
|
||||
CLANG:=$(firstword $(shell PATH='$(BPF_PATH)' which clang clang-13 clang-12 clang-11))
|
||||
LLVM_VER:=$(subst clang,,$(notdir $(CLANG)))
|
||||
--
|
||||
2.25.1
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
From aff796bf3e60d7f09e5ca500cbf59221211dd218 Mon Sep 17 00:00:00 2001
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Tue, 2 Nov 2021 10:39:35 +0100
|
||||
Subject: [PATCH 056/102] include/bpf.mk: fix compile for big-endian targets
|
||||
|
||||
llvm-opt and llc need endian flags in the target as well
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
include/bpf.mk | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
||||
index 6223648c5d..9636ad5165 100644
|
||||
--- a/include/bpf.mk
|
||||
+++ b/include/bpf.mk
|
||||
@@ -22,6 +22,7 @@ LLVM_STRIP:=$(LLVM_PATH)/llvm-strip$(LLVM_VER)
|
||||
|
||||
BPF_KARCH:=mips
|
||||
BPF_ARCH:=mips$(if $(CONFIG_BIG_ENDIAN),,el)
|
||||
+BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el)
|
||||
|
||||
BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
|
||||
|
||||
@@ -59,9 +60,9 @@ BPF_CFLAGS := \
|
||||
define CompileBPF
|
||||
$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
|
||||
-c $(1) -o $(patsubst %.c,%.bc,$(1))
|
||||
- $(LLVM_OPT) -O2 -mtriple=bpf-pc-linux < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
||||
+ $(LLVM_OPT) -O2 -mtriple=$(BPF_TARGET) < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
||||
$(LLVM_DIS) < $(patsubst %.c,%.opt,$(1)) > $(patsubst %.c,%.S,$(1))
|
||||
- $(LLVM_LLC) -march=bpf -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
||||
+ $(LLVM_LLC) -march=$(BPF_TARGET) -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
||||
$(LLVM_STRIP) --strip-debug $(patsubst %.c,%.o,$(1))
|
||||
endef
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
34
backports/0057-include-bpf.mk-add-LD_LIBRARY_PATH.patch
Normal file
34
backports/0057-include-bpf.mk-add-LD_LIBRARY_PATH.patch
Normal file
@@ -0,0 +1,34 @@
|
||||
From d05fae42794c5fe76509935b1e8f900e1d17d9f0 Mon Sep 17 00:00:00 2001
|
||||
From: John Crispin <john@phrozen.org>
|
||||
Date: Fri, 5 Nov 2021 10:46:00 +0100
|
||||
Subject: [PATCH] include/bpf.mk: add LD_LIBRARY_PATH
|
||||
|
||||
Signed-off-by: John Crispin <john@phrozen.org>
|
||||
---
|
||||
include/bpf.mk | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/include/bpf.mk b/include/bpf.mk
|
||||
index 9636ad5165..2f797625b6 100644
|
||||
--- a/include/bpf.mk
|
||||
+++ b/include/bpf.mk
|
||||
@@ -58,11 +58,16 @@ BPF_CFLAGS := \
|
||||
-O2 -emit-llvm -Xclang -disable-llvm-passes
|
||||
|
||||
define CompileBPF
|
||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
||||
$(CLANG) -g -target $(BPF_ARCH)-linux-gnu $(BPF_CFLAGS) $(2) \
|
||||
-c $(1) -o $(patsubst %.c,%.bc,$(1))
|
||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
||||
$(LLVM_OPT) -O2 -mtriple=$(BPF_TARGET) < $(patsubst %.c,%.bc,$(1)) > $(patsubst %.c,%.opt,$(1))
|
||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
||||
$(LLVM_DIS) < $(patsubst %.c,%.opt,$(1)) > $(patsubst %.c,%.S,$(1))
|
||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
||||
$(LLVM_LLC) -march=$(BPF_TARGET) -filetype=obj -o $(patsubst %.c,%.o,$(1)) < $(patsubst %.c,%.S,$(1))
|
||||
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(STAGING_DIR_HOST)/lib \
|
||||
$(LLVM_STRIP) --strip-debug $(patsubst %.c,%.o,$(1))
|
||||
endef
|
||||
|
||||
--
|
||||
2.25.1
|
||||
|
||||
1088
backports/0058-kernel-backport-napi-threading-patches.patch
Normal file
1088
backports/0058-kernel-backport-napi-threading-patches.patch
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,7 @@ RUN apt-get update \
|
||||
&& apt-get install -y \
|
||||
time git-core build-essential gcc-multilib clang \
|
||||
libncurses5-dev zlib1g-dev gawk flex gettext wget unzip python \
|
||||
python3 python3-pip python3-yaml libssl-dev rsync llvm llvm-12 \
|
||||
python3 python3-pip python3-yaml libssl-dev rsync \
|
||||
&& apt-get clean
|
||||
RUN git config --global user.email "you@example.com"
|
||||
RUN git config --global user.name "Your Name"
|
||||
|
||||
@@ -2,35 +2,43 @@ Index: qca-ssdk/include/hsl/phy/hsl_phy.h
|
||||
===================================================================
|
||||
--- qca-ssdk.orig/include/hsl/phy/hsl_phy.h
|
||||
+++ qca-ssdk/include/hsl/phy/hsl_phy.h
|
||||
@@ -541,6 +541,7 @@ typedef struct {
|
||||
@@ -562,6 +562,7 @@ typedef struct {
|
||||
#define QCA8033_PHY 0x004DD074
|
||||
#define QCA8035_PHY 0x004DD072
|
||||
/*qca808x_start*/
|
||||
+#define QCA8081_PHY 0x004DD100
|
||||
#define QCA8081_PHY_V1_1 0x004DD101
|
||||
#define INVALID_PHY_ID 0
|
||||
#define INVALID_PHY_ID 0xFFFFFFFF
|
||||
|
||||
@@ -559,6 +560,7 @@ typedef struct {
|
||||
@@ -576,11 +577,14 @@ typedef struct {
|
||||
#define AQUANTIA_PHY_109 0x03a1b502
|
||||
#define AQUANTIA_PHY_111 0x03a1b610
|
||||
#define AQUANTIA_PHY_111B0 0x03a1b612
|
||||
+#define AQUANTIA_PHY_111C 0x03a1b7e2
|
||||
#define AQUANTIA_PHY_112 0x03a1b660
|
||||
#define AQUANTIA_PHY_113C_A0 0x31c31C10
|
||||
#define AQUANTIA_PHY_113C_A1 0x31c31C11
|
||||
#define AQUANTIA_PHY_112C 0x03a1b792
|
||||
+#define AQUANTIA_PHY_114C 0x31c31C22
|
||||
|
||||
+#define AQUANTIA_PHY_114C 0x31c31C22
|
||||
+
|
||||
#define PHY_805XV2 0x004DD082
|
||||
#define PHY_805XV1 0x004DD081
|
||||
/*qca808x_start*/
|
||||
Index: qca-ssdk/src/hsl/phy/hsl_phy.c
|
||||
===================================================================
|
||||
--- qca-ssdk.orig/src/hsl/phy/hsl_phy.c
|
||||
+++ qca-ssdk/src/hsl/phy/hsl_phy.c
|
||||
@@ -231,6 +231,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
|
||||
@@ -231,6 +231,8 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
|
||||
case AQUANTIA_PHY_108:
|
||||
case AQUANTIA_PHY_109:
|
||||
case AQUANTIA_PHY_111:
|
||||
+ case AQUANTIA_PHY_111C:
|
||||
+ case AQUANTIA_PHY_114C:
|
||||
case AQUANTIA_PHY_111B0:
|
||||
case AQUANTIA_PHY_112:
|
||||
case AQUANTIA_PHY_113C_A0:
|
||||
@@ -250,6 +251,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
|
||||
@@ -250,6 +252,7 @@ phy_type_t hsl_phytype_get_by_phyid(a_ui
|
||||
phytype = MPGE_PHY_CHIP;
|
||||
break;
|
||||
/*qca808x_start*/
|
||||
|
||||
14
feeds/ipq807x/qca-ssdk/patches/200-eap101.patch
Normal file
14
feeds/ipq807x/qca-ssdk/patches/200-eap101.patch
Normal file
@@ -0,0 +1,14 @@
|
||||
diff --git a/src/hsl/phy/hsl_phy.c b/src/hsl/phy/hsl_phy.c
|
||||
index 5866a522..41227581 100755
|
||||
--- a/src/hsl/phy/hsl_phy.c
|
||||
+++ b/src/hsl/phy/hsl_phy.c
|
||||
@@ -608,6 +608,9 @@ hsl_port_phyid_get(a_uint32_t dev_id, fal_port_t port_id)
|
||||
return INVALID_PHY_ID;
|
||||
}
|
||||
|
||||
+ if (phy_id == MALIBU5PORT_PHY && of_machine_is_compatible("edgecore,eap101"))
|
||||
+ phy_id = MALIBU2PORT_PHY;
|
||||
+
|
||||
return phy_id;
|
||||
}
|
||||
|
||||
@@ -230,6 +230,8 @@ IN_SFP_PHY=TRUE
|
||||
IN_MALIBU_PHY=TRUE
|
||||
else ifeq (CPPE, $(CHIP_TYPE))
|
||||
IN_QCA808X_PHY=TRUE
|
||||
IN_QCA803X_PHY=TRUE
|
||||
IN_SFP_PHY=TRUE
|
||||
IN_PHY_I2C_MODE=TRUE
|
||||
IN_MALIBU_PHY=TRUE
|
||||
else ifeq (DESS, $(CHIP_TYPE))
|
||||
|
||||
@@ -17,7 +17,7 @@ include ./openvswitch.mk
|
||||
#
|
||||
PKG_NAME:=openvswitch
|
||||
PKG_VERSION:=$(ovs_version)
|
||||
PKG_RELEASE:=9
|
||||
PKG_RELEASE:=10
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://www.openvswitch.org/releases/
|
||||
PKG_HASH:=5c7baed537364d43af36c15dde298c95d35cb2cb3204b4d3fe9b0fc73c97f16d
|
||||
|
||||
@@ -121,6 +121,7 @@ ovs_bridge_port_add() {
|
||||
}
|
||||
|
||||
ovs-vsctl --may-exist add-port "$name" "$port" ${type:+ -- set interface "$port" type="$type"}
|
||||
ovs_bridge_port_up "$port"
|
||||
__port_list="$__port_list ${port} "
|
||||
}
|
||||
|
||||
@@ -162,6 +163,7 @@ ovs_bridge_port_add_complex() {
|
||||
ovs-vsctl --may-exist add-port "$bridge" "$port" ${tag:+tag="$tag"} \
|
||||
${ofport:+ -- set interface "$port" ofport_request="$ofport"} \
|
||||
${type:+ -- set interface "$port" type="$type"}
|
||||
ovs_bridge_port_up "$port"
|
||||
__port_list="$__port_list ${port} "
|
||||
}
|
||||
|
||||
@@ -174,6 +176,12 @@ ovs_bridge_port_cleanup() {
|
||||
done
|
||||
}
|
||||
|
||||
ovs_bridge_port_up() {
|
||||
local port="$1"
|
||||
|
||||
ip link set dev "$port" up
|
||||
}
|
||||
|
||||
ovs_bridge_validate_datapath_id() {
|
||||
local dpid="$1"
|
||||
|
||||
|
||||
@@ -79,9 +79,10 @@ return view.extend({
|
||||
|
||||
var cntbtn = E('button', {
|
||||
'class': 'btn cbi-button-action important',
|
||||
'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn),
|
||||
'disabled': !is_valid
|
||||
'click': ui.createHandlerFn(this, 'handleSysupgradeConfirm', btn)
|
||||
}, [ _('Continue') ]);
|
||||
if (!is_valid)
|
||||
cntbtn.disabled = true;
|
||||
|
||||
body.push(E('div', { 'class': 'right' }, [
|
||||
E('button', {
|
||||
|
||||
@@ -43,6 +43,7 @@ return view.extend({
|
||||
o.value('dhcp', _('Address configuration via DHCP'));
|
||||
o.value('pppoe', _('Address configuration via PPPoE'));
|
||||
o.value('wwan', _('Cellular network connection'));
|
||||
o.value('wds', _('WiFi WDS uplink'));
|
||||
|
||||
o = s.option(form.ListValue, 'modem-type', _('Modem type'));
|
||||
o.depends('protocol', 'wwan');
|
||||
@@ -105,6 +106,25 @@ return view.extend({
|
||||
o.depends('protocol', 'static');
|
||||
o.datatype = 'ipaddr("nomask")';
|
||||
|
||||
o = s.option(form.Value, 'ssid', _('SSID'));
|
||||
o.depends('protocol', 'wds');
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(form.Value, 'passphrase', _('Passphrase'));
|
||||
o.depends('protocol', 'wds');
|
||||
o.password = true;
|
||||
o.rmempty = false;
|
||||
o.datatype = "rangelength(8, 31)";
|
||||
|
||||
o = s.option(form.ListValue, 'encryption', _('Encryption'));
|
||||
o.depends('protocol', 'wds');
|
||||
o.value('psk', 'PSK');
|
||||
o.value('psk-mixed', 'PSK-Mixed');
|
||||
o.value('psk2', 'PSK2');
|
||||
o.value('sae', 'SAE');
|
||||
o.value('sae-mixed', 'SAE-Mixed');
|
||||
o.password = true;
|
||||
|
||||
for (var i = 0; i < s.children.length; i++)
|
||||
data.broadband[s.children[i].option] = profile.broadband[s.children[i].option];
|
||||
|
||||
|
||||
@@ -45,8 +45,6 @@ config_foreach delete_forwarding forwarding
|
||||
|
||||
uci commit
|
||||
|
||||
/etc/init.d/uhttpd enable
|
||||
/etc/init.d/uhttpd start
|
||||
/etc/init.d/ucentral stop
|
||||
|
||||
reload_config
|
||||
|
||||
36
feeds/ucentral/atfpolicy/Makefile
Normal file
36
feeds/ucentral/atfpolicy/Makefile
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Copyright (C) 2021 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=atfpolicy
|
||||
PKG_VERSION:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/atfpolicy
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=A simple daemon for handling airtime fairness prioritization
|
||||
DEPENDS:=+libubox +libubus +libnl-tiny
|
||||
endef
|
||||
|
||||
TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/libnl-tiny
|
||||
|
||||
define Package/atfpolicy/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin $(1)/etc/init.d $(1)/etc/config
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/atfpolicy $(1)/usr/sbin/
|
||||
$(INSTALL_BIN) ./files/atfpolicy.init $(1)/etc/init.d/atfpolicy
|
||||
$(INSTALL_DATA) ./files/atfpolicy.conf $(1)/etc/config/atfpolicy
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,atfpolicy))
|
||||
8
feeds/ucentral/atfpolicy/files/atfpolicy.conf
Normal file
8
feeds/ucentral/atfpolicy/files/atfpolicy.conf
Normal file
@@ -0,0 +1,8 @@
|
||||
config defaults
|
||||
option vo_queue_weight 4
|
||||
option update_pkt_threshold 100
|
||||
option bulk_percent_thresh 50
|
||||
option prio_percent_thresh 30
|
||||
option weight_normal 256
|
||||
option weight_prio 512
|
||||
option weight_bulk 128
|
||||
57
feeds/ucentral/atfpolicy/files/atfpolicy.init
Normal file
57
feeds/ucentral/atfpolicy/files/atfpolicy.init
Normal file
@@ -0,0 +1,57 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
# Copyright (c) 2021 OpenWrt.org
|
||||
|
||||
START=50
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/atfpolicy
|
||||
|
||||
add_option() {
|
||||
local type="$1"
|
||||
local name="$2"
|
||||
|
||||
config_get val "$cfg" "$name"
|
||||
|
||||
[ -n "$val" ] && json_add_$type "$name" "$val"
|
||||
}
|
||||
|
||||
add_defaults() {
|
||||
cfg="$1"
|
||||
|
||||
json_add_boolean reset 1
|
||||
|
||||
add_option int vo_queue_weight
|
||||
add_option int update_pkt_threshold
|
||||
add_option int bulk_percent_thresh
|
||||
add_option int prio_percent_thresh
|
||||
add_option int weight_normal
|
||||
add_option int weight_prio
|
||||
add_option int weight_bulk
|
||||
}
|
||||
|
||||
|
||||
reload_service() {
|
||||
json_init
|
||||
|
||||
config_load atfpolicy
|
||||
|
||||
config_foreach add_defaults defaults
|
||||
|
||||
ubus call atfpolicy config "$(json_dump)"
|
||||
}
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger atfpolicy
|
||||
}
|
||||
|
||||
start_service() {
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
service_started() {
|
||||
ubus -t 10 wait_for atfpolicy
|
||||
[ $? = 0 ] && reload_service
|
||||
}
|
||||
15
feeds/ucentral/atfpolicy/src/CMakeLists.txt
Normal file
15
feeds/ucentral/atfpolicy/src/CMakeLists.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
|
||||
PROJECT(atfpolicy C)
|
||||
|
||||
ADD_DEFINITIONS(-Os -Wall -Wno-unknown-warning-option -Wno-array-bounds -Wno-format-truncation -Werror --std=gnu99)
|
||||
|
||||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
||||
|
||||
find_library(nl NAMES nl-tiny)
|
||||
ADD_EXECUTABLE(atfpolicy main.c ubus.c interface.c nl80211.c)
|
||||
TARGET_LINK_LIBRARIES(atfpolicy ${nl} ubox ubus)
|
||||
|
||||
INSTALL(TARGETS atfpolicy
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_SBINDIR}
|
||||
)
|
||||
90
feeds/ucentral/atfpolicy/src/atf.h
Normal file
90
feeds/ucentral/atfpolicy/src/atf.h
Normal file
@@ -0,0 +1,90 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#ifndef __ATF_H
|
||||
#define __ATF_H
|
||||
|
||||
#include <net/if.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <libubox/avl.h>
|
||||
|
||||
#define ATF_AVG_SCALE 12
|
||||
|
||||
#define ATF_AVG_WEIGHT_FACTOR 3
|
||||
#define ATF_AVG_WEIGHT_DIV 4
|
||||
|
||||
#define MAC_ADDR_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
|
||||
#define MAC_ADDR_DATA(_a) \
|
||||
((const uint8_t *)(_a))[0], \
|
||||
((const uint8_t *)(_a))[1], \
|
||||
((const uint8_t *)(_a))[2], \
|
||||
((const uint8_t *)(_a))[3], \
|
||||
((const uint8_t *)(_a))[4], \
|
||||
((const uint8_t *)(_a))[5]
|
||||
|
||||
#define D(format, ...) do { \
|
||||
if (debug_flag) \
|
||||
fprintf(stderr, "DEBUG: %s(%d) " format "\n", __func__, __LINE__, ## __VA_ARGS__); \
|
||||
} while (0)
|
||||
|
||||
struct atf_config {
|
||||
int voice_queue_weight;
|
||||
int min_pkt_thresh;
|
||||
|
||||
int bulk_percent_thresh;
|
||||
int prio_percent_thresh;
|
||||
|
||||
int weight_normal;
|
||||
int weight_prio;
|
||||
int weight_bulk;
|
||||
};
|
||||
|
||||
struct atf_interface {
|
||||
struct avl_node avl;
|
||||
|
||||
char ifname[IFNAMSIZ + 1];
|
||||
uint32_t ubus_obj;
|
||||
|
||||
struct avl_tree stations;
|
||||
};
|
||||
|
||||
struct atf_stats {
|
||||
uint64_t bulk, normal, prio;
|
||||
};
|
||||
|
||||
struct atf_station {
|
||||
struct avl_node avl;
|
||||
uint8_t macaddr[6];
|
||||
bool present;
|
||||
|
||||
uint8_t stats_idx;
|
||||
struct atf_stats stats[2];
|
||||
|
||||
uint16_t avg_bulk;
|
||||
uint16_t avg_prio;
|
||||
|
||||
int weight;
|
||||
};
|
||||
|
||||
extern struct atf_config config;
|
||||
extern int debug_flag;
|
||||
|
||||
void reset_config(void);
|
||||
|
||||
struct atf_interface *atf_interface_get(const char *ifname);
|
||||
void atf_interface_sta_update(struct atf_interface *iface);
|
||||
struct atf_station *atf_interface_sta_get(struct atf_interface *iface, uint8_t *macaddr);
|
||||
void atf_interface_sta_changed(struct atf_interface *iface, struct atf_station *sta);
|
||||
void atf_interface_sta_flush(struct atf_interface *iface);
|
||||
void atf_interface_update_all(void);
|
||||
|
||||
int atf_ubus_init(void);
|
||||
void atf_ubus_stop(void);
|
||||
void atf_ubus_set_sta_weight(struct atf_interface *iface, struct atf_station *sta);
|
||||
|
||||
int atf_nl80211_init(void);
|
||||
int atf_nl80211_interface_update(struct atf_interface *iface);
|
||||
|
||||
#endif
|
||||
108
feeds/ucentral/atfpolicy/src/interface.c
Normal file
108
feeds/ucentral/atfpolicy/src/interface.c
Normal file
@@ -0,0 +1,108 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <libubox/avl-cmp.h>
|
||||
|
||||
#include "atf.h"
|
||||
|
||||
static AVL_TREE(interfaces, avl_strcmp, false, NULL);
|
||||
|
||||
#ifndef container_of_safe
|
||||
#define container_of_safe(ptr, type, member) \
|
||||
(ptr ? container_of(ptr, type, member) : NULL)
|
||||
#endif
|
||||
|
||||
static int avl_macaddr_cmp(const void *k1, const void *k2, void *ptr)
|
||||
{
|
||||
return memcmp(k1, k2, 6);
|
||||
}
|
||||
|
||||
void atf_interface_sta_update(struct atf_interface *iface)
|
||||
{
|
||||
struct atf_station *sta;
|
||||
|
||||
avl_for_each_element(&iface->stations, sta, avl)
|
||||
sta->present = false;
|
||||
}
|
||||
|
||||
struct atf_station *atf_interface_sta_get(struct atf_interface *iface, uint8_t *macaddr)
|
||||
{
|
||||
struct atf_station *sta;
|
||||
|
||||
sta = avl_find_element(&iface->stations, macaddr, sta, avl);
|
||||
if (sta)
|
||||
goto out;
|
||||
|
||||
sta = calloc(1, sizeof(*sta));
|
||||
memcpy(sta->macaddr, macaddr, sizeof(sta->macaddr));
|
||||
sta->avl.key = sta->macaddr;
|
||||
sta->weight = -1;
|
||||
avl_insert(&iface->stations, &sta->avl);
|
||||
|
||||
out:
|
||||
sta->present = true;
|
||||
return sta;
|
||||
}
|
||||
|
||||
void atf_interface_sta_flush(struct atf_interface *iface)
|
||||
{
|
||||
struct atf_station *sta, *tmp;
|
||||
|
||||
avl_for_each_element_safe(&iface->stations, sta, avl, tmp) {
|
||||
if (sta->present)
|
||||
continue;
|
||||
|
||||
avl_delete(&iface->stations, &sta->avl);
|
||||
free(sta);
|
||||
}
|
||||
}
|
||||
|
||||
void atf_interface_sta_changed(struct atf_interface *iface, struct atf_station *sta)
|
||||
{
|
||||
int weight;
|
||||
|
||||
if (sta->avg_prio > config.prio_percent_thresh)
|
||||
weight = config.weight_prio;
|
||||
else if (sta->avg_prio > config.bulk_percent_thresh)
|
||||
weight = config.weight_bulk;
|
||||
else
|
||||
weight = config.weight_normal;
|
||||
|
||||
if (sta->weight == weight)
|
||||
return;
|
||||
|
||||
sta->weight = weight;
|
||||
atf_ubus_set_sta_weight(iface, sta);
|
||||
}
|
||||
|
||||
struct atf_interface *atf_interface_get(const char *ifname)
|
||||
{
|
||||
struct atf_interface *iface;
|
||||
|
||||
iface = avl_find_element(&interfaces, ifname, iface, avl);
|
||||
if (iface)
|
||||
return iface;
|
||||
|
||||
if (strlen(ifname) + 1 > sizeof(iface->ifname))
|
||||
return NULL;
|
||||
|
||||
iface = calloc(1, sizeof(*iface));
|
||||
strcpy(iface->ifname, ifname);
|
||||
iface->avl.key = iface->ifname;
|
||||
avl_init(&iface->stations, avl_macaddr_cmp, false, NULL);
|
||||
avl_insert(&interfaces, &iface->avl);
|
||||
|
||||
return iface;
|
||||
}
|
||||
|
||||
void atf_interface_update_all(void)
|
||||
{
|
||||
struct atf_interface *iface, *tmp;
|
||||
|
||||
avl_for_each_element_safe(&interfaces, iface, avl, tmp)
|
||||
atf_nl80211_interface_update(iface);
|
||||
}
|
||||
62
feeds/ucentral/atfpolicy/src/main.c
Normal file
62
feeds/ucentral/atfpolicy/src/main.c
Normal file
@@ -0,0 +1,62 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <getopt.h>
|
||||
|
||||
#include <libubox/uloop.h>
|
||||
|
||||
#include "atf.h"
|
||||
|
||||
struct atf_config config;
|
||||
int debug_flag;
|
||||
|
||||
void reset_config(void)
|
||||
{
|
||||
memset(&config, 0, sizeof(config));
|
||||
|
||||
config.voice_queue_weight = 4;
|
||||
config.min_pkt_thresh = 100;
|
||||
|
||||
config.bulk_percent_thresh = (50 << ATF_AVG_SCALE) / 100;
|
||||
config.prio_percent_thresh = (30 << ATF_AVG_SCALE) / 100;
|
||||
|
||||
config.weight_normal = 256;
|
||||
config.weight_bulk = 128;
|
||||
config.weight_prio = 512;
|
||||
}
|
||||
|
||||
static void atf_update_cb(struct uloop_timeout *t)
|
||||
{
|
||||
atf_interface_update_all();
|
||||
uloop_timeout_set(t, 1000);
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
static struct uloop_timeout update_timer = {
|
||||
.cb = atf_update_cb,
|
||||
};
|
||||
int ch;
|
||||
|
||||
while ((ch = getopt(argc, argv, "d")) != -1) {
|
||||
switch (ch) {
|
||||
case 'd':
|
||||
debug_flag = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
reset_config();
|
||||
uloop_init();
|
||||
atf_ubus_init();
|
||||
atf_nl80211_init();
|
||||
atf_update_cb(&update_timer);
|
||||
uloop_run();
|
||||
atf_ubus_stop();
|
||||
uloop_done();
|
||||
|
||||
return 0;
|
||||
}
|
||||
174
feeds/ucentral/atfpolicy/src/nl80211.c
Normal file
174
feeds/ucentral/atfpolicy/src/nl80211.c
Normal file
@@ -0,0 +1,174 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#define _GNU_SOURCE
|
||||
#include <linux/nl80211.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <net/if.h>
|
||||
#include <unl.h>
|
||||
|
||||
#include "atf.h"
|
||||
|
||||
static struct unl unl;
|
||||
|
||||
static void
|
||||
atf_parse_tid_stats(struct atf_interface *iface, struct atf_stats *stats,
|
||||
int tid, struct nlattr *attr)
|
||||
{
|
||||
struct nlattr *tb[NL80211_TID_STATS_MAX + 1];
|
||||
uint64_t msdu;
|
||||
|
||||
if (nla_parse_nested(tb, NL80211_TID_STATS_MAX, attr, NULL))
|
||||
return;
|
||||
|
||||
if (!tb[NL80211_TID_STATS_TX_MSDU])
|
||||
return;
|
||||
|
||||
msdu = nla_get_u64(tb[NL80211_TID_STATS_TX_MSDU]);
|
||||
switch (tid) {
|
||||
case 0:
|
||||
case 3:
|
||||
/* BE */
|
||||
stats->normal += msdu;
|
||||
break;
|
||||
case 1:
|
||||
case 2:
|
||||
/* BK */
|
||||
stats->bulk += msdu;
|
||||
break;
|
||||
case 4:
|
||||
case 5:
|
||||
/* VI */
|
||||
stats->prio += msdu;
|
||||
break;
|
||||
case 6:
|
||||
case 7:
|
||||
stats->prio += msdu * config.voice_queue_weight;
|
||||
/* VO */
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static uint64_t atf_stats_total(struct atf_stats *stats)
|
||||
{
|
||||
return stats->normal + stats->prio + stats->bulk;
|
||||
}
|
||||
|
||||
static void atf_stats_diff(struct atf_stats *dest, struct atf_stats *cur, struct atf_stats *prev)
|
||||
{
|
||||
dest->normal = cur->normal - prev->normal;
|
||||
dest->prio = cur->prio - prev->prio;
|
||||
dest->bulk = cur->bulk - prev->bulk;
|
||||
}
|
||||
|
||||
static uint16_t atf_stats_avg(uint16_t avg, uint64_t cur, uint32_t total)
|
||||
{
|
||||
cur <<= ATF_AVG_SCALE;
|
||||
cur /= total;
|
||||
|
||||
if (!avg)
|
||||
return (uint16_t)cur;
|
||||
|
||||
avg *= ATF_AVG_WEIGHT_FACTOR;
|
||||
avg += cur * (ATF_AVG_WEIGHT_DIV - ATF_AVG_WEIGHT_FACTOR);
|
||||
avg /= ATF_AVG_WEIGHT_DIV;
|
||||
|
||||
if (!avg)
|
||||
avg = 1;
|
||||
|
||||
return avg;
|
||||
}
|
||||
|
||||
|
||||
static void atf_sta_update_avg(struct atf_station *sta, struct atf_stats *cur)
|
||||
{
|
||||
uint64_t total = atf_stats_total(cur);
|
||||
|
||||
D("sta "MAC_ADDR_FMT" total pkts: total=%d bulk=%d normal=%d prio=%d",
|
||||
MAC_ADDR_DATA(sta->macaddr), (uint32_t)total,
|
||||
(uint32_t)cur->bulk, (uint32_t)cur->normal, (uint32_t)cur->prio);
|
||||
if (total < config.min_pkt_thresh)
|
||||
return;
|
||||
|
||||
sta->avg_bulk = atf_stats_avg(sta->avg_bulk, cur->bulk, total);
|
||||
sta->avg_prio = atf_stats_avg(sta->avg_prio, cur->prio, total);
|
||||
D("avg bulk=%d prio=%d",
|
||||
(sta->avg_bulk * 100) >> ATF_AVG_SCALE,
|
||||
(sta->avg_prio * 100) >> ATF_AVG_SCALE);
|
||||
sta->stats_idx = !sta->stats_idx;
|
||||
}
|
||||
|
||||
static int
|
||||
atf_sta_cb(struct nl_msg *msg, void *arg)
|
||||
{
|
||||
struct atf_interface *iface = arg;
|
||||
struct genlmsghdr *gnlh = nlmsg_data(nlmsg_hdr(msg));
|
||||
struct nlattr *tb[NL80211_ATTR_MAX + 1];
|
||||
struct nlattr *sinfo[NL80211_STA_INFO_MAX + 1];
|
||||
struct atf_station *sta;
|
||||
struct atf_stats *stats, diff = {};
|
||||
struct nlattr *cur;
|
||||
int idx = 0;
|
||||
int rem;
|
||||
|
||||
nla_parse(tb, NL80211_ATTR_MAX, genlmsg_attrdata(gnlh, 0),
|
||||
genlmsg_attrlen(gnlh, 0), NULL);
|
||||
|
||||
if (!tb[NL80211_ATTR_STA_INFO] || !tb[NL80211_ATTR_MAC])
|
||||
return NL_SKIP;
|
||||
|
||||
if (nla_parse_nested(sinfo, NL80211_STA_INFO_MAX,
|
||||
tb[NL80211_ATTR_STA_INFO], NULL))
|
||||
return NL_SKIP;
|
||||
|
||||
if (!sinfo[NL80211_STA_INFO_TID_STATS])
|
||||
return NL_SKIP;
|
||||
|
||||
sta = atf_interface_sta_get(iface, nla_data(tb[NL80211_ATTR_MAC]));
|
||||
if (!sta)
|
||||
return NL_SKIP;
|
||||
|
||||
stats = &sta->stats[sta->stats_idx];
|
||||
memset(stats, 0, sizeof(*stats));
|
||||
nla_for_each_nested(cur, sinfo[NL80211_STA_INFO_TID_STATS], rem)
|
||||
atf_parse_tid_stats(iface, stats, idx++, cur);
|
||||
|
||||
atf_stats_diff(&diff, stats, &sta->stats[!sta->stats_idx]);
|
||||
atf_sta_update_avg(sta, &diff);
|
||||
atf_interface_sta_changed(iface, sta);
|
||||
|
||||
return NL_SKIP;
|
||||
}
|
||||
|
||||
int atf_nl80211_interface_update(struct atf_interface *iface)
|
||||
{
|
||||
struct nl_msg *msg;
|
||||
int ifindex;
|
||||
|
||||
ifindex = if_nametoindex(iface->ifname);
|
||||
if (!ifindex)
|
||||
return -1;
|
||||
|
||||
atf_interface_sta_update(iface);
|
||||
|
||||
msg = unl_genl_msg(&unl, NL80211_CMD_GET_STATION, true);
|
||||
NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, ifindex);
|
||||
unl_genl_request(&unl, msg, atf_sta_cb, iface);
|
||||
|
||||
atf_interface_sta_flush(iface);
|
||||
|
||||
return 0;
|
||||
|
||||
nla_put_failure:
|
||||
nlmsg_free(msg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
int atf_nl80211_init(void)
|
||||
{
|
||||
return unl_genl_init(&unl, "nl80211");
|
||||
}
|
||||
164
feeds/ucentral/atfpolicy/src/ubus.c
Normal file
164
feeds/ucentral/atfpolicy/src/ubus.c
Normal file
@@ -0,0 +1,164 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <libubus.h>
|
||||
|
||||
#include "atf.h"
|
||||
|
||||
#define HOSTAPD_PREFIX "hostapd."
|
||||
|
||||
static struct ubus_auto_conn conn;
|
||||
static struct blob_buf b;
|
||||
|
||||
enum {
|
||||
ATF_CONFIG_RESET,
|
||||
ATF_CONFIG_VO_Q_WEIGHT,
|
||||
ATF_CONFIG_MIN_PKT_THRESH,
|
||||
ATF_CONFIG_BULK_PERCENT_THR,
|
||||
ATF_CONFIG_PRIO_PERCENT_THR,
|
||||
|
||||
ATF_CONFIG_WEIGHT_NORMAL,
|
||||
ATF_CONFIG_WEIGHT_PRIO,
|
||||
ATF_CONFIG_WEIGHT_BULK,
|
||||
__ATF_CONFIG_MAX
|
||||
};
|
||||
|
||||
static const struct blobmsg_policy atf_config_policy[__ATF_CONFIG_MAX] = {
|
||||
[ATF_CONFIG_VO_Q_WEIGHT] = { "vo_queue_weight", BLOBMSG_TYPE_INT32 },
|
||||
[ATF_CONFIG_MIN_PKT_THRESH] = { "update_pkt_threshold", BLOBMSG_TYPE_INT32 },
|
||||
[ATF_CONFIG_BULK_PERCENT_THR] = { "bulk_percent_thresh", BLOBMSG_TYPE_INT32 },
|
||||
[ATF_CONFIG_PRIO_PERCENT_THR] = { "prio_percent_thresh", BLOBMSG_TYPE_INT32 },
|
||||
[ATF_CONFIG_WEIGHT_NORMAL] = { "weight_normal", BLOBMSG_TYPE_INT32 },
|
||||
[ATF_CONFIG_WEIGHT_PRIO] = { "weight_prio", BLOBMSG_TYPE_INT32 },
|
||||
[ATF_CONFIG_WEIGHT_BULK] = { "weight_bulk", BLOBMSG_TYPE_INT32 },
|
||||
};
|
||||
|
||||
static int
|
||||
atf_ubus_config(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct blob_attr *tb[__ATF_CONFIG_MAX];
|
||||
struct blob_attr *cur;
|
||||
static const struct {
|
||||
int id;
|
||||
int *field;
|
||||
} field_map[] = {
|
||||
{ ATF_CONFIG_VO_Q_WEIGHT, &config.voice_queue_weight },
|
||||
{ ATF_CONFIG_MIN_PKT_THRESH, &config.min_pkt_thresh },
|
||||
{ ATF_CONFIG_BULK_PERCENT_THR, &config.bulk_percent_thresh },
|
||||
{ ATF_CONFIG_PRIO_PERCENT_THR, &config.prio_percent_thresh },
|
||||
{ ATF_CONFIG_WEIGHT_NORMAL, &config.weight_normal },
|
||||
{ ATF_CONFIG_WEIGHT_PRIO, &config.weight_prio },
|
||||
{ ATF_CONFIG_WEIGHT_BULK, &config.weight_bulk },
|
||||
};
|
||||
bool reset = false;
|
||||
int i;
|
||||
|
||||
blobmsg_parse(atf_config_policy, __ATF_CONFIG_MAX, tb,
|
||||
blobmsg_data(msg), blobmsg_len(msg));
|
||||
|
||||
if ((cur = tb[ATF_CONFIG_RESET]) != NULL)
|
||||
reset = blobmsg_get_bool(cur);
|
||||
|
||||
if (reset)
|
||||
reset_config();
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(field_map); i++) {
|
||||
if ((cur = tb[field_map[i].id]) != NULL)
|
||||
*(field_map[i].field) = blobmsg_get_u32(cur);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static const struct ubus_method atf_methods[] = {
|
||||
UBUS_METHOD("config", atf_ubus_config, atf_config_policy),
|
||||
};
|
||||
|
||||
static struct ubus_object_type atf_object_type =
|
||||
UBUS_OBJECT_TYPE("atfpolicy", atf_methods);
|
||||
|
||||
static struct ubus_object atf_object = {
|
||||
.name = "atfpolicy",
|
||||
.type = &atf_object_type,
|
||||
.methods = atf_methods,
|
||||
.n_methods = ARRAY_SIZE(atf_methods),
|
||||
};
|
||||
|
||||
static void
|
||||
atf_ubus_add_interface(struct ubus_context *ctx, const char *name)
|
||||
{
|
||||
struct atf_interface *iface;
|
||||
|
||||
iface = atf_interface_get(name + strlen(HOSTAPD_PREFIX));
|
||||
if (!iface)
|
||||
return;
|
||||
|
||||
iface->ubus_obj = 0;
|
||||
ubus_lookup_id(ctx, name, &iface->ubus_obj);
|
||||
D("add interface %s", name + strlen(HOSTAPD_PREFIX));
|
||||
}
|
||||
|
||||
static void
|
||||
atf_ubus_lookup_cb(struct ubus_context *ctx, struct ubus_object_data *obj,
|
||||
void *priv)
|
||||
{
|
||||
if (!strncmp(obj->path, HOSTAPD_PREFIX, strlen(HOSTAPD_PREFIX)))
|
||||
atf_ubus_add_interface(ctx, obj->path);
|
||||
}
|
||||
|
||||
void atf_ubus_set_sta_weight(struct atf_interface *iface, struct atf_station *sta)
|
||||
{
|
||||
D("set sta "MAC_ADDR_FMT" weight=%d", MAC_ADDR_DATA(sta->macaddr), sta->weight);
|
||||
blob_buf_init(&b, 0);
|
||||
blobmsg_printf(&b, "sta", MAC_ADDR_FMT, MAC_ADDR_DATA(sta->macaddr));
|
||||
blobmsg_add_u32(&b, "weight", sta->weight);
|
||||
if (ubus_invoke(&conn.ctx, iface->ubus_obj, "update_airtime", b.head, NULL, NULL, 100))
|
||||
D("set airtime weight failed");
|
||||
}
|
||||
|
||||
static void
|
||||
atf_ubus_event_cb(struct ubus_context *ctx, struct ubus_event_handler *ev,
|
||||
const char *type, struct blob_attr *msg)
|
||||
{
|
||||
static const struct blobmsg_policy policy =
|
||||
{ "path", BLOBMSG_TYPE_STRING };
|
||||
struct ubus_object_data obj;
|
||||
struct blob_attr *attr;
|
||||
|
||||
blobmsg_parse(&policy, 1, &attr, blobmsg_data(msg), blobmsg_len(msg));
|
||||
|
||||
if (!attr)
|
||||
return;
|
||||
|
||||
obj.path = blobmsg_get_string(attr);
|
||||
atf_ubus_lookup_cb(ctx, &obj, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
ubus_connect_handler(struct ubus_context *ctx)
|
||||
{
|
||||
static struct ubus_event_handler ev = {
|
||||
.cb = atf_ubus_event_cb
|
||||
};
|
||||
|
||||
ubus_add_object(ctx, &atf_object);
|
||||
ubus_register_event_handler(ctx, &ev, "ubus.object.add");
|
||||
ubus_lookup(ctx, "hostapd.*", atf_ubus_lookup_cb, NULL);
|
||||
}
|
||||
|
||||
int atf_ubus_init(void)
|
||||
{
|
||||
conn.cb = ubus_connect_handler;
|
||||
ubus_auto_connect(&conn);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void atf_ubus_stop(void)
|
||||
{
|
||||
ubus_auto_shutdown(&conn);
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
config defaults
|
||||
list defaults /etc/qosify-defaults.conf
|
||||
option dscp_prio CS5
|
||||
option dscp_icmp CS6
|
||||
option dscp_bulk CS0
|
||||
option dscp_default_udp CS4
|
||||
option bulk_trigger_timeout 5
|
||||
option bulk_trigger_pps 0
|
||||
option bulk_trigger_pps 100
|
||||
option prio_max_avg_pkt_len 500
|
||||
|
||||
config interface wan
|
||||
option name wan
|
||||
|
||||
@@ -30,10 +30,12 @@ add_defaults() {
|
||||
add_option int timeout
|
||||
add_option string dscp_prio
|
||||
add_option string dscp_bulk
|
||||
add_option string dscp_icmp
|
||||
add_option string dscp_default_udp
|
||||
add_option string dscp_default_tcp
|
||||
add_option int bulk_trigger_timeout
|
||||
add_option int bulk_trigger_pps
|
||||
add_option int prio_max_avg_pkt_len
|
||||
}
|
||||
|
||||
add_interface() {
|
||||
|
||||
112
feeds/ucentral/qosify/src/README
Normal file
112
feeds/ucentral/qosify/src/README
Normal file
@@ -0,0 +1,112 @@
|
||||
QoSify is simple daemon for setting up and managing CAKE along with a custom
|
||||
eBPF based classifier that sets DSCP fields of packets.
|
||||
|
||||
It supports the following features:
|
||||
- simple TCP/UDP port based mapping
|
||||
- IP address based mapping
|
||||
- priority boosting based on average packet size
|
||||
- bulk flow detection based on number of packets per second
|
||||
- dynamically add IP entries with timeout
|
||||
- dns regex entries and ubus api for providing dns lookup results
|
||||
|
||||
It can be configured via ubus call qosify config.
|
||||
|
||||
This call supports the following parameters:
|
||||
- "reset": BOOL
|
||||
Reset the config to defaults instead of only updating supplied values
|
||||
|
||||
- "files": ARRAY of STRING
|
||||
List of files with port/IP/host mappings
|
||||
|
||||
- "timeout": INT32
|
||||
Default timeout for dynamically added entries
|
||||
|
||||
- "dscp_default_udp": STRING
|
||||
Default DSCP value for UDP packets
|
||||
|
||||
- "dscp_default_tcp": STRING
|
||||
Default DSCP value for TCP packets
|
||||
|
||||
- "dscp_prio": STRING
|
||||
DSCP value for priority-marked packets
|
||||
|
||||
- "dscp_bulk": STRING
|
||||
DSCP value for bulk-marked packets
|
||||
|
||||
- "dscp_icmp": STRING
|
||||
DSCP value for ICMP packets
|
||||
|
||||
- "bulk_trigger_pps": INT32
|
||||
Number of packets per second to trigger bulk flow detection
|
||||
|
||||
- "bulk_trigger_timeout": INT32
|
||||
Time below bulk_trigger_pps threshold until a bulk flow mark is removed
|
||||
|
||||
- "prio_max_avg_pkt_len": INT32
|
||||
Maximum average packet length for marking a flow as priority
|
||||
|
||||
- "interfaces": TABLE of TABLE
|
||||
netifd interfaces to enable QoS on
|
||||
|
||||
- "devices": TABLE of TABLE
|
||||
netdevs to enable QoS on
|
||||
|
||||
|
||||
interface/device properties:
|
||||
- "bandwidth_up": STRING
|
||||
Uplink bandwidth (same format as tc)
|
||||
|
||||
- "bandwidth_down": STRING
|
||||
Downlink bandwidth (same format as tc)
|
||||
|
||||
- "ingress": BOOL
|
||||
Enable ingress shaping
|
||||
|
||||
- "egress": BOOL
|
||||
Enable egress shaping
|
||||
|
||||
- "mode": STRING
|
||||
CAKE diffserv mode
|
||||
|
||||
- "nat": BOOL
|
||||
Enable CAKE NAT host detection via conntrack
|
||||
|
||||
- "host_isolate": BOOL
|
||||
Enable CAKE host isolation
|
||||
|
||||
- "autorate_ingress": BOOL
|
||||
Enable CAKE automatic rate estimation for ingress
|
||||
|
||||
- "ingress_options": STRING
|
||||
CAKE ingress options
|
||||
|
||||
- "egress_options": STRING
|
||||
CAKE egress options
|
||||
|
||||
- "options": STRING
|
||||
CAKE options for ingress + egress
|
||||
|
||||
|
||||
Mapping file syntax:
|
||||
|
||||
Each line has two whitespace separated fields, match and dscp
|
||||
match is one of:
|
||||
- tcp:<port>[-<endport>]
|
||||
TCP single port, or range from <port> to <endport>
|
||||
- udp:<port>[-<endport>]
|
||||
UDP single port, or range from <port> to <endport>
|
||||
- <ipaddr>
|
||||
IPv4 address, e.g. 1.1.1.1
|
||||
- <ipv6addr>
|
||||
IPv6 address, e.g. ff01::1
|
||||
- dns:<regex>
|
||||
POSIX.2 extended regular expression for matching hostnames
|
||||
Only works, if dns lookups are passed to qosify via the add_dns_host ubus call.
|
||||
|
||||
dscp can be a raw value, or a codepoint like CS0
|
||||
Adding a + in front of the value tells qosify to only override the DSCP value if it is zero
|
||||
|
||||
|
||||
Planned features:
|
||||
- Integration with dnsmasq to support hostname pattern based DSCP marking
|
||||
- Support for LAN host based priority
|
||||
@@ -1,3 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <sys/wait.h>
|
||||
@@ -130,8 +134,9 @@ static const char *check_str(struct blob_attr *attr)
|
||||
}
|
||||
|
||||
static void
|
||||
iface_config_set(struct qosify_iface_config *cfg, struct blob_attr *attr)
|
||||
iface_config_set(struct qosify_iface *iface, struct blob_attr *attr)
|
||||
{
|
||||
struct qosify_iface_config *cfg = &iface->config;
|
||||
struct blob_attr *tb[__IFACE_ATTR_MAX];
|
||||
struct blob_attr *cur;
|
||||
|
||||
@@ -145,6 +150,7 @@ iface_config_set(struct qosify_iface_config *cfg, struct blob_attr *attr)
|
||||
cfg->egress = true;
|
||||
cfg->host_isolate = true;
|
||||
cfg->autorate_ingress = true;
|
||||
cfg->nat = !iface->device;
|
||||
|
||||
if ((cur = tb[IFACE_ATTR_BW_UP]) != NULL)
|
||||
cfg->bandwidth_up = check_str(cur);
|
||||
@@ -386,7 +392,7 @@ static void
|
||||
interface_set_config(struct qosify_iface *iface, struct blob_attr *config)
|
||||
{
|
||||
iface->config_data = blob_memdup(config);
|
||||
iface_config_set(&iface->config, iface->config_data);
|
||||
iface_config_set(iface, iface->config_data);
|
||||
interface_start(iface);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <sys/resource.h>
|
||||
#include <sys/stat.h>
|
||||
#include <arpa/inet.h>
|
||||
@@ -35,24 +39,17 @@ static void qosify_fill_rodata(struct bpf_object *obj, uint32_t flags)
|
||||
}
|
||||
|
||||
static int
|
||||
qosify_create_program(const char *suffix, uint32_t flags, bool *force_init)
|
||||
qosify_create_program(const char *suffix, uint32_t flags)
|
||||
{
|
||||
DECLARE_LIBBPF_OPTS(bpf_object_open_opts, opts,
|
||||
.pin_root_path = CLASSIFY_DATA_PATH,
|
||||
);
|
||||
struct bpf_program *prog;
|
||||
struct bpf_object *obj;
|
||||
struct stat st;
|
||||
char path[256];
|
||||
int err;
|
||||
|
||||
snprintf(path, sizeof(path), CLASSIFY_PIN_PATH "_" "%s", suffix);
|
||||
if (!*force_init) {
|
||||
if (stat(path, &st) == 0)
|
||||
return 0;
|
||||
|
||||
*force_init = true;
|
||||
}
|
||||
|
||||
obj = bpf_object__open_file(CLASSIFY_PROG_PATH, &opts);
|
||||
err = libbpf_get_error(obj);
|
||||
@@ -91,7 +88,7 @@ qosify_create_program(const char *suffix, uint32_t flags, bool *force_init)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int qosify_loader_init(bool force_init)
|
||||
int qosify_loader_init(void)
|
||||
{
|
||||
static const struct {
|
||||
const char *suffix;
|
||||
@@ -105,8 +102,7 @@ int qosify_loader_init(bool force_init)
|
||||
glob_t g;
|
||||
int i;
|
||||
|
||||
if (force_init &&
|
||||
glob(CLASSIFY_DATA_PATH "/*", 0, NULL, &g) == 0) {
|
||||
if (glob(CLASSIFY_DATA_PATH "/*", 0, NULL, &g) == 0) {
|
||||
for (i = 0; i < g.gl_pathc; i++)
|
||||
unlink(g.gl_pathv[i]);
|
||||
}
|
||||
@@ -117,8 +113,7 @@ int qosify_loader_init(bool force_init)
|
||||
qosify_init_env();
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(progs); i++) {
|
||||
if (qosify_create_program(progs[i].suffix, progs[i].flags,
|
||||
&force_init))
|
||||
if (qosify_create_program(progs[i].suffix, progs[i].flags))
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <stdint.h>
|
||||
@@ -10,7 +14,6 @@ static int usage(const char *progname)
|
||||
{
|
||||
fprintf(stderr, "Usage: %s [options]\n"
|
||||
"Options:\n"
|
||||
" -f: force reload of BPF programs\n"
|
||||
" -l <file> Load defaults from <file>\n"
|
||||
" -o only load program/maps without running as daemon\n"
|
||||
"\n", progname);
|
||||
@@ -21,14 +24,12 @@ static int usage(const char *progname)
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
const char *load_file = NULL;
|
||||
bool force_init = false;
|
||||
bool oneshot = false;
|
||||
int ch;
|
||||
|
||||
while ((ch = getopt(argc, argv, "fl:o")) != -1) {
|
||||
switch (ch) {
|
||||
case 'f':
|
||||
force_init = true;
|
||||
break;
|
||||
case 'l':
|
||||
load_file = optarg;
|
||||
@@ -41,7 +42,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
}
|
||||
|
||||
if (qosify_loader_init(force_init))
|
||||
if (qosify_loader_init())
|
||||
return 2;
|
||||
|
||||
if (qosify_map_init())
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <arpa/inet.h>
|
||||
|
||||
#include <errno.h>
|
||||
@@ -17,7 +21,8 @@ static AVL_TREE(map_data, qosify_map_entry_cmp, false, NULL);
|
||||
static LIST_HEAD(map_files);
|
||||
static uint32_t next_timeout;
|
||||
static uint8_t qosify_dscp_default[2] = { 0xff, 0xff };
|
||||
int qosify_map_timeout = 3600;
|
||||
int qosify_map_timeout;
|
||||
int qosify_active_timeout;
|
||||
struct qosify_config config;
|
||||
|
||||
struct qosify_map_file {
|
||||
@@ -34,6 +39,37 @@ static const struct {
|
||||
[CL_MAP_IPV4_ADDR] = { "ipv4_map", "ipv4_addr" },
|
||||
[CL_MAP_IPV6_ADDR] = { "ipv6_map", "ipv6_addr" },
|
||||
[CL_MAP_CONFIG] = { "config", "config" },
|
||||
[CL_MAP_DNS] = { "dns", "dns" },
|
||||
};
|
||||
|
||||
static const struct {
|
||||
const char name[5];
|
||||
uint8_t val;
|
||||
} codepoints[] = {
|
||||
{ "CS0", 0 },
|
||||
{ "CS1", 8 },
|
||||
{ "CS2", 16 },
|
||||
{ "CS3", 24 },
|
||||
{ "CS4", 32 },
|
||||
{ "CS5", 40 },
|
||||
{ "CS6", 48 },
|
||||
{ "CS7", 56 },
|
||||
{ "AF11", 10 },
|
||||
{ "AF12", 12 },
|
||||
{ "AF13", 14 },
|
||||
{ "AF21", 18 },
|
||||
{ "AF22", 20 },
|
||||
{ "AF22", 22 },
|
||||
{ "AF31", 26 },
|
||||
{ "AF32", 28 },
|
||||
{ "AF33", 30 },
|
||||
{ "AF41", 34 },
|
||||
{ "AF42", 36 },
|
||||
{ "AF43", 38 },
|
||||
{ "EF", 46 },
|
||||
{ "VA", 44 },
|
||||
{ "LE", 1 },
|
||||
{ "DF", 0 },
|
||||
};
|
||||
|
||||
static void qosify_map_timer_cb(struct uloop_timeout *t)
|
||||
@@ -104,6 +140,8 @@ static void __qosify_map_set_dscp_default(enum qosify_map_id id, uint8_t val)
|
||||
int fd = qosify_map_fds[id];
|
||||
int i;
|
||||
|
||||
val |= QOSIFY_DSCP_DEFAULT_FLAG;
|
||||
|
||||
for (i = 0; i < (1 << 16); i++) {
|
||||
data.addr.port = htons(i);
|
||||
if (avl_find(&map_data, &data))
|
||||
@@ -135,7 +173,7 @@ int qosify_map_init(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(qosify_map_fds); i++) {
|
||||
for (i = 0; i < CL_MAP_DNS; i++) {
|
||||
qosify_map_fds[i] = qosify_map_get_fd(i);
|
||||
if (qosify_map_fds[i] < 0)
|
||||
return -1;
|
||||
@@ -159,38 +197,11 @@ static char *str_skip(char *str, bool space)
|
||||
static int
|
||||
qosify_map_codepoint(const char *val)
|
||||
{
|
||||
static const struct {
|
||||
const char name[5];
|
||||
uint8_t val;
|
||||
} cp[] = {
|
||||
{ "CS0", 0 },
|
||||
{ "CS1", 8 },
|
||||
{ "CS2", 16 },
|
||||
{ "CS3", 24 },
|
||||
{ "CS4", 32 },
|
||||
{ "CS5", 40 },
|
||||
{ "CS6", 48 },
|
||||
{ "CS7", 56 },
|
||||
{ "AF11", 10 },
|
||||
{ "AF12", 12 },
|
||||
{ "AF13", 14 },
|
||||
{ "AF21", 18 },
|
||||
{ "AF22", 20 },
|
||||
{ "AF22", 22 },
|
||||
{ "AF31", 26 },
|
||||
{ "AF32", 28 },
|
||||
{ "AF33", 30 },
|
||||
{ "AF41", 34 },
|
||||
{ "AF42", 36 },
|
||||
{ "AF43", 38 },
|
||||
{ "EF", 46 },
|
||||
{ "VA", 44 },
|
||||
};
|
||||
int i;
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(cp); i++)
|
||||
if (!strcmp(cp[i].name, val))
|
||||
return cp[i].val;
|
||||
for (i = 0; i < ARRAY_SIZE(codepoints); i++)
|
||||
if (!strcmp(codepoints[i].name, val))
|
||||
return codepoints[i].val;
|
||||
|
||||
return 0xff;
|
||||
}
|
||||
@@ -203,9 +214,37 @@ static int qosify_map_entry_cmp(const void *k1, const void *k2, void *ptr)
|
||||
if (d1->id != d2->id)
|
||||
return d2->id - d1->id;
|
||||
|
||||
if (d1->id == CL_MAP_DNS)
|
||||
return strcmp(d1->addr.dns.pattern, d2->addr.dns.pattern);
|
||||
|
||||
return memcmp(&d1->addr, &d2->addr, sizeof(d1->addr));
|
||||
}
|
||||
|
||||
static struct qosify_map_entry *
|
||||
__qosify_map_alloc_entry(struct qosify_map_data *data)
|
||||
{
|
||||
struct qosify_map_entry *e;
|
||||
char *pattern;
|
||||
|
||||
if (data->id < CL_MAP_DNS) {
|
||||
e = calloc(1, sizeof(*e));
|
||||
memcpy(&e->data.addr, &data->addr, sizeof(e->data.addr));
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
e = calloc_a(sizeof(*e), &pattern, strlen(data->addr.dns.pattern) + 1);
|
||||
strcpy(pattern, data->addr.dns.pattern);
|
||||
e->data.addr.dns.pattern = pattern;
|
||||
if (regcomp(&e->data.addr.dns.regex, pattern,
|
||||
REG_EXTENDED | REG_ICASE | REG_NOSUB)) {
|
||||
free(e);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return e;
|
||||
}
|
||||
|
||||
static void __qosify_map_set_entry(struct qosify_map_data *data)
|
||||
{
|
||||
int fd = qosify_map_fds[data->id];
|
||||
@@ -220,10 +259,12 @@ static void __qosify_map_set_entry(struct qosify_map_data *data)
|
||||
if (!add)
|
||||
return;
|
||||
|
||||
e = calloc(1, sizeof(*e));
|
||||
e = __qosify_map_alloc_entry(data);
|
||||
if (!e)
|
||||
return;
|
||||
|
||||
e->avl.key = &e->data;
|
||||
e->data.id = data->id;
|
||||
memcpy(&e->data.addr, &data->addr, sizeof(e->data.addr));
|
||||
avl_insert(&map_data, &e->avl);
|
||||
} else {
|
||||
prev_dscp = e->data.dscp;
|
||||
@@ -243,8 +284,14 @@ static void __qosify_map_set_entry(struct qosify_map_data *data)
|
||||
e->data.dscp = e->data.file_dscp;
|
||||
}
|
||||
|
||||
if (e->data.dscp != prev_dscp)
|
||||
bpf_map_update_elem(fd, &data->addr, &e->data.dscp, BPF_ANY);
|
||||
if (e->data.dscp != prev_dscp && data->id < CL_MAP_DNS) {
|
||||
struct qosify_ip_map_val val = {
|
||||
.dscp = e->data.dscp,
|
||||
.seen = 1,
|
||||
};
|
||||
|
||||
bpf_map_update_elem(fd, &data->addr, &val, BPF_ANY);
|
||||
}
|
||||
|
||||
if (add) {
|
||||
if (qosify_map_timeout == ~0 || file) {
|
||||
@@ -313,6 +360,9 @@ int qosify_map_set_entry(enum qosify_map_id id, bool file, const char *str, uint
|
||||
};
|
||||
|
||||
switch (id) {
|
||||
case CL_MAP_DNS:
|
||||
data.addr.dns.pattern = str;
|
||||
break;
|
||||
case CL_MAP_TCP_PORTS:
|
||||
case CL_MAP_UDP_PORTS:
|
||||
return qosify_map_set_port(&data, str);
|
||||
@@ -351,6 +401,28 @@ int qosify_map_dscp_value(const char *val)
|
||||
return dscp + (fallback << 6);
|
||||
}
|
||||
|
||||
static void
|
||||
qosify_map_dscp_codepoint_str(char *dest, int len, uint8_t dscp)
|
||||
{
|
||||
int i;
|
||||
|
||||
if (dscp & QOSIFY_DSCP_FALLBACK_FLAG) {
|
||||
*(dest++) = '+';
|
||||
len--;
|
||||
dscp &= ~QOSIFY_DSCP_FALLBACK_FLAG;
|
||||
}
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(codepoints); i++) {
|
||||
if (codepoints[i].val != dscp)
|
||||
continue;
|
||||
|
||||
snprintf(dest, len, "%s", codepoints[i].name);
|
||||
return;
|
||||
}
|
||||
|
||||
snprintf(dest, len, "0x%x", dscp);
|
||||
}
|
||||
|
||||
static void
|
||||
qosify_map_parse_line(char *str)
|
||||
{
|
||||
@@ -372,6 +444,8 @@ qosify_map_parse_line(char *str)
|
||||
if (dscp < 0)
|
||||
return;
|
||||
|
||||
if (!strncmp(key, "dns:", 4))
|
||||
qosify_map_set_entry(CL_MAP_DNS, true, key + 4, dscp);
|
||||
if (!strncmp(key, "tcp:", 4))
|
||||
qosify_map_set_entry(CL_MAP_TCP_PORTS, true, key + 4, dscp);
|
||||
else if (!strncmp(key, "udp:", 4))
|
||||
@@ -458,6 +532,7 @@ void qosify_map_reset_config(void)
|
||||
qosify_map_set_dscp_default(CL_MAP_TCP_PORTS, 0);
|
||||
qosify_map_set_dscp_default(CL_MAP_UDP_PORTS, 0);
|
||||
qosify_map_timeout = 3600;
|
||||
qosify_active_timeout = 300;
|
||||
|
||||
memset(&config, 0, sizeof(config));
|
||||
config.dscp_prio = 0xff;
|
||||
@@ -477,12 +552,44 @@ void qosify_map_reload(void)
|
||||
qosify_map_gc();
|
||||
}
|
||||
|
||||
static void qosify_map_free_entry(struct qosify_map_entry *e)
|
||||
{
|
||||
int fd = qosify_map_fds[e->data.id];
|
||||
|
||||
avl_delete(&map_data, &e->avl);
|
||||
if (e->data.id < CL_MAP_DNS)
|
||||
bpf_map_delete_elem(fd, &e->data.addr);
|
||||
free(e);
|
||||
}
|
||||
|
||||
static bool
|
||||
qosify_map_entry_refresh_timeout(struct qosify_map_entry *e)
|
||||
{
|
||||
struct qosify_ip_map_val val;
|
||||
int fd = qosify_map_fds[e->data.id];
|
||||
|
||||
if (e->data.id != CL_MAP_IPV4_ADDR &&
|
||||
e->data.id != CL_MAP_IPV6_ADDR)
|
||||
return false;
|
||||
|
||||
if (bpf_map_lookup_elem(fd, &e->data.addr, &val))
|
||||
return false;
|
||||
|
||||
if (!val.seen)
|
||||
return false;
|
||||
|
||||
e->timeout = qosify_gettime() + qosify_active_timeout;
|
||||
val.seen = 0;
|
||||
bpf_map_update_elem(fd, &e->data.addr, &val, BPF_ANY);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void qosify_map_gc(void)
|
||||
{
|
||||
struct qosify_map_entry *e, *tmp;
|
||||
int32_t timeout = 0;
|
||||
uint32_t cur_time = qosify_gettime();
|
||||
int fd;
|
||||
|
||||
next_timeout = 0;
|
||||
avl_for_each_element_safe(&map_data, e, avl, tmp) {
|
||||
@@ -490,6 +597,9 @@ void qosify_map_gc(void)
|
||||
|
||||
if (e->data.user && e->timeout != ~0) {
|
||||
cur_timeout = e->timeout - cur_time;
|
||||
if (cur_timeout <= 0 &&
|
||||
qosify_map_entry_refresh_timeout(e))
|
||||
cur_timeout = e->timeout - cur_time;
|
||||
if (cur_timeout <= 0) {
|
||||
e->data.user = false;
|
||||
e->data.dscp = e->data.file_dscp;
|
||||
@@ -502,10 +612,7 @@ void qosify_map_gc(void)
|
||||
if (e->data.file || e->data.user)
|
||||
continue;
|
||||
|
||||
avl_delete(&map_data, &e->avl);
|
||||
fd = qosify_map_fds[e->data.id];
|
||||
bpf_map_delete_elem(fd, &e->data.addr);
|
||||
free(e);
|
||||
qosify_map_free_entry(e);
|
||||
}
|
||||
|
||||
if (!timeout)
|
||||
@@ -514,6 +621,52 @@ void qosify_map_gc(void)
|
||||
uloop_timeout_set(&qosify_map_timer, timeout * 1000);
|
||||
}
|
||||
|
||||
|
||||
int qosify_map_add_dns_host(const char *host, const char *addr, const char *type, int ttl)
|
||||
{
|
||||
struct qosify_map_data data = {
|
||||
.id = CL_MAP_DNS,
|
||||
.addr.dns.pattern = "",
|
||||
};
|
||||
struct qosify_map_entry *e;
|
||||
int prev_timeout = qosify_map_timeout;
|
||||
|
||||
e = avl_find_ge_element(&map_data, &data, e, avl);
|
||||
if (!e)
|
||||
return 0;
|
||||
|
||||
memset(&data, 0, sizeof(data));
|
||||
data.user = true;
|
||||
if (!strcmp(type, "A"))
|
||||
data.id = CL_MAP_IPV4_ADDR;
|
||||
else if (!strcmp(type, "AAAA"))
|
||||
data.id = CL_MAP_IPV6_ADDR;
|
||||
else
|
||||
return 0;
|
||||
|
||||
if (qosify_map_fill_ip(&data, addr))
|
||||
return -1;
|
||||
|
||||
avl_for_element_to_last(&map_data, e, e, avl) {
|
||||
regex_t *regex = &e->data.addr.dns.regex;
|
||||
|
||||
if (e->data.id != CL_MAP_DNS)
|
||||
return 0;
|
||||
|
||||
if (regexec(regex, host, 0, NULL, 0) != 0)
|
||||
continue;
|
||||
|
||||
if (ttl)
|
||||
qosify_map_timeout = ttl;
|
||||
data.dscp = e->data.dscp;
|
||||
__qosify_map_set_entry(&data);
|
||||
qosify_map_timeout = prev_timeout;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void qosify_map_dump(struct blob_buf *b)
|
||||
{
|
||||
struct qosify_map_entry *e;
|
||||
@@ -543,24 +696,31 @@ void qosify_map_dump(struct blob_buf *b)
|
||||
blobmsg_add_u8(b, "file", e->data.file);
|
||||
blobmsg_add_u8(b, "user", e->data.user);
|
||||
|
||||
buf = blobmsg_alloc_string_buffer(b, "dscp", buf_len);
|
||||
qosify_map_dscp_codepoint_str(buf, buf_len, e->data.dscp);
|
||||
blobmsg_add_string_buffer(b);
|
||||
|
||||
blobmsg_add_string(b, "type", qosify_map_info[e->data.id].type_name);
|
||||
|
||||
buf = blobmsg_alloc_string_buffer(b, "value", buf_len);
|
||||
switch (e->data.id) {
|
||||
case CL_MAP_TCP_PORTS:
|
||||
case CL_MAP_UDP_PORTS:
|
||||
snprintf(buf, buf_len, "%d", ntohs(e->data.addr.port));
|
||||
blobmsg_printf(b, "addr", "%d", ntohs(e->data.addr.port));
|
||||
break;
|
||||
case CL_MAP_IPV4_ADDR:
|
||||
case CL_MAP_IPV6_ADDR:
|
||||
buf = blobmsg_alloc_string_buffer(b, "addr", buf_len);
|
||||
af = e->data.id == CL_MAP_IPV6_ADDR ? AF_INET6 : AF_INET;
|
||||
inet_ntop(af, &e->data.addr, buf, buf_len);
|
||||
blobmsg_add_string_buffer(b);
|
||||
break;
|
||||
case CL_MAP_DNS:
|
||||
blobmsg_add_string(b, "addr", e->data.addr.dns.pattern);
|
||||
break;
|
||||
default:
|
||||
*buf = 0;
|
||||
break;
|
||||
}
|
||||
blobmsg_add_string_buffer(b);
|
||||
blobmsg_close_table(b, c);
|
||||
}
|
||||
blobmsg_close_array(b, a);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#define KBUILD_MODNAME "foo"
|
||||
#include <uapi/linux/bpf.h>
|
||||
#include <uapi/linux/if_ether.h>
|
||||
@@ -16,7 +20,6 @@
|
||||
#include "qosify-bpf.h"
|
||||
|
||||
#define INET_ECN_MASK 3
|
||||
#define DSCP_FALLBACK_FLAG BIT(6)
|
||||
|
||||
#define FLOW_CHECK_INTERVAL ((u32)((1000000000ULL) >> 24))
|
||||
#define FLOW_TIMEOUT ((u32)((30ULL * 1000000000ULL) >> 24))
|
||||
@@ -65,7 +68,7 @@ struct {
|
||||
__uint(type, BPF_MAP_TYPE_HASH);
|
||||
__uint(pinning, 1);
|
||||
__uint(key_size, sizeof(struct in_addr));
|
||||
__type(value, __u8);
|
||||
__type(value, struct qosify_ip_map_val);
|
||||
__uint(max_entries, 100000);
|
||||
__uint(map_flags, BPF_F_NO_PREALLOC);
|
||||
} ipv4_map SEC(".maps");
|
||||
@@ -74,7 +77,7 @@ struct {
|
||||
__uint(type, BPF_MAP_TYPE_HASH);
|
||||
__uint(pinning, 1);
|
||||
__uint(key_size, sizeof(struct in6_addr));
|
||||
__type(value, __u8);
|
||||
__type(value, struct qosify_ip_map_val);
|
||||
__uint(max_entries, 100000);
|
||||
__uint(map_flags, BPF_F_NO_PREALLOC);
|
||||
} ipv6_map SEC(".maps");
|
||||
@@ -211,33 +214,37 @@ static void
|
||||
parse_l4proto(struct qosify_config *config, struct __sk_buff *skb,
|
||||
__u32 offset, __u8 proto, __u8 *dscp_out)
|
||||
{
|
||||
struct udphdr *udp = skb_ptr(skb, offset);
|
||||
__u32 key;
|
||||
struct udphdr *udp;
|
||||
__u32 src, dest, key;
|
||||
__u8 *value;
|
||||
|
||||
udp = skb_ptr(skb, offset);
|
||||
if (skb_check(skb, &udp->len))
|
||||
return;
|
||||
|
||||
if (module_flags & QOSIFY_INGRESS)
|
||||
key = udp->source;
|
||||
else
|
||||
key = udp->dest;
|
||||
|
||||
if (proto == IPPROTO_TCP)
|
||||
value = bpf_map_lookup_elem(&tcp_ports, &key);
|
||||
else if (proto == IPPROTO_UDP)
|
||||
value = bpf_map_lookup_elem(&udp_ports, &key);
|
||||
else {
|
||||
if ((proto == IPPROTO_ICMP || proto == IPPROTO_ICMPV6) &&
|
||||
config && config->dscp_icmp != 0xff)
|
||||
*dscp_out = config->dscp_icmp;
|
||||
if (config && (proto == IPPROTO_ICMP || proto == IPPROTO_ICMPV6)) {
|
||||
*dscp_out = config->dscp_icmp;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!value)
|
||||
return;
|
||||
src = udp->source;
|
||||
dest = udp->dest;
|
||||
|
||||
if ((*value & DSCP_FALLBACK_FLAG) && *dscp_out)
|
||||
if (module_flags & QOSIFY_INGRESS)
|
||||
key = src;
|
||||
else
|
||||
key = dest;
|
||||
|
||||
if (proto == IPPROTO_TCP) {
|
||||
value = bpf_map_lookup_elem(&tcp_ports, &key);
|
||||
} else {
|
||||
if (proto != IPPROTO_UDP)
|
||||
key = 0;
|
||||
|
||||
value = bpf_map_lookup_elem(&udp_ports, &key);
|
||||
}
|
||||
|
||||
if (!value)
|
||||
return;
|
||||
|
||||
*dscp_out = *value;
|
||||
@@ -253,9 +260,16 @@ check_flow(struct qosify_config *config, struct __sk_buff *skb,
|
||||
__u32 hash;
|
||||
__u32 time;
|
||||
|
||||
if (!(*dscp & QOSIFY_DSCP_DEFAULT_FLAG))
|
||||
return;
|
||||
|
||||
if (!config)
|
||||
return;
|
||||
|
||||
if (!config->bulk_trigger_pps &&
|
||||
!config->prio_max_avg_pkt_len)
|
||||
return;
|
||||
|
||||
time = cur_time();
|
||||
hash = bpf_get_hash_recalc(skb);
|
||||
flow = bpf_map_lookup_elem(&flow_map, &hash);
|
||||
@@ -287,7 +301,8 @@ check_flow(struct qosify_config *config, struct __sk_buff *skb,
|
||||
if (flow->pkt_count < 0xffff)
|
||||
flow->pkt_count++;
|
||||
|
||||
if (flow->pkt_count > config->bulk_trigger_pps) {
|
||||
if (config->bulk_trigger_pps &&
|
||||
flow->pkt_count > config->bulk_trigger_pps) {
|
||||
flow->dscp = config->dscp_bulk;
|
||||
flow->bulk_timeout = config->bulk_trigger_timeout;
|
||||
}
|
||||
@@ -302,8 +317,7 @@ out:
|
||||
flow->dscp = 0xff;
|
||||
}
|
||||
|
||||
if (flow->dscp != 0xff &&
|
||||
!(*dscp && (flow->dscp & DSCP_FALLBACK_FLAG)))
|
||||
if (flow->dscp != 0xff)
|
||||
*dscp = flow->dscp;
|
||||
|
||||
return;
|
||||
@@ -322,10 +336,12 @@ static __always_inline void
|
||||
parse_ipv4(struct __sk_buff *skb, __u32 *offset)
|
||||
{
|
||||
struct qosify_config *config;
|
||||
struct qosify_ip_map_val *ip_val;
|
||||
const __u32 zero_port = 0;
|
||||
struct iphdr *iph;
|
||||
__u8 dscp = 0;
|
||||
__u8 dscp = 0xff;
|
||||
__u8 *value;
|
||||
__u8 ipproto;
|
||||
int hdr_len;
|
||||
void *key;
|
||||
bool force;
|
||||
@@ -337,7 +353,7 @@ parse_ipv4(struct __sk_buff *skb, __u32 *offset)
|
||||
return;
|
||||
|
||||
hdr_len = iph->ihl * 4;
|
||||
if (bpf_skb_pull_data(skb, *offset + hdr_len))
|
||||
if (bpf_skb_pull_data(skb, *offset + hdr_len + sizeof(struct udphdr)))
|
||||
return;
|
||||
|
||||
iph = skb_ptr(skb, *offset);
|
||||
@@ -346,23 +362,29 @@ parse_ipv4(struct __sk_buff *skb, __u32 *offset)
|
||||
if (skb_check(skb, (void *)(iph + 1)))
|
||||
return;
|
||||
|
||||
parse_l4proto(config, skb, *offset, iph->protocol, &dscp);
|
||||
ipproto = iph->protocol;
|
||||
parse_l4proto(config, skb, *offset, ipproto, &dscp);
|
||||
|
||||
if (module_flags & QOSIFY_INGRESS)
|
||||
key = &iph->saddr;
|
||||
else
|
||||
key = &iph->daddr;
|
||||
|
||||
value = bpf_map_lookup_elem(&ipv4_map, key);
|
||||
/* use udp port 0 entry as fallback for non-tcp/udp */
|
||||
if (!value)
|
||||
ip_val = bpf_map_lookup_elem(&ipv4_map, key);
|
||||
if (ip_val) {
|
||||
if (!ip_val->seen)
|
||||
ip_val->seen = 1;
|
||||
dscp = ip_val->dscp;
|
||||
} else if (dscp == 0xff) {
|
||||
/* use udp port 0 entry as fallback for non-tcp/udp */
|
||||
value = bpf_map_lookup_elem(&udp_ports, &zero_port);
|
||||
if (value)
|
||||
dscp = *value;
|
||||
if (value)
|
||||
dscp = *value;
|
||||
}
|
||||
|
||||
check_flow(config, skb, &dscp);
|
||||
|
||||
force = !(dscp & DSCP_FALLBACK_FLAG);
|
||||
force = !(dscp & QOSIFY_DSCP_FALLBACK_FLAG);
|
||||
dscp &= GENMASK(5, 0);
|
||||
|
||||
ipv4_change_dsfield(iph, INET_ECN_MASK, dscp << 2, force);
|
||||
@@ -372,16 +394,18 @@ static __always_inline void
|
||||
parse_ipv6(struct __sk_buff *skb, __u32 *offset)
|
||||
{
|
||||
struct qosify_config *config;
|
||||
struct qosify_ip_map_val *ip_val;
|
||||
const __u32 zero_port = 0;
|
||||
struct ipv6hdr *iph;
|
||||
__u8 dscp = 0;
|
||||
__u8 *value;
|
||||
__u8 ipproto;
|
||||
void *key;
|
||||
bool force;
|
||||
|
||||
config = get_config();
|
||||
|
||||
if (bpf_skb_pull_data(skb, *offset + sizeof(*iph)))
|
||||
if (bpf_skb_pull_data(skb, *offset + sizeof(*iph) + sizeof(struct udphdr)))
|
||||
return;
|
||||
|
||||
iph = skb_ptr(skb, *offset);
|
||||
@@ -390,24 +414,29 @@ parse_ipv6(struct __sk_buff *skb, __u32 *offset)
|
||||
if (skb_check(skb, (void *)(iph + 1)))
|
||||
return;
|
||||
|
||||
ipproto = iph->nexthdr;
|
||||
if (module_flags & QOSIFY_INGRESS)
|
||||
key = &iph->saddr;
|
||||
else
|
||||
key = &iph->daddr;
|
||||
|
||||
parse_l4proto(config, skb, *offset, iph->nexthdr, &dscp);
|
||||
parse_l4proto(config, skb, *offset, ipproto, &dscp);
|
||||
|
||||
value = bpf_map_lookup_elem(&ipv6_map, key);
|
||||
|
||||
/* use udp port 0 entry as fallback for non-tcp/udp */
|
||||
if (!value)
|
||||
ip_val = bpf_map_lookup_elem(&ipv6_map, key);
|
||||
if (ip_val) {
|
||||
if (!ip_val->seen)
|
||||
ip_val->seen = 1;
|
||||
dscp = ip_val->dscp;
|
||||
} else if (dscp == 0xff) {
|
||||
/* use udp port 0 entry as fallback for non-tcp/udp */
|
||||
value = bpf_map_lookup_elem(&udp_ports, &zero_port);
|
||||
if (value)
|
||||
dscp = *value;
|
||||
if (value)
|
||||
dscp = *value;
|
||||
}
|
||||
|
||||
check_flow(config, skb, &dscp);
|
||||
|
||||
force = !(dscp & DSCP_FALLBACK_FLAG);
|
||||
force = !(dscp & QOSIFY_DSCP_FALLBACK_FLAG);
|
||||
dscp &= GENMASK(5, 0);
|
||||
|
||||
ipv6_change_dsfield(iph, INET_ECN_MASK, dscp << 2, force);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#ifndef __BPF_QOSIFY_H
|
||||
#define __BPF_QOSIFY_H
|
||||
|
||||
@@ -11,6 +15,10 @@
|
||||
#define QOSIFY_INGRESS (1 << 0)
|
||||
#define QOSIFY_IP_ONLY (1 << 1)
|
||||
|
||||
|
||||
#define QOSIFY_DSCP_FALLBACK_FLAG (1 << 6)
|
||||
#define QOSIFY_DSCP_DEFAULT_FLAG (1 << 7)
|
||||
|
||||
/* global config data */
|
||||
struct qosify_config {
|
||||
uint8_t dscp_prio;
|
||||
@@ -23,4 +31,9 @@ struct qosify_config {
|
||||
uint16_t prio_max_avg_pkt_len;
|
||||
};
|
||||
|
||||
struct qosify_ip_map_val {
|
||||
uint8_t dscp; /* must be first */
|
||||
uint8_t seen;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#ifndef __QOS_CLASSIFY_H
|
||||
#define __QOS_CLASSIFY_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <regex.h>
|
||||
|
||||
#include <bpf/bpf.h>
|
||||
#include <bpf/libbpf.h>
|
||||
@@ -25,6 +30,7 @@ enum qosify_map_id {
|
||||
CL_MAP_IPV4_ADDR,
|
||||
CL_MAP_IPV6_ADDR,
|
||||
CL_MAP_CONFIG,
|
||||
CL_MAP_DNS,
|
||||
__CL_MAP_MAX,
|
||||
};
|
||||
|
||||
@@ -41,6 +47,10 @@ struct qosify_map_data {
|
||||
uint32_t port;
|
||||
struct in_addr ip;
|
||||
struct in6_addr ip6;
|
||||
struct {
|
||||
const char *pattern;
|
||||
regex_t regex;
|
||||
} dns;
|
||||
} addr;
|
||||
};
|
||||
|
||||
@@ -54,9 +64,10 @@ struct qosify_map_entry {
|
||||
|
||||
|
||||
extern int qosify_map_timeout;
|
||||
extern int qosify_active_timeout;
|
||||
extern struct qosify_config config;
|
||||
|
||||
int qosify_loader_init(bool force_init);
|
||||
int qosify_loader_init(void);
|
||||
|
||||
int qosify_map_init(void);
|
||||
int qosify_map_dscp_value(const char *val);
|
||||
@@ -69,6 +80,7 @@ void qosify_map_dump(struct blob_buf *b);
|
||||
void qosify_map_set_dscp_default(enum qosify_map_id id, uint8_t val);
|
||||
void qosify_map_reset_config(void);
|
||||
void qosify_map_update_config(void);
|
||||
int qosify_map_add_dns_host(const char *host, const char *addr, const char *type, int ttl);
|
||||
|
||||
int qosify_iface_init(void);
|
||||
void qosify_iface_config_update(struct blob_attr *ifaces, struct blob_attr *devs);
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-2.0+
|
||||
/*
|
||||
* Copyright (C) 2021 Felix Fietkau <nbd@nbd.name>
|
||||
*/
|
||||
#include <libubus.h>
|
||||
|
||||
#include "qosify.h"
|
||||
@@ -46,6 +50,7 @@ enum {
|
||||
CL_ADD_IPV6,
|
||||
CL_ADD_TCP_PORT,
|
||||
CL_ADD_UDP_PORT,
|
||||
CL_ADD_DNS,
|
||||
__CL_ADD_MAX
|
||||
};
|
||||
|
||||
@@ -56,6 +61,7 @@ static const struct blobmsg_policy qosify_add_policy[__CL_ADD_MAX] = {
|
||||
[CL_ADD_IPV6] = { "ipv6", BLOBMSG_TYPE_ARRAY },
|
||||
[CL_ADD_TCP_PORT] = { "tcp_port", BLOBMSG_TYPE_ARRAY },
|
||||
[CL_ADD_UDP_PORT] = { "udp_port", BLOBMSG_TYPE_ARRAY },
|
||||
[CL_ADD_DNS] = { "dns", BLOBMSG_TYPE_ARRAY },
|
||||
};
|
||||
|
||||
|
||||
@@ -113,6 +119,10 @@ qosify_ubus_add(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
(ret = qosify_ubus_add_array(cur, dscp, CL_MAP_UDP_PORTS) != 0))
|
||||
return ret;
|
||||
|
||||
if ((cur = tb[CL_ADD_DNS]) != NULL &&
|
||||
(ret = qosify_ubus_add_array(cur, dscp, CL_MAP_DNS) != 0))
|
||||
return ret;
|
||||
|
||||
qosify_map_timeout = prev_timemout;
|
||||
|
||||
return 0;
|
||||
@@ -254,12 +264,6 @@ qosify_ubus_status(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum {
|
||||
CL_DEV_EVENT_NAME,
|
||||
CL_DEV_EVENT_ADD,
|
||||
__CL_DEV_EVENT_MAX,
|
||||
};
|
||||
|
||||
static int
|
||||
qosify_ubus_check_devices(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
@@ -270,6 +274,48 @@ qosify_ubus_check_devices(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
return 0;
|
||||
}
|
||||
|
||||
enum {
|
||||
CL_DNS_HOST_NAME,
|
||||
CL_DNS_HOST_TYPE,
|
||||
CL_DNS_HOST_ADDR,
|
||||
CL_DNS_HOST_TTL,
|
||||
__CL_DNS_HOST_MAX
|
||||
};
|
||||
|
||||
static const struct blobmsg_policy qosify_dns_policy[__CL_DNS_HOST_MAX] = {
|
||||
[CL_DNS_HOST_NAME] = { "name", BLOBMSG_TYPE_STRING },
|
||||
[CL_DNS_HOST_TYPE] = { "type", BLOBMSG_TYPE_STRING },
|
||||
[CL_DNS_HOST_ADDR] = { "address", BLOBMSG_TYPE_STRING },
|
||||
[CL_DNS_HOST_TTL] = { "ttl", BLOBMSG_TYPE_INT32 },
|
||||
};
|
||||
|
||||
static int
|
||||
qosify_ubus_add_dns_host(struct ubus_context *ctx, struct ubus_object *obj,
|
||||
struct ubus_request_data *req, const char *method,
|
||||
struct blob_attr *msg)
|
||||
{
|
||||
struct blob_attr *tb[__CL_DNS_HOST_MAX];
|
||||
struct blob_attr *cur;
|
||||
uint32_t ttl = 0;
|
||||
|
||||
blobmsg_parse(qosify_dns_policy, __CL_DNS_HOST_MAX, tb,
|
||||
blobmsg_data(msg), blobmsg_len(msg));
|
||||
|
||||
if (!tb[CL_DNS_HOST_NAME] || !tb[CL_DNS_HOST_TYPE] ||
|
||||
!tb[CL_DNS_HOST_ADDR])
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
if ((cur = tb[CL_DNS_HOST_TTL]) != NULL)
|
||||
ttl = blobmsg_get_u32(cur);
|
||||
|
||||
if (qosify_map_add_dns_host(blobmsg_get_string(tb[CL_DNS_HOST_NAME]),
|
||||
blobmsg_get_string(tb[CL_DNS_HOST_ADDR]),
|
||||
blobmsg_get_string(tb[CL_DNS_HOST_TYPE]),
|
||||
ttl))
|
||||
return UBUS_STATUS_INVALID_ARGUMENT;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct ubus_method qosify_methods[] = {
|
||||
UBUS_METHOD_NOARG("reload", qosify_ubus_reload),
|
||||
@@ -279,6 +325,7 @@ static const struct ubus_method qosify_methods[] = {
|
||||
UBUS_METHOD("config", qosify_ubus_config, qosify_config_policy),
|
||||
UBUS_METHOD_NOARG("dump", qosify_ubus_dump),
|
||||
UBUS_METHOD_NOARG("status", qosify_ubus_status),
|
||||
UBUS_METHOD("add_dns_host", qosify_ubus_add_dns_host, qosify_dns_policy),
|
||||
UBUS_METHOD_NOARG("check_devices", qosify_ubus_check_devices),
|
||||
};
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ delclient() {
|
||||
TC class del dev $ifb parent 1:1 classid 1:$id
|
||||
}
|
||||
|
||||
ingress=
|
||||
egress=
|
||||
ingress=0
|
||||
egress=0
|
||||
|
||||
getrate() {
|
||||
config_get ssid $1 ssid
|
||||
@@ -55,12 +55,17 @@ addclient() {
|
||||
local mac=$2
|
||||
local ssid=$(cat /tmp/ratelimit.$iface)
|
||||
|
||||
egress=$3
|
||||
ingress=$4
|
||||
|
||||
logger "ratelimit: adding client"
|
||||
|
||||
config_load ratelimit
|
||||
config_foreach getrate rate $ssid
|
||||
[ "$egress" -eq 0 -o $ingress -eq 0 ] && {
|
||||
config_load ratelimit
|
||||
config_foreach getrate rate $ssid
|
||||
}
|
||||
|
||||
[ -z "$egress" -o -z $ingress ] && {
|
||||
[ "$egress" -eq 0 -o $ingress -eq 0 ] && {
|
||||
logger "ratelimit: no valid rates"
|
||||
exit 1
|
||||
}
|
||||
@@ -146,7 +151,7 @@ addiface() {
|
||||
waitiface() {
|
||||
local iface=$1
|
||||
|
||||
ubus -t 75 wait_for hostapd.$1
|
||||
ubus -t 120 wait_for hostapd.$1
|
||||
|
||||
[ $? -eq 0 ] || exit 0
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
case $2 in
|
||||
AP-STA-CONNECTED)
|
||||
ratelimit addclient $1 $3
|
||||
ratelimit addclient $1 $3 $4 $5
|
||||
;;
|
||||
AP-STA-DISCONNECTED)
|
||||
ratelimit delclient $1 $3
|
||||
|
||||
@@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL=https://github.com/blogic/ucentral-client.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-02-15
|
||||
PKG_SOURCE_VERSION:=0179c0f98039b0fe6492b6f98e321c7e80dff42d
|
||||
PKG_SOURCE_VERSION:=b4e8fc882634b407e7f2f7c859d7ecf078264261
|
||||
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
14
feeds/ucentral/ucentral-client/files/etc/init.d/ucentral-wdt
Executable file
14
feeds/ucentral/ucentral-client/files/etc/init.d/ucentral-wdt
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=99
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/libexec/ucentral-wdt.sh
|
||||
|
||||
start_service() {
|
||||
active=$(readlink /etc/ucentral/ucentral.active)
|
||||
[ -n "$active" -a "$active" != "/etc/ucentral/ucentral.cfg.0000000001" ] && return 0
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG"
|
||||
procd_close_instance
|
||||
}
|
||||
16
feeds/ucentral/ucentral-client/files/usr/libexec/ucentral-wdt.sh
Executable file
16
feeds/ucentral/ucentral-client/files/usr/libexec/ucentral-wdt.sh
Executable file
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
sleep 60
|
||||
|
||||
[ -f /etc/ucentral/redirector.json ] || return 0
|
||||
|
||||
active=$(ubus call ucentral status | jsonfilter -e '@.active')
|
||||
|
||||
[ -n "$active" -a ! "$active" -eq 1 ] && {
|
||||
logger ucentral-wdt: all good
|
||||
exit 0
|
||||
}
|
||||
|
||||
logger ucentral-wdt: restarting client
|
||||
|
||||
/etc/init.d/ucentral restart
|
||||
@@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL=https://github.com/blogic/ucentral-schema.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-02-15
|
||||
PKG_SOURCE_VERSION:=1bdc8de73f66d5b846cc07c2697959c0cfda6aee
|
||||
PKG_SOURCE_VERSION:=6d321d65047e1582fffad6034679ecb7aeabed71
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
PKG_LICENSE:=BSD-3-Clause
|
||||
|
||||
@@ -102,10 +102,6 @@
|
||||
"encryption": {
|
||||
"proto": "none",
|
||||
"ieee80211w": "optional"
|
||||
},
|
||||
"roaming": {
|
||||
"message-exchange": "ds",
|
||||
"generate-psk": true
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,107 @@
|
||||
{
|
||||
"uuid": 2,
|
||||
"radios": [
|
||||
{
|
||||
"band": "2G",
|
||||
"country": "CA",
|
||||
"channel-mode": "HE",
|
||||
"channel-width": 80,
|
||||
"channel": 32
|
||||
}
|
||||
],
|
||||
|
||||
"interfaces": [
|
||||
{
|
||||
"name": "WAN",
|
||||
"role": "upstream",
|
||||
"services": [ "lldp" ],
|
||||
"ethernet": [
|
||||
{
|
||||
"select-ports": [
|
||||
"WAN*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"ipv4": {
|
||||
"addressing": "dynamic"
|
||||
},
|
||||
"ipv6": {
|
||||
"addressing": "dynamic"
|
||||
},
|
||||
"ssids": [
|
||||
{
|
||||
"name": "OpenWifi",
|
||||
"wifi-bands": [
|
||||
"2G"
|
||||
],
|
||||
"bss-mode": "ap",
|
||||
"encryption": {
|
||||
"proto": "psk2",
|
||||
"key": "OpenWifi",
|
||||
"ieee80211w": "optional"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "LAN",
|
||||
"role": "downstream",
|
||||
"services": [ "ssh", "lldp" ],
|
||||
"ethernet": [
|
||||
{
|
||||
"select-ports": [
|
||||
"LAN*"
|
||||
]
|
||||
}
|
||||
],
|
||||
"ipv4": {
|
||||
"addressing": "static",
|
||||
"subnet": "192.168.1.1/24",
|
||||
"dhcp": {
|
||||
"lease-first": 10,
|
||||
"lease-count": 100,
|
||||
"lease-time": "6h"
|
||||
}
|
||||
},
|
||||
"ipv6": {
|
||||
"addressing": "static",
|
||||
"dhcpv6": {
|
||||
"mode": "hybrid"
|
||||
}
|
||||
},
|
||||
"ssids": [
|
||||
{
|
||||
"name": "OpenWifi",
|
||||
"wifi-bands": [
|
||||
"2G"
|
||||
],
|
||||
"bss-mode": "ap",
|
||||
"encryption": {
|
||||
"proto": "psk2",
|
||||
"key": "OpenWifi",
|
||||
"ieee80211w": "optional"
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
}
|
||||
],
|
||||
"metrics": {
|
||||
"statistics": {
|
||||
"interval": 120,
|
||||
"types": [ "ssids", "lldp", "clients" ]
|
||||
},
|
||||
"health": {
|
||||
"interval": 120
|
||||
}
|
||||
},
|
||||
"services": {
|
||||
"lldp": {
|
||||
"describe": "uCentral",
|
||||
"location": "universe"
|
||||
},
|
||||
"ssh": {
|
||||
"port": 22
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,14 +2,7 @@
|
||||
"uuid": 2,
|
||||
"globals": {
|
||||
"wireless-multimedia": {
|
||||
"UP0": [ "DF"],
|
||||
"UP1": [ "CS1" ],
|
||||
"UP2": [ "AF11", "AF12", "AF13" ],
|
||||
"UP3": [ "CS2", "AF21", "AF22", "AF23" ],
|
||||
"UP4": [ "CS3", "AF31", "AF32", "AF33" ],
|
||||
"UP5": [ "CS5", "AF41", "AF42", "AF43" ],
|
||||
"UP6": [ "CS4", "EF" ],
|
||||
"UP7": [ "CS6" ]
|
||||
"profile": "rfc8325"
|
||||
}
|
||||
},
|
||||
"radios": [
|
||||
@@ -110,27 +103,36 @@
|
||||
"select-ports": [ "WAN" ],
|
||||
"bandwidth_up": 1000,
|
||||
"bandwidth_down": 1000,
|
||||
"bulk-detection": {
|
||||
"dscp": "CS1",
|
||||
"packets-per-second": 500
|
||||
},
|
||||
"classifier": [
|
||||
{
|
||||
"dscp": "CS0",
|
||||
"dscp": "CS1",
|
||||
"ports": [
|
||||
{ "protocol": "any", "port": 53 },
|
||||
{ "protocol": "tcp", "port": 80 }
|
||||
],
|
||||
"dns": [
|
||||
"telecominfraproject.com"
|
||||
{ "fqdn": "telecominfraproject.com", "suffix-matching": false }
|
||||
]
|
||||
}, {
|
||||
"dscp": "CS1",
|
||||
"ports": [
|
||||
{ "protocol": "any", "port": 53, "range-end": 80 },
|
||||
{ "protocol": "udp", "port": 80, "reclassify": true }
|
||||
],
|
||||
"dscp": "AF41",
|
||||
"dns": [
|
||||
"telecominfraproject.com"
|
||||
{ "fqdn": "zoom.us" }
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"airtime-fairness": {
|
||||
"voice-weight": 4,
|
||||
"packet-threshold": 100,
|
||||
"bulk-threshold": 50,
|
||||
"priority-threshold": 30,
|
||||
"weight-normal": 256,
|
||||
"weight-priority": 384,
|
||||
"weight-bulk": 128
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,11 @@
|
||||
"band": "2G",
|
||||
"country": "CA",
|
||||
"channel-mode": "HE",
|
||||
"channel-width": 40
|
||||
}, {
|
||||
"band": "5G",
|
||||
"country": "CA",
|
||||
"channel-mode": "HE",
|
||||
"channel-width": 80
|
||||
}
|
||||
],
|
||||
|
||||
@@ -6,7 +6,7 @@ PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL=https://github.com/blogic/ucentral-wifi.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-04-13
|
||||
PKG_SOURCE_VERSION:=b6dd24f79b14346e767fdda7206ad8c9d851ab35
|
||||
PKG_SOURCE_VERSION:=b64cd4149388bd6b49852ba37296cb76acaff537
|
||||
#PKG_MIRROR_HASH:=a8000b3cf43ce9ebfa7305661475fec98ec1dba2dc7b062028c2e17d7c2ec50b
|
||||
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
30
feeds/ucentral/udnssnoop/Makefile
Normal file
30
feeds/ucentral/udnssnoop/Makefile
Normal file
@@ -0,0 +1,30 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=udnssnoop
|
||||
PKG_RELEASE:=1
|
||||
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
PKG_MAINTAINER:=John Crispin <john@phrozen.org>
|
||||
|
||||
PKG_SOURCE_URL=https://github.com/blogic/udnssnoop.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2021-04-12
|
||||
PKG_SOURCE_VERSION:=67e1e5f0bfc12222aa59c54e7066b1c00a680e56
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/cmake.mk
|
||||
|
||||
define Package/udnssnoop
|
||||
SECTION:=net
|
||||
CATEGORY:=Network
|
||||
TITLE:=DNS Snooping Daemon
|
||||
DEPENDS:=+libubox +libubus
|
||||
endef
|
||||
|
||||
define Package/udnssnoop/install
|
||||
$(INSTALL_DIR) $(1)/usr/sbin
|
||||
$(INSTALL_BIN) $(PKG_BUILD_DIR)/udnssnoop $(1)/usr/sbin/
|
||||
$(CP) ./files/* $(1)
|
||||
endef
|
||||
|
||||
$(eval $(call BuildPackage,udnssnoop))
|
||||
24
feeds/ucentral/udnssnoop/files/etc/init.d/dnssnoop
Executable file
24
feeds/ucentral/udnssnoop/files/etc/init.d/dnssnoop
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/bin/sh /etc/rc.common
|
||||
|
||||
START=80
|
||||
|
||||
USE_PROCD=1
|
||||
PROG=/usr/sbin/udnssnoop
|
||||
|
||||
service_triggers() {
|
||||
procd_add_reload_trigger qosify
|
||||
}
|
||||
|
||||
start_service() {
|
||||
local device=$(uci get qosify.@device[0].name)
|
||||
[ -z "$device" ] && return
|
||||
|
||||
procd_open_instance
|
||||
procd_set_param command "$PROG" $device
|
||||
procd_set_param respawn
|
||||
procd_close_instance
|
||||
}
|
||||
|
||||
reload_service() {
|
||||
restart
|
||||
}
|
||||
701
feeds/wifi-ath10k/ath10k-ct-firmware/Makefile
Normal file
701
feeds/wifi-ath10k/ath10k-ct-firmware/Makefile
Normal 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))
|
||||
121
feeds/wifi-ath10k/ath10k-ct/Makefile
Normal file
121
feeds/wifi-ath10k/ath10k-ct/Makefile
Normal file
@@ -0,0 +1,121 @@
|
||||
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_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))
|
||||
@@ -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);
|
||||
@@ -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;
|
||||
@@ -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
|
||||
@@ -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))
|
||||
@@ -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)
|
||||
@@ -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,
|
||||
},
|
||||
|
||||
@@ -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);
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
@@ -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)
|
||||
182
feeds/wifi-ath10k/ath10k-firmware/Makefile
Normal file
182
feeds/wifi-ath10k/ath10k-firmware/Makefile
Normal 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))
|
||||
231
feeds/wifi-ath10k/batctl/Makefile
Normal file
231
feeds/wifi-ath10k/batctl/Makefile
Normal 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))
|
||||
110
feeds/wifi-ath10k/batman-adv/Config.in
Normal file
110
feeds/wifi-ath10k/batman-adv/Config.in
Normal 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.
|
||||
91
feeds/wifi-ath10k/batman-adv/Makefile
Normal file
91
feeds/wifi-ath10k/batman-adv/Makefile
Normal 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))
|
||||
97
feeds/wifi-ath10k/batman-adv/files/etc/uci-defaults/99-migrate-batadv_hardif
Executable file
97
feeds/wifi-ath10k/batman-adv/files/etc/uci-defaults/99-migrate-batadv_hardif
Executable 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
|
||||
123
feeds/wifi-ath10k/batman-adv/files/lib/netifd/proto/batadv.sh
Executable file
123
feeds/wifi-ath10k/batman-adv/files/lib/netifd/proto/batadv.sh
Executable 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
|
||||
49
feeds/wifi-ath10k/batman-adv/files/lib/netifd/proto/batadv_hardif.sh
Executable file
49
feeds/wifi-ath10k/batman-adv/files/lib/netifd/proto/batadv_hardif.sh
Executable 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
|
||||
25
feeds/wifi-ath10k/batman-adv/files/lib/netifd/proto/batadv_vlan.sh
Executable file
25
feeds/wifi-ath10k/batman-adv/files/lib/netifd/proto/batadv_vlan.sh
Executable 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
|
||||
181
feeds/wifi-ath10k/batman-adv/src/compat-hacks.h
Normal file
181
feeds/wifi-ath10k/batman-adv/src/compat-hacks.h
Normal 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> */
|
||||
544
feeds/wifi-ath10k/mac80211/Makefile
Normal file
544
feeds/wifi-ath10k/mac80211/Makefile
Normal file
@@ -0,0 +1,544 @@
|
||||
#
|
||||
# Copyright (C) 2007-2015 OpenWrt.org
|
||||
#
|
||||
# This is free software, licensed under the GNU General Public License v2.
|
||||
# See /LICENSE for more information.
|
||||
#
|
||||
|
||||
include $(TOPDIR)/rules.mk
|
||||
include $(INCLUDE_DIR)/kernel.mk
|
||||
|
||||
PKG_NAME:=mac80211
|
||||
|
||||
PKG_VERSION:=5.8-1
|
||||
PKG_RELEASE:=1
|
||||
PKG_SOURCE_URL:=@KERNEL/linux/kernel/projects/backports/stable/v5.8/
|
||||
PKG_HASH:=19b4174d89bf11ee221458e11f1e8dace26558498774b823051156f522d2036b
|
||||
|
||||
PKG_SOURCE:=backports-$(PKG_VERSION).tar.xz
|
||||
PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/backports-$(PKG_VERSION)
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
PKG_MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
PKG_DRIVERS = \
|
||||
adm8211 \
|
||||
airo \
|
||||
hermes hermes-pci hermes-pcmcia hermes-plx\
|
||||
lib80211 \
|
||||
mac80211-hwsim \
|
||||
mt7601u \
|
||||
p54-common p54-pci p54-usb \
|
||||
rsi91x rsi91x-usb rsi91x-sdio\
|
||||
wlcore wl12xx wl18xx \
|
||||
zd1211rw
|
||||
|
||||
PKG_CONFIG_DEPENDS:= \
|
||||
CONFIG_PACKAGE_kmod-mac80211 \
|
||||
CONFIG_PACKAGE_CFG80211_TESTMODE \
|
||||
CONFIG_PACKAGE_MAC80211_DEBUGFS \
|
||||
CONFIG_PACKAGE_MAC80211_MESH \
|
||||
CONFIG_PACKAGE_MAC80211_TRACING \
|
||||
CONFIG_PACKAGE_IWLWIFI_DEBUG \
|
||||
CONFIG_PACKAGE_IWLWIFI_DEBUGFS \
|
||||
CONFIG_PACKAGE_RTLWIFI_DEBUG \
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
||||
WMENU:=Wireless Drivers
|
||||
|
||||
define KernelPackage/mac80211/Default
|
||||
SUBMENU:=$(WMENU)
|
||||
URL:=https://wireless.wiki.kernel.org/
|
||||
MAINTAINER:=Felix Fietkau <nbd@nbd.name>
|
||||
endef
|
||||
|
||||
config_package=$(if $(CONFIG_PACKAGE_kmod-$(1)),m)
|
||||
|
||||
config-y:= \
|
||||
WLAN \
|
||||
CFG80211_WEXT \
|
||||
CFG80211_CERTIFICATION_ONUS \
|
||||
MAC80211_RC_MINSTREL \
|
||||
MAC80211_RC_MINSTREL_HT \
|
||||
MAC80211_RC_MINSTREL_VHT \
|
||||
MAC80211_RC_DEFAULT_MINSTREL \
|
||||
WLAN_VENDOR_ADMTEK \
|
||||
WLAN_VENDOR_ATH \
|
||||
WLAN_VENDOR_ATMEL \
|
||||
WLAN_VENDOR_BROADCOM \
|
||||
WLAN_VENDOR_CISCO \
|
||||
WLAN_VENDOR_INTEL \
|
||||
WLAN_VENDOR_INTERSIL \
|
||||
WLAN_VENDOR_MARVELL \
|
||||
WLAN_VENDOR_MEDIATEK \
|
||||
WLAN_VENDOR_RALINK \
|
||||
WLAN_VENDOR_REALTEK \
|
||||
WLAN_VENDOR_RSI \
|
||||
WLAN_VENDOR_ST \
|
||||
WLAN_VENDOR_TI \
|
||||
WLAN_VENDOR_ZYDAS \
|
||||
|
||||
config-$(call config_package,cfg80211) += CFG80211
|
||||
config-$(CONFIG_PACKAGE_CFG80211_TESTMODE) += NL80211_TESTMODE
|
||||
|
||||
config-$(call config_package,mac80211) += MAC80211
|
||||
config-$(CONFIG_PACKAGE_MAC80211_MESH) += MAC80211_MESH
|
||||
|
||||
include ath.mk
|
||||
include broadcom.mk
|
||||
include intel.mk
|
||||
include marvell.mk
|
||||
include ralink.mk
|
||||
include realtek.mk
|
||||
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
$(patsubst %,CONFIG_PACKAGE_kmod-%,$(PKG_DRIVERS))
|
||||
|
||||
define KernelPackage/cfg80211
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=cfg80211 - wireless configuration API
|
||||
DEPENDS+= +iw +wireless-regdb
|
||||
ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/compat/compat.ko \
|
||||
$(PKG_BUILD_DIR)/net/wireless/cfg80211.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/cfg80211/description
|
||||
cfg80211 is the Linux wireless LAN (802.11) configuration API.
|
||||
endef
|
||||
|
||||
define KernelPackage/cfg80211/config
|
||||
if PACKAGE_kmod-cfg80211
|
||||
|
||||
config PACKAGE_CFG80211_TESTMODE
|
||||
bool "Enable testmode command support"
|
||||
default n
|
||||
help
|
||||
This is typically used for tests and calibration during
|
||||
manufacturing, or vendor specific debugging features
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/mac80211
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Linux 802.11 Wireless Networking Stack
|
||||
# +kmod-crypto-cmac is a runtime only dependency of net/mac80211/aes_cmac.c
|
||||
DEPENDS+= +kmod-cfg80211 +hostapd-common
|
||||
KCONFIG:=\
|
||||
CONFIG_AVERAGE=y
|
||||
FILES:= $(PKG_BUILD_DIR)/net/mac80211/mac80211.ko
|
||||
ABI_VERSION:=$(PKG_VERSION)-$(PKG_RELEASE)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/mac80211/config
|
||||
if PACKAGE_kmod-mac80211
|
||||
|
||||
config PACKAGE_MAC80211_DEBUGFS
|
||||
bool "Export mac80211 internals in DebugFS"
|
||||
select KERNEL_DEBUG_FS
|
||||
default y
|
||||
help
|
||||
Select this to see extensive information about
|
||||
the internal state of mac80211 in debugfs.
|
||||
|
||||
config PACKAGE_MAC80211_TRACING
|
||||
bool "Enable tracing (mac80211 and supported drivers)"
|
||||
select KERNEL_FTRACE
|
||||
select KERNEL_ENABLE_DEFAULT_TRACERS
|
||||
default n
|
||||
help
|
||||
Select this to enable tracing of mac80211 and
|
||||
related wifi drivers (using trace-cmd).
|
||||
|
||||
config PACKAGE_MAC80211_MESH
|
||||
bool "Enable 802.11s mesh support"
|
||||
default y
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/mac80211/description
|
||||
Generic IEEE 802.11 Networking Stack (mac80211)
|
||||
endef
|
||||
|
||||
define KernelPackage/adm8211
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=ADMTek 8211 support
|
||||
DEPENDS+=@PCI_SUPPORT +kmod-mac80211 +kmod-eeprom-93cx6
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/admtek/adm8211.ko
|
||||
AUTOLOAD:=$(call AutoProbe,adm8211)
|
||||
endef
|
||||
|
||||
define KernelPackage/airo
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Cisco Aironet driver
|
||||
DEPENDS+=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT +kmod-cfg80211 @TARGET_x86 @BROKEN
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/cisco/airo.ko
|
||||
AUTOLOAD:=$(call AutoProbe,airo)
|
||||
endef
|
||||
|
||||
define KernelPackage/airo/description
|
||||
Kernel support for Cisco Aironet cards
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Hermes 802.11b chipset support
|
||||
DEPENDS:=@PCI_SUPPORT||PCMCIA_SUPPORT +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT +kmod-crypto-michael-mic
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco.ko
|
||||
AUTOLOAD:=$(call AutoProbe,orinoco)
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes/description
|
||||
Kernel support for Hermes 802.11b chipsets
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes-pci
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Intersil Prism 2.5 PCI support
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-hermes
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_pci.ko
|
||||
AUTOLOAD:=$(call AutoProbe,orinoco_pci)
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes-pci/description
|
||||
Kernel modules for Intersil Prism 2.5 PCI support
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes-plx
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=PLX9052 based PCI adaptor
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-hermes
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_plx.ko
|
||||
AUTOLOAD:=$(call AutoProbe,orinoco_plx)
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes-plx/description
|
||||
Kernel modules for Hermes in PLX9052 based PCI adaptors
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes-pcmcia
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Hermes based PCMCIA adaptors
|
||||
DEPENDS:=@PCMCIA_SUPPORT +kmod-hermes +kmod-pcmcia-core
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/orinoco/orinoco_cs.ko
|
||||
AUTOLOAD:=$(call AutoProbe,orinoco_cs)
|
||||
endef
|
||||
|
||||
define KernelPackage/hermes-pcmcia/description
|
||||
Kernel modules for Hermes based PCMCIA adaptors
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/lib80211
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=802.11 Networking stack
|
||||
DEPENDS:=+kmod-cfg80211 +kmod-crypto-hash +kmod-crypto-ccm
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/net/wireless/lib80211.ko \
|
||||
$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_wep.ko \
|
||||
$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_ccmp.ko \
|
||||
$(PKG_BUILD_DIR)/net/wireless/lib80211_crypt_tkip.ko
|
||||
AUTOLOAD:=$(call AutoProbe, \
|
||||
lib80211 \
|
||||
lib80211_crypt_wep \
|
||||
lib80211_crypt_ccmp \
|
||||
lib80211_crypt_tkip \
|
||||
)
|
||||
endef
|
||||
|
||||
define KernelPackage/lib80211/description
|
||||
Kernel modules for 802.11 Networking stack
|
||||
Includes:
|
||||
- lib80211
|
||||
- lib80211_crypt_wep
|
||||
- lib80211_crypt_tkip
|
||||
- lib80211_crytp_ccmp
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/mac80211-hwsim
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=mac80211 HW simulation device
|
||||
DEPENDS+= +kmod-mac80211 +@DRIVER_11AC_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mac80211_hwsim.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mac80211_hwsim)
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/mt7601u
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=MT7601U-based USB dongles Wireless Driver
|
||||
DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT @USB_SUPPORT +kmod-usb-core +mt7601u-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mediatek/mt7601u/mt7601u.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mt7601u)
|
||||
endef
|
||||
|
||||
define KernelPackage/p54/Default
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Prism54 Drivers
|
||||
endef
|
||||
|
||||
define KernelPackage/p54/description
|
||||
Kernel module for Prism54 chipsets (mac80211)
|
||||
endef
|
||||
|
||||
define KernelPackage/p54-common
|
||||
$(call KernelPackage/p54/Default)
|
||||
DEPENDS+= @(PCI_SUPPORT||USB_SUPPORT) +kmod-mac80211 +kmod-lib-crc-ccitt +@DRIVER_11W_SUPPORT
|
||||
TITLE+= (COMMON)
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54common.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/p54-pci
|
||||
$(call KernelPackage/p54/Default)
|
||||
TITLE+= (PCI)
|
||||
DEPENDS+= @PCI_SUPPORT +kmod-p54-common +p54-pci-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54pci.ko
|
||||
AUTOLOAD:=$(call AutoProbe,p54pci)
|
||||
endef
|
||||
|
||||
define KernelPackage/p54-usb
|
||||
$(call KernelPackage/p54/Default)
|
||||
TITLE+= (USB)
|
||||
DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-p54-common +p54-usb-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intersil/p54/p54usb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,p54usb)
|
||||
endef
|
||||
|
||||
define KernelPackage/rsi91x
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Redpine Signals Inc 91x WLAN driver support
|
||||
DEPENDS+= +kmod-mac80211 +rs9113-firmware +@DRIVER_11N_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_91x.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/rsi91x-usb
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Redpine Signals USB bus support
|
||||
DEPENDS+=@USB_SUPPORT +kmod-usb-core +kmod-mac80211 +kmod-rsi91x +rs9113-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_usb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,rsi_usb)
|
||||
endef
|
||||
|
||||
define KernelPackage/rsi91x-sdio
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Redpine Signals SDIO bus support
|
||||
DEPENDS+= +kmod-mac80211 +kmod-mmc +kmod-rsi91x +rs9113-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/rsi/rsi_sdio.ko
|
||||
AUTOLOAD:=$(call AutoProbe,rsi_sdio)
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/wlcore
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=TI common driver part
|
||||
DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wlcore/wlcore_sdio.ko
|
||||
AUTOLOAD:=$(call AutoProbe,wlcore wlcore_sdio)
|
||||
endef
|
||||
|
||||
define KernelPackage/wlcore/description
|
||||
This module contains some common parts needed by TI Wireless drivers.
|
||||
endef
|
||||
|
||||
define KernelPackage/wl12xx
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for TI WL12xx
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl12xx
|
||||
DEPENDS+= +kmod-wlcore +wl12xx-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl12xx/wl12xx.ko
|
||||
AUTOLOAD:=$(call AutoProbe,wl12xx)
|
||||
endef
|
||||
|
||||
define KernelPackage/wl12xx/description
|
||||
Kernel modules for TI WL12xx
|
||||
endef
|
||||
|
||||
define KernelPackage/wl18xx
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for TI WL18xx
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/wl18xx
|
||||
DEPENDS+= +kmod-wlcore +wl18xx-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ti/wl18xx/wl18xx.ko
|
||||
AUTOLOAD:=$(call AutoProbe,wl18xx)
|
||||
endef
|
||||
|
||||
define KernelPackage/wl18xx/description
|
||||
Kernel modules for TI WL18xx
|
||||
endef
|
||||
|
||||
|
||||
ZD1211FW_NAME:=zd1211-firmware
|
||||
ZD1211FW_VERSION:=1.4
|
||||
define Download/zd1211rw
|
||||
FILE:=$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
|
||||
URL:=@SF/zd1211/
|
||||
HASH:=866308f6f59f7075f075d4959dff2ede47735c751251fecd1496df1ba4d338e1
|
||||
endef
|
||||
$(eval $(call Download,zd1211rw))
|
||||
|
||||
define KernelPackage/zd1211rw
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Zydas ZD1211 support
|
||||
DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-mac80211 +@DRIVER_11W_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/zydas/zd1211rw/zd1211rw.ko
|
||||
AUTOLOAD:=$(call AutoProbe,zd1211rw)
|
||||
endef
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
|
||||
config-y += \
|
||||
CFG80211_DEBUGFS \
|
||||
MAC80211_DEBUGFS
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_TRACING
|
||||
config-y += \
|
||||
IWLWIFI_DEVICE_TRACING
|
||||
endif
|
||||
|
||||
config-$(call config_package,lib80211) += LIB80211 LIB80211_CRYPT_WEP LIB80211_CRYPT_CCMP LIB80211_CRYPT_TKIP
|
||||
|
||||
config-$(call config_package,airo) += AIRO
|
||||
|
||||
config-$(call config_package,mac80211-hwsim) += MAC80211_HWSIM
|
||||
config-$(call config_package,mt7601u) += MT7601U
|
||||
config-y += WL_MEDIATEK
|
||||
|
||||
config-$(call config_package,p54-common) += P54_COMMON
|
||||
config-$(call config_package,p54-pci) += P54_PCI
|
||||
config-$(call config_package,p54-usb) += P54_USB
|
||||
|
||||
config-$(call config_package,hermes) += HERMES
|
||||
config-$(call config_package,hermes-pci) += PCI_HERMES
|
||||
config-$(call config_package,hermes-plx) += PLX_HERMES
|
||||
config-$(call config_package,hermes-pcmcia) += PCMCIA_HERMES
|
||||
config-y += HERMES_PRISM
|
||||
|
||||
config-$(call config_package,adm8211) += ADM8211
|
||||
config-$(call config_package,wlcore) += WLCORE WLCORE_SDIO
|
||||
config-$(call config_package,wl12xx) += WL12XX
|
||||
config-$(call config_package,wl18xx) += WL18XX
|
||||
config-y += WL_TI WILINK_PLATFORM_DATA
|
||||
config-$(call config_package,zd1211rw) += ZD1211RW
|
||||
config-$(call config_package,rsi91x) += RSI_91X
|
||||
config-$(call config_package,rsi91x-usb) += RSI_USB
|
||||
config-$(call config_package,rsi91x-sdio) += RSI_SDIO
|
||||
|
||||
config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS
|
||||
|
||||
MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
|
||||
$(KERNEL_MAKE_FLAGS) \
|
||||
EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS)" \
|
||||
KLIB_BUILD="$(LINUX_DIR)" \
|
||||
MODPROBE=true \
|
||||
KLIB=$(TARGET_MODULES_DIR) \
|
||||
KERNEL_SUBLEVEL=$(lastword $(subst ., ,$(KERNEL_PATCHVER))) \
|
||||
KBUILD_LDFLAGS_MODULE_PREREQ=
|
||||
|
||||
define ConfigVars
|
||||
$(subst $(space),,$(foreach opt,$(config-$(1)),CPTCFG_$(opt)=$(1)
|
||||
))
|
||||
endef
|
||||
|
||||
define mac80211_config
|
||||
$(call ConfigVars,m)$(call ConfigVars,y)
|
||||
endef
|
||||
$(eval $(call shexport,mac80211_config))
|
||||
|
||||
define Build/Prepare
|
||||
rm -rf $(PKG_BUILD_DIR)
|
||||
mkdir -p $(PKG_BUILD_DIR)
|
||||
$(PKG_UNPACK)
|
||||
$(Build/Patch)
|
||||
$(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
|
||||
$(TAR) -C $(PKG_BUILD_DIR) -xzf $(DL_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
|
||||
$(TAR) -C $(PKG_BUILD_DIR) -xjf $(DL_DIR)/$(ZD1211FW_NAME)-$(ZD1211FW_VERSION).tar.bz2
|
||||
rm -rf \
|
||||
$(PKG_BUILD_DIR)/include/linux/ssb \
|
||||
$(PKG_BUILD_DIR)/include/linux/bcma \
|
||||
$(PKG_BUILD_DIR)/include/net/bluetooth
|
||||
|
||||
rm -f \
|
||||
$(PKG_BUILD_DIR)/include/linux/cordic.h \
|
||||
$(PKG_BUILD_DIR)/include/linux/crc8.h \
|
||||
$(PKG_BUILD_DIR)/include/linux/eeprom_93cx6.h \
|
||||
$(PKG_BUILD_DIR)/include/linux/wl12xx.h \
|
||||
$(PKG_BUILD_DIR)/include/linux/spi/libertas_spi.h \
|
||||
$(PKG_BUILD_DIR)/include/net/ieee80211.h \
|
||||
$(PKG_BUILD_DIR)/backport-include/linux/bcm47xx_nvram.h
|
||||
|
||||
echo 'compat-wireless-$(PKG_VERSION)-$(PKG_RELEASE)-$(REVISION)' > $(PKG_BUILD_DIR)/compat_version
|
||||
endef
|
||||
|
||||
ifneq ($(CONFIG_PACKAGE_kmod-cfg80211)$(CONFIG_PACKAGE_kmod-lib80211),)
|
||||
define Build/Compile/kmod
|
||||
rm -rf $(PKG_BUILD_DIR)/modules
|
||||
+$(MAKE) $(PKG_JOBS) $(MAKE_OPTS) modules
|
||||
endef
|
||||
endif
|
||||
|
||||
define Build/Patch
|
||||
$(if $(QUILT),rm -rf $(PKG_BUILD_DIR)/patches; mkdir -p $(PKG_BUILD_DIR)/patches)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
|
||||
$(call PatchDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
|
||||
$(if $(QUILT),touch $(PKG_BUILD_DIR)/.quilt_used)
|
||||
endef
|
||||
|
||||
define Quilt/Refresh/Package
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/build,build/)
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/subsys,subsys/)
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/ath,ath/)
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/rt2x00,rt2x00/)
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/mwl,mwl/)
|
||||
$(call Quilt/RefreshDir,$(PKG_BUILD_DIR),$(PATCH_DIR)/brcm,brcm/)
|
||||
endef
|
||||
|
||||
define Build/Compile
|
||||
$(SH_FUNC) var2file "$(call shvar,mac80211_config)" $(PKG_BUILD_DIR)/.config
|
||||
$(MAKE) $(MAKE_OPTS) allnoconfig
|
||||
$(call Build/Compile/kmod)
|
||||
endef
|
||||
|
||||
define Build/InstallDev
|
||||
mkdir -p \
|
||||
$(1)/usr/include/mac80211 \
|
||||
$(1)/usr/include/mac80211-backport \
|
||||
$(1)/usr/include/mac80211/ath \
|
||||
$(1)/usr/include/net/mac80211
|
||||
$(CP) $(PKG_BUILD_DIR)/net/mac80211/*.h $(PKG_BUILD_DIR)/include/* $(1)/usr/include/mac80211/
|
||||
$(CP) $(PKG_BUILD_DIR)/backport-include/* $(1)/usr/include/mac80211-backport/
|
||||
$(CP) $(PKG_BUILD_DIR)/net/mac80211/rate.h $(1)/usr/include/net/mac80211/
|
||||
$(CP) $(PKG_BUILD_DIR)/drivers/net/wireless/ath/*.h $(1)/usr/include/mac80211/ath/
|
||||
rm -f $(1)/usr/include/mac80211-backport/linux/module.h
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/cfg80211/install
|
||||
$(INSTALL_DIR) $(1)/lib/wifi $(1)/lib/netifd/wireless
|
||||
$(INSTALL_DATA) ./files/lib/wifi/mac80211.sh $(1)/lib/wifi
|
||||
$(INSTALL_DATA) ./files/lib/netifd/mac80211.sh $(1)/lib/netifd
|
||||
$(INSTALL_BIN) ./files/lib/netifd/wireless/mac80211.sh $(1)/lib/netifd/wireless
|
||||
$(INSTALL_DIR) $(1)/etc/hotplug.d/ieee80211
|
||||
$(INSTALL_DATA) ./files/mac80211.hotplug $(1)/etc/hotplug.d/ieee80211/10-wifi-detect
|
||||
endef
|
||||
|
||||
define KernelPackage/zd1211rw/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/zd1211
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(ZD1211FW_NAME)/zd1211* $(1)/lib/firmware/zd1211
|
||||
endef
|
||||
|
||||
$(eval $(foreach drv,$(PKG_DRIVERS),$(call KernelPackage,$(drv))))
|
||||
$(eval $(call KernelPackage,cfg80211))
|
||||
$(eval $(call KernelPackage,mac80211))
|
||||
310
feeds/wifi-ath10k/mac80211/ath.mk
Normal file
310
feeds/wifi-ath10k/mac80211/ath.mk
Normal file
@@ -0,0 +1,310 @@
|
||||
PKG_DRIVERS += \
|
||||
ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k \
|
||||
carl9170 owl-loader ar5523
|
||||
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_PACKAGE_ATH_DEBUG \
|
||||
CONFIG_PACKAGE_ATH_DFS \
|
||||
CONFIG_PACKAGE_ATH_SPECTRAL \
|
||||
CONFIG_PACKAGE_ATH_DYNACK \
|
||||
CONFIG_ATH9K_HWRNG \
|
||||
CONFIG_ATH9K_SUPPORT_PCOEM \
|
||||
CONFIG_ATH9K_TX99 \
|
||||
CONFIG_ATH10K_LEDS \
|
||||
CONFIG_ATH10K_THERMAL \
|
||||
CONFIG_ATH_USER_REGD
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
|
||||
config-y += \
|
||||
ATH9K_DEBUGFS \
|
||||
ATH9K_HTC_DEBUGFS \
|
||||
ATH10K_DEBUGFS \
|
||||
CARL9170_DEBUGFS \
|
||||
ATH5K_DEBUG \
|
||||
ATH6KL_DEBUG
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_TRACING
|
||||
config-y += \
|
||||
ATH10K_TRACING \
|
||||
ATH6KL_TRACING \
|
||||
ATH_TRACEPOINTS \
|
||||
ATH5K_TRACER
|
||||
endif
|
||||
|
||||
config-$(call config_package,ath) += ATH_CARDS ATH_COMMON ATH_REG_DYNAMIC_USER_REG_HINTS
|
||||
config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS
|
||||
config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
|
||||
config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL
|
||||
config-$(CONFIG_PACKAGE_ATH_DYNACK) += ATH9K_DYNACK
|
||||
config-$(call config_package,ath9k) += ATH9K
|
||||
config-$(call config_package,ath9k-common) += ATH9K_COMMON
|
||||
config-$(call config_package,owl-loader) += ATH9K_PCI_NO_EEPROM
|
||||
config-$(CONFIG_TARGET_ath79) += ATH9K_AHB
|
||||
config-$(CONFIG_TARGET_ipq40xx) += ATH10K_AHB
|
||||
config-$(CONFIG_PCI) += ATH9K_PCI
|
||||
config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD
|
||||
config-$(CONFIG_ATH9K_HWRNG) += ATH9K_HWRNG
|
||||
config-$(CONFIG_ATH9K_SUPPORT_PCOEM) += ATH9K_PCOEM
|
||||
config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99
|
||||
config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
|
||||
config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS
|
||||
config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
|
||||
|
||||
config-$(call config_package,ath9k-htc) += ATH9K_HTC
|
||||
config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
|
||||
|
||||
config-$(call config_package,ath5k) += ATH5K
|
||||
ifdef CONFIG_TARGET_ath25
|
||||
config-y += ATH5K_AHB
|
||||
else
|
||||
config-y += ATH5K_PCI
|
||||
endif
|
||||
|
||||
config-$(call config_package,ath6kl) += ATH6KL
|
||||
config-$(call config_package,ath6kl-sdio) += ATH6KL_SDIO
|
||||
config-$(call config_package,ath6kl-usb) += ATH6KL_USB
|
||||
|
||||
config-$(call config_package,carl9170) += CARL9170
|
||||
config-$(call config_package,ar5523) += AR5523
|
||||
|
||||
define KernelPackage/ath/config
|
||||
if PACKAGE_kmod-ath
|
||||
config ATH_USER_REGD
|
||||
bool "Force Atheros drivers to respect the user's regdomain settings"
|
||||
default y
|
||||
help
|
||||
Atheros' idea of regulatory handling is that the EEPROM of the card defines
|
||||
the regulatory limits and the user is only allowed to restrict the settings
|
||||
even further, even if the country allows frequencies or power levels that
|
||||
are forbidden by the EEPROM settings.
|
||||
|
||||
Select this option if you want the driver to respect the user's decision about
|
||||
regulatory settings.
|
||||
|
||||
config PACKAGE_ATH_DEBUG
|
||||
bool "Atheros wireless debugging"
|
||||
help
|
||||
Say Y, if you want to debug atheros wireless drivers.
|
||||
Only ath9k & ath10k make use of this.
|
||||
|
||||
config PACKAGE_ATH_DFS
|
||||
bool "Enable DFS support"
|
||||
default y
|
||||
help
|
||||
Dynamic frequency selection (DFS) is required for most of the 5 GHz band
|
||||
channels in Europe, US, and Japan.
|
||||
|
||||
Select this option if you want to use such channels.
|
||||
|
||||
config PACKAGE_ATH_SPECTRAL
|
||||
bool "Atheros spectral scan support"
|
||||
depends on PACKAGE_ATH_DEBUG
|
||||
select KERNEL_RELAY
|
||||
help
|
||||
Say Y to enable access to the FFT/spectral data via debugfs.
|
||||
|
||||
config PACKAGE_ATH_DYNACK
|
||||
bool "Enable Dynack support"
|
||||
depends on PACKAGE_kmod-ath9k-common
|
||||
help
|
||||
Enables support for Dynamic ACK estimation, which allows the fastest possible speed
|
||||
at any distance automatically by increasing/decreasing the max frame ACK time for
|
||||
the most remote station detected. It can be enabled by using iw (iw phy0 set distance auto),
|
||||
or by sending the NL80211_ATTR_WIPHY_DYN_ACK flag to mac80211 driver using netlink.
|
||||
|
||||
Select this option if you want to enable this feature
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/ath
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros common driver part
|
||||
DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79||TARGET_ath25 +kmod-mac80211
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/ath/description
|
||||
This module contains some common parts needed by Atheros Wireless drivers.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath5k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 5xxx wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k
|
||||
DEPENDS+= @(PCI_SUPPORT||TARGET_ath25) +kmod-ath +@DRIVER_11W_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath5k)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath5k/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros 5xxx chipset.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb)
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
|
||||
HIDDEN:=1
|
||||
DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT
|
||||
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-sdio
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n SDIO wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
|
||||
DEPENDS+= +kmod-mmc +kmod-ath6kl
|
||||
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath6kl_sdio)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-sdio/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros IEEE 802.11n AR6003 and AR6004 family of chipsets.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-usb
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n USB wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
|
||||
DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-ath6kl
|
||||
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath6kl_usb)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-usb/description
|
||||
This module adds support for wireless adapters based on the
|
||||
Atheros IEEE 802.11n AR6004 chipset.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k-common
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
|
||||
HIDDEN:=1
|
||||
DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ath79 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n PCI wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
|
||||
DEPENDS+= @PCI_SUPPORT||TARGET_ath79 +kmod-ath9k-common
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath9k)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k/config
|
||||
|
||||
config ATH9K_HWRNG
|
||||
bool "Add wireless noise as source of randomness to kernel entropy pool"
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
select PACKAGE_kmod-random-core
|
||||
default n
|
||||
|
||||
config ATH9K_SUPPORT_PCOEM
|
||||
bool "Support chips used in PC OEM cards"
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
|
||||
config ATH9K_TX99
|
||||
bool "Enable TX99 support (WARNING: testing only, breaks normal operation!)"
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
|
||||
config ATH9K_UBNTHSR
|
||||
bool "Support for Ubiquiti UniFi Outdoor+ access point"
|
||||
depends on PACKAGE_kmod-ath9k && TARGET_ath79
|
||||
default y
|
||||
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k-htc
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n USB device support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
|
||||
DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core +ath9k-htc-firmware
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath9k_htc)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k-htc/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros USB AR9271 and AR7010 family of chipsets.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath10k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11ac wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k
|
||||
DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \
|
||||
+ATH10K_THERMAL:kmod-hwmon-core +ATH10K_THERMAL:kmod-thermal
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath10k_pci)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath10k/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros IEEE 802.11ac family of chipsets. For now only
|
||||
PCI is supported.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath10k/config
|
||||
|
||||
config ATH10K_LEDS
|
||||
bool "Enable LED support"
|
||||
default y
|
||||
depends on PACKAGE_kmod-ath10k
|
||||
|
||||
config ATH10K_THERMAL
|
||||
bool "Enable thermal sensors and throttling support"
|
||||
depends on PACKAGE_kmod-ath10k
|
||||
|
||||
endef
|
||||
|
||||
define KernelPackage/carl9170
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Atheros AR9170 USB sticks
|
||||
DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +carl9170-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko
|
||||
AUTOLOAD:=$(call AutoProbe,carl9170)
|
||||
endef
|
||||
|
||||
define KernelPackage/owl-loader
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Owl loader for initializing Atheros PCI(e) Wifi chips
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-ath9k
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath9k_pci_owl_loader)
|
||||
endef
|
||||
|
||||
define KernelPackage/owl-loader/description
|
||||
Kernel module that helps to initialize certain Qualcomm
|
||||
Atheros' PCI(e) Wifi chips, which have the init data
|
||||
(which contains the PCI device ID for example) stored
|
||||
together with the calibration data in the file system.
|
||||
|
||||
This is necessary for devices like the Cisco Meraki Z1.
|
||||
endef
|
||||
|
||||
define KernelPackage/ar5523
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Atheros AR5523 USB sticks
|
||||
DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ar5523/ar5523.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ar5523)
|
||||
endef
|
||||
302
feeds/wifi-ath10k/mac80211/ath.mk.orig
Normal file
302
feeds/wifi-ath10k/mac80211/ath.mk.orig
Normal file
@@ -0,0 +1,302 @@
|
||||
PKG_DRIVERS += \
|
||||
ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k \
|
||||
carl9170 owl-loader
|
||||
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_PACKAGE_ATH_DEBUG \
|
||||
CONFIG_PACKAGE_ATH_DFS \
|
||||
CONFIG_PACKAGE_ATH_SPECTRAL \
|
||||
CONFIG_PACKAGE_ATH_DYNACK \
|
||||
CONFIG_ATH9K_HWRNG \
|
||||
CONFIG_ATH9K_SUPPORT_PCOEM \
|
||||
CONFIG_ATH9K_TX99 \
|
||||
CONFIG_ATH10K_LEDS \
|
||||
CONFIG_ATH10K_THERMAL \
|
||||
CONFIG_ATH_USER_REGD
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_DEBUGFS
|
||||
config-y += \
|
||||
ATH9K_DEBUGFS \
|
||||
ATH9K_HTC_DEBUGFS \
|
||||
ATH10K_DEBUGFS \
|
||||
CARL9170_DEBUGFS \
|
||||
ATH5K_DEBUG \
|
||||
ATH6KL_DEBUG
|
||||
endif
|
||||
|
||||
ifdef CONFIG_PACKAGE_MAC80211_TRACING
|
||||
config-y += \
|
||||
ATH10K_TRACING \
|
||||
ATH6KL_TRACING \
|
||||
ATH_TRACEPOINTS \
|
||||
ATH5K_TRACER
|
||||
endif
|
||||
|
||||
config-$(call config_package,ath) += ATH_CARDS ATH_COMMON ATH_REG_DYNAMIC_USER_REG_HINTS
|
||||
config-$(CONFIG_PACKAGE_ATH_DEBUG) += ATH_DEBUG ATH10K_DEBUG ATH9K_STATION_STATISTICS
|
||||
config-$(CONFIG_PACKAGE_ATH_DFS) += ATH9K_DFS_CERTIFIED ATH10K_DFS_CERTIFIED
|
||||
config-$(CONFIG_PACKAGE_ATH_SPECTRAL) += ATH9K_COMMON_SPECTRAL ATH10K_SPECTRAL
|
||||
config-$(CONFIG_PACKAGE_ATH_DYNACK) += ATH9K_DYNACK
|
||||
config-$(call config_package,ath9k) += ATH9K
|
||||
config-$(call config_package,ath9k-common) += ATH9K_COMMON
|
||||
config-$(call config_package,owl-loader) += ATH9K_PCI_NO_EEPROM
|
||||
config-$(CONFIG_TARGET_ar71xx) += ATH9K_AHB
|
||||
config-$(CONFIG_TARGET_ath79) += ATH9K_AHB
|
||||
config-$(CONFIG_TARGET_ipq40xx) += ATH10K_AHB
|
||||
config-$(CONFIG_PCI) += ATH9K_PCI
|
||||
config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD
|
||||
config-$(CONFIG_ATH9K_HWRNG) += ATH9K_HWRNG
|
||||
config-$(CONFIG_ATH9K_SUPPORT_PCOEM) += ATH9K_PCOEM
|
||||
config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99
|
||||
config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
|
||||
config-$(CONFIG_ATH10K_LEDS) += ATH10K_LEDS
|
||||
config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
|
||||
|
||||
config-$(call config_package,ath9k-htc) += ATH9K_HTC
|
||||
config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
|
||||
|
||||
config-$(call config_package,ath5k) += ATH5K
|
||||
ifdef CONFIG_TARGET_ath25
|
||||
config-y += ATH5K_AHB
|
||||
else
|
||||
config-y += ATH5K_PCI
|
||||
endif
|
||||
|
||||
config-$(call config_package,ath6kl) += ATH6KL
|
||||
config-$(call config_package,ath6kl-sdio) += ATH6KL_SDIO
|
||||
config-$(call config_package,ath6kl-usb) += ATH6KL_USB
|
||||
|
||||
config-$(call config_package,carl9170) += CARL9170
|
||||
|
||||
define KernelPackage/ath/config
|
||||
if PACKAGE_kmod-ath
|
||||
config ATH_USER_REGD
|
||||
bool "Force Atheros drivers to respect the user's regdomain settings"
|
||||
default y
|
||||
help
|
||||
Atheros' idea of regulatory handling is that the EEPROM of the card defines
|
||||
the regulatory limits and the user is only allowed to restrict the settings
|
||||
even further, even if the country allows frequencies or power levels that
|
||||
are forbidden by the EEPROM settings.
|
||||
|
||||
Select this option if you want the driver to respect the user's decision about
|
||||
regulatory settings.
|
||||
|
||||
config PACKAGE_ATH_DEBUG
|
||||
bool "Atheros wireless debugging"
|
||||
help
|
||||
Say Y, if you want to debug atheros wireless drivers.
|
||||
Only ath9k & ath10k make use of this.
|
||||
|
||||
config PACKAGE_ATH_DFS
|
||||
bool "Enable DFS support"
|
||||
default y
|
||||
help
|
||||
Dynamic frequency selection (DFS) is required for most of the 5 GHz band
|
||||
channels in Europe, US, and Japan.
|
||||
|
||||
Select this option if you want to use such channels.
|
||||
|
||||
config PACKAGE_ATH_SPECTRAL
|
||||
bool "Atheros spectral scan support"
|
||||
depends on PACKAGE_ATH_DEBUG
|
||||
select KERNEL_RELAY
|
||||
help
|
||||
Say Y to enable access to the FFT/spectral data via debugfs.
|
||||
|
||||
config PACKAGE_ATH_DYNACK
|
||||
bool "Enable Dynack support"
|
||||
depends on PACKAGE_kmod-ath9k-common
|
||||
help
|
||||
Enables support for Dynamic ACK estimation, which allows the fastest possible speed
|
||||
at any distance automatically by increasing/decreasing the max frame ACK time for
|
||||
the most remote station detected. It can be enabled by using iw (iw phy0 set distance auto),
|
||||
or by sending the NL80211_ATTR_WIPHY_DYN_ACK flag to mac80211 driver using netlink.
|
||||
|
||||
Select this option if you want to enable this feature
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/ath
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros common driver part
|
||||
DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath79||TARGET_ath25 +kmod-mac80211
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath.ko
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/ath/description
|
||||
This module contains some common parts needed by Atheros Wireless drivers.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath5k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 5xxx wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath5k
|
||||
DEPENDS+= @(PCI_SUPPORT||TARGET_ath25) +kmod-ath +@DRIVER_11W_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath5k/ath5k.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath5k)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath5k/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros 5xxx chipset.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros FullMAC wireless devices (common code for ath6kl_sdio and ath6kl_usb)
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
|
||||
HIDDEN:=1
|
||||
DEPENDS+= +kmod-ath +@DRIVER_11N_SUPPORT
|
||||
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_core.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-sdio
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n SDIO wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
|
||||
DEPENDS+= +kmod-mmc +kmod-ath6kl
|
||||
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_sdio.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath6kl_sdio)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-sdio/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros IEEE 802.11n AR6003 and AR6004 family of chipsets.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-usb
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n USB wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath6kl
|
||||
DEPENDS+= @USB_SUPPORT +kmod-usb-core +kmod-ath6kl
|
||||
FILES:= $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath6kl/ath6kl_usb.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath6kl_usb)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath6kl-usb/description
|
||||
This module adds support for wireless adapters based on the
|
||||
Atheros IEEE 802.11n AR6004 chipset.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k-common
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n wireless devices (common code for ath9k and ath9k_htc)
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
|
||||
HIDDEN:=1
|
||||
DEPENDS+= @PCI_SUPPORT||USB_SUPPORT||TARGET_ar71xx||TARGET_ath79 +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_common.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_hw.ko
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n PCI wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
|
||||
DEPENDS+= @PCI_SUPPORT||TARGET_ar71xx||TARGET_ath79 +kmod-ath9k-common
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath9k)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros IEEE 802.11n AR5008 and AR9001 family of chipsets.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k/config
|
||||
|
||||
config ATH9K_HWRNG
|
||||
bool "Add wireless noise as source of randomness to kernel entropy pool"
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
select PACKAGE_kmod-random-core
|
||||
default n
|
||||
|
||||
config ATH9K_SUPPORT_PCOEM
|
||||
bool "Support chips used in PC OEM cards"
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
|
||||
config ATH9K_TX99
|
||||
bool "Enable TX99 support (WARNING: testing only, breaks normal operation!)"
|
||||
depends on PACKAGE_kmod-ath9k
|
||||
|
||||
config ATH9K_UBNTHSR
|
||||
bool "Support for Ubiquiti UniFi Outdoor+ access point"
|
||||
depends on PACKAGE_kmod-ath9k && (TARGET_ar71xx_generic||TARGET_ath79)
|
||||
default y
|
||||
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k-htc
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11n USB device support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath9k
|
||||
DEPENDS+= @USB_SUPPORT +kmod-ath9k-common +kmod-usb-core +ath9k-htc-firmware
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_htc.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath9k_htc)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath9k-htc/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros USB AR9271 and AR7010 family of chipsets.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath10k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Atheros 802.11ac wireless cards support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k
|
||||
DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \
|
||||
+ATH10K_THERMAL:kmod-hwmon-core +ATH10K_THERMAL:kmod-thermal
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath10k_pci)
|
||||
endef
|
||||
|
||||
define KernelPackage/ath10k/description
|
||||
This module adds support for wireless adapters based on
|
||||
Atheros IEEE 802.11ac family of chipsets. For now only
|
||||
PCI is supported.
|
||||
endef
|
||||
|
||||
define KernelPackage/ath10k/config
|
||||
|
||||
config ATH10K_LEDS
|
||||
bool "Enable LED support"
|
||||
default y
|
||||
depends on PACKAGE_kmod-ath10k
|
||||
|
||||
config ATH10K_THERMAL
|
||||
bool "Enable thermal sensors and throttling support"
|
||||
depends on PACKAGE_kmod-ath10k
|
||||
|
||||
endef
|
||||
|
||||
define KernelPackage/carl9170
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Atheros AR9170 USB sticks
|
||||
DEPENDS:=@USB_SUPPORT +kmod-mac80211 +kmod-ath +kmod-usb-core +kmod-input-core +@DRIVER_11N_SUPPORT +@DRIVER_11W_SUPPORT +carl9170-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/carl9170/carl9170.ko
|
||||
AUTOLOAD:=$(call AutoProbe,carl9170)
|
||||
endef
|
||||
|
||||
define KernelPackage/owl-loader
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Owl loader for initializing Atheros PCI(e) Wifi chips
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-ath9k
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ath9k_pci_owl_loader)
|
||||
endef
|
||||
|
||||
define KernelPackage/owl-loader/description
|
||||
Kernel module that helps to initialize certain Qualcomm
|
||||
Atheros' PCI(e) Wifi chips, which have the init data
|
||||
(which contains the PCI device ID for example) stored
|
||||
together with the calibration data in the file system.
|
||||
|
||||
This is necessary for devices like the Cisco Meraki Z1.
|
||||
endef
|
||||
510
feeds/wifi-ath10k/mac80211/broadcom.mk
Normal file
510
feeds/wifi-ath10k/mac80211/broadcom.mk
Normal file
@@ -0,0 +1,510 @@
|
||||
PKG_DRIVERS += \
|
||||
b43 b43legacy brcmsmac brcmfmac brcmutil
|
||||
|
||||
PKG_CONFIG_DEPENDS += \
|
||||
CONFIG_PACKAGE_B43_DEBUG \
|
||||
CONFIG_PACKAGE_B43_PIO \
|
||||
CONFIG_PACKAGE_B43_PHY_G \
|
||||
CONFIG_PACKAGE_B43_PHY_N \
|
||||
CONFIG_PACKAGE_B43_PHY_LP \
|
||||
CONFIG_PACKAGE_B43_PHY_HT \
|
||||
CONFIG_PACKAGE_B43_BUSES_BCMA_AND_SSB \
|
||||
CONFIG_PACKAGE_B43_BUSES_BCMA \
|
||||
CONFIG_PACKAGE_B43_BUSES_SSB \
|
||||
CONFIG_PACKAGE_BRCM80211_DEBUG
|
||||
|
||||
config-$(call config_package,b43) += B43
|
||||
config-$(CONFIG_PACKAGE_B43_BUSES_BCMA_AND_SSB) += B43_BUSES_BCMA_AND_SSB
|
||||
config-$(CONFIG_PACKAGE_B43_BUSES_BCMA) += B43_BUSES_BCMA
|
||||
config-$(CONFIG_PACKAGE_B43_BUSES_SSB) += B43_BUSES_SSB
|
||||
config-$(CONFIG_PACKAGE_B43_PHY_G) += B43_PHY_G
|
||||
config-$(CONFIG_PACKAGE_B43_PHY_N) += B43_PHY_N
|
||||
config-$(CONFIG_PACKAGE_B43_PHY_LP) += B43_PHY_LP
|
||||
config-$(CONFIG_PACKAGE_B43_PHY_HT) += B43_PHY_HT
|
||||
config-$(CONFIG_PACKAGE_B43_PIO) += B43_PIO
|
||||
config-$(CONFIG_PACKAGE_B43_DEBUG) += B43_DEBUG
|
||||
|
||||
config-$(call config_package,b43legacy) += B43LEGACY
|
||||
config-y += B43LEGACY_DMA_MODE
|
||||
|
||||
config-$(call config_package,brcmutil) += BRCMUTIL
|
||||
config-$(call config_package,brcmsmac) += BRCMSMAC
|
||||
config-$(call config_package,brcmfmac) += BRCMFMAC
|
||||
config-$(CONFIG_BRCMFMAC_SDIO) += BRCMFMAC_SDIO
|
||||
config-$(CONFIG_BRCMFMAC_USB) += BRCMFMAC_USB
|
||||
config-$(CONFIG_BRCMFMAC_PCIE) += BRCMFMAC_PCIE
|
||||
config-$(CONFIG_PACKAGE_BRCM80211_DEBUG) += BRCMDBG
|
||||
|
||||
config-$(CONFIG_LEDS_TRIGGERS) += B43_LEDS B43LEGACY_LEDS
|
||||
|
||||
#Broadcom firmware
|
||||
ifneq ($(CONFIG_B43_FW_6_30),)
|
||||
PKG_B43_FWV4_NAME:=broadcom-wl
|
||||
PKG_B43_FWV4_VERSION:=6.30.163.46
|
||||
PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).wl_apsta.o
|
||||
PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
|
||||
PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
|
||||
PKG_B43_FWV4_HASH:=a07c3b6b277833c7dbe61daa511f908cd66c5e2763eb7a0859abc36cd9335c2d
|
||||
else
|
||||
ifneq ($(CONFIG_B43_FW_5_10),)
|
||||
PKG_B43_FWV4_NAME:=broadcom-wl
|
||||
PKG_B43_FWV4_VERSION:=5.10.56.27.3
|
||||
PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta/wl_prebuilt.o
|
||||
PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)_mipsel.tar.bz2
|
||||
PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||
PKG_B43_FWV4_HASH:=26a8c370f48fc129d0731cfd751c36cae1419b0bc8ca35781126744e60eae009
|
||||
else
|
||||
ifneq ($(CONFIG_B43_FW_4_178),)
|
||||
PKG_B43_FWV4_NAME:=broadcom-wl
|
||||
PKG_B43_FWV4_VERSION:=4.178.10.4
|
||||
PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
|
||||
PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
|
||||
PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||
PKG_B43_FWV4_HASH:=32f6ad98facbb9045646fdc8b54bb03086d204153253f9c65d0234a5d90ae53f
|
||||
else
|
||||
ifneq ($(CONFIG_B43_FW_5_100_138),)
|
||||
PKG_B43_FWV4_NAME:=broadcom-wl
|
||||
PKG_B43_FWV4_VERSION:=5.100.138
|
||||
PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/linux/wl_apsta.o
|
||||
PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
|
||||
PKG_B43_FWV4_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
|
||||
PKG_B43_FWV4_HASH:=f1e7067aac5b62b67b8b6e4c517990277804339ac16065eb13c731ff909ae46f
|
||||
else
|
||||
PKG_B43_FWV4_NAME:=broadcom-wl
|
||||
PKG_B43_FWV4_VERSION:=4.150.10.5
|
||||
PKG_B43_FWV4_OBJECT:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION)/driver/wl_apsta_mimo.o
|
||||
PKG_B43_FWV4_SOURCE:=$(PKG_B43_FWV4_NAME)-$(PKG_B43_FWV4_VERSION).tar.bz2
|
||||
PKG_B43_FWV4_SOURCE_URL:=http://mirror2.openwrt.org/sources/
|
||||
PKG_B43_FWV4_HASH:=a9f4e276a4d8d3a1cd0f2eb87080ae89b77f0a7140f06d4e9e2135fc44fdd533
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
ifneq ($(CONFIG_B43_OPENFIRMWARE),)
|
||||
PKG_B43_FWV4_NAME:=broadcom-wl
|
||||
PKG_B43_FWV4_VERSION:=5.2
|
||||
PKG_B43_FWV4_OBJECT:=openfwwf-$(PKG_B43_FWV4_VERSION)
|
||||
PKG_B43_FWV4_SOURCE:=openfwwf-$(PKG_B43_FWV4_VERSION).tar.gz
|
||||
PKG_B43_FWV4_SOURCE_URL:=http://netweb.ing.unibs.it/~openfwwf/firmware
|
||||
PKG_B43_FWV4_HASH:=9de03320083201080b2e94b81637ac07a159cf4e6f3481383e1a217e627bc0dc
|
||||
endif
|
||||
|
||||
|
||||
define Download/b43
|
||||
FILE:=$(PKG_B43_FWV4_SOURCE)
|
||||
URL:=$(PKG_B43_FWV4_SOURCE_URL)
|
||||
HASH:=$(PKG_B43_FWV4_HASH)
|
||||
endef
|
||||
$(eval $(call Download,b43))
|
||||
|
||||
define KernelPackage/b43
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Broadcom 43xx wireless support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
|
||||
KCONFIG:= \
|
||||
CONFIG_HW_RANDOM=y
|
||||
# Depend on PCI_SUPPORT to make sure we can select kmod-bcma or kmod-ssb
|
||||
DEPENDS += \
|
||||
@PCI_SUPPORT +@DRIVER_11W_SUPPORT +kmod-mac80211 +kmod-lib-cordic \
|
||||
$(if $(CONFIG_PACKAGE_B43_USE_SSB),+kmod-ssb) \
|
||||
$(if $(CONFIG_PACKAGE_B43_USE_BCMA),+kmod-bcma)
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43/b43.ko
|
||||
AUTOLOAD:=$(call AutoProbe,b43)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/b43/config
|
||||
|
||||
config PACKAGE_B43_USE_SSB
|
||||
select PACKAGE_kmod-ssb
|
||||
tristate
|
||||
depends on !TARGET_bcm47xx && !TARGET_bcm63xx
|
||||
default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
|
||||
default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_SSB
|
||||
|
||||
config PACKAGE_B43_USE_BCMA
|
||||
select PACKAGE_kmod-bcma
|
||||
tristate
|
||||
depends on !TARGET_bcm47xx && !TARGET_bcm53xx
|
||||
default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA_AND_SSB
|
||||
default PACKAGE_kmod-b43 if PACKAGE_B43_BUSES_BCMA
|
||||
|
||||
if PACKAGE_kmod-b43
|
||||
|
||||
choice
|
||||
prompt "b43 firmware version"
|
||||
default B43_FW_5_100_138
|
||||
help
|
||||
This option allows you to select the version of the b43 firmware.
|
||||
|
||||
config B43_FW_4_150
|
||||
bool "Firmware 410.2160 from driver 4.150.10.5 (old stable)"
|
||||
help
|
||||
Old stable firmware for BCM43xx devices.
|
||||
|
||||
If unsure, select this.
|
||||
|
||||
config B43_FW_4_178
|
||||
bool "Firmware 478.104 from driver 4.178.10.4"
|
||||
help
|
||||
Older firmware for BCM43xx devices.
|
||||
|
||||
If unsure, select the "stable" firmware.
|
||||
|
||||
config B43_FW_5_10
|
||||
bool "Firmware 508.1084 from driver 5.10.56.27"
|
||||
help
|
||||
Older firmware for BCM43xx devices.
|
||||
|
||||
If unsure, select the "stable" firmware.
|
||||
|
||||
config B43_FW_5_100_138
|
||||
bool "Firmware 666.2 from driver 5.100.138 (stable)"
|
||||
help
|
||||
The currently default firmware for BCM43xx devices.
|
||||
|
||||
This firmware currently gets most of the testing and is needed for some N-PHY devices.
|
||||
|
||||
If unsure, select the this firmware.
|
||||
|
||||
config B43_FW_6_30
|
||||
bool "Firmware 784.2 from driver 6.30.163.46 (experimental)"
|
||||
help
|
||||
Newer experimental firmware for BCM43xx devices.
|
||||
|
||||
This firmware is mostly untested.
|
||||
|
||||
If unsure, select the "stable" firmware.
|
||||
|
||||
config B43_OPENFIRMWARE
|
||||
bool "Open FirmWare for WiFi networks"
|
||||
help
|
||||
Opensource firmware for BCM43xx devices.
|
||||
|
||||
Do _not_ select this, unless you know what you are doing.
|
||||
The Opensource firmware is not suitable for embedded devices, yet.
|
||||
It does not support QoS, which is bad for AccessPoints.
|
||||
It does not support hardware crypto acceleration, which is a showstopper
|
||||
for embedded devices with low CPU resources.
|
||||
|
||||
If unsure, select the "stable" firmware.
|
||||
|
||||
endchoice
|
||||
|
||||
config B43_FW_SQUASH
|
||||
bool "Remove unnecessary firmware files"
|
||||
depends on !B43_OPENFIRMWARE
|
||||
default y
|
||||
help
|
||||
This options allows you to remove unnecessary b43 firmware files
|
||||
from the final rootfs image. This can reduce the rootfs size by
|
||||
up to 200k.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config B43_FW_SQUASH_COREREVS
|
||||
string "Core revisions to include"
|
||||
depends on B43_FW_SQUASH
|
||||
default "5,6,7,8,9,10,11,13,15" if TARGET_bcm47xx_legacy
|
||||
default "16,28,29,30" if TARGET_bcm47xx_mips74k
|
||||
default "5,6,7,8,9,10,11,13,15,16,28,29,30"
|
||||
help
|
||||
This is a comma seperated list of core revision numbers.
|
||||
|
||||
Example (keep files for rev5 only):
|
||||
5
|
||||
|
||||
Example (keep files for rev5 and rev11):
|
||||
5,11
|
||||
|
||||
config B43_FW_SQUASH_PHYTYPES
|
||||
string "PHY types to include"
|
||||
depends on B43_FW_SQUASH
|
||||
default "G,N,LP" if TARGET_bcm47xx_legacy
|
||||
default "N,HT" if TARGET_bcm47xx_mips74k
|
||||
default "G,N,LP,HT"
|
||||
help
|
||||
This is a comma seperated list of PHY types:
|
||||
A => A-PHY
|
||||
AG => Dual A-PHY G-PHY
|
||||
G => G-PHY
|
||||
LP => LP-PHY
|
||||
N => N-PHY
|
||||
HT => HT-PHY
|
||||
LCN => LCN-PHY
|
||||
LCN40 => LCN40-PHY
|
||||
AC => AC-PHY
|
||||
|
||||
Example (keep files for G-PHY only):
|
||||
G
|
||||
|
||||
Example (keep files for G-PHY and N-PHY):
|
||||
G,N
|
||||
|
||||
choice
|
||||
prompt "Supported buses"
|
||||
default PACKAGE_B43_BUSES_BCMA_AND_SSB
|
||||
help
|
||||
This allows choosing buses that b43 should support.
|
||||
|
||||
config PACKAGE_B43_BUSES_BCMA_AND_SSB
|
||||
depends on !TARGET_bcm47xx_legacy && !TARGET_bcm47xx_mips74k && !TARGET_bcm53xx
|
||||
bool "BCMA and SSB"
|
||||
|
||||
config PACKAGE_B43_BUSES_BCMA
|
||||
depends on !TARGET_bcm47xx_legacy
|
||||
bool "BCMA only"
|
||||
|
||||
config PACKAGE_B43_BUSES_SSB
|
||||
depends on !TARGET_bcm47xx_mips74k && !TARGET_bcm53xx
|
||||
bool "SSB only"
|
||||
|
||||
endchoice
|
||||
|
||||
config PACKAGE_B43_DEBUG
|
||||
bool "Enable debug output and debugfs for b43"
|
||||
default n
|
||||
help
|
||||
Enable additional debug output and runtime sanity checks for b43
|
||||
and enables the debugfs interface.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config PACKAGE_B43_PIO
|
||||
bool "Enable support for PIO transfer mode"
|
||||
default n
|
||||
help
|
||||
Enable support for using PIO instead of DMA. Unless you have DMA
|
||||
transfer problems you don't need this.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
config PACKAGE_B43_PHY_G
|
||||
bool "Enable support for G-PHYs"
|
||||
default n if TARGET_bcm47xx_mips74k
|
||||
default y
|
||||
help
|
||||
Enable support for G-PHY. This includes support for the following devices:
|
||||
PCI: BCM4306, BCM4311, BCM4318
|
||||
SoC: BCM5352E, BCM4712
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config PACKAGE_B43_PHY_N
|
||||
bool "Enable support for N-PHYs"
|
||||
default y
|
||||
help
|
||||
Enable support for N-PHY. This includes support for the following devices:
|
||||
PCI: BCM4321, BCM4322, BCM43222, BCM43224, BCM43225
|
||||
SoC: BCM4716, BCM4717, BCM4718
|
||||
|
||||
Currently only 11g speed is available.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config PACKAGE_B43_PHY_LP
|
||||
bool "Enable support for LP-PHYs"
|
||||
default n if TARGET_bcm47xx_mips74k
|
||||
default y
|
||||
help
|
||||
Enable support for LP-PHY. This includes support for the following devices:
|
||||
PCI: BCM4312
|
||||
SoC: BCM5354
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config PACKAGE_B43_PHY_HT
|
||||
bool "Enable support for HT-PHYs"
|
||||
default n if TARGET_bcm47xx_legacy
|
||||
default y
|
||||
help
|
||||
Enable support for HT-PHY. This includes support for the following devices:
|
||||
PCI: BCM4331
|
||||
|
||||
Currently only 11g speed is available.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
config PACKAGE_B43_PHY_LCN
|
||||
bool "Enable support for LCN-PHYs"
|
||||
depends on BROKEN
|
||||
default n
|
||||
help
|
||||
Currently broken.
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/b43/description
|
||||
Kernel module for Broadcom 43xx wireless support (mac80211 stack) new
|
||||
endef
|
||||
|
||||
define KernelPackage/b43legacy
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Broadcom 43xx-legacy wireless support
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/b43
|
||||
KCONFIG:= \
|
||||
CONFIG_HW_RANDOM=y
|
||||
DEPENDS+= +kmod-mac80211 +!(TARGET_bcm47xx||TARGET_bcm63xx):kmod-ssb @!TARGET_bcm47xx_mips74k +b43legacy-firmware +@DRIVER_11W_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/b43legacy/b43legacy.ko
|
||||
AUTOLOAD:=$(call AutoProbe,b43legacy)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/b43legacy/description
|
||||
Kernel module for Broadcom 43xx-legacy wireless support (mac80211 stack) new
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/brcmutil
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Broadcom IEEE802.11n common driver parts
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
|
||||
DEPENDS+=@PCI_SUPPORT||USB_SUPPORT
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmutil/brcmutil.ko
|
||||
AUTOLOAD:=$(call AutoProbe,brcmutil)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/brcmutil/description
|
||||
This module contains some common parts needed by Broadcom Wireless drivers brcmsmac and brcmfmac.
|
||||
endef
|
||||
|
||||
define KernelPackage/brcmutil/config
|
||||
if PACKAGE_kmod-brcmutil
|
||||
|
||||
config PACKAGE_BRCM80211_DEBUG
|
||||
bool "Broadcom wireless driver debugging"
|
||||
help
|
||||
Say Y, if you want to debug brcmsmac and brcmfmac wireless driver.
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
PKG_BRCMSMAC_FW_NAME:=broadcom-wl
|
||||
PKG_BRCMSMAC_FW_VERSION:=5.100.138
|
||||
PKG_BRCMSMAC_FW_OBJECT:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION)/linux/wl_apsta.o
|
||||
PKG_BRCMSMAC_FW_SOURCE:=$(PKG_BRCMSMAC_FW_NAME)-$(PKG_BRCMSMAC_FW_VERSION).tar.bz2
|
||||
PKG_BRCMSMAC_FW_SOURCE_URL:=http://www.lwfinger.com/b43-firmware/
|
||||
PKG_BRCMSMAC_FW_HASH:=f1e7067aac5b62b67b8b6e4c517990277804339ac16065eb13c731ff909ae46f
|
||||
|
||||
define Download/brcmsmac
|
||||
FILE:=$(PKG_BRCMSMAC_FW_SOURCE)
|
||||
URL:=$(PKG_BRCMSMAC_FW_SOURCE_URL)
|
||||
HASH:=$(PKG_BRCMSMAC_FW_HASH)
|
||||
endef
|
||||
$(eval $(call Download,brcmsmac))
|
||||
|
||||
define KernelPackage/brcmsmac
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Broadcom IEEE802.11n PCIe SoftMAC WLAN driver
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
|
||||
DEPENDS+= +kmod-mac80211 +@DRIVER_11N_SUPPORT +!TARGET_bcm47xx:kmod-bcma +kmod-lib-cordic +kmod-lib-crc8 +kmod-brcmutil +!BRCMSMAC_USE_FW_FROM_WL:brcmsmac-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmsmac/brcmsmac.ko
|
||||
AUTOLOAD:=$(call AutoProbe,brcmsmac)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/brcmsmac/description
|
||||
Kernel module for Broadcom IEEE802.11n PCIe Wireless cards
|
||||
endef
|
||||
|
||||
define KernelPackage/brcmsmac/config
|
||||
if PACKAGE_kmod-brcmsmac
|
||||
|
||||
config BRCMSMAC_USE_FW_FROM_WL
|
||||
bool "Use firmware extracted from broadcom proprietary driver"
|
||||
default y
|
||||
help
|
||||
Instead of using the official brcmsmac firmware a firmware
|
||||
version 666.2 extracted from the proprietary Broadcom driver
|
||||
is used. This is needed to get core rev 17 used in bcm4716
|
||||
to work.
|
||||
|
||||
If unsure, say Y.
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/brcmfmac
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Broadcom IEEE802.11n USB FullMAC WLAN driver
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/brcm80211
|
||||
DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \
|
||||
+kmod-brcmutil +BRCMFMAC_SDIO:kmod-mmc @!TARGET_uml \
|
||||
+BRCMFMAC_USB:kmod-usb-core +BRCMFMAC_USB:brcmfmac-firmware-usb
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/broadcom/brcm80211/brcmfmac/brcmfmac.ko
|
||||
AUTOLOAD:=$(call AutoProbe,brcmfmac)
|
||||
endef
|
||||
|
||||
define KernelPackage/brcmfmac/description
|
||||
Kernel module for Broadcom IEEE802.11n USB Wireless cards
|
||||
endef
|
||||
|
||||
define KernelPackage/brcmfmac/config
|
||||
if PACKAGE_kmod-brcmfmac
|
||||
|
||||
config BRCMFMAC_SDIO
|
||||
bool "Enable SDIO bus interface support"
|
||||
default y if TARGET_bcm27xx
|
||||
default y if TARGET_sunxi
|
||||
default n
|
||||
help
|
||||
Enable support for cards attached to an SDIO bus.
|
||||
Select this option only if you are sure that your
|
||||
board has a Broadcom wireless chip atacched to
|
||||
that bus.
|
||||
|
||||
config BRCMFMAC_USB
|
||||
bool "Enable USB bus interface support"
|
||||
depends on USB_SUPPORT
|
||||
default y
|
||||
help
|
||||
Supported USB connected chipsets:
|
||||
BCM43235, BCM43236, BCM43238 (all in revision 3 only)
|
||||
BCM43143, BCM43242, BCM43566, BCM43569
|
||||
|
||||
config BRCMFMAC_PCIE
|
||||
bool "Enable PCIE bus interface support"
|
||||
depends on PCI_SUPPORT
|
||||
default y
|
||||
help
|
||||
Supported PCIe connected chipsets:
|
||||
BCM4354, BCM4356, BCM43567, BCM43570, BCM43602
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/b43/install
|
||||
rm -rf $(1)/lib/firmware/
|
||||
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
|
||||
tar xzf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
|
||||
else
|
||||
tar xjf "$(DL_DIR)/$(PKG_B43_FWV4_SOURCE)" -C "$(PKG_BUILD_DIR)"
|
||||
endif
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/
|
||||
ifeq ($(CONFIG_B43_OPENFIRMWARE),y)
|
||||
$(MAKE) -C "$(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/"
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/b43-open/
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/ucode5.fw $(1)/lib/firmware/b43-open/ucode5.fw
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0bsinitvals5.fw $(1)/lib/firmware/b43-open/b0g0bsinitvals5.fw
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)/b0g0initvals5.fw $(1)/lib/firmware/b43-open/b0g0initvals5.fw
|
||||
else
|
||||
b43-fwcutter -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_B43_FWV4_OBJECT)
|
||||
endif
|
||||
ifneq ($(CONFIG_B43_FW_SQUASH),)
|
||||
b43-fwsquash.py "$(CONFIG_B43_FW_SQUASH_PHYTYPES)" "$(CONFIG_B43_FW_SQUASH_COREREVS)" "$(1)/lib/firmware/b43"
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/brcmsmac/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware/brcm
|
||||
ifeq ($(CONFIG_BRCMSMAC_USE_FW_FROM_WL),y)
|
||||
tar xjf "$(DL_DIR)/$(PKG_BRCMSMAC_FW_SOURCE)" -C "$(PKG_BUILD_DIR)"
|
||||
b43-fwcutter --brcmsmac -w $(1)/lib/firmware/ $(PKG_BUILD_DIR)/$(PKG_BRCMSMAC_FW_OBJECT)
|
||||
endif
|
||||
endef
|
||||
36
feeds/wifi-ath10k/mac80211/files/lib/netifd/mac80211.sh
Normal file
36
feeds/wifi-ath10k/mac80211/files/lib/netifd/mac80211.sh
Normal file
@@ -0,0 +1,36 @@
|
||||
mac80211_phy_to_path() {
|
||||
local phy="$1"
|
||||
|
||||
[ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${phy} ] || return
|
||||
|
||||
local path="$(readlink -f /sys/class/ieee80211/${phy}/device)"
|
||||
[ -n "$path" ] || return
|
||||
|
||||
path="${path##/sys/devices/}"
|
||||
case "$path" in
|
||||
platform*/pci*) path="${path##platform/}";;
|
||||
esac
|
||||
|
||||
local p
|
||||
local seq=""
|
||||
for p in $(ls /sys/class/ieee80211/$phy/device/ieee80211); do
|
||||
[ "$p" = "$phy" ] && {
|
||||
echo "$path${seq:++$seq}"
|
||||
break
|
||||
}
|
||||
|
||||
seq=$((${seq:-0} + 1))
|
||||
done
|
||||
}
|
||||
|
||||
mac80211_path_to_phy() {
|
||||
local path="$1"
|
||||
|
||||
local p
|
||||
for p in $(ls /sys/class/ieee80211); do
|
||||
local cur="$(mac80211_phy_to_path "$p")"
|
||||
case "$cur" in
|
||||
*$path) echo "$p"; return;;
|
||||
esac
|
||||
done
|
||||
}
|
||||
1232
feeds/wifi-ath10k/mac80211/files/lib/netifd/wireless/mac80211.sh
Normal file
1232
feeds/wifi-ath10k/mac80211/files/lib/netifd/wireless/mac80211.sh
Normal file
File diff suppressed because it is too large
Load Diff
190
feeds/wifi-ath10k/mac80211/files/lib/wifi/mac80211.sh
Normal file
190
feeds/wifi-ath10k/mac80211/files/lib/wifi/mac80211.sh
Normal file
@@ -0,0 +1,190 @@
|
||||
#!/bin/sh
|
||||
|
||||
append DRIVERS "mac80211"
|
||||
|
||||
lookup_phy() {
|
||||
[ -n "$phy" ] && {
|
||||
[ -d /sys/class/ieee80211/$phy ] && return
|
||||
}
|
||||
|
||||
local devpath
|
||||
config_get devpath "$device" path
|
||||
[ -n "$devpath" ] && {
|
||||
phy="$(iwinfo nl80211 phyname "path=$devpath")"
|
||||
[ -n "$phy" ] && return
|
||||
}
|
||||
|
||||
local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
|
||||
[ -n "$macaddr" ] && {
|
||||
for _phy in /sys/class/ieee80211/*; do
|
||||
[ -e "$_phy" ] || continue
|
||||
|
||||
[ "$macaddr" = "$(cat ${_phy}/macaddress)" ] || continue
|
||||
phy="${_phy##*/}"
|
||||
return
|
||||
done
|
||||
}
|
||||
phy=
|
||||
return
|
||||
}
|
||||
|
||||
find_mac80211_phy() {
|
||||
local device="$1"
|
||||
|
||||
config_get phy "$device" phy
|
||||
lookup_phy
|
||||
[ -n "$phy" -a -d "/sys/class/ieee80211/$phy" ] || {
|
||||
echo "PHY for wifi device $1 not found"
|
||||
return 1
|
||||
}
|
||||
config_set "$device" phy "$phy"
|
||||
|
||||
config_get macaddr "$device" macaddr
|
||||
[ -z "$macaddr" ] && {
|
||||
config_set "$device" macaddr "$(cat /sys/class/ieee80211/${phy}/macaddress)"
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
check_mac80211_device() {
|
||||
config_get phy "$1" phy
|
||||
[ -z "$phy" ] && {
|
||||
find_mac80211_phy "$1" >/dev/null || return 0
|
||||
config_get phy "$1" phy
|
||||
}
|
||||
[ "$phy" = "$dev" ] && found=1
|
||||
}
|
||||
|
||||
|
||||
__get_band_defaults() {
|
||||
local phy="$1"
|
||||
|
||||
( iw phy "$phy" info; echo ) | awk '
|
||||
BEGIN {
|
||||
bands = ""
|
||||
}
|
||||
|
||||
($1 == "Band" || $1 == "") && band {
|
||||
if (channel) {
|
||||
mode="NOHT"
|
||||
if (ht) mode="HT20"
|
||||
if (vht && band != "1:") mode="VHT80"
|
||||
if (he) mode="HE80"
|
||||
if (he && band == "1:") mode="HE20"
|
||||
sub("\\[", "", channel)
|
||||
sub("\\]", "", channel)
|
||||
bands = bands band channel ":" mode " "
|
||||
}
|
||||
band=""
|
||||
}
|
||||
|
||||
$1 == "Band" {
|
||||
band = $2
|
||||
channel = ""
|
||||
vht = ""
|
||||
ht = ""
|
||||
he = ""
|
||||
}
|
||||
|
||||
$0 ~ "Capabilities:" {
|
||||
ht=1
|
||||
}
|
||||
|
||||
$0 ~ "VHT Capabilities" {
|
||||
vht=1
|
||||
}
|
||||
|
||||
$0 ~ "HE Iftypes" {
|
||||
he=1
|
||||
}
|
||||
|
||||
$1 == "*" && $3 == "MHz" && $0 !~ /disabled/ && band && !channel {
|
||||
channel = $4
|
||||
}
|
||||
|
||||
END {
|
||||
print bands
|
||||
}'
|
||||
}
|
||||
|
||||
get_band_defaults() {
|
||||
local phy="$1"
|
||||
|
||||
for c in $(__get_band_defaults "$phy"); do
|
||||
local band="${c%%:*}"
|
||||
c="${c#*:}"
|
||||
local chan="${c%%:*}"
|
||||
c="${c#*:}"
|
||||
local mode="${c%%:*}"
|
||||
|
||||
case "$band" in
|
||||
1) band=2g;;
|
||||
2) band=5g;;
|
||||
3) band=60g;;
|
||||
4) band=6g;;
|
||||
*) band="";;
|
||||
esac
|
||||
|
||||
[ -n "$band" ] || continue
|
||||
[ -n "$mode_band" -a "$band" = "6g" ] && return
|
||||
|
||||
mode_band="$band"
|
||||
channel="$chan"
|
||||
htmode="$mode"
|
||||
done
|
||||
}
|
||||
|
||||
detect_mac80211() {
|
||||
devidx=0
|
||||
config_load wireless
|
||||
while :; do
|
||||
config_get type "radio$devidx" type
|
||||
[ -n "$type" ] || break
|
||||
devidx=$(($devidx + 1))
|
||||
done
|
||||
|
||||
for _dev in /sys/class/ieee80211/*; do
|
||||
[ -e "$_dev" ] || continue
|
||||
|
||||
dev="${_dev##*/}"
|
||||
|
||||
found=0
|
||||
config_foreach check_mac80211_device wifi-device
|
||||
[ "$found" -gt 0 ] && continue
|
||||
|
||||
mode_band=""
|
||||
channel=""
|
||||
htmode=""
|
||||
ht_capab=""
|
||||
|
||||
get_band_defaults "$dev"
|
||||
|
||||
path="$(iwinfo nl80211 path "$dev")"
|
||||
if [ -n "$path" ]; then
|
||||
dev_id="set wireless.radio${devidx}.path='$path'"
|
||||
else
|
||||
dev_id="set wireless.radio${devidx}.macaddr=$(cat /sys/class/ieee80211/${dev}/macaddress)"
|
||||
fi
|
||||
|
||||
uci -q batch <<-EOF
|
||||
set wireless.radio${devidx}=wifi-device
|
||||
set wireless.radio${devidx}.type=mac80211
|
||||
${dev_id}
|
||||
set wireless.radio${devidx}.channel=${channel}
|
||||
set wireless.radio${devidx}.band=${mode_band}
|
||||
set wireless.radio${devidx}.htmode=$htmode
|
||||
set wireless.radio${devidx}.disabled=1
|
||||
|
||||
set wireless.default_radio${devidx}=wifi-iface
|
||||
set wireless.default_radio${devidx}.device=radio${devidx}
|
||||
set wireless.default_radio${devidx}.network=lan
|
||||
set wireless.default_radio${devidx}.mode=ap
|
||||
set wireless.default_radio${devidx}.ssid=OpenWrt
|
||||
set wireless.default_radio${devidx}.encryption=none
|
||||
EOF
|
||||
uci -q commit wireless
|
||||
|
||||
devidx=$(($devidx + 1))
|
||||
done
|
||||
}
|
||||
5
feeds/wifi-ath10k/mac80211/files/mac80211.hotplug
Normal file
5
feeds/wifi-ath10k/mac80211/files/mac80211.hotplug
Normal file
@@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
[ "${ACTION}" = "add" ] && {
|
||||
/sbin/wifi config
|
||||
}
|
||||
200
feeds/wifi-ath10k/mac80211/intel.mk
Normal file
200
feeds/wifi-ath10k/mac80211/intel.mk
Normal file
@@ -0,0 +1,200 @@
|
||||
PKG_DRIVERS += \
|
||||
iwl-legacy iwl3945 iwl4965 iwlwifi \
|
||||
libipw ipw2100 ipw2200 \
|
||||
|
||||
config-$(call config_package,iwl-legacy) += IWLEGACY
|
||||
config-$(call config_package,iwl3945) += IWL3945
|
||||
config-$(call config_package,iwl4965) += IWL4965
|
||||
config-$(call config_package,iwlwifi) += IWLWIFI IWLDVM IWLMVM
|
||||
config-$(CONFIG_PACKAGE_IWLWIFI_DEBUG)+= IWLWIFI_DEBUG
|
||||
config-$(CONFIG_PACKAGE_IWLWIFI_DEBUGFS)+= IWLWIFI_DEBUGFS
|
||||
|
||||
config-$(call config_package,libipw) += LIBIPW
|
||||
config-$(call config_package,ipw2100) += IPW2100
|
||||
config-$(call config_package,ipw2200) += IPW2200
|
||||
|
||||
define KernelPackage/iwlwifi
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS:= +kmod-mac80211 @PCI_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT
|
||||
TITLE:=Intel AGN Wireless support
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/iwlwifi.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/dvm/iwldvm.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlwifi/mvm/iwlmvm.ko
|
||||
AUTOLOAD:=$(call AutoProbe,iwlwifi iwldvm iwlmvm)
|
||||
MENU:=1
|
||||
endef
|
||||
|
||||
define KernelPackage/iwlwifi/description
|
||||
iwlwifi kernel module for
|
||||
Intel Wireless WiFi Link 6250AGN Adapter
|
||||
Intel 6000 Series Wi-Fi Adapters (6200AGN and 6300AGN)
|
||||
Intel WiFi Link 1000BGN
|
||||
Intel Wireless WiFi 5150AGN
|
||||
Intel Wireless WiFi 5100AGN, 5300AGN, and 5350AGN
|
||||
Intel 6005 Series Wi-Fi Adapters
|
||||
Intel 6030 Series Wi-Fi Adapters
|
||||
Intel Wireless WiFi Link 6150BGN 2 Adapter
|
||||
Intel 100 Series Wi-Fi Adapters (100BGN and 130BGN)
|
||||
Intel 2000 Series Wi-Fi Adapters
|
||||
Intel 7260 Wi-Fi Adapter
|
||||
Intel 3160 Wi-Fi Adapter
|
||||
Intel 7265 Wi-Fi Adapter
|
||||
Intel 8260 Wi-Fi Adapter
|
||||
Intel 3165 Wi-Fi Adapter
|
||||
endef
|
||||
|
||||
define KernelPackage/iwlwifi/config
|
||||
if PACKAGE_kmod-iwlwifi
|
||||
|
||||
config PACKAGE_IWLWIFI_DEBUG
|
||||
bool "Enable full debugging output in the iwlwifi driver"
|
||||
default n
|
||||
help
|
||||
This option will enable debug tracing output for the iwlwifi drivers
|
||||
|
||||
This will result in the kernel module being ~100k larger. You can
|
||||
control which debug output is sent to the kernel log by setting the
|
||||
value in
|
||||
|
||||
/sys/module/iwlwifi/parameters/debug
|
||||
|
||||
This entry will only exist if this option is enabled.
|
||||
|
||||
To set a value, simply echo an 8-byte hex value to the same file:
|
||||
|
||||
% echo 0x43fff > /sys/module/iwlwifi/parameters/debug
|
||||
|
||||
You can find the list of debug mask values in:
|
||||
drivers/net/wireless/intel/iwlwifi/iwl-debug.h
|
||||
|
||||
If this is your first time using this driver, you should say Y here
|
||||
as the debug information can assist others in helping you resolve
|
||||
any problems you may encounter.
|
||||
|
||||
config PACKAGE_IWLWIFI_DEBUGFS
|
||||
bool "iwlwifi debugfs support"
|
||||
depends on PACKAGE_MAC80211_DEBUGFS
|
||||
default n
|
||||
help
|
||||
Enable creation of debugfs files for the iwlwifi drivers. This
|
||||
is a low-impact option that allows getting insight into the
|
||||
driver's state at runtime.
|
||||
|
||||
endif
|
||||
endef
|
||||
|
||||
define KernelPackage/iwl-legacy
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS:= +kmod-mac80211 @PCI_SUPPORT
|
||||
TITLE:=Intel legacy Wireless support
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlegacy/iwlegacy.ko
|
||||
AUTOLOAD:=$(call AutoProbe,iwlegacy)
|
||||
endef
|
||||
|
||||
define KernelPackage/iwl-legacy/description
|
||||
iwl-legacy kernel module for legacy Intel wireless support
|
||||
endef
|
||||
|
||||
define KernelPackage/iwl3945
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +iwl3945-firmware
|
||||
TITLE:=Intel iwl3945 Wireless support
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlegacy/iwl3945.ko
|
||||
AUTOLOAD:=$(call AutoProbe,iwl3945)
|
||||
endef
|
||||
|
||||
define KernelPackage/iwl3945/description
|
||||
iwl3945 kernel module for Intel 3945 support
|
||||
endef
|
||||
|
||||
define KernelPackage/iwl4965
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS:= +kmod-mac80211 +kmod-iwl-legacy +@DRIVER_11N_SUPPORT +iwl4965-firmware
|
||||
TITLE:=Intel iwl4965 Wireless support
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/iwlegacy/iwl4965.ko
|
||||
AUTOLOAD:=$(call AutoProbe,iwl4965)
|
||||
endef
|
||||
|
||||
define KernelPackage/iwl4965/description
|
||||
iwl4965 kernel module for Intel 4965 support
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/libipw
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=libipw for ipw2100 and ipw2200
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-crypto-michael-mic +kmod-crypto-ecb +kmod-lib80211 +kmod-cfg80211 +@DRIVER_WEXT_SUPPORT @!BIG_ENDIAN
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/libipw.ko
|
||||
AUTOLOAD:=$(call AutoProbe,libipw)
|
||||
endef
|
||||
|
||||
define KernelPackage/libipw/description
|
||||
Hardware independent IEEE 802.11 networking stack for ipw2100 and ipw2200.
|
||||
endef
|
||||
|
||||
IPW2100_NAME:=ipw2100-fw
|
||||
IPW2100_VERSION:=1.3
|
||||
|
||||
define Download/ipw2100
|
||||
URL:= \
|
||||
https://src.fedoraproject.org/repo/pkgs/ipw2100-firmware/ipw2100-fw-1.3.tgz/46aa75bcda1a00efa841f9707bbbd113/ \
|
||||
https://archlinux.mirror.pkern.at/other/packages/ipw2100-fw/ \
|
||||
http://mirror.ox.ac.uk/sites/ftp.openbsd.org/pub/OpenBSD/distfiles/firmware/ \
|
||||
http://firmware.openbsd.org/firmware-dist/
|
||||
FILE:=$(IPW2100_NAME)-$(IPW2100_VERSION).tgz
|
||||
HASH:=e1107c455e48d324a616b47a622593bc8413dcce72026f72731c0b03dae3a7a2
|
||||
endef
|
||||
$(eval $(call Download,ipw2100))
|
||||
|
||||
define KernelPackage/ipw2100
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Intel IPW2100 driver
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-libipw
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/ipw2100.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ipw2100)
|
||||
endef
|
||||
|
||||
define KernelPackage/ipw2100/description
|
||||
Kernel support for Intel IPW2100
|
||||
Includes:
|
||||
- ipw2100
|
||||
endef
|
||||
|
||||
IPW2200_NAME:=ipw2200-fw
|
||||
IPW2200_VERSION:=3.1
|
||||
|
||||
define Download/ipw2200
|
||||
URL:= \
|
||||
https://src.fedoraproject.org/repo/pkgs/ipw2200-firmware/ipw2200-fw-3.1.tgz/eaba788643c7cc7483dd67ace70f6e99/ \
|
||||
https://archlinux.mirror.pkern.at/other/packages/ipw2200-fw/ \
|
||||
http://mirror.ox.ac.uk/sites/ftp.openbsd.org/pub/OpenBSD/distfiles/firmware/ \
|
||||
http://firmware.openbsd.org/firmware-dist/
|
||||
FILE:=$(IPW2200_NAME)-$(IPW2200_VERSION).tgz
|
||||
HASH:=c6818c11c18cc030d55ff83f64b2bad8feef485e7742f84f94a61d811a6258bd
|
||||
endef
|
||||
$(eval $(call Download,ipw2200))
|
||||
|
||||
define KernelPackage/ipw2200
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Intel IPW2200 driver
|
||||
DEPENDS:=@PCI_SUPPORT +kmod-libipw
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/intel/ipw2x00/ipw2200.ko
|
||||
AUTOLOAD:=$(call AutoProbe,ipw2200)
|
||||
endef
|
||||
|
||||
define KernelPackage/ipw2200/description
|
||||
Kernel support for Intel IPW2200
|
||||
Includes:
|
||||
- ipw2200
|
||||
endef
|
||||
|
||||
define KernelPackage/ipw2100/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/ipw2100-$(IPW2100_VERSION)*.fw $(1)/lib/firmware
|
||||
endef
|
||||
|
||||
define KernelPackage/ipw2200/install
|
||||
$(INSTALL_DIR) $(1)/lib/firmware
|
||||
$(INSTALL_DATA) $(PKG_BUILD_DIR)/$(IPW2200_NAME)-$(IPW2200_VERSION)/ipw2200*.fw $(1)/lib/firmware
|
||||
endef
|
||||
90
feeds/wifi-ath10k/mac80211/marvell.mk
Normal file
90
feeds/wifi-ath10k/mac80211/marvell.mk
Normal file
@@ -0,0 +1,90 @@
|
||||
PKG_DRIVERS += \
|
||||
libertas-sdio libertas-usb libertas-spi \
|
||||
mwl8k mwifiex-pcie mwifiex-sdio
|
||||
|
||||
config-$(call config_package,libertas-sdio) += LIBERTAS LIBERTAS_SDIO
|
||||
config-$(call config_package,libertas-usb) += LIBERTAS LIBERTAS_USB
|
||||
config-$(call config_package,libertas-spi) += LIBERTAS LIBERTAS_SPI
|
||||
config-$(call config_package,mwl8k) += MWL8K
|
||||
config-$(call config_package,mwifiex-pcie) += MWIFIEX MWIFIEX_PCIE
|
||||
config-$(call config_package,mwifiex-sdio) += MWIFIEX MWIFIEX_SDIO
|
||||
|
||||
define KernelPackage/libertas-usb
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS+= @USB_SUPPORT +kmod-cfg80211 +kmod-usb-core +kmod-lib80211 +@DRIVER_WEXT_SUPPORT +libertas-usb-firmware
|
||||
TITLE:=Marvell 88W8015 Wireless Driver
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/usb8xxx.ko
|
||||
AUTOLOAD:=$(call AutoProbe,libertas usb8xxx)
|
||||
endef
|
||||
|
||||
define KernelPackage/libertas-sdio
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +kmod-mmc +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-sdio-firmware
|
||||
TITLE:=Marvell 88W8686 Wireless Driver
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas_sdio.ko
|
||||
AUTOLOAD:=$(call AutoProbe,libertas libertas_sdio)
|
||||
endef
|
||||
|
||||
define KernelPackage/libertas-spi
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
SUBMENU:=Wireless Drivers
|
||||
DEPENDS+= +kmod-cfg80211 +kmod-lib80211 +@DRIVER_WEXT_SUPPORT @!TARGET_uml +libertas-spi-firmware
|
||||
KCONFIG := \
|
||||
CONFIG_SPI=y \
|
||||
CONFIG_SPI_MASTER=y
|
||||
TITLE:=Marvell 88W8686 SPI Wireless Driver
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/libertas/libertas_spi.ko
|
||||
AUTOLOAD:=$(call AutoProbe,libertas libertas_spi)
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/mwl8k
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwl8k
|
||||
DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +mwl8k-firmware
|
||||
FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwl8k.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mwl8k)
|
||||
endef
|
||||
|
||||
define KernelPackage/mwl8k/description
|
||||
Kernel modules for Marvell TOPDOG 802.11 Wireless cards
|
||||
endef
|
||||
|
||||
|
||||
define KernelPackage/mwifiex-pcie
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Marvell 802.11n/802.11ac PCIe Wireless cards
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwifiex
|
||||
DEPENDS+= @PCI_SUPPORT +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +mwifiex-pcie-firmware
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_pcie.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mwifiex_pcie)
|
||||
endef
|
||||
|
||||
define KernelPackage/mwifiex-pcie/description
|
||||
Kernel modules for Marvell 802.11n/802.11ac PCIe Wireless cards
|
||||
endef
|
||||
|
||||
define KernelPackage/mwifiex-sdio
|
||||
$(call KernelPackage/mac80211/Default)
|
||||
TITLE:=Driver for Marvell 802.11n/802.11ac SDIO Wireless cards
|
||||
URL:=https://wireless.wiki.kernel.org/en/users/drivers/mwifiex
|
||||
DEPENDS+= +kmod-mmc +kmod-mac80211 +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +mwifiex-sdio-firmware
|
||||
FILES:= \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex.ko \
|
||||
$(PKG_BUILD_DIR)/drivers/net/wireless/marvell/mwifiex/mwifiex_sdio.ko
|
||||
AUTOLOAD:=$(call AutoProbe,mwifiex_sdio)
|
||||
endef
|
||||
|
||||
define KernelPackage/mwifiex-sdio/description
|
||||
Kernel modules for Marvell 802.11n/802.11ac SDIO Wireless cards
|
||||
endef
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--- a/drivers/net/wireless/ath/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/Kconfig
|
||||
@@ -1,6 +1,6 @@
|
||||
# SPDX-License-Identifier: ISC
|
||||
config ATH_COMMON
|
||||
- tristate
|
||||
+ tristate "ath.ko"
|
||||
depends on m
|
||||
|
||||
config WLAN_VENDOR_ATH
|
||||
@@ -0,0 +1,47 @@
|
||||
--- a/drivers/net/wireless/ath/ath10k/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
|
||||
@@ -86,6 +86,12 @@ config ATH10K_TRACING
|
||||
help
|
||||
Select this to ath10k use tracing infrastructure.
|
||||
|
||||
+config ATH10K_THERMAL
|
||||
+ bool "Atheros ath10k thermal monitoring support"
|
||||
+ depends on THERMAL
|
||||
+ ---help---
|
||||
+ Select this to ath10k use hwmon for thermal measurement.
|
||||
+
|
||||
config ATH10K_DFS_CERTIFIED
|
||||
bool "Atheros DFS support for certified platforms"
|
||||
depends on ATH10K && CFG80211_CERTIFICATION_ONUS
|
||||
--- a/drivers/net/wireless/ath/ath10k/Makefile
|
||||
+++ b/drivers/net/wireless/ath/ath10k/Makefile
|
||||
@@ -18,7 +18,7 @@ ath10k_core-y += mac.o \
|
||||
ath10k_core-$(CPTCFG_ATH10K_SPECTRAL) += spectral.o
|
||||
ath10k_core-$(CPTCFG_NL80211_TESTMODE) += testmode.o
|
||||
ath10k_core-$(CPTCFG_ATH10K_TRACING) += trace.o
|
||||
-ath10k_core-$(CONFIG_THERMAL) += thermal.o
|
||||
+ath10k_core-$(CPTCFG_ATH10K_THERMAL) += thermal.o
|
||||
ath10k_core-$(CPTCFG_MAC80211_DEBUGFS) += debugfs_sta.o
|
||||
ath10k_core-$(CONFIG_PM) += wow.o
|
||||
ath10k_core-$(CONFIG_DEV_COREDUMP) += coredump.o
|
||||
--- a/drivers/net/wireless/ath/ath10k/thermal.h
|
||||
+++ b/drivers/net/wireless/ath/ath10k/thermal.h
|
||||
@@ -25,7 +25,7 @@ struct ath10k_thermal {
|
||||
int temperature;
|
||||
};
|
||||
|
||||
-#if IS_REACHABLE(CONFIG_THERMAL)
|
||||
+#if IS_REACHABLE(CPTCFG_ATH10K_THERMAL)
|
||||
int ath10k_thermal_register(struct ath10k *ar);
|
||||
void ath10k_thermal_unregister(struct ath10k *ar);
|
||||
void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
|
||||
--- a/local-symbols
|
||||
+++ b/local-symbols
|
||||
@@ -142,6 +142,7 @@ ATH10K_SNOC=
|
||||
ATH10K_DEBUG=
|
||||
ATH10K_DEBUGFS=
|
||||
ATH10K_SPECTRAL=
|
||||
+ATH10K_THERMAL=
|
||||
ATH10K_TRACING=
|
||||
ATH10K_DFS_CERTIFIED=
|
||||
WCN36XX=
|
||||
@@ -0,0 +1,53 @@
|
||||
From: Christian Lamparter <chunkeey@gmail.com>
|
||||
Date: Sat, 16 Nov 2019 19:25:24 +0100
|
||||
Subject: [PATCH] owl_loader: compatibility patch
|
||||
|
||||
This patch includes OpenWrt specific changes that are
|
||||
not included in the upstream owl-loader.
|
||||
|
||||
This includes a platform data handling changes for ar71xx.
|
||||
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
|
||||
@@ -103,6 +103,7 @@ static void owl_fw_cb(const struct firmw
|
||||
{
|
||||
struct pci_dev *pdev = (struct pci_dev *)context;
|
||||
struct owl_ctx *ctx = (struct owl_ctx *)pci_get_drvdata(pdev);
|
||||
+ struct ath9k_platform_data *pdata = dev_get_platdata(&pdev->dev);
|
||||
struct pci_bus *bus;
|
||||
|
||||
complete(&ctx->eeprom_load);
|
||||
@@ -118,6 +119,16 @@ static void owl_fw_cb(const struct firmw
|
||||
goto release;
|
||||
}
|
||||
|
||||
+ if (pdata) {
|
||||
+ memcpy(pdata->eeprom_data, fw->data, fw->size);
|
||||
+
|
||||
+ /*
|
||||
+ * eeprom has been successfully loaded - pass the data to ath9k
|
||||
+ * but remove the eeprom_name, so it doesn't try to load it too.
|
||||
+ */
|
||||
+ pdata->eeprom_name = NULL;
|
||||
+ }
|
||||
+
|
||||
if (ath9k_pci_fixup(pdev, (const u16 *)fw->data, fw->size))
|
||||
goto release;
|
||||
|
||||
@@ -137,8 +148,14 @@ release:
|
||||
static const char *owl_get_eeprom_name(struct pci_dev *pdev)
|
||||
{
|
||||
struct device *dev = &pdev->dev;
|
||||
+ struct ath9k_platform_data *pdata;
|
||||
char *eeprom_name;
|
||||
|
||||
+ /* try the existing platform data first */
|
||||
+ pdata = dev_get_platdata(dev);
|
||||
+ if (pdata && pdata->eeprom_name)
|
||||
+ return pdata->eeprom_name;
|
||||
+
|
||||
dev_dbg(dev, "using auto-generated eeprom filename\n");
|
||||
|
||||
eeprom_name = devm_kzalloc(dev, EEPROM_FILENAME_LEN, GFP_KERNEL);
|
||||
@@ -0,0 +1,38 @@
|
||||
--- a/drivers/net/wireless/ath/ath5k/initvals.c
|
||||
+++ b/drivers/net/wireless/ath/ath5k/initvals.c
|
||||
@@ -62,8 +62,14 @@ static const struct ath5k_ini ar5210_ini
|
||||
{ AR5K_IMR, 0 },
|
||||
{ AR5K_IER, AR5K_IER_DISABLE },
|
||||
{ AR5K_BSR, 0, AR5K_INI_READ },
|
||||
+#if !defined(CONFIG_ATHEROS_AR71XX) && !defined(CONFIG_ATH79)
|
||||
{ AR5K_TXCFG, AR5K_DMASIZE_128B },
|
||||
{ AR5K_RXCFG, AR5K_DMASIZE_128B },
|
||||
+#else
|
||||
+ /* WAR for AR71xx PCI bug */
|
||||
+ { AR5K_TXCFG, AR5K_DMASIZE_128B },
|
||||
+ { AR5K_RXCFG, AR5K_DMASIZE_4B },
|
||||
+#endif
|
||||
{ AR5K_CFG, AR5K_INIT_CFG },
|
||||
{ AR5K_TOPS, 8 },
|
||||
{ AR5K_RXNOFRM, 8 },
|
||||
--- a/drivers/net/wireless/ath/ath5k/dma.c
|
||||
+++ b/drivers/net/wireless/ath/ath5k/dma.c
|
||||
@@ -869,10 +869,18 @@ ath5k_hw_dma_init(struct ath5k_hw *ah)
|
||||
* guess we can tweak it and see how it goes ;-)
|
||||
*/
|
||||
if (ah->ah_version != AR5K_AR5210) {
|
||||
+#if !defined(CONFIG_ATHEROS_AR71XX) && !defined(CONFIG_ATH79)
|
||||
AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG,
|
||||
AR5K_TXCFG_SDMAMR, AR5K_DMASIZE_128B);
|
||||
AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG,
|
||||
AR5K_RXCFG_SDMAMW, AR5K_DMASIZE_128B);
|
||||
+#else
|
||||
+ /* WAR for AR71xx PCI bug */
|
||||
+ AR5K_REG_WRITE_BITS(ah, AR5K_TXCFG,
|
||||
+ AR5K_TXCFG_SDMAMR, AR5K_DMASIZE_128B);
|
||||
+ AR5K_REG_WRITE_BITS(ah, AR5K_RXCFG,
|
||||
+ AR5K_RXCFG_SDMAMW, AR5K_DMASIZE_4B);
|
||||
+#endif
|
||||
}
|
||||
|
||||
/* Pre-enable interrupts on 5211/5212*/
|
||||
@@ -0,0 +1,25 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 9 Jul 2016 15:25:24 +0200
|
||||
Subject: [PATCH] ath9k_hw: reset AHB-WMAC interface on AR91xx
|
||||
|
||||
Should fix a few stability issues
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1435,8 +1435,12 @@ static bool ath9k_hw_set_reset(struct at
|
||||
if (!AR_SREV_9100(ah))
|
||||
REG_WRITE(ah, AR_RC, 0);
|
||||
|
||||
- if (AR_SREV_9100(ah))
|
||||
+ if (AR_SREV_9100(ah)) {
|
||||
+ /* Reset the AHB-WMAC interface */
|
||||
+ if (ah->external_reset)
|
||||
+ ah->external_reset();
|
||||
udelay(50);
|
||||
+ }
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 9 Jul 2016 15:26:44 +0200
|
||||
Subject: [PATCH] ath9k_hw: issue external reset for QCA955x
|
||||
|
||||
The RTC interface on the SoC needs to be reset along with the rest of
|
||||
the WMAC.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -1312,39 +1312,56 @@ void ath9k_hw_get_delta_slope_vals(struc
|
||||
*coef_exponent = coef_exp - 16;
|
||||
}
|
||||
|
||||
-/* AR9330 WAR:
|
||||
- * call external reset function to reset WMAC if:
|
||||
- * - doing a cold reset
|
||||
- * - we have pending frames in the TX queues.
|
||||
- */
|
||||
-static bool ath9k_hw_ar9330_reset_war(struct ath_hw *ah, int type)
|
||||
+static bool ath9k_hw_need_external_reset(struct ath_hw *ah, int type)
|
||||
{
|
||||
- int i, npend = 0;
|
||||
+ int i;
|
||||
|
||||
- for (i = 0; i < AR_NUM_QCU; i++) {
|
||||
- npend = ath9k_hw_numtxpending(ah, i);
|
||||
- if (npend)
|
||||
- break;
|
||||
- }
|
||||
-
|
||||
- if (ah->external_reset &&
|
||||
- (npend || type == ATH9K_RESET_COLD)) {
|
||||
- int reset_err = 0;
|
||||
-
|
||||
- ath_dbg(ath9k_hw_common(ah), RESET,
|
||||
- "reset MAC via external reset\n");
|
||||
-
|
||||
- reset_err = ah->external_reset();
|
||||
- if (reset_err) {
|
||||
- ath_err(ath9k_hw_common(ah),
|
||||
- "External reset failed, err=%d\n",
|
||||
- reset_err);
|
||||
- return false;
|
||||
+ if (type == ATH9K_RESET_COLD)
|
||||
+ return true;
|
||||
+
|
||||
+ if (AR_SREV_9550(ah))
|
||||
+ return true;
|
||||
+
|
||||
+ /* AR9330 WAR:
|
||||
+ * call external reset function to reset WMAC if:
|
||||
+ * - doing a cold reset
|
||||
+ * - we have pending frames in the TX queues.
|
||||
+ */
|
||||
+ if (AR_SREV_9330(ah)) {
|
||||
+ for (i = 0; i < AR_NUM_QCU; i++) {
|
||||
+ if (ath9k_hw_numtxpending(ah, i))
|
||||
+ return true;
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+}
|
||||
+
|
||||
+static bool ath9k_hw_external_reset(struct ath_hw *ah, int type)
|
||||
+{
|
||||
+ int err;
|
||||
+
|
||||
+ if (!ah->external_reset || !ath9k_hw_need_external_reset(ah, type))
|
||||
+ return true;
|
||||
+
|
||||
+ ath_dbg(ath9k_hw_common(ah), RESET,
|
||||
+ "reset MAC via external reset\n");
|
||||
|
||||
- REG_WRITE(ah, AR_RTC_RESET, 1);
|
||||
+ err = ah->external_reset();
|
||||
+ if (err) {
|
||||
+ ath_err(ath9k_hw_common(ah),
|
||||
+ "External reset failed, err=%d\n", err);
|
||||
+ return false;
|
||||
}
|
||||
|
||||
+ if (AR_SREV_9550(ah)) {
|
||||
+ REG_WRITE(ah, AR_RTC_RESET, 0);
|
||||
+ udelay(10);
|
||||
+ }
|
||||
+
|
||||
+ REG_WRITE(ah, AR_RTC_RESET, 1);
|
||||
+ udelay(10);
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1397,24 +1414,24 @@ static bool ath9k_hw_set_reset(struct at
|
||||
rst_flags |= AR_RTC_RC_MAC_COLD;
|
||||
}
|
||||
|
||||
- if (AR_SREV_9330(ah)) {
|
||||
- if (!ath9k_hw_ar9330_reset_war(ah, type))
|
||||
- return false;
|
||||
- }
|
||||
-
|
||||
if (ath9k_hw_mci_is_enabled(ah))
|
||||
ar9003_mci_check_gpm_offset(ah);
|
||||
|
||||
/* DMA HALT added to resolve ar9300 and ar9580 bus error during
|
||||
- * RTC_RC reg read
|
||||
+ * RTC_RC reg read. Also needed for AR9550 external reset
|
||||
*/
|
||||
- if (AR_SREV_9300(ah) || AR_SREV_9580(ah)) {
|
||||
+ if (AR_SREV_9300(ah) || AR_SREV_9580(ah) || AR_SREV_9550(ah)) {
|
||||
REG_SET_BIT(ah, AR_CFG, AR_CFG_HALT_REQ);
|
||||
ath9k_hw_wait(ah, AR_CFG, AR_CFG_HALT_ACK, AR_CFG_HALT_ACK,
|
||||
20 * AH_WAIT_TIMEOUT);
|
||||
- REG_CLR_BIT(ah, AR_CFG, AR_CFG_HALT_REQ);
|
||||
}
|
||||
|
||||
+ if (!AR_SREV_9100(ah))
|
||||
+ ath9k_hw_external_reset(ah, type);
|
||||
+
|
||||
+ if (AR_SREV_9300(ah) || AR_SREV_9580(ah))
|
||||
+ REG_CLR_BIT(ah, AR_CFG, AR_CFG_HALT_REQ);
|
||||
+
|
||||
REG_WRITE(ah, AR_RTC_RC, rst_flags);
|
||||
|
||||
REGWRITE_BUFFER_FLUSH(ah);
|
||||
@@ -0,0 +1,35 @@
|
||||
From: Felix Fietkau <nbd@openwrt.org>
|
||||
Date: Sun, 7 Jun 2015 13:53:35 +0200
|
||||
Subject: [PATCH] ath9k: force rx_clear when disabling rx
|
||||
|
||||
This makes stopping Rx more reliable and should reduce the frequency of
|
||||
Rx related DMA stop warnings. Don't use rx_clear in TX99 mode.
|
||||
|
||||
Cc: stable@vger.kernel.org
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/mac.c
|
||||
@@ -678,13 +678,18 @@ void ath9k_hw_startpcureceive(struct ath
|
||||
|
||||
ath9k_ani_reset(ah, is_scanning);
|
||||
|
||||
- REG_CLR_BIT(ah, AR_DIAG_SW, (AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT));
|
||||
+ REG_CLR_BIT(ah, AR_DIAG_SW,
|
||||
+ AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT | AR_DIAG_FORCE_RX_CLEAR);
|
||||
}
|
||||
EXPORT_SYMBOL(ath9k_hw_startpcureceive);
|
||||
|
||||
void ath9k_hw_abortpcurecv(struct ath_hw *ah)
|
||||
{
|
||||
- REG_SET_BIT(ah, AR_DIAG_SW, AR_DIAG_RX_ABORT | AR_DIAG_RX_DIS);
|
||||
+ u32 reg = AR_DIAG_RX_DIS | AR_DIAG_RX_ABORT;
|
||||
+
|
||||
+ if (!IS_ENABLED(CPTCFG_ATH9K_TX99))
|
||||
+ reg |= AR_DIAG_FORCE_RX_CLEAR;
|
||||
+ REG_SET_BIT(ah, AR_DIAG_SW, reg);
|
||||
|
||||
ath9k_hw_disable_mib_counters(ah);
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 14 May 2016 14:51:02 +0200
|
||||
Subject: [PATCH] Revert "ath9k: interpret requested txpower in EIRP
|
||||
domain"
|
||||
|
||||
This reverts commit 71f5137bf010c6faffab50c0ec15374c59c4a411.
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -2977,7 +2977,8 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
{
|
||||
struct ath_regulatory *reg = ath9k_hw_regulatory(ah);
|
||||
struct ieee80211_channel *channel;
|
||||
- int chan_pwr, new_pwr;
|
||||
+ int chan_pwr, new_pwr, max_gain;
|
||||
+ int ant_gain, ant_reduction = 0;
|
||||
u16 ctl = NO_CTL;
|
||||
|
||||
if (!chan)
|
||||
@@ -2989,9 +2990,14 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
channel = chan->chan;
|
||||
chan_pwr = min_t(int, channel->max_power * 2, MAX_COMBINED_POWER);
|
||||
new_pwr = min_t(int, chan_pwr, reg->power_limit);
|
||||
+ max_gain = chan_pwr - new_pwr + channel->max_antenna_gain * 2;
|
||||
+
|
||||
+ ant_gain = get_antenna_gain(ah, chan);
|
||||
+ if (ant_gain > max_gain)
|
||||
+ ant_reduction = ant_gain - max_gain;
|
||||
|
||||
ah->eep_ops->set_txpower(ah, chan, ctl,
|
||||
- get_antenna_gain(ah, chan), new_pwr, test);
|
||||
+ ant_reduction, new_pwr, test);
|
||||
}
|
||||
|
||||
void ath9k_hw_set_txpowerlimit(struct ath_hw *ah, u32 limit, bool test)
|
||||
@@ -0,0 +1,24 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Wed, 19 Jul 2017 08:49:31 +0200
|
||||
Subject: [PATCH] ath9k: adjust tx power reduction for US regulatory
|
||||
domain
|
||||
|
||||
FCC regulatory rules allow for up to 6 dBi antenna gain. Account for
|
||||
this in the EEPROM based tx power reduction code.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/hw.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hw.c
|
||||
@@ -2996,6 +2996,10 @@ void ath9k_hw_apply_txpower(struct ath_h
|
||||
if (ant_gain > max_gain)
|
||||
ant_reduction = ant_gain - max_gain;
|
||||
|
||||
+ /* FCC allows maximum antenna gain of 6 dBi */
|
||||
+ if (reg->region == NL80211_DFS_FCC)
|
||||
+ ant_reduction = max_t(int, ant_reduction - 12, 0);
|
||||
+
|
||||
ah->eep_ops->set_txpower(ah, chan, ctl,
|
||||
ant_reduction, new_pwr, test);
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
--- a/drivers/net/wireless/ath/Makefile
|
||||
+++ b/drivers/net/wireless/ath/Makefile
|
||||
@@ -15,10 +15,10 @@ ath-objs := main.o \
|
||||
regd.o \
|
||||
hw.o \
|
||||
key.o \
|
||||
+ debug.o \
|
||||
dfs_pattern_detector.o \
|
||||
dfs_pri_detector.o
|
||||
|
||||
-ath-$(CPTCFG_ATH_DEBUG) += debug.o
|
||||
ath-$(CPTCFG_ATH_TRACEPOINTS) += trace.o
|
||||
|
||||
CFLAGS_trace.o := -I$(src)
|
||||
--- a/drivers/net/wireless/ath/ath.h
|
||||
+++ b/drivers/net/wireless/ath/ath.h
|
||||
@@ -316,14 +316,7 @@ void _ath_dbg(struct ath_common *common,
|
||||
#endif /* CPTCFG_ATH_DEBUG */
|
||||
|
||||
/** Returns string describing opmode, or NULL if unknown mode. */
|
||||
-#ifdef CPTCFG_ATH_DEBUG
|
||||
const char *ath_opmode_to_string(enum nl80211_iftype opmode);
|
||||
-#else
|
||||
-static inline const char *ath_opmode_to_string(enum nl80211_iftype opmode)
|
||||
-{
|
||||
- return "UNKNOWN";
|
||||
-}
|
||||
-#endif
|
||||
|
||||
extern const char *ath_bus_type_strings[];
|
||||
static inline const char *ath_bus_type_to_string(enum ath_bus_type bustype)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user