diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-04-27 17:10:00 -0400 |
---|---|---|
committer | Reinette Chatre <reinette.chatre@intel.com> | 2010-05-10 18:08:49 -0400 |
commit | f401241310f4260505b1c462807c83aac5e5bbc8 (patch) | |
tree | 2969392aa39aaa4de0d31c7226e2930f0809d08a | |
parent | 0af0d04b8db7712498558541cbedeeebdbabf70f (diff) |
iwlwifi: wimax co-exist code clean up
wifi/wimax co-exist command is part of _agn device configuration
sequence; move it to iwl-agn-ucode.c which is more appropriate place for the
function.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | 60 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 59 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 |
3 files changed, 59 insertions, 61 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c index ae476c234a7c..c3e3283426a9 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-ucode.c | |||
@@ -52,6 +52,37 @@ static const s8 iwlagn_default_queue_to_tx_fifo[] = { | |||
52 | IWL_TX_FIFO_UNUSED, | 52 | IWL_TX_FIFO_UNUSED, |
53 | }; | 53 | }; |
54 | 54 | ||
55 | static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = { | ||
56 | {COEX_CU_UNASSOC_IDLE_RP, COEX_CU_UNASSOC_IDLE_WP, | ||
57 | 0, COEX_UNASSOC_IDLE_FLAGS}, | ||
58 | {COEX_CU_UNASSOC_MANUAL_SCAN_RP, COEX_CU_UNASSOC_MANUAL_SCAN_WP, | ||
59 | 0, COEX_UNASSOC_MANUAL_SCAN_FLAGS}, | ||
60 | {COEX_CU_UNASSOC_AUTO_SCAN_RP, COEX_CU_UNASSOC_AUTO_SCAN_WP, | ||
61 | 0, COEX_UNASSOC_AUTO_SCAN_FLAGS}, | ||
62 | {COEX_CU_CALIBRATION_RP, COEX_CU_CALIBRATION_WP, | ||
63 | 0, COEX_CALIBRATION_FLAGS}, | ||
64 | {COEX_CU_PERIODIC_CALIBRATION_RP, COEX_CU_PERIODIC_CALIBRATION_WP, | ||
65 | 0, COEX_PERIODIC_CALIBRATION_FLAGS}, | ||
66 | {COEX_CU_CONNECTION_ESTAB_RP, COEX_CU_CONNECTION_ESTAB_WP, | ||
67 | 0, COEX_CONNECTION_ESTAB_FLAGS}, | ||
68 | {COEX_CU_ASSOCIATED_IDLE_RP, COEX_CU_ASSOCIATED_IDLE_WP, | ||
69 | 0, COEX_ASSOCIATED_IDLE_FLAGS}, | ||
70 | {COEX_CU_ASSOC_MANUAL_SCAN_RP, COEX_CU_ASSOC_MANUAL_SCAN_WP, | ||
71 | 0, COEX_ASSOC_MANUAL_SCAN_FLAGS}, | ||
72 | {COEX_CU_ASSOC_AUTO_SCAN_RP, COEX_CU_ASSOC_AUTO_SCAN_WP, | ||
73 | 0, COEX_ASSOC_AUTO_SCAN_FLAGS}, | ||
74 | {COEX_CU_ASSOC_ACTIVE_LEVEL_RP, COEX_CU_ASSOC_ACTIVE_LEVEL_WP, | ||
75 | 0, COEX_ASSOC_ACTIVE_LEVEL_FLAGS}, | ||
76 | {COEX_CU_RF_ON_RP, COEX_CU_RF_ON_WP, 0, COEX_CU_RF_ON_FLAGS}, | ||
77 | {COEX_CU_RF_OFF_RP, COEX_CU_RF_OFF_WP, 0, COEX_RF_OFF_FLAGS}, | ||
78 | {COEX_CU_STAND_ALONE_DEBUG_RP, COEX_CU_STAND_ALONE_DEBUG_WP, | ||
79 | 0, COEX_STAND_ALONE_DEBUG_FLAGS}, | ||
80 | {COEX_CU_IPAN_ASSOC_LEVEL_RP, COEX_CU_IPAN_ASSOC_LEVEL_WP, | ||
81 | 0, COEX_IPAN_ASSOC_LEVEL_FLAGS}, | ||
82 | {COEX_CU_RSRVD1_RP, COEX_CU_RSRVD1_WP, 0, COEX_RSRVD1_FLAGS}, | ||
83 | {COEX_CU_RSRVD2_RP, COEX_CU_RSRVD2_WP, 0, COEX_RSRVD2_FLAGS} | ||
84 | }; | ||
85 | |||
55 | /* | 86 | /* |
56 | * ucode | 87 | * ucode |
57 | */ | 88 | */ |
@@ -320,6 +351,33 @@ restart: | |||
320 | queue_work(priv->workqueue, &priv->restart); | 351 | queue_work(priv->workqueue, &priv->restart); |
321 | } | 352 | } |
322 | 353 | ||
354 | static int iwlagn_send_wimax_coex(struct iwl_priv *priv) | ||
355 | { | ||
356 | struct iwl_wimax_coex_cmd coex_cmd; | ||
357 | |||
358 | if (priv->cfg->support_wimax_coexist) { | ||
359 | /* UnMask wake up src at associated sleep */ | ||
360 | coex_cmd.flags = COEX_FLAGS_ASSOC_WA_UNMASK_MSK; | ||
361 | |||
362 | /* UnMask wake up src at unassociated sleep */ | ||
363 | coex_cmd.flags |= COEX_FLAGS_UNASSOC_WA_UNMASK_MSK; | ||
364 | memcpy(coex_cmd.sta_prio, cu_priorities, | ||
365 | sizeof(struct iwl_wimax_coex_event_entry) * | ||
366 | COEX_NUM_OF_EVENTS); | ||
367 | |||
368 | /* enabling the coexistence feature */ | ||
369 | coex_cmd.flags |= COEX_FLAGS_COEX_ENABLE_MSK; | ||
370 | |||
371 | /* enabling the priorities tables */ | ||
372 | coex_cmd.flags |= COEX_FLAGS_STA_TABLE_VALID_MSK; | ||
373 | } else { | ||
374 | /* coexistence is disabled */ | ||
375 | memset(&coex_cmd, 0, sizeof(coex_cmd)); | ||
376 | } | ||
377 | return iwl_send_cmd_pdu(priv, COEX_PRIORITY_TABLE_CMD, | ||
378 | sizeof(coex_cmd), &coex_cmd); | ||
379 | } | ||
380 | |||
323 | int iwlagn_alive_notify(struct iwl_priv *priv) | 381 | int iwlagn_alive_notify(struct iwl_priv *priv) |
324 | { | 382 | { |
325 | u32 a; | 383 | u32 a; |
@@ -407,7 +465,7 @@ int iwlagn_alive_notify(struct iwl_priv *priv) | |||
407 | 465 | ||
408 | spin_unlock_irqrestore(&priv->lock, flags); | 466 | spin_unlock_irqrestore(&priv->lock, flags); |
409 | 467 | ||
410 | iwl_send_wimax_coex(priv); | 468 | iwlagn_send_wimax_coex(priv); |
411 | 469 | ||
412 | iwlagn_set_Xtal_calib(priv); | 470 | iwlagn_set_Xtal_calib(priv); |
413 | iwl_send_calib_results(priv); | 471 | iwl_send_calib_results(priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index d8ee5283ecbe..0c3b9846aa52 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -67,37 +67,6 @@ static bool bt_coex_active = true; | |||
67 | module_param(bt_coex_active, bool, S_IRUGO); | 67 | module_param(bt_coex_active, bool, S_IRUGO); |
68 | MODULE_PARM_DESC(bt_coex_active, "enable wifi/bluetooth co-exist"); | 68 | MODULE_PARM_DESC(bt_coex_active, "enable wifi/bluetooth co-exist"); |
69 | 69 | ||
70 | static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = { | ||
71 | {COEX_CU_UNASSOC_IDLE_RP, COEX_CU_UNASSOC_IDLE_WP, | ||
72 | 0, COEX_UNASSOC_IDLE_FLAGS}, | ||
73 | {COEX_CU_UNASSOC_MANUAL_SCAN_RP, COEX_CU_UNASSOC_MANUAL_SCAN_WP, | ||
74 | 0, COEX_UNASSOC_MANUAL_SCAN_FLAGS}, | ||
75 | {COEX_CU_UNASSOC_AUTO_SCAN_RP, COEX_CU_UNASSOC_AUTO_SCAN_WP, | ||
76 | 0, COEX_UNASSOC_AUTO_SCAN_FLAGS}, | ||
77 | {COEX_CU_CALIBRATION_RP, COEX_CU_CALIBRATION_WP, | ||
78 | 0, COEX_CALIBRATION_FLAGS}, | ||
79 | {COEX_CU_PERIODIC_CALIBRATION_RP, COEX_CU_PERIODIC_CALIBRATION_WP, | ||
80 | 0, COEX_PERIODIC_CALIBRATION_FLAGS}, | ||
81 | {COEX_CU_CONNECTION_ESTAB_RP, COEX_CU_CONNECTION_ESTAB_WP, | ||
82 | 0, COEX_CONNECTION_ESTAB_FLAGS}, | ||
83 | {COEX_CU_ASSOCIATED_IDLE_RP, COEX_CU_ASSOCIATED_IDLE_WP, | ||
84 | 0, COEX_ASSOCIATED_IDLE_FLAGS}, | ||
85 | {COEX_CU_ASSOC_MANUAL_SCAN_RP, COEX_CU_ASSOC_MANUAL_SCAN_WP, | ||
86 | 0, COEX_ASSOC_MANUAL_SCAN_FLAGS}, | ||
87 | {COEX_CU_ASSOC_AUTO_SCAN_RP, COEX_CU_ASSOC_AUTO_SCAN_WP, | ||
88 | 0, COEX_ASSOC_AUTO_SCAN_FLAGS}, | ||
89 | {COEX_CU_ASSOC_ACTIVE_LEVEL_RP, COEX_CU_ASSOC_ACTIVE_LEVEL_WP, | ||
90 | 0, COEX_ASSOC_ACTIVE_LEVEL_FLAGS}, | ||
91 | {COEX_CU_RF_ON_RP, COEX_CU_RF_ON_WP, 0, COEX_CU_RF_ON_FLAGS}, | ||
92 | {COEX_CU_RF_OFF_RP, COEX_CU_RF_OFF_WP, 0, COEX_RF_OFF_FLAGS}, | ||
93 | {COEX_CU_STAND_ALONE_DEBUG_RP, COEX_CU_STAND_ALONE_DEBUG_WP, | ||
94 | 0, COEX_STAND_ALONE_DEBUG_FLAGS}, | ||
95 | {COEX_CU_IPAN_ASSOC_LEVEL_RP, COEX_CU_IPAN_ASSOC_LEVEL_WP, | ||
96 | 0, COEX_IPAN_ASSOC_LEVEL_FLAGS}, | ||
97 | {COEX_CU_RSRVD1_RP, COEX_CU_RSRVD1_WP, 0, COEX_RSRVD1_FLAGS}, | ||
98 | {COEX_CU_RSRVD2_RP, COEX_CU_RSRVD2_WP, 0, COEX_RSRVD2_FLAGS} | ||
99 | }; | ||
100 | |||
101 | #define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \ | 70 | #define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \ |
102 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ | 71 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ |
103 | IWL_RATE_SISO_##s##M_PLCP, \ | 72 | IWL_RATE_SISO_##s##M_PLCP, \ |
@@ -2340,34 +2309,6 @@ void iwl_free_txq_mem(struct iwl_priv *priv) | |||
2340 | } | 2309 | } |
2341 | EXPORT_SYMBOL(iwl_free_txq_mem); | 2310 | EXPORT_SYMBOL(iwl_free_txq_mem); |
2342 | 2311 | ||
2343 | int iwl_send_wimax_coex(struct iwl_priv *priv) | ||
2344 | { | ||
2345 | struct iwl_wimax_coex_cmd coex_cmd; | ||
2346 | |||
2347 | if (priv->cfg->support_wimax_coexist) { | ||
2348 | /* UnMask wake up src at associated sleep */ | ||
2349 | coex_cmd.flags = COEX_FLAGS_ASSOC_WA_UNMASK_MSK; | ||
2350 | |||
2351 | /* UnMask wake up src at unassociated sleep */ | ||
2352 | coex_cmd.flags |= COEX_FLAGS_UNASSOC_WA_UNMASK_MSK; | ||
2353 | memcpy(coex_cmd.sta_prio, cu_priorities, | ||
2354 | sizeof(struct iwl_wimax_coex_event_entry) * | ||
2355 | COEX_NUM_OF_EVENTS); | ||
2356 | |||
2357 | /* enabling the coexistence feature */ | ||
2358 | coex_cmd.flags |= COEX_FLAGS_COEX_ENABLE_MSK; | ||
2359 | |||
2360 | /* enabling the priorities tables */ | ||
2361 | coex_cmd.flags |= COEX_FLAGS_STA_TABLE_VALID_MSK; | ||
2362 | } else { | ||
2363 | /* coexistence is disabled */ | ||
2364 | memset(&coex_cmd, 0, sizeof(coex_cmd)); | ||
2365 | } | ||
2366 | return iwl_send_cmd_pdu(priv, COEX_PRIORITY_TABLE_CMD, | ||
2367 | sizeof(coex_cmd), &coex_cmd); | ||
2368 | } | ||
2369 | EXPORT_SYMBOL(iwl_send_wimax_coex); | ||
2370 | |||
2371 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 2312 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
2372 | 2313 | ||
2373 | #define IWL_TRAFFIC_DUMP_SIZE (IWL_TRAFFIC_ENTRY_SIZE * IWL_TRAFFIC_ENTRIES) | 2314 | #define IWL_TRAFFIC_DUMP_SIZE (IWL_TRAFFIC_ENTRY_SIZE * IWL_TRAFFIC_ENTRIES) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 88c641202c2f..f66c1c1848c8 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -373,7 +373,6 @@ int iwl_alloc_txq_mem(struct iwl_priv *priv); | |||
373 | void iwl_free_txq_mem(struct iwl_priv *priv); | 373 | void iwl_free_txq_mem(struct iwl_priv *priv); |
374 | void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, | 374 | void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, |
375 | __le32 *tx_flags); | 375 | __le32 *tx_flags); |
376 | int iwl_send_wimax_coex(struct iwl_priv *priv); | ||
377 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 376 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
378 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); | 377 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); |
379 | void iwl_free_traffic_mem(struct iwl_priv *priv); | 378 | void iwl_free_traffic_mem(struct iwl_priv *priv); |