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.c42
1 files changed, 37 insertions, 5 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 47a4cda9eb72..cdeb09eee739 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
@@ -3718,6 +3728,28 @@ static const u8 iwlagn_pan_ac_to_queue[] = {
3718 7, 6, 5, 4, 3728 7, 6, 5, 4,
3719}; 3729};
3720 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
3721static 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)
3722{ 3754{
3723 int err = 0, i; 3755 int err = 0, i;