iwlwifi: mvm: disable power on P2P client when BSS is added
authorAvri Altman <avri.altman@intel.com>
Thu, 20 Feb 2014 11:28:57 +0000 (13:28 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 9 Mar 2014 14:39:08 +0000 (16:39 +0200)
When power update is initiated on BSS STA while P2P client
exists, the power command will be sent only on BSS STA vif
ignoring P2P client.

Since the firmware has symmetric constraints on the power
save enablement we can simplify the code a bit.

The current firmware doesn't know how to enable power
management on P2P client. Even BSS power management must
be disabled when a P2P client is added.

Future firmware will support power save on BSS and P2P client
as long as they are on different channels.
This was buggy since we didn't disable power management on
P2P client interface if BSS added on the same channel.

Signed-off-by: Avri Altman <avri.altman@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/power.c

index def6ec5173b9d8bbabe5e5e4e3a681b41af96f31..6b636eab33391cbec4957180efe2e74d2ad07388 100644 (file)
@@ -511,6 +511,7 @@ int iwl_mvm_power_uapsd_misbehaving_ap_notif(struct iwl_mvm *mvm,
 struct iwl_power_constraint {
        struct ieee80211_vif *bf_vif;
        struct ieee80211_vif *bss_vif;
+       struct ieee80211_vif *p2p_vif;
        u16 bss_phyctx_id;
        u16 p2p_phyctx_id;
        bool pm_disabled;
@@ -546,6 +547,10 @@ static void iwl_mvm_power_iterator(void *_data, u8 *mac,
                if (mvmvif->phy_ctxt)
                        power_iterator->p2p_phyctx_id = mvmvif->phy_ctxt->id;
 
+               /* we should have only one P2P vif */
+               WARN_ON(power_iterator->p2p_vif);
+               power_iterator->p2p_vif = vif;
+
                IWL_DEBUG_POWER(mvm, "p2p: p2p_id=%d, bss_id=%d\n",
                                power_iterator->p2p_phyctx_id,
                                power_iterator->bss_phyctx_id);
@@ -633,16 +638,18 @@ int iwl_mvm_power_update_mac(struct iwl_mvm *mvm, struct ieee80211_vif *vif)
                        return ret;
        }
 
-       ret = iwl_mvm_power_send_cmd(mvm, vif);
-       if (ret)
-               return ret;
-
-       if (constraint.bss_vif && vif != constraint.bss_vif) {
+       if (constraint.bss_vif) {
                ret = iwl_mvm_power_send_cmd(mvm, constraint.bss_vif);
                if (ret)
                        return ret;
        }
 
+       if (constraint.p2p_vif) {
+               ret = iwl_mvm_power_send_cmd(mvm, constraint.p2p_vif);
+               if (ret)
+                       return ret;
+       }
+
        if (!constraint.bf_vif)
                return 0;