diff --git a/target_if/mgmt_txrx/inc/target_if_mgmt_txrx_rx_reo.h b/target_if/mgmt_txrx/inc/target_if_mgmt_txrx_rx_reo.h index 57b04ab741..88ffb61156 100644 --- a/target_if/mgmt_txrx/inc/target_if_mgmt_txrx_rx_reo.h +++ b/target_if/mgmt_txrx/inc/target_if_mgmt_txrx_rx_reo.h @@ -32,10 +32,6 @@ #include #ifdef WLAN_MGMT_RX_REO_SUPPORT - -#define MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT (11) -#define MGMT_RX_REO_SNAPSHOT_READ_RETRY_LIMIT (25) - /** * target_if_get_mgmt_rx_reo_low_level_ops() - Get low-level ops of management * rx-reorder module diff --git a/target_if/mgmt_txrx/src/target_if_mgmt_txrx_rx_reo.c b/target_if/mgmt_txrx/src/target_if_mgmt_txrx_rx_reo.c index acf20399e2..8b862979a4 100644 --- a/target_if/mgmt_txrx/src/target_if_mgmt_txrx_rx_reo.c +++ b/target_if/mgmt_txrx/src/target_if_mgmt_txrx_rx_reo.c @@ -249,7 +249,8 @@ target_if_mgmt_rx_reo_read_snapshot_raw (struct mgmt_rx_reo_shared_snapshot *snapshot_address, uint32_t *mgmt_rx_reo_snapshot_low, uint32_t *mgmt_rx_reo_snapshot_high, - uint8_t snapshot_version) + uint8_t snapshot_version, + struct mgmt_rx_reo_shared_snapshot *raw_snapshot) { uint32_t prev_snapshot_low; uint32_t prev_snapshot_high; @@ -262,17 +263,28 @@ target_if_mgmt_rx_reo_read_snapshot_raw snapshot_address->mgmt_rx_reo_snapshot_low; *mgmt_rx_reo_snapshot_high = snapshot_address->mgmt_rx_reo_snapshot_high; + raw_snapshot->mgmt_rx_reo_snapshot_low = + *mgmt_rx_reo_snapshot_low; + raw_snapshot->mgmt_rx_reo_snapshot_high = + *mgmt_rx_reo_snapshot_high; return QDF_STATUS_SUCCESS; } prev_snapshot_low = snapshot_address->mgmt_rx_reo_snapshot_low; prev_snapshot_high = snapshot_address->mgmt_rx_reo_snapshot_high; + raw_snapshot->mgmt_rx_reo_snapshot_low = prev_snapshot_low; + raw_snapshot->mgmt_rx_reo_snapshot_high = prev_snapshot_high; - for (; retry_count < MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT; + for (; retry_count < (MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT - 1); retry_count++) { cur_snapshot_low = snapshot_address->mgmt_rx_reo_snapshot_low; cur_snapshot_high = snapshot_address->mgmt_rx_reo_snapshot_high; + raw_snapshot[retry_count + 1].mgmt_rx_reo_snapshot_low = + cur_snapshot_low; + raw_snapshot[retry_count + 1].mgmt_rx_reo_snapshot_high = + cur_snapshot_high; + if (prev_snapshot_low == cur_snapshot_low && prev_snapshot_high == cur_snapshot_high) break; @@ -282,7 +294,7 @@ target_if_mgmt_rx_reo_read_snapshot_raw } qdf_assert_always(retry_count != - MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT); + (MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT - 1)); *mgmt_rx_reo_snapshot_low = cur_snapshot_low; *mgmt_rx_reo_snapshot_high = cur_snapshot_high; @@ -306,7 +318,9 @@ target_if_mgmt_rx_reo_read_snapshot( struct wlan_objmgr_pdev *pdev, struct mgmt_rx_reo_snapshot_info *snapshot_info, enum mgmt_rx_reo_shared_snapshot_id id, - struct mgmt_rx_reo_snapshot_params *snapshot_value) + struct mgmt_rx_reo_snapshot_params *snapshot_value, + struct mgmt_rx_reo_shared_snapshot (*raw_snapshot) + [MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT]) { bool snapshot_valid; uint16_t mgmt_pkt_ctr; @@ -361,7 +375,8 @@ target_if_mgmt_rx_reo_read_snapshot( (snapshot_address, &mgmt_rx_reo_snapshot_low, &mgmt_rx_reo_snapshot_high, - snapshot_version); + snapshot_version, + raw_snapshot[retry_count]); if (QDF_IS_STATUS_ERROR(status)) { mgmt_rx_reo_err("Failed to read snapshot %d", @@ -376,8 +391,16 @@ target_if_mgmt_rx_reo_read_snapshot( if (!snapshot_valid) { mgmt_rx_reo_info("Invalid REO snapshot value"); snapshot_value->valid = false; - snapshot_value->mgmt_pkt_ctr = 0xFFFE; - snapshot_value->global_timestamp = 0xFFFFFFFE; + snapshot_value->mgmt_pkt_ctr = + low_level_ops->snapshot_get_mgmt_pkt_ctr + (mgmt_rx_reo_snapshot_low, + snapshot_version); + snapshot_value->global_timestamp = + low_level_ops->snapshot_get_global_timestamp + (mgmt_rx_reo_snapshot_low, + mgmt_rx_reo_snapshot_high, + snapshot_version); + snapshot_value->retry_count = retry_count + 1; return QDF_STATUS_SUCCESS; } @@ -409,6 +432,7 @@ target_if_mgmt_rx_reo_read_snapshot( snapshot_value->valid = false; snapshot_value->mgmt_pkt_ctr = 0xFFFF; snapshot_value->global_timestamp = 0xFFFFFFFF; + snapshot_value->retry_count = retry_count; qdf_assert_always(0); return QDF_STATUS_E_FAILURE; } @@ -416,6 +440,7 @@ target_if_mgmt_rx_reo_read_snapshot( snapshot_value->valid = true; snapshot_value->mgmt_pkt_ctr = mgmt_pkt_ctr; snapshot_value->global_timestamp = global_timestamp; + snapshot_value->retry_count = retry_count + 1; status = QDF_STATUS_SUCCESS; break; diff --git a/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo.c b/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo.c index 435fb5a19c..37e3bb796a 100644 --- a/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo.c +++ b/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo.c @@ -964,6 +964,7 @@ wlan_mgmt_rx_reo_algo_calculate_wait_count( uint8_t snapshot_id; struct wlan_objmgr_pdev *pdev; struct mgmt_rx_reo_pdev_info *rx_reo_pdev_ctx; + struct mgmt_rx_reo_pdev_info *in_frame_rx_reo_pdev_ctx; struct mgmt_rx_reo_snapshot_info *snapshot_info; struct mgmt_rx_reo_snapshot_params snapshot_params [MGMT_RX_REO_SHARED_SNAPSHOT_MAX]; @@ -1001,6 +1002,15 @@ wlan_mgmt_rx_reo_algo_calculate_wait_count( qdf_assert_always(in_frame_link < MAX_MLO_LINKS); qdf_assert_always(mgmt_rx_reo_is_valid_link(in_frame_link)); + in_frame_rx_reo_pdev_ctx = + wlan_mgmt_rx_reo_get_priv_object(in_frame_pdev); + if (!in_frame_rx_reo_pdev_ctx) { + mgmt_rx_reo_err("Reo context null for incoming frame pdev"); + return QDF_STATUS_E_FAILURE; + } + qdf_mem_zero(in_frame_rx_reo_pdev_ctx->raw_snapshots, + sizeof(in_frame_rx_reo_pdev_ctx->raw_snapshots)); + /* Iterate over all the valid MLO links */ for (link = 0; link < MAX_MLO_LINKS; link++) { /* No need wait for any frames on an invalid link */ @@ -1021,6 +1031,7 @@ wlan_mgmt_rx_reo_algo_calculate_wait_count( } host_ss = &rx_reo_pdev_ctx->host_snapshot; + desc->host_snapshot[link] = rx_reo_pdev_ctx->host_snapshot; mgmt_rx_reo_info("link_id = %u HOST SS: valid = %u, ctr = %u, ts = %u", link, host_ss->valid, host_ss->mgmt_pkt_ctr, @@ -1038,7 +1049,9 @@ wlan_mgmt_rx_reo_algo_calculate_wait_count( status = tgt_mgmt_rx_reo_read_snapshot( pdev, snapshot_info, snapshot_id, - &snapshot_params[snapshot_id]); + &snapshot_params[snapshot_id], + in_frame_rx_reo_pdev_ctx->raw_snapshots + [link][snapshot_id]); /* Read operation shouldn't fail */ if (QDF_IS_STATUS_ERROR(status)) { diff --git a/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo_i.h b/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo_i.h index eba3d0c735..be59121af3 100644 --- a/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo_i.h +++ b/umac/cmn_services/mgmt_txrx/core/src/wlan_mgmt_txrx_rx_reo_i.h @@ -101,6 +101,10 @@ struct mgmt_rx_reo_pdev_info { struct mgmt_rx_reo_snapshot_info host_target_shared_snapshot_info [MGMT_RX_REO_SHARED_SNAPSHOT_MAX]; struct mgmt_rx_reo_filter filter; + struct mgmt_rx_reo_shared_snapshot raw_snapshots[MAX_MLO_LINKS] + [MGMT_RX_REO_SHARED_SNAPSHOT_MAX] + [MGMT_RX_REO_SNAPSHOT_READ_RETRY_LIMIT] + [MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT]; }; /** diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_public_structs.h b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_public_structs.h index befd670613..8b1888a488 100644 --- a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_public_structs.h +++ b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_public_structs.h @@ -41,33 +41,6 @@ enum mgmt_rx_reo_shared_snapshot_id { MGMT_RX_REO_SHARED_SNAPSHOT_INVALID, }; -/* - * struct mgmt_rx_reo_snapshot_params - Represents the simplified version of - * Management Rx Frame snapshot for Host use. Note that this is different from - * the structure shared between the Host and FW/HW - * @valid: Whether this snapshot is valid - * @mgmt_pkt_ctr: MGMT packet counter. This will be local to a particular - * HW link - * @global_timestamp: Global timestamp.This is taken from a clock which is - * common across all the HW links - */ -struct mgmt_rx_reo_snapshot_params { - bool valid; - uint16_t mgmt_pkt_ctr; - uint32_t global_timestamp; -}; - -/* - * struct mgmt_rx_reo_snapshot_info - Information related to management Rx - * reorder snapshot - * @address: Snapshot address - * @version: Snapshot version - */ -struct mgmt_rx_reo_snapshot_info { - struct mgmt_rx_reo_shared_snapshot *address; - uint8_t version; -}; - /* * struct mgmt_rx_reo_shared_snapshot - Represents the management rx-reorder * shared snapshots @@ -93,6 +66,37 @@ struct mgmt_rx_reo_shared_snapshot { }; }; +#define MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT (11) +#define MGMT_RX_REO_SNAPSHOT_READ_RETRY_LIMIT (25) + +/* + * struct mgmt_rx_reo_snapshot_params - Represents the simplified version of + * Management Rx Frame snapshot for Host use. Note that this is different from + * the structure shared between the Host and FW/HW + * @valid: Whether this snapshot is valid + * @mgmt_pkt_ctr: MGMT packet counter. This will be local to a particular + * HW link + * @global_timestamp: Global timestamp.This is taken from a clock which is + * common across all the HW links + */ +struct mgmt_rx_reo_snapshot_params { + bool valid; + uint16_t mgmt_pkt_ctr; + uint32_t global_timestamp; + uint8_t retry_count; +}; + +/* + * struct mgmt_rx_reo_snapshot_info - Information related to management Rx + * reorder snapshot + * @address: Snapshot address + * @version: Snapshot version + */ +struct mgmt_rx_reo_snapshot_info { + struct mgmt_rx_reo_shared_snapshot *address; + uint8_t version; +}; + /* * struct mgmt_rx_reo_params - MGMT Rx REO parameters * @valid: Whether these params are valid diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_tgt_api.h b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_tgt_api.h index f187e29b34..8423a2d22f 100644 --- a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_tgt_api.h +++ b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_rx_reo_tgt_api.h @@ -114,7 +114,9 @@ tgt_mgmt_rx_reo_read_snapshot( struct wlan_objmgr_pdev *pdev, struct mgmt_rx_reo_snapshot_info *snapshot_info, enum mgmt_rx_reo_shared_snapshot_id id, - struct mgmt_rx_reo_snapshot_params *value); + struct mgmt_rx_reo_snapshot_params *value, + struct mgmt_rx_reo_shared_snapshot (*raw_snapshot) + [MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT]); /** * tgt_mgmt_rx_reo_fw_consumed_event_handler() - MGMT Rx REO FW consumed diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_rx_reo_tgt_api.c b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_rx_reo_tgt_api.c index cfdea027ee..736ac53f5b 100644 --- a/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_rx_reo_tgt_api.c +++ b/umac/cmn_services/mgmt_txrx/dispatcher/src/wlan_mgmt_txrx_rx_reo_tgt_api.c @@ -71,7 +71,9 @@ tgt_mgmt_rx_reo_read_snapshot( struct wlan_objmgr_pdev *pdev, struct mgmt_rx_reo_snapshot_info *snapshot_info, enum mgmt_rx_reo_shared_snapshot_id id, - struct mgmt_rx_reo_snapshot_params *value) + struct mgmt_rx_reo_snapshot_params *value, + struct mgmt_rx_reo_shared_snapshot (*raw_snapshot) + [MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT]) { struct wlan_lmac_if_mgmt_rx_reo_tx_ops *mgmt_rx_reo_txops; @@ -87,7 +89,8 @@ tgt_mgmt_rx_reo_read_snapshot( } return mgmt_rx_reo_txops->read_mgmt_rx_reo_snapshot(pdev, snapshot_info, - id, value); + id, value, + raw_snapshot); } /** 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 db0e5be127..3f146dc766 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 @@ -312,7 +312,9 @@ struct wlan_lmac_if_mgmt_rx_reo_tx_ops { (struct wlan_objmgr_pdev *pdev, struct mgmt_rx_reo_snapshot_info *snapshot_info, enum mgmt_rx_reo_shared_snapshot_id id, - struct mgmt_rx_reo_snapshot_params *value); + struct mgmt_rx_reo_snapshot_params *value, + struct mgmt_rx_reo_shared_snapshot (*raw_snapshot) + [MGMT_RX_REO_SNAPSHOT_B2B_READ_SWAR_RETRY_LIMIT]); QDF_STATUS (*get_mgmt_rx_reo_snapshot_info) (struct wlan_objmgr_pdev *pdev, enum mgmt_rx_reo_shared_snapshot_id id,