1b379b76ae9f9d4dc28a7ec33b490578024aaaca
[openwrt/staging/pepe2k.git] /
1 From: Ryder Lee <ryder.lee@mediatek.com>
2 Date: Sat, 18 Feb 2023 01:49:25 +0800
3 Subject: [PATCH] wifi: mac80211: add LDPC related flags in ieee80211_bss_conf
4
5 This is utilized to pass LDPC configurations from user space
6 (i.e. hostapd) to driver.
7
8 Signed-off-by: Ryder Lee <ryder.lee@mediatek.com>
9 Link: https://lore.kernel.org/r/1de696aaa34efd77a926eb657b8c0fda05aaa177.1676628065.git.ryder.lee@mediatek.com
10 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
11 ---
12
13 --- a/include/net/mac80211.h
14 +++ b/include/net/mac80211.h
15 @@ -653,6 +653,9 @@ struct ieee80211_fils_discovery {
16 * write-protected by sdata_lock and local->mtx so holding either is fine
17 * for read access.
18 * @color_change_color: the bss color that will be used after the change.
19 + * @ht_ldpc: in AP mode, indicates interface has HT LDPC capability.
20 + * @vht_ldpc: in AP mode, indicates interface has VHT LDPC capability.
21 + * @he_ldpc: in AP mode, indicates interface has HE LDPC capability.
22 * @vht_su_beamformer: in AP mode, does this BSS support operation as an VHT SU
23 * beamformer
24 * @vht_su_beamformee: in AP mode, does this BSS support operation as an VHT SU
25 @@ -744,6 +747,9 @@ struct ieee80211_bss_conf {
26 bool color_change_active;
27 u8 color_change_color;
28
29 + bool ht_ldpc;
30 + bool vht_ldpc;
31 + bool he_ldpc;
32 bool vht_su_beamformer;
33 bool vht_su_beamformee;
34 bool vht_mu_beamformer;
35 --- a/net/mac80211/cfg.c
36 +++ b/net/mac80211/cfg.c
37 @@ -1252,7 +1252,15 @@ static int ieee80211_start_ap(struct wip
38 prev_beacon_int = link_conf->beacon_int;
39 link_conf->beacon_int = params->beacon_interval;
40
41 + if (params->ht_cap)
42 + link_conf->ht_ldpc =
43 + params->ht_cap->cap_info &
44 + cpu_to_le16(IEEE80211_HT_CAP_LDPC_CODING);
45 +
46 if (params->vht_cap) {
47 + link_conf->vht_ldpc =
48 + params->vht_cap->vht_cap_info &
49 + cpu_to_le32(IEEE80211_VHT_CAP_RXLDPC);
50 link_conf->vht_su_beamformer =
51 params->vht_cap->vht_cap_info &
52 cpu_to_le32(IEEE80211_VHT_CAP_SU_BEAMFORMER_CAPABLE);
53 @@ -1282,6 +1290,9 @@ static int ieee80211_start_ap(struct wip
54 }
55
56 if (params->he_cap) {
57 + link_conf->he_ldpc =
58 + params->he_cap->phy_cap_info[1] &
59 + IEEE80211_HE_PHY_CAP1_LDPC_CODING_IN_PAYLOAD;
60 link_conf->he_su_beamformer =
61 params->he_cap->phy_cap_info[3] &
62 IEEE80211_HE_PHY_CAP3_SU_BEAMFORMER;