From patchwork Thu Apr 12 15:41:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alfonso_S=C3=A1nchez-Beato?= X-Patchwork-Id: 10338903 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AF8AE602D8 for ; Thu, 12 Apr 2018 15:42:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9FB411FF62 for ; Thu, 12 Apr 2018 15:42:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92F6620416; Thu, 12 Apr 2018 15:42:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D3C662022C for ; Thu, 12 Apr 2018 15:42:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752918AbeDLPmi (ORCPT ); Thu, 12 Apr 2018 11:42:38 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:42142 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752775AbeDLPmh (ORCPT ); Thu, 12 Apr 2018 11:42:37 -0400 Received: from mail-wr0-f198.google.com ([209.85.128.198]) by youngberry.canonical.com with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.76) (envelope-from ) id 1f6eMu-0002ej-PF for linux-wireless@vger.kernel.org; Thu, 12 Apr 2018 15:42:36 +0000 Received: by mail-wr0-f198.google.com with SMTP id d37so3247246wrd.21 for ; Thu, 12 Apr 2018 08:42:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=xpZjXv77JZ0iMxuqj2N4bmqfy6ynjd0vxPzPqcD/J0A=; b=BYZN2HmzAcKhwh8prSzPMSfqPRGToUrTiY86Pf6mv72v8Jp3q3jmoPIoPrTxTCVZVd 1nNUAmulz+UbgyFqFPF/fdzpzKs95w/DEaSH2jOiFkGNThdHBDobkYhLrw8x995TN5Hl /N7DzIb/Db01o9aq6u3qhrmHLrGpTZ8yuTWr1t3d/GIIq6D6OX21x4nwF1S4K89Vm+A5 /scQfyu4H4dtHyPln/r9bl0bwFRS3xLCb2W2kz7ZJ1lOJ/eOlXuC0TEFiSJwObNpxqHk QWop8AcQOTgz3em+zgsMFV7B4/rXhKf3r56FVH3Aa+SLXLGtYxdpjq1vjUIhWEaeJx4o bTNg== X-Gm-Message-State: ALQs6tCWyKaTaeqLyGtGPixcHwZjxubkVkeHQtmZpdhOFKmUpF+37QYh 3bEl2JgIfDyvy7/EctG6Mwjz1VtkG+4yHL9P++QRK4N/UXCvW5PVVOJIkhHYEo43I26VSsLDIFO aPBXOxZ2RFCeZZUsAe1BYsefbFfOfJnqcsT/mNiorFHYz X-Received: by 10.223.150.161 with SMTP id u30mr1143717wrb.151.1523547756453; Thu, 12 Apr 2018 08:42:36 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+dKhy3qUFg8awUL1np48EI3OHW5raKVUVheaxBqh3Nld1NwNMFdgRf0YRXEmmLZVsL8nQKGA== X-Received: by 10.223.150.161 with SMTP id u30mr1143697wrb.151.1523547756198; Thu, 12 Apr 2018 08:42:36 -0700 (PDT) Received: from localhost.localdomain ([80.30.243.246]) by smtp.gmail.com with ESMTPSA id 71sm5136398wmg.11.2018.04.12.08.42.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 12 Apr 2018 08:42:34 -0700 (PDT) From: =?UTF-8?q?Alfonso=20S=C3=A1nchez-Beato?= To: kvalo@qca.qualcomm.com Cc: ath6kl@lists.infradead.org, linux-wireless@vger.kernel.org, alfonso.sanchez-beato@canonical.com Subject: [PATCH] ath6kl: use WMI to set RSN capabilities Date: Thu, 12 Apr 2018 17:41:59 +0200 Message-Id: <20180412154159.13934-1-alfonso.sanchez-beato@canonical.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes AP mode when the ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE flag is not present in the FW. The id of some WMI commands is also fixed (there was an error in the enum order), and a function to set RSN caps is added. Signed-off-by: Alfonso Sánchez-Beato --- drivers/net/wireless/ath/ath6kl/cfg80211.c | 21 ++++++--------------- drivers/net/wireless/ath/ath6kl/main.c | 10 +++------- drivers/net/wireless/ath/ath6kl/wmi.c | 23 +++++++++++++++++++++++ drivers/net/wireless/ath/ath6kl/wmi.h | 15 +++++++++++---- 4 files changed, 43 insertions(+), 26 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/cfg80211.c b/drivers/net/wireless/ath/ath6kl/cfg80211.c index 2ba8cf3f38af..1b89c53d47e7 100644 --- a/drivers/net/wireless/ath/ath6kl/cfg80211.c +++ b/drivers/net/wireless/ath/ath6kl/cfg80211.c @@ -2933,13 +2933,11 @@ static int ath6kl_start_ap(struct wiphy *wiphy, struct net_device *dev, * advertise the same in beacon/probe response. Send * the complete RSN IE capability field to firmware */ - if (!ath6kl_get_rsn_capab(&info->beacon, (u8 *) &rsn_capab) && - test_bit(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE, - ar->fw_capabilities)) { - res = ath6kl_wmi_set_ie_cmd(ar->wmi, vif->fw_vif_idx, - WLAN_EID_RSN, WMI_RSN_IE_CAPB, - (const u8 *) &rsn_capab, - sizeof(rsn_capab)); + if (!ath6kl_get_rsn_capab(&info->beacon, (u8 *)&rsn_capab)) { + ath6kl_dbg(ATH6KL_DBG_WLAN_CFG, "RSN caps %d\n", rsn_capab); + + res = ath6kl_wmi_set_rsn_cap(ar->wmi, vif->fw_vif_idx, + rsn_capab); vif->rsn_capab = rsn_capab; if (res < 0) return res; @@ -3918,14 +3916,7 @@ int ath6kl_cfg80211_init(struct ath6kl *ar) return -EINVAL; } - /* - * Even if the fw has HT support, advertise HT cap only when - * the firmware has support to override RSN capability, otherwise - * 4-way handshake would fail. - */ - if (!(ht && - test_bit(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE, - ar->fw_capabilities))) { + if (!ht) { ath6kl_band_2ghz.ht_cap.cap = 0; ath6kl_band_2ghz.ht_cap.ht_supported = false; ath6kl_band_5ghz.ht_cap.cap = 0; diff --git a/drivers/net/wireless/ath/ath6kl/main.c b/drivers/net/wireless/ath/ath6kl/main.c index db95f85751e3..4e186f8b3950 100644 --- a/drivers/net/wireless/ath/ath6kl/main.c +++ b/drivers/net/wireless/ath/ath6kl/main.c @@ -579,13 +579,9 @@ static int ath6kl_commit_ch_switch(struct ath6kl_vif *vif, u16 channel) * reconfigure any saved RSN IE capabilites in the beacon / * probe response to stay in sync with the supplicant. */ - if (vif->rsn_capab && - test_bit(ATH6KL_FW_CAPABILITY_RSN_CAP_OVERRIDE, - ar->fw_capabilities)) - ath6kl_wmi_set_ie_cmd(ar->wmi, vif->fw_vif_idx, - WLAN_EID_RSN, WMI_RSN_IE_CAPB, - (const u8 *) &vif->rsn_capab, - sizeof(vif->rsn_capab)); + if (vif->rsn_capab) + ath6kl_wmi_set_rsn_cap(ar->wmi, vif->fw_vif_idx, + vif->rsn_capab); return ath6kl_wmi_ap_profile_commit(ar->wmi, vif->fw_vif_idx, &vif->profile); diff --git a/drivers/net/wireless/ath/ath6kl/wmi.c b/drivers/net/wireless/ath/ath6kl/wmi.c index 777acc564ac9..d7de9224d755 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.c +++ b/drivers/net/wireless/ath/ath6kl/wmi.c @@ -4168,3 +4168,26 @@ void ath6kl_wmi_shutdown(struct wmi *wmi) kfree(wmi->last_mgmt_tx_frame); kfree(wmi); } + +int ath6kl_wmi_set_rsn_cap(struct wmi *wmi, u8 if_idx, u16 rsn_cap) +{ + struct sk_buff *skb; + struct wmi_rsn_cap_cmd *cmd; + + skb = ath6kl_wmi_get_new_buf(sizeof(*cmd)); + if (!skb) + return -ENOMEM; + + ath6kl_dbg(ATH6KL_DBG_WMI, "set_rsn_cap: 0x%04x\n", rsn_cap); + + cmd = (struct wmi_rsn_cap_cmd *)skb->data; + cmd->rsn_cap = cpu_to_le16(rsn_cap); + + return ath6kl_wmi_cmd_send(wmi, if_idx, skb, WMI_SET_RSN_CAP_CMDID, + NO_SYNC_WMIFLAG); +} + +int ath6kl_wmi_get_rsn_cap(struct wmi *wmi, u8 if_idx) +{ + return ath6kl_wmi_simple_cmd(wmi, if_idx, WMI_GET_RSN_CAP_CMDID); +} diff --git a/drivers/net/wireless/ath/ath6kl/wmi.h b/drivers/net/wireless/ath/ath6kl/wmi.h index a60bb49fe920..011d4b6fb5ab 100644 --- a/drivers/net/wireless/ath/ath6kl/wmi.h +++ b/drivers/net/wireless/ath/ath6kl/wmi.h @@ -597,10 +597,6 @@ enum wmi_cmd_id { WMI_GREENTX_PARAMS_CMDID, - WMI_RTT_MEASREQ_CMDID, - WMI_RTT_CAPREQ_CMDID, - WMI_RTT_STATUSREQ_CMDID, - /* WPS Commands */ WMI_WPS_START_CMDID, WMI_GET_WPS_STATUS_CMDID, @@ -621,6 +617,10 @@ enum wmi_cmd_id { WMI_RX_FILTER_COALESCE_FILTER_OP_CMDID, WMI_RX_FILTER_SET_FRAME_TEST_LIST_CMDID, + WMI_RTT_MEASREQ_CMDID, + WMI_RTT_CAPREQ_CMDID, + WMI_RTT_STATUSREQ_CMDID, + WMI_SEND_MGMT_CMDID, WMI_BEGIN_SCAN_CMDID, @@ -2533,6 +2533,10 @@ enum wmi_sync_flag { END_WMIFLAG }; +struct wmi_rsn_cap_cmd { + __le16 rsn_cap; +} __packed; + enum htc_endpoint_id ath6kl_wmi_get_control_ep(struct wmi *wmi); void ath6kl_wmi_set_control_ep(struct wmi *wmi, enum htc_endpoint_id ep_id); int ath6kl_wmi_dix_2_dot3(struct wmi *wmi, struct sk_buff *skb); @@ -2728,4 +2732,7 @@ void *ath6kl_wmi_init(struct ath6kl *devt); void ath6kl_wmi_shutdown(struct wmi *wmi); void ath6kl_wmi_reset(struct wmi *wmi); +int ath6kl_wmi_set_rsn_cap(struct wmi *wmi, u8 if_idx, u16 rsn_cap); +int ath6kl_wmi_get_rsn_cap(struct wmi *wmi, u8 if_idx); + #endif /* WMI_H */