diff --git a/dp/inc/cdp_txrx_cmn_struct.h b/dp/inc/cdp_txrx_cmn_struct.h index 0b4778584d..2d661e6a27 100644 --- a/dp/inc/cdp_txrx_cmn_struct.h +++ b/dp/inc/cdp_txrx_cmn_struct.h @@ -2129,22 +2129,22 @@ struct cdp_tx_completion_ppdu_user { uint8_t sa_is_training; uint32_t rssi_chain[CDP_RSSI_CHAIN_LEN]; uint32_t sa_tx_antenna; - /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ - * |---------------------------------------| - * | 16 bits | 16 bits | 16 bits | 16 bits | - * | BW-1 | BW-2 | BW-3 | BW-4 | - * | /\ \ | - * | / \ \ | - * | / \ \ | - * | / \ \ | - * | / \ \ | - * | / \ \ | - * |/ \ \ | - * |[11|8] [5|8] \ | - * | BW1 PADDED \ | - * |---------------------------------------| + /*Max rates for BW: 20MHZ, 40MHZ and 80MHZ and 160MHZ and 320MHZ + * |-------------------------------------------------| + * | 16 bits | 16 bits | 16 bits | 16 bits | 16 bits | + * | BW-1 | BW-2 | BW-3 | BW-4 | BW-5 | + * | /\ \ | + * | / \ \ | + * | / \ \ | + * | / \ \ | + * | / \ \ | + * | / \ \ | + * |/ \ \ | + * |[11|8] [5|8] \ | + * | BW1 PADDED \ | + * |-------------------------------------------------| */ - uint16_t sa_max_rates[CDP_NUM_SA_BW]; + uint16_t sa_max_rates[CDP_NUM_SA_BW + 1]; uint32_t sa_goodput; /* below field is used to calculate goodput in non-training period * Note: As host is exposing goodput and hence current_rate_per is diff --git a/dp/wifi3.0/monitor/dp_mon.c b/dp/wifi3.0/monitor/dp_mon.c index 21300dfbe4..0f7f85ea10 100644 --- a/dp/wifi3.0/monitor/dp_mon.c +++ b/dp/wifi3.0/monitor/dp_mon.c @@ -4133,6 +4133,14 @@ static void dp_process_ppdu_stats_user_cmpltn_common_tlv( tag_buf += CDP_NUM_SA_BW; ppdu_user_desc->current_rate_per = HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_CURRENT_RATE_PER_GET(*tag_buf); + + tag_buf++; + /* Skip SW RTS */ + + tag_buf++; + /* Extract 320MHz MAX PHY ratecode */ + ppdu_user_desc->sa_max_rates[bw_iter] = + HTT_PPDU_STATS_USER_CMPLTN_COMMON_TLV_MAX_RATES_GET(*tag_buf); } /** diff --git a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h index 04fb85e0a1..c7dd2b3c18 100644 --- a/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h +++ b/umac/global_umac_dispatcher/lmac_if/inc/wlan_lmac_if_def.h @@ -730,15 +730,15 @@ struct wlan_lmac_if_fd_tx_ops { /** * struct wlan_lmac_if_sa_api_tx_ops - SA API specific tx function pointers - * @sa_api_register_event_handler: - * @sa_api_unregister_event_handler: - * @sa_api_enable_sa: - * @sa_api_set_rx_antenna: - * @sa_api_set_tx_antenna: - * @sa_api_set_tx_default_antenna: - * @sa_api_set_training_info: - * @sa_api_prepare_rateset: - * @sa_api_set_node_config_ops: + * @sa_api_register_event_handler: Register event handler for Smart Antenna + * @sa_api_unregister_event_handler: Unregister event handler for Smart Antenna + * @sa_api_enable_sa: Enable Smart Antenna + * @sa_api_set_rx_antenna: Set Rx antenna + * @sa_api_set_tx_antenna: Set Tx antenna + * @sa_api_set_tx_default_antenna: Set default Tx antenna + * @sa_api_set_training_info: Set Smart Antenna training metrics + * @sa_api_prepare_rateset: Prepare rest set + * @sa_api_set_node_config_ops: Set Peer config operations structure */ struct wlan_lmac_if_sa_api_tx_ops { void (*sa_api_register_event_handler)(struct wlan_objmgr_psoc *psoc); @@ -754,7 +754,9 @@ struct wlan_lmac_if_sa_api_tx_ops { void (*sa_api_set_training_info) (struct wlan_objmgr_peer *peer, uint32_t *rate_array, uint32_t *antenna_array, - uint32_t numpkts); + uint32_t numpkts, + uint16_t minpkts, + uint16_t per_threshold); void (*sa_api_prepare_rateset)(struct wlan_objmgr_pdev *pdev, struct wlan_objmgr_peer *peer, struct sa_rate_info *rate_info); diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index 74674960a1..6d1b88cf38 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -7026,7 +7026,8 @@ typedef struct { /* Maximum MCS rates supported; 4 rates in each dword */ /* Maximum MCS ratecodes with 11ax */ #define WMI_SA_MAX_MCS_RATES 96 -#define WMI_SA_MAX_RATE_COUNTERS 4 +/* Maximum ratecode per BW supported legacy, 20, 40, 80, 160 and 320 MHz */ +#define WMI_SA_MAX_RATE_COUNTERS 6 /* Maximum rate series used for transmission */ #define SA_MAX_RATE_SERIES 2 @@ -7043,14 +7044,21 @@ typedef struct { #define SA_MAX_LEGACY_RATE_WORDS 6 #define SA_MAX_HT_RATE_WORDS 48 -/* TODO: ratecode_160 needs to add for future chips */ +#define SA_INVALID_PARAM_VALUE 0xffff +/* Mask to check PER threshold */ +#define SA_MASK_PER_TH 0xff +/* Mask to check Minimum packets for Smart Antenna Training */ +#define SA_MASK_MIN_PKTS 0xffff + /** * struct wmi_sa_rate_cap - smart antenna rat capabilities * @pdev_id: pdev_id * @ratecode_legacy: Rate code array for CCK OFDM - * @ratecode_20: Rate code array for 20MHz BW - * @ratecode_40: Rate code array for 40MHz BW - * @ratecode_80: Rate code array for 80MHz BW + * @ratecode_20: Rate code array for 20 MHz BW + * @ratecode_40: Rate code array for 40 MHz BW + * @ratecode_80: Rate code array for 80 MHz BW + * @ratecode_160: Rate code array for 160 MHz BW + * @ratecode_320: Rate code array for 320 MHz BW * @ratecount: Max Rate count for each mode */ typedef struct { @@ -7058,6 +7066,8 @@ typedef struct { uint16_t ratecode_20[WMI_SA_MAX_MCS_RATES]; uint16_t ratecode_40[WMI_SA_MAX_MCS_RATES]; uint16_t ratecode_80[WMI_SA_MAX_MCS_RATES]; + uint16_t ratecode_160[WMI_SA_MAX_MCS_RATES]; + uint16_t ratecode_320[WMI_SA_MAX_MCS_RATES]; uint8_t ratecount[WMI_SA_MAX_RATE_COUNTERS]; } wmi_sa_rate_cap;