diff --git a/dp/inc/cdp_txrx_mob_def.h b/dp/inc/cdp_txrx_mob_def.h index b68867f28983..191e5f7efb93 100644 --- a/dp/inc/cdp_txrx_mob_def.h +++ b/dp/inc/cdp_txrx_mob_def.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -104,8 +105,9 @@ enum netif_action_type { WLAN_NETIF_VI_QUEUE_ON = 14, WLAN_NETIF_VI_QUEUE_OFF = 15, WLAN_NETIF_BE_BK_QUEUE_OFF = 16, - WLAN_WAKE_NON_PRIORITY_QUEUE = 17, - WLAN_STOP_NON_PRIORITY_QUEUE = 18, + WLAN_NETIF_BE_BK_QUEUE_ON = 17, + WLAN_WAKE_NON_PRIORITY_QUEUE = 18, + WLAN_STOP_NON_PRIORITY_QUEUE = 19, WLAN_NETIF_ACTION_TYPE_MAX, }; @@ -128,6 +130,10 @@ enum netif_reason_type { WLAN_PEER_UNAUTHORISED, WLAN_THERMAL_MITIGATION, WLAN_DATA_FLOW_CONTROL_PRIORITY, + WLAN_DATA_FLOW_CTRL_BE_BK, + WLAN_DATA_FLOW_CTRL_VI, + WLAN_DATA_FLOW_CTRL_VO, + WLAN_DATA_FLOW_CTRL_PRI, WLAN_REASON_TYPE_MAX, }; diff --git a/dp/inc/cdp_txrx_stats_struct.h b/dp/inc/cdp_txrx_stats_struct.h index de4ed05f0882..34bd143389c5 100644 --- a/dp/inc/cdp_txrx_stats_struct.h +++ b/dp/inc/cdp_txrx_stats_struct.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -465,8 +465,46 @@ struct cdp_tidq_stats { * @rtt_che_buffer_pointer_low32 : The low 32 bits of the 40 bits pointer to * external RTT channel information buffer * + * @rtt_cfo_measurement : raw cfo data extracted from hardware, which is 14 bit + * signed number. The first bit used for sign representation and 13 bits for + * fractional part. + * + * @agc_gain_info0: Chain 0 & chain 1 agc gain information reported by PHY + * + * @agc_gain_info1: Chain 2 & chain 3 agc gain information reported by PHY + * + * @agc_gain_info2: Chain 4 & chain 5 agc gain information reported by PHY + * + * @agc_gain_info3: Chain 6 & chain 7 agc gain information reported by PHY + * + * @rx_start_ts: Rx packet timestamp, the time the first L-STF ADC sample + * arrived at Rx antenna. + * + * @mcs_rate: Indicates the mcs/rate in which packet is received. + * If HT, + * 0-7: MCS0-MCS7 + * If VHT, + * 0-9: MCS0 to MCS9 + * If HE, + * 0-11: MCS0 to MCS11, + * 12-13: 4096QAM, + * 14-15: reserved + * If Legacy, + * 0: 48 Mbps + * 1: 24 Mbps + * 2: 12 Mbps + * 3: 6 Mbps + * 4: 54 Mbps + * 5: 36 Mbps + * 6: 18 Mbps + * 7: 9 Mbps + * + * @gi_type: Indicates the gaurd interval. + * 0: 0.8 us + * 1: 0.4 us + * 2: 1.6 us + * 3: 3.2 us */ - struct cdp_rx_ppdu_cfr_info { bool bb_captured_channel; bool bb_captured_timeout; @@ -475,6 +513,14 @@ struct cdp_rx_ppdu_cfr_info { uint8_t chan_capture_status; uint8_t rtt_che_buffer_pointer_high8; uint32_t rtt_che_buffer_pointer_low32; + int16_t rtt_cfo_measurement; + uint32_t agc_gain_info0; + uint32_t agc_gain_info1; + uint32_t agc_gain_info2; + uint32_t agc_gain_info3; + uint32_t rx_start_ts; + uint32_t mcs_rate; + uint32_t gi_type; }; #endif /* diff --git a/dp/wifi3.0/dp_rx_mon_status.c b/dp/wifi3.0/dp_rx_mon_status.c index 53cf6b3671d7..1d7e1d0fcaad 100644 --- a/dp/wifi3.0/dp_rx_mon_status.c +++ b/dp/wifi3.0/dp_rx_mon_status.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -489,6 +489,16 @@ dp_rx_populate_cdp_indication_ppdu(struct dp_pdev *pdev, cdp_rx_ppdu->lsig_a = ppdu_info->rx_status.rate; cdp_rx_ppdu->u.ltf_size = ppdu_info->rx_status.ltf_size; + if (ppdu_info->rx_status.preamble_type == HAL_RX_PKT_TYPE_11AC) { + cdp_rx_ppdu->u.stbc = ppdu_info->rx_status.is_stbc; + } else if (ppdu_info->rx_status.preamble_type == + HAL_RX_PKT_TYPE_11AX) { + cdp_rx_ppdu->u.stbc = (ppdu_info->rx_status.he_data3 >> + QDF_MON_STATUS_STBC_SHIFT) & 0x1; + cdp_rx_ppdu->u.dcm = (ppdu_info->rx_status.he_data3 >> + QDF_MON_STATUS_DCM_SHIFT) & 0x1; + } + dp_rx_populate_rx_rssi_chain(ppdu_info, cdp_rx_ppdu); dp_rx_populate_su_evm_details(ppdu_info, cdp_rx_ppdu); cdp_rx_ppdu->rx_antenna = ppdu_info->rx_status.rx_antenna; @@ -1187,17 +1197,66 @@ dp_rx_mon_populate_cfr_ppdu_info(struct dp_pdev *pdev, struct hal_rx_ppdu_info *ppdu_info, struct cdp_rx_indication_ppdu *cdp_rx_ppdu) { + struct dp_peer *peer; + struct dp_ast_entry *ast_entry; + struct dp_soc *soc = pdev->soc; + uint32_t ast_index; int chain; cdp_rx_ppdu->ppdu_id = ppdu_info->com_info.ppdu_id; cdp_rx_ppdu->timestamp = ppdu_info->rx_status.tsft; cdp_rx_ppdu->u.ppdu_type = ppdu_info->rx_status.reception_type; - cdp_rx_ppdu->num_users = ppdu_info->com_info.num_users; for (chain = 0; chain < MAX_CHAIN; chain++) cdp_rx_ppdu->per_chain_rssi[chain] = ppdu_info->rx_status.rssi[chain]; + + cdp_rx_ppdu->u.ltf_size = ppdu_info->rx_status.ltf_size; + cdp_rx_ppdu->beamformed = ppdu_info->rx_status.beamformed; + cdp_rx_ppdu->u.ldpc = ppdu_info->rx_status.ldpc; + + if ((ppdu_info->rx_status.sgi == VHT_SGI_NYSM) && + (ppdu_info->rx_status.preamble_type == HAL_RX_PKT_TYPE_11AC)) + cdp_rx_ppdu->u.gi = CDP_SGI_0_4_US; + else + cdp_rx_ppdu->u.gi = ppdu_info->rx_status.sgi; + + if (ppdu_info->rx_status.preamble_type == HAL_RX_PKT_TYPE_11AC) { + cdp_rx_ppdu->u.stbc = ppdu_info->rx_status.is_stbc; + } else if (ppdu_info->rx_status.preamble_type == + HAL_RX_PKT_TYPE_11AX) { + cdp_rx_ppdu->u.stbc = (ppdu_info->rx_status.he_data3 >> + QDF_MON_STATUS_STBC_SHIFT) & 0x1; + cdp_rx_ppdu->u.dcm = (ppdu_info->rx_status.he_data3 >> + QDF_MON_STATUS_DCM_SHIFT) & 0x1; + } + dp_rx_mon_handle_cfr_mu_info(pdev, ppdu_info, cdp_rx_ppdu); + ast_index = ppdu_info->rx_status.ast_index; + if (ast_index >= wlan_cfg_get_max_ast_idx(soc->wlan_cfg_ctx)) { + cdp_rx_ppdu->peer_id = HTT_INVALID_PEER; + cdp_rx_ppdu->num_users = 0; + return; + } + + ast_entry = soc->ast_table[ast_index]; + if (!ast_entry || ast_entry->peer_id == HTT_INVALID_PEER) { + cdp_rx_ppdu->peer_id = HTT_INVALID_PEER; + cdp_rx_ppdu->num_users = 0; + return; + } + + peer = dp_peer_get_ref_by_id(soc, ast_entry->peer_id, + DP_MOD_ID_RX_PPDU_STATS); + if (!peer) { + cdp_rx_ppdu->peer_id = HTT_INVALID_PEER; + cdp_rx_ppdu->num_users = 0; + return; + } + + cdp_rx_ppdu->peer_id = peer->peer_id; + cdp_rx_ppdu->vdev_id = peer->vdev->vdev_id; + cdp_rx_ppdu->num_users = ppdu_info->com_info.num_users; } /** @@ -1247,6 +1306,22 @@ dp_rx_mon_populate_cfr_info(struct dp_pdev *pdev, = ppdu_info->cfr_info.rtt_che_buffer_pointer_high8; cfr_info->rtt_che_buffer_pointer_low32 = ppdu_info->cfr_info.rtt_che_buffer_pointer_low32; + cfr_info->rtt_cfo_measurement + = (int16_t)ppdu_info->cfr_info.rtt_cfo_measurement; + cfr_info->agc_gain_info0 + = ppdu_info->cfr_info.agc_gain_info0; + cfr_info->agc_gain_info1 + = ppdu_info->cfr_info.agc_gain_info1; + cfr_info->agc_gain_info2 + = ppdu_info->cfr_info.agc_gain_info2; + cfr_info->agc_gain_info3 + = ppdu_info->cfr_info.agc_gain_info3; + cfr_info->rx_start_ts + = ppdu_info->cfr_info.rx_start_ts; + cfr_info->mcs_rate + = ppdu_info->cfr_info.mcs_rate; + cfr_info->gi_type + = ppdu_info->cfr_info.gi_type; } /** diff --git a/dp/wifi3.0/dp_tx_desc.h b/dp/wifi3.0/dp_tx_desc.h index cdc1f4c25e32..9c8527971742 100644 --- a/dp/wifi3.0/dp_tx_desc.h +++ b/dp/wifi3.0/dp_tx_desc.h @@ -1,5 +1,6 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -219,6 +220,61 @@ dp_tx_is_threshold_reached(struct dp_tx_desc_pool_s *pool, uint16_t avail_desc) return false; } +/** + * dp_tx_adjust_flow_pool_state() - Adjust flow pool state + * + * @soc: dp soc + * @pool: flow pool + */ +static inline void +dp_tx_adjust_flow_pool_state(struct dp_soc *soc, + struct dp_tx_desc_pool_s *pool) +{ + if (pool->avail_desc > pool->stop_th[DP_TH_BE_BK]) { + pool->status = FLOW_POOL_ACTIVE_UNPAUSED; + return; + } else if (pool->avail_desc <= pool->stop_th[DP_TH_BE_BK] && + pool->avail_desc > pool->stop_th[DP_TH_VI]) { + pool->status = FLOW_POOL_BE_BK_PAUSED; + } else if (pool->avail_desc <= pool->stop_th[DP_TH_VI] && + pool->avail_desc > pool->stop_th[DP_TH_VO]) { + pool->status = FLOW_POOL_VI_PAUSED; + } else if (pool->avail_desc <= pool->stop_th[DP_TH_VO] && + pool->avail_desc > pool->stop_th[DP_TH_HI]) { + pool->status = FLOW_POOL_VO_PAUSED; + } else if (pool->avail_desc <= pool->stop_th[DP_TH_HI]) { + pool->status = FLOW_POOL_ACTIVE_PAUSED; + } + + switch (pool->status) { + case FLOW_POOL_ACTIVE_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_PRIORITY_QUEUE_OFF, + WLAN_DATA_FLOW_CTRL_PRI); + /* fallthrough */ + + case FLOW_POOL_VO_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_VO_QUEUE_OFF, + WLAN_DATA_FLOW_CTRL_VO); + /* fallthrough */ + + case FLOW_POOL_VI_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_VI_QUEUE_OFF, + WLAN_DATA_FLOW_CTRL_VI); + /* fallthrough */ + + case FLOW_POOL_BE_BK_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_BE_BK_QUEUE_OFF, + WLAN_DATA_FLOW_CTRL_BE_BK); + break; + default: + dp_err("Invalid pool staus:%u to adjust", pool->status); + } +} + /** * dp_tx_desc_alloc() - Allocate a Software Tx descriptor from given pool * @@ -235,39 +291,53 @@ dp_tx_desc_alloc(struct dp_soc *soc, uint8_t desc_pool_id) bool is_pause = false; enum netif_action_type act = WLAN_NETIF_ACTION_TYPE_NONE; enum dp_fl_ctrl_threshold level = DP_TH_BE_BK; + enum netif_reason_type reason; if (qdf_likely(pool)) { qdf_spin_lock_bh(&pool->flow_pool_lock); - if (qdf_likely(pool->avail_desc)) { + if (qdf_likely(pool->avail_desc && + pool->status != FLOW_POOL_INVALID && + pool->status != FLOW_POOL_INACTIVE)) { tx_desc = dp_tx_get_desc_flow_pool(pool); tx_desc->pool_id = desc_pool_id; tx_desc->flags = DP_TX_DESC_FLAG_ALLOCATED; + is_pause = dp_tx_is_threshold_reached(pool, pool->avail_desc); + if (qdf_unlikely(pool->status == + FLOW_POOL_ACTIVE_UNPAUSED_REATTACH)) { + dp_tx_adjust_flow_pool_state(soc, pool); + is_pause = false; + } + if (qdf_unlikely(is_pause)) { switch (pool->status) { case FLOW_POOL_ACTIVE_UNPAUSED: /* pause network BE\BK queue */ act = WLAN_NETIF_BE_BK_QUEUE_OFF; + reason = WLAN_DATA_FLOW_CTRL_BE_BK; level = DP_TH_BE_BK; pool->status = FLOW_POOL_BE_BK_PAUSED; break; case FLOW_POOL_BE_BK_PAUSED: /* pause network VI queue */ act = WLAN_NETIF_VI_QUEUE_OFF; + reason = WLAN_DATA_FLOW_CTRL_VI; level = DP_TH_VI; pool->status = FLOW_POOL_VI_PAUSED; break; case FLOW_POOL_VI_PAUSED: /* pause network VO queue */ act = WLAN_NETIF_VO_QUEUE_OFF; + reason = WLAN_DATA_FLOW_CTRL_VO; level = DP_TH_VO; pool->status = FLOW_POOL_VO_PAUSED; break; case FLOW_POOL_VO_PAUSED: /* pause network HI PRI queue */ act = WLAN_NETIF_PRIORITY_QUEUE_OFF; + reason = WLAN_DATA_FLOW_CTRL_PRI; level = DP_TH_HI; pool->status = FLOW_POOL_ACTIVE_PAUSED; break; @@ -285,7 +355,7 @@ dp_tx_desc_alloc(struct dp_soc *soc, uint8_t desc_pool_id) qdf_get_system_timestamp(); soc->pause_cb(desc_pool_id, act, - WLAN_DATA_FLOW_CONTROL); + reason); } } } else { @@ -315,6 +385,7 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc, struct dp_tx_desc_pool_s *pool = &soc->tx_desc[desc_pool_id]; qdf_time_t unpause_time = qdf_get_system_timestamp(), pause_dur; enum netif_action_type act = WLAN_WAKE_ALL_NETIF_QUEUE; + enum netif_reason_type reason; qdf_spin_lock_bh(&pool->flow_pool_lock); tx_desc->vdev_id = DP_INVALID_VDEV_ID; @@ -325,6 +396,7 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc, case FLOW_POOL_ACTIVE_PAUSED: if (pool->avail_desc > pool->start_th[DP_TH_HI]) { act = WLAN_NETIF_PRIORITY_QUEUE_ON; + reason = WLAN_DATA_FLOW_CTRL_PRI; pool->status = FLOW_POOL_VO_PAUSED; /* Update maxinum pause duration for HI queue */ @@ -337,6 +409,7 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc, case FLOW_POOL_VO_PAUSED: if (pool->avail_desc > pool->start_th[DP_TH_VO]) { act = WLAN_NETIF_VO_QUEUE_ON; + reason = WLAN_DATA_FLOW_CTRL_VO; pool->status = FLOW_POOL_VI_PAUSED; /* Update maxinum pause duration for VO queue */ @@ -349,6 +422,7 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc, case FLOW_POOL_VI_PAUSED: if (pool->avail_desc > pool->start_th[DP_TH_VI]) { act = WLAN_NETIF_VI_QUEUE_ON; + reason = WLAN_DATA_FLOW_CTRL_VI; pool->status = FLOW_POOL_BE_BK_PAUSED; /* Update maxinum pause duration for VI queue */ @@ -360,7 +434,8 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc, break; case FLOW_POOL_BE_BK_PAUSED: if (pool->avail_desc > pool->start_th[DP_TH_BE_BK]) { - act = WLAN_WAKE_NON_PRIORITY_QUEUE; + act = WLAN_NETIF_BE_BK_QUEUE_ON; + reason = WLAN_DATA_FLOW_CTRL_BE_BK; pool->status = FLOW_POOL_ACTIVE_UNPAUSED; /* Update maxinum pause duration for BE_BK queue */ @@ -393,7 +468,7 @@ dp_tx_desc_free(struct dp_soc *soc, struct dp_tx_desc_s *tx_desc, if (act != WLAN_WAKE_ALL_NETIF_QUEUE) soc->pause_cb(pool->flow_pool_id, - act, WLAN_DATA_FLOW_CONTROL); + act, reason); qdf_spin_unlock_bh(&pool->flow_pool_lock); } #else /* QCA_AC_BASED_FLOW_CONTROL */ diff --git a/dp/wifi3.0/dp_tx_flow_control.c b/dp/wifi3.0/dp_tx_flow_control.c index 6d728d278d65..341e7945904d 100644 --- a/dp/wifi3.0/dp_tx_flow_control.c +++ b/dp/wifi3.0/dp_tx_flow_control.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2015-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -90,20 +91,7 @@ dp_tx_flow_pool_reattach(struct dp_tx_desc_pool_s *pool) "%s: flow pool already allocated, attached %d times", __func__, pool->pool_create_cnt); - if (pool->avail_desc > pool->start_th[DP_TH_BE_BK]) - pool->status = FLOW_POOL_ACTIVE_UNPAUSED; - else if (pool->avail_desc <= pool->start_th[DP_TH_BE_BK] && - pool->avail_desc > pool->start_th[DP_TH_VI]) - pool->status = FLOW_POOL_BE_BK_PAUSED; - else if (pool->avail_desc <= pool->start_th[DP_TH_VI] && - pool->avail_desc > pool->start_th[DP_TH_VO]) - pool->status = FLOW_POOL_VI_PAUSED; - else if (pool->avail_desc <= pool->start_th[DP_TH_VO] && - pool->avail_desc > pool->start_th[DP_TH_HI]) - pool->status = FLOW_POOL_VO_PAUSED; - else - pool->status = FLOW_POOL_ACTIVE_PAUSED; - + pool->status = FLOW_POOL_ACTIVE_UNPAUSED_REATTACH; pool->pool_create_cnt++; } @@ -131,6 +119,48 @@ dp_tx_flow_pool_dump_threshold(struct dp_tx_desc_pool_s *pool) } } +/** + * dp_tx_flow_ctrl_reset_subqueues() - Reset subqueues to orginal state + * @soc: dp soc + * @pool: flow pool + * @pool_status: flow pool status + * + * Return: none + */ +static inline void +dp_tx_flow_ctrl_reset_subqueues(struct dp_soc *soc, + struct dp_tx_desc_pool_s *pool, + enum flow_pool_status pool_status) +{ + switch (pool_status) { + case FLOW_POOL_ACTIVE_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_PRIORITY_QUEUE_ON, + WLAN_DATA_FLOW_CTRL_PRI); + /* fallthrough */ + + case FLOW_POOL_VO_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_VO_QUEUE_ON, + WLAN_DATA_FLOW_CTRL_VO); + /* fallthrough */ + + case FLOW_POOL_VI_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_VI_QUEUE_ON, + WLAN_DATA_FLOW_CTRL_VI); + /* fallthrough */ + + case FLOW_POOL_BE_BK_PAUSED: + soc->pause_cb(pool->flow_pool_id, + WLAN_NETIF_BE_BK_QUEUE_ON, + WLAN_DATA_FLOW_CTRL_BE_BK); + /* fallthrough */ + default: + break; + } +} + #else static inline void dp_tx_initialize_threshold(struct dp_tx_desc_pool_s *pool, @@ -166,6 +196,13 @@ dp_tx_flow_pool_dump_threshold(struct dp_tx_desc_pool_s *pool) pool->start_th, pool->stop_th); } +static inline void +dp_tx_flow_ctrl_reset_subqueues(struct dp_soc *soc, + struct dp_tx_desc_pool_s *pool, + enum flow_pool_status pool_status) +{ +} + #endif /** @@ -356,6 +393,7 @@ int dp_tx_delete_flow_pool(struct dp_soc *soc, struct dp_tx_desc_pool_s *pool, bool force) { struct dp_vdev *vdev; + enum flow_pool_status pool_status; if (!soc || !pool) { dp_err("pool or soc is NULL"); @@ -381,7 +419,10 @@ int dp_tx_delete_flow_pool(struct dp_soc *soc, struct dp_tx_desc_pool_s *pool, } if (pool->avail_desc < pool->pool_size) { + pool_status = pool->status; pool->status = FLOW_POOL_INVALID; + dp_tx_flow_ctrl_reset_subqueues(soc, pool, pool_status); + qdf_spin_unlock_bh(&pool->flow_pool_lock); /* Reset TX desc associated to this Vdev as NULL */ vdev = dp_vdev_get_ref_by_id(soc, pool->flow_pool_id, diff --git a/dp/wifi3.0/dp_types.h b/dp/wifi3.0/dp_types.h index 2d3d0add270a..87587b070bfc 100644 --- a/dp/wifi3.0/dp_types.h +++ b/dp/wifi3.0/dp_types.h @@ -533,6 +533,30 @@ struct dp_tx_desc_s { struct hal_tx_desc_comp_s comp; }; +#ifdef QCA_AC_BASED_FLOW_CONTROL +/** + * enum flow_pool_status - flow pool status + * @FLOW_POOL_ACTIVE_UNPAUSED : pool is active (can take/put descriptors) + * and network queues are unpaused + * @FLOW_POOL_ACTIVE_PAUSED: pool is active (can take/put descriptors) + * and network queues are paused + * @FLOW_POOL_INVALID: pool is invalid (put descriptor) + * @FLOW_POOL_INACTIVE: pool is inactive (pool is free) + * @FLOW_POOL_ACTIVE_UNPAUSED_REATTACH: pool is reattached but network + * queues are not paused + */ +enum flow_pool_status { + FLOW_POOL_ACTIVE_UNPAUSED = 0, + FLOW_POOL_ACTIVE_PAUSED = 1, + FLOW_POOL_BE_BK_PAUSED = 2, + FLOW_POOL_VI_PAUSED = 3, + FLOW_POOL_VO_PAUSED = 4, + FLOW_POOL_INVALID = 5, + FLOW_POOL_INACTIVE = 6, + FLOW_POOL_ACTIVE_UNPAUSED_REATTACH = 7, +}; + +#else /** * enum flow_pool_status - flow pool status * @FLOW_POOL_ACTIVE_UNPAUSED : pool is active (can take/put descriptors) @@ -552,6 +576,8 @@ enum flow_pool_status { FLOW_POOL_INACTIVE = 6, }; +#endif + /** * struct dp_tx_tso_seg_pool_s * @pool_size: total number of pool elements diff --git a/hal/wifi3.0/hal_api_mon.h b/hal/wifi3.0/hal_api_mon.h index 3ed0268816fc..79b009e3e16a 100644 --- a/hal/wifi3.0/hal_api_mon.h +++ b/hal/wifi3.0/hal_api_mon.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -590,8 +590,47 @@ struct hal_rx_ppdu_cfr_user_info { * d. CAPTURE_NO_BUFFER: next buffer in IPC ring not available * * @cfr_user_info: Peer mac for upto 4 MU users + * + * @rtt_cfo_measurement : raw cfo data extracted from hardware, which is 14 bit + * signed number. The first bit used for sign representation and 13 bits for + * fractional part. + * + * @agc_gain_info0: Chain 0 & chain 1 agc gain information reported by PHY + * + * @agc_gain_info1: Chain 2 & chain 3 agc gain information reported by PHY + * + * @agc_gain_info2: Chain 4 & chain 5 agc gain information reported by PHY + * + * @agc_gain_info3: Chain 6 & chain 7 agc gain information reported by PHY + * + * @rx_start_ts: Rx packet timestamp, the time the first L-STF ADC sample + * arrived at Rx antenna. + * + * @mcs_rate: Indicates the mcs/rate in which packet is received. + * If HT, + * 0-7: MCS0-MCS7 + * If VHT, + * 0-9: MCS0 to MCS9 + * If HE, + * 0-11: MCS0 to MCS11, + * 12-13: 4096QAM, + * 14-15: reserved + * If Legacy, + * 0: 48 Mbps + * 1: 24 Mbps + * 2: 12 Mbps + * 3: 6 Mbps + * 4: 54 Mbps + * 5: 36 Mbps + * 6: 18 Mbps + * 7: 9 Mbps + * + * @gi_type: Indicates the gaurd interval. + * 0: 0.8 us + * 1: 0.4 us + * 2: 1.6 us + * 3: 3.2 us */ - struct hal_rx_ppdu_cfr_info { bool bb_captured_channel; bool bb_captured_timeout; @@ -601,6 +640,14 @@ struct hal_rx_ppdu_cfr_info { uint8_t rtt_che_buffer_pointer_high8; uint32_t rtt_che_buffer_pointer_low32; struct hal_rx_ppdu_cfr_user_info cfr_user_info[HAL_MAX_UL_MU_USERS]; + int16_t rtt_cfo_measurement; + uint32_t agc_gain_info0; + uint32_t agc_gain_info1; + uint32_t agc_gain_info2; + uint32_t agc_gain_info3; + uint32_t rx_start_ts; + uint32_t mcs_rate; + uint32_t gi_type; }; #else struct hal_rx_ppdu_cfr_info {}; diff --git a/hal/wifi3.0/hal_generic_api.h b/hal/wifi3.0/hal_generic_api.h index 38d44dc0ef27..159bb076fa2f 100644 --- a/hal/wifi3.0/hal_generic_api.h +++ b/hal/wifi3.0/hal_generic_api.h @@ -907,6 +907,7 @@ hal_rx_status_get_tlv_info_generic(void *rx_tlv_hdr, void *ppduinfo, #ifdef QCA_WIFI_QCA6390 case TARGET_TYPE_QCA6390: #endif + case TARGET_TYPE_QCA6490: ppdu_info->rx_status.is_stbc = HAL_RX_GET(vht_sig_a_info, VHT_SIG_A_INFO_0, STBC); @@ -935,7 +936,6 @@ hal_rx_status_get_tlv_info_generic(void *rx_tlv_hdr, void *ppduinfo, ppdu_info->rx_status.nss = 0; #endif break; - case TARGET_TYPE_QCA6490: case TARGET_TYPE_QCA6750: ppdu_info->rx_status.nss = 0; break; diff --git a/hal/wifi3.0/qca6490/hal_6490_rx.h b/hal/wifi3.0/qca6490/hal_6490_rx.h index 8859e95eb02f..bf935dae38ba 100644 --- a/hal/wifi3.0/qca6490/hal_6490_rx.h +++ b/hal/wifi3.0/qca6490/hal_6490_rx.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -462,6 +463,45 @@ void hal_rx_get_rtt_info_6490(void *rx_tlv, HAL_RX_GET(rx_tlv, PHYRX_PKT_END_13_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, RESERVED_8); + ppdu_info->cfr_info.rx_start_ts = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_9_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RX_START_TS); + + ppdu_info->cfr_info.rtt_cfo_measurement = (int16_t) + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_13_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_CFO_MEASUREMENT); + + ppdu_info->cfr_info.agc_gain_info0 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_1_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info1 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_2_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_UPPER_32); + + ppdu_info->cfr_info.agc_gain_info2 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_3_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info3 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_4_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_UPPER_32); + + ppdu_info->cfr_info.mcs_rate = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_MCS_RATE); + + ppdu_info->cfr_info.gi_type = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_GI_TYPE); } #endif #endif diff --git a/hal/wifi3.0/qca8074v2/hal_8074v2_rx.h b/hal/wifi3.0/qca8074v2/hal_8074v2_rx.h index 8ceae3823277..4c51ef665010 100644 --- a/hal/wifi3.0/qca8074v2/hal_8074v2_rx.h +++ b/hal/wifi3.0/qca8074v2/hal_8074v2_rx.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -545,6 +545,46 @@ void hal_rx_get_rtt_info_8074v2(void *rx_tlv, HAL_RX_GET(rx_tlv, PHYRX_PKT_END_13_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, RESERVED_8); + + ppdu_info->cfr_info.rx_start_ts = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_9_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RX_START_TS); + + ppdu_info->cfr_info.rtt_cfo_measurement = (int16_t) + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_13_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_CFO_MEASUREMENT); + + ppdu_info->cfr_info.agc_gain_info0 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_1_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info1 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_2_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_UPPER_32); + + ppdu_info->cfr_info.agc_gain_info2 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_3_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info3 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_4_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_UPPER_32); + + ppdu_info->cfr_info.mcs_rate = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_MCS_RATE); + + ppdu_info->cfr_info.gi_type = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_GI_TYPE); } #endif diff --git a/hal/wifi3.0/qcn9000/hal_9000.c b/hal/wifi3.0/qcn9000/hal_9000.c index f276e63a426a..025aca716c37 100644 --- a/hal/wifi3.0/qcn9000/hal_9000.c +++ b/hal/wifi3.0/qcn9000/hal_9000.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -337,6 +337,46 @@ void hal_rx_get_rtt_info_9000(void *rx_tlv, void *ppdu_info_hdl) ppdu_info->cfr_info.chan_capture_status = GET_RX_LOCATION_INFO_CHAN_CAPTURE_STATUS(rx_tlv); + + ppdu_info->cfr_info.rx_start_ts = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_9_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RX_START_TS); + + ppdu_info->cfr_info.rtt_cfo_measurement = (int16_t) + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_13_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_CFO_MEASUREMENT); + + ppdu_info->cfr_info.agc_gain_info0 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_1_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info1 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_2_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_1_UPPER_32); + + ppdu_info->cfr_info.agc_gain_info2 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_3_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_LOWER_32); + + ppdu_info->cfr_info.agc_gain_info3 = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_4_RX_PKT_END_DETAILS, + PHY_TIMESTAMP_2_UPPER_32); + + ppdu_info->cfr_info.mcs_rate = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_MCS_RATE); + + ppdu_info->cfr_info.gi_type = + HAL_RX_GET(rx_tlv, + PHYRX_PKT_END_8_RX_PKT_END_DETAILS_RX_LOCATION_INFO_DETAILS, + RTT_GI_TYPE); } #endif /** diff --git a/hif/src/ipcie/if_ipci.h b/hif/src/ipcie/if_ipci.h index 2270890f6f60..209d91d437df 100644 --- a/hif/src/ipcie/if_ipci.h +++ b/hif/src/ipcie/if_ipci.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2020-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -68,11 +69,10 @@ struct hif_ipci_stats { #define EP_VOTE_POLL_TIME_CNT 2 #ifdef HAL_CONFIG_SLUB_DEBUG_ON #define EP_WAKE_RESET_DELAY_TIMEOUT_MS 3 -#define EP_WAKE_DELAY_TIMEOUT_MS 7 #else #define EP_WAKE_RESET_DELAY_TIMEOUT_MS 10 -#define EP_WAKE_DELAY_TIMEOUT_MS 10 #endif +#define EP_WAKE_DELAY_TIMEOUT_MS 10 #define EP_WAKE_RESET_DELAY_US 50 #define EP_WAKE_DELAY_US 200 #endif diff --git a/qdf/inc/qdf_tracker.h b/qdf/inc/qdf_tracker.h index 04dee0e7b246..bece8a77b06f 100644 --- a/qdf/inc/qdf_tracker.h +++ b/qdf/inc/qdf_tracker.h @@ -1,5 +1,7 @@ /* * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -60,6 +62,7 @@ struct qdf_tracker name = { \ .ht = qdf_ptr_hash_ptr(name ## _ht), \ } +#ifdef CONFIG_LEAK_DETECTION /** * qdf_tracker_init() - initialize a qdf_tracker * @tracker: the qdf_tracker to initialize @@ -125,6 +128,42 @@ qdf_must_check bool qdf_tracker_lookup(struct qdf_tracker *tracker, void *ptr, char (*out_func)[QDF_TRACKER_FUNC_SIZE], uint32_t *out_line); +#else +static inline +void qdf_tracker_init(struct qdf_tracker *tracker) +{ +} +static inline +void qdf_tracker_deinit(struct qdf_tracker *tracker) +{ +} + +static inline qdf_must_check QDF_STATUS +qdf_tracker_track(struct qdf_tracker *tracker, void *ptr, + const char *func, uint32_t line) +{ + return QDF_STATUS_SUCCESS; +} + +static inline +void qdf_tracker_untrack(struct qdf_tracker *tracker, void *ptr, + const char *func, uint32_t line) +{ +} + +static inline +void qdf_tracker_check_for_leaks(struct qdf_tracker *tracker) +{ +} + +static inline qdf_must_check bool +qdf_tracker_lookup(struct qdf_tracker *tracker, void *ptr, + char (*out_func)[QDF_TRACKER_FUNC_SIZE], + uint32_t *out_line) +{ + return false; +} +#endif #endif /* __QDF_TRACKER_H */ diff --git a/qdf/src/qdf_tracker.c b/qdf/src/qdf_tracker.c index 2061a4b5537a..2b58765b7820 100644 --- a/qdf/src/qdf_tracker.c +++ b/qdf/src/qdf_tracker.c @@ -1,5 +1,6 @@ /* - * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2019, 2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -26,6 +27,7 @@ #include "qdf_tracker.h" #include "qdf_types.h" +#ifdef CONFIG_LEAK_DETECTION struct qdf_tracker_node { struct qdf_ptr_hash_entry entry; enum qdf_debug_domain domain; @@ -188,4 +190,4 @@ bool qdf_tracker_lookup(struct qdf_tracker *tracker, void *ptr, return !!node; } - +#endif diff --git a/qdf/test/qdf_tracker_test.c b/qdf/test/qdf_tracker_test.c index b1bd7a8968b8..219a89bd9cbc 100644 --- a/qdf/test/qdf_tracker_test.c +++ b/qdf/test/qdf_tracker_test.c @@ -1,5 +1,7 @@ /* * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -21,6 +23,7 @@ #include "qdf_trace.h" #include "qdf_types.h" +#if defined(CONFIG_LEAK_DETECTION) && defined(WLAN_TRACKER_TEST) #define qdf_ut_tracker_bits 4 /* 16 buckets */ #define qdf_ut_tracker_item_count 3 #define qdf_ut_tracker_declare(name) \ @@ -92,4 +95,4 @@ uint32_t qdf_tracker_unit_test(void) return errors; } - +#endif diff --git a/qdf/test/qdf_tracker_test.h b/qdf/test/qdf_tracker_test.h index 8500f5110439..4b7d7968e1e9 100644 --- a/qdf/test/qdf_tracker_test.h +++ b/qdf/test/qdf_tracker_test.h @@ -1,5 +1,7 @@ /* * Copyright (c) 2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -19,7 +21,7 @@ #ifndef __QDF_TRACKER_TEST #define __QDF_TRACKER_TEST -#ifdef WLAN_TRACKER_TEST +#if defined(CONFIG_LEAK_DETECTION) && defined(WLAN_TRACKER_TEST) /** * qdf_tracker_unit_test() - run the qdf tracker unit test suite * diff --git a/target_if/cfr/inc/target_if_cfr.h b/target_if/cfr/inc/target_if_cfr.h index 237aaee8dfc5..1053571185e5 100644 --- a/target_if/cfr/inc/target_if_cfr.h +++ b/target_if/cfr/inc/target_if_cfr.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -48,6 +48,10 @@ */ #define CORRELATE_TX_EV_MODULE_ID 1 +#define get_u16_lsb(value) (uint16_t)(value) +#define get_u16_msb(value) (uint16_t)(((uint32_t)value) >> 16) +#define get_gain_db(value) ((value) & 0xFF) + /** * target_if_cfr_init_pdev() - Inits cfr pdev and registers necessary handlers. * @psoc: pointer to psoc object @@ -168,6 +172,17 @@ void target_if_cfr_info_send(struct wlan_objmgr_pdev *pdev, void *head, size_t hlen, void *data, size_t dlen, void *tail, size_t tlen); +/** + * target_if_cfr_fill_header() - Function to fill cfr header cmn section + * @hdr: pointer to the csi_cfr_header + * @is_wifi_2_0: flag to indicate legacy and non legacy radio + * @target_type: target type of the radio + * @is_rcc: flag to denote fill header request from periodic cfr/rcc + */ +void target_if_cfr_fill_header(struct csi_cfr_header *hdr, + bool is_wifi_2_0, + uint32_t target_type, + bool is_rcc); #ifdef WIFI_TARGET_TYPE_2_0 /** * cfr_wifi2_0_init_pdev() - Function to init legacy pdev diff --git a/target_if/cfr/src/target_if_cfr.c b/target_if/cfr/src/target_if_cfr.c index 4423a8937487..dce4c5c37a7a 100644 --- a/target_if/cfr/src/target_if_cfr.c +++ b/target_if/cfr/src/target_if_cfr.c @@ -201,6 +201,53 @@ int target_if_cfr_get_target_type(struct wlan_objmgr_psoc *psoc) return target_type; } +void target_if_cfr_fill_header(struct csi_cfr_header *hdr, + bool is_wifi_2_0, + uint32_t target_type, + bool is_rcc) +{ + hdr->cmn.start_magic_num = 0xDEADBEAF; + hdr->cmn.vendorid = 0x8cfdf0; + hdr->cmn.pltform_type = CFR_PLATFORM_TYPE_ARM; + hdr->cmn.cfr_metadata_len = CFR_META_DATA_LEN; + hdr->cmn.cfr_data_version = CFR_DATA_VERSION_1; + + if (is_wifi_2_0) { + hdr->cmn.cfr_metadata_version = CFR_META_VERSION_1; + if (target_type == TARGET_TYPE_IPQ4019) + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_DAKOTA; + else if (target_type == TARGET_TYPE_QCA9888) + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_BESRA; + else if (target_type == TARGET_TYPE_QCA9984) + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_CASCADE; + else + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_NONE; + } else if (target_type == TARGET_TYPE_QCA8074V2) { + hdr->cmn.cfr_metadata_version = CFR_META_VERSION_6; + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_HKV2; + } else { + if (target_type == TARGET_TYPE_QCN9000 || + target_type == TARGET_TYPE_QCA6490) + hdr->cmn.cfr_metadata_version = CFR_META_VERSION_7; + else if ((target_type == TARGET_TYPE_QCA6018) || + ((target_type == TARGET_TYPE_QCA5018) && (!is_rcc))) + hdr->cmn.cfr_metadata_version = CFR_META_VERSION_5; + else + hdr->cmn.cfr_metadata_version = CFR_META_VERSION_3; + + if (target_type == TARGET_TYPE_QCN9000) + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_PINE; + else if (target_type == TARGET_TYPE_QCA5018) + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_MAPLE; + else if (target_type == TARGET_TYPE_QCA6490) + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_HSP; + else if (target_type == TARGET_TYPE_QCA6750) + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_MOSELLE; + else + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_CYP; + } +} + #ifdef CFR_USE_FIXED_FOLDER static QDF_STATUS target_if_cfr_init_target(struct wlan_objmgr_psoc *psoc, struct wlan_objmgr_pdev *pdev, diff --git a/target_if/cfr/src/target_if_cfr_enh.c b/target_if/cfr/src/target_if_cfr_enh.c index 8a17ace66c90..170bcec6ea3e 100644 --- a/target_if/cfr/src/target_if_cfr_enh.c +++ b/target_if/cfr/src/target_if_cfr_enh.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -337,7 +337,7 @@ static void dump_mu_rx_info(void *mu_rx_user_info, static void dump_metadata(struct csi_cfr_header *header, uint32_t cookie) { uint8_t user_id, chain_id; - struct cfr_metadata_version_3 *meta = &header->u.meta_v3; + struct enh_cfr_metadata *meta = &header->u.meta_enh; uint8_t *usermac = NULL; cfr_debug("<%u>\n" @@ -345,6 +345,7 @@ static void dump_metadata(struct csi_cfr_header *header, uint32_t cookie) "vendorid = 0x%x\n" "cfr_metadata_version = %d\n" "cfr_data_version = %d\n" + "cfr_metadata_len = %d\n" "chip_type = %d\n" "platform_type = %d\n" "status = %d\n" @@ -363,12 +364,13 @@ static void dump_metadata(struct csi_cfr_header *header, uint32_t cookie) "is_mu_ppdu = %d\n" "num_users = %d\n", cookie, - header->start_magic_num, - header->vendorid, - header->cfr_metadata_version, - header->cfr_data_version, - header->chip_type, - header->pltform_type, + header->cmn.start_magic_num, + header->cmn.vendorid, + header->cmn.cfr_metadata_version, + header->cmn.cfr_data_version, + header->cmn.cfr_metadata_len, + header->cmn.chip_type, + header->cmn.pltform_type, meta->status, meta->capture_bw, meta->channel_bw, @@ -407,6 +409,21 @@ static void dump_metadata(struct csi_cfr_header *header, uint32_t cookie) chain_id, meta->chain_phase[chain_id]); } + + if (header->cmn.cfr_metadata_version >= CFR_META_VERSION_5) { + cfr_debug("rtt_cfo_measurement = %d\n", + meta->rtt_cfo_measurement); + cfr_debug("rx_start_ts = %u\n", meta->rx_start_ts); + + for (chain_id = 0; chain_id < HOST_MAX_CHAINS; chain_id++) { + cfr_debug("agc_gain[%d] = %d\n", + chain_id, + meta->agc_gain[chain_id]); + } + + cfr_debug("mcs_rate = %u\n", meta->mcs_rate); + cfr_debug("gi_type = %u\n", meta->gi_type); + } } /** @@ -704,9 +721,10 @@ void target_if_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf) int i, status = 0; QDF_STATUS retval = 0; struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = NULL; - struct cfr_metadata_version_3 *meta = NULL; + struct enh_cfr_metadata *meta = NULL; uint8_t srng_id = 0; struct wlan_lmac_if_rx_ops *rx_ops; + uint32_t target_type; if (qdf_unlikely(!pdev)) { cfr_err("pdev is null\n"); @@ -745,6 +763,7 @@ void target_if_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf) cfr_err("rx_ops is NULL"); goto relref; } + target_type = target_if_cfr_get_target_type(psoc); cfr_rx_ops = &rx_ops->cfr_rx_ops; buf_addr_extn = cfr_info->rtt_che_buffer_pointer_high8 & 0xF; buf_addr = (cfr_info->rtt_che_buffer_pointer_low32 | @@ -805,15 +824,9 @@ void target_if_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf) lut->tx_address2 = cfr_info->rtt_che_buffer_pointer_high8; lut->txrx_tstamp = qdf_ktime_to_ms(qdf_ktime_get()); header = &lut->header; - meta = &header->u.meta_v3; + meta = &header->u.meta_enh; - header->start_magic_num = 0xDEADBEAF; - header->vendorid = 0x8cfdf0; - header->cfr_metadata_version = CFR_META_VERSION_3; - header->cfr_data_version = CFR_DATA_VERSION_1; - header->chip_type = pcfr->chip_type; - header->pltform_type = CFR_PLATFORM_TYPE_ARM; - header->Reserved = 0; + target_if_cfr_fill_header(header, false, target_type, true); meta->status = 1; meta->phy_mode = ch_phymode; @@ -826,6 +839,27 @@ void target_if_cfr_rx_tlv_process(struct wlan_objmgr_pdev *pdev, void *nbuf) meta->is_mu_ppdu = (cdp_rx_ppdu->u.ppdu_type == CDP_RX_TYPE_SU) ? 0 : 1; meta->num_mu_users = (meta->is_mu_ppdu) ? (cdp_rx_ppdu->num_users) : 0; + meta->rtt_cfo_measurement = cfr_info->rtt_cfo_measurement; + meta->rx_start_ts = cfr_info->rx_start_ts; + + meta->agc_gain[0] = get_gain_db(get_u16_lsb(cfr_info->agc_gain_info0)); + meta->agc_gain[1] = get_gain_db(get_u16_msb(cfr_info->agc_gain_info0)); + meta->agc_gain[2] = get_gain_db(get_u16_lsb(cfr_info->agc_gain_info1)); + meta->agc_gain[3] = get_gain_db(get_u16_msb(cfr_info->agc_gain_info1)); + meta->agc_gain[4] = get_gain_db(get_u16_lsb(cfr_info->agc_gain_info2)); + meta->agc_gain[5] = get_gain_db(get_u16_msb(cfr_info->agc_gain_info2)); + meta->agc_gain[6] = get_gain_db(get_u16_lsb(cfr_info->agc_gain_info3)); + meta->agc_gain[7] = get_gain_db(get_u16_msb(cfr_info->agc_gain_info3)); + + meta->mcs_rate = cfr_info->mcs_rate; + meta->gi_type = cfr_info->gi_type; + meta->sig_info.ltf_size = cdp_rx_ppdu->u.ltf_size; + meta->sig_info.stbc = cdp_rx_ppdu->u.stbc; + meta->sig_info.sgi = (cdp_rx_ppdu->u.gi == CDP_SGI_0_4_US) ? 1 : 0; + meta->sig_info.dcm = cdp_rx_ppdu->u.dcm; + meta->sig_info.coding = cdp_rx_ppdu->u.ldpc; + meta->sig_info.beamformed = cdp_rx_ppdu->beamformed; + if (meta->num_mu_users > pcfr->max_mu_users) meta->num_mu_users = pcfr->max_mu_users; @@ -923,7 +957,7 @@ static bool enh_cfr_dbr_event_handler(struct wlan_objmgr_pdev *pdev, uint8_t capture_type = CFR_TYPE_METHOD_AUTO; uint8_t *peer_macaddr = NULL; struct wlan_lmac_if_cfr_rx_ops *cfr_rx_ops = NULL; - struct cfr_metadata_version_3 *meta = NULL; + struct enh_cfr_metadata *meta = NULL; struct wlan_lmac_if_rx_ops *rx_ops; if ((!pdev) || (!payload)) { @@ -1003,8 +1037,8 @@ static bool enh_cfr_dbr_event_handler(struct wlan_objmgr_pdev *pdev, sizeof(struct whal_cfir_dma_hdr)); header = &lut->header; - header->chip_type = pcfr->chip_type; - meta = &header->u.meta_v3; + header->cmn.chip_type = pcfr->chip_type; + meta = &header->u.meta_enh; meta->channel_bw = dma_hdr.upload_pkt_bw; meta->num_rx_chain = NUM_CHAINS_FW_TO_HOST(dma_hdr.num_chains); meta->length = length; @@ -1164,24 +1198,13 @@ static void enh_prepare_cfr_header_txstatus(wmi_cfr_peer_tx_event_param struct csi_cfr_header *header, uint32_t target_type) { - header->start_magic_num = 0xDEADBEAF; - header->vendorid = 0x8cfdf0; - header->cfr_metadata_version = CFR_META_VERSION_3; - header->cfr_data_version = CFR_DATA_VERSION_1; + target_if_cfr_fill_header(header, false, target_type, false); + header->u.meta_enh.status = 0; /* failure */ + header->u.meta_enh.length = 0; + header->u.meta_enh.rtt_cfo_measurement = tx_evt_param->cfo_measurement; + header->u.meta_enh.rx_start_ts = tx_evt_param->rx_start_ts; - if (target_type == TARGET_TYPE_QCN9000) - header->chip_type = CFR_CAPTURE_RADIO_PINE; - else if (target_type == TARGET_TYPE_QCA5018) - header->chip_type = CFR_CAPTURE_RADIO_MAPLE; - else - header->chip_type = CFR_CAPTURE_RADIO_CYP; - - header->pltform_type = CFR_PLATFORM_TYPE_ARM; - header->Reserved = 0; - header->u.meta_v3.status = 0; /* failure */ - header->u.meta_v3.length = 0; - - qdf_mem_copy(&header->u.meta_v3.peer_addr.su_peer_addr[0], + qdf_mem_copy(&header->u.meta_enh.peer_addr.su_peer_addr[0], &tx_evt_param->peer_mac_addr.bytes[0], QDF_MAC_ADDR_SIZE); } @@ -1206,7 +1229,7 @@ target_if_peer_capture_event(ol_scn_t sc, uint8_t *data, uint32_t datalen) struct pdev_cfr *pcfr; struct look_up_table *lut = NULL; struct csi_cfr_header *header = NULL; - struct csi_cfr_header header_error = {0}; + struct csi_cfr_header header_error = {{0} }; wmi_cfr_peer_tx_event_param tx_evt_param = {0}; qdf_dma_addr_t buf_addr = 0, buf_addr_temp = 0; int status; @@ -1362,50 +1385,44 @@ target_if_peer_capture_event(ol_scn_t sc, uint8_t *data, uint32_t datalen) lut->txrx_tstamp = qdf_ktime_to_ms(qdf_ktime_get()); header = &lut->header; - header->start_magic_num = 0xDEADBEAF; - header->vendorid = 0x8cfdf0; - header->cfr_metadata_version = CFR_META_VERSION_3; - header->cfr_data_version = CFR_DATA_VERSION_1; - - if (target_type == TARGET_TYPE_QCN9000) - header->chip_type = CFR_CAPTURE_RADIO_PINE; - else if (target_type == TARGET_TYPE_QCA5018) - header->chip_type = CFR_CAPTURE_RADIO_MAPLE; - else - header->chip_type = CFR_CAPTURE_RADIO_CYP; - - header->pltform_type = CFR_PLATFORM_TYPE_ARM; - header->Reserved = 0; - header->u.meta_v3.status = (tx_evt_param.status & - PEER_CFR_CAPTURE_EVT_STATUS_MASK) ? - 1 : 0; - header->u.meta_v3.capture_bw = tx_evt_param.bandwidth; + target_if_cfr_fill_header(header, false, target_type, false); + header->u.meta_enh.status = (tx_evt_param.status & + PEER_CFR_CAPTURE_EVT_STATUS_MASK) ? + 1 : 0; + header->u.meta_enh.capture_bw = tx_evt_param.bandwidth; bss_chan = wlan_vdev_mlme_get_bss_chan(vdev); - header->u.meta_v3.phy_mode = bss_chan->ch_phymode; + header->u.meta_enh.phy_mode = bss_chan->ch_phymode; - header->u.meta_v3.prim20_chan = tx_evt_param.primary_20mhz_chan; - header->u.meta_v3.center_freq1 = tx_evt_param.band_center_freq1; - header->u.meta_v3.center_freq2 = tx_evt_param.band_center_freq2; + header->u.meta_enh.prim20_chan = tx_evt_param.primary_20mhz_chan; + header->u.meta_enh.center_freq1 = tx_evt_param.band_center_freq1; + header->u.meta_enh.center_freq2 = tx_evt_param.band_center_freq2; /* Currently CFR data is captured on ACK of a Qos NULL frame. * For 20 MHz, ACK is Legacy and for 40/80/160, ACK is DUP Legacy. */ - header->u.meta_v3.capture_mode = tx_evt_param.bandwidth ? + header->u.meta_enh.capture_mode = tx_evt_param.bandwidth ? CFR_DUP_LEGACY_ACK : CFR_LEGACY_ACK; - header->u.meta_v3.capture_type = tx_evt_param.capture_method; - header->u.meta_v3.num_rx_chain = wlan_vdev_mlme_get_rxchainmask(vdev); - header->u.meta_v3.sts_count = tx_evt_param.spatial_streams; - header->u.meta_v3.timestamp = tx_evt_param.timestamp_us; + header->u.meta_enh.capture_type = tx_evt_param.capture_method; + header->u.meta_enh.num_rx_chain = wlan_vdev_mlme_get_rxchainmask(vdev); + header->u.meta_enh.sts_count = tx_evt_param.spatial_streams; + header->u.meta_enh.timestamp = tx_evt_param.timestamp_us; - qdf_mem_copy(&header->u.meta_v3.peer_addr.su_peer_addr[0], + qdf_mem_copy(&header->u.meta_enh.peer_addr.su_peer_addr[0], &tx_evt_param.peer_mac_addr.bytes[0], QDF_MAC_ADDR_SIZE); - qdf_mem_copy(&header->u.meta_v3.chain_rssi[0], + qdf_mem_copy(&header->u.meta_enh.chain_rssi[0], &tx_evt_param.chain_rssi[0], HOST_MAX_CHAINS * sizeof(tx_evt_param.chain_rssi[0])); - qdf_mem_copy(&header->u.meta_v3.chain_phase[0], + qdf_mem_copy(&header->u.meta_enh.chain_phase[0], &tx_evt_param.chain_phase[0], HOST_MAX_CHAINS * sizeof(tx_evt_param.chain_phase[0])); + qdf_mem_copy(&header->u.meta_enh.agc_gain[0], + &tx_evt_param.agc_gain[0], + HOST_MAX_CHAINS * sizeof(tx_evt_param.agc_gain[0])); + header->u.meta_enh.rtt_cfo_measurement = tx_evt_param.cfo_measurement; + header->u.meta_enh.rx_start_ts = tx_evt_param.rx_start_ts; + header->u.meta_enh.mcs_rate = tx_evt_param.mcs_rate; + header->u.meta_enh.gi_type = tx_evt_param.gi_type; status = correlate_and_relay_enh(pdev, cookie, lut, CORRELATE_TX_EV_MODULE_ID); diff --git a/umac/cfr/core/src/cfr_common.c b/umac/cfr/core/src/cfr_common.c index 988ff51415f2..1365dc8a718b 100644 --- a/umac/cfr/core/src/cfr_common.c +++ b/umac/cfr/core/src/cfr_common.c @@ -1,5 +1,6 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -510,13 +511,11 @@ QDF_STATUS cfr_stop_indication(struct wlan_objmgr_vdev *vdev) return QDF_STATUS_E_INVAL; } - if (pa->nl_cb.cfr_nl_cb) { - pa->nl_cb.cfr_nl_cb(pa->nl_cb.vdev_id, pa->nl_cb.pid, - (const void *)CFR_STOP_STR, - sizeof(CFR_STOP_STR)); - + /* Don't write stop sting if there is valid cfr_nl_cb. Since + * userspace needn't stop event string + */ + if (pa->nl_cb.cfr_nl_cb) return QDF_STATUS_SUCCESS; - } status = cfr_streamfs_write(pa, (const void *)CFR_STOP_STR, sizeof(CFR_STOP_STR)); diff --git a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h index e8b7721734b1..a3cf8ba37193 100644 --- a/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h +++ b/umac/cfr/dispatcher/inc/wlan_cfr_utils_api.h @@ -1,6 +1,6 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -64,9 +64,13 @@ enum cfrmetaversion { CFR_META_VERSION_NONE, - CFR_META_VERSION_1, - CFR_META_VERSION_2, - CFR_META_VERSION_3, + CFR_META_VERSION_1, /* initial version for leg_cfr_metadata */ + CFR_META_VERSION_2, /* initial version for dbr_cfr_metadata */ + CFR_META_VERSION_3, /* initial version for enh_cfr_metadata */ + CFR_META_VERSION_4, /* agc gain, cfo, rx_start_ts in dbr_cfr_metadata */ + CFR_META_VERSION_5, /* agc gain, cfo, rx_start_ts in enh_cfr_metadata */ + CFR_META_VERSION_6, /* mcs, gi_type in dbr_cfr_metadata */ + CFR_META_VERSION_7, /* mcs, gi_type, sig_info in enh_cfr_metadata */ CFR_META_VERSION_MAX = 0xFF, }; @@ -132,7 +136,8 @@ enum cfr_capture_type { CFR_TYPE_METHOD_MAX, }; -struct cfr_metadata_version_1 { +/* ensure to add new members at the end of the structure only */ +struct leg_cfr_metadata { u_int8_t peer_addr[QDF_MAC_ADDR_SIZE]; u_int8_t status; u_int8_t capture_bw; @@ -151,7 +156,8 @@ struct cfr_metadata_version_1 { #define HOST_MAX_CHAINS 8 -struct cfr_metadata_version_2 { +/* ensure to add new members at the end of the structure only */ +struct dbr_cfr_metadata { u_int8_t peer_addr[QDF_MAC_ADDR_SIZE]; u_int8_t status; u_int8_t capture_bw; @@ -168,10 +174,26 @@ struct cfr_metadata_version_2 { u_int32_t length; u_int32_t chain_rssi[HOST_MAX_CHAINS]; u_int16_t chain_phase[HOST_MAX_CHAINS]; + u_int32_t rtt_cfo_measurement; + u_int8_t agc_gain[HOST_MAX_CHAINS]; + u_int32_t rx_start_ts; + u_int16_t mcs_rate; + u_int16_t gi_type; } __attribute__ ((__packed__)); #ifdef WLAN_ENH_CFR_ENABLE -struct cfr_metadata_version_3 { +struct cfr_su_sig_info { + u_int8_t coding; + u_int8_t stbc; + u_int8_t beamformed; + u_int8_t dcm; + u_int8_t ltf_size; + u_int8_t sgi; + u_int16_t reserved; +} __attribute__ ((__packed__)); + +/* ensure to add new members at the end of the structure only */ +struct enh_cfr_metadata { u_int8_t status; u_int8_t capture_bw; u_int8_t channel_bw; @@ -193,23 +215,35 @@ struct cfr_metadata_version_3 { } peer_addr; u_int32_t chain_rssi[HOST_MAX_CHAINS]; u_int16_t chain_phase[HOST_MAX_CHAINS]; + u_int32_t rtt_cfo_measurement; + u_int8_t agc_gain[HOST_MAX_CHAINS]; + u_int32_t rx_start_ts; + u_int16_t mcs_rate; + u_int16_t gi_type; + struct cfr_su_sig_info sig_info; } __attribute__ ((__packed__)); #endif -struct csi_cfr_header { +#define CFR_META_DATA_LEN \ + (sizeof(struct csi_cfr_header) - sizeof(struct cfr_header_cmn)) + +struct cfr_header_cmn { u_int32_t start_magic_num; u_int32_t vendorid; u_int8_t cfr_metadata_version; u_int8_t cfr_data_version; u_int8_t chip_type; u_int8_t pltform_type; - u_int32_t Reserved; + u_int32_t cfr_metadata_len; +} __attribute__ ((__packed__)); +struct csi_cfr_header { + struct cfr_header_cmn cmn; union { - struct cfr_metadata_version_1 meta_v1; - struct cfr_metadata_version_2 meta_v2; + struct leg_cfr_metadata meta_leg; + struct dbr_cfr_metadata meta_dbr; #ifdef WLAN_ENH_CFR_ENABLE - struct cfr_metadata_version_3 meta_v3; + struct enh_cfr_metadata meta_enh; #endif } u; } __attribute__ ((__packed__)); diff --git a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c index 33ea0ed87edb..c6b79cc56627 100644 --- a/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c +++ b/umac/cfr/dispatcher/src/wlan_cfr_ucfg_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020 The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021 The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -419,12 +419,12 @@ void ucfg_cfr_capture_data(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, goto exit; } - hdr->vendorid = CFR_VENDOR_ID; - hdr->cfr_metadata_version = CFR_META_VERSION_1; - hdr->cfr_data_version = CFR_DATA_VERSION_1; - hdr->chip_type = CFR_CAPTURE_RADIO_ADRASTEA; - hdr->pltform_type = CFR_PLATFORM_TYPE_ARM; - hdr->Reserved = 0; + hdr->cmn.vendorid = CFR_VENDOR_ID; + hdr->cmn.cfr_metadata_version = CFR_META_VERSION_1; + hdr->cmn.cfr_data_version = CFR_DATA_VERSION_1; + hdr->cmn.chip_type = CFR_CAPTURE_RADIO_ADRASTEA; + hdr->cmn.pltform_type = CFR_PLATFORM_TYPE_ARM; + hdr->cmn.cfr_metadata_len = CFR_META_DATA_LEN; vaddr = pcfr->cfr_mem_chunk.vaddr; rindex = (u32 *)vaddr; @@ -435,7 +435,7 @@ void ucfg_cfr_capture_data(struct wlan_objmgr_psoc *psoc, uint32_t vdev_id, * find data pointer from mem index and start address of memory. */ payload = vaddr + mem_index; - payload_len = hdr->u.meta_v1.length; + payload_len = hdr->u.meta_leg.length; /* Write data into streamfs */ tgt_cfr_info_send(pdev, hdr, sizeof(struct csi_cfr_header), diff --git a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h index e423506e6445..6a9907af33e7 100644 --- a/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h +++ b/umac/cmn_services/cmn_defs/inc/wlan_cmn_ieee80211.h @@ -210,9 +210,17 @@ #define WLAN_HE_6GHZ_CHWIDTH_160_80_80 3 /* 160/80+80 MHz Oper Ch width */ #define WLAN_RATE_VAL 0x7f +#define WLAN_BASIC_RATE_MASK 0x80 #define WLAN_RV(v) ((v) & WLAN_RATE_VAL) +#define WLAN_BSS_MEMBERSHIP_SELECTOR_HT_PHY 127 +#define WLAN_BSS_MEMBERSHIP_SELECTOR_VHT_PHY 126 +#define WLAN_BSS_MEMBERSHIP_SELECTOR_GLK 125 +#define WLAN_BSS_MEMBERSHIP_SELECTOR_EPD 124 +#define WLAN_BSS_MEMBERSHIP_SELECTOR_SAE_H2E 123 +#define WLAN_BSS_MEMBERSHIP_SELECTOR_HE_PHY 122 + #define WLAN_CHAN_IS_5GHZ(chanidx) \ ((chanidx > 30) ? true : false) #define WLAN_CHAN_IS_2GHZ(chanidx) \ diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c index 0e00c2b62f2d..e98e19d05e84 100644 --- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2017-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -1944,6 +1945,16 @@ static void util_parse_noninheritance_list(uint8_t *extn_elem, } } +static size_t util_oui_header_len(uint8_t *ie) +{ + /* Cisco Vendor Specific IEs doesn't have subtype in + * their VSIE header, therefore skip subtype + */ + if (ie[0] == 0x00 && ie[1] == 0x40 && ie[2] == 0x96) + return OUI_LEN - 1; + return OUI_LEN; +} + static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen, uint8_t *subelement, size_t subie_len, uint8_t *new_ie) @@ -2033,16 +2044,18 @@ static uint32_t util_gen_new_ie(uint8_t *ie, uint32_t ielen, } else { /* ie in transmitting ie also in subelement, * copy from subelement and flag the ie in subelement - * as copied (by setting eid field to 0xff). For - * vendor ie, compare OUI + type + subType to - * determine if they are the same ie. + * as copied (by setting eid field to 0xff). + * To determine if the vendor ies are same: + * 1. For Cisco OUI, compare only OUI + type + * 2. For other OUI, compare OUI + type + subType */ tmp_rem_len = subie_len - (tmp - sub_copy); if (tmp_old[0] == WLAN_ELEMID_VENDOR && tmp_rem_len >= MIN_VENDOR_TAG_LEN) { if (!qdf_mem_cmp(tmp_old + PAYLOAD_START_POS, tmp + PAYLOAD_START_POS, - OUI_LEN)) { + util_oui_header_len(tmp + + PAYLOAD_START_POS))) { /* same vendor ie, copy from * subelement */ diff --git a/utils/logging/inc/wlan_roam_debug.h b/utils/logging/inc/wlan_roam_debug.h index 136f3c6cb0c8..1848215b79a1 100644 --- a/utils/logging/inc/wlan_roam_debug.h +++ b/utils/logging/inc/wlan_roam_debug.h @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2019, 2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -64,6 +65,7 @@ typedef enum { * @DEBUG_CONN_DISCONNECT: trace station disconnect * @DEBUG_CONN_DISCONNECT_HANDLER: trace disconnect handler * @DEBUG_CONN_DISCONNECT_IND: trace disconnect indication + * @DEBUG_CONN_RSO: trace RSO state changing */ enum peer_debug_op { DEBUG_PEER_CREATE_SEND = 0, @@ -91,6 +93,7 @@ enum peer_debug_op { DEBUG_CONN_DISCONNECT, DEBUG_CONN_DISCONNECT_HANDLER, DEBUG_CONN_DISCONNECT_IND, + DEBUG_CONN_RSO, }; /** diff --git a/utils/logging/src/wlan_roam_debug.c b/utils/logging/src/wlan_roam_debug.c index 1f0b0c956095..d41fec171834 100644 --- a/utils/logging/src/wlan_roam_debug.c +++ b/utils/logging/src/wlan_roam_debug.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2013-2018, 2020-2021 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -248,6 +249,8 @@ static char *wlan_roam_debug_string(uint32_t op) return "dishdr"; case DEBUG_CONN_DISCONNECT_IND: return "disind"; + case DEBUG_CONN_RSO: + return "rso"; default: return "unknown"; } diff --git a/wbuff/src/wbuff.c b/wbuff/src/wbuff.c index 65455bfb4d09..4b964d161aa7 100644 --- a/wbuff/src/wbuff.c +++ b/wbuff/src/wbuff.c @@ -1,5 +1,6 @@ /* * Copyright (c) 2018-2019 The Linux Foundation. All rights reserved. + * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for * any purpose with or without fee is hereby granted, provided that the @@ -345,6 +346,10 @@ qdf_nbuf_t wbuff_buff_put(qdf_nbuf_t buf) mslot = (slot_info & WBUFF_MSLOT_BITMASK) >> WBUFF_MSLOT_SHIFT; pslot = (slot_info & WBUFF_PSLOT_BITMASK) >> WBUFF_PSLOT_SHIFT; + + if (mslot >= WBUFF_MAX_MODULES || pslot >= WBUFF_MAX_POOLS) + return NULL; + qdf_nbuf_reset(buffer, wbuff.mod[mslot].reserve, wbuff.mod[mslot]. align); qdf_spin_lock_bh(&wbuff.mod[mslot].lock); diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index b97c2455e142..4ee01ee2886f 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -1298,6 +1298,12 @@ struct seg_hdr_info { * Data:1 Mgmt:0 * @cfr_enable: flag to enable CFR capture * 0:disable 1:enable + * @en_beamforming: flag to enable tx beamforming + * 0:disable 1:enable + * @retry_limit_ext: 3 bits of extended retry limit. + * Combined with 4 bits "retry_limit" + * to create 7 bits hw retry count. + * Maximum 127 retries for specific frames. */ struct tx_send_params { uint32_t pwr:8, @@ -1309,7 +1315,9 @@ struct tx_send_params { preamble_type:5, frame_type:1, cfr_enable:1, - reserved:10; + en_beamforming:1, + retry_limit_ext:3, + reserved:6; }; /** @@ -8115,6 +8123,12 @@ typedef struct { uint32_t counter; uint32_t chain_rssi[WMI_HOST_MAX_CHAINS]; uint16_t chain_phase[WMI_HOST_MAX_CHAINS]; + int32_t cfo_measurement; + uint8_t agc_gain[WMI_HOST_MAX_CHAINS]; + uint32_t rx_start_ts; + uint32_t rx_ts_reset; + uint32_t mcs_rate; + uint32_t gi_type; } wmi_cfr_peer_tx_event_param; /** diff --git a/wmi/src/wmi_unified_cfr_tlv.c b/wmi/src/wmi_unified_cfr_tlv.c index be782021f3ae..5c79f4c25c6e 100644 --- a/wmi/src/wmi_unified_cfr_tlv.c +++ b/wmi/src/wmi_unified_cfr_tlv.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2019-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. * * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -62,6 +62,18 @@ extract_cfr_peer_tx_event_param_tlv(wmi_unified_t wmi_handle, void *evt_buf, peer_tx_event->counter = peer_tx_event_ev->counter; qdf_mem_copy(peer_tx_event->chain_rssi, peer_tx_event_ev->chain_rssi, sizeof(peer_tx_event->chain_rssi)); + if (peer_tx_event_ev->cfo_measurement_valid) + peer_tx_event->cfo_measurement = + peer_tx_event_ev->cfo_measurement; + else + peer_tx_event->cfo_measurement = 0; + + peer_tx_event->rx_start_ts = peer_tx_event_ev->rx_start_ts; + peer_tx_event->rx_ts_reset = peer_tx_event_ev->rx_ts_reset; + peer_tx_event->mcs_rate = + WMI_CFR_MCS_GET(peer_tx_event_ev->mcs_gi_info); + peer_tx_event->gi_type = + WMI_CFR_GI_TYPE_GET(peer_tx_event_ev->mcs_gi_info); chain_phase_ev = param_buf->phase_param; if (chain_phase_ev) { @@ -74,6 +86,8 @@ extract_cfr_peer_tx_event_param_tlv(wmi_unified_t wmi_handle, void *evt_buf, */ peer_tx_event->chain_phase[idx] = (0xffff & chain_phase_ev->chain_phase[idx]); + peer_tx_event->agc_gain[idx] = + WMI_UNIFIED_AGC_GAIN_GET(chain_phase_ev, idx); } } diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 1b95fa9770e9..df3781218048 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -3393,6 +3393,10 @@ static inline QDF_STATUS populate_tx_send_params(uint8_t *bufp, param.frame_type); WMI_TX_SEND_PARAM_CFR_CAPTURE_SET(tx_param->tx_param_dword1, param.cfr_enable); + WMI_TX_SEND_PARAM_BEAMFORM_SET(tx_param->tx_param_dword1, + param.en_beamforming); + WMI_TX_SEND_PARAM_RETRY_LIMIT_EXT_SET(tx_param->tx_param_dword1, + param.retry_limit_ext); return status; }