Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions drivers/net/wireless/ath/ath10k/testmode.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ static const struct nla_policy ath10k_tm_policy[ATH10K_TM_ATTR_MAX + 1] = {
[ATH10K_TM_ATTR_VERSION_MINOR] = { .type = NLA_U32 },
};

static bool ath10k_tm_is_utf_event(u32 cmd_id)
{
return cmd_id == WMI_10X_PDEV_UTF_EVENTID ||
cmd_id == WMI_10_2_PDEV_UTF_EVENTID ||
cmd_id == WMI_10_4_PDEV_UTF_EVENTID ||
cmd_id == WMI_TLV_PDEV_UTF_EVENTID;
}

/* Returns true if callee consumes the skb and the skb should be discarded.
* Returns false if skb is not used. Does not sleep.
*/
Expand Down Expand Up @@ -53,6 +61,12 @@ bool ath10k_tm_event_wmi(struct ath10k *ar, u32 cmd_id, struct sk_buff *skb)
*/
consumed = true;

if (!ath10k_tm_is_utf_event(cmd_id)) {
ath10k_dbg(ar, ATH10K_DBG_TESTMODE,
"testmode drop non-utf event cmd_id %u\n", cmd_id);
goto out;
}

nl_skb = cfg80211_testmode_alloc_event_skb(ar->hw->wiphy,
2 * sizeof(u32) + skb->len,
GFP_ATOMIC);
Expand Down