Browse Source

qcacld-3.0: Include CSA offset in TBTT beacon update

Currently, host does not include the CSA/ECSA offset
in the beacon update triggered by the TBTT offset event.
Therefore, ongoing CSA is terminated after this beacon
template update to the firmware.

To fix, include the CSA/ECSA offset in the beacon template
configured due to TBTT offset update.

Change-Id: I352d348a35006f65058ff627ca12714fdded4cec
CRs-Fixed: 3637561
Surya Prakash Sivaraj 1 year ago
parent
commit
ce3c85fb7b
2 changed files with 18 additions and 0 deletions
  1. 4 0
      core/wma/inc/wma.h
  2. 14 0
      core/wma/src/wma_mgmt.c

+ 4 - 0
core/wma/inc/wma.h

@@ -442,6 +442,8 @@ enum wma_rx_exec_ctx {
  * @noa_sub_ie_len: NOA sub IE length
  * @noa_ie: NOA IE
  * @p2p_ie_offset: p2p IE offset
+ * @csa_count_offset: Offset of Switch count field in CSA IE
+ * @ecsa_count_offset: Offset of Switch count field in ECSA IE
  * @lock: lock
  */
 struct beacon_info {
@@ -455,6 +457,8 @@ struct beacon_info {
 	uint16_t noa_sub_ie_len;
 	uint8_t *noa_ie;
 	uint16_t p2p_ie_offset;
+	uint16_t csa_count_offset;
+	uint16_t ecsa_count_offset;
 	qdf_spinlock_t lock;
 };
 

+ 14 - 0
core/wma/src/wma_mgmt.c

@@ -2302,6 +2302,16 @@ static QDF_STATUS wma_store_bcn_tmpl(tp_wma_handle wma, uint8_t vdev_id,
 	else
 		bcn->p2p_ie_offset = bcn_info->p2pIeOffset;
 
+	if (bcn_info->csa_count_offset > 3)
+		bcn->csa_count_offset = bcn_info->csa_count_offset - 4;
+	else
+		bcn->csa_count_offset = bcn_info->csa_count_offset;
+
+	if (bcn_info->ecsa_count_offset > 3)
+		bcn->ecsa_count_offset = bcn_info->ecsa_count_offset - 4;
+	else
+		bcn->ecsa_count_offset = bcn_info->ecsa_count_offset;
+
 	bcn_payload = qdf_nbuf_data(bcn->buf);
 	if (bcn->tim_ie_offset) {
 		tim_ie = (struct beacon_tim_ie *)
@@ -2379,8 +2389,12 @@ int wma_tbttoffset_update_event_handler(void *handle, uint8_t *event,
 		bcn_info.p2pIeOffset = bcn->p2p_ie_offset;
 		bcn_info.beaconLength = bcn->len;
 		bcn_info.timIeOffset = bcn->tim_ie_offset;
+		bcn_info.csa_count_offset = bcn->csa_count_offset;
+		bcn_info.ecsa_count_offset = bcn->ecsa_count_offset;
 		qdf_spin_unlock_bh(&bcn->lock);
 
+		wma_err_rl("Update beacon template for vdev %d due to TBTT offset update",
+			   if_id);
 		/* Update beacon template in firmware */
 		wma_unified_bcn_tmpl_send(wma, if_id, &bcn_info, 0);
 	}