From patchwork Wed Aug 30 09:38:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amitkumar Karwar X-Patchwork-Id: 9929129 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 6CA306022E for ; Wed, 30 Aug 2017 09:43:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6A1492842E for ; Wed, 30 Aug 2017 09:43:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F1FD2843B; Wed, 30 Aug 2017 09:43:33 +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 DCFBB2842E for ; Wed, 30 Aug 2017 09:43:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751434AbdH3Jnb (ORCPT ); Wed, 30 Aug 2017 05:43:31 -0400 Received: from mail-pg0-f67.google.com ([74.125.83.67]:36260 "EHLO mail-pg0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751242AbdH3Jna (ORCPT ); Wed, 30 Aug 2017 05:43:30 -0400 Received: by mail-pg0-f67.google.com with SMTP id 83so4713536pgb.3 for ; Wed, 30 Aug 2017 02:43:30 -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=aui2i+rFQhsBgwXkIdEIWYCSt58vsvDTDzTiG4PIXn4=; b=ciElulx2SIfPz5WMxNV4ZYoXR2QUF8xs9kvPCJ0VCgkYBlbwxPHcprWBCP1XxAxuzc m60tlYnM1wG4BhJPUUHdbM/giow7/UO5Y0j8AvAROjNx/Jae8R/pka/aNCQvniV1+Jag ZXzOuzIQWUaiy/tGX+j2KWIDvSt02fcVkAKU4UQCQgKpj56875Zp6FXHfwh+Iy/BIeW3 HYuo7xvrC6C2UO+SPD+CmiAUyqztbiszFe7SxqMC3G2XSu1VrffFfxrulsY6KyDBU7jJ N00q0ut7bKdV5ywDZvu7z5X9X6fVERkMdQqghdyKcx8L72OtNK4uBpe/dTwXKm5FeHm6 qpLQ== 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=aui2i+rFQhsBgwXkIdEIWYCSt58vsvDTDzTiG4PIXn4=; b=n5znXH6zco6/GXzkuwp8X3zauujzCO4mm3G1e+optZ5G6ykrwhZJtd92OWSn0TLnLv z/T5Rv7C+MJRFAvAuvWfr6KmLwf8zhNc8MBDYGTinNop7vYI/GM27yo4o8cnsXQ1grGf 2C1ZwvfUxzUVgpPiLsFd6UShoLJXBnZjZqh5E8rYZXKrEnP5RCxSEHDpROT/cTxooCmP i2A9EK3aMsqToAA4r4jeX0WyOprDJZzI7hL50r5w97ZLfmxa8P61oKfA5//EHOpohlQZ oNLcoXIYF29NNs4BusMVY4e8t5Y6ZzO1zXych59twWmwxG530eL6Ke8xbM0yfFDH9i1s 0IQQ== X-Gm-Message-State: AHYfb5iDZCcwUEjbuoKj4QZBbE3Sfesu1Je94ZkgV5ELxM8bcQxk49Wf kxtzjBLf6RzpuA== X-Received: by 10.99.1.136 with SMTP id 130mr919120pgb.215.1504086209103; Wed, 30 Aug 2017 02:43:29 -0700 (PDT) Received: from cpu185.redpinesignals.com ([203.196.161.90]) by smtp.gmail.com with ESMTPSA id i127sm2209650pgc.73.2017.08.30.02.43.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 30 Aug 2017 02:43:28 -0700 (PDT) From: Amitkumar Karwar To: Kalle Valo Cc: linux-wireless@vger.kernel.org, Amitkumar Karwar , Prameela Rani Garnepudi Subject: [PATCH 1/8] rsi: add p2p support parameters to mac80211 Date: Wed, 30 Aug 2017 15:08:21 +0530 Message-Id: <1504085908-2163-2-git-send-email-amitkarwar@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1504085908-2163-1-git-send-email-amitkarwar@gmail.com> References: <1504085908-2163-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 This patch adds p2p supported parameters to mac80211 hw and wiphy structures during mac80211 registration. Signed-off-by: Prameela Rani Garnepudi Signed-off-by: Amitkumar Karwar --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 37 ++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/rsi/rsi_91x_mac80211.c b/drivers/net/wireless/rsi/rsi_91x_mac80211.c index fa12c05..992ac6c 100644 --- a/drivers/net/wireless/rsi/rsi_91x_mac80211.c +++ b/drivers/net/wireless/rsi/rsi_91x_mac80211.c @@ -139,6 +139,32 @@ static const u32 rsi_max_ap_stas[16] = { 4, /* 14 - AP + BT Dual */ }; +static const struct ieee80211_iface_limit rsi_iface_limits[] = { + { + .max = 1, + .types = BIT(NL80211_IFTYPE_STATION), + }, + { + .max = 1, + .types = BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO), + }, + { + .max = 1, + .types = BIT(NL80211_IFTYPE_P2P_DEVICE), + }, +}; + +static const struct ieee80211_iface_combination rsi_iface_combinations[] = { + { + .num_different_channels = 1, + .max_interfaces = 3, + .limits = rsi_iface_limits, + .n_limits = ARRAY_SIZE(rsi_iface_limits), + }, +}; + /** * rsi_is_cipher_wep() - This function determines if the cipher is WEP or not. * @common: Pointer to the driver private structure. @@ -1581,7 +1607,11 @@ int rsi_mac80211_attach(struct rsi_common *common) ether_addr_copy(hw->wiphy->addr_mask, addr_mask); wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | - BIT(NL80211_IFTYPE_AP); + BIT(NL80211_IFTYPE_AP) | + BIT(NL80211_IFTYPE_P2P_DEVICE) | + BIT(NL80211_IFTYPE_P2P_CLIENT) | + BIT(NL80211_IFTYPE_P2P_GO); + wiphy->signal_type = CFG80211_SIGNAL_TYPE_MBM; wiphy->retry_short = RETRY_SHORT; wiphy->retry_long = RETRY_LONG; @@ -1608,6 +1638,11 @@ int rsi_mac80211_attach(struct rsi_common *common) wiphy_ext_feature_set(wiphy, NL80211_EXT_FEATURE_CQM_RSSI_LIST); + /* Wi-Fi direct parameters */ + hw->max_listen_interval = 10; + wiphy->iface_combinations = rsi_iface_combinations; + wiphy->n_iface_combinations = ARRAY_SIZE(rsi_iface_combinations); + status = ieee80211_register_hw(hw); if (status) return status;