Merge tag 'powerpc-4.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc...
[cascardo/linux.git] / drivers / net / wireless / intel / iwlwifi / mvm / utils.c
index 7c138fe..d04babd 100644 (file)
@@ -512,7 +512,7 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
                        base = mvm->fw->inst_errlog_ptr;
        }
 
-       if (base < 0x800000) {
+       if (base < 0x400000) {
                IWL_ERR(mvm,
                        "Not valid error log pointer 0x%08X for %s uCode\n",
                        base,
@@ -1225,6 +1225,28 @@ void iwl_mvm_inactivity_check(struct iwl_mvm *mvm)
        rcu_read_unlock();
 }
 
+void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, u32 *gp2, u64 *boottime)
+{
+       bool ps_disabled;
+
+       lockdep_assert_held(&mvm->mutex);
+
+       /* Disable power save when reading GP2 */
+       ps_disabled = mvm->ps_disabled;
+       if (!ps_disabled) {
+               mvm->ps_disabled = true;
+               iwl_mvm_power_update_device(mvm);
+       }
+
+       *gp2 = iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG);
+       *boottime = ktime_get_boot_ns();
+
+       if (!ps_disabled) {
+               mvm->ps_disabled = ps_disabled;
+               iwl_mvm_power_update_device(mvm);
+       }
+}
+
 int iwl_mvm_send_lqm_cmd(struct ieee80211_vif *vif,
                         enum iwl_lqm_cmd_operatrions operation,
                         u32 duration, u32 timeout)