Fichiers
android_kernel_samsung_sm86…/qdf/inc/i_qdf_nbuf_api_m.h
Yu Wang 8aa054e666 qcacmn: add fields to record transmit timestamp in nbuf cb
Add field 'u.tx.pa_ts.ts_value' to store the driver ingress
timestamp, and field 'u.tx.dev.priv_cb_m.flag_ts_valid' to
indicate whether 'u.tx.pa_ts.ts_value' is available or not.
Both fields must be cleared before fragment mapping, to
avoid overlap with the filed 'u.tx.pa_ts.paddr'.

Change-Id: I645c3c27b0c519417f86e6346f4f018b8d87d701
CRs-Fixed: 3560477
2023-09-20 04:15:55 -07:00

320 lignes
7.1 KiB
C

/*
* Copyright (c) 2014-2017,2019-2021 The Linux Foundation. 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
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: i_qdf_nbuf_api_m.h
*
* Platform specific qdf_nbuf_public network buffer API
* This file defines the network buffer abstraction.
* Included by qdf_nbuf.h and should not be included
* directly from other files.
*/
#ifndef _QDF_NBUF_M_H
#define _QDF_NBUF_M_H
static inline int qdf_nbuf_ipa_owned_get(qdf_nbuf_t buf)
{
return __qdf_nbuf_ipa_owned_get(buf);
}
static inline void qdf_nbuf_ipa_owned_set(qdf_nbuf_t buf)
{
__qdf_nbuf_ipa_owned_set(buf);
}
static inline void qdf_nbuf_ipa_owned_clear(qdf_nbuf_t buf)
{
__qdf_nbuf_ipa_owned_clear(buf);
}
static inline int qdf_nbuf_ipa_priv_get(qdf_nbuf_t buf)
{
return __qdf_nbuf_ipa_priv_get(buf);
}
static inline void qdf_nbuf_ipa_priv_set(qdf_nbuf_t buf, uint32_t priv)
{
QDF_BUG(!(priv & QDF_NBUF_IPA_CHECK_MASK));
__qdf_nbuf_ipa_priv_set(buf, priv);
}
static inline void qdf_nbuf_tx_notify_comp_set(qdf_nbuf_t buf, uint8_t val)
{
QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_NOTIFY_COMP(buf) = val;
}
static inline uint8_t qdf_nbuf_tx_notify_comp_get(qdf_nbuf_t buf)
{
return QDF_NBUF_CB_TX_EXTRA_FRAG_FLAGS_NOTIFY_COMP(buf);
}
/**
* qdf_nbuf_set_rx_protocol_tag()
* @buf: Network buffer
* @val: Value to be set in the nbuf
* Return: None
*/
static inline void qdf_nbuf_set_rx_protocol_tag(qdf_nbuf_t buf, uint16_t val)
{
}
/**
* qdf_nbuf_get_rx_protocol_tag()
* @buf: Network buffer
* Return: Value of rx protocol tag, here 0
*/
static inline uint16_t qdf_nbuf_get_rx_protocol_tag(qdf_nbuf_t buf)
{
return 0;
}
/**
* qdf_nbuf_set_rx_flow_tag() - set given value in flow tag field
* of buf(skb->cb)
* @buf: Network buffer
* @val: Rx Flow Tag to be set in the nbuf
* Return: None
*/
static inline void qdf_nbuf_set_rx_flow_tag(qdf_nbuf_t buf, uint16_t val)
{
}
/**
* qdf_nbuf_get_rx_flow_tag() - Get the value of flow_tag
* field of buf(skb->cb)
* @buf: Network buffer
* Return: Value of rx flow tag, here 0
*/
static inline uint16_t qdf_nbuf_get_rx_flow_tag(qdf_nbuf_t buf)
{
return 0;
}
/**
* qdf_nbuf_set_exc_frame() - set exception frame flag
* @buf: Network buffer whose cb is to set exception frame flag
* @value: exception frame flag, value 0 or 1.
*
* Return: none
*/
static inline void qdf_nbuf_set_exc_frame(qdf_nbuf_t buf, uint8_t value)
{
QDF_NBUF_CB_RX_PACKET_EXC_FRAME(buf) = value;
}
/**
* qdf_nbuf_is_exc_frame() - check exception frame flag bit
* @buf: Network buffer to get exception flag
*
* Return: 0 or 1
*/
static inline uint8_t qdf_nbuf_is_exc_frame(qdf_nbuf_t buf)
{
return QDF_NBUF_CB_RX_PACKET_EXC_FRAME(buf);
}
/**
* qdf_nbuf_set_lmac_id() - set lmac ID
* @buf: Network buffer
* @value: lmac ID value
*
* Return: none
*/
static inline void qdf_nbuf_set_lmac_id(qdf_nbuf_t buf, uint8_t value)
{
QDF_NBUF_CB_RX_PACKET_LMAC_ID(buf) = value;
}
/**
* qdf_nbuf_get_lmac_id() - get lmac ID of RX packet
* @buf: Network buffer
*
* Return: lmac ID value
*/
static inline uint8_t qdf_nbuf_get_lmac_id(qdf_nbuf_t buf)
{
return QDF_NBUF_CB_RX_PACKET_LMAC_ID(buf);
}
/**
* qdf_nbuf_get_mpdu_seq_num() - get MPDU sequence number
* @buf: Network buffer
*
* Return: mpdu sequence number value
*/
static inline uint16_t qdf_nbuf_get_mpdu_seq_num(qdf_nbuf_t buf)
{
return QDF_NBUF_CB_RX_MPDU_SEQ_NUM(buf);
}
/**
* qdf_nbuf_set_rx_ipa_smmu_map() - set ipa smmu mapped flag
* @buf: Network buffer
* @value: 1 - ipa smmu mapped, 0 - ipa smmu unmapped
*
* Return: none
*/
static inline void qdf_nbuf_set_rx_ipa_smmu_map(qdf_nbuf_t buf,
uint8_t value)
{
QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf) = value;
}
/**
* qdf_nbuf_is_rx_ipa_smmu_map() - check ipa smmu map flag
* @buf: Network buffer
*
* Return 0 or 1
*/
static inline uint8_t qdf_nbuf_is_rx_ipa_smmu_map(qdf_nbuf_t buf)
{
return QDF_NBUF_CB_RX_PACKET_IPA_SMMU_MAP(buf);
}
/**
* qdf_nbuf_set_rx_reo_dest_ind_or_sw_excpt() - set reo destination indication
* or sw exception flag
* @buf: Network buffer
* @value: value to set
*
* Return: none
*/
static inline void qdf_nbuf_set_rx_reo_dest_ind_or_sw_excpt(qdf_nbuf_t buf,
uint8_t value)
{
QDF_NBUF_CB_RX_PACKET_REO_DEST_IND_OR_SW_EXCPT(buf) = value;
}
/**
* qdf_nbuf_get_rx_reo_dest_ind_or_sw_excpt() - get reo destination indication
* or sw exception flag
* @buf: Network buffer
*
* Return reo destination indication value (0 ~ 31) or sw exception (0 ~ 1)
*/
static inline uint8_t qdf_nbuf_get_rx_reo_dest_ind_or_sw_excpt(qdf_nbuf_t buf)
{
return QDF_NBUF_CB_RX_PACKET_REO_DEST_IND_OR_SW_EXCPT(buf);
}
/**
* qdf_nbuf_get_tx_fctx() - get fctx of nbuf
*
* @buf: Network buffer
* Return: fctx value
*/
static inline void *qdf_nbuf_get_tx_fctx(qdf_nbuf_t buf)
{
return NULL;
}
/**
* qdf_nbuf_set_tx_fctx_type() - set ftype and fctx
*
* @buf: Network buffer
* @ctx: address to fctx
* @type: ftype
*
* Return: void
*/
static inline void
qdf_nbuf_set_tx_fctx_type(qdf_nbuf_t buf, void *ctx, uint8_t type)
{
}
/**
* qdf_nbuf_tx_set_band() - Set band in nbuf cb
* @nbuf: nbuf pointer
* @band: peer band
*
* Return: None
*/
static inline void
qdf_nbuf_tx_set_band(qdf_nbuf_t nbuf, uint8_t band)
{
QDF_NBUF_CB_TX_BAND(nbuf) = band;
}
/**
* qdf_nbuf_tx_get_band() - Get band from nbuf cb
* @nbuf: nbuf pointer
*
* Return: Band
*/
static inline uint8_t
qdf_nbuf_tx_get_band(qdf_nbuf_t nbuf)
{
return QDF_NBUF_CB_TX_BAND(nbuf);
}
/**
* qdf_nbuf_rx_set_band() - Set band in nbuf cb
* @nbuf: nbuf pointer
* @band: peer band
*
* Return: None
*/
static inline void
qdf_nbuf_rx_set_band(qdf_nbuf_t nbuf, uint8_t band)
{
QDF_NBUF_CB_RX_BAND(nbuf) = band;
}
/**
* qdf_nbuf_rx_get_band() - Get band from nbuf cb
* @nbuf: nbuf pointer
*
* Return: Band
*/
static inline uint8_t
qdf_nbuf_rx_get_band(qdf_nbuf_t nbuf)
{
return QDF_NBUF_CB_RX_BAND(nbuf);
}
/**
* qdf_nbuf_set_tx_ts() - set tx timestamp of nbuf
* @buf: Network buffer
*
* Return: None
*/
static inline void qdf_nbuf_set_tx_ts(qdf_nbuf_t buf)
{
__qdf_nbuf_set_tx_ts(buf, qdf_ktime_real_get());
}
/**
* qdf_nbuf_get_tx_ts() - get tx timestamp of nbuf
* @buf: Network buffer
* @clear: clear the fields after getting tx timestamp
*
* Return: tx timestamp
*/
static inline qdf_time_t qdf_nbuf_get_tx_ts(qdf_nbuf_t buf, bool clear)
{
qdf_time_t ts = __qdf_nbuf_get_tx_ts(buf);
if (clear)
__qdf_nbuf_clear_tx_ts(buf);
return ts;
}
#endif /* _QDF_NBUF_M_H */