Browse Source

qcacld-3.0: Fix data rate in mgmt rx packets in packet capture mode

Currently the rate, ofdm and cck flags are filled to support only
legacy rates.To support other rates too, fill ofdm and cck flags
based on phymode and fill rate in terms of 500 Kbps in tx status.

Change-Id: I972919ebd2cbd19a1b55af0324e481fada7f12cd
CRs-Fixed: 2917079
Vulupala Shashank Reddy 4 years ago
parent
commit
a8d99b9c1b
1 changed files with 4 additions and 3 deletions
  1. 4 3
      components/pkt_capture/core/src/wlan_pkt_capture_mgmt_txrx.c

+ 4 - 3
components/pkt_capture/core/src/wlan_pkt_capture_mgmt_txrx.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2020, 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
@@ -485,12 +485,13 @@ pkt_capture_mgmt_rx_data_cb(struct wlan_objmgr_psoc *psoc,
 	txrx_status.rtap_flags |=
 		((txrx_status.rate == 6 /* Mbps */) ? BIT(1) : 0);
 
-	if (txrx_status.rate == 6)
+	if (rx_params->phy_mode != WLAN_PHYMODE_11B)
 		txrx_status.ofdm_flag = 1;
 	else
 		txrx_status.cck_flag = 1;
 
-	txrx_status.rate = ((txrx_status.rate == 6 /* Mbps */) ? 0x0c : 0x02);
+	/* Convert rate from Mbps to 500 Kbps */
+	txrx_status.rate = txrx_status.rate * 2;
 	txrx_status.add_rtap_ext = true;
 
 	wh = (struct ieee80211_frame *)qdf_nbuf_data(nbuf);