diff options
author | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-08-12 20:44:53 -0400 |
commit | aa11d958d1a6572eda08214d7c6a735804fe48a5 (patch) | |
tree | d025b05270ad1e010660d17eeadc6ac3c1abbd7d /drivers/net/wireless/mwl8k.c | |
parent | 07f6642ee9418e962e54cbc07471cfe2e559c568 (diff) | |
parent | 9799218ae36910af50f002a5db1802d576fffb43 (diff) |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
arch/microblaze/include/asm/socket.h
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index 4f725473fb73..8a6d3afe4122 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 | ||
266 | static const struct ieee80211_channel mwl8k_channels[] = { | 266 | static 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; |
@@ -1592,6 +1594,9 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) | |||
1592 | timeout = wait_for_completion_timeout(&cmd_wait, | 1594 | timeout = wait_for_completion_timeout(&cmd_wait, |
1593 | msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS)); | 1595 | msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS)); |
1594 | 1596 | ||
1597 | pci_unmap_single(priv->pdev, dma_addr, dma_size, | ||
1598 | PCI_DMA_BIDIRECTIONAL); | ||
1599 | |||
1595 | result = &cmd->result; | 1600 | result = &cmd->result; |
1596 | if (!timeout) { | 1601 | if (!timeout) { |
1597 | spin_lock_irq(&priv->fw_lock); | 1602 | spin_lock_irq(&priv->fw_lock); |
@@ -1611,8 +1616,6 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd) | |||
1611 | *result); | 1616 | *result); |
1612 | } | 1617 | } |
1613 | 1618 | ||
1614 | pci_unmap_single(priv->pdev, dma_addr, dma_size, | ||
1615 | PCI_DMA_BIDIRECTIONAL); | ||
1616 | return rc; | 1619 | return rc; |
1617 | } | 1620 | } |
1618 | 1621 | ||
@@ -1655,18 +1658,18 @@ static int mwl8k_cmd_get_hw_spec(struct ieee80211_hw *hw) | |||
1655 | memset(cmd->perm_addr, 0xff, sizeof(cmd->perm_addr)); | 1658 | memset(cmd->perm_addr, 0xff, sizeof(cmd->perm_addr)); |
1656 | cmd->ps_cookie = cpu_to_le32(priv->cookie_dma); | 1659 | cmd->ps_cookie = cpu_to_le32(priv->cookie_dma); |
1657 | cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rx_desc_dma); | 1660 | cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rx_desc_dma); |
1658 | cmd->num_tx_queues = MWL8K_TX_QUEUES; | 1661 | cmd->num_tx_queues = cpu_to_le32(MWL8K_TX_QUEUES); |
1659 | for (i = 0; i < MWL8K_TX_QUEUES; i++) | 1662 | for (i = 0; i < MWL8K_TX_QUEUES; i++) |
1660 | cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].tx_desc_dma); | 1663 | cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].tx_desc_dma); |
1661 | cmd->num_tx_desc_per_queue = MWL8K_TX_DESCS; | 1664 | cmd->num_tx_desc_per_queue = cpu_to_le32(MWL8K_TX_DESCS); |
1662 | cmd->total_rx_desc = MWL8K_RX_DESCS; | 1665 | cmd->total_rx_desc = cpu_to_le32(MWL8K_RX_DESCS); |
1663 | 1666 | ||
1664 | rc = mwl8k_post_cmd(hw, &cmd->header); | 1667 | rc = mwl8k_post_cmd(hw, &cmd->header); |
1665 | 1668 | ||
1666 | if (!rc) { | 1669 | if (!rc) { |
1667 | SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr); | 1670 | SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr); |
1668 | priv->num_mcaddrs = le16_to_cpu(cmd->num_mcaddrs); | 1671 | priv->num_mcaddrs = le16_to_cpu(cmd->num_mcaddrs); |
1669 | priv->fw_rev = cmd->fw_rev; | 1672 | priv->fw_rev = le32_to_cpu(cmd->fw_rev); |
1670 | priv->hw_rev = cmd->hw_rev; | 1673 | priv->hw_rev = cmd->hw_rev; |
1671 | priv->region_code = le16_to_cpu(cmd->region_code); | 1674 | priv->region_code = le16_to_cpu(cmd->region_code); |
1672 | } | 1675 | } |
@@ -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 | ||
@@ -3725,6 +3732,8 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev) | |||
3725 | 3732 | ||
3726 | ieee80211_stop_queues(hw); | 3733 | ieee80211_stop_queues(hw); |
3727 | 3734 | ||
3735 | ieee80211_unregister_hw(hw); | ||
3736 | |||
3728 | /* Remove tx reclaim tasklet */ | 3737 | /* Remove tx reclaim tasklet */ |
3729 | tasklet_kill(&priv->tx_reclaim_task); | 3738 | tasklet_kill(&priv->tx_reclaim_task); |
3730 | 3739 | ||
@@ -3738,8 +3747,6 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev) | |||
3738 | for (i = 0; i < MWL8K_TX_QUEUES; i++) | 3747 | for (i = 0; i < MWL8K_TX_QUEUES; i++) |
3739 | mwl8k_txq_reclaim(hw, i, 1); | 3748 | mwl8k_txq_reclaim(hw, i, 1); |
3740 | 3749 | ||
3741 | ieee80211_unregister_hw(hw); | ||
3742 | |||
3743 | for (i = 0; i < MWL8K_TX_QUEUES; i++) | 3750 | for (i = 0; i < MWL8K_TX_QUEUES; i++) |
3744 | mwl8k_txq_deinit(hw, i); | 3751 | mwl8k_txq_deinit(hw, i); |
3745 | 3752 | ||