Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac802...
[deliverable/linux.git] / drivers / net / wireless / iwlwifi / mvm / mac-ctxt.c
index 86e312a4f6291d53c1bb366ed13e7d2e1a73381d..e6eca4d66f6c8bf2b0b9ada40a6ca9fe9ab83ce4 100644 (file)
@@ -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);
 }
@@ -919,6 +921,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);
 
@@ -929,8 +932,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);
 }
This page took 0.026391 seconds and 5 git commands to generate.