diff options
author | Abhijeet Kolekar <abhijeet.kolekar@intel.com> | 2009-04-08 14:26:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:54:43 -0400 |
commit | bd564261d7dd3660f7a5ba308a867c6bb23de6a2 (patch) | |
tree | 8fdba368708c3b7068a80deba7ec7cdba62ee4d4 /drivers/net/wireless/iwlwifi | |
parent | aa89f31e708d469f5dd824c59c98e4856a2e3572 (diff) |
iwl3945: use iwl_mac_reset_tsf from iwlwifi
3945 can now use iwl_mac_reset_tsf from iwlwifi.
Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com>
Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 75 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.c | 75 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 1 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 60 |
4 files changed, 77 insertions, 134 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 3ebf80fbebab..9dda3d547d0d 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2235,81 +2235,6 @@ static int iwl_mac_get_stats(struct ieee80211_hw *hw, | |||
2235 | return 0; | 2235 | return 0; |
2236 | } | 2236 | } |
2237 | 2237 | ||
2238 | static void iwl_mac_reset_tsf(struct ieee80211_hw *hw) | ||
2239 | { | ||
2240 | struct iwl_priv *priv = hw->priv; | ||
2241 | unsigned long flags; | ||
2242 | |||
2243 | mutex_lock(&priv->mutex); | ||
2244 | IWL_DEBUG_MAC80211(priv, "enter\n"); | ||
2245 | |||
2246 | spin_lock_irqsave(&priv->lock, flags); | ||
2247 | memset(&priv->current_ht_config, 0, sizeof(struct iwl_ht_info)); | ||
2248 | spin_unlock_irqrestore(&priv->lock, flags); | ||
2249 | |||
2250 | iwl_reset_qos(priv); | ||
2251 | |||
2252 | spin_lock_irqsave(&priv->lock, flags); | ||
2253 | priv->assoc_id = 0; | ||
2254 | priv->assoc_capability = 0; | ||
2255 | priv->assoc_station_added = 0; | ||
2256 | |||
2257 | /* new association get rid of ibss beacon skb */ | ||
2258 | if (priv->ibss_beacon) | ||
2259 | dev_kfree_skb(priv->ibss_beacon); | ||
2260 | |||
2261 | priv->ibss_beacon = NULL; | ||
2262 | |||
2263 | priv->beacon_int = priv->hw->conf.beacon_int; | ||
2264 | priv->timestamp = 0; | ||
2265 | if ((priv->iw_mode == NL80211_IFTYPE_STATION)) | ||
2266 | priv->beacon_int = 0; | ||
2267 | |||
2268 | spin_unlock_irqrestore(&priv->lock, flags); | ||
2269 | |||
2270 | if (!iwl_is_ready_rf(priv)) { | ||
2271 | IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); | ||
2272 | mutex_unlock(&priv->mutex); | ||
2273 | return; | ||
2274 | } | ||
2275 | |||
2276 | /* we are restarting association process | ||
2277 | * clear RXON_FILTER_ASSOC_MSK bit | ||
2278 | */ | ||
2279 | if (priv->iw_mode != NL80211_IFTYPE_AP) { | ||
2280 | iwl_scan_cancel_timeout(priv, 100); | ||
2281 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
2282 | iwlcore_commit_rxon(priv); | ||
2283 | } | ||
2284 | |||
2285 | iwl_power_update_mode(priv, 0); | ||
2286 | |||
2287 | /* Per mac80211.h: This is only used in IBSS mode... */ | ||
2288 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { | ||
2289 | |||
2290 | /* switch to CAM during association period. | ||
2291 | * the ucode will block any association/authentication | ||
2292 | * frome during assiciation period if it can not hear | ||
2293 | * the AP because of PM. the timer enable PM back is | ||
2294 | * association do not complete | ||
2295 | */ | ||
2296 | if (priv->hw->conf.channel->flags & (IEEE80211_CHAN_PASSIVE_SCAN | | ||
2297 | IEEE80211_CHAN_RADAR)) | ||
2298 | iwl_power_disable_management(priv, 3000); | ||
2299 | |||
2300 | IWL_DEBUG_MAC80211(priv, "leave - not in IBSS\n"); | ||
2301 | mutex_unlock(&priv->mutex); | ||
2302 | return; | ||
2303 | } | ||
2304 | |||
2305 | iwl_set_rate(priv); | ||
2306 | |||
2307 | mutex_unlock(&priv->mutex); | ||
2308 | |||
2309 | IWL_DEBUG_MAC80211(priv, "leave\n"); | ||
2310 | } | ||
2311 | |||
2312 | |||
2313 | /***************************************************************************** | 2238 | /***************************************************************************** |
2314 | * | 2239 | * |
2315 | * sysfs attributes | 2240 | * sysfs attributes |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c index 144630b25491..c523cc339eaf 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.c +++ b/drivers/net/wireless/iwlwifi/iwl-core.c | |||
@@ -2715,6 +2715,81 @@ int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, | |||
2715 | } | 2715 | } |
2716 | EXPORT_SYMBOL(iwl_mac_get_tx_stats); | 2716 | EXPORT_SYMBOL(iwl_mac_get_tx_stats); |
2717 | 2717 | ||
2718 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw) | ||
2719 | { | ||
2720 | struct iwl_priv *priv = hw->priv; | ||
2721 | unsigned long flags; | ||
2722 | |||
2723 | mutex_lock(&priv->mutex); | ||
2724 | IWL_DEBUG_MAC80211(priv, "enter\n"); | ||
2725 | |||
2726 | spin_lock_irqsave(&priv->lock, flags); | ||
2727 | memset(&priv->current_ht_config, 0, sizeof(struct iwl_ht_info)); | ||
2728 | spin_unlock_irqrestore(&priv->lock, flags); | ||
2729 | |||
2730 | iwl_reset_qos(priv); | ||
2731 | |||
2732 | spin_lock_irqsave(&priv->lock, flags); | ||
2733 | priv->assoc_id = 0; | ||
2734 | priv->assoc_capability = 0; | ||
2735 | priv->assoc_station_added = 0; | ||
2736 | |||
2737 | /* new association get rid of ibss beacon skb */ | ||
2738 | if (priv->ibss_beacon) | ||
2739 | dev_kfree_skb(priv->ibss_beacon); | ||
2740 | |||
2741 | priv->ibss_beacon = NULL; | ||
2742 | |||
2743 | priv->beacon_int = priv->hw->conf.beacon_int; | ||
2744 | priv->timestamp = 0; | ||
2745 | if ((priv->iw_mode == NL80211_IFTYPE_STATION)) | ||
2746 | priv->beacon_int = 0; | ||
2747 | |||
2748 | spin_unlock_irqrestore(&priv->lock, flags); | ||
2749 | |||
2750 | if (!iwl_is_ready_rf(priv)) { | ||
2751 | IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); | ||
2752 | mutex_unlock(&priv->mutex); | ||
2753 | return; | ||
2754 | } | ||
2755 | |||
2756 | /* we are restarting association process | ||
2757 | * clear RXON_FILTER_ASSOC_MSK bit | ||
2758 | */ | ||
2759 | if (priv->iw_mode != NL80211_IFTYPE_AP) { | ||
2760 | iwl_scan_cancel_timeout(priv, 100); | ||
2761 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
2762 | iwlcore_commit_rxon(priv); | ||
2763 | } | ||
2764 | |||
2765 | iwl_power_update_mode(priv, 0); | ||
2766 | |||
2767 | /* Per mac80211.h: This is only used in IBSS mode... */ | ||
2768 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { | ||
2769 | |||
2770 | /* switch to CAM during association period. | ||
2771 | * the ucode will block any association/authentication | ||
2772 | * frome during assiciation period if it can not hear | ||
2773 | * the AP because of PM. the timer enable PM back is | ||
2774 | * association do not complete | ||
2775 | */ | ||
2776 | if (priv->hw->conf.channel->flags & | ||
2777 | (IEEE80211_CHAN_PASSIVE_SCAN | IEEE80211_CHAN_RADAR)) | ||
2778 | iwl_power_disable_management(priv, 3000); | ||
2779 | |||
2780 | IWL_DEBUG_MAC80211(priv, "leave - not in IBSS\n"); | ||
2781 | mutex_unlock(&priv->mutex); | ||
2782 | return; | ||
2783 | } | ||
2784 | |||
2785 | iwl_set_rate(priv); | ||
2786 | |||
2787 | mutex_unlock(&priv->mutex); | ||
2788 | |||
2789 | IWL_DEBUG_MAC80211(priv, "leave\n"); | ||
2790 | } | ||
2791 | EXPORT_SYMBOL(iwl_mac_reset_tsf); | ||
2792 | |||
2718 | #ifdef CONFIG_PM | 2793 | #ifdef CONFIG_PM |
2719 | 2794 | ||
2720 | int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) | 2795 | int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 7e0d0ed0a5db..df90c261b6b5 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -286,6 +286,7 @@ int iwl_mac_config_interface(struct ieee80211_hw *hw, | |||
286 | struct ieee80211_if_conf *conf); | 286 | struct ieee80211_if_conf *conf); |
287 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, | 287 | int iwl_mac_get_tx_stats(struct ieee80211_hw *hw, |
288 | struct ieee80211_tx_queue_stats *stats); | 288 | struct ieee80211_tx_queue_stats *stats); |
289 | void iwl_mac_reset_tsf(struct ieee80211_hw *hw); | ||
289 | 290 | ||
290 | /***************************************************** | 291 | /***************************************************** |
291 | * RX handlers. | 292 | * RX handlers. |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 07883b264b7e..ed497551a860 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -3494,64 +3494,6 @@ static int iwl3945_mac_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, | |||
3494 | return ret; | 3494 | return ret; |
3495 | } | 3495 | } |
3496 | 3496 | ||
3497 | static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw) | ||
3498 | { | ||
3499 | struct iwl_priv *priv = hw->priv; | ||
3500 | unsigned long flags; | ||
3501 | |||
3502 | mutex_lock(&priv->mutex); | ||
3503 | IWL_DEBUG_MAC80211(priv, "enter\n"); | ||
3504 | |||
3505 | iwl_reset_qos(priv); | ||
3506 | |||
3507 | spin_lock_irqsave(&priv->lock, flags); | ||
3508 | priv->assoc_id = 0; | ||
3509 | priv->assoc_capability = 0; | ||
3510 | |||
3511 | /* new association get rid of ibss beacon skb */ | ||
3512 | if (priv->ibss_beacon) | ||
3513 | dev_kfree_skb(priv->ibss_beacon); | ||
3514 | |||
3515 | priv->ibss_beacon = NULL; | ||
3516 | |||
3517 | priv->beacon_int = priv->hw->conf.beacon_int; | ||
3518 | priv->timestamp = 0; | ||
3519 | if ((priv->iw_mode == NL80211_IFTYPE_STATION)) | ||
3520 | priv->beacon_int = 0; | ||
3521 | |||
3522 | spin_unlock_irqrestore(&priv->lock, flags); | ||
3523 | |||
3524 | if (!iwl_is_ready_rf(priv)) { | ||
3525 | IWL_DEBUG_MAC80211(priv, "leave - not ready\n"); | ||
3526 | mutex_unlock(&priv->mutex); | ||
3527 | return; | ||
3528 | } | ||
3529 | |||
3530 | /* we are restarting association process | ||
3531 | * clear RXON_FILTER_ASSOC_MSK bit | ||
3532 | */ | ||
3533 | if (priv->iw_mode != NL80211_IFTYPE_AP) { | ||
3534 | iwl_scan_cancel_timeout(priv, 100); | ||
3535 | priv->staging_rxon.filter_flags &= ~RXON_FILTER_ASSOC_MSK; | ||
3536 | iwlcore_commit_rxon(priv); | ||
3537 | } | ||
3538 | |||
3539 | /* Per mac80211.h: This is only used in IBSS mode... */ | ||
3540 | if (priv->iw_mode != NL80211_IFTYPE_ADHOC) { | ||
3541 | |||
3542 | IWL_DEBUG_MAC80211(priv, "leave - not in IBSS\n"); | ||
3543 | mutex_unlock(&priv->mutex); | ||
3544 | return; | ||
3545 | } | ||
3546 | |||
3547 | iwl_set_rate(priv); | ||
3548 | |||
3549 | mutex_unlock(&priv->mutex); | ||
3550 | |||
3551 | IWL_DEBUG_MAC80211(priv, "leave\n"); | ||
3552 | |||
3553 | } | ||
3554 | |||
3555 | /***************************************************************************** | 3497 | /***************************************************************************** |
3556 | * | 3498 | * |
3557 | * sysfs attributes | 3499 | * sysfs attributes |
@@ -4083,7 +4025,7 @@ static struct ieee80211_ops iwl3945_hw_ops = { | |||
4083 | .set_key = iwl3945_mac_set_key, | 4025 | .set_key = iwl3945_mac_set_key, |
4084 | .get_tx_stats = iwl_mac_get_tx_stats, | 4026 | .get_tx_stats = iwl_mac_get_tx_stats, |
4085 | .conf_tx = iwl_mac_conf_tx, | 4027 | .conf_tx = iwl_mac_conf_tx, |
4086 | .reset_tsf = iwl3945_mac_reset_tsf, | 4028 | .reset_tsf = iwl_mac_reset_tsf, |
4087 | .bss_info_changed = iwl_bss_info_changed, | 4029 | .bss_info_changed = iwl_bss_info_changed, |
4088 | .hw_scan = iwl_mac_hw_scan | 4030 | .hw_scan = iwl_mac_hw_scan |
4089 | }; | 4031 | }; |