aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-rx.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index a2eb90d40b7e..cc61c937320f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -33,6 +33,7 @@
33#include "iwl-core.h" 33#include "iwl-core.h"
34#include "iwl-sta.h" 34#include "iwl-sta.h"
35#include "iwl-io.h" 35#include "iwl-io.h"
36#include "iwl-calib.h"
36#include "iwl-helpers.h" 37#include "iwl-helpers.h"
37/************************** RX-FUNCTIONS ****************************/ 38/************************** RX-FUNCTIONS ****************************/
38/* 39/*
@@ -420,3 +421,50 @@ int iwl_rx_init(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
420 return 0; 421 return 0;
421} 422}
422 423
424int iwl_rxq_stop(struct iwl_priv *priv)
425{
426 int ret;
427 unsigned long flags;
428
429 spin_lock_irqsave(&priv->lock, flags);
430 ret = iwl_grab_nic_access(priv);
431 if (unlikely(ret)) {
432 spin_unlock_irqrestore(&priv->lock, flags);
433 return ret;
434 }
435
436 /* stop Rx DMA */
437 iwl_write_direct32(priv, FH_MEM_RCSR_CHNL0_CONFIG_REG, 0);
438 ret = iwl_poll_direct_bit(priv, FH_MEM_RSSR_RX_STATUS_REG,
439 (1 << 24), 1000);
440 if (ret < 0)
441 IWL_ERROR("Can't stop Rx DMA.\n");
442
443 iwl_release_nic_access(priv);
444 spin_unlock_irqrestore(&priv->lock, flags);
445
446 return 0;
447}
448EXPORT_SYMBOL(iwl_rxq_stop);
449
450void iwl_rx_missed_beacon_notif(struct iwl_priv *priv,
451 struct iwl_rx_mem_buffer *rxb)
452
453{
454#ifdef CONFIG_IWLWIFI_RUN_TIME_CALIB
455 struct iwl_rx_packet *pkt = (struct iwl_rx_packet *)rxb->skb->data;
456 struct iwl4965_missed_beacon_notif *missed_beacon;
457
458 missed_beacon = &pkt->u.missed_beacon;
459 if (le32_to_cpu(missed_beacon->consequtive_missed_beacons) > 5) {
460 IWL_DEBUG_CALIB("missed bcn cnsq %d totl %d rcd %d expctd %d\n",
461 le32_to_cpu(missed_beacon->consequtive_missed_beacons),
462 le32_to_cpu(missed_beacon->total_missed_becons),
463 le32_to_cpu(missed_beacon->num_recvd_beacons),
464 le32_to_cpu(missed_beacon->num_expected_beacons));
465 if (!test_bit(STATUS_SCANNING, &priv->status))
466 iwl_init_sensitivity(priv);
467 }
468#endif /* CONFIG_IWLWIFI_RUN_TIME_CALIB */
469}
470EXPORT_SYMBOL(iwl_rx_missed_beacon_notif);