54 static void iwl1000_set_ct_threshold(
struct iwl_priv *
priv)
79 return (1 << tsf_bits) - 1;
87 static inline u32 iwl_beacon_time_mask_high(
struct iwl_priv *priv,
90 return ((1 << (32 - tsf_bits)) - 1) << tsf_bits;
106 if (!interval || !usec)
112 rem = (usec %
interval) & iwl_beacon_time_mask_low(priv,
122 u32 addon,
u32 beacon_interval)
124 u32 base_low = base & iwl_beacon_time_mask_low(priv,
126 u32 addon_low = addon & iwl_beacon_time_mask_low(priv,
129 u32 res = (base & iwl_beacon_time_mask_high(priv,
131 (addon & iwl_beacon_time_mask_high(priv,
134 if (base_low > addon_low)
135 res += base_low - addon_low;
136 else if (base_low < addon_low) {
137 res += interval + base_low - addon_low;
147 .auto_corr_min_ofdm = 90,
148 .auto_corr_min_ofdm_mrc = 170,
149 .auto_corr_min_ofdm_x1 = 120,
150 .auto_corr_min_ofdm_mrc_x1 = 240,
152 .auto_corr_max_ofdm = 120,
153 .auto_corr_max_ofdm_mrc = 210,
154 .auto_corr_max_ofdm_x1 = 155,
155 .auto_corr_max_ofdm_mrc_x1 = 290,
157 .auto_corr_min_cck = 125,
158 .auto_corr_max_cck = 200,
159 .auto_corr_min_cck_mrc = 170,
160 .auto_corr_max_cck_mrc = 400,
164 .barker_corr_th_min = 190,
165 .barker_corr_th_min_mrc = 390,
169 static void iwl1000_hw_set_hw_params(
struct iwl_priv *priv)
171 iwl1000_set_ct_threshold(priv);
174 priv->
hw_params.sens = &iwl1000_sensitivity;
178 .set_hw_params = iwl1000_hw_set_hw_params,
179 .nic_config = iwl1000_nic_config,
189 static void iwl2000_set_ct_threshold(
struct iwl_priv *priv)
197 static void iwl2000_nic_config(
struct iwl_priv *priv)
205 .auto_corr_min_ofdm = 80,
206 .auto_corr_min_ofdm_mrc = 128,
207 .auto_corr_min_ofdm_x1 = 105,
208 .auto_corr_min_ofdm_mrc_x1 = 192,
210 .auto_corr_max_ofdm = 145,
211 .auto_corr_max_ofdm_mrc = 232,
212 .auto_corr_max_ofdm_x1 = 110,
213 .auto_corr_max_ofdm_mrc_x1 = 232,
215 .auto_corr_min_cck = 125,
216 .auto_corr_max_cck = 175,
217 .auto_corr_min_cck_mrc = 160,
218 .auto_corr_max_cck_mrc = 310,
222 .barker_corr_th_min = 190,
223 .barker_corr_th_min_mrc = 390,
227 static void iwl2000_hw_set_hw_params(
struct iwl_priv *priv)
229 iwl2000_set_ct_threshold(priv);
232 priv->
hw_params.sens = &iwl2000_sensitivity;
236 .set_hw_params = iwl2000_hw_set_hw_params,
237 .nic_config = iwl2000_nic_config,
242 .set_hw_params = iwl2000_hw_set_hw_params,
243 .nic_config = iwl2000_nic_config,
255 .auto_corr_min_ofdm = 90,
256 .auto_corr_min_ofdm_mrc = 170,
257 .auto_corr_min_ofdm_x1 = 105,
258 .auto_corr_min_ofdm_mrc_x1 = 220,
260 .auto_corr_max_ofdm = 120,
261 .auto_corr_max_ofdm_mrc = 210,
262 .auto_corr_max_ofdm_x1 = 120,
263 .auto_corr_max_ofdm_mrc_x1 = 240,
265 .auto_corr_min_cck = 125,
266 .auto_corr_max_cck = 200,
267 .auto_corr_min_cck_mrc = 200,
268 .auto_corr_max_cck_mrc = 400,
272 .barker_corr_th_min = 190,
273 .barker_corr_th_min_mrc = 390,
279 .auto_corr_min_ofdm = 90,
280 .auto_corr_min_ofdm_mrc = 170,
281 .auto_corr_min_ofdm_x1 = 105,
282 .auto_corr_min_ofdm_mrc_x1 = 220,
284 .auto_corr_max_ofdm = 120,
285 .auto_corr_max_ofdm_mrc = 210,
287 .auto_corr_max_ofdm_x1 = 105,
288 .auto_corr_max_ofdm_mrc_x1 = 220,
290 .auto_corr_min_cck = 125,
291 .auto_corr_max_cck = 200,
292 .auto_corr_min_cck_mrc = 170,
293 .auto_corr_max_cck_mrc = 400,
297 .barker_corr_th_min = 190,
298 .barker_corr_th_min_mrc = 390,
302 #define IWL_5150_VOLTAGE_TO_TEMPERATURE_COEFF (-5)
304 static s32 iwl_temp_calib_to_offset(
struct iwl_priv *priv)
312 return (
s32)(temperature -
316 static void iwl5150_set_ct_threshold(
struct iwl_priv *priv)
320 iwl_temp_calib_to_offset(priv);
322 priv->
hw_params.ct_kill_threshold = threshold * volt2temp_coef;
325 static void iwl5000_set_ct_threshold(
struct iwl_priv *priv)
331 static void iwl5000_hw_set_hw_params(
struct iwl_priv *priv)
333 iwl5000_set_ct_threshold(priv);
336 priv->
hw_params.sens = &iwl5000_sensitivity;
339 static void iwl5150_hw_set_hw_params(
struct iwl_priv *priv)
341 iwl5150_set_ct_threshold(priv);
344 priv->
hw_params.sens = &iwl5150_sensitivity;
347 static void iwl5150_temperature(
struct iwl_priv *priv)
350 s32 offset = iwl_temp_calib_to_offset(priv);
359 static int iwl5000_hw_channel_switch(
struct iwl_priv *priv,
368 u32 switch_time_in_usec, ucode_switch_time;
376 .len = {
sizeof(
cmd), },
382 ch = ch_switch->
channel->hw_value;
387 cmd.rxon_filter_flags = ctx->
staging.filter_flags;
388 switch_count = ch_switch->
count;
389 tsf_low = ch_switch->
timestamp & 0x0ffffffff;
398 tsf_low) / beacon_interval;
402 if (switch_count <= 1)
405 switch_time_in_usec =
407 ucode_switch_time = iwl_usecs_to_beacons(priv,
410 cmd.switch_time = iwl_add_beacon_time(priv,
423 .set_hw_params = iwl5000_hw_set_hw_params,
424 .set_channel_switch = iwl5000_hw_channel_switch,
429 .set_hw_params = iwl5150_hw_set_hw_params,
430 .set_channel_switch = iwl5000_hw_channel_switch,
431 .temperature = iwl5150_temperature,
441 static void iwl6000_set_ct_threshold(
struct iwl_priv *priv)
449 static void iwl6000_nic_config(
struct iwl_priv *priv)
451 switch (priv->
cfg->device_family) {
482 .auto_corr_min_ofdm = 80,
483 .auto_corr_min_ofdm_mrc = 128,
484 .auto_corr_min_ofdm_x1 = 105,
485 .auto_corr_min_ofdm_mrc_x1 = 192,
487 .auto_corr_max_ofdm = 145,
488 .auto_corr_max_ofdm_mrc = 232,
489 .auto_corr_max_ofdm_x1 = 110,
490 .auto_corr_max_ofdm_mrc_x1 = 232,
492 .auto_corr_min_cck = 125,
493 .auto_corr_max_cck = 175,
494 .auto_corr_min_cck_mrc = 160,
495 .auto_corr_max_cck_mrc = 310,
499 .barker_corr_th_min = 190,
500 .barker_corr_th_min_mrc = 336,
504 static void iwl6000_hw_set_hw_params(
struct iwl_priv *priv)
506 iwl6000_set_ct_threshold(priv);
509 priv->
hw_params.sens = &iwl6000_sensitivity;
513 static int iwl6000_hw_channel_switch(
struct iwl_priv *priv,
522 u32 switch_time_in_usec, ucode_switch_time;
530 .len = {
sizeof(*cmd), },
543 ch = ch_switch->
channel->hw_value;
549 switch_count = ch_switch->
count;
550 tsf_low = ch_switch->
timestamp & 0x0ffffffff;
559 tsf_low) / beacon_interval;
563 if (switch_count <= 1)
566 switch_time_in_usec =
568 ucode_switch_time = iwl_usecs_to_beacons(priv,
586 .set_hw_params = iwl6000_hw_set_hw_params,
587 .set_channel_switch = iwl6000_hw_channel_switch,
588 .nic_config = iwl6000_nic_config,
593 .set_hw_params = iwl6000_hw_set_hw_params,
594 .set_channel_switch = iwl6000_hw_channel_switch,
595 .nic_config = iwl6000_nic_config,