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

Currently, data rate for management tx packets is filled only as
1 or 6 Mbps which is wrong.
Sniffer expect data rate multiple of 2. Hence fill the data rate with
multiple of 2 for tx management packets which received from firmware
and converting into mbps.

Change-Id: I5dd6515804cd3751925af0992a30a7441ebf9bbb
CRs-Fixed: 3444177
This commit is contained in:
Balaji Pothunoori 2023-07-07 19:34:03 +05:30
commit 21aa15dc9f
2 changed files with 10 additions and 8 deletions

View file

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020, 2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2023 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
@ -362,6 +362,7 @@ pkt_capture_process_mgmt_tx_data(struct wlan_objmgr_pdev *pdev,
struct wlan_objmgr_psoc *psoc;
tpSirMacFrameCtl pfc = (tpSirMacFrameCtl)(qdf_nbuf_data(nbuf));
struct ieee80211_frame *wh;
uint16_t rate;
psoc = wlan_pdev_get_psoc(pdev);
if (!psoc) {
@ -388,8 +389,6 @@ pkt_capture_process_mgmt_tx_data(struct wlan_objmgr_pdev *pdev,
txrx_status.tsft = (u_int64_t)params->tsf_l32;
txrx_status.chan_num = wlan_freq_to_chan(params->chan_freq);
txrx_status.chan_freq = params->chan_freq;
/* params->rate is in Kbps, convert into Mbps */
txrx_status.rate = (params->rate_kbps / 1000);
if (params->rssi == INVALID_RSSI_FOR_TX)
/* RSSI -128 is invalid rssi for TX, make it 0 here,
* will be normalized during radiotap updation
@ -400,15 +399,18 @@ pkt_capture_process_mgmt_tx_data(struct wlan_objmgr_pdev *pdev,
txrx_status.rssi_comb = txrx_status.ant_signal_db;
txrx_status.nr_ant = 1;
txrx_status.rtap_flags |=
((txrx_status.rate == 6 /* Mbps */) ? BIT(1) : 0);
rate = params->rate_kbps * 2;
/* params->rate is in Kbps, convert into Mbps */
txrx_status.rate = (uint8_t)(rate / 1000);
if (txrx_status.rate == 6)
txrx_status.rtap_flags |=
((txrx_status.rate == 12 /* Mbps */) ? BIT(1) : 0);
if (txrx_status.rate == 12)
txrx_status.ofdm_flag = 1;
else
txrx_status.cck_flag = 1;
txrx_status.rate = ((txrx_status.rate == 6 /* Mbps */) ? 0x0c : 0x02);
txrx_status.tx_status = status;
txrx_status.tx_retry_cnt = params->tx_retry_cnt;
txrx_status.add_rtap_ext = true;

View file

@ -1,6 +1,6 @@
/*
* Copyright (c) 2020-2021 The Linux Foundation. All rights reserved.
* Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021, 2023 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
@ -73,7 +73,7 @@ enum pkt_capture_config {
struct mgmt_offload_event_params {
uint32_t tsf_l32;
uint32_t chan_freq;
uint32_t rate_kbps;
uint16_t rate_kbps;
uint32_t rssi;
uint32_t buf_len;
uint32_t tx_status;