From b83596e8e6de327fef5ee40d988f430e903a09a9 Mon Sep 17 00:00:00 2001 From: maheshkkv Date: Thu, 14 Dec 2023 16:35:41 -0800 Subject: [PATCH] Make TWT wake interval 64 bit As the TWT Wake Interval Mantissa is a 2-byte field and TWT Wake Interval Exponent is a 5-bit field, Maximum TWT Wake Interval = 65,535 x [2^31] microseconds. So make TWT wake inteval 64 bit to avoid overflow. Bug: 296108122 Test: m Change-Id: Ib4736a98f50abd1b8d63e3c5fa32b2c540bbcb0f --- include/hardware_legacy/wifi_twt.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/include/hardware_legacy/wifi_twt.h b/include/hardware_legacy/wifi_twt.h index 1a787ef..cb11c78 100644 --- a/include/hardware_legacy/wifi_twt.h +++ b/include/hardware_legacy/wifi_twt.h @@ -31,8 +31,8 @@ typedef struct { u8 is_flexible_twt_supported; // 0 for not supporting flexible twt schedules u32 min_wake_duration_micros; // minimum twt wake duration capable in microseconds u32 max_wake_duration_micros; // maximum twt wake duration capable in microseconds - u32 min_wake_interval_micros; // minimum twt wake interval capable in microseconds - u32 max_wake_interval_micros; // maximum twt wake interval capable in microseconds + u64 min_wake_interval_micros; // minimum twt wake interval capable in microseconds + u64 max_wake_interval_micros; // maximum twt wake interval capable in microseconds } wifi_twt_capabilities; /* TWT request parameters to setup or update a TWT session */ @@ -41,8 +41,8 @@ typedef struct { // Otherwise UNSPECIFIED. u32 min_wake_duration_micros; // minimum twt wake duration in microseconds u32 max_wake_duration_micros; // maximum twt wake duration in microseconds - u32 min_wake_interval_micros; // minimum twt wake interval in microseconds - u32 max_wake_interval_micros; // maximum twt wake interval in microseconds + u64 min_wake_interval_micros; // minimum twt wake interval in microseconds + u64 max_wake_interval_micros; // maximum twt wake interval in microseconds } wifi_twt_request; /* TWT negotiation types */ @@ -56,7 +56,7 @@ typedef struct { u32 session_id; // a unique identifier for the session s8 mlo_link_id; // link id in case of MLO connection. Otherwise UNSPECIFIED. u32 wake_duration_micros; // TWT service period in microseconds - u32 wake_interval_micros; // TWT wake interval for this session in microseconds + u64 wake_interval_micros; // TWT wake interval for this session in microseconds wifi_twt_negotiation_type negotiation_type; // TWT negotiation type u8 is_trigger_enabled; // 0 if this TWT session is not trigger enabled u8 is_announced; // 0 if this TWT session is not announced