qcacmn: Check the MPDU start tag before read ppdu id

Check the MPDU start tag before read ppdu id in MPDU
start TLV in the head of packet TLV.

Change-Id: I0b9a367e148d55a6c667adc8ad16e7c0fdf0a741
This commit is contained in:
Kai Chen 2018-07-22 11:34:13 -07:00 • committed by nshrivas
commit 339b01d8ae
2 changed files with 27 additions and 0 deletions

View file

@ -222,6 +222,14 @@ dp_rx_mon_mpdu_pop(struct dp_soc *soc, uint32_t mac_id,
num_msdus);
if (is_first_msdu) {
if (!HAL_RX_HW_DESC_MPDU_VALID(
rx_desc_tlv)) {
drop_mpdu = true;
qdf_nbuf_free(msdu);
msdu = NULL;
goto next_msdu;
}
msdu_ppdu_id = HAL_RX_HW_DESC_GET_PPDUID_GET(
rx_desc_tlv);
is_first_msdu = false;

View file

@ -212,6 +212,25 @@ HAL_RX_DESC_GET_80211_HDR(void *hw_desc_addr) {
return rx_pkt_hdr;
}
/*
* HAL_RX_HW_DESC_MPDU_VALID() - check MPDU start TLV tag in MPDU
* start TLV of Hardware TLV descriptor
* @hw_desc_addr: Hardware desciptor address
*
* Return: bool: if TLV tag match
*/
static inline
bool HAL_RX_HW_DESC_MPDU_VALID(void *hw_desc_addr)
{
struct rx_pkt_tlvs *rx_desc = (struct rx_pkt_tlvs *)hw_desc_addr;
uint32_t tlv_tag;
tlv_tag = HAL_RX_GET_USER_TLV32_TYPE(
&rx_desc->mpdu_start_tlv);
return tlv_tag == WIFIRX_MPDU_START_E ? true : false;
}
static inline
uint32_t HAL_RX_HW_DESC_GET_PPDUID_GET(void *hw_desc_addr)
{