]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
iwlwifi: move channel switch related functions
authorMeenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Tue, 13 Mar 2012 22:18:07 +0000 (15:18 -0700)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Thu, 12 Apr 2012 21:18:37 +0000 (14:18 -0700)
With the creation of iwl-agn-devices.c,
iwl-core.c can be cleaned up a bit more by
moving beacon time related functions from
iwl-core.c to iwl-agn-devices.c

Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn-devices.c
drivers/net/wireless/iwlwifi/iwl-core.c
drivers/net/wireless/iwlwifi/iwl-core.h

index bc9cb5c0ec6ccb8c9b0403c35d2dfe03fb12a5f7..08718caf4aa9176df4ad90d3edc380979cd263c8 100644 (file)
@@ -71,6 +71,80 @@ static void iwl1000_nic_config(struct iwl_priv *priv)
                                ~APMG_SVR_VOLTAGE_CONFIG_BIT_MSK);
 }
 
+/**
+ * iwl_beacon_time_mask_low - mask of lower 32 bit of beacon time
+ * @priv -- pointer to iwl_priv data structure
+ * @tsf_bits -- number of bits need to shift for masking)
+ */
+static inline u32 iwl_beacon_time_mask_low(struct iwl_priv *priv,
+                                          u16 tsf_bits)
+{
+       return (1 << tsf_bits) - 1;
+}
+
+/**
+ * iwl_beacon_time_mask_high - mask of higher 32 bit of beacon time
+ * @priv -- pointer to iwl_priv data structure
+ * @tsf_bits -- number of bits need to shift for masking)
+ */
+static inline u32 iwl_beacon_time_mask_high(struct iwl_priv *priv,
+                                           u16 tsf_bits)
+{
+       return ((1 << (32 - tsf_bits)) - 1) << tsf_bits;
+}
+
+/*
+ * extended beacon time format
+ * time in usec will be changed into a 32-bit value in extended:internal format
+ * the extended part is the beacon counts
+ * the internal part is the time in usec within one beacon interval
+ */
+static u32 iwl_usecs_to_beacons(struct iwl_priv *priv, u32 usec,
+                               u32 beacon_interval)
+{
+       u32 quot;
+       u32 rem;
+       u32 interval = beacon_interval * TIME_UNIT;
+
+       if (!interval || !usec)
+               return 0;
+
+       quot = (usec / interval) &
+               (iwl_beacon_time_mask_high(priv, IWLAGN_EXT_BEACON_TIME_POS) >>
+               IWLAGN_EXT_BEACON_TIME_POS);
+       rem = (usec % interval) & iwl_beacon_time_mask_low(priv,
+                                  IWLAGN_EXT_BEACON_TIME_POS);
+
+       return (quot << IWLAGN_EXT_BEACON_TIME_POS) + rem;
+}
+
+/* base is usually what we get from ucode with each received frame,
+ * the same as HW timer counter counting down
+ */
+static __le32 iwl_add_beacon_time(struct iwl_priv *priv, u32 base,
+                          u32 addon, u32 beacon_interval)
+{
+       u32 base_low = base & iwl_beacon_time_mask_low(priv,
+                               IWLAGN_EXT_BEACON_TIME_POS);
+       u32 addon_low = addon & iwl_beacon_time_mask_low(priv,
+                               IWLAGN_EXT_BEACON_TIME_POS);
+       u32 interval = beacon_interval * TIME_UNIT;
+       u32 res = (base & iwl_beacon_time_mask_high(priv,
+                               IWLAGN_EXT_BEACON_TIME_POS)) +
+                               (addon & iwl_beacon_time_mask_high(priv,
+                               IWLAGN_EXT_BEACON_TIME_POS));
+
+       if (base_low > addon_low)
+               res += base_low - addon_low;
+       else if (base_low < addon_low) {
+               res += interval + base_low - addon_low;
+               res += (1 << IWLAGN_EXT_BEACON_TIME_POS);
+       } else
+               res += (1 << IWLAGN_EXT_BEACON_TIME_POS);
+
+       return cpu_to_le32(res);
+}
+
 static const struct iwl_sensitivity_ranges iwl1000_sensitivity = {
        .min_nrg_cck = 95,
        .auto_corr_min_ofdm = 90,
index 0f86f1c323aac134e79d9d3f69457cabfc6cd4ea..0fde81d72a61b6beed7ec4ace652cf067d392508 100644 (file)
@@ -783,79 +783,6 @@ int iwl_cmd_echo_test(struct iwl_priv *priv)
        return ret;
 }
 
-/**
- * iwl_beacon_time_mask_low - mask of lower 32 bit of beacon time
- * @priv -- pointer to iwl_priv data structure
- * @tsf_bits -- number of bits need to shift for masking)
- */
-static inline u32 iwl_beacon_time_mask_low(struct iwl_priv *priv,
-                                          u16 tsf_bits)
-{
-       return (1 << tsf_bits) - 1;
-}
-
-/**
- * iwl_beacon_time_mask_high - mask of higher 32 bit of beacon time
- * @priv -- pointer to iwl_priv data structure
- * @tsf_bits -- number of bits need to shift for masking)
- */
-static inline u32 iwl_beacon_time_mask_high(struct iwl_priv *priv,
-                                           u16 tsf_bits)
-{
-       return ((1 << (32 - tsf_bits)) - 1) << tsf_bits;
-}
-
-/*
- * extended beacon time format
- * time in usec will be changed into a 32-bit value in extended:internal format
- * the extended part is the beacon counts
- * the internal part is the time in usec within one beacon interval
- */
-u32 iwl_usecs_to_beacons(struct iwl_priv *priv, u32 usec, u32 beacon_interval)
-{
-       u32 quot;
-       u32 rem;
-       u32 interval = beacon_interval * TIME_UNIT;
-
-       if (!interval || !usec)
-               return 0;
-
-       quot = (usec / interval) &
-               (iwl_beacon_time_mask_high(priv, IWLAGN_EXT_BEACON_TIME_POS) >>
-               IWLAGN_EXT_BEACON_TIME_POS);
-       rem = (usec % interval) & iwl_beacon_time_mask_low(priv,
-                                  IWLAGN_EXT_BEACON_TIME_POS);
-
-       return (quot << IWLAGN_EXT_BEACON_TIME_POS) + rem;
-}
-
-/* base is usually what we get from ucode with each received frame,
- * the same as HW timer counter counting down
- */
-__le32 iwl_add_beacon_time(struct iwl_priv *priv, u32 base,
-                          u32 addon, u32 beacon_interval)
-{
-       u32 base_low = base & iwl_beacon_time_mask_low(priv,
-                               IWLAGN_EXT_BEACON_TIME_POS);
-       u32 addon_low = addon & iwl_beacon_time_mask_low(priv,
-                               IWLAGN_EXT_BEACON_TIME_POS);
-       u32 interval = beacon_interval * TIME_UNIT;
-       u32 res = (base & iwl_beacon_time_mask_high(priv,
-                               IWLAGN_EXT_BEACON_TIME_POS)) +
-                               (addon & iwl_beacon_time_mask_high(priv,
-                               IWLAGN_EXT_BEACON_TIME_POS));
-
-       if (base_low > addon_low)
-               res += base_low - addon_low;
-       else if (base_low < addon_low) {
-               res += interval + base_low - addon_low;
-               res += (1 << IWLAGN_EXT_BEACON_TIME_POS);
-       } else
-               res += (1 << IWLAGN_EXT_BEACON_TIME_POS);
-
-       return cpu_to_le32(res);
-}
-
 void iwl_set_hw_rfkill_state(struct iwl_op_mode *op_mode, bool state)
 {
        struct iwl_priv *priv = IWL_OP_MODE_GET_DVM(op_mode);
index 96a2f8dee40b41dccef1fdb69323b64e5e3fd4d0..5cbe609de84c6f79fa19c58ffbb816223f307215 100644 (file)
@@ -176,10 +176,6 @@ int __must_check iwl_scan_initiate(struct iwl_priv *priv,
  *   S e n d i n g     H o s t     C o m m a n d s   *
  *****************************************************/
 
-u32 iwl_usecs_to_beacons(struct iwl_priv *priv, u32 usec, u32 beacon_interval);
-__le32 iwl_add_beacon_time(struct iwl_priv *priv, u32 base,
-                          u32 addon, u32 beacon_interval);
-
 extern void iwl_send_bt_config(struct iwl_priv *priv);
 extern int iwl_send_statistics_request(struct iwl_priv *priv,
                                       u8 flags, bool clear);