From patchwork Wed Jun 10 05:10:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 6576551 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 0DE8EC0020 for ; Wed, 10 Jun 2015 05:10:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 341D720523 for ; Wed, 10 Jun 2015 05:10:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 50FDE204AD for ; Wed, 10 Jun 2015 05:10:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751318AbbFJFKx (ORCPT ); Wed, 10 Jun 2015 01:10:53 -0400 Received: from mail-wi0-f171.google.com ([209.85.212.171]:35425 "EHLO mail-wi0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750861AbbFJFKv (ORCPT ); Wed, 10 Jun 2015 01:10:51 -0400 Received: by wiga1 with SMTP id a1so35700174wig.0 for ; Tue, 09 Jun 2015 22:10:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=8qt9zsNUSm02sHnUaFqY0XLspwjlCmHByvR5iU1NOJM=; b=k+h2orzBRz0nN1fU6+1u8vVDgVC1WJHOGdrI8LeJ256/VVXZMTBlTiKwwFQRVfWgLQ n4pqvvdARxVPsOwYLnlJozmuPjdpKch7mV9e5b4CvNmTj8QnHZFVRQhV2Xt4+Mxc7nDI X9A6xUC69p3K9rX/iv8OpTOl4HfhUBeSFiACA= 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=8qt9zsNUSm02sHnUaFqY0XLspwjlCmHByvR5iU1NOJM=; b=JswE51MosAugC6gYDObgHO1ZHa2Yl/Y2OLQz98wZCPi1sFIInDejstx1YyPgMhqC9e YIm5HmUe6xFLbNyiW1aINrotKdrJyu2bUmVk10EJ8PK1I0hHe6FRT/N9E8mc0RFGoZ71 GAugkvJDe78WR5UCbHKjVb9Jv6mCN0uHusYMlxKc7/DbXaR1iVJvePsoKhTf9DV/vraM MkeSYwv614+vHWFe8DXu9BVsw34d9Punp0EokeEhvxdbR/xWXucWipVpIpfSKPJjYaUp mLOgPmkxyzhIF2oNpopgDN9OP6mjFtB7UZ6nXR4LlqW1hbeXG/A5MuoeE2H5LTXTk52I I68g== X-Gm-Message-State: ALoCoQk2qnfD9MBOS7NwB6VzZB1kN7MLfZMC6VDTPIuPjculfvTfS4imrxJgyk77IF36sBm9HTxcSiHoXRyv8iFM/oBBSSuP4/WArlBDMr7vSXBHYIxJcyHgiihDDDCWZyGwe/Ra2FUpXreLrKw3g3YLlCaL5sqr4TRUhZ3lNFMLHzu0+MVIz7pzSt0AkZLR0gR/+GWTE96p X-Received: by 10.194.235.4 with SMTP id ui4mr2715264wjc.0.1433913050203; Tue, 09 Jun 2015 22:10:50 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id d3sm5954623wic.1.2015.06.09.22.10.49 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Jun 2015 22:10:49 -0700 (PDT) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: ath9k-devel@venema.h4ckr.net, nbd@openwrt.org, sujith@msujith.org, Janusz Dziedzic Subject: [RFC] ath9k: advertise p2p dev support when chanctx Date: Wed, 10 Jun 2015 07:10:34 +0200 Message-Id: <1433913034-17801-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 X-DomainID: tieto.com 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_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,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 Add p2p dev support when ath9k loaded with use_chanctx=1. This will fix problem, when first interface is an AP and next we would like to run p2p_find. Before p2p scan failed. Signed-off-by: Janusz Dziedzic --- @Felix, Sujith please review. I am not sure if didn't miss some case for NL80211_IFTYPE_P2P_DEVICE (special handling required?). drivers/net/wireless/ath/ath9k/init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index f8d11ef..7da1a17 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -736,13 +736,14 @@ static const struct ieee80211_iface_limit if_limits_multi[] = { BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO) }, { .max = 1, .types = BIT(NL80211_IFTYPE_ADHOC) }, + { .max = 1, .types = BIT(NL80211_IFTYPE_P2P_DEVICE) }, }; static const struct ieee80211_iface_combination if_comb_multi[] = { { .limits = if_limits_multi, .n_limits = ARRAY_SIZE(if_limits_multi), - .max_interfaces = 2, + .max_interfaces = 3, .num_different_channels = 2, .beacon_int_infra_match = true, }, @@ -855,6 +856,9 @@ static void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw) BIT(NL80211_IFTYPE_MESH_POINT) | BIT(NL80211_IFTYPE_WDS); + if (ath9k_is_chanctx_enabled()) + hw->wiphy->interface_modes |= BIT(NL80211_IFTYPE_P2P_DEVICE); + hw->wiphy->iface_combinations = if_comb; hw->wiphy->n_iface_combinations = ARRAY_SIZE(if_comb); }