developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 1 | From ea7da2297d396febe75de0d7cf77cba9d2eab778 Mon Sep 17 00:00:00 2001 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 2 | From: MeiChia Chiu <meichia.chiu@mediatek.com> |
| 3 | Date: Thu, 12 Jan 2023 15:18:19 +0800 |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 4 | Subject: [PATCH 13/40] hostapd: mtk: Add he_ldpc configuration |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 5 | |
| 6 | --- |
| 7 | hostapd/config_file.c | 2 ++ |
| 8 | hostapd/hostapd.conf | 5 +++++ |
| 9 | src/ap/ap_config.c | 1 + |
| 10 | src/ap/ap_config.h | 1 + |
| 11 | src/ap/ieee802_11_he.c | 7 +++++++ |
| 12 | src/common/ieee802_11_defs.h | 3 +++ |
| 13 | 6 files changed, 19 insertions(+) |
| 14 | |
| 15 | diff --git a/hostapd/config_file.c b/hostapd/config_file.c |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 16 | index d17e50e..04ca433 100644 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 17 | --- a/hostapd/config_file.c |
| 18 | +++ b/hostapd/config_file.c |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 19 | @@ -3515,6 +3515,8 @@ static int hostapd_config_fill(struct hostapd_config *conf, |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 20 | conf->he_phy_capab.he_su_beamformee = atoi(pos); |
| 21 | } else if (os_strcmp(buf, "he_mu_beamformer") == 0) { |
| 22 | conf->he_phy_capab.he_mu_beamformer = atoi(pos); |
| 23 | + } else if (os_strcmp(buf, "he_ldpc") == 0) { |
| 24 | + conf->he_phy_capab.he_ldpc = atoi(pos); |
| 25 | } else if (os_strcmp(buf, "he_bss_color") == 0) { |
| 26 | conf->he_op.he_bss_color = atoi(pos) & 0x3f; |
| 27 | conf->he_op.he_bss_color_disabled = 0; |
| 28 | diff --git a/hostapd/hostapd.conf b/hostapd/hostapd.conf |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 29 | index 30fb06d..fd42c50 100644 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 30 | --- a/hostapd/hostapd.conf |
| 31 | +++ b/hostapd/hostapd.conf |
developer | 5e0a8d7 | 2023-05-12 18:58:17 +0800 | [diff] [blame] | 32 | @@ -833,6 +833,11 @@ wmm_ac_vo_acm=0 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 33 | # 1 = supported |
| 34 | #he_mu_beamformer=1 |
| 35 | |
| 36 | +#he_ldpc: HE LDPC support |
| 37 | +# 0 = not supported |
| 38 | +# 1 = supported (default) |
| 39 | +#he_ldpc=1 |
| 40 | + |
| 41 | # he_bss_color: BSS color (1-63) |
| 42 | #he_bss_color=1 |
| 43 | |
| 44 | diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 45 | index f519a76..223db56 100644 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 46 | --- a/src/ap/ap_config.c |
| 47 | +++ b/src/ap/ap_config.c |
developer | 9a58788 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 48 | @@ -269,6 +269,7 @@ struct hostapd_config * hostapd_config_defaults(void) |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 49 | #endif /* CONFIG_ACS */ |
| 50 | |
| 51 | #ifdef CONFIG_IEEE80211AX |
| 52 | + conf->he_phy_capab.he_ldpc = 1; |
| 53 | conf->he_op.he_rts_threshold = HE_OPERATION_RTS_THRESHOLD_MASK >> |
| 54 | HE_OPERATION_RTS_THRESHOLD_OFFSET; |
| 55 | /* Set default basic MCS/NSS set to single stream MCS 0-7 */ |
| 56 | diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 57 | index b8f6680..5b2dbff 100644 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 58 | --- a/src/ap/ap_config.h |
| 59 | +++ b/src/ap/ap_config.h |
developer | 9a58788 | 2023-07-17 11:11:44 +0800 | [diff] [blame] | 60 | @@ -956,6 +956,7 @@ struct hostapd_bss_config { |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 61 | * struct he_phy_capabilities_info - HE PHY capabilities |
| 62 | */ |
| 63 | struct he_phy_capabilities_info { |
| 64 | + bool he_ldpc; |
| 65 | bool he_su_beamformer; |
| 66 | bool he_su_beamformee; |
| 67 | bool he_mu_beamformer; |
| 68 | diff --git a/src/ap/ieee802_11_he.c b/src/ap/ieee802_11_he.c |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 69 | index 548a448..9407dd6 100644 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 70 | --- a/src/ap/ieee802_11_he.c |
| 71 | +++ b/src/ap/ieee802_11_he.c |
| 72 | @@ -138,6 +138,13 @@ u8 * hostapd_eid_he_capab(struct hostapd_data *hapd, u8 *eid, |
| 73 | os_memcpy(&cap->optional[mcs_nss_size], |
| 74 | mode->he_capab[opmode].ppet, ppet_size); |
| 75 | |
| 76 | + if (hapd->iface->conf->he_phy_capab.he_ldpc) |
| 77 | + cap->he_phy_capab_info[HE_PHYCAP_LDPC_CODING_IN_PAYLOAD_IDX] |= |
| 78 | + HE_PHYCAP_LDPC_CODING_IN_PAYLOAD; |
| 79 | + else |
| 80 | + cap->he_phy_capab_info[HE_PHYCAP_LDPC_CODING_IN_PAYLOAD_IDX] &= |
| 81 | + ~HE_PHYCAP_LDPC_CODING_IN_PAYLOAD; |
| 82 | + |
| 83 | if (hapd->iface->conf->he_phy_capab.he_su_beamformer) |
| 84 | cap->he_phy_capab_info[HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX] |= |
| 85 | HE_PHYCAP_SU_BEAMFORMER_CAPAB; |
| 86 | diff --git a/src/common/ieee802_11_defs.h b/src/common/ieee802_11_defs.h |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 87 | index 0b7b776..cf3ef98 100644 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 88 | --- a/src/common/ieee802_11_defs.h |
| 89 | +++ b/src/common/ieee802_11_defs.h |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 90 | @@ -2357,6 +2357,9 @@ struct ieee80211_spatial_reuse { |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 91 | #define HE_PHYCAP_CHANNEL_WIDTH_SET_160MHZ_IN_5G ((u8) BIT(3)) |
| 92 | #define HE_PHYCAP_CHANNEL_WIDTH_SET_80PLUS80MHZ_IN_5G ((u8) BIT(4)) |
| 93 | |
| 94 | +#define HE_PHYCAP_LDPC_CODING_IN_PAYLOAD_IDX 1 |
| 95 | +#define HE_PHYCAP_LDPC_CODING_IN_PAYLOAD ((u8) BIT(5)) |
| 96 | + |
| 97 | #define HE_PHYCAP_SU_BEAMFORMER_CAPAB_IDX 3 |
| 98 | #define HE_PHYCAP_SU_BEAMFORMER_CAPAB ((u8) BIT(7)) |
| 99 | #define HE_PHYCAP_SU_BEAMFORMEE_CAPAB_IDX 4 |
| 100 | -- |
developer | bddc9db | 2023-09-11 13:34:36 +0800 | [diff] [blame] | 101 | 2.18.0 |
developer | 092b55c | 2023-01-18 18:20:58 +0800 | [diff] [blame] | 102 | |