From patchwork Wed Aug 16 13:13:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 9903733 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 142A360231 for ; Wed, 16 Aug 2017 13:17:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05F93289EE for ; Wed, 16 Aug 2017 13:17:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF39A289F0; Wed, 16 Aug 2017 13:17:46 +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.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 96F0C289EE for ; Wed, 16 Aug 2017 13:17:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751844AbdHPNRo (ORCPT ); Wed, 16 Aug 2017 09:17:44 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33448 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751637AbdHPNRn (ORCPT ); Wed, 16 Aug 2017 09:17:43 -0400 Received: by mail-pf0-f196.google.com with SMTP id c65so1360666pfl.0 for ; Wed, 16 Aug 2017 06:17:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gj5u2D/POdnTshV8eeZ3rwRGcyQ1+I2zWg6eqG3VZr4=; b=NgPvLRrw+Fzf2/Ic7oLTIrlMsyQxyrYU0j3hUoVlT6KCHtGzqCzO91TjjlG7e2FVIh /ZoY+Cm1dIRvweLEzsd7jHKwsp69feQ/hmcol9msjTq8OgQIH2/jpHyTbifgL4fOousx FUaB+bw0imoaF6oLnhGW9yRU9VRdFkvnlBVSmzd4FvOLGLZ3e1UgCogyFiBu0XTEIce1 X0Qx7XC5rXg/1VwXI2jHm+hZOVwF1Tj6G2SGa+XC5uzTG8c0sWdUUxmFHY4Bgb6+ZB/9 spKUs5fSaxu9ixBQco0LMj0q6MVN1uEU6Jzn7xHOQaEUO26cr58nCR+umAt46MKNnvhR yHvw== 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:in-reply-to :references; bh=gj5u2D/POdnTshV8eeZ3rwRGcyQ1+I2zWg6eqG3VZr4=; b=M+IcIzBuSzvygaBqxOPCakIvriWf7iVjXbSjEUjkkWsjNYZc7349XT0tikVLrbkDkx EKLUr4MZVwsNjTzY/25sqUWAAmXfapCLZoeqrAspZctEZ12PvCw2JeCknyXt4DKZHMKC kx//zJiPFwvvkWSEx+G4qOGxRGv9duZBc44H/FPC1uZkjGCjk5Mpf0y7HF/7DKEWWaN5 nzE/mXk/nEKM7m3uc4JL9g+iZZ24zKQINhi/+O+oj+aLKisQLNIJ7O26krR+SmI/Bih4 /0zuDIbM4DuZd5aXGKt95AVjKgmUWLsgZYaY40OFZUJfKZfGLIsDhg1EyyQd67i7bfRX mDOw== X-Gm-Message-State: AHYfb5hD/TeZ1M0hSptfWuBMX4nzKgxOFKE5NJiVFhHeXHSCTKsLkbi/ xJGOSyShDjCBNA== X-Received: by 10.84.132.129 with SMTP id e1mr1865010ple.316.1502889463427; Wed, 16 Aug 2017 06:17:43 -0700 (PDT) Received: from cpu185.redpinesignals.com ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id g9sm2843862pfe.104.2017.08.16.06.17.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Aug 2017 06:17:42 -0700 (PDT) From: Amitkumar Karwar To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Prameela Rani Garnepudi Subject: [v2 01/11] rsi: advertise ap mode support Date: Wed, 16 Aug 2017 18:43:08 +0530 Message-Id: <1502889198-4478-2-git-send-email-amitkarwar@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1502889198-4478-1-git-send-email-amitkarwar@gmail.com> References: <1502889198-4478-1-git-send-email-amitkarwar@gmail.com> 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 From: Prameela Rani Garnepudi AP mode support is advertised to cfg80211. Necessary wiphy parameters are initialized. Signed-off-by: Prameela Rani Garnepudi Signed-off-by: Amitkumar Karwar --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 28 +++++++++++++++++++++++++++- drivers/net/wireless/rsi/rsi_main.h | 10 ++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index 210ad79..2da5493 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -122,6 +122,23 @@ const u16 rsi_mcsrates[8] = { RSI_RATE_MCS4, RSI_RATE_MCS5, RSI_RATE_MCS6, RSI_RATE_MCS7 }; +static const u32 rsi_max_ap_stas[16] = { + 32, /* 1 - Wi-Fi alone */ + 0, /* 2 */ + 0, /* 3 */ + 0, /* 4 - BT EDR alone */ + 4, /* 5 - STA + BT EDR */ + 32, /* 6 - AP + BT EDR */ + 0, /* 7 */ + 0, /* 8 - BT LE alone */ + 4, /* 9 - STA + BE LE */ + 0, /* 10 */ + 0, /* 11 */ + 0, /* 12 */ + 1, /* 13 - STA + BT Dual */ + 4, /* 14 - AP + BT Dual */ +}; + /** * rsi_is_cipher_wep() - This function determines if the cipher is WEP or not. * @common: Pointer to the driver private structure. @@ -1348,7 +1365,8 @@ int rsi_mac80211_attach(struct rsi_common *common) SET_IEEE80211_PERM_ADDR(hw, common->mac_addr); ether_addr_copy(hw->wiphy->addr_mask, addr_mask); - wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); + wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | + BIT(NL80211_IFTYPE_AP); wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wiphy->retry_short = RETRY_SHORT; wiphy->retry_long = RETRY_LONG; @@ -1363,6 +1381,14 @@ int rsi_mac80211_attach(struct rsi_common *common) wiphy->bands[NL80211_BAND_5GHZ] = &adapter->sbands[NL80211_BAND_5GHZ]; + /* AP Parameters */ + wiphy->max_ap_assoc_sta = rsi_max_ap_stas[common->oper_mode - 1]; + common->max_stations = wiphy->max_ap_assoc_sta; + rsi_dbg(ERR_ZONE, "Max Stations Allowed = %d\n", common->max_stations); + hw->sta_data_size = sizeof(struct rsi_sta); + wiphy->flags = WIPHY_FLAG_REPORTS_OBSS; + wiphy->flags |= WIPHY_FLAG_AP_UAPSD; + wiphy->features |= NL80211_FEATURE_INACTIVITY_TIMER; wiphy->reg_notifier = rsi_reg_notify; wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); diff --git a/drivers/net/wireless/rsi/rsi_main.h b/drivers/net/wireless/rsi/rsi_main.h index d05b5e0..0077888 100644 --- a/drivers/net/wireless/rsi/rsi_main.h +++ b/drivers/net/wireless/rsi/rsi_main.h @@ -21,6 +21,13 @@ #include #include +struct rsi_sta { + struct ieee80211_sta *sta; + s16 sta_id; + u16 seq_start[IEEE80211_NUM_TIDS]; + bool start_tx_aggr[IEEE80211_NUM_TIDS]; +}; + struct rsi_hw; #include "rsi_ps.h" @@ -253,6 +260,9 @@ struct rsi_common { u16 beacon_interval; u8 dtim_cnt; + + /* AP mode parameters */ + int max_stations; }; enum host_intf {