Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
41b14cb7e0
@ -4,7 +4,7 @@ IMAGE_KERNEL = $(word 1,$^)
|
||||
IMAGE_ROOTFS = $(word 2,$^)
|
||||
|
||||
define ModelNameLimit16
|
||||
$(shell expr substr "$(word 2, $(subst _, ,$(1)))" 1 16)
|
||||
$(shell printf %.16s "$(word 2, $(subst _, ,$(1)))")
|
||||
endef
|
||||
|
||||
define rootfs_align
|
||||
|
||||
@ -283,3 +283,7 @@ macaddr_canonicalize() {
|
||||
|
||||
printf "%02x:%02x:%02x:%02x:%02x:%02x" 0x${canon// / 0x} 2>/dev/null
|
||||
}
|
||||
|
||||
dt_is_enabled() {
|
||||
grep -q okay "/proc/device-tree/$1/status"
|
||||
}
|
||||
|
||||
@ -646,6 +646,21 @@ ucidef_set_ntpserver() {
|
||||
json_select ..
|
||||
}
|
||||
|
||||
ucidef_add_wlan() {
|
||||
local path="$1"; shift
|
||||
|
||||
ucidef_wlan_idx=${ucidef_wlan_idx:-0}
|
||||
|
||||
json_select_object wlan
|
||||
json_select_object "wl$ucidef_wlan_idx"
|
||||
json_add_string path "$path"
|
||||
json_add_fields "$@"
|
||||
json_select ..
|
||||
json_select ..
|
||||
|
||||
ucidef_wlan_idx="$((ucidef_wlan_idx + 1))"
|
||||
}
|
||||
|
||||
board_config_update() {
|
||||
json_init
|
||||
[ -f ${CFG} ] && json_load "$(cat ${CFG})"
|
||||
|
||||
@ -51,6 +51,8 @@ drv_mac80211_init_device_config() {
|
||||
rx_antenna_pattern \
|
||||
tx_antenna_pattern \
|
||||
he_spr_sr_control \
|
||||
he_spr_psr_enabled \
|
||||
he_bss_color_enabled \
|
||||
he_twt_required
|
||||
config_add_int \
|
||||
beamformer_antennas \
|
||||
@ -414,12 +416,14 @@ mac80211_hostapd_setup_base() {
|
||||
if [ "$enable_ax" != "0" ]; then
|
||||
json_get_vars \
|
||||
he_su_beamformer:1 \
|
||||
he_su_beamformee:0 \
|
||||
he_su_beamformee:1 \
|
||||
he_mu_beamformer:1 \
|
||||
he_twt_required:0 \
|
||||
he_spr_sr_control:0 \
|
||||
he_spr_non_srg_obss_pd_max_offset:1 \
|
||||
he_bss_color
|
||||
he_spr_sr_control:3 \
|
||||
he_spr_psr_enabled:0 \
|
||||
he_spr_non_srg_obss_pd_max_offset:0 \
|
||||
he_bss_color:128 \
|
||||
he_bss_color_enabled:1
|
||||
|
||||
he_phy_cap=$(iw phy "$phy" info | sed -n '/HE Iftypes: AP/,$p' | awk -F "[()]" '/HE PHY Capabilities/ { print $2 }' | head -1)
|
||||
he_phy_cap=${he_phy_cap:2}
|
||||
@ -432,17 +436,25 @@ mac80211_hostapd_setup_base() {
|
||||
append base_cfg "he_oper_centr_freq_seg0_idx=$vht_center_seg0" "$N"
|
||||
}
|
||||
|
||||
set_default he_bss_color 128
|
||||
append base_cfg "he_bss_color=$he_bss_color" "$N"
|
||||
|
||||
mac80211_add_he_capabilities \
|
||||
he_su_beamformer:${he_phy_cap:6:2}:0x80:$he_su_beamformer \
|
||||
he_su_beamformee:${he_phy_cap:8:2}:0x1:$he_su_beamformee \
|
||||
he_mu_beamformer:${he_phy_cap:8:2}:0x2:$he_mu_beamformer \
|
||||
he_spr_sr_control:${he_phy_cap:14:2}:0x1:$he_spr_sr_control \
|
||||
he_spr_psr_enabled:${he_phy_cap:14:2}:0x1:$he_spr_psr_enabled \
|
||||
he_twt_required:${he_mac_cap:0:2}:0x6:$he_twt_required
|
||||
|
||||
[ "$he_spr_sr_control" -gt 0 ] && append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N"
|
||||
if [ "$he_bss_color_enabled" -gt 0 ]; then
|
||||
append base_cfg "he_bss_color=$he_bss_color" "$N"
|
||||
[ "$he_spr_non_srg_obss_pd_max_offset" -gt 0 ] && { \
|
||||
append base_cfg "he_spr_non_srg_obss_pd_max_offset=$he_spr_non_srg_obss_pd_max_offset" "$N"
|
||||
he_spr_sr_control=$((he_spr_sr_control | (1 << 2)))
|
||||
}
|
||||
[ "$he_spr_psr_enabled" -gt 0 ] || he_spr_sr_control=$((he_spr_sr_control | (1 << 0)))
|
||||
append base_cfg "he_spr_sr_control=$he_spr_sr_control" "$N"
|
||||
else
|
||||
append base_cfg "he_bss_color_disabled=1" "$N"
|
||||
fi
|
||||
|
||||
|
||||
append base_cfg "he_default_pe_duration=4" "$N"
|
||||
append base_cfg "he_rts_threshold=1023" "$N"
|
||||
@ -569,15 +581,77 @@ mac80211_generate_mac() {
|
||||
$(( (0x$6 + $id) % 0x100 ))
|
||||
}
|
||||
|
||||
get_board_phy_name() (
|
||||
local path="$1"
|
||||
local fallback_phy=""
|
||||
|
||||
__check_phy() {
|
||||
local val="$1"
|
||||
local key="$2"
|
||||
local ref_path="$3"
|
||||
|
||||
json_select "$key"
|
||||
json_get_values path
|
||||
json_select ..
|
||||
|
||||
[ "${ref_path%+*}" = "$path" ] && fallback_phy=$key
|
||||
[ "$ref_path" = "$path" ] || return 0
|
||||
|
||||
echo "$key"
|
||||
exit
|
||||
}
|
||||
|
||||
json_load_file /etc/board.json
|
||||
json_for_each_item __check_phy wlan "$path"
|
||||
[ -n "$fallback_phy" ] && echo "${fallback_phy}.${path##*+}"
|
||||
)
|
||||
|
||||
rename_board_phy_by_path() {
|
||||
local path="$1"
|
||||
|
||||
local new_phy="$(get_board_phy_name "$path")"
|
||||
[ -z "$new_phy" -o "$new_phy" = "$phy" ] && return
|
||||
|
||||
iw "$phy" set name "$new_phy" && phy="$new_phy"
|
||||
}
|
||||
|
||||
rename_board_phy_by_name() (
|
||||
local phy="$1"
|
||||
local suffix="${phy##*.}"
|
||||
[ "$suffix" = "$phy" ] && suffix=
|
||||
|
||||
json_load_file /etc/board.json
|
||||
json_select wlan
|
||||
json_select "${phy%.*}" || return 0
|
||||
json_get_values path
|
||||
|
||||
prev_phy="$(iwinfo nl80211 phyname "path=$path${suffix:++$suffix}")"
|
||||
[ -n "$prev_phy" ] || return 0
|
||||
|
||||
[ "$prev_phy" = "$phy" ] && return 0
|
||||
|
||||
iw "$prev_phy" set name "$phy"
|
||||
)
|
||||
|
||||
find_phy() {
|
||||
[ -n "$phy" -a -d /sys/class/ieee80211/$phy ] && return 0
|
||||
[ -n "$phy" ] && {
|
||||
rename_board_phy_by_name "$phy"
|
||||
[ -d /sys/class/ieee80211/$phy ] && return 0
|
||||
}
|
||||
[ -n "$path" ] && {
|
||||
phy="$(iwinfo nl80211 phyname "path=$path")"
|
||||
[ -n "$phy" ] && return 0
|
||||
[ -n "$phy" ] && {
|
||||
rename_board_phy_by_path "$path"
|
||||
return 0
|
||||
}
|
||||
}
|
||||
[ -n "$macaddr" ] && {
|
||||
for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
|
||||
grep -i -q "$macaddr" "/sys/class/ieee80211/${phy}/macaddress" && return 0
|
||||
grep -i -q "$macaddr" "/sys/class/ieee80211/${phy}/macaddress" && {
|
||||
path="$(iwinfo nl80211 path "$phy")"
|
||||
rename_board_phy_by_path "$path"
|
||||
return 0
|
||||
}
|
||||
done
|
||||
}
|
||||
return 1
|
||||
@ -655,13 +729,28 @@ mac80211_iw_interface_add() {
|
||||
return $rc
|
||||
}
|
||||
|
||||
mac80211_set_ifname() {
|
||||
local phy="$1"
|
||||
local prefix="$2"
|
||||
eval "ifname=\"$phy-$prefix\${idx_$prefix:-0}\"; idx_$prefix=\$((\${idx_$prefix:-0 } + 1))"
|
||||
}
|
||||
|
||||
mac80211_prepare_vif() {
|
||||
json_select config
|
||||
|
||||
json_get_vars ifname mode ssid wds powersave macaddr enable wpa_psk_file vlan_file
|
||||
|
||||
[ -n "$ifname" ] || ifname="wlan${phy#phy}${if_idx:+-$if_idx}"
|
||||
if_idx=$((${if_idx:-0} + 1))
|
||||
[ -n "$ifname" ] || {
|
||||
local prefix;
|
||||
|
||||
case "$mode" in
|
||||
ap|sta|mesh) prefix=$mode;;
|
||||
adhoc) prefix=ibss;;
|
||||
monitor) prefix=mon;;
|
||||
esac
|
||||
|
||||
mac80211_set_ifname "$phy" "$prefix"
|
||||
}
|
||||
|
||||
set_default wds 0
|
||||
set_default powersave 0
|
||||
|
||||
@ -2,60 +2,48 @@
|
||||
|
||||
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() {
|
||||
check_mac80211_device() {
|
||||
local device="$1"
|
||||
local path="$2"
|
||||
local macaddr="$3"
|
||||
|
||||
[ -n "$found" ] && return 0
|
||||
|
||||
phy_path=
|
||||
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
|
||||
json_select wlan
|
||||
[ -n "$phy" ] && case "$phy" in
|
||||
phy*)
|
||||
[ -d /sys/class/ieee80211/$phy ] && \
|
||||
phy_path="$(iwinfo nl80211 path "$dev")"
|
||||
;;
|
||||
*)
|
||||
if json_is_a "$phy" object; then
|
||||
json_select "$phy"
|
||||
json_get_var phy_path path
|
||||
json_select ..
|
||||
elif json_is_a "${phy%.*}" object; then
|
||||
json_select "${phy%.*}"
|
||||
json_get_var phy_path path
|
||||
json_select ..
|
||||
phy_path="$phy_path+${phy##*.}"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
json_select ..
|
||||
[ -n "$phy_path" ] || config_get phy_path "$device" path
|
||||
[ -n "$path" -a "$phy_path" = "$path" ] && {
|
||||
found=1
|
||||
return 0
|
||||
}
|
||||
config_set "$device" phy "$phy"
|
||||
|
||||
config_get macaddr "$device" macaddr
|
||||
[ -z "$macaddr" ] && {
|
||||
config_set "$device" macaddr "$(cat /sys/class/ieee80211/${phy}/macaddress)"
|
||||
}
|
||||
config_get dev_macaddr "$device" macaddr
|
||||
|
||||
[ -n "$macaddr" -a "$dev_macaddr" = "$macaddr" ] && found=1
|
||||
|
||||
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"
|
||||
@ -135,24 +123,41 @@ get_band_defaults() {
|
||||
done
|
||||
}
|
||||
|
||||
check_devidx() {
|
||||
case "$1" in
|
||||
radio[0-9]*)
|
||||
local idx="${1#radio}"
|
||||
[ "$devidx" -ge "${1#radio}" ] && devidx=$((idx + 1))
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
check_board_phy() {
|
||||
local name="$2"
|
||||
|
||||
json_select "$name"
|
||||
json_get_var phy_path path
|
||||
json_select ..
|
||||
|
||||
if [ "$path" = "$phy_path" ]; then
|
||||
board_dev="$name"
|
||||
elif [ "${path%+*}" = "$phy_path" ]; then
|
||||
fallback_board_dev="$name.${path#*+}"
|
||||
fi
|
||||
}
|
||||
|
||||
detect_mac80211() {
|
||||
devidx=0
|
||||
config_load wireless
|
||||
while :; do
|
||||
config_get type "radio$devidx" type
|
||||
[ -n "$type" ] || break
|
||||
devidx=$(($devidx + 1))
|
||||
done
|
||||
config_foreach check_devidx wifi-device
|
||||
|
||||
json_load_file /etc/board.json
|
||||
|
||||
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=""
|
||||
@ -161,32 +166,50 @@ detect_mac80211() {
|
||||
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
|
||||
macaddr="$(cat /sys/class/ieee80211/${dev}/macaddress)"
|
||||
board_dev=
|
||||
fallback_board_dev=
|
||||
json_for_each_item check_board_phy wlan
|
||||
[ -n "$board_dev" ] || board_dev="$fallback_board_dev"
|
||||
[ -n "$board_dev" ] && dev="$board_dev"
|
||||
|
||||
found=
|
||||
config_foreach check_mac80211_device wifi-device "$path" "$macaddr"
|
||||
[ -n "$found" ] && continue
|
||||
|
||||
name="radio${devidx}"
|
||||
devidx=$(($devidx + 1))
|
||||
case "$dev" in
|
||||
phy*)
|
||||
if [ -n "$path" ]; then
|
||||
dev_id="set wireless.${name}.path='$path'"
|
||||
else
|
||||
dev_id="set wireless.${name}.macaddr='$macaddr'"
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
dev_id="set wireless.${name}.phy='$dev'"
|
||||
;;
|
||||
esac
|
||||
|
||||
uci -q batch <<-EOF
|
||||
set wireless.radio${devidx}=wifi-device
|
||||
set wireless.radio${devidx}.type=mac80211
|
||||
set wireless.${name}=wifi-device
|
||||
set wireless.${name}.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}.country=US
|
||||
set wireless.radio${devidx}.disabled=0
|
||||
< set wireless.${name}.channel=${channel}
|
||||
set wireless.${name}.band=${mode_band}
|
||||
set wireless.${name}.htmode=$htmode
|
||||
set wireless.${name}.country=US
|
||||
set wireless.${name}.disabled=0
|
||||
|
||||
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
|
||||
set wireless.default_radio${devidx}.iw_qos_map_set=none
|
||||
set wireless.default_${name}=wifi-iface
|
||||
set wireless.default_${name}.device=${name}
|
||||
set wireless.default_${name}.network=lan
|
||||
set wireless.default_${name}.mode=ap
|
||||
set wireless.default_${name}.ssid=OpenWrt
|
||||
set wireless.default_${name}.encryption=none
|
||||
set wireless.default_${name}.iw_qos_map_set=none
|
||||
EOF
|
||||
uci -q commit wireless
|
||||
|
||||
devidx=$(($devidx + 1))
|
||||
done
|
||||
}
|
||||
|
||||
@ -0,0 +1,110 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Mon, 20 Sep 2021 15:40:07 +0200
|
||||
Subject: [PATCH] mac80211: mesh: clean up rx_bcn_presp API
|
||||
|
||||
commit a5b983c6073140b624f64e79fea6d33c3e4315a0 upstream.
|
||||
|
||||
We currently pass the entire elements to the rx_bcn_presp()
|
||||
method, but only need mesh_config. Additionally, we use the
|
||||
length of the elements to calculate back the entire frame's
|
||||
length, but that's confusing - just pass the length of the
|
||||
frame instead.
|
||||
|
||||
Link: https://lore.kernel.org/r/20210920154009.a18ed3d2da6c.I1824b773a0fbae4453e1433c184678ca14e8df45@changeid
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -645,10 +645,9 @@ struct ieee80211_if_ocb {
|
||||
*/
|
||||
struct ieee802_11_elems;
|
||||
struct ieee80211_mesh_sync_ops {
|
||||
- void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata,
|
||||
- u16 stype,
|
||||
- struct ieee80211_mgmt *mgmt,
|
||||
- struct ieee802_11_elems *elems,
|
||||
+ void (*rx_bcn_presp)(struct ieee80211_sub_if_data *sdata, u16 stype,
|
||||
+ struct ieee80211_mgmt *mgmt, unsigned int len,
|
||||
+ const struct ieee80211_meshconf_ie *mesh_cfg,
|
||||
struct ieee80211_rx_status *rx_status);
|
||||
|
||||
/* should be called with beacon_data under RCU read lock */
|
||||
--- a/net/mac80211/mesh.c
|
||||
+++ b/net/mac80211/mesh.c
|
||||
@@ -1354,8 +1354,8 @@ static void ieee80211_mesh_rx_bcn_presp(
|
||||
}
|
||||
|
||||
if (ifmsh->sync_ops)
|
||||
- ifmsh->sync_ops->rx_bcn_presp(sdata,
|
||||
- stype, mgmt, &elems, rx_status);
|
||||
+ ifmsh->sync_ops->rx_bcn_presp(sdata, stype, mgmt, len,
|
||||
+ elems.mesh_config, rx_status);
|
||||
}
|
||||
|
||||
int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata)
|
||||
--- a/net/mac80211/mesh_sync.c
|
||||
+++ b/net/mac80211/mesh_sync.c
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright 2011-2012, Pavel Zubarev <pavel.zubarev@gmail.com>
|
||||
* Copyright 2011-2012, Marco Porsch <marco.porsch@s2005.tu-chemnitz.de>
|
||||
* Copyright 2011-2012, cozybit Inc.
|
||||
+ * Copyright (C) 2021 Intel Corporation
|
||||
*/
|
||||
|
||||
#include "ieee80211_i.h"
|
||||
@@ -35,12 +36,12 @@ struct sync_method {
|
||||
/**
|
||||
* mesh_peer_tbtt_adjusting - check if an mp is currently adjusting its TBTT
|
||||
*
|
||||
- * @ie: information elements of a management frame from the mesh peer
|
||||
+ * @cfg: mesh config element from the mesh peer (or %NULL)
|
||||
*/
|
||||
-static bool mesh_peer_tbtt_adjusting(struct ieee802_11_elems *ie)
|
||||
+static bool mesh_peer_tbtt_adjusting(const struct ieee80211_meshconf_ie *cfg)
|
||||
{
|
||||
- return (ie->mesh_config->meshconf_cap &
|
||||
- IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING) != 0;
|
||||
+ return cfg &&
|
||||
+ (cfg->meshconf_cap & IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING);
|
||||
}
|
||||
|
||||
void mesh_sync_adjust_tsf(struct ieee80211_sub_if_data *sdata)
|
||||
@@ -76,11 +77,11 @@ void mesh_sync_adjust_tsf(struct ieee802
|
||||
}
|
||||
}
|
||||
|
||||
-static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
|
||||
- u16 stype,
|
||||
- struct ieee80211_mgmt *mgmt,
|
||||
- struct ieee802_11_elems *elems,
|
||||
- struct ieee80211_rx_status *rx_status)
|
||||
+static void
|
||||
+mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, u16 stype,
|
||||
+ struct ieee80211_mgmt *mgmt, unsigned int len,
|
||||
+ const struct ieee80211_meshconf_ie *mesh_cfg,
|
||||
+ struct ieee80211_rx_status *rx_status)
|
||||
{
|
||||
struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
@@ -101,10 +102,7 @@ static void mesh_sync_offset_rx_bcn_pres
|
||||
*/
|
||||
if (ieee80211_have_rx_timestamp(rx_status))
|
||||
t_r = ieee80211_calculate_rx_timestamp(local, rx_status,
|
||||
- 24 + 12 +
|
||||
- elems->total_len +
|
||||
- FCS_LEN,
|
||||
- 24);
|
||||
+ len + FCS_LEN, 24);
|
||||
else
|
||||
t_r = drv_get_tsf(local, sdata);
|
||||
|
||||
@@ -119,7 +117,7 @@ static void mesh_sync_offset_rx_bcn_pres
|
||||
* dot11MeshNbrOffsetMaxNeighbor non-peer non-MBSS neighbors
|
||||
*/
|
||||
|
||||
- if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) {
|
||||
+ if (mesh_peer_tbtt_adjusting(mesh_cfg)) {
|
||||
msync_dbg(sdata, "STA %pM : is adjusting TBTT\n",
|
||||
sta->sta.addr);
|
||||
goto no_sync;
|
||||
@ -0,0 +1,82 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Mon, 20 Sep 2021 15:40:08 +0200
|
||||
Subject: [PATCH] mac80211: move CRC into struct ieee802_11_elems
|
||||
|
||||
commit c6e37ed498f958254b5459253199e816b6bfc52f upstream.
|
||||
|
||||
We're currently returning this value, but to prepare for
|
||||
returning the allocated structure, move it into there.
|
||||
|
||||
Link: https://lore.kernel.org/r/20210920154009.479b8ebf999d.If0d4ba75ee38998dc3eeae25058aa748efcb2fc9@changeid
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1530,6 +1530,7 @@ struct ieee80211_csa_ie {
|
||||
struct ieee802_11_elems {
|
||||
const u8 *ie_start;
|
||||
size_t total_len;
|
||||
+ u32 crc;
|
||||
|
||||
/* pointers to IEs */
|
||||
const struct ieee80211_tdls_lnkie *lnk_id;
|
||||
@@ -2089,10 +2090,10 @@ static inline void ieee80211_tx_skb(stru
|
||||
ieee80211_tx_skb_tid(sdata, skb, 7);
|
||||
}
|
||||
|
||||
-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,
|
||||
- u8 *bss_bssid);
|
||||
+void 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,
|
||||
+ u8 *bss_bssid);
|
||||
static inline void ieee802_11_parse_elems(const u8 *start, size_t len,
|
||||
bool action,
|
||||
struct ieee802_11_elems *elems,
|
||||
--- a/net/mac80211/mlme.c
|
||||
+++ b/net/mac80211/mlme.c
|
||||
@@ -4102,10 +4102,11 @@ static void ieee80211_rx_mgmt_beacon(str
|
||||
*/
|
||||
if (!ieee80211_is_s1g_beacon(hdr->frame_control))
|
||||
ncrc = crc32_be(0, (void *)&mgmt->u.beacon.beacon_int, 4);
|
||||
- ncrc = ieee802_11_parse_elems_crc(variable,
|
||||
- len - baselen, false, &elems,
|
||||
- care_about_ies, ncrc,
|
||||
- mgmt->bssid, bssid);
|
||||
+ ieee802_11_parse_elems_crc(variable,
|
||||
+ len - baselen, false, &elems,
|
||||
+ care_about_ies, ncrc,
|
||||
+ mgmt->bssid, bssid);
|
||||
+ ncrc = elems.crc;
|
||||
|
||||
if (ieee80211_hw_check(&local->hw, PS_NULLFUNC_STACK) &&
|
||||
ieee80211_check_tim(elems.tim, elems.tim_len, bss_conf->aid)) {
|
||||
--- a/net/mac80211/util.c
|
||||
+++ b/net/mac80211/util.c
|
||||
@@ -1469,10 +1469,10 @@ static size_t ieee802_11_find_bssid_prof
|
||||
return found ? profile_len : 0;
|
||||
}
|
||||
|
||||
-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,
|
||||
- u8 *bss_bssid)
|
||||
+void 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,
|
||||
+ u8 *bss_bssid)
|
||||
{
|
||||
const struct element *non_inherit = NULL;
|
||||
u8 *nontransmitted_profile;
|
||||
@@ -1524,7 +1524,7 @@ u32 ieee802_11_parse_elems_crc(const u8
|
||||
|
||||
kfree(nontransmitted_profile);
|
||||
|
||||
- return crc;
|
||||
+ elems->crc = crc;
|
||||
}
|
||||
|
||||
void ieee80211_regulatory_limit_wmm_params(struct ieee80211_sub_if_data *sdata,
|
||||
@ -0,0 +1,80 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Mon, 20 Sep 2021 15:40:09 +0200
|
||||
Subject: [PATCH] mac80211: mlme: find auth challenge directly
|
||||
|
||||
commit 49a765d6785e99157ff5091cc37485732496864e upstream.
|
||||
|
||||
There's no need to parse all elements etc. just to find the
|
||||
authentication challenge - use cfg80211_find_elem() instead.
|
||||
This also allows us to remove WLAN_EID_CHALLENGE handling
|
||||
from the element parsing entirely.
|
||||
|
||||
Link: https://lore.kernel.org/r/20210920154009.45f9b3a15722.Ice3159ffad03a007d6154cbf1fb3a8c48489e86f@changeid
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1540,7 +1540,6 @@ struct ieee802_11_elems {
|
||||
const u8 *supp_rates;
|
||||
const u8 *ds_params;
|
||||
const struct ieee80211_tim_ie *tim;
|
||||
- const u8 *challenge;
|
||||
const u8 *rsn;
|
||||
const u8 *rsnx;
|
||||
const u8 *erp_info;
|
||||
@@ -1594,7 +1593,6 @@ struct ieee802_11_elems {
|
||||
u8 ssid_len;
|
||||
u8 supp_rates_len;
|
||||
u8 tim_len;
|
||||
- u8 challenge_len;
|
||||
u8 rsn_len;
|
||||
u8 rsnx_len;
|
||||
u8 ext_supp_rates_len;
|
||||
--- a/net/mac80211/mlme.c
|
||||
+++ b/net/mac80211/mlme.c
|
||||
@@ -2889,17 +2889,17 @@ static void ieee80211_auth_challenge(str
|
||||
{
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct ieee80211_mgd_auth_data *auth_data = sdata->u.mgd.auth_data;
|
||||
+ const struct element *challenge;
|
||||
u8 *pos;
|
||||
- struct ieee802_11_elems elems;
|
||||
u32 tx_flags = 0;
|
||||
struct ieee80211_prep_tx_info info = {
|
||||
.subtype = IEEE80211_STYPE_AUTH,
|
||||
};
|
||||
|
||||
pos = mgmt->u.auth.variable;
|
||||
- ieee802_11_parse_elems(pos, len - (pos - (u8 *)mgmt), false, &elems,
|
||||
- mgmt->bssid, auth_data->bss->bssid);
|
||||
- if (!elems.challenge)
|
||||
+ challenge = cfg80211_find_elem(WLAN_EID_CHALLENGE, pos,
|
||||
+ len - (pos - (u8 *)mgmt));
|
||||
+ if (!challenge)
|
||||
return;
|
||||
auth_data->expected_transaction = 4;
|
||||
drv_mgd_prepare_tx(sdata->local, sdata, &info);
|
||||
@@ -2907,7 +2907,8 @@ static void ieee80211_auth_challenge(str
|
||||
tx_flags = IEEE80211_TX_CTL_REQ_TX_STATUS |
|
||||
IEEE80211_TX_INTFL_MLME_CONN_TX;
|
||||
ieee80211_send_auth(sdata, 3, auth_data->algorithm, 0,
|
||||
- elems.challenge - 2, elems.challenge_len + 2,
|
||||
+ (void *)challenge,
|
||||
+ challenge->datalen + sizeof(*challenge),
|
||||
auth_data->bss->bssid, auth_data->bss->bssid,
|
||||
auth_data->key, auth_data->key_len,
|
||||
auth_data->key_idx, tx_flags);
|
||||
--- a/net/mac80211/util.c
|
||||
+++ b/net/mac80211/util.c
|
||||
@@ -1120,10 +1120,6 @@ _ieee802_11_parse_elems_crc(const u8 *st
|
||||
} else
|
||||
elem_parse_failed = true;
|
||||
break;
|
||||
- case WLAN_EID_CHALLENGE:
|
||||
- elems->challenge = pos;
|
||||
- elems->challenge_len = elen;
|
||||
- break;
|
||||
case WLAN_EID_VENDOR_SPECIFIC:
|
||||
if (elen >= 4 && pos[0] == 0x00 && pos[1] == 0x50 &&
|
||||
pos[2] == 0xf2) {
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,115 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Fri, 1 Oct 2021 21:11:08 +0200
|
||||
Subject: [PATCH] mac80211: fix memory leaks with element parsing
|
||||
|
||||
commit 8223ac199a3849257e86ec27865dc63f034b1cf1 upstream.
|
||||
|
||||
My previous commit 5d24828d05f3 ("mac80211: always allocate
|
||||
struct ieee802_11_elems") had a few bugs and leaked the new
|
||||
allocated struct in a few error cases, fix that.
|
||||
|
||||
Fixes: 5d24828d05f3 ("mac80211: always allocate struct ieee802_11_elems")
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
Link: https://lore.kernel.org/r/20211001211108.9839928e42e0.Ib81ca187d3d3af7ed1bfeac2e00d08a4637c8025@changeid
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/agg-rx.c
|
||||
+++ b/net/mac80211/agg-rx.c
|
||||
@@ -499,13 +499,14 @@ void ieee80211_process_addba_request(str
|
||||
elems = ieee802_11_parse_elems(mgmt->u.action.u.addba_req.variable,
|
||||
ies_len, true, mgmt->bssid, NULL);
|
||||
if (!elems || elems->parse_error)
|
||||
- return;
|
||||
+ goto free;
|
||||
}
|
||||
|
||||
__ieee80211_start_rx_ba_session(sta, dialog_token, timeout,
|
||||
start_seq_num, ba_policy, tid,
|
||||
buf_size, true, false,
|
||||
elems ? elems->addba_ext_ie : NULL);
|
||||
+free:
|
||||
kfree(elems);
|
||||
}
|
||||
|
||||
--- a/net/mac80211/ibss.c
|
||||
+++ b/net/mac80211/ibss.c
|
||||
@@ -1659,11 +1659,11 @@ void ieee80211_ibss_rx_queued_mgmt(struc
|
||||
mgmt->u.action.u.chan_switch.variable,
|
||||
ies_len, true, mgmt->bssid, NULL);
|
||||
|
||||
- if (!elems || elems->parse_error)
|
||||
- break;
|
||||
-
|
||||
- ieee80211_rx_mgmt_spectrum_mgmt(sdata, mgmt, skb->len,
|
||||
- rx_status, elems);
|
||||
+ if (elems && !elems->parse_error)
|
||||
+ ieee80211_rx_mgmt_spectrum_mgmt(sdata, mgmt,
|
||||
+ skb->len,
|
||||
+ rx_status,
|
||||
+ elems);
|
||||
kfree(elems);
|
||||
break;
|
||||
}
|
||||
--- a/net/mac80211/mlme.c
|
||||
+++ b/net/mac80211/mlme.c
|
||||
@@ -3374,8 +3374,10 @@ static bool ieee80211_assoc_success(stru
|
||||
bss_ies = kmemdup(ies, sizeof(*ies) + ies->len,
|
||||
GFP_ATOMIC);
|
||||
rcu_read_unlock();
|
||||
- if (!bss_ies)
|
||||
- return false;
|
||||
+ if (!bss_ies) {
|
||||
+ ret = false;
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
bss_elems = ieee802_11_parse_elems(bss_ies->data, bss_ies->len,
|
||||
false, mgmt->bssid,
|
||||
@@ -4358,13 +4360,11 @@ void ieee80211_sta_rx_queued_mgmt(struct
|
||||
mgmt->u.action.u.chan_switch.variable,
|
||||
ies_len, true, mgmt->bssid, NULL);
|
||||
|
||||
- if (!elems || elems->parse_error)
|
||||
- break;
|
||||
-
|
||||
- ieee80211_sta_process_chanswitch(sdata,
|
||||
- rx_status->mactime,
|
||||
- rx_status->device_timestamp,
|
||||
- elems, false);
|
||||
+ if (elems && !elems->parse_error)
|
||||
+ ieee80211_sta_process_chanswitch(sdata,
|
||||
+ rx_status->mactime,
|
||||
+ rx_status->device_timestamp,
|
||||
+ elems, false);
|
||||
kfree(elems);
|
||||
} else if (mgmt->u.action.category == WLAN_CATEGORY_PUBLIC) {
|
||||
struct ieee802_11_elems *elems;
|
||||
@@ -4384,17 +4384,17 @@ void ieee80211_sta_rx_queued_mgmt(struct
|
||||
mgmt->u.action.u.ext_chan_switch.variable,
|
||||
ies_len, true, mgmt->bssid, NULL);
|
||||
|
||||
- if (!elems || elems->parse_error)
|
||||
- break;
|
||||
+ if (elems && !elems->parse_error) {
|
||||
+ /* for the handling code pretend it was an IE */
|
||||
+ elems->ext_chansw_ie =
|
||||
+ &mgmt->u.action.u.ext_chan_switch.data;
|
||||
+
|
||||
+ ieee80211_sta_process_chanswitch(sdata,
|
||||
+ rx_status->mactime,
|
||||
+ rx_status->device_timestamp,
|
||||
+ elems, false);
|
||||
+ }
|
||||
|
||||
- /* for the handling code pretend this was also an IE */
|
||||
- elems->ext_chansw_ie =
|
||||
- &mgmt->u.action.u.ext_chan_switch.data;
|
||||
-
|
||||
- ieee80211_sta_process_chanswitch(sdata,
|
||||
- rx_status->mactime,
|
||||
- rx_status->device_timestamp,
|
||||
- elems, false);
|
||||
kfree(elems);
|
||||
}
|
||||
break;
|
||||
@ -0,0 +1,41 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 28 Sep 2022 21:56:15 +0200
|
||||
Subject: [PATCH] wifi: cfg80211: fix u8 overflow in
|
||||
cfg80211_update_notlisted_nontrans()
|
||||
|
||||
commit aebe9f4639b13a1f4e9a6b42cdd2e38c617b442d upstream.
|
||||
|
||||
In the copy code of the elements, we do the following calculation
|
||||
to reach the end of the MBSSID element:
|
||||
|
||||
/* copy the IEs after MBSSID */
|
||||
cpy_len = mbssid[1] + 2;
|
||||
|
||||
This looks fine, however, cpy_len is a u8, the same as mbssid[1],
|
||||
so the addition of two can overflow. In this case the subsequent
|
||||
memcpy() will overflow the allocated buffer, since it copies 256
|
||||
bytes too much due to the way the allocation and memcpy() sizes
|
||||
are calculated.
|
||||
|
||||
Fix this by using size_t for the cpy_len variable.
|
||||
|
||||
This fixes CVE-2022-41674.
|
||||
|
||||
Reported-by: Soenke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Tested-by: Soenke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
|
||||
Reviewed-by: Kees Cook <keescook@chromium.org>
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/wireless/scan.c
|
||||
+++ b/net/wireless/scan.c
|
||||
@@ -2238,7 +2238,7 @@ cfg80211_update_notlisted_nontrans(struc
|
||||
size_t new_ie_len;
|
||||
struct cfg80211_bss_ies *new_ies;
|
||||
const struct cfg80211_bss_ies *old;
|
||||
- u8 cpy_len;
|
||||
+ size_t cpy_len;
|
||||
|
||||
lockdep_assert_held(&wiphy_to_rdev(wiphy)->bss_lock);
|
||||
|
||||
@ -0,0 +1,47 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 28 Sep 2022 22:01:37 +0200
|
||||
Subject: [PATCH] wifi: cfg80211/mac80211: reject bad MBSSID elements
|
||||
|
||||
commit 8f033d2becc24aa6bfd2a5c104407963560caabc upstream
|
||||
|
||||
Per spec, the maximum value for the MaxBSSID ('n') indicator is 8,
|
||||
and the minimum is 1 since a multiple BSSID set with just one BSSID
|
||||
doesn't make sense (the # of BSSIDs is limited by 2^n).
|
||||
|
||||
Limit this in the parsing in both cfg80211 and mac80211, rejecting
|
||||
any elements with an invalid value.
|
||||
|
||||
This fixes potentially bad shifts in the processing of these inside
|
||||
the cfg80211_gen_new_bssid() function later.
|
||||
|
||||
I found this during the investigation of CVE-2022-41674 fixed by the
|
||||
previous patch.
|
||||
|
||||
Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
|
||||
Fixes: 78ac51f81532 ("mac80211: support multi-bssid")
|
||||
Reviewed-by: Kees Cook <keescook@chromium.org>
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/util.c
|
||||
+++ b/net/mac80211/util.c
|
||||
@@ -1413,6 +1413,8 @@ static size_t ieee802_11_find_bssid_prof
|
||||
for_each_element_id(elem, WLAN_EID_MULTIPLE_BSSID, start, len) {
|
||||
if (elem->datalen < 2)
|
||||
continue;
|
||||
+ if (elem->data[0] < 1 || elem->data[0] > 8)
|
||||
+ continue;
|
||||
|
||||
for_each_element(sub, elem->data + 1, elem->datalen - 1) {
|
||||
u8 new_bssid[ETH_ALEN];
|
||||
--- a/net/wireless/scan.c
|
||||
+++ b/net/wireless/scan.c
|
||||
@@ -2103,6 +2103,8 @@ static void cfg80211_parse_mbssid_data(s
|
||||
for_each_element_id(elem, WLAN_EID_MULTIPLE_BSSID, ie, ielen) {
|
||||
if (elem->datalen < 4)
|
||||
continue;
|
||||
+ if (elem->data[0] < 1 || (int)elem->data[0] > 8)
|
||||
+ continue;
|
||||
for_each_element(sub, elem->data + 1, elem->datalen - 1) {
|
||||
u8 profile_len;
|
||||
|
||||
@ -0,0 +1,94 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 28 Sep 2022 22:07:15 +0200
|
||||
Subject: [PATCH] wifi: mac80211: fix MBSSID parsing use-after-free
|
||||
|
||||
commit ff05d4b45dd89b922578dac497dcabf57cf771c6
|
||||
|
||||
When we parse a multi-BSSID element, we might point some
|
||||
element pointers into the allocated nontransmitted_profile.
|
||||
However, we free this before returning, causing UAF when the
|
||||
relevant pointers in the parsed elements are accessed.
|
||||
|
||||
Fix this by not allocating the scratch buffer separately but
|
||||
as part of the returned structure instead, that way, there
|
||||
are no lifetime issues with it.
|
||||
|
||||
The scratch buffer introduction as part of the returned data
|
||||
here is taken from MLO feature work done by Ilan.
|
||||
|
||||
This fixes CVE-2022-42719.
|
||||
|
||||
Fixes: 5023b14cf4df ("mac80211: support profile split between elements")
|
||||
Co-developed-by: Ilan Peer <ilan.peer@intel.com>
|
||||
Signed-off-by: Ilan Peer <ilan.peer@intel.com>
|
||||
Reviewed-by: Kees Cook <keescook@chromium.org>
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1611,6 +1611,14 @@ struct ieee802_11_elems {
|
||||
|
||||
/* whether a parse error occurred while retrieving these elements */
|
||||
bool parse_error;
|
||||
+
|
||||
+ /*
|
||||
+ * scratch buffer that can be used for various element parsing related
|
||||
+ * tasks, e.g., element de-fragmentation etc.
|
||||
+ */
|
||||
+ size_t scratch_len;
|
||||
+ u8 *scratch_pos;
|
||||
+ u8 scratch[];
|
||||
};
|
||||
|
||||
static inline struct ieee80211_local *hw_to_local(
|
||||
--- a/net/mac80211/util.c
|
||||
+++ b/net/mac80211/util.c
|
||||
@@ -1478,24 +1478,25 @@ struct ieee802_11_elems *ieee802_11_pars
|
||||
u8 *nontransmitted_profile;
|
||||
int nontransmitted_profile_len = 0;
|
||||
|
||||
- elems = kzalloc(sizeof(*elems), GFP_ATOMIC);
|
||||
+ elems = kzalloc(sizeof(*elems) + len, GFP_ATOMIC);
|
||||
if (!elems)
|
||||
return NULL;
|
||||
elems->ie_start = start;
|
||||
elems->total_len = len;
|
||||
|
||||
- nontransmitted_profile = kmalloc(len, GFP_ATOMIC);
|
||||
- if (nontransmitted_profile) {
|
||||
- nontransmitted_profile_len =
|
||||
- ieee802_11_find_bssid_profile(start, len, elems,
|
||||
- transmitter_bssid,
|
||||
- bss_bssid,
|
||||
- nontransmitted_profile);
|
||||
- non_inherit =
|
||||
- cfg80211_find_ext_elem(WLAN_EID_EXT_NON_INHERITANCE,
|
||||
- nontransmitted_profile,
|
||||
- nontransmitted_profile_len);
|
||||
- }
|
||||
+ elems->scratch_len = len;
|
||||
+ elems->scratch_pos = elems->scratch;
|
||||
+
|
||||
+ nontransmitted_profile = elems->scratch_pos;
|
||||
+ nontransmitted_profile_len =
|
||||
+ ieee802_11_find_bssid_profile(start, len, elems,
|
||||
+ transmitter_bssid,
|
||||
+ bss_bssid,
|
||||
+ nontransmitted_profile);
|
||||
+ non_inherit =
|
||||
+ cfg80211_find_ext_elem(WLAN_EID_EXT_NON_INHERITANCE,
|
||||
+ nontransmitted_profile,
|
||||
+ nontransmitted_profile_len);
|
||||
|
||||
crc = _ieee802_11_parse_elems_crc(start, len, action, elems, filter,
|
||||
crc, non_inherit);
|
||||
@@ -1524,8 +1525,6 @@ struct ieee802_11_elems *ieee802_11_pars
|
||||
offsetofend(struct ieee80211_bssid_index, dtim_count))
|
||||
elems->dtim_count = elems->bssid_index->dtim_count;
|
||||
|
||||
- kfree(nontransmitted_profile);
|
||||
-
|
||||
elems->crc = crc;
|
||||
|
||||
return elems;
|
||||
@ -0,0 +1,41 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Thu, 29 Sep 2022 21:50:44 +0200
|
||||
Subject: [PATCH] wifi: cfg80211: ensure length byte is present before
|
||||
access
|
||||
|
||||
commit 567e14e39e8f8c6997a1378bc3be615afca86063 upstream.
|
||||
|
||||
When iterating the elements here, ensure the length byte is
|
||||
present before checking it to see if the entire element will
|
||||
fit into the buffer.
|
||||
|
||||
Longer term, we should rewrite this code using the type-safe
|
||||
element iteration macros that check all of this.
|
||||
|
||||
Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
|
||||
Reported-by: Soenke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/wireless/scan.c
|
||||
+++ b/net/wireless/scan.c
|
||||
@@ -304,7 +304,8 @@ static size_t cfg80211_gen_new_ie(const
|
||||
tmp_old = cfg80211_find_ie(WLAN_EID_SSID, ie, ielen);
|
||||
tmp_old = (tmp_old) ? tmp_old + tmp_old[1] + 2 : ie;
|
||||
|
||||
- while (tmp_old + tmp_old[1] + 2 - ie <= ielen) {
|
||||
+ while (tmp_old + 2 - ie <= ielen &&
|
||||
+ tmp_old + tmp_old[1] + 2 - ie <= ielen) {
|
||||
if (tmp_old[0] == 0) {
|
||||
tmp_old++;
|
||||
continue;
|
||||
@@ -364,7 +365,8 @@ static size_t cfg80211_gen_new_ie(const
|
||||
* copied to new ie, skip ssid, capability, bssid-index ie
|
||||
*/
|
||||
tmp_new = sub_copy;
|
||||
- while (tmp_new + tmp_new[1] + 2 - sub_copy <= subie_len) {
|
||||
+ while (tmp_new + 2 - sub_copy <= subie_len &&
|
||||
+ tmp_new + tmp_new[1] + 2 - sub_copy <= subie_len) {
|
||||
if (!(tmp_new[0] == WLAN_EID_NON_TX_BSSID_CAP ||
|
||||
tmp_new[0] == WLAN_EID_SSID)) {
|
||||
memcpy(pos, tmp_new, tmp_new[1] + 2);
|
||||
@ -0,0 +1,87 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Fri, 30 Sep 2022 23:44:23 +0200
|
||||
Subject: [PATCH] wifi: cfg80211: fix BSS refcounting bugs
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
commit 0b7808818cb9df6680f98996b8e9a439fa7bcc2f upstream.
|
||||
|
||||
There are multiple refcounting bugs related to multi-BSSID:
|
||||
- In bss_ref_get(), if the BSS has a hidden_beacon_bss, then
|
||||
the bss pointer is overwritten before checking for the
|
||||
transmitted BSS, which is clearly wrong. Fix this by using
|
||||
the bss_from_pub() macro.
|
||||
|
||||
- In cfg80211_bss_update() we copy the transmitted_bss pointer
|
||||
from tmp into new, but then if we release new, we'll unref
|
||||
it erroneously. We already set the pointer and ref it, but
|
||||
need to NULL it since it was copied from the tmp data.
|
||||
|
||||
- In cfg80211_inform_single_bss_data(), if adding to the non-
|
||||
transmitted list fails, we unlink the BSS and yet still we
|
||||
return it, but this results in returning an entry without
|
||||
a reference. We shouldn't return it anyway if it was broken
|
||||
enough to not get added there.
|
||||
|
||||
This fixes CVE-2022-42720.
|
||||
|
||||
Reported-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Tested-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Fixes: a3584f56de1c ("cfg80211: Properly track transmitting and non-transmitting BSS")
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/wireless/scan.c
|
||||
+++ b/net/wireless/scan.c
|
||||
@@ -143,18 +143,12 @@ static inline void bss_ref_get(struct cf
|
||||
lockdep_assert_held(&rdev->bss_lock);
|
||||
|
||||
bss->refcount++;
|
||||
- if (bss->pub.hidden_beacon_bss) {
|
||||
- bss = container_of(bss->pub.hidden_beacon_bss,
|
||||
- struct cfg80211_internal_bss,
|
||||
- pub);
|
||||
- bss->refcount++;
|
||||
- }
|
||||
- if (bss->pub.transmitted_bss) {
|
||||
- bss = container_of(bss->pub.transmitted_bss,
|
||||
- struct cfg80211_internal_bss,
|
||||
- pub);
|
||||
- bss->refcount++;
|
||||
- }
|
||||
+
|
||||
+ if (bss->pub.hidden_beacon_bss)
|
||||
+ bss_from_pub(bss->pub.hidden_beacon_bss)->refcount++;
|
||||
+
|
||||
+ if (bss->pub.transmitted_bss)
|
||||
+ bss_from_pub(bss->pub.transmitted_bss)->refcount++;
|
||||
}
|
||||
|
||||
static inline void bss_ref_put(struct cfg80211_registered_device *rdev,
|
||||
@@ -1743,6 +1737,8 @@ cfg80211_bss_update(struct cfg80211_regi
|
||||
new->refcount = 1;
|
||||
INIT_LIST_HEAD(&new->hidden_list);
|
||||
INIT_LIST_HEAD(&new->pub.nontrans_list);
|
||||
+ /* we'll set this later if it was non-NULL */
|
||||
+ new->pub.transmitted_bss = NULL;
|
||||
|
||||
if (rcu_access_pointer(tmp->pub.proberesp_ies)) {
|
||||
hidden = rb_find_bss(rdev, tmp, BSS_CMP_HIDE_ZLEN);
|
||||
@@ -1983,10 +1979,15 @@ cfg80211_inform_single_bss_data(struct w
|
||||
spin_lock_bh(&rdev->bss_lock);
|
||||
if (cfg80211_add_nontrans_list(non_tx_data->tx_bss,
|
||||
&res->pub)) {
|
||||
- if (__cfg80211_unlink_bss(rdev, res))
|
||||
+ if (__cfg80211_unlink_bss(rdev, res)) {
|
||||
rdev->bss_generation++;
|
||||
+ res = NULL;
|
||||
+ }
|
||||
}
|
||||
spin_unlock_bh(&rdev->bss_lock);
|
||||
+
|
||||
+ if (!res)
|
||||
+ return NULL;
|
||||
}
|
||||
|
||||
trace_cfg80211_return_bss(&res->pub);
|
||||
@ -0,0 +1,48 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Sat, 1 Oct 2022 00:01:44 +0200
|
||||
Subject: [PATCH] wifi: cfg80211: avoid nontransmitted BSS list
|
||||
corruption
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
commit bcca852027e5878aec911a347407ecc88d6fff7f upstream.
|
||||
|
||||
If a non-transmitted BSS shares enough information (both
|
||||
SSID and BSSID!) with another non-transmitted BSS of a
|
||||
different AP, then we can find and update it, and then
|
||||
try to add it to the non-transmitted BSS list. We do a
|
||||
search for it on the transmitted BSS, but if it's not
|
||||
there (but belongs to another transmitted BSS), the list
|
||||
gets corrupted.
|
||||
|
||||
Since this is an erroneous situation, simply fail the
|
||||
list insertion in this case and free the non-transmitted
|
||||
BSS.
|
||||
|
||||
This fixes CVE-2022-42721.
|
||||
|
||||
Reported-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Tested-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/wireless/scan.c
|
||||
+++ b/net/wireless/scan.c
|
||||
@@ -425,6 +425,15 @@ cfg80211_add_nontrans_list(struct cfg802
|
||||
|
||||
rcu_read_unlock();
|
||||
|
||||
+ /*
|
||||
+ * This is a bit weird - it's not on the list, but already on another
|
||||
+ * one! The only way that could happen is if there's some BSSID/SSID
|
||||
+ * shared by multiple APs in their multi-BSSID profiles, potentially
|
||||
+ * with hidden SSID mixed in ... ignore it.
|
||||
+ */
|
||||
+ if (!list_empty(&nontrans_bss->nontrans_list))
|
||||
+ return -EINVAL;
|
||||
+
|
||||
/* add to the list */
|
||||
list_add_tail(&nontrans_bss->nontrans_list, &trans_bss->nontrans_list);
|
||||
return 0;
|
||||
@ -0,0 +1,31 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 5 Oct 2022 15:10:09 +0200
|
||||
Subject: [PATCH] wifi: mac80211_hwsim: avoid mac80211 warning on bad
|
||||
rate
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
commit 1833b6f46d7e2830251a063935ab464256defe22 upstream.
|
||||
|
||||
If the tool on the other side (e.g. wmediumd) gets confused
|
||||
about the rate, we hit a warning in mac80211. Silence that
|
||||
by effectively duplicating the check here and dropping the
|
||||
frame silently (in mac80211 it's dropped with the warning).
|
||||
|
||||
Reported-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Tested-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/mac80211_hwsim.c
|
||||
+++ b/drivers/net/wireless/mac80211_hwsim.c
|
||||
@@ -3760,6 +3760,8 @@ static int hwsim_cloned_frame_received_n
|
||||
|
||||
rx_status.band = channel->band;
|
||||
rx_status.rate_idx = nla_get_u32(info->attrs[HWSIM_ATTR_RX_RATE]);
|
||||
+ if (rx_status.rate_idx >= data2->hw->wiphy->bands[rx_status.band]->n_bitrates)
|
||||
+ goto out;
|
||||
rx_status.signal = nla_get_u32(info->attrs[HWSIM_ATTR_SIGNAL]);
|
||||
|
||||
hdr = (void *)skb->data;
|
||||
@ -0,0 +1,52 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 5 Oct 2022 21:24:10 +0200
|
||||
Subject: [PATCH] wifi: mac80211: fix crash in beacon protection for
|
||||
P2P-device
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
commit b2d03cabe2b2e150ff5a381731ea0355459be09f upstream.
|
||||
|
||||
If beacon protection is active but the beacon cannot be
|
||||
decrypted or is otherwise malformed, we call the cfg80211
|
||||
API to report this to userspace, but that uses a netdev
|
||||
pointer, which isn't present for P2P-Device. Fix this to
|
||||
call it only conditionally to ensure cfg80211 won't crash
|
||||
in the case of P2P-Device.
|
||||
|
||||
This fixes CVE-2022-42722.
|
||||
|
||||
Reported-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Fixes: 9eaf183af741 ("mac80211: Report beacon protection failures to user space")
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/mac80211/rx.c
|
||||
+++ b/net/mac80211/rx.c
|
||||
@@ -1986,10 +1986,11 @@ ieee80211_rx_h_decrypt(struct ieee80211_
|
||||
|
||||
if (mmie_keyidx < NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS ||
|
||||
mmie_keyidx >= NUM_DEFAULT_KEYS + NUM_DEFAULT_MGMT_KEYS +
|
||||
- NUM_DEFAULT_BEACON_KEYS) {
|
||||
- cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,
|
||||
- skb->data,
|
||||
- skb->len);
|
||||
+ NUM_DEFAULT_BEACON_KEYS) {
|
||||
+ if (rx->sdata->dev)
|
||||
+ cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,
|
||||
+ skb->data,
|
||||
+ skb->len);
|
||||
return RX_DROP_MONITOR; /* unexpected BIP keyidx */
|
||||
}
|
||||
|
||||
@@ -2137,7 +2138,8 @@ ieee80211_rx_h_decrypt(struct ieee80211_
|
||||
/* either the frame has been decrypted or will be dropped */
|
||||
status->flag |= RX_FLAG_DECRYPTED;
|
||||
|
||||
- if (unlikely(ieee80211_is_beacon(fc) && result == RX_DROP_UNUSABLE))
|
||||
+ if (unlikely(ieee80211_is_beacon(fc) && result == RX_DROP_UNUSABLE &&
|
||||
+ rx->sdata->dev))
|
||||
cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev,
|
||||
skb->data, skb->len);
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 5 Oct 2022 23:11:43 +0200
|
||||
Subject: [PATCH] wifi: cfg80211: update hidden BSSes to avoid WARN_ON
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
commit c90b93b5b782891ebfda49d4e5da36632fefd5d1 upstream.
|
||||
|
||||
When updating beacon elements in a non-transmitted BSS,
|
||||
also update the hidden sub-entries to the same beacon
|
||||
elements, so that a future update through other paths
|
||||
won't trigger a WARN_ON().
|
||||
|
||||
The warning is triggered because the beacon elements in
|
||||
the hidden BSSes that are children of the BSS should
|
||||
always be the same as in the parent.
|
||||
|
||||
Reported-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Tested-by: Sönke Huster <shuster@seemoo.tu-darmstadt.de>
|
||||
Fixes: 0b8fb8235be8 ("cfg80211: Parsing of Multiple BSSID information in scanning")
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
|
||||
--- a/net/wireless/scan.c
|
||||
+++ b/net/wireless/scan.c
|
||||
@@ -1609,6 +1609,23 @@ struct cfg80211_non_tx_bss {
|
||||
u8 bssid_index;
|
||||
};
|
||||
|
||||
+static void cfg80211_update_hidden_bsses(struct cfg80211_internal_bss *known,
|
||||
+ const struct cfg80211_bss_ies *new_ies,
|
||||
+ const struct cfg80211_bss_ies *old_ies)
|
||||
+{
|
||||
+ struct cfg80211_internal_bss *bss;
|
||||
+
|
||||
+ /* Assign beacon IEs to all sub entries */
|
||||
+ list_for_each_entry(bss, &known->hidden_list, hidden_list) {
|
||||
+ const struct cfg80211_bss_ies *ies;
|
||||
+
|
||||
+ ies = rcu_access_pointer(bss->pub.beacon_ies);
|
||||
+ WARN_ON(ies != old_ies);
|
||||
+
|
||||
+ rcu_assign_pointer(bss->pub.beacon_ies, new_ies);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static bool
|
||||
cfg80211_update_known_bss(struct cfg80211_registered_device *rdev,
|
||||
struct cfg80211_internal_bss *known,
|
||||
@@ -1632,7 +1649,6 @@ cfg80211_update_known_bss(struct cfg8021
|
||||
kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);
|
||||
} else if (rcu_access_pointer(new->pub.beacon_ies)) {
|
||||
const struct cfg80211_bss_ies *old;
|
||||
- struct cfg80211_internal_bss *bss;
|
||||
|
||||
if (known->pub.hidden_beacon_bss &&
|
||||
!list_empty(&known->hidden_list)) {
|
||||
@@ -1660,16 +1676,7 @@ cfg80211_update_known_bss(struct cfg8021
|
||||
if (old == rcu_access_pointer(known->pub.ies))
|
||||
rcu_assign_pointer(known->pub.ies, new->pub.beacon_ies);
|
||||
|
||||
- /* Assign beacon IEs to all sub entries */
|
||||
- list_for_each_entry(bss, &known->hidden_list, hidden_list) {
|
||||
- const struct cfg80211_bss_ies *ies;
|
||||
-
|
||||
- ies = rcu_access_pointer(bss->pub.beacon_ies);
|
||||
- WARN_ON(ies != old);
|
||||
-
|
||||
- rcu_assign_pointer(bss->pub.beacon_ies,
|
||||
- new->pub.beacon_ies);
|
||||
- }
|
||||
+ cfg80211_update_hidden_bsses(known, new->pub.beacon_ies, old);
|
||||
|
||||
if (old)
|
||||
kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);
|
||||
@@ -2319,6 +2326,8 @@ cfg80211_update_notlisted_nontrans(struc
|
||||
} else {
|
||||
old = rcu_access_pointer(nontrans_bss->beacon_ies);
|
||||
rcu_assign_pointer(nontrans_bss->beacon_ies, new_ies);
|
||||
+ cfg80211_update_hidden_bsses(bss_from_pub(nontrans_bss),
|
||||
+ new_ies, old);
|
||||
rcu_assign_pointer(nontrans_bss->ies, new_ies);
|
||||
if (old)
|
||||
kfree_rcu((struct cfg80211_bss_ies *)old, rcu_head);
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
--- a/net/mac80211/scan.c
|
||||
+++ b/net/mac80211/scan.c
|
||||
@@ -461,16 +461,19 @@ static void __ieee80211_scan_completed(s
|
||||
@@ -465,16 +465,19 @@ static void __ieee80211_scan_completed(s
|
||||
scan_req = rcu_dereference_protected(local->scan_req,
|
||||
lockdep_is_held(&local->mtx));
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
|
||||
--- a/net/mac80211/rx.c
|
||||
+++ b/net/mac80211/rx.c
|
||||
@@ -3180,6 +3180,49 @@ static void ieee80211_process_sa_query_r
|
||||
@@ -3182,6 +3182,49 @@ static void ieee80211_process_sa_query_r
|
||||
ieee80211_tx_skb(sdata, skb);
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
static ieee80211_rx_result debug_noinline
|
||||
ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx)
|
||||
{
|
||||
@@ -3205,6 +3248,9 @@ ieee80211_rx_h_mgmt_check(struct ieee802
|
||||
@@ -3207,6 +3250,9 @@ ieee80211_rx_h_mgmt_check(struct ieee802
|
||||
!(rx->flags & IEEE80211_RX_BEACON_REPORTED)) {
|
||||
int sig = 0;
|
||||
|
||||
@ -0,0 +1,513 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sun, 9 Oct 2022 20:15:46 +0200
|
||||
Subject: [PATCH] mac80211: add support for restricting netdev features per vif
|
||||
|
||||
This can be used to selectively disable feature flags for checksum offload,
|
||||
scatter/gather or GSO by changing vif->netdev_features.
|
||||
Removing features from vif->netdev_features does not affect the netdev
|
||||
features themselves, but instead fixes up skbs in the tx path so that the
|
||||
offloads are not needed in the driver.
|
||||
|
||||
Aside from making it easier to deal with vif type based hardware limitations,
|
||||
this also makes it possible to optimize performance on hardware without native
|
||||
GSO support by declaring GSO support in hw->netdev_features and removing it
|
||||
from vif->netdev_features. This allows mac80211 to handle GSO segmentation
|
||||
after the sta lookup, but before itxq enqueue, thus reducing the number of
|
||||
unnecessary sta lookups, as well as some other per-packet processing.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/net/fq_impl.h
|
||||
+++ b/include/net/fq_impl.h
|
||||
@@ -200,6 +200,7 @@ static void fq_tin_enqueue(struct fq *fq
|
||||
fq_skb_free_t free_func)
|
||||
{
|
||||
struct fq_flow *flow;
|
||||
+ struct sk_buff *next;
|
||||
bool oom;
|
||||
|
||||
lockdep_assert_held(&fq->lock);
|
||||
@@ -214,11 +215,15 @@ static void fq_tin_enqueue(struct fq *fq
|
||||
}
|
||||
|
||||
flow->tin = tin;
|
||||
- flow->backlog += skb->len;
|
||||
- tin->backlog_bytes += skb->len;
|
||||
- tin->backlog_packets++;
|
||||
- fq->memory_usage += skb->truesize;
|
||||
- fq->backlog++;
|
||||
+ skb_list_walk_safe(skb, skb, next) {
|
||||
+ skb_mark_not_on_list(skb);
|
||||
+ flow->backlog += skb->len;
|
||||
+ tin->backlog_bytes += skb->len;
|
||||
+ tin->backlog_packets++;
|
||||
+ fq->memory_usage += skb->truesize;
|
||||
+ fq->backlog++;
|
||||
+ __skb_queue_tail(&flow->queue, skb);
|
||||
+ }
|
||||
|
||||
if (list_empty(&flow->flowchain)) {
|
||||
flow->deficit = fq->quantum;
|
||||
@@ -226,7 +231,6 @@ static void fq_tin_enqueue(struct fq *fq
|
||||
&tin->new_flows);
|
||||
}
|
||||
|
||||
- __skb_queue_tail(&flow->queue, skb);
|
||||
oom = (fq->memory_usage > fq->memory_limit);
|
||||
while (fq->backlog > fq->limit || oom) {
|
||||
flow = fq_find_fattest_flow(fq);
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -1685,6 +1685,10 @@ enum ieee80211_offload_flags {
|
||||
* write-protected by sdata_lock and local->mtx so holding either is fine
|
||||
* for read access.
|
||||
* @mu_mimo_owner: indicates interface owns MU-MIMO capability
|
||||
+ * @netdev_features: tx netdev features supported by the hardware for this
|
||||
+ * vif. mac80211 initializes this to hw->netdev_features, and the driver
|
||||
+ * can mask out specific tx features. mac80211 will handle software fixup
|
||||
+ * for masked offloads (GSO, CSUM)
|
||||
* @driver_flags: flags/capabilities the driver has for this interface,
|
||||
* these need to be set (or cleared) when the interface is added
|
||||
* or, if supported by the driver, the interface type is changed
|
||||
@@ -1736,6 +1740,7 @@ struct ieee80211_vif {
|
||||
|
||||
struct ieee80211_chanctx_conf __rcu *chanctx_conf;
|
||||
|
||||
+ netdev_features_t netdev_features;
|
||||
u32 driver_flags;
|
||||
u32 offload_flags;
|
||||
|
||||
--- a/net/mac80211/iface.c
|
||||
+++ b/net/mac80211/iface.c
|
||||
@@ -2209,6 +2209,7 @@ int ieee80211_if_add(struct ieee80211_lo
|
||||
ndev->features |= local->hw.netdev_features;
|
||||
ndev->hw_features |= ndev->features &
|
||||
MAC80211_SUPPORTED_FEATURES_TX;
|
||||
+ sdata->vif.netdev_features = local->hw.netdev_features;
|
||||
|
||||
netdev_set_default_ethtool_ops(ndev, &ieee80211_ethtool_ops);
|
||||
|
||||
--- a/net/mac80211/tx.c
|
||||
+++ b/net/mac80211/tx.c
|
||||
@@ -1310,7 +1310,11 @@ static struct txq_info *ieee80211_get_tx
|
||||
|
||||
static void ieee80211_set_skb_enqueue_time(struct sk_buff *skb)
|
||||
{
|
||||
- IEEE80211_SKB_CB(skb)->control.enqueue_time = codel_get_time();
|
||||
+ struct sk_buff *next;
|
||||
+ codel_time_t now = codel_get_time();
|
||||
+
|
||||
+ skb_list_walk_safe(skb, skb, next)
|
||||
+ IEEE80211_SKB_CB(skb)->control.enqueue_time = now;
|
||||
}
|
||||
|
||||
static u32 codel_skb_len_func(const struct sk_buff *skb)
|
||||
@@ -3499,47 +3503,71 @@ ieee80211_xmit_fast_finish(struct ieee80
|
||||
return TX_CONTINUE;
|
||||
}
|
||||
|
||||
-static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
|
||||
- struct sta_info *sta,
|
||||
- struct ieee80211_fast_tx *fast_tx,
|
||||
- struct sk_buff *skb)
|
||||
+static netdev_features_t
|
||||
+ieee80211_sdata_netdev_features(struct ieee80211_sub_if_data *sdata)
|
||||
{
|
||||
- struct ieee80211_local *local = sdata->local;
|
||||
- u16 ethertype = (skb->data[12] << 8) | skb->data[13];
|
||||
- int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
|
||||
- int hw_headroom = sdata->local->hw.extra_tx_headroom;
|
||||
- struct ethhdr eth;
|
||||
- struct ieee80211_tx_info *info;
|
||||
- struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
|
||||
- struct ieee80211_tx_data tx;
|
||||
- ieee80211_tx_result r;
|
||||
- struct tid_ampdu_tx *tid_tx = NULL;
|
||||
- u8 tid = IEEE80211_NUM_TIDS;
|
||||
+ if (sdata->vif.type != NL80211_IFTYPE_AP_VLAN)
|
||||
+ return sdata->vif.netdev_features;
|
||||
|
||||
- /* control port protocol needs a lot of special handling */
|
||||
- if (cpu_to_be16(ethertype) == sdata->control_port_protocol)
|
||||
- return false;
|
||||
+ if (!sdata->bss)
|
||||
+ return 0;
|
||||
|
||||
- /* only RFC 1042 SNAP */
|
||||
- if (ethertype < ETH_P_802_3_MIN)
|
||||
- return false;
|
||||
+ sdata = container_of(sdata->bss, struct ieee80211_sub_if_data, u.ap);
|
||||
+ return sdata->vif.netdev_features;
|
||||
+}
|
||||
|
||||
- /* don't handle TX status request here either */
|
||||
- if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
|
||||
- return false;
|
||||
+static struct sk_buff *
|
||||
+ieee80211_tx_skb_fixup(struct sk_buff *skb, netdev_features_t features)
|
||||
+{
|
||||
+ if (skb_is_gso(skb)) {
|
||||
+ struct sk_buff *segs;
|
||||
|
||||
- if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
|
||||
- tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
|
||||
- tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
|
||||
- if (tid_tx) {
|
||||
- if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state))
|
||||
- return false;
|
||||
- if (tid_tx->timeout)
|
||||
- tid_tx->last_tx = jiffies;
|
||||
- }
|
||||
+ segs = skb_gso_segment(skb, features);
|
||||
+ if (!segs)
|
||||
+ return skb;
|
||||
+ if (IS_ERR(segs))
|
||||
+ goto free;
|
||||
+
|
||||
+ consume_skb(skb);
|
||||
+ return segs;
|
||||
+ }
|
||||
+
|
||||
+ if (skb_needs_linearize(skb, features) && __skb_linearize(skb))
|
||||
+ goto free;
|
||||
+
|
||||
+ if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
+ int ofs = skb_checksum_start_offset(skb);
|
||||
+
|
||||
+ if (skb->encapsulation)
|
||||
+ skb_set_inner_transport_header(skb, ofs);
|
||||
+ else
|
||||
+ skb_set_transport_header(skb, ofs);
|
||||
+
|
||||
+ if (skb_csum_hwoffload_help(skb, features))
|
||||
+ goto free;
|
||||
}
|
||||
|
||||
- /* after this point (skb is modified) we cannot return false */
|
||||
+ skb_mark_not_on_list(skb);
|
||||
+ return skb;
|
||||
+
|
||||
+free:
|
||||
+ kfree_skb(skb);
|
||||
+ return NULL;
|
||||
+}
|
||||
+
|
||||
+static void __ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
|
||||
+ struct sta_info *sta,
|
||||
+ struct ieee80211_fast_tx *fast_tx,
|
||||
+ struct sk_buff *skb, u8 tid, bool ampdu)
|
||||
+{
|
||||
+ struct ieee80211_local *local = sdata->local;
|
||||
+ struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
|
||||
+ struct ieee80211_tx_info *info;
|
||||
+ struct ieee80211_tx_data tx;
|
||||
+ ieee80211_tx_result r;
|
||||
+ int hw_headroom = sdata->local->hw.extra_tx_headroom;
|
||||
+ int extra_head = fast_tx->hdr_len - (ETH_HLEN - 2);
|
||||
+ struct ethhdr eth;
|
||||
|
||||
if (skb_shared(skb)) {
|
||||
struct sk_buff *tmp_skb = skb;
|
||||
@@ -3548,12 +3576,12 @@ static bool ieee80211_xmit_fast(struct i
|
||||
kfree_skb(tmp_skb);
|
||||
|
||||
if (!skb)
|
||||
- return true;
|
||||
+ return;
|
||||
}
|
||||
|
||||
if ((hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) &&
|
||||
ieee80211_amsdu_aggregate(sdata, sta, fast_tx, skb))
|
||||
- return true;
|
||||
+ return;
|
||||
|
||||
/* will not be crypto-handled beyond what we do here, so use false
|
||||
* as the may-encrypt argument for the resize to not account for
|
||||
@@ -3562,10 +3590,8 @@ static bool ieee80211_xmit_fast(struct i
|
||||
if (unlikely(ieee80211_skb_resize(sdata, skb,
|
||||
max_t(int, extra_head + hw_headroom -
|
||||
skb_headroom(skb), 0),
|
||||
- ENCRYPT_NO))) {
|
||||
- kfree_skb(skb);
|
||||
- return true;
|
||||
- }
|
||||
+ ENCRYPT_NO)))
|
||||
+ goto free;
|
||||
|
||||
memcpy(ð, skb->data, ETH_HLEN - 2);
|
||||
hdr = skb_push(skb, extra_head);
|
||||
@@ -3579,7 +3605,7 @@ static bool ieee80211_xmit_fast(struct i
|
||||
info->control.vif = &sdata->vif;
|
||||
info->flags = IEEE80211_TX_CTL_FIRST_FRAGMENT |
|
||||
IEEE80211_TX_CTL_DONTFRAG |
|
||||
- (tid_tx ? IEEE80211_TX_CTL_AMPDU : 0);
|
||||
+ (ampdu ? IEEE80211_TX_CTL_AMPDU : 0);
|
||||
info->control.flags = IEEE80211_TX_CTRL_FAST_XMIT;
|
||||
|
||||
#ifdef CPTCFG_MAC80211_DEBUGFS
|
||||
@@ -3601,16 +3627,14 @@ static bool ieee80211_xmit_fast(struct i
|
||||
tx.key = fast_tx->key;
|
||||
|
||||
if (ieee80211_queue_skb(local, sdata, sta, skb))
|
||||
- return true;
|
||||
+ return;
|
||||
|
||||
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 (r == TX_DROP)
|
||||
+ goto free;
|
||||
|
||||
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
|
||||
sdata = container_of(sdata->bss,
|
||||
@@ -3618,6 +3642,55 @@ static bool ieee80211_xmit_fast(struct i
|
||||
|
||||
__skb_queue_tail(&tx.skbs, skb);
|
||||
ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false);
|
||||
+ return;
|
||||
+
|
||||
+free:
|
||||
+ kfree_skb(skb);
|
||||
+}
|
||||
+
|
||||
+static bool ieee80211_xmit_fast(struct ieee80211_sub_if_data *sdata,
|
||||
+ struct sta_info *sta,
|
||||
+ struct ieee80211_fast_tx *fast_tx,
|
||||
+ struct sk_buff *skb)
|
||||
+{
|
||||
+ u16 ethertype = (skb->data[12] << 8) | skb->data[13];
|
||||
+ struct ieee80211_hdr *hdr = (void *)fast_tx->hdr;
|
||||
+ struct tid_ampdu_tx *tid_tx = NULL;
|
||||
+ struct sk_buff *next;
|
||||
+ u8 tid = IEEE80211_NUM_TIDS;
|
||||
+
|
||||
+ /* control port protocol needs a lot of special handling */
|
||||
+ if (cpu_to_be16(ethertype) == sdata->control_port_protocol)
|
||||
+ return false;
|
||||
+
|
||||
+ /* only RFC 1042 SNAP */
|
||||
+ if (ethertype < ETH_P_802_3_MIN)
|
||||
+ return false;
|
||||
+
|
||||
+ /* don't handle TX status request here either */
|
||||
+ if (skb->sk && skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS)
|
||||
+ return false;
|
||||
+
|
||||
+ if (hdr->frame_control & cpu_to_le16(IEEE80211_STYPE_QOS_DATA)) {
|
||||
+ tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
|
||||
+ tid_tx = rcu_dereference(sta->ampdu_mlme.tid_tx[tid]);
|
||||
+ if (tid_tx) {
|
||||
+ if (!test_bit(HT_AGG_STATE_OPERATIONAL, &tid_tx->state))
|
||||
+ return false;
|
||||
+ if (tid_tx->timeout)
|
||||
+ tid_tx->last_tx = jiffies;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ skb = ieee80211_tx_skb_fixup(skb, ieee80211_sdata_netdev_features(sdata));
|
||||
+ if (!skb)
|
||||
+ return true;
|
||||
+
|
||||
+ skb_list_walk_safe(skb, skb, next) {
|
||||
+ skb_mark_not_on_list(skb);
|
||||
+ __ieee80211_xmit_fast(sdata, sta, fast_tx, skb, tid, tid_tx);
|
||||
+ }
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -4123,31 +4196,14 @@ void __ieee80211_subif_start_xmit(struct
|
||||
goto out;
|
||||
}
|
||||
|
||||
- if (skb_is_gso(skb)) {
|
||||
- struct sk_buff *segs;
|
||||
-
|
||||
- segs = skb_gso_segment(skb, 0);
|
||||
- if (IS_ERR(segs)) {
|
||||
- goto out_free;
|
||||
- } else if (segs) {
|
||||
- consume_skb(skb);
|
||||
- skb = segs;
|
||||
- }
|
||||
- } else {
|
||||
- /* we cannot process non-linear frames on this path */
|
||||
- if (skb_linearize(skb))
|
||||
- goto out_free;
|
||||
-
|
||||
- /* the frame could be fragmented, software-encrypted, and other
|
||||
- * things so we cannot really handle checksum offload with it -
|
||||
- * fix it up in software before we handle anything else.
|
||||
- */
|
||||
- if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
- skb_set_transport_header(skb,
|
||||
- skb_checksum_start_offset(skb));
|
||||
- if (skb_checksum_help(skb))
|
||||
- goto out_free;
|
||||
- }
|
||||
+ /* the frame could be fragmented, software-encrypted, and other
|
||||
+ * things so we cannot really handle checksum or GSO offload.
|
||||
+ * fix it up in software before we handle anything else.
|
||||
+ */
|
||||
+ skb = ieee80211_tx_skb_fixup(skb, 0);
|
||||
+ if (!skb) {
|
||||
+ len = 0;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
skb_list_walk_safe(skb, skb, next) {
|
||||
@@ -4310,9 +4366,11 @@ netdev_tx_t ieee80211_subif_start_xmit(s
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
-static bool ieee80211_tx_8023(struct ieee80211_sub_if_data *sdata,
|
||||
- struct sk_buff *skb, struct sta_info *sta,
|
||||
- bool txpending)
|
||||
+
|
||||
+
|
||||
+static bool __ieee80211_tx_8023(struct ieee80211_sub_if_data *sdata,
|
||||
+ struct sk_buff *skb, struct sta_info *sta,
|
||||
+ bool txpending)
|
||||
{
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct ieee80211_tx_control control = {};
|
||||
@@ -4321,14 +4379,6 @@ static bool ieee80211_tx_8023(struct iee
|
||||
unsigned long flags;
|
||||
int q = info->hw_queue;
|
||||
|
||||
- if (sta)
|
||||
- sk_pacing_shift_update(skb->sk, local->hw.tx_sk_pacing_shift);
|
||||
-
|
||||
- ieee80211_tpt_led_trig_tx(local, skb->len);
|
||||
-
|
||||
- if (ieee80211_queue_skb(local, sdata, sta, skb))
|
||||
- return true;
|
||||
-
|
||||
spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
|
||||
|
||||
if (local->queue_stop_reasons[q] ||
|
||||
@@ -4355,27 +4405,50 @@ static bool ieee80211_tx_8023(struct iee
|
||||
return true;
|
||||
}
|
||||
|
||||
+static bool ieee80211_tx_8023(struct ieee80211_sub_if_data *sdata,
|
||||
+ struct sk_buff *skb, struct sta_info *sta,
|
||||
+ bool txpending)
|
||||
+{
|
||||
+ struct ieee80211_local *local = sdata->local;
|
||||
+ struct sk_buff *next;
|
||||
+ bool ret = true;
|
||||
+
|
||||
+ if (ieee80211_queue_skb(local, sdata, sta, skb))
|
||||
+ return true;
|
||||
+
|
||||
+ skb_list_walk_safe(skb, skb, next) {
|
||||
+ skb_mark_not_on_list(skb);
|
||||
+ if (!__ieee80211_tx_8023(sdata, skb, sta, txpending))
|
||||
+ ret = false;
|
||||
+ }
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
|
||||
struct net_device *dev, struct sta_info *sta,
|
||||
struct ieee80211_key *key, struct sk_buff *skb)
|
||||
{
|
||||
- struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
|
||||
+ struct ieee80211_tx_info *info;
|
||||
struct ieee80211_local *local = sdata->local;
|
||||
struct tid_ampdu_tx *tid_tx;
|
||||
+ struct sk_buff *seg, *next;
|
||||
+ unsigned int skbs = 0, len = 0;
|
||||
+ u16 queue;
|
||||
u8 tid;
|
||||
|
||||
if (local->ops->wake_tx_queue) {
|
||||
- u16 queue = __ieee80211_select_queue(sdata, sta, skb);
|
||||
+ queue = __ieee80211_select_queue(sdata, sta, skb);
|
||||
skb_set_queue_mapping(skb, queue);
|
||||
skb_get_hash(skb);
|
||||
+ } else {
|
||||
+ queue = skb_get_queue_mapping(skb);
|
||||
}
|
||||
|
||||
if (unlikely(test_bit(SCAN_SW_SCANNING, &local->scanning)) &&
|
||||
test_bit(SDATA_STATE_OFFCHANNEL, &sdata->state))
|
||||
goto out_free;
|
||||
|
||||
- memset(info, 0, sizeof(*info));
|
||||
-
|
||||
ieee80211_aggr_check(sdata, sta, skb);
|
||||
|
||||
tid = skb->priority & IEEE80211_QOS_CTL_TAG1D_MASK;
|
||||
@@ -4387,22 +4460,20 @@ static void ieee80211_8023_xmit(struct i
|
||||
return;
|
||||
}
|
||||
|
||||
- info->flags |= IEEE80211_TX_CTL_AMPDU;
|
||||
if (tid_tx->timeout)
|
||||
tid_tx->last_tx = jiffies;
|
||||
}
|
||||
|
||||
- if (unlikely(skb->sk &&
|
||||
- skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
|
||||
- info->ack_frame_id = ieee80211_store_ack_skb(local, skb,
|
||||
- &info->flags, NULL);
|
||||
+ skb = ieee80211_tx_skb_fixup(skb, ieee80211_sdata_netdev_features(sdata));
|
||||
+ if (!skb)
|
||||
+ return;
|
||||
|
||||
- info->hw_queue = sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
|
||||
+ info = IEEE80211_SKB_CB(skb);
|
||||
+ memset(info, 0, sizeof(*info));
|
||||
+ if (tid_tx)
|
||||
+ info->flags |= IEEE80211_TX_CTL_AMPDU;
|
||||
|
||||
- dev_sw_netstats_tx_add(dev, 1, skb->len);
|
||||
-
|
||||
- sta->tx_stats.bytes[skb_get_queue_mapping(skb)] += skb->len;
|
||||
- sta->tx_stats.packets[skb_get_queue_mapping(skb)]++;
|
||||
+ info->hw_queue = sdata->vif.hw_queue[queue];
|
||||
|
||||
if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN)
|
||||
sdata = container_of(sdata->bss,
|
||||
@@ -4414,6 +4485,24 @@ static void ieee80211_8023_xmit(struct i
|
||||
if (key)
|
||||
info->control.hw_key = &key->conf;
|
||||
|
||||
+ skb_list_walk_safe(skb, seg, next) {
|
||||
+ skbs++;
|
||||
+ len += seg->len;
|
||||
+ if (seg != skb)
|
||||
+ memcpy(IEEE80211_SKB_CB(seg), info, sizeof(*info));
|
||||
+ }
|
||||
+
|
||||
+ if (unlikely(skb->sk &&
|
||||
+ skb_shinfo(skb)->tx_flags & SKBTX_WIFI_STATUS))
|
||||
+ info->ack_frame_id = ieee80211_store_ack_skb(local, skb,
|
||||
+ &info->flags, NULL);
|
||||
+
|
||||
+ dev_sw_netstats_tx_add(dev, skbs, len);
|
||||
+ sta->tx_stats.packets[queue] += skbs;
|
||||
+ sta->tx_stats.bytes[queue] += len;
|
||||
+
|
||||
+ ieee80211_tpt_led_trig_tx(local, len);
|
||||
+
|
||||
ieee80211_tx_8023(sdata, skb, sta, false);
|
||||
|
||||
return;
|
||||
@@ -4455,6 +4544,7 @@ netdev_tx_t ieee80211_subif_start_xmit_8
|
||||
key->conf.cipher == WLAN_CIPHER_SUITE_TKIP))
|
||||
goto skip_offload;
|
||||
|
||||
+ sk_pacing_shift_update(skb->sk, sdata->local->hw.tx_sk_pacing_shift);
|
||||
ieee80211_8023_xmit(sdata, dev, sta, key, skb);
|
||||
goto out;
|
||||
|
||||
@ -5,9 +5,9 @@ PKG_RELEASE=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/libubox.git
|
||||
PKG_MIRROR_HASH:=cf48d00ed0ea74d53f2043eb9f9dc52834c0b214f258201cf22dfff7dd6c6e40
|
||||
PKG_SOURCE_DATE:=2022-05-15
|
||||
PKG_SOURCE_VERSION:=d2223ef9da7172a84d1508733dc58840e1381e3c
|
||||
PKG_MIRROR_HASH:=400bef38b8c0f382e4e595a50bb52dfbdb8da820eb80f3447b9bd7be3f5499a5
|
||||
PKG_SOURCE_DATE:=2022-09-27
|
||||
PKG_SOURCE_VERSION:=ea56013409d5823001b47a9bba6f74055a6d76a5
|
||||
PKG_ABI_VERSION:=$(call abi_version_str,$(PKG_SOURCE_DATE))
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
|
||||
@ -2019,6 +2019,7 @@ void hostapd_ubus_notify_beacon_report(
|
||||
blobmsg_add_macaddr(&b, "bssid", rep->bssid);
|
||||
blobmsg_add_u16(&b, "antenna-id", rep->antenna_id);
|
||||
blobmsg_add_u16(&b, "parent-tsf", rep->parent_tsf);
|
||||
blobmsg_add_u16(&b, "rep-mode", rep_mode);
|
||||
|
||||
ubus_notify(ctx, &hapd->ubus.obj, "beacon-report", b.head, -1);
|
||||
}
|
||||
|
||||
@ -11,9 +11,9 @@ PKG_RELEASE:=1
|
||||
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_URL=$(PROJECT_GIT)/project/iwinfo.git
|
||||
PKG_SOURCE_DATE:=2022-09-22
|
||||
PKG_SOURCE_VERSION:=4a43b0d40ba50a21de1d47e7bf0f759be9cf646a
|
||||
PKG_MIRROR_HASH:=4df2c5ac8cb60e4df06a4ef9a87c3a5196f0a8739ee39e6a2587c15527612250
|
||||
PKG_SOURCE_DATE:=2022-10-14
|
||||
PKG_SOURCE_VERSION:=0496c722f1d798789d9280d9e357f87b920349eb
|
||||
PKG_MIRROR_HASH:=6dcbb79b3ebcad3f013a162ee1b18535a05afe9be9bf578cf62d9cf0b210f9df
|
||||
PKG_MAINTAINER:=Jo-Philipp Wich <jo@mein.io>
|
||||
PKG_LICENSE:=GPL-2.0
|
||||
|
||||
|
||||
1
target/linux/airoha/generic/target.mk
Normal file
1
target/linux/airoha/generic/target.mk
Normal file
@ -0,0 +1 @@
|
||||
BOARDNAME:=Generic
|
||||
@ -152,8 +152,6 @@ CONFIG_IIO_ST_SENSORS_I2C=y
|
||||
CONFIG_IIO_ST_SENSORS_SPI=y
|
||||
CONFIG_IIO_TRIGGER=y
|
||||
CONFIG_IIO_TRIGGERED_BUFFER=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
|
||||
@ -199,8 +199,6 @@ CONFIG_I2C=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
# CONFIG_I2C_BRCMSTB is not set
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
|
||||
@ -252,8 +252,6 @@ CONFIG_I2C=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
# CONFIG_I2C_BRCMSTB is not set
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
# CONFIG_INPUT_MOUSEDEV_PSAUX is not set
|
||||
|
||||
@ -249,8 +249,6 @@ CONFIG_I2C=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
# CONFIG_I2C_BRCMSTB is not set
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
|
||||
@ -256,8 +256,6 @@ CONFIG_I2C=y
|
||||
# CONFIG_I2C_BCM2708 is not set
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
# CONFIG_I2C_BRCMSTB is not set
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_MOUSEDEV=y
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
From e492f69e4da879db7b3e9a2290e5b6620f1335b5 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksey Nasibulin <alealexpro100@ya.ru>
|
||||
Date: Thu, 13 Oct 2022 08:16:51 +0000
|
||||
Subject: [PATCH] ARM: dts: BCM5301X: Extend RAM to full 256MB for Linksys
|
||||
EA6500 V2
|
||||
|
||||
Linksys ea6500-v2 have 256MB of ram. Currently we only use 128MB.
|
||||
Expand the definition to use all the available RAM.
|
||||
|
||||
Fixes: 03e96644d7a8 ("ARM: dts: BCM5301X: Add basic DT for Linksys EA6500 V2")
|
||||
Signed-off-by: Aleksey Nasibulin <alealexpro100@ya.ru>
|
||||
---
|
||||
arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts
|
||||
index f1412ba83def..0454423fe166 100644
|
||||
--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts
|
||||
+++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts
|
||||
@@ -19,7 +19,8 @@ chosen {
|
||||
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
- reg = <0x00000000 0x08000000>;
|
||||
+ reg = <0x00000000 0x08000000>,
|
||||
+ <0x88000000 0x08000000>;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@ -0,0 +1,32 @@
|
||||
From e492f69e4da879db7b3e9a2290e5b6620f1335b5 Mon Sep 17 00:00:00 2001
|
||||
From: Aleksey Nasibulin <alealexpro100@ya.ru>
|
||||
Date: Thu, 13 Oct 2022 08:16:51 +0000
|
||||
Subject: [PATCH] ARM: dts: BCM5301X: Extend RAM to full 256MB for Linksys
|
||||
EA6500 V2
|
||||
|
||||
Linksys ea6500-v2 have 256MB of ram. Currently we only use 128MB.
|
||||
Expand the definition to use all the available RAM.
|
||||
|
||||
Fixes: 03e96644d7a8 ("ARM: dts: BCM5301X: Add basic DT for Linksys EA6500 V2")
|
||||
Signed-off-by: Aleksey Nasibulin <alealexpro100@ya.ru>
|
||||
---
|
||||
arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts
|
||||
index f1412ba83def..0454423fe166 100644
|
||||
--- a/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts
|
||||
+++ b/arch/arm/boot/dts/bcm4708-linksys-ea6500-v2.dts
|
||||
@@ -19,7 +19,8 @@ chosen {
|
||||
|
||||
memory@0 {
|
||||
device_type = "memory";
|
||||
- reg = <0x00000000 0x08000000>;
|
||||
+ reg = <0x00000000 0x08000000>,
|
||||
+ <0x88000000 0x08000000>;
|
||||
};
|
||||
|
||||
gpio-keys {
|
||||
--
|
||||
2.30.2
|
||||
|
||||
@ -0,0 +1,73 @@
|
||||
From 2fd7e7f9317d3048a14026816d081b08ba98ea8e Mon Sep 17 00:00:00 2001
|
||||
From: Mark Rutland <mark.rutland@arm.com>
|
||||
Date: Tue, 8 Mar 2022 22:56:13 +0100
|
||||
Subject: [PATCH 1/3] Kbuild: use -Wdeclaration-after-statement
|
||||
|
||||
The kernel is moving from using `-std=gnu89` to `-std=gnu11`, permitting
|
||||
the use of additional C11 features such as for-loop initial declarations.
|
||||
|
||||
One contentious aspect of C99 is that it permits mixed declarations and
|
||||
code, and for now at least, it seems preferable to enforce that
|
||||
declarations must come first.
|
||||
|
||||
These warnings were already enabled in the kernel itself, but not
|
||||
for KBUILD_USERCFLAGS or the compat VDSO on arch/arm64, which uses
|
||||
a separate set of CFLAGS.
|
||||
|
||||
This patch fixes an existing violation in modpost.c, which is not
|
||||
reported because of the missing flag in KBUILD_USERCFLAGS:
|
||||
|
||||
| scripts/mod/modpost.c: In function ‘match’:
|
||||
| scripts/mod/modpost.c:837:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
|
||||
| 837 | const char *endp = p + strlen(p) - 1;
|
||||
| | ^~~~~
|
||||
|
||||
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
|
||||
[arnd: don't add a duplicate flag to the default set, update changelog]
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
|
||||
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM/Clang v13.0.0 (x86-64)
|
||||
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
---
|
||||
Makefile | 3 ++-
|
||||
arch/arm64/kernel/vdso32/Makefile | 1 +
|
||||
scripts/mod/modpost.c | 4 +++-
|
||||
3 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,7 +416,8 @@ HOSTCXX = g++
|
||||
endif
|
||||
|
||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
- -O2 -fomit-frame-pointer -std=gnu89
|
||||
+ -O2 -fomit-frame-pointer -std=gnu89 \
|
||||
+ -Wdeclaration-after-statement
|
||||
export KBUILD_USERLDFLAGS :=
|
||||
|
||||
KBUILD_HOSTCFLAGS := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
|
||||
--- a/arch/arm64/kernel/vdso32/Makefile
|
||||
+++ b/arch/arm64/kernel/vdso32/Makefile
|
||||
@@ -76,6 +76,7 @@ VDSO_CFLAGS += -Wall -Wundef -Wstrict-pr
|
||||
-fno-strict-aliasing -fno-common \
|
||||
-Werror-implicit-function-declaration \
|
||||
-Wno-format-security \
|
||||
+ -Wdeclaration-after-statement \
|
||||
-std=gnu89
|
||||
VDSO_CFLAGS += -O2
|
||||
# Some useful compiler-dependent flags from top-level Makefile
|
||||
--- a/scripts/mod/modpost.c
|
||||
+++ b/scripts/mod/modpost.c
|
||||
@@ -844,8 +844,10 @@ static int match(const char *sym, const
|
||||
{
|
||||
const char *p;
|
||||
while (*pat) {
|
||||
+ const char *endp;
|
||||
+
|
||||
p = *pat++;
|
||||
- const char *endp = p + strlen(p) - 1;
|
||||
+ endp = p + strlen(p) - 1;
|
||||
|
||||
/* "*foo*" */
|
||||
if (*p == '*' && *endp == '*') {
|
||||
@ -0,0 +1,60 @@
|
||||
From b810c8e719ea082e47c7a8f7cf878bc84fa2455d Mon Sep 17 00:00:00 2001
|
||||
From: Arnd Bergmann <arnd@arndb.de>
|
||||
Date: Tue, 8 Mar 2022 22:56:14 +0100
|
||||
Subject: [PATCH 2/3] Kbuild: move to -std=gnu11
|
||||
|
||||
During a patch discussion, Linus brought up the option of changing
|
||||
the C standard version from gnu89 to gnu99, which allows using variable
|
||||
declaration inside of a for() loop. While the C99, C11 and later standards
|
||||
introduce many other features, most of these are already available in
|
||||
gnu89 as GNU extensions as well.
|
||||
|
||||
An earlier attempt to do this when gcc-5 started defaulting to
|
||||
-std=gnu11 failed because at the time that caused warnings about
|
||||
designated initializers with older compilers. Now that gcc-5.1 is
|
||||
the minimum compiler version used for building kernels, that is no
|
||||
longer a concern. Similarly, the behavior of 'inline' functions changes
|
||||
between gnu89 using gnu_inline behavior and gnu11 using standard c99+
|
||||
behavior, but this was taken care of by defining 'inline' to include
|
||||
__attribute__((gnu_inline)) in order to allow building with clang a
|
||||
while ago.
|
||||
|
||||
Nathan Chancellor reported a new -Wdeclaration-after-statement
|
||||
warning that appears in a system header on arm, this still needs a
|
||||
workaround.
|
||||
|
||||
The differences between gnu99, gnu11, gnu1x and gnu17 are fairly
|
||||
minimal and mainly impact warnings at the -Wpedantic level that the
|
||||
kernel never enables. Between these, gnu11 is the newest version
|
||||
that is supported by all supported compiler versions, though it is
|
||||
only the default on gcc-5, while all other supported versions of
|
||||
gcc or clang default to gnu1x/gnu17.
|
||||
|
||||
Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/
|
||||
Link: https://github.com/ClangBuiltLinux/linux/issues/1603
|
||||
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Acked-by: Marco Elver <elver@google.com>
|
||||
Acked-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Acked-by: David Sterba <dsterba@suse.com>
|
||||
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
|
||||
Reviewed-by: Alex Shi <alexs@kernel.org>
|
||||
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
|
||||
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -498,7 +498,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror
|
||||
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
||||
-Werror=implicit-function-declaration -Werror=implicit-int \
|
||||
-Werror=return-type -Wno-format-security \
|
||||
- -std=gnu89
|
||||
+ -std=gnu11
|
||||
KBUILD_CPPFLAGS := -D__KERNEL__
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
KBUILD_CFLAGS_KERNEL :=
|
||||
@ -0,0 +1,42 @@
|
||||
From 40337d6f3d677aee7ad3052ae662d3f53dd4d5cb Mon Sep 17 00:00:00 2001
|
||||
From: Arnd Bergmann <arnd@arndb.de>
|
||||
Date: Tue, 8 Mar 2022 22:56:15 +0100
|
||||
Subject: [PATCH 3/3] Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS
|
||||
|
||||
As we change the C language standard for the kernel from gnu89 to
|
||||
gnu11, it makes sense to also update the version for user space
|
||||
compilation.
|
||||
|
||||
Some users have older native compilers than what they use for
|
||||
kernel builds, so I considered using gnu99 as the default version
|
||||
for wider compatibility with gcc-4.6 and earlier.
|
||||
|
||||
However, testing with older compilers showed that we already require
|
||||
HOSTCC version 5.1 as well because a lot of host tools include
|
||||
linux/compiler.h that uses __has_attribute():
|
||||
|
||||
CC tools/objtool/exec-cmd.o
|
||||
In file included from tools/include/linux/compiler_types.h:36:0,
|
||||
from tools/include/linux/compiler.h:5,
|
||||
from exec-cmd.c:2:
|
||||
tools/include/linux/compiler-gcc.h:19:5: error: "__has_attribute" is not defined [-Werror=undef]
|
||||
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
|
||||
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
|
||||
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,7 +416,7 @@ HOSTCXX = g++
|
||||
endif
|
||||
|
||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
- -O2 -fomit-frame-pointer -std=gnu89 \
|
||||
+ -O2 -fomit-frame-pointer -std=gnu11 \
|
||||
-Wdeclaration-after-statement
|
||||
export KBUILD_USERLDFLAGS :=
|
||||
@ -0,0 +1,81 @@
|
||||
From 2fd7e7f9317d3048a14026816d081b08ba98ea8e Mon Sep 17 00:00:00 2001
|
||||
From: Mark Rutland <mark.rutland@arm.com>
|
||||
Date: Tue, 8 Mar 2022 22:56:13 +0100
|
||||
Subject: [PATCH 1/3] Kbuild: use -Wdeclaration-after-statement
|
||||
|
||||
The kernel is moving from using `-std=gnu89` to `-std=gnu11`, permitting
|
||||
the use of additional C11 features such as for-loop initial declarations.
|
||||
|
||||
One contentious aspect of C99 is that it permits mixed declarations and
|
||||
code, and for now at least, it seems preferable to enforce that
|
||||
declarations must come first.
|
||||
|
||||
These warnings were already enabled in the kernel itself, but not
|
||||
for KBUILD_USERCFLAGS or the compat VDSO on arch/arm64, which uses
|
||||
a separate set of CFLAGS.
|
||||
|
||||
This patch fixes an existing violation in modpost.c, which is not
|
||||
reported because of the missing flag in KBUILD_USERCFLAGS:
|
||||
|
||||
| scripts/mod/modpost.c: In function ‘match’:
|
||||
| scripts/mod/modpost.c:837:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
|
||||
| 837 | const char *endp = p + strlen(p) - 1;
|
||||
| | ^~~~~
|
||||
|
||||
Signed-off-by: Mark Rutland <mark.rutland@arm.com>
|
||||
[arnd: don't add a duplicate flag to the default set, update changelog]
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
|
||||
Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # LLVM/Clang v13.0.0 (x86-64)
|
||||
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
---
|
||||
Makefile | 3 ++-
|
||||
arch/arm64/kernel/vdso32/Makefile | 1 +
|
||||
scripts/mod/modpost.c | 4 +++-
|
||||
3 files changed, 6 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index b9e0b5c604af..cfe400032f96 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,7 +416,8 @@ HOSTCXX = g++
|
||||
endif
|
||||
|
||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
- -O2 -fomit-frame-pointer -std=gnu89
|
||||
+ -O2 -fomit-frame-pointer -std=gnu89 \
|
||||
+ -Wdeclaration-after-statement
|
||||
export KBUILD_USERLDFLAGS :=
|
||||
|
||||
KBUILD_HOSTCFLAGS := $(KBUILD_USERCFLAGS) $(HOST_LFS_CFLAGS) $(HOSTCFLAGS)
|
||||
diff --git a/arch/arm64/kernel/vdso32/Makefile b/arch/arm64/kernel/vdso32/Makefile
|
||||
index abad38c576e1..33cd7ed3f94f 100644
|
||||
--- a/arch/arm64/kernel/vdso32/Makefile
|
||||
+++ b/arch/arm64/kernel/vdso32/Makefile
|
||||
@@ -76,6 +76,7 @@ VDSO_CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
|
||||
-fno-strict-aliasing -fno-common \
|
||||
-Werror-implicit-function-declaration \
|
||||
-Wno-format-security \
|
||||
+ -Wdeclaration-after-statement \
|
||||
-std=gnu89
|
||||
VDSO_CFLAGS += -O2
|
||||
# Some useful compiler-dependent flags from top-level Makefile
|
||||
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
|
||||
index 3c27a177b28b..d2b17ed27e6e 100644
|
||||
--- a/scripts/mod/modpost.c
|
||||
+++ b/scripts/mod/modpost.c
|
||||
@@ -844,8 +844,10 @@ static int match(const char *sym, const char * const pat[])
|
||||
{
|
||||
const char *p;
|
||||
while (*pat) {
|
||||
+ const char *endp;
|
||||
+
|
||||
p = *pat++;
|
||||
- const char *endp = p + strlen(p) - 1;
|
||||
+ endp = p + strlen(p) - 1;
|
||||
|
||||
/* "*foo*" */
|
||||
if (*p == '*' && *endp == '*') {
|
||||
--
|
||||
2.37.2
|
||||
@ -0,0 +1,64 @@
|
||||
From b810c8e719ea082e47c7a8f7cf878bc84fa2455d Mon Sep 17 00:00:00 2001
|
||||
From: Arnd Bergmann <arnd@arndb.de>
|
||||
Date: Tue, 8 Mar 2022 22:56:14 +0100
|
||||
Subject: [PATCH 2/3] Kbuild: move to -std=gnu11
|
||||
|
||||
During a patch discussion, Linus brought up the option of changing
|
||||
the C standard version from gnu89 to gnu99, which allows using variable
|
||||
declaration inside of a for() loop. While the C99, C11 and later standards
|
||||
introduce many other features, most of these are already available in
|
||||
gnu89 as GNU extensions as well.
|
||||
|
||||
An earlier attempt to do this when gcc-5 started defaulting to
|
||||
-std=gnu11 failed because at the time that caused warnings about
|
||||
designated initializers with older compilers. Now that gcc-5.1 is
|
||||
the minimum compiler version used for building kernels, that is no
|
||||
longer a concern. Similarly, the behavior of 'inline' functions changes
|
||||
between gnu89 using gnu_inline behavior and gnu11 using standard c99+
|
||||
behavior, but this was taken care of by defining 'inline' to include
|
||||
__attribute__((gnu_inline)) in order to allow building with clang a
|
||||
while ago.
|
||||
|
||||
Nathan Chancellor reported a new -Wdeclaration-after-statement
|
||||
warning that appears in a system header on arm, this still needs a
|
||||
workaround.
|
||||
|
||||
The differences between gnu99, gnu11, gnu1x and gnu17 are fairly
|
||||
minimal and mainly impact warnings at the -Wpedantic level that the
|
||||
kernel never enables. Between these, gnu11 is the newest version
|
||||
that is supported by all supported compiler versions, though it is
|
||||
only the default on gcc-5, while all other supported versions of
|
||||
gcc or clang default to gnu1x/gnu17.
|
||||
|
||||
Link: https://lore.kernel.org/lkml/CAHk-=wiyCH7xeHcmiFJ-YgXUy2Jaj7pnkdKpcovt8fYbVFW3TA@mail.gmail.com/
|
||||
Link: https://github.com/ClangBuiltLinux/linux/issues/1603
|
||||
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Acked-by: Marco Elver <elver@google.com>
|
||||
Acked-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Acked-by: David Sterba <dsterba@suse.com>
|
||||
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
|
||||
Reviewed-by: Alex Shi <alexs@kernel.org>
|
||||
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
|
||||
Reviewed-by: Miguel Ojeda <ojeda@kernel.org>
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index cfe400032f96..fe86758acaaa 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -498,7 +498,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \
|
||||
-fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \
|
||||
-Werror=implicit-function-declaration -Werror=implicit-int \
|
||||
-Werror=return-type -Wno-format-security \
|
||||
- -std=gnu89
|
||||
+ -std=gnu11
|
||||
KBUILD_CPPFLAGS := -D__KERNEL__
|
||||
KBUILD_AFLAGS_KERNEL :=
|
||||
KBUILD_CFLAGS_KERNEL :=
|
||||
--
|
||||
2.37.2
|
||||
@ -0,0 +1,47 @@
|
||||
From 40337d6f3d677aee7ad3052ae662d3f53dd4d5cb Mon Sep 17 00:00:00 2001
|
||||
From: Arnd Bergmann <arnd@arndb.de>
|
||||
Date: Tue, 8 Mar 2022 22:56:15 +0100
|
||||
Subject: [PATCH 3/3] Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS
|
||||
|
||||
As we change the C language standard for the kernel from gnu89 to
|
||||
gnu11, it makes sense to also update the version for user space
|
||||
compilation.
|
||||
|
||||
Some users have older native compilers than what they use for
|
||||
kernel builds, so I considered using gnu99 as the default version
|
||||
for wider compatibility with gcc-4.6 and earlier.
|
||||
|
||||
However, testing with older compilers showed that we already require
|
||||
HOSTCC version 5.1 as well because a lot of host tools include
|
||||
linux/compiler.h that uses __has_attribute():
|
||||
|
||||
CC tools/objtool/exec-cmd.o
|
||||
In file included from tools/include/linux/compiler_types.h:36:0,
|
||||
from tools/include/linux/compiler.h:5,
|
||||
from exec-cmd.c:2:
|
||||
tools/include/linux/compiler-gcc.h:19:5: error: "__has_attribute" is not defined [-Werror=undef]
|
||||
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
|
||||
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
|
||||
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
|
||||
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
|
||||
---
|
||||
Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/Makefile b/Makefile
|
||||
index fe86758acaaa..e569fccfb009 100644
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -416,7 +416,7 @@ HOSTCXX = g++
|
||||
endif
|
||||
|
||||
export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
- -O2 -fomit-frame-pointer -std=gnu89 \
|
||||
+ -O2 -fomit-frame-pointer -std=gnu11 \
|
||||
-Wdeclaration-after-statement
|
||||
export KBUILD_USERLDFLAGS :=
|
||||
|
||||
--
|
||||
2.37.2
|
||||
@ -0,0 +1,163 @@
|
||||
From a2550d3ce53c68f54042bc5e468c4d07491ffe0e Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Wed, 12 Oct 2022 19:18:36 +0200
|
||||
Subject: [PATCH 1/2] net: dsa: qca8k: fix inband mgmt for big-endian systems
|
||||
|
||||
The header and the data of the skb for the inband mgmt requires
|
||||
to be in little-endian. This is problematic for big-endian system
|
||||
as the mgmt header is written in the cpu byte order.
|
||||
|
||||
Fix this by converting each value for the mgmt header and data to
|
||||
little-endian, and convert to cpu byte order the mgmt header and
|
||||
data sent by the switch.
|
||||
|
||||
Fixes: 5950c7c0a68c ("net: dsa: qca8k: add support for mgmt read/write in Ethernet packet")
|
||||
Tested-by: Pawel Dembicki <paweldembicki@gmail.com>
|
||||
Tested-by: Lech Perczak <lech.perczak@gmail.com>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/qca/qca8k-8xxx.c | 63 ++++++++++++++++++++++++--------
|
||||
include/linux/dsa/tag_qca.h | 6 +--
|
||||
2 files changed, 50 insertions(+), 19 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
|
||||
index 5669c92c93f7..644338ca0510 100644
|
||||
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
|
||||
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
|
||||
@@ -137,27 +137,42 @@ static void qca8k_rw_reg_ack_handler(struct dsa_switch *ds, struct sk_buff *skb)
|
||||
struct qca8k_mgmt_eth_data *mgmt_eth_data;
|
||||
struct qca8k_priv *priv = ds->priv;
|
||||
struct qca_mgmt_ethhdr *mgmt_ethhdr;
|
||||
+ u32 command;
|
||||
u8 len, cmd;
|
||||
+ int i;
|
||||
|
||||
mgmt_ethhdr = (struct qca_mgmt_ethhdr *)skb_mac_header(skb);
|
||||
mgmt_eth_data = &priv->mgmt_eth_data;
|
||||
|
||||
- cmd = FIELD_GET(QCA_HDR_MGMT_CMD, mgmt_ethhdr->command);
|
||||
- len = FIELD_GET(QCA_HDR_MGMT_LENGTH, mgmt_ethhdr->command);
|
||||
+ command = get_unaligned_le32(&mgmt_ethhdr->command);
|
||||
+ cmd = FIELD_GET(QCA_HDR_MGMT_CMD, command);
|
||||
+ len = FIELD_GET(QCA_HDR_MGMT_LENGTH, command);
|
||||
|
||||
/* Make sure the seq match the requested packet */
|
||||
- if (mgmt_ethhdr->seq == mgmt_eth_data->seq)
|
||||
+ if (get_unaligned_le32(&mgmt_ethhdr->seq) == mgmt_eth_data->seq)
|
||||
mgmt_eth_data->ack = true;
|
||||
|
||||
if (cmd == MDIO_READ) {
|
||||
- mgmt_eth_data->data[0] = mgmt_ethhdr->mdio_data;
|
||||
+ u32 *val = mgmt_eth_data->data;
|
||||
+
|
||||
+ *val = get_unaligned_le32(&mgmt_ethhdr->mdio_data);
|
||||
|
||||
/* Get the rest of the 12 byte of data.
|
||||
* The read/write function will extract the requested data.
|
||||
*/
|
||||
- if (len > QCA_HDR_MGMT_DATA1_LEN)
|
||||
- memcpy(mgmt_eth_data->data + 1, skb->data,
|
||||
- QCA_HDR_MGMT_DATA2_LEN);
|
||||
+ if (len > QCA_HDR_MGMT_DATA1_LEN) {
|
||||
+ __le32 *data2 = (__le32 *)skb->data;
|
||||
+ int data_len = min_t(int, QCA_HDR_MGMT_DATA2_LEN,
|
||||
+ len - QCA_HDR_MGMT_DATA1_LEN);
|
||||
+
|
||||
+ val++;
|
||||
+
|
||||
+ for (i = sizeof(u32); i <= data_len; i += sizeof(u32)) {
|
||||
+ *val = get_unaligned_le32(data2);
|
||||
+ val++;
|
||||
+ data2++;
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
complete(&mgmt_eth_data->rw_done);
|
||||
@@ -169,8 +184,10 @@ static struct sk_buff *qca8k_alloc_mdio_header(enum mdio_cmd cmd, u32 reg, u32 *
|
||||
struct qca_mgmt_ethhdr *mgmt_ethhdr;
|
||||
unsigned int real_len;
|
||||
struct sk_buff *skb;
|
||||
- u32 *data2;
|
||||
+ __le32 *data2;
|
||||
+ u32 command;
|
||||
u16 hdr;
|
||||
+ int i;
|
||||
|
||||
skb = dev_alloc_skb(QCA_HDR_MGMT_PKT_LEN);
|
||||
if (!skb)
|
||||
@@ -199,20 +216,32 @@ static struct sk_buff *qca8k_alloc_mdio_header(enum mdio_cmd cmd, u32 reg, u32 *
|
||||
hdr |= FIELD_PREP(QCA_HDR_XMIT_DP_BIT, BIT(0));
|
||||
hdr |= FIELD_PREP(QCA_HDR_XMIT_CONTROL, QCA_HDR_XMIT_TYPE_RW_REG);
|
||||
|
||||
- mgmt_ethhdr->command = FIELD_PREP(QCA_HDR_MGMT_ADDR, reg);
|
||||
- mgmt_ethhdr->command |= FIELD_PREP(QCA_HDR_MGMT_LENGTH, real_len);
|
||||
- mgmt_ethhdr->command |= FIELD_PREP(QCA_HDR_MGMT_CMD, cmd);
|
||||
- mgmt_ethhdr->command |= FIELD_PREP(QCA_HDR_MGMT_CHECK_CODE,
|
||||
+ command = FIELD_PREP(QCA_HDR_MGMT_ADDR, reg);
|
||||
+ command |= FIELD_PREP(QCA_HDR_MGMT_LENGTH, real_len);
|
||||
+ command |= FIELD_PREP(QCA_HDR_MGMT_CMD, cmd);
|
||||
+ command |= FIELD_PREP(QCA_HDR_MGMT_CHECK_CODE,
|
||||
QCA_HDR_MGMT_CHECK_CODE_VAL);
|
||||
|
||||
+ put_unaligned_le32(command, &mgmt_ethhdr->command);
|
||||
+
|
||||
if (cmd == MDIO_WRITE)
|
||||
- mgmt_ethhdr->mdio_data = *val;
|
||||
+ put_unaligned_le32(*val, &mgmt_ethhdr->mdio_data);
|
||||
|
||||
mgmt_ethhdr->hdr = htons(hdr);
|
||||
|
||||
data2 = skb_put_zero(skb, QCA_HDR_MGMT_DATA2_LEN + QCA_HDR_MGMT_PADDING_LEN);
|
||||
- if (cmd == MDIO_WRITE && len > QCA_HDR_MGMT_DATA1_LEN)
|
||||
- memcpy(data2, val + 1, len - QCA_HDR_MGMT_DATA1_LEN);
|
||||
+ if (cmd == MDIO_WRITE && len > QCA_HDR_MGMT_DATA1_LEN) {
|
||||
+ int data_len = min_t(int, QCA_HDR_MGMT_DATA2_LEN,
|
||||
+ len - QCA_HDR_MGMT_DATA1_LEN);
|
||||
+
|
||||
+ val++;
|
||||
+
|
||||
+ for (i = sizeof(u32); i <= data_len; i += sizeof(u32)) {
|
||||
+ put_unaligned_le32(*val, data2);
|
||||
+ data2++;
|
||||
+ val++;
|
||||
+ }
|
||||
+ }
|
||||
|
||||
return skb;
|
||||
}
|
||||
@@ -220,9 +249,11 @@ static struct sk_buff *qca8k_alloc_mdio_header(enum mdio_cmd cmd, u32 reg, u32 *
|
||||
static void qca8k_mdio_header_fill_seq_num(struct sk_buff *skb, u32 seq_num)
|
||||
{
|
||||
struct qca_mgmt_ethhdr *mgmt_ethhdr;
|
||||
+ u32 seq;
|
||||
|
||||
+ seq = FIELD_PREP(QCA_HDR_MGMT_SEQ_NUM, seq_num);
|
||||
mgmt_ethhdr = (struct qca_mgmt_ethhdr *)skb->data;
|
||||
- mgmt_ethhdr->seq = FIELD_PREP(QCA_HDR_MGMT_SEQ_NUM, seq_num);
|
||||
+ put_unaligned_le32(seq, &mgmt_ethhdr->seq);
|
||||
}
|
||||
|
||||
static int qca8k_read_eth(struct qca8k_priv *priv, u32 reg, u32 *val, int len)
|
||||
diff --git a/include/linux/dsa/tag_qca.h b/include/linux/dsa/tag_qca.h
|
||||
index 50be7cbd93a5..0e176da1e43f 100644
|
||||
--- a/include/linux/dsa/tag_qca.h
|
||||
+++ b/include/linux/dsa/tag_qca.h
|
||||
@@ -61,9 +61,9 @@ struct sk_buff;
|
||||
|
||||
/* Special struct emulating a Ethernet header */
|
||||
struct qca_mgmt_ethhdr {
|
||||
- u32 command; /* command bit 31:0 */
|
||||
- u32 seq; /* seq 63:32 */
|
||||
- u32 mdio_data; /* first 4byte mdio */
|
||||
+ __le32 command; /* command bit 31:0 */
|
||||
+ __le32 seq; /* seq 63:32 */
|
||||
+ __le32 mdio_data; /* first 4byte mdio */
|
||||
__be16 hdr; /* qca hdr */
|
||||
} __packed;
|
||||
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@ -0,0 +1,88 @@
|
||||
From 0d4636f7d72df3179b20a2d32b647881917a5e2a Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Wed, 12 Oct 2022 19:18:37 +0200
|
||||
Subject: [PATCH 2/2] net: dsa: qca8k: fix ethtool autocast mib for big-endian
|
||||
systems
|
||||
|
||||
The switch sends autocast mib in little-endian. This is problematic for
|
||||
big-endian system as the values needs to be converted.
|
||||
|
||||
Fix this by converting each mib value to cpu byte order.
|
||||
|
||||
Fixes: 5c957c7ca78c ("net: dsa: qca8k: add support for mib autocast in Ethernet packet")
|
||||
Tested-by: Pawel Dembicki <paweldembicki@gmail.com>
|
||||
Tested-by: Lech Perczak <lech.perczak@gmail.com>
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/dsa/qca/qca8k-8xxx.c | 20 ++++++++------------
|
||||
include/linux/dsa/tag_qca.h | 2 +-
|
||||
2 files changed, 9 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/dsa/qca/qca8k-8xxx.c b/drivers/net/dsa/qca/qca8k-8xxx.c
|
||||
index 644338ca0510..c5c3b4e92f28 100644
|
||||
--- a/drivers/net/dsa/qca/qca8k-8xxx.c
|
||||
+++ b/drivers/net/dsa/qca/qca8k-8xxx.c
|
||||
@@ -1518,9 +1518,9 @@ static void qca8k_mib_autocast_handler(struct dsa_switch *ds, struct sk_buff *sk
|
||||
struct qca8k_priv *priv = ds->priv;
|
||||
const struct qca8k_mib_desc *mib;
|
||||
struct mib_ethhdr *mib_ethhdr;
|
||||
- int i, mib_len, offset = 0;
|
||||
- u64 *data;
|
||||
+ __le32 *data2;
|
||||
u8 port;
|
||||
+ int i;
|
||||
|
||||
mib_ethhdr = (struct mib_ethhdr *)skb_mac_header(skb);
|
||||
mib_eth_data = &priv->mib_eth_data;
|
||||
@@ -1532,28 +1532,24 @@ static void qca8k_mib_autocast_handler(struct dsa_switch *ds, struct sk_buff *sk
|
||||
if (port != mib_eth_data->req_port)
|
||||
goto exit;
|
||||
|
||||
- data = mib_eth_data->data;
|
||||
+ data2 = (__le32 *)skb->data;
|
||||
|
||||
for (i = 0; i < priv->info->mib_count; i++) {
|
||||
mib = &ar8327_mib[i];
|
||||
|
||||
/* First 3 mib are present in the skb head */
|
||||
if (i < 3) {
|
||||
- data[i] = mib_ethhdr->data[i];
|
||||
+ mib_eth_data->data[i] = get_unaligned_le32(mib_ethhdr->data + i);
|
||||
continue;
|
||||
}
|
||||
|
||||
- mib_len = sizeof(uint32_t);
|
||||
-
|
||||
/* Some mib are 64 bit wide */
|
||||
if (mib->size == 2)
|
||||
- mib_len = sizeof(uint64_t);
|
||||
-
|
||||
- /* Copy the mib value from packet to the */
|
||||
- memcpy(data + i, skb->data + offset, mib_len);
|
||||
+ mib_eth_data->data[i] = get_unaligned_le64((__le64 *)data2);
|
||||
+ else
|
||||
+ mib_eth_data->data[i] = get_unaligned_le32(data2);
|
||||
|
||||
- /* Set the offset for the next mib */
|
||||
- offset += mib_len;
|
||||
+ data2 += mib->size;
|
||||
}
|
||||
|
||||
exit:
|
||||
diff --git a/include/linux/dsa/tag_qca.h b/include/linux/dsa/tag_qca.h
|
||||
index 0e176da1e43f..b1b5720d89a5 100644
|
||||
--- a/include/linux/dsa/tag_qca.h
|
||||
+++ b/include/linux/dsa/tag_qca.h
|
||||
@@ -73,7 +73,7 @@ enum mdio_cmd {
|
||||
};
|
||||
|
||||
struct mib_ethhdr {
|
||||
- u32 data[3]; /* first 3 mib counter */
|
||||
+ __le32 data[3]; /* first 3 mib counter */
|
||||
__be16 hdr; /* qca hdr */
|
||||
} __packed;
|
||||
|
||||
--
|
||||
2.37.2
|
||||
|
||||
@ -3200,6 +3200,11 @@ CONFIG_LLC=y
|
||||
CONFIG_LOCALVERSION=""
|
||||
# CONFIG_LOCALVERSION_AUTO is not set
|
||||
# CONFIG_LOCKD is not set
|
||||
CONFIG_LOCKDEP_BITS=15
|
||||
CONFIG_LOCKDEP_CIRCULAR_QUEUE_BITS=12
|
||||
CONFIG_LOCKDEP_CHAINS_BITS=16
|
||||
CONFIG_LOCKDEP_STACK_TRACE_BITS=19
|
||||
CONFIG_LOCKDEP_STACK_TRACE_HASH_BITS=14
|
||||
CONFIG_LOCKDEP_SUPPORT=y
|
||||
CONFIG_LOCKD_V4=y
|
||||
# CONFIG_LOCKUP_DETECTOR is not set
|
||||
|
||||
@ -292,8 +292,6 @@ CONFIG_I2C_SLAVE_EEPROM=y
|
||||
CONFIG_I2C_XILINX=y
|
||||
CONFIG_ICPLUS_PHY=y
|
||||
CONFIG_ICS932S401=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_IMX2_WDT=y
|
||||
# CONFIG_IMX7ULP_WDT is not set
|
||||
# CONFIG_IMX8MM_THERMAL is not set
|
||||
|
||||
@ -381,8 +381,6 @@ CONFIG_I2C_MUX_PCA954x=y
|
||||
CONFIG_I2C_RK3X=y
|
||||
CONFIG_I2C_SLAVE=y
|
||||
# CONFIG_I2C_SLAVE_TESTUNIT is not set
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_IMX2_WDT=y
|
||||
CONFIG_INET_DIAG=y
|
||||
|
||||
@ -184,8 +184,6 @@ CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_MT65XX=y
|
||||
CONFIG_ICPLUS_PHY=y
|
||||
CONFIG_IIO=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IO_URING=y
|
||||
|
||||
@ -34,6 +34,17 @@ mediatek_setup_interfaces()
|
||||
esac
|
||||
}
|
||||
|
||||
DEV_PATH_WMAC=platform/18000000.wmac
|
||||
DEV_PATH_PCIE0=1a143000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0
|
||||
DEV_PATH_PCIE1=1a145000.pcie/pci0001:00/0001:00:01.0/0001:01:00.0
|
||||
|
||||
mediatek_setup_wlan()
|
||||
{
|
||||
dt_is_enabled wmac@18000000 && ucidef_add_wlan $DEV_PATH_WMAC
|
||||
dt_is_enabled pcie@1a143000 && ucidef_add_wlan $DEV_PATH_PCIE0
|
||||
dt_is_enabled pcie@1a145000 && ucidef_add_wlan $DEV_PATH_PCIE1
|
||||
}
|
||||
|
||||
mediatek_setup_macs()
|
||||
{
|
||||
local board="$1"
|
||||
@ -60,6 +71,7 @@ board_config_update
|
||||
board=$(board_name)
|
||||
mediatek_setup_interfaces $board
|
||||
mediatek_setup_macs $board
|
||||
mediatek_setup_wlan $board
|
||||
board_config_flush
|
||||
|
||||
exit 0
|
||||
|
||||
@ -73,7 +73,7 @@ CONFIG_COMMON_CLK_MT7622_ETHSYS=y
|
||||
CONFIG_COMMON_CLK_MT7622_HIFSYS=y
|
||||
# CONFIG_COMMON_CLK_MT7986 is not set
|
||||
# CONFIG_COMMON_CLK_MT8173 is not set
|
||||
CONFIG_COMMON_CLK_MT8183=y
|
||||
# CONFIG_COMMON_CLK_MT8183 is not set
|
||||
# CONFIG_COMMON_CLK_MT8183_AUDIOSYS is not set
|
||||
# CONFIG_COMMON_CLK_MT8183_CAMSYS is not set
|
||||
# CONFIG_COMMON_CLK_MT8183_IMGSYS is not set
|
||||
@ -85,7 +85,7 @@ CONFIG_COMMON_CLK_MT8183=y
|
||||
# CONFIG_COMMON_CLK_MT8183_MMSYS is not set
|
||||
# CONFIG_COMMON_CLK_MT8183_VDECSYS is not set
|
||||
# CONFIG_COMMON_CLK_MT8183_VENCSYS is not set
|
||||
CONFIG_COMMON_CLK_MT8516=y
|
||||
# CONFIG_COMMON_CLK_MT8516 is not set
|
||||
# CONFIG_COMMON_CLK_MT8516_AUDSYS is not set
|
||||
CONFIG_COMPAT=y
|
||||
CONFIG_COMPAT_32BIT_TIME=y
|
||||
@ -146,7 +146,6 @@ CONFIG_DCACHE_WORD_ACCESS=y
|
||||
CONFIG_DEBUG_MISC=y
|
||||
CONFIG_DIMLIB=y
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMATEST=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_ENGINE_RAID=y
|
||||
@ -211,12 +210,8 @@ CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_MT65XX=y
|
||||
CONFIG_ICPLUS_PHY=y
|
||||
CONFIG_IIO=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0xdead000000000000
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IO_URING=y
|
||||
# CONFIG_IR_MTK is not set
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
|
||||
@ -0,0 +1,48 @@
|
||||
From 824d56e753a588fcfd650db1822e34a02a48bb77 Mon Sep 17 00:00:00 2001
|
||||
From: Bruno Umuarama <anonimou_eu@hotmail.com>
|
||||
Date: Thu, 13 Oct 2022 21:18:21 +0000
|
||||
Subject: [PATCH] mediatek: mt7623: fix thermal zone
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Raising the temperatures for passive and active trips. @VA1DER
|
||||
proposed at issue 9396 to remove passive trip. This commit relates to
|
||||
his suggestion.
|
||||
|
||||
Without this patch. the CPU will be throttled all the way down to 98MHz
|
||||
if the temperature rises even a degree above the trip point, and it was
|
||||
further discovered that if the internal temperature of the device is
|
||||
above the first trip point temperature when it boots then it will start
|
||||
in a throttled state and even
|
||||
$ echo disabled > /sys/class/thermal/thermal_zone0/mode
|
||||
will have no effect.
|
||||
|
||||
The patch increases the passive trip point and active cooling map. The
|
||||
throttling temperature will then be at 77°C and 82°C, which is still a
|
||||
low enough temperature for ARM devices to not be in the real danger
|
||||
zone, and gives some operational headroom.
|
||||
|
||||
Signed-off-by: Bruno Umuarama <anonimou_eu@hotmail.com>
|
||||
---
|
||||
arch/arm/boot/dts/mt7623.dtsi | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/arch/arm/boot/dts/mt7623.dtsi
|
||||
+++ b/arch/arm/boot/dts/mt7623.dtsi
|
||||
@@ -160,13 +160,13 @@
|
||||
|
||||
trips {
|
||||
cpu_passive: cpu-passive {
|
||||
- temperature = <57000>;
|
||||
+ temperature = <77000>;
|
||||
hysteresis = <2000>;
|
||||
type = "passive";
|
||||
};
|
||||
|
||||
cpu_active: cpu-active {
|
||||
- temperature = <67000>;
|
||||
+ temperature = <82000>;
|
||||
hysteresis = <2000>;
|
||||
type = "active";
|
||||
};
|
||||
@ -274,8 +274,6 @@ CONFIG_I2C_ALGOBIT=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_OMAP=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
|
||||
@ -277,8 +277,6 @@ CONFIG_I2C_ALGOBIT=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_OMAP=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_IP_PNP=y
|
||||
CONFIG_IP_PNP_BOOTP=y
|
||||
|
||||
@ -246,8 +246,6 @@ CONFIG_IIO_BUFFER=y
|
||||
CONFIG_IIO_KFIFO_BUF=y
|
||||
CONFIG_IIO_TRIGGER=y
|
||||
CONFIG_IIO_TRIGGERED_BUFFER=y
|
||||
CONFIG_IKCONFIG=y
|
||||
CONFIG_IKCONFIG_PROC=y
|
||||
CONFIG_INITRAMFS_SOURCE=""
|
||||
CONFIG_INPUT=y
|
||||
CONFIG_INPUT_EVDEV=y
|
||||
|
||||
Loading…
Reference in New Issue
Block a user