From patchwork Thu Oct 13 11:26:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Prameela Rani Garnepudi X-Patchwork-Id: 9374987 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 DAADD6075E for ; Thu, 13 Oct 2016 13:28:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CB4402A09A for ; Thu, 13 Oct 2016 13:28:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BF70B2A0A0; Thu, 13 Oct 2016 13:28:12 +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=-6.3 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID 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 505602A09A for ; Thu, 13 Oct 2016 13:28:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754915AbcJMN2B (ORCPT ); Thu, 13 Oct 2016 09:28:01 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35495 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754421AbcJMN2A (ORCPT ); Thu, 13 Oct 2016 09:28:00 -0400 Received: by mail-pf0-f196.google.com with SMTP id s8so5104037pfj.2 for ; Thu, 13 Oct 2016 06:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=6QQmSteWrmW6JwZl456rv+ItOnpak/6tl6Mni8g7vAg=; b=M8yonE+f1oFjQbVWQ9ZKOS7vcboo5foXzp7vNuY9o7/VKi+Oz2pYakgjejbH9SRdcc sMMrbjxWpDR91oc15/o+444g5J++M1ni/Z972qm1IL1JSdb9ppTkHgYHttocvscj3hpf hlX1bIRdreDB57KS6ImrOUm1REO9FpTGgfHL3rmuQZRYo4VLwkQPA9ofvTW1KV4GxD5U JnIUYcLGlSR8Ypi2JBxKjJCxRwmWQdLHqQnaK1xB6j8U5nnO/Ha1ccUuF+ZO3VxFV4xL h/wF5JPyYFnN0dsSPCI4ZeuKvkD7K3MsQY3zxYGTzQMW+EEfIPRVe8pLM4TW1dywP8hP ZtDA== 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=6QQmSteWrmW6JwZl456rv+ItOnpak/6tl6Mni8g7vAg=; b=UcMmGFaYn6TKlopkSR6XpAswT7AW0KEfT4+KLbh1RS0J6olSuxhTIYWlF7ZivX1Xub tbJnuPiwS2Sa4gLT4kGb1mEAzHxVeG0x9ERuVP/ghURVa/dkXdmQ3AQH7+A8cJlAyg7M eDJxlQiA/FvlSZloqqawF3BngtkXaWPDxx13ZJBpz8EyWTXxiZeLTIotwwpO7f4pzXD4 GLB4e/x1UjPo0/5gJpLNTrlq6QmQbwelucTWRLMvSdNKEu2wU8lxEEYOHgYhGPIugH4l ztHfiSjoNpLSlwImqUJQFESV8s6okGqJnBgoHQrdOG27qOvP4Ye7aQbnp7fXY6O3686J MRjw== X-Gm-Message-State: AA6/9Rk/Gt5G/0DrslpWSEvOxKhvZAUv+AjrUrp8lTSpy/NmrWtvUxmlIEJFaG22wdmHkw== X-Received: by 10.98.87.209 with SMTP id i78mr9314773pfj.79.1476358173219; Thu, 13 Oct 2016 04:29:33 -0700 (PDT) Received: from lapt225.localdomain ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id n2sm18752519pfa.75.2016.10.13.04.29.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 04:29:32 -0700 (PDT) From: Prameela Rani Garnepudi To: linux-wireless@vger.kernel.org Cc: kvalo@codeaurora.org, johannes.berg@intel.com, hofrat@osadl.org, xypron.glpk@gmx.de, prameela.garnepudi@redpinesignals.com, Prameela Rani Garnepudi Subject: [PATCH 2/3] rsi: Host to device command frame vap_capabilites modified with new field vap status Date: Thu, 13 Oct 2016 16:56:45 +0530 Message-Id: <1476358005-15521-1-git-send-email-prameela.j04cs@gmail.com> X-Mailer: git-send-email 2.4.11 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 * Command frame vap_capabilites is modified to use for vap add, vap delete and vap update in firmware, hence new filed vap status is added. * When interface is down this frame needs to be send with vap status delete. Otherwise it is considered as wrong frame for the same interface in firmware. * vap_update status is reserved for future. Signed-off-by: Prameela Rani Garnepudi --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 8 ++++++-- drivers/net/wireless/rsi/rsi_91x_mgmt.c | 5 ++++- drivers/net/wireless/rsi/rsi_mgmt.h | 9 ++++++++- 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 58779c0..aaca258 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -315,7 +315,9 @@ static int rsi_mac80211_add_interface(struct ieee80211_hw *hw, if (!adapter->sc_nvifs) { ++adapter->sc_nvifs; adapter->vifs[0] = vif; - ret = rsi_set_vap_capabilities(common, STA_OPMODE); + ret = rsi_set_vap_capabilities(common, + STA_OPMODE, + VAP_ADD); } break; default: @@ -343,8 +345,10 @@ static void rsi_mac80211_remove_interface(struct ieee80211_hw *hw, struct rsi_common *common = adapter->priv; mutex_lock(&common->mutex); - if (vif->type == NL80211_IFTYPE_STATION) + if (vif->type == NL80211_IFTYPE_STATION) { adapter->sc_nvifs--; + rsi_set_vap_capabilities(common, STA_OPMODE, VAP_DELETE); + } if (!memcmp(adapter->vifs[0], vif, sizeof(struct ieee80211_vif))) adapter->vifs[0] = NULL; diff --git a/drivers/net/wireless/rsi/rsi_91x_mgmt.c b/drivers/net/wireless/rsi/rsi_91x_mgmt.c index 35c14cc..30b9d44 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mgmt.c +++ b/drivers/net/wireless/rsi/rsi_91x_mgmt.c @@ -617,7 +617,9 @@ static int rsi_program_bb_rf(struct rsi_common *common) * * Return: 0 on success, corresponding negative error code on failure. */ -int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode) +int rsi_set_vap_capabilities(struct rsi_common *common, + enum opmode mode, + u8 vap_status) { struct sk_buff *skb = NULL; struct rsi_vap_caps *vap_caps; @@ -642,6 +644,7 @@ int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode) FRAME_DESC_SZ) | (RSI_WIFI_MGMT_Q << 12)); vap_caps->desc_word[1] = cpu_to_le16(VAP_CAPABILITIES); + vap_caps->desc_word[2] = cpu_to_le16(vap_status << 8); vap_caps->desc_word[4] = cpu_to_le16(mode | (common->channel_width << 8)); vap_caps->desc_word[7] = cpu_to_le16((vap_id << 8) | diff --git a/drivers/net/wireless/rsi/rsi_mgmt.h b/drivers/net/wireless/rsi/rsi_mgmt.h index 3741173..d155358 100644 --- a/drivers/net/wireless/rsi/rsi_mgmt.h +++ b/drivers/net/wireless/rsi/rsi_mgmt.h @@ -145,6 +145,12 @@ enum opmode { AP_OPMODE = 2 }; +enum vap_status { + VAP_ADD = 1, + VAP_DELETE = 2, + VAP_UPDATE = 3 +}; + extern struct ieee80211_rate rsi_rates[12]; extern const u16 rsi_mcsrates[8]; @@ -287,7 +293,8 @@ static inline u8 rsi_get_channel(u8 *addr) } int rsi_mgmt_pkt_recv(struct rsi_common *common, u8 *msg); -int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode); +int rsi_set_vap_capabilities(struct rsi_common *common, enum opmode mode, + u8 vap_status); int rsi_send_aggregation_params_frame(struct rsi_common *common, u16 tid, u16 ssn, u8 buf_size, u8 event); int rsi_hal_load_key(struct rsi_common *common, u8 *data, u16 key_len,