diff --git a/fw/wmi_services.h b/fw/wmi_services.h index 2d51191b3a..178c01f896 100644 --- a/fw/wmi_services.h +++ b/fw/wmi_services.h @@ -375,6 +375,7 @@ typedef enum { WMI_SERVICE_GET_MWS_IDRX_STATE = 190, /* FW provides LTE-Coex IDRx info */ WMI_SERVICE_GET_MWS_ANTENNA_SHARING_STATE = 191, /* FW provides LTE-Coex Antenna sharing info */ WMI_SERVICE_ENHANCED_TPC_CONFIG_EVENT = 192, /* FW provides enhanced tx power control configuration dump */ + WMI_SERVICE_WLM_STATS_REQUEST = 193, /* FW supports WLAN latency manager stats request */ /******* ADD NEW SERVICES HERE *******/ diff --git a/fw/wmi_tlv_defs.h b/fw/wmi_tlv_defs.h index dc48cd2b6e..5fec5951f4 100644 --- a/fw/wmi_tlv_defs.h +++ b/fw/wmi_tlv_defs.h @@ -962,6 +962,9 @@ typedef enum { WMITLV_TAG_STRUC_wmi_vdev_get_mws_coex_tdm_state_fixed_param, WMITLV_TAG_STRUC_wmi_vdev_get_mws_coex_idrx_state_fixed_param, WMITLV_TAG_STRUC_wmi_vdev_get_mws_coex_antenna_sharing_state_fixed_param, + WMITLV_TAG_STRUC_wmi_request_wlm_stats_cmd_fixed_param, + WMITLV_TAG_STRUC_wmi_wlm_stats_event_fixed_param, + WMITLV_TAG_STRUC_wmi_wlm_link_stats, } WMITLV_TAG_ID; /* @@ -1354,6 +1357,7 @@ typedef enum { OP(WMI_PEER_UNMAP_RESPONSE_CMDID) \ OP(WMI_ROAM_BSS_LOAD_CONFIG_CMDID) \ OP(WMI_VDEV_GET_MWS_COEX_INFO_CMDID) \ + OP(WMI_REQUEST_WLM_STATS_CMDID) \ /* add new CMD_LIST elements above this line */ @@ -1575,6 +1579,7 @@ typedef enum { OP(WMI_VDEV_GET_MWS_COEX_TDM_STATE_EVENTID) \ OP(WMI_VDEV_GET_MWS_COEX_IDRX_STATE_EVENTID) \ OP(WMI_VDEV_GET_MWS_COEX_ANTENNA_SHARING_STATE_EVENTID) \ + OP(WMI_WLM_STATS_EVENTID) \ /* add new EVT_LIST elements above this line */ @@ -2210,6 +2215,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_CLEAR_LINK_STATS_CMDID); WMITLV_CREATE_PARAM_STRUC(WMI_REQUEST_LINK_STATS_CMDID); +/* Request wlm stats Cmd */ +#define WMITLV_TABLE_WMI_REQUEST_WLM_STATS_CMDID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_request_wlm_stats_cmd_fixed_param, wmi_request_wlm_stats_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) + +WMITLV_CREATE_PARAM_STRUC(WMI_REQUEST_WLM_STATS_CMDID); + /* Network list offload config Cmd */ #define WMITLV_TABLE_WMI_NETWORK_LIST_OFFLOAD_CONFIG_CMDID(id,op,buf,len) \ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_nlo_config_cmd_fixed_param, wmi_nlo_config_cmd_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ @@ -4412,6 +4423,12 @@ WMITLV_CREATE_PARAM_STRUC(WMI_PEER_LINK_STATS_EVENTID); WMITLV_CREATE_PARAM_STRUC(WMI_RADIO_LINK_STATS_EVENTID); +/* Update WLM stats event */ +#define WMITLV_TABLE_WMI_WLM_STATS_EVENTID(id,op,buf,len) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_STRUC_wmi_wlm_stats_event_fixed_param, wmi_wlm_stats_event_fixed_param, fixed_param, WMITLV_SIZE_FIX) \ + WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_STRUC, wmi_wlm_link_stats, wlm_link_stats, WMITLV_SIZE_VAR) +WMITLV_CREATE_PARAM_STRUC(WMI_WLM_STATS_EVENTID); + /* PDEV QVIT Event */ #define WMITLV_TABLE_WMI_PDEV_QVIT_EVENTID(id,op,buf,len)\ WMITLV_ELEM(id,op,buf,len, WMITLV_TAG_ARRAY_BYTE, A_UINT8, data, WMITLV_SIZE_VAR) diff --git a/fw/wmi_unified.h b/fw/wmi_unified.h index c7ffe3a99a..237af46dd8 100644 --- a/fw/wmi_unified.h +++ b/fw/wmi_unified.h @@ -831,6 +831,10 @@ typedef enum { /** One time request for radio channel stats */ WMI_REQUEST_RADIO_CHAN_STATS_CMDID, + /** request for WLM (wlan latency manager) stats */ + WMI_REQUEST_WLM_STATS_CMDID, + + /** ARP OFFLOAD REQUEST*/ WMI_SET_ARP_NS_OFFLOAD_CMDID = WMI_CMD_GRP_START_ID(WMI_GRP_ARP_NS_OFL), @@ -1541,6 +1545,11 @@ typedef enum { * and report radio channel stats to host */ WMI_RADIO_CHAN_STATS_EVENTID, + /** This event is used to respond to WMI_REQUEST_WLM_STATS_CMDID + * and report WLM (WLAN latency manager) stats info to host */ + WMI_WLM_STATS_EVENTID, + + /* NLO specific events */ /** NLO match event after the first match */ WMI_NLO_MATCH_EVENTID = WMI_EVT_GRP_START_ID(WMI_GRP_NLO_OFL), @@ -6403,6 +6412,18 @@ typedef struct { wmi_mac_addr peer_macaddr; } wmi_request_link_stats_cmd_fixed_param; +#define WLM_STATS_REQ_LINK 0x00000001 +typedef struct { + A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_request_wlm_stats_cmd_fixed_param */ + /** unique id identifying the VDEV, generated by the caller */ + A_UINT32 vdev_id; + /** WLM event request bitmask + * Used by host to customize the wlm stats report. + * Filled with a combination of WLM_STATS_xxx values. + */ + A_UINT32 request_bitmask; +} wmi_request_wlm_stats_cmd_fixed_param; + /* channel statistics */ typedef struct { A_UINT32 tlv_header; /** TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_channel_stats */ @@ -6726,6 +6747,60 @@ typedef struct { */ } wmi_iface_link_stats_event_fixed_param; +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_wlm_stats_event_fixed_param */ + /** bitmask listing which WLM stats are provided. + * Copied from wlm_stats_cmd_fixed_param. + * (This field is provided for convenience rather than necessity, since + * the recipient can directly check which TLV arrays have non-zero length.) + */ + A_UINT32 request_bitmask; + /** unique id identifying the VDEV, generated by the caller */ + A_UINT32 vdev_id; + /** + * timestamp of event report, in microseconds units + * This timestamp is for debugging purposes only. + * It can be used to correlate this WLM stats event data with + * other WLM information uploaded through other means. + */ + A_UINT32 timestamp; + /** + * Interval between two consecutive WLM stats query requests, + * in microseconds units. + * This interval is used for converting the scan_period and pwr_on_period + * values from within wmi_wlm_link_stats from percentage units to time + * units. + */ + A_UINT32 req_interval; +/* + * This TLV is followed by another TLV of array of struct + * size of(struct wmi_wlm_link_stats); + */ +} wmi_wlm_stats_event_fixed_param; + +/** wlan latency manager stats report */ +typedef struct { + A_UINT32 tlv_header; /* TLV tag and len; tag equals WMITLV_TAG_STRUC_wmi_wlm_link_stats */ + /** average beacon rssi in dbm */ + A_INT32 bcn_rssi; + /** scan period, in units of percentage of req_interval */ + A_UINT32 scan_period; + /** power on period, in units of percentage of req_interval */ + A_UINT32 pwr_on_period; + /** congestion level, in units of percentage of req_interval */ + A_UINT32 congestion_level; + /** total phy_err count within req_interval */ + A_UINT32 phy_err; + /** total mpdu_err count within req_interval */ + A_UINT32 mpdu_err; + /** last TX rate in Mbps to bss peer */ + A_UINT32 last_tx_rate; + /** num_ac - how many elements of the ac_stats array contain valid data */ + A_UINT32 num_ac; + /** wmm ac stats */ + wmi_wmm_ac_stats ac_stats[WLAN_MAX_AC]; +} wmi_wlm_link_stats; + /** Suspend option */ enum { WMI_PDEV_SUSPEND, /* suspend */ @@ -23246,6 +23321,7 @@ static INLINE A_UINT8 *wmi_id_to_name(A_UINT32 wmi_command) WMI_RETURN_STRING(WMI_PEER_TX_PN_REQUEST_CMDID); WMI_RETURN_STRING(WMI_ROAM_BSS_LOAD_CONFIG_CMDID); WMI_RETURN_STRING(WMI_VDEV_GET_MWS_COEX_INFO_CMDID); + WMI_RETURN_STRING(WMI_REQUEST_WLM_STATS_CMDID); } return "Invalid WMI cmd"; diff --git a/fw/wmi_version.h b/fw/wmi_version.h index 33385f69a1..c5364d02fd 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_ 617 +#define __WMI_REVISION_ 618 /** The Version Namespace should not be normally changed. Only * host and firmware of the same WMI namespace will work