From patchwork Wed Mar 20 19:13:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz Dziedzic X-Patchwork-Id: 2309361 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 48181E016C for ; Wed, 20 Mar 2013 19:14:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933065Ab3CTTN5 (ORCPT ); Wed, 20 Mar 2013 15:13:57 -0400 Received: from mail-ia0-f174.google.com ([209.85.210.174]:58511 "EHLO mail-ia0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753605Ab3CTTN4 (ORCPT ); Wed, 20 Mar 2013 15:13:56 -0400 Received: by mail-ia0-f174.google.com with SMTP id b35so1697464iac.5 for ; Wed, 20 Mar 2013 12:13:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:date:message-id:subject:from:to:cc :content-type; bh=fVmaPTVsdWvmPJk+1b+2iv1uczVDvGE/1Wl5zCvR/QU=; b=GcuoJw2tMDwmMVtoQqwpzRbF7muygZVihpsU2JjJBayv+5bpnWgkSHhYzlQ2yMqlhy GORUMFPyW9//qulk6Z6D8TS+fcbuGpgYQ1K9yaGz4vkhwtIek98OTBRARfMLX0kfp/io wuTvCarEGc5Q3Ur24USn34miwODq0yFNSZlcSY0pFQ2+gTNYcrzmJhRAV9HomkVyJuwG DZ0eMP32w8gO4TxUsezLbWpvrytp9WDhOK1MucbdiKn8MWEgIcydhTo8xZ0DRhix0lTy psu2ii3atfGlw0obaa6pmxyeC6KAeo/th6Gtkumg/BkG4N/eMzJpVZfnhprq3OMBzrO7 d/BQ== MIME-Version: 1.0 X-Received: by 10.50.100.167 with SMTP id ez7mr188353igb.3.1363806836167; Wed, 20 Mar 2013 12:13:56 -0700 (PDT) Received: by 10.42.169.9 with HTTP; Wed, 20 Mar 2013 12:13:56 -0700 (PDT) Date: Wed, 20 Mar 2013 20:13:56 +0100 Message-ID: Subject: [PATCH 4/4] iwlwifi: mvm: use ieee80211_noa_attr From: Janusz Dziedzic To: linux-wireless Cc: Johannes Berg 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(-) @@ -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); } 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);