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

Commit 700a1204 authored by Vulupala Shashank Reddy's avatar Vulupala Shashank Reddy Committed by Gerrit - the friendly Code Review server
Browse files

qcacmn: Add support to include ACK status for mon interface

Extend radiotap header to append ACK status for packets sent to
virtual mon interface.

Change-Id: I2f57f7dbf1efdb44185fc9a1383c2d0c3a795f99
CRs-Fixed: 2538423
parent 7b0707fe
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2019 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
@@ -155,6 +155,8 @@
 * @sgi: Rx frame short guard interval
 * @ldpc: ldpc enabled
 * @beamformed: Is frame beamformed.
 * @tx_status: Status of Tx frame
 * @add_rtap_ext: Bool to add extension to radiotap header
 */
struct mon_rx_status {
	uint64_t tsft;
@@ -179,6 +181,8 @@ struct mon_rx_status {
	uint8_t  sgi;
	uint8_t  ldpc;
	uint8_t  beamformed;
	uint8_t  tx_status;
	bool add_rtap_ext;
};

/* DHCP Related Mask */
+32 −3
Original line number Diff line number Diff line
/*
 * Copyright (c) 2014-2018 The Linux Foundation. All rights reserved.
 * Copyright (c) 2014-2019 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
@@ -3417,13 +3417,23 @@ static unsigned int qdf_nbuf_update_radiotap_vht_flags(

#define NORMALIZED_TO_NOISE_FLOOR (-96)

#define IEEE80211_RADIOTAP_TX_STATUS 0

/* This is Radio Tap Header Extension Length.
 * 4 Bytes for Extended it_present bit map +
 * 4 bytes padding for alignment
 */
#define RADIOTAP_HEADER_EXT_LEN (2 * sizeof(uint32_t))

/* This is the length for radiotap, combined length
 * (Mandatory part struct ieee80211_radiotap_header + RADIOTAP_HEADER_LEN)
 * (Mandatory part struct ieee80211_radiotap_header +
 *  RADIOTAP_HEADER_LEN + RADIOTAP_HEADER_EXT_LEN)
 * cannot be more than available headroom_sz.
 * Max size current radiotap we are populating is less than 100 bytes,
 * increase this when we add more radiotap elements.
 */
#define RADIOTAP_HEADER_LEN (sizeof(struct ieee80211_radiotap_header) + 100)
#define RADIOTAP_HEADER_LEN (sizeof(struct ieee80211_radiotap_header) + \
						RADIOTAP_HEADER_EXT_LEN + 100)

/**
 * qdf_nbuf_update_radiotap() - Update radiotap header from rx_status
@@ -3441,6 +3451,13 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
		(struct ieee80211_radiotap_header *)rtap_buf;
	uint32_t rtap_hdr_len = sizeof(struct ieee80211_radiotap_header);
	uint32_t rtap_len = rtap_hdr_len;
	uint32_t *rtap_ext = NULL;

	/* Adding Extended Header space */
	if (rx_status->add_rtap_ext) {
		rtap_hdr_len += RADIOTAP_HEADER_EXT_LEN;
		rtap_len = rtap_hdr_len;
	}

	/* IEEE80211_RADIOTAP_TSFT              __le64       microseconds*/
	rthdr->it_present = cpu_to_le32(1 << IEEE80211_RADIOTAP_TSFT);
@@ -3510,6 +3527,18 @@ unsigned int qdf_nbuf_update_radiotap(struct mon_rx_status *rx_status,
							      rtap_buf,
							      rtap_len);
	}

	/* Add Extension to Radiotap Header & corresponding data */
	if (rx_status->add_rtap_ext) {
		rthdr->it_present |= cpu_to_le32(1 << IEEE80211_RADIOTAP_EXT);
		rtap_ext = (uint32_t *)&rthdr->it_present;
		rtap_ext++;
		*rtap_ext = cpu_to_le32(1 << IEEE80211_RADIOTAP_TX_STATUS);

		rtap_buf[rtap_len] = rx_status->tx_status;
		rtap_len += 1;
	}

	rthdr->it_len = cpu_to_le16(rtap_len);

	if (headroom_sz < rtap_len) {