aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwl8k.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r--drivers/net/wireless/mwl8k.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index a263d5c84c08..83967afe0821 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -261,7 +261,7 @@ struct mwl8k_vif {
261 */ 261 */
262}; 262};
263 263
264#define MWL8K_VIF(_vif) (struct mwl8k_vif *)(&((_vif)->drv_priv)) 264#define MWL8K_VIF(_vif) ((struct mwl8k_vif *)&((_vif)->drv_priv))
265 265
266static const struct ieee80211_channel mwl8k_channels[] = { 266static const struct ieee80211_channel mwl8k_channels[] = {
267 { .center_freq = 2412, .hw_value = 1, }, 267 { .center_freq = 2412, .hw_value = 1, },
@@ -1012,6 +1012,8 @@ static int rxq_process(struct ieee80211_hw *hw, int index, int limit)
1012 rmb(); 1012 rmb();
1013 1013
1014 skb = rxq->rx_skb[rxq->rx_head]; 1014 skb = rxq->rx_skb[rxq->rx_head];
1015 if (skb == NULL)
1016 break;
1015 rxq->rx_skb[rxq->rx_head] = NULL; 1017 rxq->rx_skb[rxq->rx_head] = NULL;
1016 1018
1017 rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS; 1019 rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS;
@@ -1591,6 +1593,9 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1591 timeout = wait_for_completion_timeout(&cmd_wait, 1593 timeout = wait_for_completion_timeout(&cmd_wait,
1592 msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS)); 1594 msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS));
1593 1595
1596 pci_unmap_single(priv->pdev, dma_addr, dma_size,
1597 PCI_DMA_BIDIRECTIONAL);
1598
1594 result = &cmd->result; 1599 result = &cmd->result;
1595 if (!timeout) { 1600 if (!timeout) {
1596 spin_lock_irq(&priv->fw_lock); 1601 spin_lock_irq(&priv->fw_lock);
@@ -1610,8 +1615,6 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1610 *result); 1615 *result);
1611 } 1616 }
1612 1617
1613 pci_unmap_single(priv->pdev, dma_addr, dma_size,
1614 PCI_DMA_BIDIRECTIONAL);
1615 return rc; 1618 return rc;
1616} 1619}
1617 1620
@@ -1654,18 +1657,18 @@ static int mwl8k_cmd_get_hw_spec(struct ieee80211_hw *hw)
1654 memset(cmd->perm_addr, 0xff, sizeof(cmd->perm_addr)); 1657 memset(cmd->perm_addr, 0xff, sizeof(cmd->perm_addr));
1655 cmd->ps_cookie = cpu_to_le32(priv->cookie_dma); 1658 cmd->ps_cookie = cpu_to_le32(priv->cookie_dma);
1656 cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rx_desc_dma); 1659 cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rx_desc_dma);
1657 cmd->num_tx_queues = MWL8K_TX_QUEUES; 1660 cmd->num_tx_queues = cpu_to_le32(MWL8K_TX_QUEUES);
1658 for (i = 0; i < MWL8K_TX_QUEUES; i++) 1661 for (i = 0; i < MWL8K_TX_QUEUES; i++)
1659 cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].tx_desc_dma); 1662 cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].tx_desc_dma);
1660 cmd->num_tx_desc_per_queue = MWL8K_TX_DESCS; 1663 cmd->num_tx_desc_per_queue = cpu_to_le32(MWL8K_TX_DESCS);
1661 cmd->total_rx_desc = MWL8K_RX_DESCS; 1664 cmd->total_rx_desc = cpu_to_le32(MWL8K_RX_DESCS);
1662 1665
1663 rc = mwl8k_post_cmd(hw, &cmd->header); 1666 rc = mwl8k_post_cmd(hw, &cmd->header);
1664 1667
1665 if (!rc) { 1668 if (!rc) {
1666 SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr); 1669 SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr);
1667 priv->num_mcaddrs = le16_to_cpu(cmd->num_mcaddrs); 1670 priv->num_mcaddrs = le16_to_cpu(cmd->num_mcaddrs);
1668 priv->fw_rev = cmd->fw_rev; 1671 priv->fw_rev = le32_to_cpu(cmd->fw_rev);
1669 priv->hw_rev = cmd->hw_rev; 1672 priv->hw_rev = cmd->hw_rev;
1670 priv->region_code = le16_to_cpu(cmd->region_code); 1673 priv->region_code = le16_to_cpu(cmd->region_code);
1671 } 1674 }
@@ -3216,15 +3219,19 @@ static int mwl8k_configure_filter_wt(struct work_struct *wt)
3216 struct dev_addr_list *mclist = worker->mclist; 3219 struct dev_addr_list *mclist = worker->mclist;
3217 3220
3218 struct mwl8k_priv *priv = hw->priv; 3221 struct mwl8k_priv *priv = hw->priv;
3219 struct mwl8k_vif *mv_vif;
3220 int rc = 0; 3222 int rc = 0;
3221 3223
3222 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { 3224 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
3223 if (*total_flags & FIF_BCN_PRBRESP_PROMISC) 3225 if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
3224 rc = mwl8k_cmd_set_pre_scan(hw); 3226 rc = mwl8k_cmd_set_pre_scan(hw);
3225 else { 3227 else {
3226 mv_vif = MWL8K_VIF(priv->vif); 3228 u8 *bssid;
3227 rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid); 3229
3230 bssid = "\x00\x00\x00\x00\x00\x00";
3231 if (priv->vif != NULL)
3232 bssid = MWL8K_VIF(priv->vif)->bssid;
3233
3234 rc = mwl8k_cmd_set_post_scan(hw, bssid);
3228 } 3235 }
3229 } 3236 }
3230 3237
@@ -3726,6 +3733,8 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev)
3726 3733
3727 ieee80211_stop_queues(hw); 3734 ieee80211_stop_queues(hw);
3728 3735
3736 ieee80211_unregister_hw(hw);
3737
3729 /* Remove tx reclaim tasklet */ 3738 /* Remove tx reclaim tasklet */
3730 tasklet_kill(&priv->tx_reclaim_task); 3739 tasklet_kill(&priv->tx_reclaim_task);
3731 3740
@@ -3739,8 +3748,6 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev)
3739 for (i = 0; i < MWL8K_TX_QUEUES; i++) 3748 for (i = 0; i < MWL8K_TX_QUEUES; i++)
3740 mwl8k_txq_reclaim(hw, i, 1); 3749 mwl8k_txq_reclaim(hw, i, 1);
3741 3750
3742 ieee80211_unregister_hw(hw);
3743
3744 for (i = 0; i < MWL8K_TX_QUEUES; i++) 3751 for (i = 0; i < MWL8K_TX_QUEUES; i++)
3745 mwl8k_txq_deinit(hw, i); 3752 mwl8k_txq_deinit(hw, i);
3746 3753