diff options
author | David S. Miller <davem@davemloft.net> | 2010-02-04 11:58:14 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-02-04 11:58:14 -0500 |
commit | 10be7eb36b93364b98688831ee7d26f58402bb96 (patch) | |
tree | eb13ae80fcaa8baacd804a721c5a4962a501a2a4 /drivers/net/wireless/iwlwifi/iwl-agn.c | |
parent | 90c30335a70e96b8b8493b7deb15e6b30e6d9fce (diff) | |
parent | 5ffaf8a361b4c9025963959a744f21d8173c7669 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 344e99de4ca..d0268280d67 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /****************************************************************************** | 1 | /****************************************************************************** |
2 | * | 2 | * |
3 | * Copyright(c) 2003 - 2009 Intel Corporation. All rights reserved. | 3 | * Copyright(c) 2003 - 2010 Intel Corporation. All rights reserved. |
4 | * | 4 | * |
5 | * Portions of this file are derived from the ipw3945 project, as well | 5 | * Portions of this file are derived from the ipw3945 project, as well |
6 | * as portions of the ieee80211 subsystem header files. | 6 | * as portions of the ieee80211 subsystem header files. |
@@ -73,13 +73,7 @@ | |||
73 | #define VD | 73 | #define VD |
74 | #endif | 74 | #endif |
75 | 75 | ||
76 | #ifdef CONFIG_IWLWIFI_SPECTRUM_MEASUREMENT | 76 | #define DRV_VERSION IWLWIFI_VERSION VD |
77 | #define VS "s" | ||
78 | #else | ||
79 | #define VS | ||
80 | #endif | ||
81 | |||
82 | #define DRV_VERSION IWLWIFI_VERSION VD VS | ||
83 | 77 | ||
84 | 78 | ||
85 | MODULE_DESCRIPTION(DRV_DESCRIPTION); | 79 | MODULE_DESCRIPTION(DRV_DESCRIPTION); |
@@ -203,7 +197,8 @@ int iwl_commit_rxon(struct iwl_priv *priv) | |||
203 | priv->start_calib = 0; | 197 | priv->start_calib = 0; |
204 | 198 | ||
205 | /* Add the broadcast address so we can send broadcast frames */ | 199 | /* Add the broadcast address so we can send broadcast frames */ |
206 | iwl_add_bcast_station(priv); | 200 | priv->cfg->ops->lib->add_bcast_station(priv); |
201 | |||
207 | 202 | ||
208 | /* If we have set the ASSOC_MSK and we are in BSS mode then | 203 | /* If we have set the ASSOC_MSK and we are in BSS mode then |
209 | * add the IWL_AP_ID to the station rate table */ | 204 | * add the IWL_AP_ID to the station rate table */ |
@@ -704,7 +699,7 @@ static void iwl_print_cont_event_trace(struct iwl_priv *priv, u32 base, | |||
704 | spin_unlock_irqrestore(&priv->reg_lock, reg_flags); | 699 | spin_unlock_irqrestore(&priv->reg_lock, reg_flags); |
705 | } | 700 | } |
706 | 701 | ||
707 | void iwl_continuous_event_trace(struct iwl_priv *priv) | 702 | static void iwl_continuous_event_trace(struct iwl_priv *priv) |
708 | { | 703 | { |
709 | u32 capacity; /* event log capacity in # entries */ | 704 | u32 capacity; /* event log capacity in # entries */ |
710 | u32 base; /* SRAM byte address of event log header */ | 705 | u32 base; /* SRAM byte address of event log header */ |
@@ -888,6 +883,8 @@ static void iwl_setup_rx_handlers(struct iwl_priv *priv) | |||
888 | priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive; | 883 | priv->rx_handlers[REPLY_ALIVE] = iwl_rx_reply_alive; |
889 | priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error; | 884 | priv->rx_handlers[REPLY_ERROR] = iwl_rx_reply_error; |
890 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa; | 885 | priv->rx_handlers[CHANNEL_SWITCH_NOTIFICATION] = iwl_rx_csa; |
886 | priv->rx_handlers[SPECTRUM_MEASURE_NOTIFICATION] = | ||
887 | iwl_rx_spectrum_measure_notif; | ||
891 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; | 888 | priv->rx_handlers[PM_SLEEP_NOTIFICATION] = iwl_rx_pm_sleep_notif; |
892 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = | 889 | priv->rx_handlers[PM_DEBUG_STATISTIC_NOTIFIC] = |
893 | iwl_rx_pm_debug_statistics_notif; | 890 | iwl_rx_pm_debug_statistics_notif; |
@@ -901,7 +898,6 @@ static void iwl_setup_rx_handlers(struct iwl_priv *priv) | |||
901 | priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl_reply_statistics; | 898 | priv->rx_handlers[REPLY_STATISTICS_CMD] = iwl_reply_statistics; |
902 | priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl_rx_statistics; | 899 | priv->rx_handlers[STATISTICS_NOTIFICATION] = iwl_rx_statistics; |
903 | 900 | ||
904 | iwl_setup_spectrum_handlers(priv); | ||
905 | iwl_setup_rx_scan_handlers(priv); | 901 | iwl_setup_rx_scan_handlers(priv); |
906 | 902 | ||
907 | /* status change handler */ | 903 | /* status change handler */ |
@@ -1761,7 +1757,7 @@ static const char *desc_lookup_text[] = { | |||
1761 | "DEBUG_1", | 1757 | "DEBUG_1", |
1762 | "DEBUG_2", | 1758 | "DEBUG_2", |
1763 | "DEBUG_3", | 1759 | "DEBUG_3", |
1764 | "UNKNOWN" | 1760 | "ADVANCED SYSASSERT" |
1765 | }; | 1761 | }; |
1766 | 1762 | ||
1767 | static const char *desc_lookup(int i) | 1763 | static const char *desc_lookup(int i) |
@@ -1965,7 +1961,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
1965 | IWL_ERR(priv, | 1961 | IWL_ERR(priv, |
1966 | "Invalid event log pointer 0x%08X for %s uCode\n", | 1962 | "Invalid event log pointer 0x%08X for %s uCode\n", |
1967 | base, (priv->ucode_type == UCODE_INIT) ? "Init" : "RT"); | 1963 | base, (priv->ucode_type == UCODE_INIT) ? "Init" : "RT"); |
1968 | return pos; | 1964 | return -EINVAL; |
1969 | } | 1965 | } |
1970 | 1966 | ||
1971 | /* event log header */ | 1967 | /* event log header */ |
@@ -2013,7 +2009,7 @@ int iwl_dump_nic_event_log(struct iwl_priv *priv, bool full_log, | |||
2013 | bufsz = size * 48; | 2009 | bufsz = size * 48; |
2014 | *buf = kmalloc(bufsz, GFP_KERNEL); | 2010 | *buf = kmalloc(bufsz, GFP_KERNEL); |
2015 | if (!*buf) | 2011 | if (!*buf) |
2016 | return pos; | 2012 | return -ENOMEM; |
2017 | } | 2013 | } |
2018 | if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) { | 2014 | if ((iwl_get_debug_level(priv) & IWL_DL_FW_ERRORS) || full_log) { |
2019 | /* | 2015 | /* |
@@ -2443,18 +2439,6 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work) | |||
2443 | return; | 2439 | return; |
2444 | } | 2440 | } |
2445 | 2441 | ||
2446 | static void iwl_bg_up(struct work_struct *data) | ||
2447 | { | ||
2448 | struct iwl_priv *priv = container_of(data, struct iwl_priv, up); | ||
2449 | |||
2450 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
2451 | return; | ||
2452 | |||
2453 | mutex_lock(&priv->mutex); | ||
2454 | __iwl_up(priv); | ||
2455 | mutex_unlock(&priv->mutex); | ||
2456 | } | ||
2457 | |||
2458 | static void iwl_bg_restart(struct work_struct *data) | 2442 | static void iwl_bg_restart(struct work_struct *data) |
2459 | { | 2443 | { |
2460 | struct iwl_priv *priv = container_of(data, struct iwl_priv, restart); | 2444 | struct iwl_priv *priv = container_of(data, struct iwl_priv, restart); |
@@ -2471,7 +2455,13 @@ static void iwl_bg_restart(struct work_struct *data) | |||
2471 | ieee80211_restart_hw(priv->hw); | 2455 | ieee80211_restart_hw(priv->hw); |
2472 | } else { | 2456 | } else { |
2473 | iwl_down(priv); | 2457 | iwl_down(priv); |
2474 | queue_work(priv->workqueue, &priv->up); | 2458 | |
2459 | if (test_bit(STATUS_EXIT_PENDING, &priv->status)) | ||
2460 | return; | ||
2461 | |||
2462 | mutex_lock(&priv->mutex); | ||
2463 | __iwl_up(priv); | ||
2464 | mutex_unlock(&priv->mutex); | ||
2475 | } | 2465 | } |
2476 | } | 2466 | } |
2477 | 2467 | ||
@@ -2607,7 +2597,7 @@ void iwl_post_associate(struct iwl_priv *priv) | |||
2607 | * Not a mac80211 entry point function, but it fits in with all the | 2597 | * Not a mac80211 entry point function, but it fits in with all the |
2608 | * other mac80211 functions grouped here. | 2598 | * other mac80211 functions grouped here. |
2609 | */ | 2599 | */ |
2610 | static int iwl_setup_mac(struct iwl_priv *priv) | 2600 | static int iwl_mac_setup_register(struct iwl_priv *priv) |
2611 | { | 2601 | { |
2612 | int ret; | 2602 | int ret; |
2613 | struct ieee80211_hw *hw = priv->hw; | 2603 | struct ieee80211_hw *hw = priv->hw; |
@@ -2839,14 +2829,18 @@ void iwl_config_ap(struct iwl_priv *priv) | |||
2839 | } | 2829 | } |
2840 | 2830 | ||
2841 | static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, | 2831 | static void iwl_mac_update_tkip_key(struct ieee80211_hw *hw, |
2842 | struct ieee80211_key_conf *keyconf, const u8 *addr, | 2832 | struct ieee80211_vif *vif, |
2843 | u32 iv32, u16 *phase1key) | 2833 | struct ieee80211_key_conf *keyconf, |
2834 | struct ieee80211_sta *sta, | ||
2835 | u32 iv32, u16 *phase1key) | ||
2844 | { | 2836 | { |
2845 | 2837 | ||
2846 | struct iwl_priv *priv = hw->priv; | 2838 | struct iwl_priv *priv = hw->priv; |
2847 | IWL_DEBUG_MAC80211(priv, "enter\n"); | 2839 | IWL_DEBUG_MAC80211(priv, "enter\n"); |
2848 | 2840 | ||
2849 | iwl_update_tkip_key(priv, keyconf, addr, iv32, phase1key); | 2841 | iwl_update_tkip_key(priv, keyconf, |
2842 | sta ? sta->addr : iwl_bcast_addr, | ||
2843 | iv32, phase1key); | ||
2850 | 2844 | ||
2851 | IWL_DEBUG_MAC80211(priv, "leave\n"); | 2845 | IWL_DEBUG_MAC80211(priv, "leave\n"); |
2852 | } | 2846 | } |
@@ -3007,6 +3001,8 @@ static void iwl_mac_sta_notify(struct ieee80211_hw *hw, | |||
3007 | break; | 3001 | break; |
3008 | case STA_NOTIFY_AWAKE: | 3002 | case STA_NOTIFY_AWAKE: |
3009 | WARN_ON(!sta_priv->client); | 3003 | WARN_ON(!sta_priv->client); |
3004 | if (!sta_priv->asleep) | ||
3005 | break; | ||
3010 | sta_priv->asleep = false; | 3006 | sta_priv->asleep = false; |
3011 | sta_id = iwl_find_station(priv, sta->addr); | 3007 | sta_id = iwl_find_station(priv, sta->addr); |
3012 | if (sta_id != IWL_INVALID_STATION) | 3008 | if (sta_id != IWL_INVALID_STATION) |
@@ -3283,7 +3279,6 @@ static void iwl_setup_deferred_work(struct iwl_priv *priv) | |||
3283 | 3279 | ||
3284 | init_waitqueue_head(&priv->wait_command_queue); | 3280 | init_waitqueue_head(&priv->wait_command_queue); |
3285 | 3281 | ||
3286 | INIT_WORK(&priv->up, iwl_bg_up); | ||
3287 | INIT_WORK(&priv->restart, iwl_bg_restart); | 3282 | INIT_WORK(&priv->restart, iwl_bg_restart); |
3288 | INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); | 3283 | INIT_WORK(&priv->rx_replenish, iwl_bg_rx_replenish); |
3289 | INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update); | 3284 | INIT_WORK(&priv->beacon_update, iwl_bg_beacon_update); |
@@ -3368,6 +3363,7 @@ static int iwl_init_drv(struct iwl_priv *priv) | |||
3368 | 3363 | ||
3369 | priv->iw_mode = NL80211_IFTYPE_STATION; | 3364 | priv->iw_mode = NL80211_IFTYPE_STATION; |
3370 | priv->current_ht_config.smps = IEEE80211_SMPS_STATIC; | 3365 | priv->current_ht_config.smps = IEEE80211_SMPS_STATIC; |
3366 | priv->missed_beacon_threshold = IWL_MISSED_BEACON_THRESHOLD_DEF; | ||
3371 | 3367 | ||
3372 | /* Choose which receivers/antennas to use */ | 3368 | /* Choose which receivers/antennas to use */ |
3373 | if (priv->cfg->ops->hcmd->set_rxon_chain) | 3369 | if (priv->cfg->ops->hcmd->set_rxon_chain) |
@@ -3619,9 +3615,9 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3619 | iwl_setup_deferred_work(priv); | 3615 | iwl_setup_deferred_work(priv); |
3620 | iwl_setup_rx_handlers(priv); | 3616 | iwl_setup_rx_handlers(priv); |
3621 | 3617 | ||
3622 | /********************************** | 3618 | /********************************************* |
3623 | * 8. Setup and register mac80211 | 3619 | * 8. Enable interrupts and read RFKILL state |
3624 | **********************************/ | 3620 | *********************************************/ |
3625 | 3621 | ||
3626 | /* enable interrupts if needed: hw bug w/a */ | 3622 | /* enable interrupts if needed: hw bug w/a */ |
3627 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); | 3623 | pci_read_config_word(priv->pci_dev, PCI_COMMAND, &pci_cmd); |
@@ -3632,14 +3628,6 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3632 | 3628 | ||
3633 | iwl_enable_interrupts(priv); | 3629 | iwl_enable_interrupts(priv); |
3634 | 3630 | ||
3635 | err = iwl_setup_mac(priv); | ||
3636 | if (err) | ||
3637 | goto out_remove_sysfs; | ||
3638 | |||
3639 | err = iwl_dbgfs_register(priv, DRV_NAME); | ||
3640 | if (err) | ||
3641 | IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err); | ||
3642 | |||
3643 | /* If platform's RF_KILL switch is NOT set to KILL */ | 3631 | /* If platform's RF_KILL switch is NOT set to KILL */ |
3644 | if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) | 3632 | if (iwl_read32(priv, CSR_GP_CNTRL) & CSR_GP_CNTRL_REG_FLAG_HW_RF_KILL_SW) |
3645 | clear_bit(STATUS_RF_KILL_HW, &priv->status); | 3633 | clear_bit(STATUS_RF_KILL_HW, &priv->status); |
@@ -3651,6 +3639,18 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3651 | 3639 | ||
3652 | iwl_power_initialize(priv); | 3640 | iwl_power_initialize(priv); |
3653 | iwl_tt_initialize(priv); | 3641 | iwl_tt_initialize(priv); |
3642 | |||
3643 | /************************************************** | ||
3644 | * 9. Setup and register with mac80211 and debugfs | ||
3645 | **************************************************/ | ||
3646 | err = iwl_mac_setup_register(priv); | ||
3647 | if (err) | ||
3648 | goto out_remove_sysfs; | ||
3649 | |||
3650 | err = iwl_dbgfs_register(priv, DRV_NAME); | ||
3651 | if (err) | ||
3652 | IWL_ERR(priv, "failed to create debugfs files. Ignoring error: %d\n", err); | ||
3653 | |||
3654 | return 0; | 3654 | return 0; |
3655 | 3655 | ||
3656 | out_remove_sysfs: | 3656 | out_remove_sysfs: |