fw-api: CL 9967066 - update fw common interface files

Change-Id: If9993c59950bafc0171878f17f4591902e1098a4
WMI: service bit extension TLV array in SERVICE_AVAILABLE_EVENT msg
CRs-Fixed: 2262693
This commit is contained in:
spuligil 2020-03-20 18:00:49 -07:00 • committed by nshrivas
commit a2203a5587
4 changed files with 97 additions and 7 deletions

View file

@ -206,9 +206,13 @@ typedef enum {
/* NOTE:
* The above service flags are delivered in the wmi_service_bitmap field
* of the WMI_SERVICE_READY_EVENT message.
* The below service flags are delivered in a WMI_SERVICE_AVAILABLE_EVENT
* message rather than in the WMI_SERVICE_READY_EVENT message's
* wmi_service_bitmap field.
* The below service flags are not delivered in the
* WMI_SERVICE_READY_EVENT message's wmi_service_bitmap field,
* but instead are delivered in the
* fixed_param.wmi_service_segment_bitmap portion
* of the WMI_SERVICE_AVAILABLE_EVENT message, with
* fixed_param.wmi_service_segment_offset
* set to 128.
* The WMI_SERVICE_AVAILABLE_EVENT message immediately precedes the
* WMI_SERVICE_READY_EVENT message.
*/
@ -435,15 +439,38 @@ typedef enum {
WMI_SERVICE_BEACON_PROTECTION_SUPPORT = 244, /* Indicates FW supports WPA3 Beacon protection */
/******* ADD NEW SERVICES HERE *******/
/******* ADD NEW SERVICES UP TO 256 HERE *******/
WMI_MAX_EXT_SERVICE
WMI_MAX_EXT_SERVICE = 256,
/* NOTE:
* The above service flags are delivered in the
* fixed_param.wmi_service_segment_bitmap portion
* of the WMI_SERVICE_AVAILABLE_EVENT message, with
* fixed_param.wmi_service_segment_offset
* set to 128.
* The below service flags can be delivered in one of two ways:
* 1. The target can deliver a 2nd SERVICE_AVAILABLE message, with
* fixed_param.wmi_service_segment_offset
* set to 256.
* (This method is acceptable, but not recommended.)
* 2. The target can populate the wmi_service_ext_bitmap[] TLV array
* within the WMI_SERVICE_AVAILABLE_EVENT message.
* (This method is recommended.)
*/
/******* ADD NEW SERVICES 256 AND BEYOND HERE *******/
WMI_MAX_EXT2_SERVICE
} WMI_SERVICE;
#define WMI_SERVICE_BM_SIZE ((WMI_MAX_SERVICE + sizeof(A_UINT32)- 1)/sizeof(A_UINT32))
#define WMI_NUM_EXT_SERVICES (WMI_MAX_EXT_SERVICE - WMI_MAX_SERVICE)
#define WMI_NUM_EXT2_SERVICES (WMI_MAX_EXT2_SERVICE - WMI_MAX_EXT_SERVICE)
/*
* TEMPORARY WORKAROUND
@ -511,6 +538,50 @@ typedef enum {
(((pwmi_svc_ext_bmap)[((svc_id) - WMI_MAX_SERVICE) / 32] >> \
((svc_id) & 0x1f)) & 0x1))
#define WMI_SERVICE_EXT2_ENABLE( \
pwmi_svc_bmap, pwmi_svc_ext_bmap, pwmi_svc_ext2_bmap, svc_id) \
do { \
if (svc_id < WMI_MAX_SERVICE) { \
WMI_SERVICE_ENABLE(pwmi_svc_bmap, svc_id); \
} else if (svc_id < WMI_MAX_EXT_SERVICE) { \
WMI_SERVICE_EXT_ENABLE(pwmi_svc_bmap, pwmi_svc_ext_bmap, svc_id); \
} else { \
int word = ((svc_id) - WMI_MAX_EXT_SERVICE) / 32; \
int bit = (svc_id) & 0x1f; /* svc_id mod 32 */ \
(pwmi_svc_ext2_bmap)[word] |= (1 << bit); \
} \
} while (0)
#define WMI_SERVICE_EXT2_DISABLE( \
pwmi_svc_bmap, pwmi_svc_ext_bmap, pwmi_svc_ext2_bmap, svc_id) \
do { \
if (svc_id < WMI_MAX_SERVICE) { \
WMI_SERVICE_DISABLE(pwmi_svc_bmap, svc_id); \
} else if (svc_id < WMI_MAX_EXT_SERVICE) { \
WMI_SERVICE_DISABLE(pwmi_svc_bmap, pwmi_svc_ext_bmap, svc_id); \
} else { \
int word = ((svc_id) - WMI_MAX_EXT_SERVICE) / 32; \
int bit = (svc_id) & 0x1f; /* svc_id mod 32 */ \
(pwmi_svc_ext2_bmap)[word] &= ~(1 << bit); \
} \
} while (0)
#define WMI_SERVICE_EXT2_IS_ENABLED( \
pwmi_svc_bmap, pwmi_svc_ext_bmap, pwmi_svc_ext2_bmap, svc_id) \
/* If the service ID is beyond the known limit, treat it as disabled */ \
((svc_id) >= WMI_MAX_EXT2_SERVICE ? 0 : \
/* If service ID is in the non-extension range, use the old check */ \
(svc_id) < WMI_MAX_SERVICE ? \
WMI_SERVICE_IS_ENABLED(pwmi_svc_bmap, svc_id) : \
/* If service ID is in the 1st extended range, check ext_bmap */ \
(svc_id) < WMI_MAX_EXT_SERVICE ? \
WMI_SERVICE_EXT_IS_ENABLED( \
pwmi_svc_bmap, pwmi_svc_ext_bmap, svc_id) : \
/* \
* If service ID is in the 2nd extended range, check ext2_bmap \
*/ \
(((pwmi_svc_ext2_bmap)[((svc_id) - WMI_MAX_EXT_SERVICE) / 32] >> \
((svc_id) & 0x1f)) & 0x1))
#ifdef __cplusplus
}

View file

@ -4325,7 +4325,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_SERVICE_READY_EVENTID);
/* service available event */
#define WMITLV_TABLE_WMI_SERVICE_AVAILABLE_EVENTID(id,op,buf,len) \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_service_available_event_fixed_param, wmi_service_available_event_fixed_param, fixed_param, WMITLV_SIZE_FIX)
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_service_available_event_fixed_param, wmi_service_available_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \
/* \
* The wmi_service_ext_bitmap covers WMI service bits beyond the range \
* of the fixed_param.wmi_service_segment_bitmap[]. \
*/ \
WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, wmi_service_ext_bitmap, WMITLV_SIZE_VAR)
WMITLV_CREATE_PARAM_STRUC(WMI_SERVICE_AVAILABLE_EVENTID);
/* Service Ready Extension event */

View file

@ -2614,6 +2614,20 @@ typedef struct {
*/
A_UINT32 wmi_service_segment_offset;
A_UINT32 wmi_service_segment_bitmap[WMI_SERVICE_SEGMENT_BM_SIZE32];
/*
* This TLV is followed by the below TLVs:
* A_UINT32 wmi_service_ext_bitmap[]
* The wmi_service_ext_bitmap covers WMI service flags at the offset where
* wmi_service_available_event_fixed_param.wmi_service_segment_bitmap
* leaves off.
* For example, if
* wmi_service_available_event_fixed_param.wmi_service_segment_offset
* is 128, then
* wmi_service_available_event_fixed_param.wmi_service_segment_bitmap
* will cover WMI service flags
* 128 to (128 + WMI_SERVICE_SEGMENT_BM_SIZE32 * 32) = 128 to 256
* and wmi_service_ext_bitmap will cover WMI service flags starting at 256.
*/
} wmi_service_available_event_fixed_param;
typedef struct {

View file

@ -36,7 +36,7 @@
#define __WMI_VER_MINOR_ 0
/** WMI revision number has to be incremented when there is a
* change that may or may not break compatibility. */
#define __WMI_REVISION_ 798
#define __WMI_REVISION_ 799
/** The Version Namespace should not be normally changed. Only
* host and firmware of the same WMI namespace will work