From patchwork Thu Mar 21 14:47:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 2313941 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id A24B540213 for ; Thu, 21 Mar 2013 14:48:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933586Ab3CUOsX (ORCPT ); Thu, 21 Mar 2013 10:48:23 -0400 Received: from mail-ea0-f175.google.com ([209.85.215.175]:34879 "EHLO mail-ea0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932865Ab3CUOsW (ORCPT ); Thu, 21 Mar 2013 10:48:22 -0400 Received: by mail-ea0-f175.google.com with SMTP id o10so911944eaj.34 for ; Thu, 21 Mar 2013 07:48:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=o89AEID3ZWGhAo6gOJlU0VfkaFE188HCGGnwKH+chis=; b=keK1BdbT1z3iBy/HlQrzFjkdBBN8bnyMT0z/UIztu2S5O7G7pFc1AYQspe0m6AfobB zFteUz/e9alB34H6zimahf9NJ/wEdAXKEDyscroA0E/+NM3ftvkcHQG9yVGdkNpFBklx KpwxNPrSnr5XadE5fvxRRjt4v7ugk6tyF0uoPqLm90iVlWV+crfx2ropjKNn62FAPE5c 8Iic7i66+m5BIe7JJhcDdKmF7GtQo9R5ZAnKYDvjjF/2Fa+zQ9rjVWau+NrWAhWqCWtP ICApwkHjtX48pK3ndjWA3xda4vPztqS2bQdtkhqxQuExq/qi+M14sLs5oO3TnKI6QEQc KV3A== X-Received: by 10.14.0.73 with SMTP id 49mr83551505eea.21.1363877301117; Thu, 21 Mar 2013 07:48:21 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPS id r4sm8843548eeo.12.2013.03.21.07.48.18 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 21 Mar 2013 07:48:20 -0700 (PDT) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Janusz Dziedzic , Janusz Dziedzic Subject: [PATCH v2 4/4] iwlwifi: mvm: use ieee80211_noa_attr Date: Thu, 21 Mar 2013 15:47:57 +0100 Message-Id: <1363877277-5108-4-git-send-email-janusz.dziedzic@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1363877277-5108-1-git-send-email-janusz.dziedzic@gmail.com> References: <1363877277-5108-1-git-send-email-janusz.dziedzic@gmail.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Use ieee80211_noa_attr structure while handling P2P PS. Signed-off-by: Janusz Dziedzic --- drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c index 2779235..1f884b6 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac-ctxt.c @@ -669,6 +669,7 @@ static int iwl_mvm_mac_ctxt_cmd_p2p_client(struct iwl_mvm *mvm, u32 action) { struct iwl_mac_ctx_cmd cmd = {}; + struct ieee80211_p2p_noa_attr *noa = &vif->bss_conf.p2p_noa_attr; WARN_ON(vif->type != NL80211_IFTYPE_STATION || !vif->p2p); @@ -678,7 +679,8 @@ static int iwl_mvm_mac_ctxt_cmd_p2p_client(struct iwl_mvm *mvm, /* Fill the data specific for station mode */ iwl_mvm_mac_ctxt_cmd_fill_sta(mvm, vif, &cmd.p2p_sta.sta); - cmd.p2p_sta.ctwin = cpu_to_le32(vif->bss_conf.p2p_ctwindow); + cmd.p2p_sta.ctwin = cpu_to_le32(noa->oppps_ctwindow & + IEEE80211_P2P_OPPPS_CTWINDOW_MASK); return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); } @@ -914,6 +916,7 @@ static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm, u32 action) { struct iwl_mac_ctx_cmd cmd = {}; + struct ieee80211_p2p_noa_attr *noa = &vif->bss_conf.p2p_noa_attr; WARN_ON(vif->type != NL80211_IFTYPE_AP || !vif->p2p); @@ -924,8 +927,11 @@ static int iwl_mvm_mac_ctxt_cmd_go(struct iwl_mvm *mvm, iwl_mvm_mac_ctxt_cmd_fill_ap(mvm, vif, &cmd.go.ap, action == FW_CTXT_ACTION_ADD); - cmd.go.ctwin = cpu_to_le32(vif->bss_conf.p2p_ctwindow); - cmd.go.opp_ps_enabled = cpu_to_le32(!!vif->bss_conf.p2p_oppps); + cmd.go.ctwin = cpu_to_le32(noa->oppps_ctwindow & + IEEE80211_P2P_OPPPS_CTWINDOW_MASK); + cmd.go.opp_ps_enabled = + cpu_to_le32(!!(noa->oppps_ctwindow & + IEEE80211_P2P_OPPPS_ENABLE_BIT)); return iwl_mvm_mac_ctxt_send_cmd(mvm, &cmd); }