aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-04-08 14:26:36 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:54:41 -0400
commit9944b938f23fdd1ce2f5da190f771f176bb51eef (patch)
tree3acb05a6b64fcf129bcb6fd6b3e443c218627831 /drivers
parent5bbe233b9bafabc08a5404d54b9fa086e8390fc7 (diff)
iwl3945: use iwl_mac_beacon_update
3945 can use iwl_mac_beacon_update. 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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c43
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c41
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c49
4 files changed, 44 insertions, 90 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index d14146fa751f..124a477ebd99 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1443,10 +1443,6 @@ static int iwl_read_ucode(struct iwl_priv *priv)
1443 return ret; 1443 return ret;
1444} 1444}
1445 1445
1446/* temporary */
1447static int iwl_mac_beacon_update(struct ieee80211_hw *hw,
1448 struct sk_buff *skb);
1449
1450/** 1446/**
1451 * iwl_alive_start - called after REPLY_ALIVE notification received 1447 * iwl_alive_start - called after REPLY_ALIVE notification received
1452 * from protocol/runtime uCode (initialization uCode's 1448 * from protocol/runtime uCode (initialization uCode's
@@ -2657,45 +2653,6 @@ static void iwl_mac_reset_tsf(struct ieee80211_hw *hw)
2657 IWL_DEBUG_MAC80211(priv, "leave\n"); 2653 IWL_DEBUG_MAC80211(priv, "leave\n");
2658} 2654}
2659 2655
2660static int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
2661{
2662 struct iwl_priv *priv = hw->priv;
2663 unsigned long flags;
2664 __le64 timestamp;
2665
2666 IWL_DEBUG_MAC80211(priv, "enter\n");
2667
2668 if (!iwl_is_ready_rf(priv)) {
2669 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
2670 return -EIO;
2671 }
2672
2673 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
2674 IWL_DEBUG_MAC80211(priv, "leave - not IBSS\n");
2675 return -EIO;
2676 }
2677
2678 spin_lock_irqsave(&priv->lock, flags);
2679
2680 if (priv->ibss_beacon)
2681 dev_kfree_skb(priv->ibss_beacon);
2682
2683 priv->ibss_beacon = skb;
2684
2685 priv->assoc_id = 0;
2686 timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
2687 priv->timestamp = le64_to_cpu(timestamp);
2688
2689 IWL_DEBUG_MAC80211(priv, "leave\n");
2690 spin_unlock_irqrestore(&priv->lock, flags);
2691
2692 iwl_reset_qos(priv);
2693
2694 priv->cfg->ops->lib->post_associate(priv);
2695
2696
2697 return 0;
2698}
2699 2656
2700/***************************************************************************** 2657/*****************************************************************************
2701 * 2658 *
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 15691829e023..eaeeb4dae0ed 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -2293,6 +2293,47 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
2293} 2293}
2294EXPORT_SYMBOL(iwl_bss_info_changed); 2294EXPORT_SYMBOL(iwl_bss_info_changed);
2295 2295
2296int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
2297{
2298 struct iwl_priv *priv = hw->priv;
2299 unsigned long flags;
2300 __le64 timestamp;
2301
2302 IWL_DEBUG_MAC80211(priv, "enter\n");
2303
2304 if (!iwl_is_ready_rf(priv)) {
2305 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
2306 return -EIO;
2307 }
2308
2309 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
2310 IWL_DEBUG_MAC80211(priv, "leave - not IBSS\n");
2311 return -EIO;
2312 }
2313
2314 spin_lock_irqsave(&priv->lock, flags);
2315
2316 if (priv->ibss_beacon)
2317 dev_kfree_skb(priv->ibss_beacon);
2318
2319 priv->ibss_beacon = skb;
2320
2321 priv->assoc_id = 0;
2322 timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
2323 priv->timestamp = le64_to_cpu(timestamp);
2324
2325 IWL_DEBUG_MAC80211(priv, "leave\n");
2326 spin_unlock_irqrestore(&priv->lock, flags);
2327
2328 iwl_reset_qos(priv);
2329
2330 priv->cfg->ops->lib->post_associate(priv);
2331
2332
2333 return 0;
2334}
2335EXPORT_SYMBOL(iwl_mac_beacon_update);
2336
2296#ifdef CONFIG_PM 2337#ifdef CONFIG_PM
2297 2338
2298int iwl_pci_suspend(struct pci_dev *pdev, pm_message_t state) 2339int 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 4ad8465ae5fb..04473858b9b5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -258,6 +258,7 @@ void iwl_bss_info_changed(struct ieee80211_hw *hw,
258 struct ieee80211_vif *vif, 258 struct ieee80211_vif *vif,
259 struct ieee80211_bss_conf *bss_conf, 259 struct ieee80211_bss_conf *bss_conf,
260 u32 changes); 260 u32 changes);
261int iwl_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb);
261 262
262/***************************************************** 263/*****************************************************
263 * RX handlers. 264 * RX handlers.
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 6f44abc2dce0..857393a69016 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -2792,11 +2792,6 @@ static void iwl3945_init_alive_start(struct iwl_priv *priv)
2792 queue_work(priv->workqueue, &priv->restart); 2792 queue_work(priv->workqueue, &priv->restart);
2793} 2793}
2794 2794
2795
2796/* temporary */
2797static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw,
2798 struct sk_buff *skb);
2799
2800/** 2795/**
2801 * iwl3945_alive_start - called after REPLY_ALIVE notification received 2796 * iwl3945_alive_start - called after REPLY_ALIVE notification received
2802 * from protocol/runtime uCode (initialization uCode's 2797 * from protocol/runtime uCode (initialization uCode's
@@ -2904,7 +2899,7 @@ static void iwl3945_alive_start(struct iwl_priv *priv)
2904 struct sk_buff *beacon = ieee80211_beacon_get(priv->hw, 2899 struct sk_buff *beacon = ieee80211_beacon_get(priv->hw,
2905 priv->vif); 2900 priv->vif);
2906 if (beacon) 2901 if (beacon)
2907 iwl3945_mac_beacon_update(priv->hw, beacon); 2902 iwl_mac_beacon_update(priv->hw, beacon);
2908 } 2903 }
2909 2904
2910 return; 2905 return;
@@ -3837,7 +3832,7 @@ static int iwl3945_mac_config_interface(struct ieee80211_hw *hw,
3837 if (!beacon) 3832 if (!beacon)
3838 return -ENOMEM; 3833 return -ENOMEM;
3839 mutex_lock(&priv->mutex); 3834 mutex_lock(&priv->mutex);
3840 rc = iwl3945_mac_beacon_update(hw, beacon); 3835 rc = iwl_mac_beacon_update(hw, beacon);
3841 mutex_unlock(&priv->mutex); 3836 mutex_unlock(&priv->mutex);
3842 if (rc) 3837 if (rc)
3843 return rc; 3838 return rc;
@@ -4089,46 +4084,6 @@ static void iwl3945_mac_reset_tsf(struct ieee80211_hw *hw)
4089 4084
4090} 4085}
4091 4086
4092static int iwl3945_mac_beacon_update(struct ieee80211_hw *hw, struct sk_buff *skb)
4093{
4094 struct iwl_priv *priv = hw->priv;
4095 unsigned long flags;
4096 __le64 timestamp;
4097
4098 IWL_DEBUG_MAC80211(priv, "enter\n");
4099
4100 if (!iwl_is_ready_rf(priv)) {
4101 IWL_DEBUG_MAC80211(priv, "leave - RF not ready\n");
4102 return -EIO;
4103 }
4104
4105 if (priv->iw_mode != NL80211_IFTYPE_ADHOC) {
4106 IWL_DEBUG_MAC80211(priv, "leave - not IBSS\n");
4107 return -EIO;
4108 }
4109
4110 spin_lock_irqsave(&priv->lock, flags);
4111
4112 if (priv->ibss_beacon)
4113 dev_kfree_skb(priv->ibss_beacon);
4114
4115 priv->ibss_beacon = skb;
4116
4117 priv->assoc_id = 0;
4118 timestamp = ((struct ieee80211_mgmt *)skb->data)->u.beacon.timestamp;
4119 priv->timestamp = le64_to_cpu(timestamp);
4120
4121 IWL_DEBUG_MAC80211(priv, "leave\n");
4122 spin_unlock_irqrestore(&priv->lock, flags);
4123
4124 iwl_reset_qos(priv);
4125
4126 priv->cfg->ops->lib->post_associate(priv);
4127
4128
4129 return 0;
4130}
4131
4132/***************************************************************************** 4087/*****************************************************************************
4133 * 4088 *
4134 * sysfs attributes 4089 * sysfs attributes