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: 5468761 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BA548BEEA8 for ; Wed, 10 Dec 2014 12:45:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E42F12010C for ; Wed, 10 Dec 2014 12:45:20 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0E28B2010B for ; Wed, 10 Dec 2014 12:45:20 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XygdO-00082U-L9; Wed, 10 Dec 2014 12:44:50 +0000 Received: from mail-wg0-x233.google.com ([2a00:1450:400c:c00::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XygdK-0007wi-1J for ath10k@lists.infradead.org; Wed, 10 Dec 2014 12:44:46 +0000 Received: by mail-wg0-f51.google.com with SMTP id x12so3453287wgg.38 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=MfwL6dIP3nE/u9qFtsLSs+WjznumzYu/1KX3Y6gzMpa+nGYGzbQhAr/aiUGaI/uIhX jjEe+mDnMZYLUmvz7hoHa+Qi8kVO1G+mv13ftzFfDkrAJ+Q64zJM5tHyj8ESCLcn1ZKw oudsDTBCmqcXNAU4I127TF+s+/mTYdalzTEcTutw01udoopTSfjz7tBdR69bCCaj/53k PpXaa+7ozjZ/Nhw7sHf9maMT2pqQfFehkNDzGYjULBW3PHaXQlx2ogaAFzUQWyvKUJeK oWDDBN2oemEoBGnGQoUBMBWN8IolkpqX8H5JcDmAIrEfothiSK2NBeuLMv0YlnCZpR/a HzjQ== X-Gm-Message-State: ALoCoQklIBytTqeuD9FuENo9Rj0wgDYAq9steEvcSuerbwky0ZR1J/am7WIg48WTlqFm16Xi4nxfgB3lUtlQQOcFZn3JP1SpFtkFDfAsN2rR9I5sy3vcNX/eoV0z7upKDkFp13slNwACjP1/TY22Panl32mhUsw7q3oCnzS0j+2Yr8OqvZs/XDE= 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141210_044446_244162_B3147E7D X-CRM114-Status: GOOD ( 10.15 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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);