diff --git a/qdf/inc/qdf_nbuf.h b/qdf/inc/qdf_nbuf.h index 40c0eb0a71..09c8ea19ea 100644 --- a/qdf/inc/qdf_nbuf.h +++ b/qdf/inc/qdf_nbuf.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 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 @@ -3961,6 +3961,18 @@ static inline qdf_size_t qdf_nbuf_get_end_offset(qdf_nbuf_t nbuf) return __qdf_nbuf_get_end_offset(nbuf); } +/** + * qdf_nbuf_get_truesize() - Return the true size of the nbuf + * including the header and variable data area + * @nbuf: qdf_nbuf_t + * + * Return: size of network buffer + */ +static inline qdf_size_t qdf_nbuf_get_truesize(qdf_nbuf_t nbuf) +{ + return __qdf_nbuf_get_truesize(nbuf); +} + #ifdef NBUF_FRAG_MEMORY_DEBUG #define qdf_nbuf_move_frag_page_offset(f, i, o) \ diff --git a/qdf/linux/src/i_qdf_nbuf.h b/qdf/linux/src/i_qdf_nbuf.h index af1556dc80..7b78bc518a 100644 --- a/qdf/linux/src/i_qdf_nbuf.h +++ b/qdf/linux/src/i_qdf_nbuf.h @@ -1,6 +1,6 @@ /* * Copyright (c) 2014-2021 The Linux Foundation. All rights reserved. - * Copyright (c) 2021 Qualcomm Innovation Center, Inc. All rights reserved. + * Copyright (c) 2021-2022 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 @@ -2277,6 +2277,18 @@ static inline unsigned int __qdf_nbuf_get_end_offset(__qdf_nbuf_t nbuf) return skb_end_offset(nbuf); } +/** + * __qdf_nbuf_get_truesize() - Return the true size of the nbuf + * including the header and variable data area + * @skb: sk buff + * + * Return: size of network buffer + */ +static inline unsigned int __qdf_nbuf_get_truesize(struct sk_buff *skb) +{ + return skb->truesize; +} + #ifdef CONFIG_WLAN_SYSFS_MEM_STATS /** * __qdf_record_nbuf_nbytes() - add or subtract the size of the nbuf