diff options
author | Roee Zamir <roee.zamir@intel.com> | 2016-08-02 06:55:13 -0400 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2016-09-19 04:29:28 -0400 |
commit | b3bee580b1e200e4fc14091e3e118ae8280dc06c (patch) | |
tree | f60fd745403e395d9d5689c46e84c6e89e50b87c /drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |
parent | 5a41a86c525a53d31a229dd358f70d6b4b5a7bbc (diff) |
iwlwifi: mvm: Add debugfs function for clocks diff
New function, reveals the diff between gp2 and host time.
Signed-off-by: Roee Zamir <roee.zamir@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/mvm/utils.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/mvm/utils.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c index 7c138fedcb19..9e366e28c983 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/utils.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/utils.c | |||
@@ -1225,6 +1225,28 @@ void iwl_mvm_inactivity_check(struct iwl_mvm *mvm) | |||
1225 | rcu_read_unlock(); | 1225 | rcu_read_unlock(); |
1226 | } | 1226 | } |
1227 | 1227 | ||
1228 | void iwl_mvm_get_sync_time(struct iwl_mvm *mvm, u32 *gp2, u64 *boottime) | ||
1229 | { | ||
1230 | bool ps_disabled; | ||
1231 | |||
1232 | lockdep_assert_held(&mvm->mutex); | ||
1233 | |||
1234 | /* Disable power save when reading GP2 */ | ||
1235 | ps_disabled = mvm->ps_disabled; | ||
1236 | if (!ps_disabled) { | ||
1237 | mvm->ps_disabled = true; | ||
1238 | iwl_mvm_power_update_device(mvm); | ||
1239 | } | ||
1240 | |||
1241 | *gp2 = iwl_read_prph(mvm->trans, DEVICE_SYSTEM_TIME_REG); | ||
1242 | *boottime = ktime_get_boot_ns(); | ||
1243 | |||
1244 | if (!ps_disabled) { | ||
1245 | mvm->ps_disabled = ps_disabled; | ||
1246 | iwl_mvm_power_update_device(mvm); | ||
1247 | } | ||
1248 | } | ||
1249 | |||
1228 | int iwl_mvm_send_lqm_cmd(struct ieee80211_vif *vif, | 1250 | int iwl_mvm_send_lqm_cmd(struct ieee80211_vif *vif, |
1229 | enum iwl_lqm_cmd_operatrions operation, | 1251 | enum iwl_lqm_cmd_operatrions operation, |
1230 | u32 duration, u32 timeout) | 1252 | u32 duration, u32 timeout) |