From patchwork Wed Dec 10 12:31:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5468751 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id EBCA79F30B for ; Wed, 10 Dec 2014 12:44:33 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 190902010C for ; Wed, 10 Dec 2014 12:44:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 34BA02010B for ; Wed, 10 Dec 2014 12:44:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755658AbaLJMoa (ORCPT ); Wed, 10 Dec 2014 07:44:30 -0500 Received: from mail-wg0-f54.google.com ([74.125.82.54]:57365 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755171AbaLJMoZ (ORCPT ); Wed, 10 Dec 2014 07:44:25 -0500 Received: by mail-wg0-f54.google.com with SMTP id l2so3495519wgh.13 for ; Wed, 10 Dec 2014 04:44:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=8h+sW9vIKjyts0HPRQxIiBHjepA28KnkDf3KodJaPfI=; b=QHVxSe1GxmDIDiGwArIRyefTchsXt3rrZNxJvDxPW6FrOKvInjncmEren8eo4YNHFS MDvb6WJBESZtjL4ZVYvBu4ziKvOTWVMxmPuEOS/edLRJbGqlEk8Wjcf8zUtpyNKqQhm0 4ovbKmmRm8o2qJqzEN7pyLt2qWzL387dPzsfw= 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:in-reply-to :references; bh=8h+sW9vIKjyts0HPRQxIiBHjepA28KnkDf3KodJaPfI=; b=QSHdlXqDy3grqXODy/oTTJx2VDKKFLWcup8B0gRbmogcITkMP5nfFYkiH8avM9fVJb fSLHj+S59s/PpofAesOMMmeodt03cE7lmWY8yhAbuiUOcKXcDp0+U2k4CvSzOJjGQ4RS 7AAvp/cCScZOAWIGh5X24s9tzNJpbaDMcg8R/nkyzkbFwoDDYlHTts8m+U9Jl43Uk4is keoVI9KGyqL08Rr5wI5EncVbru0fdyU+D9Fsu3kJZOxMhs2zwRdyWIsGAwn0mdAtMElw kiRNoqNij7rFptOahh35uZMVG8h1v3qsPzwnf6uwHwtguqOuDHvrARPMSrJc51S3snUX 2/1g== X-Gm-Message-State: ALoCoQm5fAGCfNuNr9UUeAjsm7myLq+QPiHZam7wDbrDsePT/+CLvECCG+i9WwWol5JXLbAMA9sHJzdFLK7AOete79ZN4kgPpWJrXkqnB+/yrg5DT3WSorFYV6q1ezvUe4gV3el2YUe2 X-Received: by 10.194.121.167 with SMTP id ll7mr6345110wjb.26.1418215464212; Wed, 10 Dec 2014 04:44:24 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id b10sm6203642wiw.9.2014.12.10.04.44.23 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Dec 2014 04:44:23 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH 5/5] ath10k: advertise p2p dev support Date: Wed, 10 Dec 2014 13:31:54 +0100 Message-Id: <1418214714-29689-6-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> References: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> 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 Firmware doesn't allow precise tx rate control so P2P wasn't entirely spec compliant (it was using CCK rates in some cases). The only way to make sure firmware doesn't use CCK rates is to have a vdev with P2P subtype used for scanning and tx. This can be done via a special dedicated P2P device interface support. This also removes the ancient hack from ath10k in favor of p2pdev. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.c | 6 ------ drivers/net/wireless/ath/ath10k/mac.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 577a3d7..c83f1e7 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -32,17 +32,14 @@ unsigned int ath10k_debug_mask; static bool uart_print; -static unsigned int ath10k_p2p; static bool skip_otp; module_param_named(debug_mask, ath10k_debug_mask, uint, 0644); module_param(uart_print, bool, 0644); -module_param_named(p2p, ath10k_p2p, uint, 0644); module_param(skip_otp, bool, 0644); MODULE_PARM_DESC(debug_mask, "Debugging mask"); MODULE_PARM_DESC(uart_print, "Uart target debugging"); -MODULE_PARM_DESC(p2p, "Enable ath10k P2P support"); MODULE_PARM_DESC(skip_otp, "Skip otp failure for calibration in testmode"); static const struct ath10k_hw_params ath10k_hw_params_list[] = { @@ -1290,10 +1287,7 @@ struct ath10k *ath10k_core_create(size_t priv_size, struct device *dev, ar->ath_common.priv = ar; ar->ath_common.hw = ar->hw; - - ar->p2p = !!ath10k_p2p; ar->dev = dev; - ar->hif.ops = hif_ops; ar->hif.bus = bus; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index e84397d..22d2046 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -2935,10 +2935,11 @@ static int ath10k_add_interface(struct ieee80211_hw *hw, arvif->vdev_id = bit; arvif->vdev_subtype = WMI_VDEV_SUBTYPE_NONE; - if (ar->p2p) - arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE; - switch (vif->type) { + case NL80211_IFTYPE_P2P_DEVICE: + arvif->vdev_type = WMI_VDEV_TYPE_STA; + arvif->vdev_subtype = WMI_VDEV_SUBTYPE_P2P_DEVICE; + break; case NL80211_IFTYPE_UNSPECIFIED: case NL80211_IFTYPE_STATION: arvif->vdev_type = WMI_VDEV_TYPE_STA; @@ -4830,6 +4831,10 @@ static const struct ieee80211_iface_limit ath10k_if_limits[] = { .types = BIT(NL80211_IFTYPE_P2P_GO) }, { + .max = 1, + .types = BIT(NL80211_IFTYPE_P2P_DEVICE) + }, + { .max = 7, .types = BIT(NL80211_IFTYPE_AP) }, @@ -5049,6 +5054,7 @@ int ath10k_mac_register(struct ath10k *ar) if (!test_bit(ATH10K_FW_FEATURE_NO_P2P, ar->fw_features)) ar->hw->wiphy->interface_modes |= + BIT(NL80211_IFTYPE_P2P_DEVICE) | BIT(NL80211_IFTYPE_P2P_CLIENT) | BIT(NL80211_IFTYPE_P2P_GO);