diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2009-10-30 17:36:18 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-11-02 15:39:48 -0500 |
commit | 1933ac4d9377ed44caba45abe1531ec1bc14bb63 (patch) | |
tree | 43ccdb0d06168f07ab94dd3442debb4151cd42a3 /drivers | |
parent | 3f3e0376bb14ac7bfd8ac3e9824b2ad04d945e18 (diff) |
iwlwifi: add wimax/wifi coexist support for 6x50 series
For 6x50 series, it is wimax/wifi combo device, so driver need to enable
the wimax/wifi co-exist function and send the coexist event priority
table to uCode for operation.
The priority table will be used by uCode to determine what is the proper
action it should take when co-exist with WiMAX.
For example, when WiFi runs a scan, it must own radio exclusively, therefore
will disconnect WiMAX if WiMAX is connected.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-commands.h | 92 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 59 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 3 |
5 files changed, 158 insertions, 11 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index d256fecc6cda..910217f0ad8a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -591,16 +591,6 @@ static void iwl5000_tx_queue_set_status(struct iwl_priv *priv, | |||
591 | scd_retry ? "BA" : "AC", txq_id, tx_fifo_id); | 591 | scd_retry ? "BA" : "AC", txq_id, tx_fifo_id); |
592 | } | 592 | } |
593 | 593 | ||
594 | static int iwl5000_send_wimax_coex(struct iwl_priv *priv) | ||
595 | { | ||
596 | struct iwl_wimax_coex_cmd coex_cmd; | ||
597 | |||
598 | memset(&coex_cmd, 0, sizeof(coex_cmd)); | ||
599 | |||
600 | return iwl_send_cmd_pdu(priv, COEX_PRIORITY_TABLE_CMD, | ||
601 | sizeof(coex_cmd), &coex_cmd); | ||
602 | } | ||
603 | |||
604 | int iwl5000_alive_notify(struct iwl_priv *priv) | 594 | int iwl5000_alive_notify(struct iwl_priv *priv) |
605 | { | 595 | { |
606 | u32 a; | 596 | u32 a; |
@@ -681,7 +671,7 @@ int iwl5000_alive_notify(struct iwl_priv *priv) | |||
681 | spin_unlock_irqrestore(&priv->lock, flags); | 671 | spin_unlock_irqrestore(&priv->lock, flags); |
682 | 672 | ||
683 | 673 | ||
684 | iwl5000_send_wimax_coex(priv); | 674 | iwl_send_wimax_coex(priv); |
685 | 675 | ||
686 | iwl5000_set_Xtal_calib(priv); | 676 | iwl5000_set_Xtal_calib(priv); |
687 | iwl_send_calib_results(priv); | 677 | iwl_send_calib_results(priv); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index a4a8b5e2f411..70e117f8d0c4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -491,6 +491,7 @@ struct iwl_cfg iwl6050_2agn_cfg = { | |||
491 | .adv_thermal_throttle = true, | 491 | .adv_thermal_throttle = true, |
492 | .support_ct_kill_exit = true, | 492 | .support_ct_kill_exit = true, |
493 | .support_sm_ps = true, | 493 | .support_sm_ps = true, |
494 | .support_wimax_coexist = true, | ||
494 | }; | 495 | }; |
495 | 496 | ||
496 | struct iwl_cfg iwl6050_2abg_cfg = { | 497 | struct iwl_cfg iwl6050_2abg_cfg = { |
@@ -520,6 +521,7 @@ struct iwl_cfg iwl6050_2abg_cfg = { | |||
520 | .supports_idle = true, | 521 | .supports_idle = true, |
521 | .adv_thermal_throttle = true, | 522 | .adv_thermal_throttle = true, |
522 | .support_ct_kill_exit = true, | 523 | .support_ct_kill_exit = true, |
524 | .support_wimax_coexist = true, | ||
523 | }; | 525 | }; |
524 | 526 | ||
525 | struct iwl_cfg iwl6000_3agn_cfg = { | 527 | struct iwl_cfg iwl6000_3agn_cfg = { |
@@ -581,6 +583,7 @@ struct iwl_cfg iwl6050_3agn_cfg = { | |||
581 | .adv_thermal_throttle = true, | 583 | .adv_thermal_throttle = true, |
582 | .support_ct_kill_exit = true, | 584 | .support_ct_kill_exit = true, |
583 | .support_sm_ps = true, | 585 | .support_sm_ps = true, |
586 | .support_wimax_coexist = true, | ||
584 | }; | 587 | }; |
585 | 588 | ||
586 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); | 589 | MODULE_FIRMWARE(IWL6000_MODULE_FIRMWARE(IWL6000_UCODE_API_MAX)); |
diff --git a/drivers/net/wireless/iwlwifi/iwl-commands.h b/drivers/net/wireless/iwlwifi/iwl-commands.h index 43dd6af00892..b62c90ec9e1e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-commands.h +++ b/drivers/net/wireless/iwlwifi/iwl-commands.h | |||
@@ -3507,6 +3507,98 @@ struct iwl_led_cmd { | |||
3507 | * also used as potential "events" value for both | 3507 | * also used as potential "events" value for both |
3508 | * COEX_MEDIUM_NOTIFICATION and COEX_EVENT_CMD | 3508 | * COEX_MEDIUM_NOTIFICATION and COEX_EVENT_CMD |
3509 | */ | 3509 | */ |
3510 | |||
3511 | /* | ||
3512 | * COEX events entry flag masks | ||
3513 | * RP - Requested Priority | ||
3514 | * WP - Win Medium Priority: priority assigned when the contention has been won | ||
3515 | */ | ||
3516 | #define COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG (0x1) | ||
3517 | #define COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG (0x2) | ||
3518 | #define COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG (0x4) | ||
3519 | |||
3520 | #define COEX_CU_UNASSOC_IDLE_RP 4 | ||
3521 | #define COEX_CU_UNASSOC_MANUAL_SCAN_RP 4 | ||
3522 | #define COEX_CU_UNASSOC_AUTO_SCAN_RP 4 | ||
3523 | #define COEX_CU_CALIBRATION_RP 4 | ||
3524 | #define COEX_CU_PERIODIC_CALIBRATION_RP 4 | ||
3525 | #define COEX_CU_CONNECTION_ESTAB_RP 4 | ||
3526 | #define COEX_CU_ASSOCIATED_IDLE_RP 4 | ||
3527 | #define COEX_CU_ASSOC_MANUAL_SCAN_RP 4 | ||
3528 | #define COEX_CU_ASSOC_AUTO_SCAN_RP 4 | ||
3529 | #define COEX_CU_ASSOC_ACTIVE_LEVEL_RP 4 | ||
3530 | #define COEX_CU_RF_ON_RP 6 | ||
3531 | #define COEX_CU_RF_OFF_RP 4 | ||
3532 | #define COEX_CU_STAND_ALONE_DEBUG_RP 6 | ||
3533 | #define COEX_CU_IPAN_ASSOC_LEVEL_RP 4 | ||
3534 | #define COEX_CU_RSRVD1_RP 4 | ||
3535 | #define COEX_CU_RSRVD2_RP 4 | ||
3536 | |||
3537 | #define COEX_CU_UNASSOC_IDLE_WP 3 | ||
3538 | #define COEX_CU_UNASSOC_MANUAL_SCAN_WP 3 | ||
3539 | #define COEX_CU_UNASSOC_AUTO_SCAN_WP 3 | ||
3540 | #define COEX_CU_CALIBRATION_WP 3 | ||
3541 | #define COEX_CU_PERIODIC_CALIBRATION_WP 3 | ||
3542 | #define COEX_CU_CONNECTION_ESTAB_WP 3 | ||
3543 | #define COEX_CU_ASSOCIATED_IDLE_WP 3 | ||
3544 | #define COEX_CU_ASSOC_MANUAL_SCAN_WP 3 | ||
3545 | #define COEX_CU_ASSOC_AUTO_SCAN_WP 3 | ||
3546 | #define COEX_CU_ASSOC_ACTIVE_LEVEL_WP 3 | ||
3547 | #define COEX_CU_RF_ON_WP 3 | ||
3548 | #define COEX_CU_RF_OFF_WP 3 | ||
3549 | #define COEX_CU_STAND_ALONE_DEBUG_WP 6 | ||
3550 | #define COEX_CU_IPAN_ASSOC_LEVEL_WP 3 | ||
3551 | #define COEX_CU_RSRVD1_WP 3 | ||
3552 | #define COEX_CU_RSRVD2_WP 3 | ||
3553 | |||
3554 | #define COEX_UNASSOC_IDLE_FLAGS 0 | ||
3555 | #define COEX_UNASSOC_MANUAL_SCAN_FLAGS \ | ||
3556 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3557 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) | ||
3558 | #define COEX_UNASSOC_AUTO_SCAN_FLAGS \ | ||
3559 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3560 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) | ||
3561 | #define COEX_CALIBRATION_FLAGS \ | ||
3562 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3563 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) | ||
3564 | #define COEX_PERIODIC_CALIBRATION_FLAGS 0 | ||
3565 | /* | ||
3566 | * COEX_CONNECTION_ESTAB: | ||
3567 | * we need DELAY_MEDIUM_FREE_NTFY to let WiMAX disconnect from network. | ||
3568 | */ | ||
3569 | #define COEX_CONNECTION_ESTAB_FLAGS \ | ||
3570 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3571 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG | \ | ||
3572 | COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG) | ||
3573 | #define COEX_ASSOCIATED_IDLE_FLAGS 0 | ||
3574 | #define COEX_ASSOC_MANUAL_SCAN_FLAGS \ | ||
3575 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3576 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) | ||
3577 | #define COEX_ASSOC_AUTO_SCAN_FLAGS \ | ||
3578 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3579 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) | ||
3580 | #define COEX_ASSOC_ACTIVE_LEVEL_FLAGS 0 | ||
3581 | #define COEX_RF_ON_FLAGS 0 | ||
3582 | #define COEX_RF_OFF_FLAGS 0 | ||
3583 | #define COEX_STAND_ALONE_DEBUG_FLAGS \ | ||
3584 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3585 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG) | ||
3586 | #define COEX_IPAN_ASSOC_LEVEL_FLAGS \ | ||
3587 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3588 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG | \ | ||
3589 | COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG) | ||
3590 | #define COEX_RSRVD1_FLAGS 0 | ||
3591 | #define COEX_RSRVD2_FLAGS 0 | ||
3592 | /* | ||
3593 | * COEX_CU_RF_ON is the event wrapping all radio ownership. | ||
3594 | * We need DELAY_MEDIUM_FREE_NTFY to let WiMAX disconnect from network. | ||
3595 | */ | ||
3596 | #define COEX_CU_RF_ON_FLAGS \ | ||
3597 | (COEX_EVT_FLAG_MEDIUM_FREE_NTFY_FLG | \ | ||
3598 | COEX_EVT_FLAG_MEDIUM_ACTV_NTFY_FLG | \ | ||
3599 | COEX_EVT_FLAG_DELAY_MEDIUM_FREE_NTFY_FLG) | ||
3600 | |||
3601 | |||
3510 | enum { | 3602 | enum { |
3511 | /* un-association part */ | 3603 | /* un-association part */ |
3512 | COEX_UNASSOC_IDLE = 0, | 3604 | COEX_UNASSOC_IDLE = 0, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index c4ff381e440e..7373b2f50aca 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -46,6 +46,37 @@ MODULE_VERSION(IWLWIFI_VERSION); | |||
46 | MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); | 46 | MODULE_AUTHOR(DRV_COPYRIGHT " " DRV_AUTHOR); |
47 | MODULE_LICENSE("GPL"); | 47 | MODULE_LICENSE("GPL"); |
48 | 48 | ||
49 | static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = { | ||
50 | {COEX_CU_UNASSOC_IDLE_RP, COEX_CU_UNASSOC_IDLE_WP, | ||
51 | 0, COEX_UNASSOC_IDLE_FLAGS}, | ||
52 | {COEX_CU_UNASSOC_MANUAL_SCAN_RP, COEX_CU_UNASSOC_MANUAL_SCAN_WP, | ||
53 | 0, COEX_UNASSOC_MANUAL_SCAN_FLAGS}, | ||
54 | {COEX_CU_UNASSOC_AUTO_SCAN_RP, COEX_CU_UNASSOC_AUTO_SCAN_WP, | ||
55 | 0, COEX_UNASSOC_AUTO_SCAN_FLAGS}, | ||
56 | {COEX_CU_CALIBRATION_RP, COEX_CU_CALIBRATION_WP, | ||
57 | 0, COEX_CALIBRATION_FLAGS}, | ||
58 | {COEX_CU_PERIODIC_CALIBRATION_RP, COEX_CU_PERIODIC_CALIBRATION_WP, | ||
59 | 0, COEX_PERIODIC_CALIBRATION_FLAGS}, | ||
60 | {COEX_CU_CONNECTION_ESTAB_RP, COEX_CU_CONNECTION_ESTAB_WP, | ||
61 | 0, COEX_CONNECTION_ESTAB_FLAGS}, | ||
62 | {COEX_CU_ASSOCIATED_IDLE_RP, COEX_CU_ASSOCIATED_IDLE_WP, | ||
63 | 0, COEX_ASSOCIATED_IDLE_FLAGS}, | ||
64 | {COEX_CU_ASSOC_MANUAL_SCAN_RP, COEX_CU_ASSOC_MANUAL_SCAN_WP, | ||
65 | 0, COEX_ASSOC_MANUAL_SCAN_FLAGS}, | ||
66 | {COEX_CU_ASSOC_AUTO_SCAN_RP, COEX_CU_ASSOC_AUTO_SCAN_WP, | ||
67 | 0, COEX_ASSOC_AUTO_SCAN_FLAGS}, | ||
68 | {COEX_CU_ASSOC_ACTIVE_LEVEL_RP, COEX_CU_ASSOC_ACTIVE_LEVEL_WP, | ||
69 | 0, COEX_ASSOC_ACTIVE_LEVEL_FLAGS}, | ||
70 | {COEX_CU_RF_ON_RP, COEX_CU_RF_ON_WP, 0, COEX_CU_RF_ON_FLAGS}, | ||
71 | {COEX_CU_RF_OFF_RP, COEX_CU_RF_OFF_WP, 0, COEX_RF_OFF_FLAGS}, | ||
72 | {COEX_CU_STAND_ALONE_DEBUG_RP, COEX_CU_STAND_ALONE_DEBUG_WP, | ||
73 | 0, COEX_STAND_ALONE_DEBUG_FLAGS}, | ||
74 | {COEX_CU_IPAN_ASSOC_LEVEL_RP, COEX_CU_IPAN_ASSOC_LEVEL_WP, | ||
75 | 0, COEX_IPAN_ASSOC_LEVEL_FLAGS}, | ||
76 | {COEX_CU_RSRVD1_RP, COEX_CU_RSRVD1_WP, 0, COEX_RSRVD1_FLAGS}, | ||
77 | {COEX_CU_RSRVD2_RP, COEX_CU_RSRVD2_WP, 0, COEX_RSRVD2_FLAGS} | ||
78 | }; | ||
79 | |||
49 | #define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \ | 80 | #define IWL_DECLARE_RATE_INFO(r, s, ip, in, rp, rn, pp, np) \ |
50 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ | 81 | [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ |
51 | IWL_RATE_SISO_##s##M_PLCP, \ | 82 | IWL_RATE_SISO_##s##M_PLCP, \ |
@@ -2865,6 +2896,34 @@ void iwl_free_txq_mem(struct iwl_priv *priv) | |||
2865 | } | 2896 | } |
2866 | EXPORT_SYMBOL(iwl_free_txq_mem); | 2897 | EXPORT_SYMBOL(iwl_free_txq_mem); |
2867 | 2898 | ||
2899 | int iwl_send_wimax_coex(struct iwl_priv *priv) | ||
2900 | { | ||
2901 | struct iwl_wimax_coex_cmd uninitialized_var(coex_cmd); | ||
2902 | |||
2903 | if (priv->cfg->support_wimax_coexist) { | ||
2904 | /* UnMask wake up src at associated sleep */ | ||
2905 | coex_cmd.flags |= COEX_FLAGS_ASSOC_WA_UNMASK_MSK; | ||
2906 | |||
2907 | /* UnMask wake up src at unassociated sleep */ | ||
2908 | coex_cmd.flags |= COEX_FLAGS_UNASSOC_WA_UNMASK_MSK; | ||
2909 | memcpy(coex_cmd.sta_prio, cu_priorities, | ||
2910 | sizeof(struct iwl_wimax_coex_event_entry) * | ||
2911 | COEX_NUM_OF_EVENTS); | ||
2912 | |||
2913 | /* enabling the coexistence feature */ | ||
2914 | coex_cmd.flags |= COEX_FLAGS_COEX_ENABLE_MSK; | ||
2915 | |||
2916 | /* enabling the priorities tables */ | ||
2917 | coex_cmd.flags |= COEX_FLAGS_STA_TABLE_VALID_MSK; | ||
2918 | } else { | ||
2919 | /* coexistence is disabled */ | ||
2920 | memset(&coex_cmd, 0, sizeof(coex_cmd)); | ||
2921 | } | ||
2922 | return iwl_send_cmd_pdu(priv, COEX_PRIORITY_TABLE_CMD, | ||
2923 | sizeof(coex_cmd), &coex_cmd); | ||
2924 | } | ||
2925 | EXPORT_SYMBOL(iwl_send_wimax_coex); | ||
2926 | |||
2868 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 2927 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
2869 | 2928 | ||
2870 | #define IWL_TRAFFIC_DUMP_SIZE (IWL_TRAFFIC_ENTRY_SIZE * IWL_TRAFFIC_ENTRIES) | 2929 | #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 d2e47dab38d4..9574d8f33537 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -229,6 +229,7 @@ struct iwl_mod_params { | |||
229 | * @adv_thermal_throttle: support advance thermal throttle | 229 | * @adv_thermal_throttle: support advance thermal throttle |
230 | * @support_ct_kill_exit: support ct kill exit condition | 230 | * @support_ct_kill_exit: support ct kill exit condition |
231 | * @support_sm_ps: support spatial multiplexing power save | 231 | * @support_sm_ps: support spatial multiplexing power save |
232 | * @support_wimax_coexist: support wimax/wifi co-exist | ||
232 | * | 233 | * |
233 | * We enable the driver to be backward compatible wrt API version. The | 234 | * We enable the driver to be backward compatible wrt API version. The |
234 | * driver specifies which APIs it supports (with @ucode_api_max being the | 235 | * driver specifies which APIs it supports (with @ucode_api_max being the |
@@ -285,6 +286,7 @@ struct iwl_cfg { | |||
285 | bool adv_thermal_throttle; | 286 | bool adv_thermal_throttle; |
286 | bool support_ct_kill_exit; | 287 | bool support_ct_kill_exit; |
287 | bool support_sm_ps; | 288 | bool support_sm_ps; |
289 | const bool support_wimax_coexist; | ||
288 | }; | 290 | }; |
289 | 291 | ||
290 | /*************************** | 292 | /*************************** |
@@ -340,6 +342,7 @@ int iwl_alloc_txq_mem(struct iwl_priv *priv); | |||
340 | void iwl_free_txq_mem(struct iwl_priv *priv); | 342 | void iwl_free_txq_mem(struct iwl_priv *priv); |
341 | void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, | 343 | void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info, |
342 | __le32 *tx_flags); | 344 | __le32 *tx_flags); |
345 | int iwl_send_wimax_coex(struct iwl_priv *priv); | ||
343 | #ifdef CONFIG_IWLWIFI_DEBUGFS | 346 | #ifdef CONFIG_IWLWIFI_DEBUGFS |
344 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); | 347 | int iwl_alloc_traffic_mem(struct iwl_priv *priv); |
345 | void iwl_free_traffic_mem(struct iwl_priv *priv); | 348 | void iwl_free_traffic_mem(struct iwl_priv *priv); |