aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-20 19:44:00 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-20 19:44:00 -0500
commit6ab33d51713d6d60c7677c0d020910a8cb37e513 (patch)
tree546c2ff099b2757e75cf34ddace874f1220f740e /drivers/net
parent7be6065b39c3f1cfa796667eac1a2170465acc91 (diff)
parent13d428afc007fcfcd6deeb215618f54cf9c0cae6 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/ixgbe/ixgbe_main.c include/net/mac80211.h net/phonet/af_phonet.c
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/atlx/atl2.c8
-rw-r--r--drivers/net/ipg.c8
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c62
-rw-r--r--drivers/net/jme.c21
-rw-r--r--drivers/net/mv643xx_eth.c5
-rw-r--r--drivers/net/phy/phy_device.c34
-rw-r--r--drivers/net/sh_eth.c4
-rw-r--r--drivers/net/smc911x.c2
-rw-r--r--drivers/net/usb/asix.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c8
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-dev.h3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-rx.c26
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c2
13 files changed, 103 insertions, 84 deletions
diff --git a/drivers/net/atlx/atl2.c b/drivers/net/atlx/atl2.c
index 688c21e81a8e..b8d585722e1a 100644
--- a/drivers/net/atlx/atl2.c
+++ b/drivers/net/atlx/atl2.c
@@ -1681,9 +1681,11 @@ static int atl2_resume(struct pci_dev *pdev)
1681 1681
1682 ATL2_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0); 1682 ATL2_WRITE_REG(&adapter->hw, REG_WOL_CTRL, 0);
1683 1683
1684 err = atl2_request_irq(adapter); 1684 if (netif_running(netdev)) {
1685 if (netif_running(netdev) && err) 1685 err = atl2_request_irq(adapter);
1686 return err; 1686 if (err)
1687 return err;
1688 }
1687 1689
1688 atl2_reset_hw(&adapter->hw); 1690 atl2_reset_hw(&adapter->hw);
1689 1691
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c
index 24c777aff5c6..7b6d435a8468 100644
--- a/drivers/net/ipg.c
+++ b/drivers/net/ipg.c
@@ -1112,7 +1112,7 @@ static void ipg_nic_rx_free_skb(struct net_device *dev)
1112 struct ipg_rx *rxfd = sp->rxd + entry; 1112 struct ipg_rx *rxfd = sp->rxd + entry;
1113 1113
1114 pci_unmap_single(sp->pdev, 1114 pci_unmap_single(sp->pdev,
1115 le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), 1115 le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
1116 sp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1116 sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
1117 dev_kfree_skb_irq(sp->rx_buff[entry]); 1117 dev_kfree_skb_irq(sp->rx_buff[entry]);
1118 sp->rx_buff[entry] = NULL; 1118 sp->rx_buff[entry] = NULL;
@@ -1179,7 +1179,7 @@ static int ipg_nic_rx_check_error(struct net_device *dev)
1179 */ 1179 */
1180 if (sp->rx_buff[entry]) { 1180 if (sp->rx_buff[entry]) {
1181 pci_unmap_single(sp->pdev, 1181 pci_unmap_single(sp->pdev,
1182 le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), 1182 le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
1183 sp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1183 sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
1184 1184
1185 dev_kfree_skb_irq(sp->rx_buff[entry]); 1185 dev_kfree_skb_irq(sp->rx_buff[entry]);
@@ -1245,7 +1245,7 @@ static void ipg_nic_rx_with_start(struct net_device *dev,
1245 if (jumbo->found_start) 1245 if (jumbo->found_start)
1246 dev_kfree_skb_irq(jumbo->skb); 1246 dev_kfree_skb_irq(jumbo->skb);
1247 1247
1248 pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info & ~IPG_RFI_FRAGLEN), 1248 pci_unmap_single(pdev, le64_to_cpu(rxfd->frag_info) & ~IPG_RFI_FRAGLEN,
1249 sp->rx_buf_sz, PCI_DMA_FROMDEVICE); 1249 sp->rx_buf_sz, PCI_DMA_FROMDEVICE);
1250 1250
1251 skb_put(skb, sp->rxfrag_size); 1251 skb_put(skb, sp->rxfrag_size);
@@ -1345,7 +1345,7 @@ static int ipg_nic_rx_jumbo(struct net_device *dev)
1345 unsigned int entry = curr % IPG_RFDLIST_LENGTH; 1345 unsigned int entry = curr % IPG_RFDLIST_LENGTH;
1346 struct ipg_rx *rxfd = sp->rxd + entry; 1346 struct ipg_rx *rxfd = sp->rxd + entry;
1347 1347
1348 if (!(rxfd->rfs & le64_to_cpu(IPG_RFS_RFDDONE))) 1348 if (!(rxfd->rfs & cpu_to_le64(IPG_RFS_RFDDONE)))
1349 break; 1349 break;
1350 1350
1351 switch (ipg_nic_rx_check_frame_type(dev)) { 1351 switch (ipg_nic_rx_check_frame_type(dev)) {
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 6fb873889e74..7ad07a00680a 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -1301,7 +1301,36 @@ static void ixgbe_set_itr(struct ixgbe_adapter *adapter)
1301 return; 1301 return;
1302} 1302}
1303 1303
1304static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter); 1304/**
1305 * ixgbe_irq_disable - Mask off interrupt generation on the NIC
1306 * @adapter: board private structure
1307 **/
1308static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter)
1309{
1310 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0);
1311 IXGBE_WRITE_FLUSH(&adapter->hw);
1312 if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
1313 int i;
1314 for (i = 0; i < adapter->num_msix_vectors; i++)
1315 synchronize_irq(adapter->msix_entries[i].vector);
1316 } else {
1317 synchronize_irq(adapter->pdev->irq);
1318 }
1319}
1320
1321/**
1322 * ixgbe_irq_enable - Enable default interrupt generation settings
1323 * @adapter: board private structure
1324 **/
1325static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter)
1326{
1327 u32 mask;
1328 mask = IXGBE_EIMS_ENABLE_MASK;
1329 if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE)
1330 mask |= IXGBE_EIMS_GPI_SDP1;
1331 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask);
1332 IXGBE_WRITE_FLUSH(&adapter->hw);
1333}
1305 1334
1306/** 1335/**
1307 * ixgbe_intr - legacy mode Interrupt Handler 1336 * ixgbe_intr - legacy mode Interrupt Handler
@@ -1410,37 +1439,6 @@ static void ixgbe_free_irq(struct ixgbe_adapter *adapter)
1410} 1439}
1411 1440
1412/** 1441/**
1413 * ixgbe_irq_disable - Mask off interrupt generation on the NIC
1414 * @adapter: board private structure
1415 **/
1416static inline void ixgbe_irq_disable(struct ixgbe_adapter *adapter)
1417{
1418 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMC, ~0);
1419 IXGBE_WRITE_FLUSH(&adapter->hw);
1420 if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
1421 int i;
1422 for (i = 0; i < adapter->num_msix_vectors; i++)
1423 synchronize_irq(adapter->msix_entries[i].vector);
1424 } else {
1425 synchronize_irq(adapter->pdev->irq);
1426 }
1427}
1428
1429/**
1430 * ixgbe_irq_enable - Enable default interrupt generation settings
1431 * @adapter: board private structure
1432 **/
1433static inline void ixgbe_irq_enable(struct ixgbe_adapter *adapter)
1434{
1435 u32 mask;
1436 mask = IXGBE_EIMS_ENABLE_MASK;
1437 if (adapter->flags & IXGBE_FLAG_FAN_FAIL_CAPABLE)
1438 mask |= IXGBE_EIMS_GPI_SDP1;
1439 IXGBE_WRITE_REG(&adapter->hw, IXGBE_EIMS, mask);
1440 IXGBE_WRITE_FLUSH(&adapter->hw);
1441}
1442
1443/**
1444 * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts 1442 * ixgbe_configure_msi_and_legacy - Initialize PIN (INTA...) and MSI interrupts
1445 * 1443 *
1446 **/ 1444 **/
diff --git a/drivers/net/jme.c b/drivers/net/jme.c
index 0796d0b0e338..0430ffb62364 100644
--- a/drivers/net/jme.c
+++ b/drivers/net/jme.c
@@ -912,23 +912,23 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx)
912 skb_put(skb, framesize); 912 skb_put(skb, framesize);
913 skb->protocol = eth_type_trans(skb, jme->dev); 913 skb->protocol = eth_type_trans(skb, jme->dev);
914 914
915 if (jme_rxsum_ok(jme, rxdesc->descwb.flags)) 915 if (jme_rxsum_ok(jme, le16_to_cpu(rxdesc->descwb.flags)))
916 skb->ip_summed = CHECKSUM_UNNECESSARY; 916 skb->ip_summed = CHECKSUM_UNNECESSARY;
917 else 917 else
918 skb->ip_summed = CHECKSUM_NONE; 918 skb->ip_summed = CHECKSUM_NONE;
919 919
920 if (rxdesc->descwb.flags & RXWBFLAG_TAGON) { 920 if (rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_TAGON)) {
921 if (jme->vlgrp) { 921 if (jme->vlgrp) {
922 jme->jme_vlan_rx(skb, jme->vlgrp, 922 jme->jme_vlan_rx(skb, jme->vlgrp,
923 le32_to_cpu(rxdesc->descwb.vlan)); 923 le16_to_cpu(rxdesc->descwb.vlan));
924 NET_STAT(jme).rx_bytes += 4; 924 NET_STAT(jme).rx_bytes += 4;
925 } 925 }
926 } else { 926 } else {
927 jme->jme_rx(skb); 927 jme->jme_rx(skb);
928 } 928 }
929 929
930 if ((le16_to_cpu(rxdesc->descwb.flags) & RXWBFLAG_DEST) == 930 if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_DEST)) ==
931 RXWBFLAG_DEST_MUL) 931 cpu_to_le16(RXWBFLAG_DEST_MUL))
932 ++(NET_STAT(jme).multicast); 932 ++(NET_STAT(jme).multicast);
933 933
934 NET_STAT(jme).rx_bytes += framesize; 934 NET_STAT(jme).rx_bytes += framesize;
@@ -960,7 +960,7 @@ jme_process_receive(struct jme_adapter *jme, int limit)
960 rxdesc = rxring->desc; 960 rxdesc = rxring->desc;
961 rxdesc += i; 961 rxdesc += i;
962 962
963 if ((rxdesc->descwb.flags & RXWBFLAG_OWN) || 963 if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) ||
964 !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) 964 !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL))
965 goto out; 965 goto out;
966 966
@@ -1762,10 +1762,9 @@ jme_expand_header(struct jme_adapter *jme, struct sk_buff *skb)
1762} 1762}
1763 1763
1764static int 1764static int
1765jme_tx_tso(struct sk_buff *skb, 1765jme_tx_tso(struct sk_buff *skb, __le16 *mss, u8 *flags)
1766 u16 *mss, u8 *flags)
1767{ 1766{
1768 *mss = skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT; 1767 *mss = cpu_to_le16(skb_shinfo(skb)->gso_size << TXDESC_MSS_SHIFT);
1769 if (*mss) { 1768 if (*mss) {
1770 *flags |= TXFLAG_LSEN; 1769 *flags |= TXFLAG_LSEN;
1771 1770
@@ -1825,11 +1824,11 @@ jme_tx_csum(struct jme_adapter *jme, struct sk_buff *skb, u8 *flags)
1825} 1824}
1826 1825
1827static inline void 1826static inline void
1828jme_tx_vlan(struct sk_buff *skb, u16 *vlan, u8 *flags) 1827jme_tx_vlan(struct sk_buff *skb, __le16 *vlan, u8 *flags)
1829{ 1828{
1830 if (vlan_tx_tag_present(skb)) { 1829 if (vlan_tx_tag_present(skb)) {
1831 *flags |= TXFLAG_TAGON; 1830 *flags |= TXFLAG_TAGON;
1832 *vlan = vlan_tx_tag_get(skb); 1831 *vlan = cpu_to_le16(vlan_tx_tag_get(skb));
1833 } 1832 }
1834} 1833}
1835 1834
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index b56fdf0dc875..7253a499d9c8 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -906,7 +906,8 @@ static int txq_reclaim(struct tx_queue *txq, int budget, int force)
906 if (skb != NULL) { 906 if (skb != NULL) {
907 if (skb_queue_len(&mp->rx_recycle) < 907 if (skb_queue_len(&mp->rx_recycle) <
908 mp->default_rx_ring_size && 908 mp->default_rx_ring_size &&
909 skb_recycle_check(skb, mp->skb_size)) 909 skb_recycle_check(skb, mp->skb_size +
910 dma_get_cache_alignment() - 1))
910 __skb_queue_head(&mp->rx_recycle, skb); 911 __skb_queue_head(&mp->rx_recycle, skb);
911 else 912 else
912 dev_kfree_skb(skb); 913 dev_kfree_skb(skb);
@@ -2478,8 +2479,8 @@ static int mv643xx_eth_shared_remove(struct platform_device *pdev)
2478 struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data; 2479 struct mv643xx_eth_shared_platform_data *pd = pdev->dev.platform_data;
2479 2480
2480 if (pd == NULL || pd->shared_smi == NULL) { 2481 if (pd == NULL || pd->shared_smi == NULL) {
2481 mdiobus_free(msp->smi_bus);
2482 mdiobus_unregister(msp->smi_bus); 2482 mdiobus_unregister(msp->smi_bus);
2483 mdiobus_free(msp->smi_bus);
2483 } 2484 }
2484 if (msp->err_interrupt != NO_IRQ) 2485 if (msp->err_interrupt != NO_IRQ)
2485 free_irq(msp->err_interrupt, msp); 2486 free_irq(msp->err_interrupt, msp);
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index bce918bd3cdd..b344a0b55dbf 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -564,20 +564,32 @@ EXPORT_SYMBOL(genphy_restart_aneg);
564 */ 564 */
565int genphy_config_aneg(struct phy_device *phydev) 565int genphy_config_aneg(struct phy_device *phydev)
566{ 566{
567 int result = 0; 567 int result;
568 568
569 if (AUTONEG_ENABLE == phydev->autoneg) { 569 if (AUTONEG_ENABLE != phydev->autoneg)
570 int result = genphy_config_advert(phydev); 570 return genphy_setup_forced(phydev);
571
572 result = genphy_config_advert(phydev);
573
574 if (result < 0) /* error */
575 return result;
571 576
572 if (result < 0) /* error */ 577 if (result == 0) {
573 return result; 578 /* Advertisment hasn't changed, but maybe aneg was never on to
579 * begin with? Or maybe phy was isolated? */
580 int ctl = phy_read(phydev, MII_BMCR);
581
582 if (ctl < 0)
583 return ctl;
584
585 if (!(ctl & BMCR_ANENABLE) || (ctl & BMCR_ISOLATE))
586 result = 1; /* do restart aneg */
587 }
574 588
575 /* Only restart aneg if we are advertising something different 589 /* Only restart aneg if we are advertising something different
576 * than we were before. */ 590 * than we were before. */
577 if (result > 0) 591 if (result > 0)
578 result = genphy_restart_aneg(phydev); 592 result = genphy_restart_aneg(phydev);
579 } else
580 result = genphy_setup_forced(phydev);
581 593
582 return result; 594 return result;
583} 595}
diff --git a/drivers/net/sh_eth.c b/drivers/net/sh_eth.c
index 077d796ccb70..7f8e514eb5e9 100644
--- a/drivers/net/sh_eth.c
+++ b/drivers/net/sh_eth.c
@@ -926,7 +926,7 @@ static int sh_eth_start_xmit(struct sk_buff *skb, struct net_device *ndev)
926 struct sh_eth_private *mdp = netdev_priv(ndev); 926 struct sh_eth_private *mdp = netdev_priv(ndev);
927 struct sh_eth_txdesc *txdesc; 927 struct sh_eth_txdesc *txdesc;
928 u32 entry; 928 u32 entry;
929 int flags; 929 unsigned long flags;
930 930
931 spin_lock_irqsave(&mdp->lock, flags); 931 spin_lock_irqsave(&mdp->lock, flags);
932 if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) { 932 if ((mdp->cur_tx - mdp->dirty_tx) >= (TX_RING_SIZE - 4)) {
@@ -1140,7 +1140,7 @@ static int sh_mdio_init(struct net_device *ndev, int id)
1140 /* Hook up MII support for ethtool */ 1140 /* Hook up MII support for ethtool */
1141 mdp->mii_bus->name = "sh_mii"; 1141 mdp->mii_bus->name = "sh_mii";
1142 mdp->mii_bus->parent = &ndev->dev; 1142 mdp->mii_bus->parent = &ndev->dev;
1143 mdp->mii_bus->id[0] = id; 1143 snprintf(mdp->mii_bus->id, MII_BUS_ID_SIZE, "%x", id);
1144 1144
1145 /* PHY IRQ */ 1145 /* PHY IRQ */
1146 mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL); 1146 mdp->mii_bus->irq = kmalloc(sizeof(int)*PHY_MAX_ADDR, GFP_KERNEL);
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index a91b7351150d..84d1feb1c179 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -1811,7 +1811,7 @@ static int __init smc911x_probe(struct net_device *dev)
1811 val = SMC_GET_BYTE_TEST(lp); 1811 val = SMC_GET_BYTE_TEST(lp);
1812 DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val); 1812 DBG(SMC_DEBUG_MISC, "%s: endian probe returned 0x%04x\n", CARDNAME, val);
1813 if (val != 0x87654321) { 1813 if (val != 0x87654321) {
1814 printk(KERN_ERR "Invalid chip endian 0x08%x\n",val); 1814 printk(KERN_ERR "Invalid chip endian 0x%08x\n",val);
1815 retval = -ENODEV; 1815 retval = -ENODEV;
1816 goto err_out; 1816 goto err_out;
1817 } 1817 }
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index e12cdb4543b4..de57490103fc 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -1102,12 +1102,14 @@ static int ax88178_link_reset(struct usbnet *dev)
1102 mode = AX88178_MEDIUM_DEFAULT; 1102 mode = AX88178_MEDIUM_DEFAULT;
1103 1103
1104 if (ecmd.speed == SPEED_1000) 1104 if (ecmd.speed == SPEED_1000)
1105 mode |= AX_MEDIUM_GM | AX_MEDIUM_ENCK; 1105 mode |= AX_MEDIUM_GM;
1106 else if (ecmd.speed == SPEED_100) 1106 else if (ecmd.speed == SPEED_100)
1107 mode |= AX_MEDIUM_PS; 1107 mode |= AX_MEDIUM_PS;
1108 else 1108 else
1109 mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM); 1109 mode &= ~(AX_MEDIUM_PS | AX_MEDIUM_GM);
1110 1110
1111 mode |= AX_MEDIUM_ENCK;
1112
1111 if (ecmd.duplex == DUPLEX_FULL) 1113 if (ecmd.duplex == DUPLEX_FULL)
1112 mode |= AX_MEDIUM_FD; 1114 mode |= AX_MEDIUM_FD;
1113 else 1115 else
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 8264d3742d08..35cfa1524c35 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1379,7 +1379,7 @@ void iwl_rx_handle(struct iwl_priv *priv)
1379 1379
1380 rxq->queue[i] = NULL; 1380 rxq->queue[i] = NULL;
1381 1381
1382 pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->dma_addr, 1382 pci_dma_sync_single_for_cpu(priv->pci_dev, rxb->aligned_dma_addr,
1383 priv->hw_params.rx_buf_size, 1383 priv->hw_params.rx_buf_size,
1384 PCI_DMA_FROMDEVICE); 1384 PCI_DMA_FROMDEVICE);
1385 pkt = (struct iwl_rx_packet *)rxb->skb->data; 1385 pkt = (struct iwl_rx_packet *)rxb->skb->data;
@@ -1432,8 +1432,8 @@ void iwl_rx_handle(struct iwl_priv *priv)
1432 rxb->skb = NULL; 1432 rxb->skb = NULL;
1433 } 1433 }
1434 1434
1435 pci_unmap_single(priv->pci_dev, rxb->dma_addr, 1435 pci_unmap_single(priv->pci_dev, rxb->real_dma_addr,
1436 priv->hw_params.rx_buf_size, 1436 priv->hw_params.rx_buf_size + 256,
1437 PCI_DMA_FROMDEVICE); 1437 PCI_DMA_FROMDEVICE);
1438 spin_lock_irqsave(&rxq->lock, flags); 1438 spin_lock_irqsave(&rxq->lock, flags);
1439 list_add_tail(&rxb->list, &priv->rxq.rx_used); 1439 list_add_tail(&rxb->list, &priv->rxq.rx_used);
@@ -2334,7 +2334,6 @@ static void iwl_bg_alive_start(struct work_struct *data)
2334 mutex_lock(&priv->mutex); 2334 mutex_lock(&priv->mutex);
2335 iwl_alive_start(priv); 2335 iwl_alive_start(priv);
2336 mutex_unlock(&priv->mutex); 2336 mutex_unlock(&priv->mutex);
2337 ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
2338} 2337}
2339 2338
2340static void iwl_bg_rf_kill(struct work_struct *work) 2339static void iwl_bg_rf_kill(struct work_struct *work)
@@ -2390,7 +2389,6 @@ static void iwl_bg_set_monitor(struct work_struct *work)
2390 } 2389 }
2391 2390
2392 mutex_unlock(&priv->mutex); 2391 mutex_unlock(&priv->mutex);
2393 ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
2394} 2392}
2395 2393
2396static void iwl_bg_run_time_calib_work(struct work_struct *work) 2394static void iwl_bg_run_time_calib_work(struct work_struct *work)
diff --git a/drivers/net/wireless/iwlwifi/iwl-dev.h b/drivers/net/wireless/iwlwifi/iwl-dev.h
index eb396f26730c..d509aed5567a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-dev.h
+++ b/drivers/net/wireless/iwlwifi/iwl-dev.h
@@ -89,7 +89,8 @@ extern struct iwl_cfg iwl5100_abg_cfg;
89#define DEFAULT_LONG_RETRY_LIMIT 4U 89#define DEFAULT_LONG_RETRY_LIMIT 4U
90 90
91struct iwl_rx_mem_buffer { 91struct iwl_rx_mem_buffer {
92 dma_addr_t dma_addr; 92 dma_addr_t real_dma_addr;
93 dma_addr_t aligned_dma_addr;
93 struct sk_buff *skb; 94 struct sk_buff *skb;
94 struct list_head list; 95 struct list_head list;
95}; 96};
diff --git a/drivers/net/wireless/iwlwifi/iwl-rx.c b/drivers/net/wireless/iwlwifi/iwl-rx.c
index b86f9586acde..b3c35c64d042 100644
--- a/drivers/net/wireless/iwlwifi/iwl-rx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-rx.c
@@ -204,7 +204,7 @@ int iwl_rx_queue_restock(struct iwl_priv *priv)
204 list_del(element); 204 list_del(element);
205 205
206 /* Point to Rx buffer via next RBD in circular buffer */ 206 /* Point to Rx buffer via next RBD in circular buffer */
207 rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->dma_addr); 207 rxq->bd[rxq->write] = iwl_dma_addr2rbd_ptr(priv, rxb->aligned_dma_addr);
208 rxq->queue[rxq->write] = rxb; 208 rxq->queue[rxq->write] = rxb;
209 rxq->write = (rxq->write + 1) & RX_QUEUE_MASK; 209 rxq->write = (rxq->write + 1) & RX_QUEUE_MASK;
210 rxq->free_count--; 210 rxq->free_count--;
@@ -251,7 +251,7 @@ void iwl_rx_allocate(struct iwl_priv *priv)
251 rxb = list_entry(element, struct iwl_rx_mem_buffer, list); 251 rxb = list_entry(element, struct iwl_rx_mem_buffer, list);
252 252
253 /* Alloc a new receive buffer */ 253 /* Alloc a new receive buffer */
254 rxb->skb = alloc_skb(priv->hw_params.rx_buf_size, 254 rxb->skb = alloc_skb(priv->hw_params.rx_buf_size + 256,
255 __GFP_NOWARN | GFP_ATOMIC); 255 __GFP_NOWARN | GFP_ATOMIC);
256 if (!rxb->skb) { 256 if (!rxb->skb) {
257 if (net_ratelimit()) 257 if (net_ratelimit())
@@ -266,9 +266,17 @@ void iwl_rx_allocate(struct iwl_priv *priv)
266 list_del(element); 266 list_del(element);
267 267
268 /* Get physical address of RB/SKB */ 268 /* Get physical address of RB/SKB */
269 rxb->dma_addr = 269 rxb->real_dma_addr = pci_map_single(
270 pci_map_single(priv->pci_dev, rxb->skb->data, 270 priv->pci_dev,
271 priv->hw_params.rx_buf_size, PCI_DMA_FROMDEVICE); 271 rxb->skb->data,
272 priv->hw_params.rx_buf_size + 256,
273 PCI_DMA_FROMDEVICE);
274 /* dma address must be no more than 36 bits */
275 BUG_ON(rxb->real_dma_addr & ~DMA_BIT_MASK(36));
276 /* and also 256 byte aligned! */
277 rxb->aligned_dma_addr = ALIGN(rxb->real_dma_addr, 256);
278 skb_reserve(rxb->skb, rxb->aligned_dma_addr - rxb->real_dma_addr);
279
272 list_add_tail(&rxb->list, &rxq->rx_free); 280 list_add_tail(&rxb->list, &rxq->rx_free);
273 rxq->free_count++; 281 rxq->free_count++;
274 } 282 }
@@ -300,8 +308,8 @@ void iwl_rx_queue_free(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
300 for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) { 308 for (i = 0; i < RX_QUEUE_SIZE + RX_FREE_BUFFERS; i++) {
301 if (rxq->pool[i].skb != NULL) { 309 if (rxq->pool[i].skb != NULL) {
302 pci_unmap_single(priv->pci_dev, 310 pci_unmap_single(priv->pci_dev,
303 rxq->pool[i].dma_addr, 311 rxq->pool[i].real_dma_addr,
304 priv->hw_params.rx_buf_size, 312 priv->hw_params.rx_buf_size + 256,
305 PCI_DMA_FROMDEVICE); 313 PCI_DMA_FROMDEVICE);
306 dev_kfree_skb(rxq->pool[i].skb); 314 dev_kfree_skb(rxq->pool[i].skb);
307 } 315 }
@@ -354,8 +362,8 @@ void iwl_rx_queue_reset(struct iwl_priv *priv, struct iwl_rx_queue *rxq)
354 * to an SKB, so we need to unmap and free potential storage */ 362 * to an SKB, so we need to unmap and free potential storage */
355 if (rxq->pool[i].skb != NULL) { 363 if (rxq->pool[i].skb != NULL) {
356 pci_unmap_single(priv->pci_dev, 364 pci_unmap_single(priv->pci_dev,
357 rxq->pool[i].dma_addr, 365 rxq->pool[i].real_dma_addr,
358 priv->hw_params.rx_buf_size, 366 priv->hw_params.rx_buf_size + 256,
359 PCI_DMA_FROMDEVICE); 367 PCI_DMA_FROMDEVICE);
360 priv->alloc_rxb_skb--; 368 priv->alloc_rxb_skb--;
361 dev_kfree_skb(rxq->pool[i].skb); 369 dev_kfree_skb(rxq->pool[i].skb);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 119185fb1e26..a3ec4d0467a2 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -5948,7 +5948,6 @@ static void iwl3945_bg_alive_start(struct work_struct *data)
5948 mutex_lock(&priv->mutex); 5948 mutex_lock(&priv->mutex);
5949 iwl3945_alive_start(priv); 5949 iwl3945_alive_start(priv);
5950 mutex_unlock(&priv->mutex); 5950 mutex_unlock(&priv->mutex);
5951 ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
5952} 5951}
5953 5952
5954static void iwl3945_bg_rf_kill(struct work_struct *work) 5953static void iwl3945_bg_rf_kill(struct work_struct *work)
@@ -5999,7 +5998,6 @@ static void iwl3945_bg_set_monitor(struct work_struct *work)
5999 IWL_ERROR("iwl3945_set_mode() failed\n"); 5998 IWL_ERROR("iwl3945_set_mode() failed\n");
6000 5999
6001 mutex_unlock(&priv->mutex); 6000 mutex_unlock(&priv->mutex);
6002 ieee80211_notify_mac(priv->hw, IEEE80211_NOTIFY_RE_ASSOC);
6003} 6001}
6004 6002
6005#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ) 6003#define IWL_SCAN_CHECK_WATCHDOG (7 * HZ)