iwlwifi: mvm: allow both d0i3 and d3 wowlan configuration modes
authorEliad Peller <eliad@wizery.com>
Tue, 9 Dec 2014 13:54:46 +0000 (15:54 +0200)
committerEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Sun, 28 Dec 2014 18:00:19 +0000 (20:00 +0200)
d3 and d0i3 shouldn't be mutually exclusive. Set supported
wowlan triggers by looking for each of them, and check
on suspend/resume which flow should be used ("any" trigger
is supported by d0i3, and all the others by d3)

Signed-off-by: Eliad Peller <eliadx.peller@intel.com>
Reviewed-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
drivers/net/wireless/iwlwifi/mvm/d3.c
drivers/net/wireless/iwlwifi/mvm/mac80211.c

index 744de262373ea38acc55dc32e1f5d1f6181be154..a64894c40e8f5391c95d88da16f998475eaa86a9 100644 (file)
@@ -1142,7 +1142,8 @@ int iwl_mvm_suspend(struct ieee80211_hw *hw, struct cfg80211_wowlan *wowlan)
        struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
 
        iwl_trans_suspend(mvm->trans);
-       if (iwl_mvm_is_d0i3_supported(mvm)) {
+       if (wowlan->any) {
+               /* 'any' trigger means d0i3 usage */
                mutex_lock(&mvm->d0i3_suspend_mutex);
                __set_bit(D0I3_DEFER_WAKEUP, &mvm->d0i3_suspend_flags);
                mutex_unlock(&mvm->d0i3_suspend_mutex);
@@ -1876,8 +1877,10 @@ int iwl_mvm_resume(struct ieee80211_hw *hw)
 
        iwl_trans_resume(mvm->trans);
 
-       if (iwl_mvm_is_d0i3_supported(mvm))
+       if (mvm->hw->wiphy->wowlan_config->any) {
+               /* 'any' trigger means d0i3 usage */
                return 0;
+       }
 
        return __iwl_mvm_resume(mvm, false);
 }
index b2f4ea59747321935d6b78e33e3c6371a275107a..fd0f8ce0f79da5789354a7102691db53a0ec5a96 100644 (file)
@@ -462,15 +462,17 @@ int iwl_mvm_mac_setup_register(struct iwl_mvm *mvm)
            device_can_wakeup(mvm->trans->dev)) {
                mvm->wowlan.flags = WIPHY_WOWLAN_ANY;
                hw->wiphy->wowlan = &mvm->wowlan;
-       } else if (mvm->fw->img[IWL_UCODE_WOWLAN].sec[0].len &&
+       }
+
+       if (mvm->fw->img[IWL_UCODE_WOWLAN].sec[0].len &&
            mvm->trans->ops->d3_suspend &&
            mvm->trans->ops->d3_resume &&
            device_can_wakeup(mvm->trans->dev)) {
-               mvm->wowlan.flags = WIPHY_WOWLAN_MAGIC_PKT |
-                                   WIPHY_WOWLAN_DISCONNECT |
-                                   WIPHY_WOWLAN_EAP_IDENTITY_REQ |
-                                   WIPHY_WOWLAN_RFKILL_RELEASE |
-                                   WIPHY_WOWLAN_NET_DETECT;
+               mvm->wowlan.flags |= WIPHY_WOWLAN_MAGIC_PKT |
+                                    WIPHY_WOWLAN_DISCONNECT |
+                                    WIPHY_WOWLAN_EAP_IDENTITY_REQ |
+                                    WIPHY_WOWLAN_RFKILL_RELEASE |
+                                    WIPHY_WOWLAN_NET_DETECT;
                if (!iwlwifi_mod_params.sw_crypto)
                        mvm->wowlan.flags |= WIPHY_WOWLAN_SUPPORTS_GTK_REKEY |
                                             WIPHY_WOWLAN_GTK_REKEY_FAILURE |