From 83f30fabe3ab24ae00572493f74521781d6f6470 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Tue, 16 Apr 2019 14:33:58 +0200 Subject: [PATCH] HE: Disable TXOP duration-based RTS if he_rts_threshold is not set IEEE P802.11ax/D4.0 9.4.2.243 "HE Operation element" indicates that the special value 1023 in the TXOP Duration RTS Threshold field is used to indicate that TXOP duration-based RTS is disabled. Use that value as the default instead of the previously used value 0 which would really mean threshold of 0 usec. Furthermore, the previous implementation did not allow values larger than 255 to be used for this field while the field is actually 10 bits in size. Signed-off-by: Shashidhar Lakkavalli Signed-off-by: John Crispin --- src/ap/ap_config.c | 5 +++++ src/ap/ap_config.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ap/ap_config.c b/src/ap/ap_config.c index 07b818eb3..2ace6023a 100644 --- a/src/ap/ap_config.c +++ b/src/ap/ap_config.c @@ -236,6 +236,11 @@ struct hostapd_config * hostapd_config_defaults(void) conf->acs_num_scans = 5; #endif /* CONFIG_ACS */ +#ifdef CONFIG_IEEE80211AX + conf->he_op.he_rts_threshold = HE_OPERATION_RTS_THRESHOLD_MASK >> + HE_OPERATION_RTS_THRESHOLD_OFFSET; +#endif /* CONFIG_IEEE80211AX */ + /* The third octet of the country string uses an ASCII space character * by default to indicate that the regulations encompass all * environments for the current frequency band in the country. */ diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h index 19eda67e1..84b6b786f 100644 --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h @@ -737,7 +737,7 @@ struct he_operation { u8 he_bss_color; u8 he_default_pe_duration; u8 he_twt_required; - u8 he_rts_threshold; + u16 he_rts_threshold; }; /**