Skip to content
This repository has been archived by the owner on Jun 20, 2022. It is now read-only.

Commit

Permalink
Merge tag 'LA.UM.7.2.c6-02600-sdm660.0' of https://source.codeaurora.…
Browse files Browse the repository at this point in the history
…org/quic/la/platform/vendor/qcom-opensource/wlan/qca-wifi-host-cmn into kernel.lnx.4.4.r40-rel

"LA.UM.7.2.c6-02600-sdm660.0"
  • Loading branch information
radcolor committed Dec 2, 2019
2 parents 3d6d8c7 + d69f58a commit 36be25b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 4 deletions.
7 changes: 6 additions & 1 deletion drivers/staging/qca-wifi-host-cmn/qdf/inc/qdf_nbuf.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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
Expand Down Expand Up @@ -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;
Expand All @@ -179,6 +181,9 @@ struct mon_rx_status {
uint8_t sgi;
uint8_t ldpc;
uint8_t beamformed;
uint8_t tx_status;
bool add_rtap_ext;
uint8_t tx_retry_cnt;
};

/* DHCP Related Mask */
Expand Down
39 changes: 36 additions & 3 deletions drivers/staging/qca-wifi-host-cmn/qdf/linux/src/qdf_nbuf.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* 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
Expand Down Expand Up @@ -3417,13 +3417,24 @@ static unsigned int qdf_nbuf_update_radiotap_vht_flags(

#define NORMALIZED_TO_NOISE_FLOOR (-96)

#define IEEE80211_RADIOTAP_TX_STATUS 0
#define IEEE80211_RADIOTAP_RETRY_COUNT 1

/* 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
Expand All @@ -3441,6 +3452,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);
Expand Down Expand Up @@ -3510,6 +3528,21 @@ 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_ext |= cpu_to_le32(1 << IEEE80211_RADIOTAP_RETRY_COUNT);

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

rthdr->it_len = cpu_to_le16(rtap_len);

if (headroom_sz < rtap_len) {
Expand Down

0 comments on commit 36be25b

Please sign in to comment.