diff --git a/fw/wmi_tlv_defs.h b/fw/wmi_tlv_defs.h index db953adcd1..024814e851 100644 --- a/fw/wmi_tlv_defs.h +++ b/fw/wmi_tlv_defs.h @@ -1447,6 +1447,8 @@ typedef enum { WMITLV_TAG_STRUC_wmi_regulatory_rule_meta_data, WMITLV_TAG_STRUC_wmi_vdev_report_ap_oper_bw_cmd_fixed_param, WMITLV_TAG_STRUC_wmi_mlo_peer_tid_to_link_map_event_fixed_param, + WMITLV_TAG_STRUC_wmi_usd_service_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_usd_service_event_fixed_param, } WMITLV_TAG_ID; /* * IMPORTANT: Please add _ALL_ WMI Commands Here. @@ -2000,6 +2002,7 @@ typedef enum { OP(WMI_SET_AP_SUSPEND_RESUME_CMDID) \ OP(WMI_P2P_GO_DFS_AP_CONFIG_CMDID) \ OP(WMI_VDEV_REPORT_AP_OPER_BW_CMDID) \ + OP(WMI_USD_SERVICE_CMDID) \ /* add new CMD_LIST elements above this line */ @@ -2327,6 +2330,7 @@ typedef enum { OP(WMI_MGMT_SRNG_REAP_EVENTID) \ OP(WMI_MLO_TLT_SELECTION_FOR_TID_SPRAY_EVENTID) \ OP(WMI_MLO_PEER_TID_TO_LINK_MAP_EVENTID) \ + OP(WMI_USD_SERVICE_EVENTID) \ /* add new EVT_LIST elements above this line */ @@ -5652,6 +5656,14 @@ WMITLV_CREATE_PARAM_STRUC(WMI_SET_AP_SUSPEND_RESUME_CMDID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_vdev_report_ap_oper_bw_cmd_fixed_param, wmi_vdev_report_ap_oper_bw_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_VDEV_REPORT_AP_OPER_BW_CMDID); +/* Unsynchronized Service Discovery Service Cmd */ +#define WMITLV_TABLE_WMI_USD_SERVICE_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_usd_service_cmd_fixed_param, wmi_usd_service_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, element_container_attr_data, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_UINT32, A_UINT32, chan_list, WMITLV_SIZE_VAR) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, service_specific_info, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_USD_SERVICE_CMDID); + /************************** TLV definitions of WMI events *******************************/ @@ -7715,6 +7727,11 @@ WMITLV_CREATE_PARAM_STRUC(WMI_MGMT_SRNG_REAP_EVENTID); WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_mlo_peer_tid_to_link_map_event_fixed_param, wmi_mlo_peer_tid_to_link_map_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) WMITLV_CREATE_PARAM_STRUC(WMI_MLO_PEER_TID_TO_LINK_MAP_EVENTID); +/* USD Service Event */ +#define WMITLV_TABLE_WMI_USD_SERVICE_EVENTID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_usd_service_event_fixed_param, wmi_usd_service_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) +WMITLV_CREATE_PARAM_STRUC(WMI_USD_SERVICE_EVENTID); + #ifdef __cplusplus } diff --git a/fw/wmi_unified.h b/fw/wmi_unified.h index 56ee371f89..936cb5a13b 100644 --- a/fw/wmi_unified.h +++ b/fw/wmi_unified.h @@ -258,6 +258,27 @@ static INLINE void wmi_packed_arr_set_bits(A_UINT32 *arr, A_UINT32 entry_index, (pwmi_mac_addr)->mac_addr47to32 = ((c_macaddr)[4] | ((c_macaddr)[5] << 8));\ } while (0) +/** macro to convert generic hash of 6 bytes from WMI word format to char array */ +#define WMI_GENERIC_HASH_TO_CHAR_ARRAY(pwmi_generic_hash,c_generic_hash) do { \ + (c_generic_hash)[0] = (((pwmi_generic_hash)->generic_hash31to0) >> 0) & 0xff; \ + (c_generic_hash)[1] = (((pwmi_generic_hash)->generic_hash31to0) >> 8) & 0xff; \ + (c_generic_hash)[2] = (((pwmi_generic_hash)->generic_hash31to0) >> 16) & 0xff; \ + (c_generic_hash)[3] = (((pwmi_generic_hash)->generic_hash31to0) >> 24) & 0xff; \ + (c_generic_hash)[4] = (((pwmi_generic_hash)->generic_hash47to32) >> 0) & 0xff; \ + (c_generic_hash)[5] = (((pwmi_generic_hash)->generic_hash47to32) >> 8) & 0xff; \ +} while (0) + +/** macro to convert generic hash from char array to WMI word format */ +#define WMI_CHAR_ARRAY_TO_GENERIC_HASH(c_generic_hash,pwmi_generic_hash) do { \ + (pwmi_generic_hash)->generic_hash31to0 = \ + (((A_UINT32)(c_generic_hash)[0] << 0) | \ + ((A_UINT32)(c_generic_hash)[1] << 8) | \ + ((A_UINT32)(c_generic_hash)[2] << 16) | \ + ((A_UINT32)(c_generic_hash)[3] << 24)); \ + (pwmi_generic_hash)->generic_hash47to32 = \ + ((c_generic_hash)[4] | ((c_generic_hash)[5] << 8)); \ +} while (0) + /* * The below function declarations are for implementations on some * platforms of the above macros, but in function form, to save code @@ -1319,6 +1340,9 @@ typedef enum { /** WMI command to Request SAP suspend/resume */ WMI_SET_AP_SUSPEND_RESUME_CMDID, + /** Unsynchronized Service Discovery */ + WMI_USD_SERVICE_CMDID, + /* Offload 11k related requests */ WMI_11K_OFFLOAD_REPORT_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_11K_OFFLOAD), @@ -2346,6 +2370,11 @@ typedef enum { /* WMI evt to indicate switch type either to WLAN(XPAN) or non_WLAN(BLE) */ WMI_AUDIO_TRANSPORT_SWITCH_TYPE_EVENTID, + /** Usynchronized Service Discovery: + * Send USD event with USD mode status as success or fail. + */ + WMI_USD_SERVICE_EVENTID, + /* GPIO Event */ WMI_GPIO_INPUT_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_GPIO), @@ -31460,6 +31489,78 @@ typedef struct { /** This is followed by a TLV array of wmi_ocb_schedule_element. */ } wmi_ocb_set_config_cmd_fixed_param; +/** WMI Generic hash to be used by any 6 byte or 8 byte hash + * Used for 6 byte USD Service ID + */ +typedef struct _wmi_generic_hash { + /** upper 4 bytes of hash */ + A_UINT32 generic_hash31to0; + /** lower 4 bytes of hash */ + A_UINT32 generic_hash47to32; +} wmi_generic_hash; + +typedef struct { + /** TLV tag and len; tag equals + * WMITLV_TAG_STRUC_wmi_usd_add_delete_update_service_cmd_fixed_param */ + A_UINT32 tlv_header; + A_UINT32 vdev_id; + /* picks service type from WMI_USD_MODE */ + A_UINT32 usd_mode; + /* element_container_attribute struct: + * A_UINT8 element_container_attr_data[element_container_attr_len] */ + A_UINT32 element_container_attr_data_len; + /* 6 bytes of service id hash */ + wmi_generic_hash service_id; + /* Instance ID of the service */ + A_UINT32 instance_id; + /* Default frequency in MHz */ + A_UINT32 default_freq; + /* length of the Service Specific Info */ + A_UINT32 service_specific_info_len; + /* Time to live in seconds */ + A_UINT32 time_to_live; + /* picks protocol type from WMI_USD_SERVICE_PROTOCOL_TYPE */ + A_UINT32 protocol_type; + wmi_mac_addr device_mac_addr; +} wmi_usd_service_cmd_fixed_param; + +typedef struct { + A_UINT32 tlv_header; + A_UINT32 vdev_id; + /* picks values from WMI_USD_MODE_STATUS */ + A_UINT32 usd_mode_status; +} wmi_usd_service_event_fixed_param; + +typedef enum { + WMI_USD_MODE_FLUSH, + WMI_USD_MODE_PUBLISH, + WMI_USD_MODE_SUBSCRIBE, + WMI_USD_MODE_UPDATE_PUBLISH, + WMI_USD_MODE_CANCEL_PUBLISH, + WMI_USD_MODE_CANCEL_SUBSCRIBE, +} WMI_USD_MODE; + +typedef enum { + WMI_USD_MODE_FLUSH_SUCCESS, + WMI_USD_MODE_FLUSH_FAIL, + WMI_USD_MODE_PUBLISH_SUCCESS, + WMI_USD_MODE_PUBLISH_FAIL, + WMI_USD_MODE_SUBSCRIBE_SUCCESS, + WMI_USD_MODE_SUBSCRIBE_FAIL, + WMI_USD_MODE_UPDATE_PUBLISH_SUCCESS, + WMI_USD_MODE_UPDATE_PUBLISH_FAIL, + WMI_USD_MODE_CANCEL_PUBLISH_SUCCESS, + WMI_USD_MODE_CANCEL_PUBLISH_FAIL, + WMI_USD_MODE_CANCEL_SUBSCRIBE_SUCCESS, + WMI_USD_MODE_CANCEL_SUBSCRIBE_FAIL, +} WMI_USD_MODE_STATUS; + +typedef enum { + WMI_USD_SERVICE_PROTOCOL_TYPE_BONJOUR = 1, + WMI_USD_SERVICE_PROTOCOL_TYPE_GENERIC = 2, + WMI_USD_SERVICE_PROTOCOL_TYPE_CSA_MATTER = 3, +} WMI_USD_SERVICE_PROTOCOL_TYPE; + #define EXPIRY_TIME_IN_TSF_TIMESTAMP_OFFSET 0 #define EXPIRY_TIME_IN_TSF_TIMESTAMP_MASK 1 diff --git a/fw/wmi_version.h b/fw/wmi_version.h index 1ad80f1f23..656d21d734 100644 --- a/fw/wmi_version.h +++ b/fw/wmi_version.h @@ -37,7 +37,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_ 1504 +#define __WMI_REVISION_ 1505 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work