Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21aa15dc authored by Balaji Pothunoori's avatar Balaji Pothunoori
Browse files

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
parent 37807a72
Loading
Loading
Loading
Loading
+8 −6
Original line number Diff line number Diff line
/*
 * 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;
	rate = params->rate_kbps * 2;
	/* params->rate is in Kbps, convert into Mbps */
	txrx_status.rate = (uint8_t)(rate / 1000);

	txrx_status.rtap_flags |=
		((txrx_status.rate == 6 /* Mbps */) ? BIT(1) : 0);
		((txrx_status.rate == 12 /* Mbps */) ? BIT(1) : 0);

	if (txrx_status.rate == 6)
	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;
+2 −2
Original line number Diff line number Diff line
/*
 * 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;