aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-3945.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-10-09 17:40:09 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-09 17:40:09 -0400
commit8aa0f64ac3835a6daf84d0b0e07c4c01d7d8eddc (patch)
treee5e6cc8637a44354997624f26d4d55834c9915b4 /drivers/net/wireless/iwlwifi/iwl-3945.c
parentcd7e1f0b056c071860db65c847a854b3093d6606 (diff)
parenteab2ec83dbf0e32e28f3108f302ffdaa225d4cce (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-3945.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c65
1 files changed, 14 insertions, 51 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index e70c5b0af364..ced0e33e44b2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -46,7 +46,8 @@
46#include "iwl-eeprom.h" 46#include "iwl-eeprom.h"
47#include "iwl-helpers.h" 47#include "iwl-helpers.h"
48#include "iwl-core.h" 48#include "iwl-core.h"
49#include "iwl-agn-rs.h" 49#include "iwl-led.h"
50#include "iwl-3945-led.h"
50 51
51#define IWL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \ 52#define IWL_DECLARE_RATE_INFO(r, ip, in, rp, rn, pp, np) \
52 [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \ 53 [IWL_RATE_##r##M_INDEX] = { IWL_RATE_##r##M_PLCP, \
@@ -359,7 +360,7 @@ void iwl3945_hw_rx_statistics(struct iwl_priv *priv,
359 360
360 memcpy(&priv->statistics_39, pkt->u.raw, sizeof(priv->statistics_39)); 361 memcpy(&priv->statistics_39, pkt->u.raw, sizeof(priv->statistics_39));
361 362
362 iwl3945_led_background(priv); 363 iwl_leds_background(priv);
363 364
364 priv->last_statistics_time = jiffies; 365 priv->last_statistics_time = jiffies;
365} 366}
@@ -572,10 +573,6 @@ static void iwl3945_pass_packet_to_mac80211(struct iwl_priv *priv,
572 (struct ieee80211_hdr *)rxb->skb->data, 573 (struct ieee80211_hdr *)rxb->skb->data,
573 le32_to_cpu(rx_end->status), stats); 574 le32_to_cpu(rx_end->status), stats);
574 575
575#ifdef CONFIG_IWLWIFI_LEDS
576 if (ieee80211_is_data(hdr->frame_control))
577 priv->rxtxpackets += len;
578#endif
579 iwl_update_stats(priv, false, hdr->frame_control, len); 576 iwl_update_stats(priv, false, hdr->frame_control, len);
580 577
581 memcpy(IEEE80211_SKB_RXCB(rxb->skb), stats, sizeof(*stats)); 578 memcpy(IEEE80211_SKB_RXCB(rxb->skb), stats, sizeof(*stats));
@@ -1002,8 +999,9 @@ static int iwl3945_apm_init(struct iwl_priv *priv)
1002 * D0U* --> D0A* state */ 999 * D0U* --> D0A* state */
1003 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 1000 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
1004 1001
1005 ret = iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 1002 ret = iwl_poll_bit(priv, CSR_GP_CNTRL,
1006 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 1003 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
1004 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
1007 if (ret < 0) { 1005 if (ret < 0) {
1008 IWL_DEBUG_INFO(priv, "Failed to init the card\n"); 1006 IWL_DEBUG_INFO(priv, "Failed to init the card\n");
1009 goto out; 1007 goto out;
@@ -1170,48 +1168,9 @@ void iwl3945_hw_txq_ctx_stop(struct iwl_priv *priv)
1170 iwl3945_hw_txq_ctx_free(priv); 1168 iwl3945_hw_txq_ctx_free(priv);
1171} 1169}
1172 1170
1173static int iwl3945_apm_stop_master(struct iwl_priv *priv)
1174{
1175 int ret = 0;
1176 unsigned long flags;
1177
1178 spin_lock_irqsave(&priv->lock, flags);
1179
1180 /* set stop master bit */
1181 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_STOP_MASTER);
1182
1183 iwl_poll_direct_bit(priv, CSR_RESET,
1184 CSR_RESET_REG_FLAG_MASTER_DISABLED, 100);
1185
1186 if (ret < 0)
1187 goto out;
1188
1189out:
1190 spin_unlock_irqrestore(&priv->lock, flags);
1191 IWL_DEBUG_INFO(priv, "stop master\n");
1192
1193 return ret;
1194}
1195
1196static void iwl3945_apm_stop(struct iwl_priv *priv)
1197{
1198 unsigned long flags;
1199
1200 iwl3945_apm_stop_master(priv);
1201
1202 spin_lock_irqsave(&priv->lock, flags);
1203
1204 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
1205
1206 udelay(10);
1207 /* clear "init complete" move adapter D0A* --> D0U state */
1208 iwl_clear_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
1209 spin_unlock_irqrestore(&priv->lock, flags);
1210}
1211
1212static int iwl3945_apm_reset(struct iwl_priv *priv) 1171static int iwl3945_apm_reset(struct iwl_priv *priv)
1213{ 1172{
1214 iwl3945_apm_stop_master(priv); 1173 iwl_apm_stop_master(priv);
1215 1174
1216 1175
1217 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET); 1176 iwl_set_bit(priv, CSR_RESET, CSR_RESET_REG_FLAG_SW_RESET);
@@ -1219,8 +1178,9 @@ static int iwl3945_apm_reset(struct iwl_priv *priv)
1219 1178
1220 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE); 1179 iwl_set_bit(priv, CSR_GP_CNTRL, CSR_GP_CNTRL_REG_FLAG_INIT_DONE);
1221 1180
1222 iwl_poll_direct_bit(priv, CSR_GP_CNTRL, 1181 iwl_poll_bit(priv, CSR_GP_CNTRL,
1223 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000); 1182 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY,
1183 CSR_GP_CNTRL_REG_FLAG_MAC_CLOCK_READY, 25000);
1224 1184
1225 iwl_write_prph(priv, APMG_CLK_CTRL_REG, 1185 iwl_write_prph(priv, APMG_CLK_CTRL_REG,
1226 APMG_CLK_VAL_BSM_CLK_RQT); 1186 APMG_CLK_VAL_BSM_CLK_RQT);
@@ -2844,7 +2804,7 @@ static struct iwl_lib_ops iwl3945_lib = {
2844 .apm_ops = { 2804 .apm_ops = {
2845 .init = iwl3945_apm_init, 2805 .init = iwl3945_apm_init,
2846 .reset = iwl3945_apm_reset, 2806 .reset = iwl3945_apm_reset,
2847 .stop = iwl3945_apm_stop, 2807 .stop = iwl_apm_stop,
2848 .config = iwl3945_nic_config, 2808 .config = iwl3945_nic_config,
2849 .set_pwr_src = iwl3945_set_pwr_src, 2809 .set_pwr_src = iwl3945_set_pwr_src,
2850 }, 2810 },
@@ -2880,6 +2840,7 @@ static struct iwl_ops iwl3945_ops = {
2880 .lib = &iwl3945_lib, 2840 .lib = &iwl3945_lib,
2881 .hcmd = &iwl3945_hcmd, 2841 .hcmd = &iwl3945_hcmd,
2882 .utils = &iwl3945_hcmd_utils, 2842 .utils = &iwl3945_hcmd_utils,
2843 .led = &iwl3945_led_ops,
2883}; 2844};
2884 2845
2885static struct iwl_cfg iwl3945_bg_cfg = { 2846static struct iwl_cfg iwl3945_bg_cfg = {
@@ -2894,6 +2855,7 @@ static struct iwl_cfg iwl3945_bg_cfg = {
2894 .mod_params = &iwl3945_mod_params, 2855 .mod_params = &iwl3945_mod_params,
2895 .use_isr_legacy = true, 2856 .use_isr_legacy = true,
2896 .ht_greenfield_support = false, 2857 .ht_greenfield_support = false,
2858 .led_compensation = 64,
2897}; 2859};
2898 2860
2899static struct iwl_cfg iwl3945_abg_cfg = { 2861static struct iwl_cfg iwl3945_abg_cfg = {
@@ -2908,6 +2870,7 @@ static struct iwl_cfg iwl3945_abg_cfg = {
2908 .mod_params = &iwl3945_mod_params, 2870 .mod_params = &iwl3945_mod_params,
2909 .use_isr_legacy = true, 2871 .use_isr_legacy = true,
2910 .ht_greenfield_support = false, 2872 .ht_greenfield_support = false,
2873 .led_compensation = 64,
2911}; 2874};
2912 2875
2913struct pci_device_id iwl3945_hw_card_ids[] = { 2876struct pci_device_id iwl3945_hw_card_ids[] = {