diff mbox

ath6kl: ignore WMI_TXE_NOTIFY_EVENTID based on fw capability flags

Message ID 1457398730-31088-1-git-send-email-steve.derosier@lairdtech.com (mailing list archive)
State Accepted
Delegated to: Kalle Valo
Headers show

Commit Message

Steve deRosier March 8, 2016, 12:58 a.m. UTC
Certain 6004 firmware releases redefine the WMI_TXE_NOTIFY_EVENTID event
number and sends the new event frequently. However it doesn't have the
tx-err-notify feature and thus this firmware capability flag isn't set on
the firmware package. By guarding the processing of this event by the same
method we guard the sending of the WMI_SET_TXE_NOTIFY_CMDID command, we
can ignore the spurious event that we don't know how to process.

Without this change we call cfg80211_cqm_txe_notify() with possibly bad
data.

Signed-off-by: Steve deRosier <steve.derosier@lairdtech.com>
---
 drivers/net/wireless/ath/ath6kl/wmi.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Kalle Valo March 11, 2016, 12:20 p.m. UTC | #1
Steve deRosier <derosier@gmail.com> writes:

> Certain 6004 firmware releases redefine the WMI_TXE_NOTIFY_EVENTID event
> number and sends the new event frequently. However it doesn't have the
> tx-err-notify feature and thus this firmware capability flag isn't set on
> the firmware package. By guarding the processing of this event by the same
> method we guard the sending of the WMI_SET_TXE_NOTIFY_CMDID command, we
> can ignore the spurious event that we don't know how to process.
>
> Without this change we call cfg80211_cqm_txe_notify() with possibly bad
> data.
>
> Signed-off-by: Steve deRosier <steve.derosier@lairdtech.com>

Applied to ath.git, thanks.
diff mbox

Patch

diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c
index a5e1de7..0b3e9c0 100644
--- a/drivers/net/wireless/ath/ath6kl/wmi.c
+++ b/drivers/net/wireless/ath/ath6kl/wmi.c
@@ -1584,6 +1584,11 @@  static int ath6kl_wmi_txe_notify_event_rx(struct wmi *wmi, u8 *datap, int len,
 	if (len < sizeof(*ev))
 		return -EINVAL;
 
+	if (vif->nw_type != INFRA_NETWORK ||
+	    !test_bit(ATH6KL_FW_CAPABILITY_TX_ERR_NOTIFY,
+		      vif->ar->fw_capabilities))
+		return -EOPNOTSUPP;
+
 	if (vif->sme_state != SME_CONNECTED)
 		return -ENOTCONN;