diff --git a/dp/wifi3.0/dp_rx.c b/dp/wifi3.0/dp_rx.c index abbb4af196c0..5745559c7b73 100644 --- a/dp/wifi3.0/dp_rx.c +++ b/dp/wifi3.0/dp_rx.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017 The Linux Foundation. All rights reserved. + * Copyright (c) 2016-2017 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 @@ -214,6 +214,7 @@ dp_rx_process(struct dp_soc *soc, void *hal_ring, uint32_t quota) uint8_t *rx_tlv_hdr; uint32_t rx_bufs_reaped = 0; struct dp_pdev *pdev; + uint32_t sgi, rate_mcs, tid; /* Debug -- Remove later */ qdf_assert(soc && hal_ring); @@ -370,6 +371,15 @@ done: /* Statistics */ continue; } + + sgi = hal_rx_msdu_start_sgi_get(rx_tlv_hdr); + rate_mcs = hal_rx_msdu_start_rate_mcs_get(rx_tlv_hdr); + tid = hal_rx_mpdu_start_tid_get(rx_tlv_hdr); + + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO, + "%s: %d, SGI: %d, rate_mcs: %d, tid: %d", + __func__, __LINE__, sgi, rate_mcs, tid); + /* * HW structures call this L3 header padding -- * even though this is actually the offset from diff --git a/dp/wifi3.0/dp_rx_err.c b/dp/wifi3.0/dp_rx_err.c index d413eb733859..cee46a4f472d 100644 --- a/dp/wifi3.0/dp_rx_err.c +++ b/dp/wifi3.0/dp_rx_err.c @@ -260,9 +260,9 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, void *ring_desc, qdf_nbuf_t nbuf; struct dp_pdev *pdev0; struct dp_vdev *vdev0; - uint32_t tid = 0; uint16_t peer_id = 0xFFFF; struct dp_peer *peer = NULL; + uint32_t sgi, rate_mcs, tid; rx_buf_cookie = HAL_RX_WBM_BUF_COOKIE_GET(ring_desc); @@ -300,6 +300,14 @@ dp_rx_null_q_desc_handle(struct dp_soc *soc, void *ring_desc, qdf_assert(0); } + sgi = hal_rx_msdu_start_sgi_get(rx_desc->rx_buf_start); + rate_mcs = hal_rx_msdu_start_rate_mcs_get(rx_desc->rx_buf_start); + tid = hal_rx_mpdu_start_tid_get(rx_desc->rx_buf_start); + + QDF_TRACE(QDF_MODULE_ID_DP, QDF_TRACE_LEVEL_INFO, + "%s: %d, SGI: %d, rate_mcs: %d, tid: %d", + __func__, __LINE__, sgi, rate_mcs, tid); + /* * Advance the packet start pointer by total size of * pre-header TLV's diff --git a/dp/wifi3.0/hal_rx.h b/dp/wifi3.0/hal_rx.h index 33b3a1f23f67..c1a765815d37 100644 --- a/dp/wifi3.0/hal_rx.h +++ b/dp/wifi3.0/hal_rx.h @@ -593,7 +593,7 @@ hal_rx_mpdu_peer_meta_data_get(uint8_t *buf) #endif /** - * hal_rx_msdu_end_l3_hdr_padding_get: API to get the + * hal_rx_msdu_end_l3_hdr_padding_get(): API to get the * l3_header padding from rx_msdu_end TLV * * @ buf: pointer to the start of RX PKT TLV headers @@ -618,7 +618,7 @@ hal_rx_msdu_end_l3_hdr_padding_get(uint8_t *buf) RX_MSDU_START_1_MSDU_LENGTH_LSB)) /** - * hal_rx_msdu_start_msdu_len_get: API to get the MSDU length + * hal_rx_msdu_start_msdu_len_get(): API to get the MSDU length * from rx_msdu_start TLV * * @ buf: pointer to the start of RX PKT TLV headers @@ -706,6 +706,77 @@ hal_rx_mpdu_start_sw_peer_id_get(uint8_t *buf) return sw_peer_id; } +#if defined(WCSS_VERSION) && \ + ((defined(CONFIG_WIN) && (WCSS_VERSION > 81)) || \ + (defined(CONFIG_MCL) && (WCSS_VERSION >= 72))) +#define HAL_RX_MSDU_START_SGI_GET(_rx_msdu_start) \ + (_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_msdu_start),\ + RX_MSDU_START_5_SGI_OFFSET)), \ + RX_MSDU_START_5_SGI_MASK, \ + RX_MSDU_START_5_SGI_LSB)) +#else +#define HAL_RX_MSDU_START_SGI_GET(_rx_msdu_start) \ + (_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_msdu_start),\ + RX_MSDU_START_6_SGI_OFFSET)), \ + RX_MSDU_START_6_SGI_MASK, \ + RX_MSDU_START_6_SGI_LSB)) +#endif +/** + * hal_rx_msdu_start_msdu_sgi_get(): API to get the Short Gaurd + * Interval from rx_msdu_start TLV + * + * @buf: pointer to the start of RX PKT TLV headers + * Return: uint32_t(sgi) + */ +static inline uint32_t +hal_rx_msdu_start_sgi_get(uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_msdu_start *msdu_start = + &pkt_tlvs->msdu_start_tlv.rx_msdu_start; + uint32_t sgi; + + sgi = HAL_RX_MSDU_START_SGI_GET(msdu_start); + + return sgi; +} + +#if defined(WCSS_VERSION) && \ + ((defined(CONFIG_WIN) && (WCSS_VERSION > 81)) || \ + (defined(CONFIG_MCL) && (WCSS_VERSION >= 72))) +#define HAL_RX_MSDU_START_RATE_MCS_GET(_rx_msdu_start) \ + (_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_msdu_start),\ + RX_MSDU_START_5_RATE_MCS_OFFSET)), \ + RX_MSDU_START_5_RATE_MCS_MASK, \ + RX_MSDU_START_5_RATE_MCS_LSB)) +#else +#define HAL_RX_MSDU_START_RATE_MCS_GET(_rx_msdu_start) \ + (_HAL_MS((*_OFFSET_TO_WORD_PTR((_rx_msdu_start),\ + RX_MSDU_START_6_RATE_MCS_OFFSET)), \ + RX_MSDU_START_6_RATE_MCS_MASK, \ + RX_MSDU_START_6_RATE_MCS_LSB)) +#endif +/** + * hal_rx_msdu_start_msdu_rate_mcs_get(): API to get the MCS rate + * from rx_msdu_start TLV + * + * @buf: pointer to the start of RX PKT TLV headers + * Return: uint32_t(rate_mcs) + */ +static inline uint32_t +hal_rx_msdu_start_rate_mcs_get(uint8_t *buf) +{ + struct rx_pkt_tlvs *pkt_tlvs = (struct rx_pkt_tlvs *)buf; + struct rx_msdu_start *msdu_start = + &pkt_tlvs->msdu_start_tlv.rx_msdu_start; + uint32_t rate_mcs; + + rate_mcs = HAL_RX_MSDU_START_RATE_MCS_GET(msdu_start); + + return rate_mcs; +} + + /******************************************************************************* * RX ERROR APIS ******************************************************************************/