ath10k: move cycle_count macro
authorMichal Kazior <michal.kazior@tieto.com>
Mon, 25 May 2015 12:06:17 +0000 (14:06 +0200)
committerKalle Valo <kvalo@qca.qualcomm.com>
Fri, 29 May 2015 14:34:19 +0000 (17:34 +0300)
The macro isn't WMI specific. Instead it is
related to hardware chip so move the macro
accordingly. While at it document the magic value.

Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
drivers/net/wireless/ath/ath10k/hw.h
drivers/net/wireless/ath/ath10k/wmi.c
drivers/net/wireless/ath/ath10k/wmi.h

index 89e09cbeac19f4cc64d96002aafd31cc0bc1cc2c..372f0b8c96f52a9ded23df0a6e3d9882ed68c89d 100644 (file)
@@ -449,6 +449,9 @@ enum ath10k_hw_rate_cck {
 #define SCRATCH_3_ADDRESS                      ar->regs->scratch_3_address
 #define CPU_INTR_ADDRESS                       0x0010
 
+/* Cycle counters are running at 88MHz */
+#define CCNT_TO_MSEC(x) ((x) / 88000)
+
 /* Firmware indications to the Host via SCRATCH_3 register. */
 #define FW_INDICATOR_ADDRESS   (SOC_CORE_BASE_ADDRESS + SCRATCH_3_ADDRESS)
 #define FW_IND_EVENT_PENDING                   1
index 0fabe689179c8a8ab3d150bada5f50bc4300a6a2..43caabf5b02548cd8aa22844e0cbd049a48072af 100644 (file)
@@ -1644,8 +1644,8 @@ void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb)
                rx_clear_count -= ar->survey_last_rx_clear_count;
 
                survey = &ar->survey[idx];
-               survey->time = WMI_CHAN_INFO_MSEC(cycle_count);
-               survey->time_busy = WMI_CHAN_INFO_MSEC(rx_clear_count);
+               survey->time = CCNT_TO_MSEC(cycle_count);
+               survey->time_busy = CCNT_TO_MSEC(rx_clear_count);
                survey->noise = noise_floor;
                survey->filled = SURVEY_INFO_TIME |
                                 SURVEY_INFO_TIME_BUSY |
index cad72ae76253362cf0e7f28ba9930a71814d35f4..cf44a3d080a38c7a58b454d7e82419e98f1733a4 100644 (file)
@@ -4665,7 +4665,6 @@ struct wmi_peer_sta_kickout_event {
 } __packed;
 
 #define WMI_CHAN_INFO_FLAG_COMPLETE BIT(0)
-#define WMI_CHAN_INFO_MSEC(x) ((x) / 88000)
 
 /* Beacon filter wmi command info */
 #define BCN_FLT_MAX_SUPPORTED_IES      256