From patchwork Tue Mar 8 00:58:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve deRosier X-Patchwork-Id: 8528021 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 98488C0553 for ; Tue, 8 Mar 2016 01:02:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B902D201B9 for ; Tue, 8 Mar 2016 01:02:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 940272015A for ; Tue, 8 Mar 2016 01:02:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753877AbcCHBCI (ORCPT ); Mon, 7 Mar 2016 20:02:08 -0500 Received: from mail-qg0-f47.google.com ([209.85.192.47]:35112 "EHLO mail-qg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753847AbcCHBCB (ORCPT ); Mon, 7 Mar 2016 20:02:01 -0500 Received: by mail-qg0-f47.google.com with SMTP id y89so301114qge.2 for ; Mon, 07 Mar 2016 17:02:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=imMLtM3eMXLDySQ+kP8/noYDjESEt4OJgWQwl/aghaE=; b=fsk0GRmpRG1vL7dUk1aztiucP2VKYiT1eAYsPRGnAaiTF958XhGpiozfVtgSGcCKon TmBtWNp4Rhd1Hg/v7Av48oSX6kRgCXNx8gkVTn2V8gCfgDhN2LyTuuqJ2dLD74UCBsBr beYSz2MXtQHPayNnv9YGhqFk6Tr1M2lpsB2WordDC/RqUO1Q6q/KGf8SZH6CDF4pH8vC DvHXpw40ZdZKCD1QmIt6lVv6x1ooawrtkIOY1y4L4egS6vus3jI3OqbVDszINwrCom2v bLEAt3AGESMYXuvnRo0Si5LbGZqC8DnjFCAkoZ9OAfIxTDnzjdVDDUeUktxs+ZCsAPQE ckBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=imMLtM3eMXLDySQ+kP8/noYDjESEt4OJgWQwl/aghaE=; b=HrlsNUkiWIf4OaSo8s7i62ksGf79tqSxWqSNCz8up2IESPyOC6RDCGC9AtYo0Qp8of hxNCG/52iO+bIJtUVHFC9gyYGJ0OD1YYECp0hsG9a4SYmRZzBGuFqEcYlTA4BmduJfeE +lKVDbXf8xEv2CX/SmK+4QtLROWDIfroGM0fxCH164pACxXLXb15U7zs5Z3phOJjZZdU tPwNl5l5I4QvUwS2pBFa4imcYcBiwBq4Bbo0nPbGeb5CVxEdmt1FPNJA4lG+5A/5b78V CpZY0PgB8KzbeCI4JJvvlOz/0Lx3AM7+DN47kTqZ56rB/q6/uejIJQbyvFjWEvwdupNU 5+UA== X-Gm-Message-State: AD7BkJJdXQizJ/+dURe3mYYEfP/cD2O8Q0Xkxh0nJjOasT81PDgclJCRadiSyE4LqifccQ== X-Received: by 10.141.0.65 with SMTP id b62mr9929454qhd.104.1457398920297; Mon, 07 Mar 2016 17:02:00 -0800 (PST) Received: from elmer.corp.lairdtech.com (c-50-184-185-234.hsd1.ca.comcast.net. [50.184.185.234]) by smtp.gmail.com with ESMTPSA id f76sm177220qhe.14.2016.03.07.17.01.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 07 Mar 2016 17:01:59 -0800 (PST) From: Steve deRosier X-Google-Original-From: Steve deRosier To: Kalle Valo Cc: ath6kl@lists.infradead.org, linux-wireless@vger.kernel.org, Steve deRosier Subject: [PATCH] ath6kl: ignore WMI_TXE_NOTIFY_EVENTID based on fw capability flags Date: Mon, 7 Mar 2016 16:58:50 -0800 Message-Id: <1457398730-31088-1-git-send-email-steve.derosier@lairdtech.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/net/wireless/ath/ath6kl/wmi.c | 5 +++++ 1 file changed, 5 insertions(+) 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;