From 9fa925362f285614e90c2d7a286efd9d3d41db45 Mon Sep 17 00:00:00 2001 From: Alexey Dobrovolsky Date: Sun, 6 Jun 2021 02:25:02 +0300 Subject: [PATCH 01/19] busybox: sysntpd: add trigger to reload server sysntpd server becomes unavailable if the index of the bound interface changes. So let's add an interface trigger to reload sysntpd. This patch also adds the ability for the sysntpd script to handle uci interface name from configuration. Fixes: 4da60500ebd2 ("busybox: sysntpd: option to bind server to iface") Signed-off-by: Alexey Dobrovolsky Reviewed-by: Philip Prindeville (cherry picked from commit 88114f617ae7bffe13d19d7b9575659a3d3cd9b6) --- package/utils/busybox/files/sysntpd | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/package/utils/busybox/files/sysntpd b/package/utils/busybox/files/sysntpd index c4c311c242..074f14b8f8 100755 --- a/package/utils/busybox/files/sysntpd +++ b/package/utils/busybox/files/sysntpd @@ -56,7 +56,14 @@ start_ntpd_instance() { procd_set_param command "$PROG" -n -N if [ "$enable_server" = "1" ]; then procd_append_param command -l - [ -n "$interface" ] && procd_append_param command -I $interface + [ -n "$interface" ] && { + local ifname + + network_get_device ifname "$interface" || \ + ifname="$interface" + procd_append_param command -I "$ifname" + procd_append_param netdev "$ifname" + } fi [ -x "$HOTPLUG_SCRIPT" ] && procd_append_param command -S "$HOTPLUG_SCRIPT" for peer in $server; do @@ -79,11 +86,12 @@ start_ntpd_instance() { } start_service() { + . /lib/functions/network.sh validate_ntp_section ntp start_ntpd_instance } service_triggers() { - local script name use_dhcp + local script name use_dhcp enable_server interface script=$(readlink -f "$initscript") name=$(basename ${script:-$initscript}) @@ -106,5 +114,17 @@ service_triggers() { fi } + config_get_bool enable_server ntp enable_server 0 + config_get interface ntp interface + + [ $enable_server -eq 1 ] && [ -n "$interface" ] && { + local ifname + + network_get_device ifname "$interface" || \ + ifname="$interface" + procd_add_interface_trigger "interface.*" "$ifname" \ + /etc/init.d/"$name" reload + } + procd_add_validation validate_ntp_section } From a078037ace500a9c0f7cf4ec4f1c3095115dc70b Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 6 Jun 2021 20:57:39 +0200 Subject: [PATCH 02/19] mac80211: improve rate control performance Call rate control handler after intermediate queueuing Includes follow-up fixes Signed-off-by: Felix Fietkau cherry-picked from commits: - 7dd8829ef915f1c5fc728be8f8360c61ddaadf1b - a603e82dd342680d584c4eb5f1b222e056379890 - 8bb4437c01ca35a5ac67e391630a1b24cb52dbb7 --- ...MPDU-session-check-from-minstrel_ht-.patch | 126 ++++++++++++++++++ ...eee80211_tx_h_rate_ctrl-when-dequeue.patch | 114 ++++++++++++++++ ...11-minstrel_ht-fix-sample-time-check.patch | 2 +- ...rting-aggregation-sessions-on-mesh-i.patch | 112 ++++++++++++++++ 4 files changed, 353 insertions(+), 1 deletion(-) create mode 100644 package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch create mode 100644 package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch create mode 100644 package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch new file mode 100644 index 0000000000..4e3242e6a9 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch @@ -0,0 +1,126 @@ +From: Felix Fietkau +Date: Thu, 17 Jun 2021 17:56:54 +0200 +Subject: [PATCH] mac80211: move A-MPDU session check from minstrel_ht to + mac80211 + +This avoids calling back into tx handlers from within the rate control module. +Preparation for deferring rate control until tx dequeue + +Signed-off-by: Felix Fietkau +--- + +--- a/include/net/mac80211.h ++++ b/include/net/mac80211.h +@@ -6160,6 +6160,11 @@ enum rate_control_capabilities { + * otherwise the NSS difference doesn't bother us. + */ + RATE_CTRL_CAPA_VHT_EXT_NSS_BW = BIT(0), ++ /** ++ * @RATE_CTRL_CAPA_AMPDU_TRIGGER: ++ * mac80211 should start A-MPDU sessions on tx ++ */ ++ RATE_CTRL_CAPA_AMPDU_TRIGGER = BIT(1), + }; + + struct rate_control_ops { +--- a/net/mac80211/rc80211_minstrel_ht.c ++++ b/net/mac80211/rc80211_minstrel_ht.c +@@ -1153,29 +1153,6 @@ minstrel_downgrade_prob_rate(struct mins + } + + static void +-minstrel_aggr_check(struct ieee80211_sta *pubsta, struct sk_buff *skb) +-{ +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; +- struct sta_info *sta = container_of(pubsta, struct sta_info, sta); +- u16 tid; +- +- if (skb_get_queue_mapping(skb) == IEEE80211_AC_VO) +- return; +- +- if (unlikely(!ieee80211_is_data_qos(hdr->frame_control))) +- return; +- +- if (unlikely(skb->protocol == cpu_to_be16(ETH_P_PAE))) +- return; +- +- tid = ieee80211_get_tid(hdr); +- if (likely(sta->ampdu_mlme.tid_tx[tid])) +- return; +- +- ieee80211_start_tx_ba_session(pubsta, tid, 0); +-} +- +-static void + minstrel_ht_tx_status(void *priv, struct ieee80211_supported_band *sband, + void *priv_sta, struct ieee80211_tx_status *st) + { +@@ -1477,10 +1454,6 @@ minstrel_ht_get_rate(void *priv, struct + struct minstrel_priv *mp = priv; + u16 sample_idx; + +- if (!(info->flags & IEEE80211_TX_CTL_AMPDU) && +- !minstrel_ht_is_legacy_group(MI_RATE_GROUP(mi->max_prob_rate))) +- minstrel_aggr_check(sta, txrc->skb); +- + info->flags |= mi->tx_flags; + + #ifdef CPTCFG_MAC80211_DEBUGFS +@@ -1894,6 +1867,7 @@ static u32 minstrel_ht_get_expected_thro + + static const struct rate_control_ops mac80211_minstrel_ht = { + .name = "minstrel_ht", ++ .capa = RATE_CTRL_CAPA_AMPDU_TRIGGER, + .tx_status_ext = minstrel_ht_tx_status, + .get_rate = minstrel_ht_get_rate, + .rate_init = minstrel_ht_rate_init, +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3933,6 +3933,29 @@ void ieee80211_txq_schedule_start(struct + } + EXPORT_SYMBOL(ieee80211_txq_schedule_start); + ++static void ++ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata, ++ struct sta_info *sta, ++ struct sk_buff *skb) ++{ ++ struct rate_control_ref *ref = sdata->local->rate_ctrl; ++ u16 tid; ++ ++ if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER)) ++ return; ++ ++ if (!sta || !sta->sta.ht_cap.ht_supported || ++ !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO || ++ skb->protocol == sdata->control_port_protocol) ++ return; ++ ++ tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; ++ if (likely(sta->ampdu_mlme.tid_tx[tid])) ++ return; ++ ++ ieee80211_start_tx_ba_session(&sta->sta, tid, 0); ++} ++ + void __ieee80211_subif_start_xmit(struct sk_buff *skb, + struct net_device *dev, + u32 info_flags, +@@ -3963,6 +3986,8 @@ void __ieee80211_subif_start_xmit(struct + skb_get_hash(skb); + } + ++ ieee80211_aggr_check(sdata, sta, skb); ++ + if (sta) { + struct ieee80211_fast_tx *fast_tx; + +@@ -4226,6 +4251,8 @@ static void ieee80211_8023_xmit(struct i + + memset(info, 0, sizeof(*info)); + ++ ieee80211_aggr_check(sdata, sta, skb); ++ + tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK; + tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]); + if (tid_tx) { diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch new file mode 100644 index 0000000000..49b1212213 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch @@ -0,0 +1,114 @@ +From: Ryder Lee +Date: Fri, 28 May 2021 14:05:41 +0800 +Subject: [PATCH] mac80211: call ieee80211_tx_h_rate_ctrl() when dequeue + +Make ieee80211_tx_h_rate_ctrl() get called on dequeue to improve +performance since it reduces the turnaround time for rate control. + +Signed-off-by: Ryder Lee +--- + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -1780,8 +1780,6 @@ static int invoke_tx_handlers_early(stru + CALL_TXH(ieee80211_tx_h_ps_buf); + CALL_TXH(ieee80211_tx_h_check_control_port_protocol); + CALL_TXH(ieee80211_tx_h_select_key); +- if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) +- CALL_TXH(ieee80211_tx_h_rate_ctrl); + + txh_done: + if (unlikely(res == TX_DROP)) { +@@ -1814,6 +1812,9 @@ static int invoke_tx_handlers_late(struc + goto txh_done; + } + ++ if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) ++ CALL_TXH(ieee80211_tx_h_rate_ctrl); ++ + CALL_TXH(ieee80211_tx_h_michael_mic_add); + CALL_TXH(ieee80211_tx_h_sequence); + CALL_TXH(ieee80211_tx_h_fragment); +@@ -3384,15 +3385,21 @@ out: + * Can be called while the sta lock is held. Anything that can cause packets to + * be generated will cause deadlock! + */ +-static void ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata, +- struct sta_info *sta, u8 pn_offs, +- struct ieee80211_key *key, +- struct sk_buff *skb) ++static ieee80211_tx_result ++ieee80211_xmit_fast_finish(struct ieee80211_sub_if_data *sdata, ++ struct sta_info *sta, u8 pn_offs, ++ struct ieee80211_key *key, ++ struct ieee80211_tx_data *tx) + { ++ struct sk_buff *skb = tx->skb; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_hdr *hdr = (void *)skb->data; + u8 tid = IEEE80211_NUM_TIDS; + ++ if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL) && ++ ieee80211_tx_h_rate_ctrl(tx) != TX_CONTINUE) ++ return TX_DROP; ++ + if (key) + info->control.hw_key = &key->conf; + +@@ -3441,6 +3448,8 @@ static void ieee80211_xmit_fast_finish(s + break; + } + } ++ ++ return TX_CONTINUE; + } + + static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, +@@ -3544,24 +3553,17 @@ static bool ieee80211_xmit_fast(struct i + tx.sta = sta; + tx.key = fast_tx->key; + +- if (!ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) { +- tx.skb = skb; +- r = ieee80211_tx_h_rate_ctrl(&tx); +- skb = tx.skb; +- tx.skb = NULL; +- +- if (r != TX_CONTINUE) { +- if (r != TX_QUEUED) +- kfree_skb(skb); +- return true; +- } +- } +- + if (ieee80211_queue_skb(local, sdata, sta, skb)) + return true; + +- ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs, +- fast_tx->key, skb); ++ tx.skb = skb; ++ r = ieee80211_xmit_fast_finish(sdata, sta, fast_tx->pn_offs, ++ fast_tx->key, &tx); ++ tx.skb = NULL; ++ if (r == TX_DROP) { ++ kfree_skb(skb); ++ return true; ++ } + + if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) + sdata = container_of(sdata->bss, +@@ -3672,8 +3674,12 @@ begin: + (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) + pn_offs = ieee80211_hdrlen(hdr->frame_control); + +- ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs, +- tx.key, skb); ++ r = ieee80211_xmit_fast_finish(sta->sdata, sta, pn_offs, ++ tx.key, &tx); ++ if (r != TX_CONTINUE) { ++ ieee80211_free_txskb(&local->hw, skb); ++ goto begin; ++ } + } else { + if (invoke_tx_handlers_late(&tx)) + goto begin; diff --git a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch index 787254b4df..d4b327c69c 100644 --- a/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch +++ b/package/kernel/mac80211/patches/subsys/377-mac80211-minstrel_ht-fix-sample-time-check.patch @@ -12,7 +12,7 @@ Signed-off-by: Felix Fietkau --- a/net/mac80211/rc80211_minstrel_ht.c +++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -1498,7 +1498,7 @@ minstrel_ht_get_rate(void *priv, struct +@@ -1466,7 +1466,7 @@ minstrel_ht_get_rate(void *priv, struct (info->control.flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO)) return; diff --git a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch new file mode 100644 index 0000000000..56eafaf847 --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch @@ -0,0 +1,112 @@ +From: Felix Fietkau +Date: Tue, 29 Jun 2021 13:25:09 +0200 +Subject: [PATCH] mac80211: fix starting aggregation sessions on mesh + interfaces + +The logic for starting aggregation sessions was recently moved from minstrel_ht +to mac80211, into the subif tx handler just after the sta lookup. +Unfortunately this didn't work for mesh interfaces, since the sta lookup is +deferred until a much later point in time on those. +Fix this by also calling the aggregation check right after the deferred sta +lookup. + +Fixes: 08a46c642001 ("mac80211: move A-MPDU session check from minstrel_ht to mac80211") +Signed-off-by: Felix Fietkau +--- + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -1159,6 +1159,29 @@ static bool ieee80211_tx_prep_agg(struct + return queued; + } + ++static void ++ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata, ++ struct sta_info *sta, ++ struct sk_buff *skb) ++{ ++ struct rate_control_ref *ref = sdata->local->rate_ctrl; ++ u16 tid; ++ ++ if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER)) ++ return; ++ ++ if (!sta || !sta->sta.ht_cap.ht_supported || ++ !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO || ++ skb->protocol == sdata->control_port_protocol) ++ return; ++ ++ tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; ++ if (likely(sta->ampdu_mlme.tid_tx[tid])) ++ return; ++ ++ ieee80211_start_tx_ba_session(&sta->sta, tid, 0); ++} ++ + /* + * initialises @tx + * pass %NULL for the station if unknown, a valid pointer if known +@@ -1172,6 +1195,7 @@ ieee80211_tx_prepare(struct ieee80211_su + struct ieee80211_local *local = sdata->local; + struct ieee80211_hdr *hdr; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ bool aggr_check = false; + int tid; + + memset(tx, 0, sizeof(*tx)); +@@ -1202,8 +1226,10 @@ ieee80211_tx_prepare(struct ieee80211_su + tx->sdata->control_port_protocol == tx->skb->protocol) { + tx->sta = sta_info_get_bss(sdata, hdr->addr1); + } +- if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) ++ if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) { + tx->sta = sta_info_get(sdata, hdr->addr1); ++ aggr_check = true; ++ } + } + + if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && +@@ -1213,8 +1239,12 @@ ieee80211_tx_prepare(struct ieee80211_su + struct tid_ampdu_tx *tid_tx; + + tid = ieee80211_get_tid(hdr); +- + tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); ++ if (!tid_tx && aggr_check) { ++ ieee80211_aggr_check(sdata, tx->sta, skb); ++ tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); ++ } ++ + if (tid_tx) { + bool queued; + +@@ -3949,29 +3979,6 @@ void ieee80211_txq_schedule_start(struct + } + EXPORT_SYMBOL(ieee80211_txq_schedule_start); + +-static void +-ieee80211_aggr_check(struct ieee80211_sub_if_data *sdata, +- struct sta_info *sta, +- struct sk_buff *skb) +-{ +- struct rate_control_ref *ref = sdata->local->rate_ctrl; +- u16 tid; +- +- if (!ref || !(ref->ops->capa & RATE_CTRL_CAPA_AMPDU_TRIGGER)) +- return; +- +- if (!sta || !sta->sta.ht_cap.ht_supported || +- !sta->sta.wme || skb_get_queue_mapping(skb) == IEEE80211_AC_VO || +- skb->protocol == sdata->control_port_protocol) +- return; +- +- tid = skb->priority & IEEE80211_QOS_CTL_TID_MASK; +- if (likely(sta->ampdu_mlme.tid_tx[tid])) +- return; +- +- ieee80211_start_tx_ba_session(&sta->sta, tid, 0); +-} +- + void __ieee80211_subif_start_xmit(struct sk_buff *skb, + struct net_device *dev, + u32 info_flags, From 4c29ff7cb8fcfd4ba26942019837656ed0258cfb Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 6 Jun 2021 20:58:33 +0200 Subject: [PATCH 03/19] mac80211: add support for 802.3 encap offload with software rate control Signed-off-by: Felix Fietkau (cherry-picked from commit f2c6d892cacb5d884bdd638bc7574c1ee98514a5) --- ...te-control-support-for-encap-offload.patch | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch diff --git a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch new file mode 100644 index 0000000000..eefeaa4a8d --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch @@ -0,0 +1,119 @@ +From: Ryder Lee +Date: Fri, 28 May 2021 14:05:43 +0800 +Subject: [PATCH] mac80211: add rate control support for encap offload + +The software rate control cannot deal with encap offload, so fix it. + +Signed-off-by: Ryder Lee +--- + +--- a/net/mac80211/ieee80211_i.h ++++ b/net/mac80211/ieee80211_i.h +@@ -2024,6 +2024,15 @@ static inline void ieee80211_tx_skb(stru + ieee80211_tx_skb_tid(sdata, skb, 7); + } + ++static inline bool ieee80211_is_tx_data(struct sk_buff *skb) ++{ ++ struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; ++ struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); ++ ++ return info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP || ++ ieee80211_is_data(hdr->frame_control); ++} ++ + u32 ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action, + struct ieee802_11_elems *elems, + u64 filter, u32 crc, u8 *transmitter_bssid, +--- a/net/mac80211/rate.c ++++ b/net/mac80211/rate.c +@@ -297,15 +297,11 @@ void ieee80211_check_rate_mask(struct ie + static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc) + { + struct sk_buff *skb = txrc->skb; +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); +- __le16 fc; +- +- fc = hdr->frame_control; + + return (info->flags & (IEEE80211_TX_CTL_NO_ACK | + IEEE80211_TX_CTL_USE_MINRATE)) || +- !ieee80211_is_data(fc); ++ !ieee80211_is_tx_data(skb); + } + + static void rc_send_low_basicrate(struct ieee80211_tx_rate *rate, +@@ -870,7 +866,6 @@ void ieee80211_get_tx_rates(struct ieee8 + int max_rates) + { + struct ieee80211_sub_if_data *sdata; +- struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_supported_band *sband; + +@@ -882,7 +877,7 @@ void ieee80211_get_tx_rates(struct ieee8 + sdata = vif_to_sdata(vif); + sband = sdata->local->hw.wiphy->bands[info->band]; + +- if (ieee80211_is_data(hdr->frame_control)) ++ if (ieee80211_is_tx_data(skb)) + rate_control_apply_mask(sdata, sta, sband, dest, max_rates); + + if (dest[0].idx < 0) +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -679,6 +679,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 + u32 len; + struct ieee80211_tx_rate_control txrc; + struct ieee80211_sta_rates *ratetbl = NULL; ++ bool encap = info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP; + bool assoc = false; + + memset(&txrc, 0, sizeof(txrc)); +@@ -720,7 +721,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 + * just wants a probe response. + */ + if (tx->sdata->vif.bss_conf.use_short_preamble && +- (ieee80211_is_data(hdr->frame_control) || ++ (ieee80211_is_tx_data(tx->skb) || + (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) + txrc.short_preamble = true; + +@@ -742,7 +743,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 + "%s: Dropped data frame as no usable bitrate found while " + "scanning and associated. Target station: " + "%pM on %d GHz band\n", +- tx->sdata->name, hdr->addr1, ++ tx->sdata->name, ++ encap ? ((struct ethhdr *)hdr)->h_dest : hdr->addr1, + info->band ? 5 : 2)) + return TX_DROP; + +@@ -776,7 +778,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 + + if (txrc.reported_rate.idx < 0) { + txrc.reported_rate = tx->rate; +- if (tx->sta && ieee80211_is_data(hdr->frame_control)) ++ if (tx->sta && ieee80211_is_tx_data(tx->skb)) + tx->sta->tx_stats.last_rate = txrc.reported_rate; + } else if (tx->sta) + tx->sta->tx_stats.last_rate = txrc.reported_rate; +@@ -3662,8 +3664,16 @@ begin: + else + info->flags &= ~IEEE80211_TX_CTL_AMPDU; + +- if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) ++ if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) { ++ if (!ieee80211_hw_check(&local->hw, HAS_RATE_CONTROL)) { ++ r = ieee80211_tx_h_rate_ctrl(&tx); ++ if (r != TX_CONTINUE) { ++ ieee80211_free_txskb(&local->hw, skb); ++ goto begin; ++ } ++ } + goto encap_out; ++ } + + if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) { + struct sta_info *sta = container_of(txq->sta, struct sta_info, From ccbe535604e3e4ad6017e57865ed140ae4926be6 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 30 Jun 2021 19:08:59 +0200 Subject: [PATCH 04/19] mac80211: backport fix for nl80211 control port tx (fixes FS#3857) Signed-off-by: Felix Fietkau (cherry-picked from commit de499573006ab4f32ded9fd66a62ec5e0c183e8a) --- ...le-QoS-support-for-nl80211-ctrl-port.patch | 116 ++++++++++++++++++ ...pply-flow-control-on-management-fram.patch | 4 +- ...set-sk_pacing_shift-for-802.3-txpath.patch | 2 +- ...MPDU-session-check-from-minstrel_ht-.patch | 6 +- ...eee80211_tx_h_rate_ctrl-when-dequeue.patch | 12 +- ...te-control-support-for-encap-offload.patch | 2 +- ...rting-aggregation-sessions-on-mesh-i.patch | 8 +- 7 files changed, 133 insertions(+), 17 deletions(-) create mode 100644 package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch diff --git a/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch new file mode 100644 index 0000000000..4be011ffec --- /dev/null +++ b/package/kernel/mac80211/patches/subsys/316-mac80211-enable-QoS-support-for-nl80211-ctrl-port.patch @@ -0,0 +1,116 @@ +From: Markus Theil +Date: Sat, 6 Feb 2021 12:51:12 +0100 +Subject: [PATCH] mac80211: enable QoS support for nl80211 ctrl port + +This patch unifies sending control port frames +over nl80211 and AF_PACKET sockets a little more. + +Before this patch, EAPOL frames got QoS prioritization +only when using AF_PACKET sockets. + +__ieee80211_select_queue only selects a QoS-enabled queue +for control port frames, when the control port protocol +is set correctly on the skb. For the AF_PACKET path this +works, but the nl80211 path used ETH_P_802_3. + +Another check for injected frames in wme.c then prevented +the QoS TID to be copied in the frame. + +In order to fix this, get rid of the frame injection marking +for nl80211 ctrl port and set the correct ethernet protocol. + +Please note: +An erlier version of this path tried to prevent +frame aggregation for control port frames in order to speed up +the initial connection setup a little. This seemed to cause +issues on my older Intel dvm-based hardware, and was therefore +removed again. Future commits which try to reintroduce this +have to check carefully how hw behaves with aggregated and +non-aggregated traffic for the same TID. +My NIC: Intel(R) Centrino(R) Ultimate-N 6300 AGN, REV=0x74 + +Reported-by: kernel test robot +Signed-off-by: Markus Theil +Link: https://lore.kernel.org/r/20210206115112.567881-1-markus.theil@tu-ilmenau.de +Signed-off-by: Johannes Berg +--- + +--- a/net/mac80211/status.c ++++ b/net/mac80211/status.c +@@ -628,16 +628,12 @@ static void ieee80211_report_ack_skb(str + u64 cookie = IEEE80211_SKB_CB(skb)->ack.cookie; + struct ieee80211_sub_if_data *sdata; + struct ieee80211_hdr *hdr = (void *)skb->data; +- __be16 ethertype = 0; +- +- if (skb->len >= ETH_HLEN && skb->protocol == cpu_to_be16(ETH_P_802_3)) +- skb_copy_bits(skb, 2 * ETH_ALEN, ðertype, ETH_TLEN); + + rcu_read_lock(); + sdata = ieee80211_sdata_from_skb(local, skb); + if (sdata) { +- if (ethertype == sdata->control_port_protocol || +- ethertype == cpu_to_be16(ETH_P_PREAUTH)) ++ if (skb->protocol == sdata->control_port_protocol || ++ skb->protocol == cpu_to_be16(ETH_P_PREAUTH)) + cfg80211_control_port_tx_status(&sdata->wdev, + cookie, + skb->data, +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -1195,9 +1195,7 @@ ieee80211_tx_prepare(struct ieee80211_su + tx->sta = rcu_dereference(sdata->u.vlan.sta); + if (!tx->sta && sdata->wdev.use_4addr) + return TX_DROP; +- } else if (info->flags & (IEEE80211_TX_INTFL_NL80211_FRAME_TX | +- IEEE80211_TX_CTL_INJECTED) || +- tx->sdata->control_port_protocol == tx->skb->protocol) { ++ } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { + tx->sta = sta_info_get_bss(sdata, hdr->addr1); + } + if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) +@@ -5421,6 +5419,7 @@ int ieee80211_tx_control_port(struct wip + { + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + struct ieee80211_local *local = sdata->local; ++ struct sta_info *sta; + struct sk_buff *skb; + struct ethhdr *ehdr; + u32 ctrl_flags = 0; +@@ -5443,8 +5442,7 @@ int ieee80211_tx_control_port(struct wip + if (cookie) + ctrl_flags |= IEEE80211_TX_CTL_REQ_TX_STATUS; + +- flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX | +- IEEE80211_TX_CTL_INJECTED; ++ flags |= IEEE80211_TX_INTFL_NL80211_FRAME_TX; + + skb = dev_alloc_skb(local->hw.extra_tx_headroom + + sizeof(struct ethhdr) + len); +@@ -5461,10 +5459,25 @@ int ieee80211_tx_control_port(struct wip + ehdr->h_proto = proto; + + skb->dev = dev; +- skb->protocol = htons(ETH_P_802_3); ++ skb->protocol = proto; + skb_reset_network_header(skb); + skb_reset_mac_header(skb); + ++ /* update QoS header to prioritize control port frames if possible, ++ * priorization also happens for control port frames send over ++ * AF_PACKET ++ */ ++ rcu_read_lock(); ++ ++ if (ieee80211_lookup_ra_sta(sdata, skb, &sta) == 0 && !IS_ERR(sta)) { ++ u16 queue = __ieee80211_select_queue(sdata, sta, skb); ++ ++ skb_set_queue_mapping(skb, queue); ++ skb_get_hash(skb); ++ } ++ ++ rcu_read_unlock(); ++ + /* mutex lock is only needed for incrementing the cookie counter */ + mutex_lock(&local->mtx); + diff --git a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch index b439a3814c..8d094a3632 100644 --- a/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch +++ b/package/kernel/mac80211/patches/subsys/371-mac80211-don-t-apply-flow-control-on-management-fram.patch @@ -28,7 +28,7 @@ Signed-off-by: Johannes Berg * * Transmit and frame generation functions. */ -@@ -1403,8 +1403,17 @@ static void ieee80211_txq_enqueue(struct +@@ -1401,8 +1401,17 @@ static void ieee80211_txq_enqueue(struct ieee80211_set_skb_enqueue_time(skb); spin_lock_bh(&fq->lock); @@ -48,7 +48,7 @@ Signed-off-by: Johannes Berg spin_unlock_bh(&fq->lock); } -@@ -3846,6 +3855,9 @@ bool ieee80211_txq_airtime_check(struct +@@ -3844,6 +3853,9 @@ bool ieee80211_txq_airtime_check(struct if (!txq->sta) return true; diff --git a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch index 4d8a91a413..5bc1469a3f 100644 --- a/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch +++ b/package/kernel/mac80211/patches/subsys/372-mac80211-set-sk_pacing_shift-for-802.3-txpath.patch @@ -9,7 +9,7 @@ Signed-off-by: Lorenzo Bianconi --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -4173,6 +4173,9 @@ static bool ieee80211_tx_8023(struct iee +@@ -4171,6 +4171,9 @@ static bool ieee80211_tx_8023(struct iee unsigned long flags; int q = info->hw_queue; diff --git a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch index 4e3242e6a9..031f8e1636 100644 --- a/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch +++ b/package/kernel/mac80211/patches/subsys/374-mac80211-move-A-MPDU-session-check-from-minstrel_ht-.patch @@ -76,7 +76,7 @@ Signed-off-by: Felix Fietkau .rate_init = minstrel_ht_rate_init, --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -3933,6 +3933,29 @@ void ieee80211_txq_schedule_start(struct +@@ -3931,6 +3931,29 @@ void ieee80211_txq_schedule_start(struct } EXPORT_SYMBOL(ieee80211_txq_schedule_start); @@ -106,7 +106,7 @@ Signed-off-by: Felix Fietkau void __ieee80211_subif_start_xmit(struct sk_buff *skb, struct net_device *dev, u32 info_flags, -@@ -3963,6 +3986,8 @@ void __ieee80211_subif_start_xmit(struct +@@ -3961,6 +3984,8 @@ void __ieee80211_subif_start_xmit(struct skb_get_hash(skb); } @@ -115,7 +115,7 @@ Signed-off-by: Felix Fietkau if (sta) { struct ieee80211_fast_tx *fast_tx; -@@ -4226,6 +4251,8 @@ static void ieee80211_8023_xmit(struct i +@@ -4224,6 +4249,8 @@ static void ieee80211_8023_xmit(struct i memset(info, 0, sizeof(*info)); diff --git a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch index 49b1212213..cf84fca68a 100644 --- a/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch +++ b/package/kernel/mac80211/patches/subsys/375-mac80211-call-ieee80211_tx_h_rate_ctrl-when-dequeue.patch @@ -10,7 +10,7 @@ Signed-off-by: Ryder Lee --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c -@@ -1780,8 +1780,6 @@ static int invoke_tx_handlers_early(stru +@@ -1778,8 +1778,6 @@ static int invoke_tx_handlers_early(stru CALL_TXH(ieee80211_tx_h_ps_buf); CALL_TXH(ieee80211_tx_h_check_control_port_protocol); CALL_TXH(ieee80211_tx_h_select_key); @@ -19,7 +19,7 @@ Signed-off-by: Ryder Lee txh_done: if (unlikely(res == TX_DROP)) { -@@ -1814,6 +1812,9 @@ static int invoke_tx_handlers_late(struc +@@ -1812,6 +1810,9 @@ static int invoke_tx_handlers_late(struc goto txh_done; } @@ -29,7 +29,7 @@ Signed-off-by: Ryder Lee CALL_TXH(ieee80211_tx_h_michael_mic_add); CALL_TXH(ieee80211_tx_h_sequence); CALL_TXH(ieee80211_tx_h_fragment); -@@ -3384,15 +3385,21 @@ out: +@@ -3382,15 +3383,21 @@ out: * Can be called while the sta lock is held. Anything that can cause packets to * be generated will cause deadlock! */ @@ -55,7 +55,7 @@ Signed-off-by: Ryder Lee if (key) info->control.hw_key = &key->conf; -@@ -3441,6 +3448,8 @@ static void ieee80211_xmit_fast_finish(s +@@ -3439,6 +3446,8 @@ static void ieee80211_xmit_fast_finish(s break; } } @@ -64,7 +64,7 @@ Signed-off-by: Ryder Lee } static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata, -@@ -3544,24 +3553,17 @@ static bool ieee80211_xmit_fast(struct i +@@ -3542,24 +3551,17 @@ static bool ieee80211_xmit_fast(struct i tx.sta = sta; tx.key = fast_tx->key; @@ -97,7 +97,7 @@ Signed-off-by: Ryder Lee if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) sdata = container_of(sdata->bss, -@@ -3672,8 +3674,12 @@ begin: +@@ -3670,8 +3672,12 @@ begin: (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) pn_offs = ieee80211_hdrlen(hdr->frame_control); diff --git a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch index eefeaa4a8d..43a4a1334d 100644 --- a/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch +++ b/package/kernel/mac80211/patches/subsys/376-mac80211-add-rate-control-support-for-encap-offload.patch @@ -99,7 +99,7 @@ Signed-off-by: Ryder Lee tx->sta->tx_stats.last_rate = txrc.reported_rate; } else if (tx->sta) tx->sta->tx_stats.last_rate = txrc.reported_rate; -@@ -3662,8 +3664,16 @@ begin: +@@ -3660,8 +3662,16 @@ begin: else info->flags &= ~IEEE80211_TX_CTL_AMPDU; diff --git a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch index 56eafaf847..2ad083f150 100644 --- a/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch +++ b/package/kernel/mac80211/patches/subsys/379-mac80211-fix-starting-aggregation-sessions-on-mesh-i.patch @@ -54,8 +54,8 @@ Signed-off-by: Felix Fietkau int tid; memset(tx, 0, sizeof(*tx)); -@@ -1202,8 +1226,10 @@ ieee80211_tx_prepare(struct ieee80211_su - tx->sdata->control_port_protocol == tx->skb->protocol) { +@@ -1200,8 +1224,10 @@ ieee80211_tx_prepare(struct ieee80211_su + } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { tx->sta = sta_info_get_bss(sdata, hdr->addr1); } - if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) @@ -66,7 +66,7 @@ Signed-off-by: Felix Fietkau } if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && -@@ -1213,8 +1239,12 @@ ieee80211_tx_prepare(struct ieee80211_su +@@ -1211,8 +1237,12 @@ ieee80211_tx_prepare(struct ieee80211_su struct tid_ampdu_tx *tid_tx; tid = ieee80211_get_tid(hdr); @@ -80,7 +80,7 @@ Signed-off-by: Felix Fietkau if (tid_tx) { bool queued; -@@ -3949,29 +3979,6 @@ void ieee80211_txq_schedule_start(struct +@@ -3947,29 +3977,6 @@ void ieee80211_txq_schedule_start(struct } EXPORT_SYMBOL(ieee80211_txq_schedule_start); From bea9380149d58e79bed4bf4b8298066bd36edde8 Mon Sep 17 00:00:00 2001 From: Bob Cantor Date: Fri, 25 Jun 2021 03:18:33 +1000 Subject: [PATCH 05/19] mac80211: fix no_reload logic (FS#3902) If drv_mac80211_setup is called twice with the same wifi configuration, then the second call returns early with error HOSTAPD_START_FAILED. (wifi works nevertheless, despite the fact that setup is incomplete. But "ubus call network.wireless status" erroneously reports that radio0 is down.) The relevant part of drv_mac80211_setup is, if [ "$no_reload" != "0" ]; then add_ap=1 ubus wait_for hostapd local hostapd_res="$(ubus call hostapd config_add "{\"iface\":\"$primary_ap\", \"config\":\"${hostapd_conf_file}\"}")" ret="$?" [ "$ret" != 0 -o -z "$hostapd_res" ] && { wireless_setup_failed HOSTAPD_START_FAILED return } wireless_add_process "$(jsonfilter -s "$hostapd_res" -l 1 -e @.pid)" "/usr/sbin/hostapd" 1 1 fi This commit sets no_reload = 0 during the second call of drv_mac80211_setup. It is perhaps worth providing a way to reproduce the situation where drv_mac80211_setup is called twice. When /sbin/wifi is used to turn on wifi, uci set wireless.@wifi-iface[0].disabled=0 uci set wireless.@wifi-device[0].disabled=0 uci commit wifi /sbin/wifi makes the following ubus calls, ubus call network reload ubus call network.wireless down ubus call network.wireless up The first and third ubus calls both call drv_mac80211_setup, while the second ubus call triggers wireless_device_setup_cancel. So the call sequence becomes, drv_mac80211_setup wireless_device_setup_cancel drv_mac80211_setup In contrast, when LuCI is used to turn on wifi only a single call is made to drv_mac80211_setup. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor (cherry-picked from commit a29ab3b79affb62fda82e0825ed811eaf482dd3c) --- package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 92c56afd24..43bd85cfdf 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1003,6 +1003,7 @@ drv_mac80211_setup() { [ -n "$hostapd_ctrl" ] && { local no_reload=1 if [ -n "$(ubus list | grep hostapd.$primary_ap)" ]; then + no_reload=0 [ "${NEW_MD5}" = "${OLD_MD5}" ] || { ubus call hostapd.$primary_ap reload no_reload=$? From 9302e63d1a3589f764e61caf0b3ecdad524458ea Mon Sep 17 00:00:00 2001 From: Bob Cantor Date: Fri, 25 Jun 2021 04:07:34 +1000 Subject: [PATCH 06/19] mac80211: always call wireless_set_data (FS#3784) When wifi is turned off, drv_mac80211_teardown sometimes fails (silently) because the device to be torn down is not defined. This situation arises if drv_mac80211_setup was called twice when wifi was turned on. This commit ensures that the device to be torn down is always defined in drv_mac80211_teardown. Steps to reproduce: 1) Use /sbin/wifi to turn on wifi. uci set wireless.@wifi-iface[0].disabled=0 uci set wireless.@wifi-device[0].disabled=0 uci commit wifi 2) Use /sbin/wifi to turn off wifi. uci set wireless.@wifi-device[0].disabled=1 uci commit wifi 3) Observe that wifi is still up. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor (cherry-picked from commit d515f6b6cde357bf480d32a7387f07ea40e85e52) --- .../kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index 43bd85cfdf..e3b26b287c 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -907,10 +907,8 @@ drv_mac80211_setup() { return 1 } - [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && { - uci -q -P /var/state set wireless._${phy}=phy - wireless_set_data phy="$phy" - } + wireless_set_data phy="$phy" + [ -z "$(uci -q -P /var/state show wireless._${phy})" ] && uci -q -P /var/state set wireless._${phy}=phy OLDAPLIST=$(uci -q -P /var/state get wireless._${phy}.aplist) OLDSPLIST=$(uci -q -P /var/state get wireless._${phy}.splist) From 6f13a390355d15bc1ecff59eba769d0189d05083 Mon Sep 17 00:00:00 2001 From: Bob Cantor Date: Fri, 25 Jun 2021 04:14:47 +1000 Subject: [PATCH 07/19] mac80211: print an error if wifi teardown fails drv_mac80211_teardown fails silently if the device to be torn down is not defined. This commit prints an error message. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor (cherry-picked from commit 3933e29d1b87c713167cf4730b68e5f18af4f140) --- package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh index e3b26b287c..9a9c35fb5f 100644 --- a/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh +++ b/package/kernel/mac80211/files/lib/netifd/wireless/mac80211.sh @@ -1076,6 +1076,10 @@ drv_mac80211_teardown() { json_select data json_get_vars phy json_select .. + [ -n "$phy" ] || { + echo "Bug: PHY is undefined for device '$1'" + return 1 + } mac80211_interface_cleanup "$phy" uci -q -P /var/state revert wireless._${phy} From b27b63b082d6e36c5ffe16c8ec3514d314907b3a Mon Sep 17 00:00:00 2001 From: Bob Cantor Date: Fri, 25 Jun 2021 04:37:17 +1000 Subject: [PATCH 08/19] base-files: wifi: swap the order of some ubus calls "/sbin/wifi up" makes three ubus calls: 1. ubus call network reload 2. ubus call network.wireless down 3. ubus call network.wireless up The first and third ubus calls call drv_mac80211_setup, while the second ubus call triggers wireless_device_setup_cancel, so the call sequence becomes, 1. drv_mac80211_setup 2. wireless_device_setup_cancel 3. drv_mac80211_setup This commit swaps the order of the first two ubus calls, 1. ubus call network.wireless down 2. ubus call network reload 3. ubus call network.wireless up Consequently drv_mac80211_setup is only called once, and two related bugs (#FS3784 and #FS3902) are no longer triggered by /sbin/wifi. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor (cherry-picked from commit b82cc8071366b8e96904a1b52af503442069b20d) --- package/base-files/files/sbin/wifi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index 75759b94f3..b2dde6f01c 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -130,6 +130,7 @@ wifi_updown() { ubus_wifi_cmd "$cmd" "$2" scan_wifi cmd=up + ubus call network reload } [ reconf = "$1" ] && { scan_wifi @@ -247,6 +248,6 @@ case "$1" in reload_legacy) wifi_reload_legacy "$2";; --help|help) usage;; reconf) ubus call network reload; wifi_updown "reconf" "$2";; - ''|up) ubus call network reload; wifi_updown "enable" "$2";; + ''|up) wifi_updown "enable" "$2";; *) usage; exit 1;; esac From a9100f21967313141020bfee517e0b307d25ab5b Mon Sep 17 00:00:00 2001 From: Bob Cantor Date: Fri, 25 Jun 2021 04:48:45 +1000 Subject: [PATCH 09/19] base-files: wifi: tidy up the reconf code commit 5edbd390d321532d9a697d6895a1a7c71c40bd5d rearranged the "wifi up" code. This commit tidies up the "wifi reconf" code so as to keep it aligned with the "wifi up" code. branches affected: trunk, 21.02 Signed-off-by: Bob Cantor (cherry-picked from commit e8b54296092118fbef75de796d57799cc6c7b927) --- package/base-files/files/sbin/wifi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/base-files/files/sbin/wifi b/package/base-files/files/sbin/wifi index b2dde6f01c..6b9662fe93 100755 --- a/package/base-files/files/sbin/wifi +++ b/package/base-files/files/sbin/wifi @@ -135,6 +135,7 @@ wifi_updown() { [ reconf = "$1" ] && { scan_wifi cmd=reconf + ubus call network reload } ubus_wifi_cmd "$cmd" "$2" _wifi_updown "$@" @@ -247,7 +248,7 @@ case "$1" in reload) wifi_reload "$2";; reload_legacy) wifi_reload_legacy "$2";; --help|help) usage;; - reconf) ubus call network reload; wifi_updown "reconf" "$2";; + reconf) wifi_updown "reconf" "$2";; ''|up) wifi_updown "enable" "$2";; *) usage; exit 1;; esac From d666ebcaa327a1e03992a484d9601ea5f2e6b19a Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 30 Jun 2021 21:57:19 +0200 Subject: [PATCH 10/19] ubus: update to the latest version 4fc532c8a55b ubusd: fix tx_queue linked list usage Signed-off-by: Felix Fietkau --- 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 c9b42fe623..28e6206b12 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-03 -PKG_SOURCE_VERSION:=a8cf678230ed163ff7a07eb1e2c872f9d655460a -PKG_MIRROR_HASH:=aee34cd1c1aa0f1a459dda0b2c6cbdb6b66e67147ebd1bcbb2a16a2ef923d008 +PKG_SOURCE_DATE:=2021-06-30 +PKG_SOURCE_VERSION:=4fc532c8a55ba8217ad67d7fd47c5eb9a8aba044 +PKG_MIRROR_HASH:=a5c8205f2e2b2f1f9ad687592e66a6e2bf8900dc54cfe3ceefe6c297d18971a8 PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 From fc4b5411b3a2105df4655e9623277d88489f6710 Mon Sep 17 00:00:00 2001 From: Arjun AK Date: Thu, 16 Jul 2020 21:22:24 +0530 Subject: [PATCH 11/19] package/comgt: Handle bind/unbind events This script was expecting only add/remove events which has not been the case since Kernel 4.12 (which added bind/unbind). Bind events were getting treated as remove events which would cause hotplugged 3g modems to not work. More info: https://lkml.org/lkml/2018/12/23/128 https://github.com/systemd/systemd/issues/8221 Signed-off-by: Arjun AK (cherry picked from commit 89ef883b92b3a87d9ab1bd289de26b9e72681dac) --- package/network/utils/comgt/files/3g.usb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/package/network/utils/comgt/files/3g.usb b/package/network/utils/comgt/files/3g.usb index 8f0d62ca83..9c7d07a0e6 100644 --- a/package/network/utils/comgt/files/3g.usb +++ b/package/network/utils/comgt/files/3g.usb @@ -23,6 +23,8 @@ find_3g_iface() { fi } +[ "$ACTION" = add ] || [ "$ACTION" = remove ] || exit 0 + case "$DEVICENAME" in tty*) [ -e "/dev/$DEVICENAME" ] || [ "$ACTION" = remove ] || exit 0 From 69c10497c7fe4fada202c40825903fe9a033ade3 Mon Sep 17 00:00:00 2001 From: DENG Qingfang Date: Fri, 9 Apr 2021 12:25:08 +0800 Subject: [PATCH 12/19] kernel/modules: move act_gact into kmod-sched-core As the name suggests, act_gact has the generic actions such as dropping and accepting packets, so move it into kmod-sched-core. Signed-off-by: DENG Qingfang (cherry-picked from commit 10aacb9a6ce3445cdee39573f4120e7888beb022) --- package/kernel/linux/modules/netsupport.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/kernel/linux/modules/netsupport.mk b/package/kernel/linux/modules/netsupport.mk index f14928e18e..1eec9f9b63 100644 --- a/package/kernel/linux/modules/netsupport.mk +++ b/package/kernel/linux/modules/netsupport.mk @@ -721,7 +721,7 @@ $(eval $(call KernelPackage,mppe)) SCHED_MODULES = $(patsubst $(LINUX_DIR)/net/sched/%.ko,%,$(wildcard $(LINUX_DIR)/net/sched/*.ko)) -SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_mirred act_skbedit cls_matchall +SCHED_MODULES_CORE = sch_ingress sch_fq_codel sch_hfsc sch_htb sch_tbf cls_basic cls_fw cls_route cls_flow cls_tcindex cls_u32 em_u32 act_gact act_mirred act_skbedit cls_matchall SCHED_MODULES_FILTER = $(SCHED_MODULES_CORE) act_connmark act_ctinfo sch_cake sch_netem sch_mqprio em_ipset cls_bpf cls_flower act_bpf act_vlan SCHED_MODULES_EXTRA = $(filter-out $(SCHED_MODULES_FILTER),$(SCHED_MODULES)) SCHED_FILES = $(patsubst %,$(LINUX_DIR)/net/sched/%.ko,$(filter $(SCHED_MODULES_CORE),$(SCHED_MODULES))) @@ -745,6 +745,7 @@ define KernelPackage/sched-core CONFIG_NET_CLS_ROUTE4 \ CONFIG_NET_CLS_TCINDEX \ CONFIG_NET_CLS_U32 \ + CONFIG_NET_ACT_GACT \ CONFIG_NET_ACT_MIRRED \ CONFIG_NET_ACT_SKBEDIT \ CONFIG_NET_CLS_MATCHALL \ @@ -899,7 +900,6 @@ define KernelPackage/sched CONFIG_NET_SCH_FQ \ CONFIG_NET_SCH_PIE \ CONFIG_NET_ACT_POLICE \ - CONFIG_NET_ACT_GACT \ CONFIG_NET_ACT_IPT \ CONFIG_NET_ACT_PEDIT \ CONFIG_NET_ACT_SIMP \ From 24cfa5005eb475d5a182f5e82dbfa469ccc7c071 Mon Sep 17 00:00:00 2001 From: Michael Yartys Date: Thu, 3 Jun 2021 23:50:12 +0200 Subject: [PATCH 13/19] ath10k-ct: update to latest version Changelog: - ath10k-ct: Add security fixes. - ath10k-ct: Add 5.12 kernel version. - ath10k-ct: Fix the beacon/mcast/bcast override issue - ath10k-ct 5.7: Fix setting mcast/bcast/beacon rate from debugfs. - ath10k-ct: Add 5.11 driver. Delete upstreamed patch and refresh the rest. Also, use the opportunity to set PKG_RELEASE to $(AUTORELEASE). Runtime-tested on ipq806x (Netgear R7800). Signed-off-by: Michael Yartys (cherry picked from commit 2e10ed925e1e07c28570731a429efa5e7de3b826) --- package/kernel/ath10k-ct/Makefile | 8 ++-- ...64-ath10k-commit-rates-from-mac80211.patch | 37 ------------------- ...rolling-support-for-various-chipsets.patch | 4 +- ...02-ath10k-use-tpt-trigger-by-default.patch | 4 +- 4 files changed, 8 insertions(+), 45 deletions(-) delete mode 100644 package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index a225bd8b19..f06d7cf132 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,16 +1,16 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE=2 +PKG_RELEASE=$(AUTORELEASE) PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-01-11 -PKG_SOURCE_VERSION:=9fe1df7d4f783b6b0cd1c99d11979e5a6e6fc40b -PKG_MIRROR_HASH:=4e30e256716611045e930b95eadaa8bfcadd5bdd8bbe3869cfe0f377920e812b +PKG_SOURCE_DATE:=2021-06-03 +PKG_SOURCE_VERSION:=b44cd7b2e7b0df5995ece18f358d4dfc40834ba1 +PKG_MIRROR_HASH:=59f961ad425eb1a48fa9c391a325cc0f23845daec9d12673445d3077f9756cf0 # Build the 5.10 ath10k-ct driver version. # Probably this should match as closely as diff --git a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch b/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch deleted file mode 100644 index 842f3ea2a5..0000000000 --- a/package/kernel/ath10k-ct/patches/164-ath10k-commit-rates-from-mac80211.patch +++ /dev/null @@ -1,37 +0,0 @@ -From: Sven Eckelmann -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 - ---- a/ath10k-5.10/mac.c -+++ b/ath10k-5.10/mac.c -@@ -6774,6 +6774,7 @@ static void ath10k_recalculate_mgmt_rate - 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); -@@ -7000,6 +7001,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); -@@ -7008,6 +7010,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); diff --git a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch index 749e796148..691b504c0f 100644 --- a/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch +++ b/package/kernel/ath10k-ct/patches/201-ath10k-add-LED-and-GPIO-controlling-support-for-various-chipsets.patch @@ -210,7 +210,7 @@ v13: #include "htt.h" #include "htc.h" -@@ -1551,6 +1552,13 @@ struct ath10k { +@@ -1557,6 +1558,13 @@ struct ath10k { } testmode; struct { @@ -445,7 +445,7 @@ v13: { --- a/ath10k-5.10/wmi-tlv.c +++ b/ath10k-5.10/wmi-tlv.c -@@ -4585,6 +4585,8 @@ static const struct wmi_ops wmi_tlv_ops +@@ -4594,6 +4594,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, diff --git a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch index eae779ef58..6205c9b661 100644 --- a/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch +++ b/package/kernel/ath10k-ct/patches/202-ath10k-use-tpt-trigger-by-default.patch @@ -16,7 +16,7 @@ Signed-off-by: Mathias Kresin --- a/ath10k-5.10/core.h +++ b/ath10k-5.10/core.h -@@ -1659,6 +1659,10 @@ struct ath10k { +@@ -1665,6 +1665,10 @@ struct ath10k { u8 csi_data[4096]; u16 csi_data_len; @@ -42,7 +42,7 @@ Signed-off-by: Mathias Kresin if (ret) --- a/ath10k-5.10/mac.c +++ b/ath10k-5.10/mac.c -@@ -11400,7 +11400,7 @@ int ath10k_mac_register(struct ath10k *a +@@ -11403,7 +11403,7 @@ int ath10k_mac_register(struct ath10k *a ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER; #ifdef CPTCFG_MAC80211_LEDS From 86f617178885c59665cc6ce01c570f128c06d151 Mon Sep 17 00:00:00 2001 From: Michael Yartys Date: Mon, 21 Jun 2021 13:37:20 +0200 Subject: [PATCH 14/19] ath10k-ct: fix typo in Makefile Add forgotten colon to Makefile. Signed-off-by: Michael Yartys (cherry picked from commit f0f1d68d528402b4d51a1dd08d2e2c9034167f92) --- package/kernel/ath10k-ct/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile index f06d7cf132..5681c5c2cd 100644 --- a/package/kernel/ath10k-ct/Makefile +++ b/package/kernel/ath10k-ct/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=ath10k-ct -PKG_RELEASE=$(AUTORELEASE) +PKG_RELEASE:=$(AUTORELEASE) PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= From d723002d84e25d18b7e225d5e6f2810875d052c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0tetiar?= Date: Fri, 2 Jul 2021 18:00:09 +0200 Subject: [PATCH 15/19] treewide: unmark selected packages nonshared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This partially reverts changes done in commit 72cc44958ef4 ("treewide: mark selected packages nonshared") as it removes the nonshared flag, but keeps the PKG_RELEASE as the PKG_RELEASE bump while adding nonshared flag was incorrect. Unmark uci, ubus, libubox, lua, libnl-tiny and libjson-c as nonshared packages as this fix attempt didn't worked out. Currently the imagebuilder is broken again: openwrt-imagebuilder-21.02.0-rc3-ipq40xx-generic.Linux-x86_64$ make image PROFILE=avm_fritzbox-7530 PACKAGES=luci-ssl-openssl ... Collected errors: * pkg_hash_check_unresolved: cannot find dependency libiwinfo20210430 for luci-mod-status * pkg_hash_fetch_best_installation_candidate: Packages for luci-mod-status found, but incompatible with the architectures configured * pkg_hash_check_unresolved: cannot find dependency libiwinfo20210430 for rpcd-mod-iwinfo * pkg_hash_fetch_best_installation_candidate: Packages for rpcd-mod-iwinfo found, but incompatible with the architectures configured * satisfy_dependencies_for: Cannot satisfy the following dependencies for luci-ssl-openssl: * libiwinfo20210430 * opkg_install_cmd: Cannot install package luci-ssl-openssl. Everything because iwinfo's ABI was changed two times since rc3 release: +IWINFO_ABI_VERSION:=20210430 +IWINFO_ABI_VERSION:=20210420 Since iwinfo is marked as nonshared, it wasn't built by phase2 builders, but luci-mod-status was already updated 2 times since rc3 and was thus rebuilt by phase2 builders: d1d452ed2fb3 luci-mod-status: don't set '-' hostname when creating static lease 95b3633055c1 luci-mod-status: switch to html table for wlan channel analysis So now luci-mod-status depends on libiwinfo20210430 but only libiwinfo20210106 can be downloaded. This is first part of the fix, in the upcoming commit Jo is going to remove nonshared flag from iwinfo package as well. References: https://lists.infradead.org/pipermail/openwrt-devel/2021-July/035736.html References: https://lists.infradead.org/pipermail/openwrt-devel/2021-July/035741.html Acked-by: Jo-Philipp Wich Reported-by: Nick Hainke Signed-off-by: Petr Štetiar (cherry picked from commit 8307da3dbdaff13d5ce99f8aefa32f5b7a2e18e6) --- package/libs/libjson-c/Makefile | 1 - package/libs/libnl-tiny/Makefile | 2 -- package/libs/libubox/Makefile | 2 -- package/system/ubus/Makefile | 1 - package/system/uci/Makefile | 2 -- package/utils/lua/Makefile | 1 - 6 files changed, 9 deletions(-) diff --git a/package/libs/libjson-c/Makefile b/package/libs/libjson-c/Makefile index 0ea3fe80b5..5f0ce3c689 100644 --- a/package/libs/libjson-c/Makefile +++ b/package/libs/libjson-c/Makefile @@ -20,7 +20,6 @@ PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYING PKG_CPE_ID:=cpe:/a:json-c_project:json-c -PKG_FLAGS := nonshared PKG_BUILD_PARALLEL:=1 HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST) diff --git a/package/libs/libnl-tiny/Makefile b/package/libs/libnl-tiny/Makefile index ff3da5b518..bdb496c48e 100644 --- a/package/libs/libnl-tiny/Makefile +++ b/package/libs/libnl-tiny/Makefile @@ -17,8 +17,6 @@ PKG_SOURCE_VERSION:=c291088f631d1694f7ba0444b59677b194348da8 PKG_MIRROR_HASH:=99bcce12701bb34dadb39689d95c2c5cf1e27719d0ecfd645d3957a8947025ac CMAKE_INSTALL:=1 -PKG_FLAGS := nonshared - PKG_LICENSE:=LGPL-2.1 PKG_MAINTAINER:=Felix Fietkau diff --git a/package/libs/libubox/Makefile b/package/libs/libubox/Makefile index 8e4848103d..d2c07783e1 100644 --- a/package/libs/libubox/Makefile +++ b/package/libs/libubox/Makefile @@ -11,8 +11,6 @@ PKG_SOURCE_VERSION:=b14c4688612c05c78ce984d7bde633bce8703b1e PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE)) CMAKE_INSTALL:=1 -PKG_FLAGS := nonshared - PKG_LICENSE:=ISC PKG_LICENSE_FILES:= diff --git a/package/system/ubus/Makefile b/package/system/ubus/Makefile index 28e6206b12..8a3fd1de7b 100644 --- a/package/system/ubus/Makefile +++ b/package/system/ubus/Makefile @@ -15,7 +15,6 @@ PKG_LICENSE:=LGPL-2.1 PKG_LICENSE_FILES:= PKG_MAINTAINER:=Felix Fietkau -PKG_FLAGS := nonshared PKG_ASLR_PIE_REGULAR:=1 include $(INCLUDE_DIR)/package.mk diff --git a/package/system/uci/Makefile b/package/system/uci/Makefile index fa2aff1c38..75fc1bdfad 100644 --- a/package/system/uci/Makefile +++ b/package/system/uci/Makefile @@ -23,8 +23,6 @@ PKG_LICENSE_FILES:= PKG_MAINTAINER:=Felix Fietkau PKG_BUILD_PARALLEL:=0 -PKG_FLAGS := nonshared - include $(INCLUDE_DIR)/package.mk include $(INCLUDE_DIR)/cmake.mk diff --git a/package/utils/lua/Makefile b/package/utils/lua/Makefile index 83b83e4856..d262d1e1fc 100644 --- a/package/utils/lua/Makefile +++ b/package/utils/lua/Makefile @@ -16,7 +16,6 @@ PKG_SOURCE_URL:=http://www.lua.org/ftp/ \ http://www.tecgraf.puc-rio.br/lua/ftp/ PKG_HASH:=2640fc56a795f29d28ef15e13c34a47e223960b0240e8cb0a82d9b0738695333 PKG_BUILD_PARALLEL:=1 -PKG_FLAGS := nonshared PKG_LICENSE:=MIT PKG_LICENSE_FILES:=COPYRIGHT From b0424190efe0fa4de4be6c1b59107e0881a39950 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Fri, 2 Jul 2021 18:04:17 +0200 Subject: [PATCH 16/19] iwinfo: build with nl80211 backend only and make shared Drop support for building the obsolete broadcom-wl backend and always forcibly enable the nl82011 support. This allows us to make the package shared again since no target specific compilation is happening anymore. This will solve various repository coherency issues related to unavailable libiwinfo versions in the long run. Signed-off-by: Jo-Philipp Wich (cherry picked from commit 5a1065758b88b568a04a50189400321601904bdf) --- package/network/utils/iwinfo/Makefile | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/package/network/utils/iwinfo/Makefile b/package/network/utils/iwinfo/Makefile index d8c1befc97..b3ef261369 100644 --- a/package/network/utils/iwinfo/Makefile +++ b/package/network/utils/iwinfo/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=libiwinfo -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_SOURCE_PROTO:=git PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git @@ -17,14 +17,6 @@ PKG_MIRROR_HASH:=24ad04791254a0523cd15a4fec6116d9ff121e006c93e5e41459f91347b33ec PKG_MAINTAINER:=Jo-Philipp Wich PKG_LICENSE:=GPL-2.0 -PKG_FLAGS := nonshared - -PKG_CONFIG_DEPENDS := \ - CONFIG_PACKAGE_kmod-brcm-wl \ - CONFIG_PACKAGE_kmod-brcm-wl-mini \ - CONFIG_PACKAGE_kmod-brcm-wl-mimo \ - CONFIG_PACKAGE_kmod-cfg80211 - IWINFO_ABI_VERSION:=20210430 include $(INCLUDE_DIR)/package.mk @@ -34,13 +26,13 @@ define Package/libiwinfo SECTION:=libs CATEGORY:=Libraries TITLE:=Generalized Wireless Information Library (iwinfo) - DEPENDS:=+PACKAGE_kmod-cfg80211:libnl-tiny +libuci +libubus + DEPENDS:=+libnl-tiny +libuci +libubus ABI_VERSION:=$(IWINFO_ABI_VERSION) endef define Package/libiwinfo/description - Wireless information library with consistent interface for proprietary Broadcom, - nl80211 and wext driver interfaces. + Wireless information library with simplified API for nl80211 + and wext driver interfaces. endef @@ -73,12 +65,6 @@ endef define Build/Configure endef -IWINFO_BACKENDS := \ - $(if $(CONFIG_PACKAGE_kmod-brcm-wl),wl) \ - $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mini),wl) \ - $(if $(CONFIG_PACKAGE_kmod-brcm-wl-mimo),wl) \ - $(if $(CONFIG_PACKAGE_kmod-cfg80211),nl80211) - TARGET_CFLAGS += \ -I$(STAGING_DIR)/usr/include/libnl-tiny \ -I$(STAGING_DIR)/usr/include \ @@ -88,7 +74,7 @@ MAKE_FLAGS += \ FPIC="$(FPIC)" \ CFLAGS="$(TARGET_CFLAGS)" \ LDFLAGS="$(TARGET_LDFLAGS)" \ - BACKENDS="$(IWINFO_BACKENDS)" \ + BACKENDS="nl80211" \ SOVERSION="$(IWINFO_ABI_VERSION)" define Build/InstallDev From 72f0733123631e0c20cefcc89d6a81d41d918f20 Mon Sep 17 00:00:00 2001 From: Hauke Mehrtens Date: Sun, 27 Jun 2021 00:52:50 +0200 Subject: [PATCH 17/19] ltq-deu: Mark lantiq DEU broken When the ltq_deu_vr9 kernel module is loaded, hostapd does not start any more. It fails with this error message: daemon.err hostapd: nl80211: kernel reports: key addition failed daemon.err hostapd: Interface initialization failed OpenWrt uses the standard Linux crypto API in the wifi drivers now and this probably makes the system offload more crypto operations to special hardware like the Lantiq DEU. There is probably a bug in the DEU and these operations fail and then hostapd does not start the interface. Do not include the Lantiq DEU by default any more. Fixes: FS#3901 Fixes: 53b6783907f3 ("mac80211: remove patches stripping down crypto support") Signed-off-by: Hauke Mehrtens Acked-by: Martin Blumenstingl Tested-by: Notupus (cherry-picked from commit 964863bb23999a1fae99b883053cc4f3c5c42b40) --- target/linux/lantiq/image/ar9.mk | 15 ++++++--------- target/linux/lantiq/image/danube.mk | 1 - target/linux/lantiq/xrx200/target.mk | 1 - 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/target/linux/lantiq/image/ar9.mk b/target/linux/lantiq/image/ar9.mk index a973c90beb..ea3836ea9d 100644 --- a/target/linux/lantiq/image/ar9.mk +++ b/target/linux/lantiq/image/ar9.mk @@ -7,7 +7,7 @@ define Device/avm_fritz7312 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 -swconfig + -swconfig endef TARGET_DEVICES += avm_fritz7312 @@ -22,7 +22,7 @@ define Device/avm_fritz7320 kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 kmod-usb-dwc2 -swconfig + kmod-usb-dwc2 -swconfig SUPPORTED_DEVICES += FRITZ7320 endef TARGET_DEVICES += avm_fritz7320 @@ -38,7 +38,6 @@ define Device/bt_homehub-v3a DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ - kmod-ltq-deu-ar9 \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ uboot-envtools @@ -107,8 +106,7 @@ define Device/netgear_dgn3500 kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-a kmod-ltq-atm-ar9 \ - ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 + ltq-adsl-app ppp-mod-pppoa SUPPORTED_DEVICES += DGN3500 endef TARGET_DEVICES += netgear_dgn3500 @@ -130,8 +128,7 @@ define Device/netgear_dgn3500b kmod-ath9k kmod-owl-loader wpad-basic-wolfssl \ kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ - ltq-adsl-app ppp-mod-pppoa \ - kmod-ltq-deu-ar9 + ltq-adsl-app ppp-mod-pppoa SUPPORTED_DEVICES += DGN3500B endef TARGET_DEVICES += netgear_dgn3500b @@ -145,7 +142,7 @@ define Device/zte_h201l kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ - kmod-ltq-deu-ar9 kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ + kmod-usb-dwc2 kmod-usb-ledtrig-usbport \ kmod-ltq-tapi kmod-ltq-vmmc SUPPORTED_DEVICES += H201L endef @@ -161,7 +158,7 @@ define Device/zyxel_p-2601hn kmod-ltq-adsl-ar9-mei kmod-ltq-adsl-ar9 \ kmod-ltq-adsl-ar9-fw-b kmod-ltq-atm-ar9 \ ltq-adsl-app ppp-mod-pppoe \ - kmod-ltq-deu-ar9 kmod-usb-dwc2 + kmod-usb-dwc2 SUPPORTED_DEVICES += P2601HNFX endef TARGET_DEVICES += zyxel_p-2601hn diff --git a/target/linux/lantiq/image/danube.mk b/target/linux/lantiq/image/danube.mk index 73ec27222a..28fa4ed800 100644 --- a/target/linux/lantiq/image/danube.mk +++ b/target/linux/lantiq/image/danube.mk @@ -192,7 +192,6 @@ define Device/bt_homehub-v2b DEVICE_PACKAGES := kmod-usb-dwc2 \ kmod-ltq-adsl-danube-mei kmod-ltq-adsl-danube \ kmod-ltq-adsl-danube-fw-a kmod-ltq-atm-danube \ - kmod-ltq-deu-danube \ ltq-adsl-app ppp-mod-pppoa \ kmod-ath9k kmod-owl-loader wpad-basic-wolfssl SUPPORTED_DEVICES += BTHOMEHUBV2B diff --git a/target/linux/lantiq/xrx200/target.mk b/target/linux/lantiq/xrx200/target.mk index f7dc8ac1c7..daf2c188cf 100644 --- a/target/linux/lantiq/xrx200/target.mk +++ b/target/linux/lantiq/xrx200/target.mk @@ -11,7 +11,6 @@ DEFAULT_PACKAGES+=kmod-leds-gpio \ kmod-ltq-vdsl-vr9 \ kmod-ltq-atm-vr9 \ kmod-ltq-ptm-vr9 \ - kmod-ltq-deu-vr9 \ ltq-vdsl-app \ dsl-vrx200-firmware-xdsl-a \ dsl-vrx200-firmware-xdsl-b-patch \ From 89d21b7f6299b8c3746c1af8671b0dba19f63598 Mon Sep 17 00:00:00 2001 From: Timo Sigurdsson Date: Tue, 15 Jun 2021 23:08:56 +0200 Subject: [PATCH 18/19] hostapd: make country3 option configurable The country3 option in hostapd.conf allows the third octet of the country string to be set. It can be used e.g. to indicate indoor or outdoor use (see hostapd.conf for further details). Make this option configurable but optional in OpenWrt. Signed-off-by: Timo Sigurdsson [bump PKG_RELEASE, rebase] Signed-off-by: Paul Spooren (cherry picked from commit 9f09c1936a4a13b67fcba632f7ca02331f685359) Signed-off-by: Paul Spooren --- package/network/services/hostapd/Makefile | 2 +- package/network/services/hostapd/files/hostapd.sh | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 0779421b8d..628bbbec4d 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=33 +PKG_RELEASE:=34 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index 87fcaf03b3..ee338a9388 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -92,7 +92,7 @@ hostapd_common_add_device_config() { config_add_array basic_rate config_add_array supported_rates - config_add_string country + config_add_string country country3 config_add_boolean country_ie doth config_add_boolean spectrum_mgmt_required config_add_int local_pwr_constraint @@ -114,7 +114,7 @@ hostapd_prepare_device_config() { local base_cfg= - json_get_vars country country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ + json_get_vars country country3 country_ie beacon_int:100 dtim_period:2 doth require_mode legacy_rates \ acs_chan_bias local_pwr_constraint spectrum_mgmt_required airtime_mode cell_density hostapd_set_log_options base_cfg @@ -128,6 +128,7 @@ hostapd_prepare_device_config() { [ -n "$country" ] && { append base_cfg "country_code=$country" "$N" + [ -n "$country3" ] && append base_cfg "country3=$country3" "$N" [ "$country_ie" -gt 0 ] && { append base_cfg "ieee80211d=1" "$N" From 3eb34bc2516b0f3e51f5710ab537d13c427ecbb0 Mon Sep 17 00:00:00 2001 From: Timo Sigurdsson Date: Tue, 15 Jun 2021 23:09:41 +0200 Subject: [PATCH 19/19] hostapd: make wnm_sleep_mode_no_keys configurable In the aftermath of the KRACK attacks, hostapd gained an AP-side workaround against WNM-Sleep Mode GTK/IGTK reinstallation attacks. WNM Sleep Mode is not enabled by default on OpenWrt, but it is configurable through the option wnm_sleep_mode. Thus, make the AP-side workaround configurable as well by exposing the option wnm_sleep_mode_no_keys. If you use the option wpa_disable_eapol_key_retries and have wnm_sleep_mode enabled, you might consider using this workaround. Signed-off-by: Timo Sigurdsson [bump PKG_RELEASE] Signed-off-by: Paul Spooren (cherry picked from commit bf98faaac8ed24cf7d3d93dd4fcd7304d109363b) --- package/network/services/hostapd/Makefile | 2 +- package/network/services/hostapd/files/hostapd.sh | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package/network/services/hostapd/Makefile b/package/network/services/hostapd/Makefile index 628bbbec4d..67ea89c339 100644 --- a/package/network/services/hostapd/Makefile +++ b/package/network/services/hostapd/Makefile @@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_RELEASE:=34 +PKG_RELEASE:=35 PKG_SOURCE_URL:=http://w1.fi/hostap.git PKG_SOURCE_PROTO:=git diff --git a/package/network/services/hostapd/files/hostapd.sh b/package/network/services/hostapd/files/hostapd.sh index ee338a9388..aa72e09eba 100644 --- a/package/network/services/hostapd/files/hostapd.sh +++ b/package/network/services/hostapd/files/hostapd.sh @@ -284,7 +284,7 @@ hostapd_common_add_bss_config() { config_add_string wps_device_type wps_device_name wps_manufacturer wps_pin config_add_string multi_ap_backhaul_ssid multi_ap_backhaul_key - config_add_boolean wnm_sleep_mode bss_transition + config_add_boolean wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition config_add_int time_advertisement config_add_string time_zone @@ -706,13 +706,17 @@ hostapd_set_bss_options() { append bss_conf "iapp_interface=$ifname" "$N" } - json_get_vars time_advertisement time_zone wnm_sleep_mode bss_transition + json_get_vars time_advertisement time_zone wnm_sleep_mode wnm_sleep_mode_no_keys bss_transition set_default bss_transition 0 set_default wnm_sleep_mode 0 + set_default wnm_sleep_mode_no_keys 0 [ -n "$time_advertisement" ] && append bss_conf "time_advertisement=$time_advertisement" "$N" [ -n "$time_zone" ] && append bss_conf "time_zone=$time_zone" "$N" - [ "$wnm_sleep_mode" -eq "1" ] && append bss_conf "wnm_sleep_mode=1" "$N" + if [ "$wnm_sleep_mode" -eq "1" ]; then + append bss_conf "wnm_sleep_mode=1" "$N" + [ "$wnm_sleep_mode_no_keys" -eq "1" ] && append bss_conf "wnm_sleep_mode_no_keys=1" "$N" + fi [ "$bss_transition" -eq "1" ] && append bss_conf "bss_transition=1" "$N" json_get_vars ieee80211k rrm_neighbor_report rrm_beacon_report