From a2203a55871e14c3c8dbf284d8b270a8bb5f2a03 Mon Sep 17 00:00:00 2001 From: spuligil Date: Fri, 20 Mar 2020 18:00:49 -0700 Subject: [PATCH] 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 --- fw/wmi_services.h | 81 ++++++++++++++++++++++++++++++++++++++++++++--- fw/wmi_tlv_defs.h | 7 +++- fw/wmi_unified.h | 14 ++++++++ fw/wmi_version.h | 2 +- 4 files changed, 97 insertions(+), 7 deletions(-) diff --git a/fw/wmi_services.h b/fw/wmi_services.h index a7a852f2c5c2..f51107b89825 100644 --- a/fw/wmi_services.h +++ b/fw/wmi_services.h @@ -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 } diff --git a/fw/wmi_tlv_defs.h b/fw/wmi_tlv_defs.h index ebf846308762..823773d66f42 100644 --- a/fw/wmi_tlv_defs.h +++ b/fw/wmi_tlv_defs.h @@ -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 */ diff --git a/fw/wmi_unified.h b/fw/wmi_unified.h index 27a2ece9de9e..9b77a3a155be 100644 --- a/fw/wmi_unified.h +++ b/fw/wmi_unified.h @@ -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 { diff --git a/fw/wmi_version.h b/fw/wmi_version.h index 1f60110f35e7..f5bade0dfe47 100644 --- a/fw/wmi_version.h +++ b/fw/wmi_version.h @@ -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