aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c66
1 files changed, 42 insertions, 24 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 60bfde75ce8..cdeb09eee73 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -59,7 +59,6 @@
59#include "iwl-sta.h" 59#include "iwl-sta.h"
60#include "iwl-agn-calib.h" 60#include "iwl-agn-calib.h"
61#include "iwl-agn.h" 61#include "iwl-agn.h"
62#include "iwl-agn-led.h"
63 62
64 63
65/****************************************************************************** 64/******************************************************************************
@@ -254,6 +253,10 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
254 struct iwl_frame *frame; 253 struct iwl_frame *frame;
255 unsigned int frame_size; 254 unsigned int frame_size;
256 int rc; 255 int rc;
256 struct iwl_host_cmd cmd = {
257 .id = REPLY_TX_BEACON,
258 .flags = CMD_SIZE_HUGE,
259 };
257 260
258 frame = iwl_get_free_frame(priv); 261 frame = iwl_get_free_frame(priv);
259 if (!frame) { 262 if (!frame) {
@@ -269,8 +272,10 @@ int iwlagn_send_beacon_cmd(struct iwl_priv *priv)
269 return -EINVAL; 272 return -EINVAL;
270 } 273 }
271 274
272 rc = iwl_send_cmd_pdu(priv, REPLY_TX_BEACON, frame_size, 275 cmd.len = frame_size;
273 &frame->u.cmd[0]); 276 cmd.data = &frame->u.cmd[0];
277
278 rc = iwl_send_cmd_sync(priv, &cmd);
274 279
275 iwl_free_frame(priv, frame); 280 iwl_free_frame(priv, frame);
276 281
@@ -395,7 +400,9 @@ int iwl_hw_txq_attach_buf_to_tfd(struct iwl_priv *priv,
395 return -EINVAL; 400 return -EINVAL;
396 } 401 }
397 402
398 BUG_ON(addr & ~DMA_BIT_MASK(36)); 403 if (WARN_ON(addr & ~DMA_BIT_MASK(36)))
404 return -EINVAL;
405
399 if (unlikely(addr & ~IWL_TX_DMA_MASK)) 406 if (unlikely(addr & ~IWL_TX_DMA_MASK))
400 IWL_ERR(priv, "Unaligned address = %llx\n", 407 IWL_ERR(priv, "Unaligned address = %llx\n",
401 (unsigned long long)addr); 408 (unsigned long long)addr);
@@ -719,7 +726,10 @@ static void iwl_rx_handle(struct iwl_priv *priv)
719 /* If an RXB doesn't have a Rx queue slot associated with it, 726 /* If an RXB doesn't have a Rx queue slot associated with it,
720 * then a bug has been introduced in the queue refilling 727 * then a bug has been introduced in the queue refilling
721 * routines -- catch it here */ 728 * routines -- catch it here */
722 BUG_ON(rxb == NULL); 729 if (WARN_ON(rxb == NULL)) {
730 i = (i + 1) & RX_QUEUE_MASK;
731 continue;
732 }
723 733
724 rxq->queue[i] = NULL; 734 rxq->queue[i] = NULL;
725 735
@@ -1481,7 +1491,7 @@ static int iwlagn_load_firmware(struct iwl_priv *priv,
1481 le32_to_cpup((__le32 *)tlv_data); 1491 le32_to_cpup((__le32 *)tlv_data);
1482 break; 1492 break;
1483 default: 1493 default:
1484 IWL_WARN(priv, "unknown TLV: %d\n", tlv_type); 1494 IWL_DEBUG_INFO(priv, "unknown TLV: %d\n", tlv_type);
1485 break; 1495 break;
1486 } 1496 }
1487 } 1497 }
@@ -1705,10 +1715,6 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
1705 else 1715 else
1706 priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM; 1716 priv->cmd_queue = IWL_DEFAULT_CMD_QUEUE_NUM;
1707 1717
1708 if (ucode_capa.flags & IWL_UCODE_TLV_FLAGS_BTSTATS ||
1709 (priv->cfg->bt_params && priv->cfg->bt_params->bt_statistics))
1710 priv->bt_statistics = true;
1711
1712 /* Copy images into buffers for card's bus-master reads ... */ 1718 /* Copy images into buffers for card's bus-master reads ... */
1713 1719
1714 /* Runtime instructions (first block of data in file) */ 1720 /* Runtime instructions (first block of data in file) */
@@ -2626,17 +2632,8 @@ static void iwl_bg_run_time_calib_work(struct work_struct *work)
2626 } 2632 }
2627 2633
2628 if (priv->start_calib) { 2634 if (priv->start_calib) {
2629 if (iwl_bt_statistics(priv)) { 2635 iwl_chain_noise_calibration(priv);
2630 iwl_chain_noise_calibration(priv, 2636 iwl_sensitivity_calibration(priv);
2631 (void *)&priv->_agn.statistics_bt);
2632 iwl_sensitivity_calibration(priv,
2633 (void *)&priv->_agn.statistics_bt);
2634 } else {
2635 iwl_chain_noise_calibration(priv,
2636 (void *)&priv->_agn.statistics);
2637 iwl_sensitivity_calibration(priv,
2638 (void *)&priv->_agn.statistics);
2639 }
2640 } 2637 }
2641 2638
2642 mutex_unlock(&priv->mutex); 2639 mutex_unlock(&priv->mutex);
@@ -2828,9 +2825,8 @@ static int iwl_mac_setup_register(struct iwl_priv *priv,
2828 2825
2829 hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF; 2826 hw->max_tx_aggregation_subframes = LINK_QUAL_AGG_FRAME_LIMIT_DEF;
2830 2827
2831 if (!priv->cfg->base_params->broken_powersave) 2828 hw->flags |= IEEE80211_HW_SUPPORTS_PS |
2832 hw->flags |= IEEE80211_HW_SUPPORTS_PS | 2829 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
2833 IEEE80211_HW_SUPPORTS_DYNAMIC_PS;
2834 2830
2835 if (priv->cfg->sku & IWL_SKU_N) 2831 if (priv->cfg->sku & IWL_SKU_N)
2836 hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS | 2832 hw->flags |= IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
@@ -3732,6 +3728,28 @@ static const u8 iwlagn_pan_ac_to_queue[] = {
3732 7, 6, 5, 4, 3728 7, 6, 5, 4,
3733}; 3729};
3734 3730
3731/* This function both allocates and initializes hw and priv. */
3732static struct ieee80211_hw *iwl_alloc_all(struct iwl_cfg *cfg)
3733{
3734 struct iwl_priv *priv;
3735 /* mac80211 allocates memory for this device instance, including
3736 * space for this driver's private structure */
3737 struct ieee80211_hw *hw;
3738
3739 hw = ieee80211_alloc_hw(sizeof(struct iwl_priv), &iwlagn_hw_ops);
3740 if (hw == NULL) {
3741 pr_err("%s: Can not allocate network device\n",
3742 cfg->name);
3743 goto out;
3744 }
3745
3746 priv = hw->priv;
3747 priv->hw = hw;
3748
3749out:
3750 return hw;
3751}
3752
3735static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 3753static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3736{ 3754{
3737 int err = 0, i; 3755 int err = 0, i;