aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/82596.c7
-rw-r--r--drivers/net/b44.c52
-rw-r--r--drivers/net/bnx2.c22
-rw-r--r--drivers/net/bnx2.h6
-rw-r--r--drivers/net/bonding/bonding.h7
-rw-r--r--drivers/net/e100.c7
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c87
-rw-r--r--drivers/net/ehea/ehea_phyp.c10
-rw-r--r--drivers/net/fs_enet/mac-fec.c13
-rw-r--r--drivers/net/fs_enet/mac-scc.c6
-rw-r--r--drivers/net/hamradio/Kconfig6
-rw-r--r--drivers/net/irda/irda-usb.c45
-rw-r--r--drivers/net/irda/irda-usb.h1
-rw-r--r--drivers/net/irda/stir4200.c2
-rw-r--r--drivers/net/irda/vlsi_ir.c16
-rw-r--r--drivers/net/irda/vlsi_ir.h33
-rw-r--r--drivers/net/mv643xx_eth.c11
-rw-r--r--drivers/net/netxen/netxen_nic.h143
-rw-r--r--drivers/net/netxen/netxen_nic_ethtool.c22
-rw-r--r--drivers/net/netxen/netxen_nic_hw.c46
-rw-r--r--drivers/net/netxen/netxen_nic_hw.h74
-rw-r--r--drivers/net/netxen/netxen_nic_init.c15
-rw-r--r--drivers/net/netxen/netxen_nic_isr.c4
-rw-r--r--drivers/net/netxen/netxen_nic_main.c10
-rw-r--r--drivers/net/netxen/netxen_nic_niu.c106
-rw-r--r--drivers/net/pcmcia/3c589_cs.c7
-rw-r--r--drivers/net/phy/fixed.c2
-rw-r--r--drivers/net/phy/phy.c3
-rw-r--r--drivers/net/s2io.c3
-rw-r--r--drivers/net/skge.c2
-rw-r--r--drivers/net/sky2.c27
-rw-r--r--drivers/net/smc911x.c5
-rw-r--r--drivers/net/spider_net.c2
34 files changed, 408 insertions, 396 deletions
diff --git a/drivers/net/82596.c b/drivers/net/82596.c
index 8236f26ffd46..640d7ca2ebcf 100644
--- a/drivers/net/82596.c
+++ b/drivers/net/82596.c
@@ -1066,8 +1066,8 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
1066 short length = skb->len; 1066 short length = skb->len;
1067 dev->trans_start = jiffies; 1067 dev->trans_start = jiffies;
1068 1068
1069 DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%x) called\n", dev->name, 1069 DEB(DEB_STARTTX,printk(KERN_DEBUG "%s: i596_start_xmit(%x,%p) called\n",
1070 skb->len, (unsigned int)skb->data)); 1070 dev->name, skb->len, skb->data));
1071 1071
1072 if (skb->len < ETH_ZLEN) { 1072 if (skb->len < ETH_ZLEN) {
1073 if (skb_padto(skb, ETH_ZLEN)) 1073 if (skb_padto(skb, ETH_ZLEN))
@@ -1246,7 +1246,8 @@ struct net_device * __init i82596_probe(int unit)
1246 dev->priv = (void *)(dev->mem_start); 1246 dev->priv = (void *)(dev->mem_start);
1247 1247
1248 lp = dev->priv; 1248 lp = dev->priv;
1249 DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%d bytes), lp->scb at 0x%08lx\n", 1249 DEB(DEB_INIT,printk(KERN_DEBUG "%s: lp at 0x%08lx (%zd bytes), "
1250 "lp->scb at 0x%08lx\n",
1250 dev->name, (unsigned long)lp, 1251 dev->name, (unsigned long)lp,
1251 sizeof(struct i596_private), (unsigned long)&lp->scb)); 1252 sizeof(struct i596_private), (unsigned long)&lp->scb));
1252 memset((void *) lp, 0, sizeof(struct i596_private)); 1253 memset((void *) lp, 0, sizeof(struct i596_private));
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 5eb2ec68393f..303a8d94ad4b 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -110,6 +110,11 @@ MODULE_DEVICE_TABLE(pci, b44_pci_tbl);
110 110
111static void b44_halt(struct b44 *); 111static void b44_halt(struct b44 *);
112static void b44_init_rings(struct b44 *); 112static void b44_init_rings(struct b44 *);
113
114#define B44_FULL_RESET 1
115#define B44_FULL_RESET_SKIP_PHY 2
116#define B44_PARTIAL_RESET 3
117
113static void b44_init_hw(struct b44 *, int); 118static void b44_init_hw(struct b44 *, int);
114 119
115static int dma_desc_align_mask; 120static int dma_desc_align_mask;
@@ -752,7 +757,7 @@ static void b44_recycle_rx(struct b44 *bp, int src_idx, u32 dest_idx_unmasked)
752 dest_idx * sizeof(dest_desc), 757 dest_idx * sizeof(dest_desc),
753 DMA_BIDIRECTIONAL); 758 DMA_BIDIRECTIONAL);
754 759
755 pci_dma_sync_single_for_device(bp->pdev, src_desc->addr, 760 pci_dma_sync_single_for_device(bp->pdev, le32_to_cpu(src_desc->addr),
756 RX_PKT_BUF_SZ, 761 RX_PKT_BUF_SZ,
757 PCI_DMA_FROMDEVICE); 762 PCI_DMA_FROMDEVICE);
758} 763}
@@ -884,7 +889,7 @@ static int b44_poll(struct net_device *netdev, int *budget)
884 spin_lock_irqsave(&bp->lock, flags); 889 spin_lock_irqsave(&bp->lock, flags);
885 b44_halt(bp); 890 b44_halt(bp);
886 b44_init_rings(bp); 891 b44_init_rings(bp);
887 b44_init_hw(bp, 1); 892 b44_init_hw(bp, B44_FULL_RESET_SKIP_PHY);
888 netif_wake_queue(bp->dev); 893 netif_wake_queue(bp->dev);
889 spin_unlock_irqrestore(&bp->lock, flags); 894 spin_unlock_irqrestore(&bp->lock, flags);
890 done = 1; 895 done = 1;
@@ -954,7 +959,7 @@ static void b44_tx_timeout(struct net_device *dev)
954 959
955 b44_halt(bp); 960 b44_halt(bp);
956 b44_init_rings(bp); 961 b44_init_rings(bp);
957 b44_init_hw(bp, 1); 962 b44_init_hw(bp, B44_FULL_RESET);
958 963
959 spin_unlock_irq(&bp->lock); 964 spin_unlock_irq(&bp->lock);
960 965
@@ -1071,7 +1076,7 @@ static int b44_change_mtu(struct net_device *dev, int new_mtu)
1071 b44_halt(bp); 1076 b44_halt(bp);
1072 dev->mtu = new_mtu; 1077 dev->mtu = new_mtu;
1073 b44_init_rings(bp); 1078 b44_init_rings(bp);
1074 b44_init_hw(bp, 1); 1079 b44_init_hw(bp, B44_FULL_RESET);
1075 spin_unlock_irq(&bp->lock); 1080 spin_unlock_irq(&bp->lock);
1076 1081
1077 b44_enable_ints(bp); 1082 b44_enable_ints(bp);
@@ -1368,12 +1373,12 @@ static int b44_set_mac_addr(struct net_device *dev, void *p)
1368 * packet processing. Invoked with bp->lock held. 1373 * packet processing. Invoked with bp->lock held.
1369 */ 1374 */
1370static void __b44_set_rx_mode(struct net_device *); 1375static void __b44_set_rx_mode(struct net_device *);
1371static void b44_init_hw(struct b44 *bp, int full_reset) 1376static void b44_init_hw(struct b44 *bp, int reset_kind)
1372{ 1377{
1373 u32 val; 1378 u32 val;
1374 1379
1375 b44_chip_reset(bp); 1380 b44_chip_reset(bp);
1376 if (full_reset) { 1381 if (reset_kind == B44_FULL_RESET) {
1377 b44_phy_reset(bp); 1382 b44_phy_reset(bp);
1378 b44_setup_phy(bp); 1383 b44_setup_phy(bp);
1379 } 1384 }
@@ -1390,7 +1395,10 @@ static void b44_init_hw(struct b44 *bp, int full_reset)
1390 bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN); 1395 bw32(bp, B44_TXMAXLEN, bp->dev->mtu + ETH_HLEN + 8 + RX_HEADER_LEN);
1391 1396
1392 bw32(bp, B44_TX_WMARK, 56); /* XXX magic */ 1397 bw32(bp, B44_TX_WMARK, 56); /* XXX magic */
1393 if (full_reset) { 1398 if (reset_kind == B44_PARTIAL_RESET) {
1399 bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
1400 (bp->rx_offset << DMARX_CTRL_ROSHIFT)));
1401 } else {
1394 bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE); 1402 bw32(bp, B44_DMATX_CTRL, DMATX_CTRL_ENABLE);
1395 bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset); 1403 bw32(bp, B44_DMATX_ADDR, bp->tx_ring_dma + bp->dma_offset);
1396 bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE | 1404 bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
@@ -1401,9 +1409,6 @@ static void b44_init_hw(struct b44 *bp, int full_reset)
1401 bp->rx_prod = bp->rx_pending; 1409 bp->rx_prod = bp->rx_pending;
1402 1410
1403 bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ); 1411 bw32(bp, B44_MIB_CTRL, MIB_CTRL_CLR_ON_READ);
1404 } else {
1405 bw32(bp, B44_DMARX_CTRL, (DMARX_CTRL_ENABLE |
1406 (bp->rx_offset << DMARX_CTRL_ROSHIFT)));
1407 } 1412 }
1408 1413
1409 val = br32(bp, B44_ENET_CTRL); 1414 val = br32(bp, B44_ENET_CTRL);
@@ -1420,7 +1425,7 @@ static int b44_open(struct net_device *dev)
1420 goto out; 1425 goto out;
1421 1426
1422 b44_init_rings(bp); 1427 b44_init_rings(bp);
1423 b44_init_hw(bp, 1); 1428 b44_init_hw(bp, B44_FULL_RESET);
1424 1429
1425 b44_check_phy(bp); 1430 b44_check_phy(bp);
1426 1431
@@ -1629,7 +1634,7 @@ static int b44_close(struct net_device *dev)
1629 netif_poll_enable(dev); 1634 netif_poll_enable(dev);
1630 1635
1631 if (bp->flags & B44_FLAG_WOL_ENABLE) { 1636 if (bp->flags & B44_FLAG_WOL_ENABLE) {
1632 b44_init_hw(bp, 0); 1637 b44_init_hw(bp, B44_PARTIAL_RESET);
1633 b44_setup_wol(bp); 1638 b44_setup_wol(bp);
1634 } 1639 }
1635 1640
@@ -1905,7 +1910,7 @@ static int b44_set_ringparam(struct net_device *dev,
1905 1910
1906 b44_halt(bp); 1911 b44_halt(bp);
1907 b44_init_rings(bp); 1912 b44_init_rings(bp);
1908 b44_init_hw(bp, 1); 1913 b44_init_hw(bp, B44_FULL_RESET);
1909 netif_wake_queue(bp->dev); 1914 netif_wake_queue(bp->dev);
1910 spin_unlock_irq(&bp->lock); 1915 spin_unlock_irq(&bp->lock);
1911 1916
@@ -1948,7 +1953,7 @@ static int b44_set_pauseparam(struct net_device *dev,
1948 if (bp->flags & B44_FLAG_PAUSE_AUTO) { 1953 if (bp->flags & B44_FLAG_PAUSE_AUTO) {
1949 b44_halt(bp); 1954 b44_halt(bp);
1950 b44_init_rings(bp); 1955 b44_init_rings(bp);
1951 b44_init_hw(bp, 1); 1956 b44_init_hw(bp, B44_FULL_RESET);
1952 } else { 1957 } else {
1953 __b44_set_flow_ctrl(bp, bp->flags); 1958 __b44_set_flow_ctrl(bp, bp->flags);
1954 } 1959 }
@@ -2304,7 +2309,7 @@ static int b44_suspend(struct pci_dev *pdev, pm_message_t state)
2304 2309
2305 free_irq(dev->irq, dev); 2310 free_irq(dev->irq, dev);
2306 if (bp->flags & B44_FLAG_WOL_ENABLE) { 2311 if (bp->flags & B44_FLAG_WOL_ENABLE) {
2307 b44_init_hw(bp, 0); 2312 b44_init_hw(bp, B44_PARTIAL_RESET);
2308 b44_setup_wol(bp); 2313 b44_setup_wol(bp);
2309 } 2314 }
2310 pci_disable_device(pdev); 2315 pci_disable_device(pdev);
@@ -2315,21 +2320,32 @@ static int b44_resume(struct pci_dev *pdev)
2315{ 2320{
2316 struct net_device *dev = pci_get_drvdata(pdev); 2321 struct net_device *dev = pci_get_drvdata(pdev);
2317 struct b44 *bp = netdev_priv(dev); 2322 struct b44 *bp = netdev_priv(dev);
2323 int rc = 0;
2318 2324
2319 pci_restore_state(pdev); 2325 pci_restore_state(pdev);
2320 pci_enable_device(pdev); 2326 rc = pci_enable_device(pdev);
2327 if (rc) {
2328 printk(KERN_ERR PFX "%s: pci_enable_device failed\n",
2329 dev->name);
2330 return rc;
2331 }
2332
2321 pci_set_master(pdev); 2333 pci_set_master(pdev);
2322 2334
2323 if (!netif_running(dev)) 2335 if (!netif_running(dev))
2324 return 0; 2336 return 0;
2325 2337
2326 if (request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev)) 2338 rc = request_irq(dev->irq, b44_interrupt, IRQF_SHARED, dev->name, dev);
2339 if (rc) {
2327 printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name); 2340 printk(KERN_ERR PFX "%s: request_irq failed\n", dev->name);
2341 pci_disable_device(pdev);
2342 return rc;
2343 }
2328 2344
2329 spin_lock_irq(&bp->lock); 2345 spin_lock_irq(&bp->lock);
2330 2346
2331 b44_init_rings(bp); 2347 b44_init_rings(bp);
2332 b44_init_hw(bp, 1); 2348 b44_init_hw(bp, B44_FULL_RESET);
2333 netif_device_attach(bp->dev); 2349 netif_device_attach(bp->dev);
2334 spin_unlock_irq(&bp->lock); 2350 spin_unlock_irq(&bp->lock);
2335 2351
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index ca5acc4736df..ee7b75b976b5 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -57,8 +57,8 @@
57 57
58#define DRV_MODULE_NAME "bnx2" 58#define DRV_MODULE_NAME "bnx2"
59#define PFX DRV_MODULE_NAME ": " 59#define PFX DRV_MODULE_NAME ": "
60#define DRV_MODULE_VERSION "1.5.3" 60#define DRV_MODULE_VERSION "1.5.5"
61#define DRV_MODULE_RELDATE "January 8, 2007" 61#define DRV_MODULE_RELDATE "February 1, 2007"
62 62
63#define RUN_AT(x) (jiffies + (x)) 63#define RUN_AT(x) (jiffies + (x))
64 64
@@ -1356,6 +1356,14 @@ bnx2_init_copper_phy(struct bnx2 *bp)
1356 bnx2_write_phy(bp, 0x18, 0x0400); 1356 bnx2_write_phy(bp, 0x18, 0x0400);
1357 } 1357 }
1358 1358
1359 if (bp->phy_flags & PHY_DIS_EARLY_DAC_FLAG) {
1360 bnx2_write_phy(bp, MII_BNX2_DSP_ADDRESS,
1361 MII_BNX2_DSP_EXPAND_REG | 0x8);
1362 bnx2_read_phy(bp, MII_BNX2_DSP_RW_PORT, &val);
1363 val &= ~(1 << 8);
1364 bnx2_write_phy(bp, MII_BNX2_DSP_RW_PORT, val);
1365 }
1366
1359 if (bp->dev->mtu > 1500) { 1367 if (bp->dev->mtu > 1500) {
1360 /* Set extended packet length bit */ 1368 /* Set extended packet length bit */
1361 bnx2_write_phy(bp, 0x18, 0x7); 1369 bnx2_write_phy(bp, 0x18, 0x7);
@@ -5845,9 +5853,11 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5845 reg = REG_RD_IND(bp, BNX2_SHM_HDR_SIGNATURE); 5853 reg = REG_RD_IND(bp, BNX2_SHM_HDR_SIGNATURE);
5846 5854
5847 if ((reg & BNX2_SHM_HDR_SIGNATURE_SIG_MASK) == 5855 if ((reg & BNX2_SHM_HDR_SIGNATURE_SIG_MASK) ==
5848 BNX2_SHM_HDR_SIGNATURE_SIG) 5856 BNX2_SHM_HDR_SIGNATURE_SIG) {
5849 bp->shmem_base = REG_RD_IND(bp, BNX2_SHM_HDR_ADDR_0); 5857 u32 off = PCI_FUNC(pdev->devfn) << 2;
5850 else 5858
5859 bp->shmem_base = REG_RD_IND(bp, BNX2_SHM_HDR_ADDR_0 + off);
5860 } else
5851 bp->shmem_base = HOST_VIEW_SHMEM_BASE; 5861 bp->shmem_base = HOST_VIEW_SHMEM_BASE;
5852 5862
5853 /* Get the permanent MAC address. First we need to make sure the 5863 /* Get the permanent MAC address. First we need to make sure the
@@ -5916,6 +5926,8 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
5916 } else if (CHIP_NUM(bp) == CHIP_NUM_5706 || 5926 } else if (CHIP_NUM(bp) == CHIP_NUM_5706 ||
5917 CHIP_NUM(bp) == CHIP_NUM_5708) 5927 CHIP_NUM(bp) == CHIP_NUM_5708)
5918 bp->phy_flags |= PHY_CRC_FIX_FLAG; 5928 bp->phy_flags |= PHY_CRC_FIX_FLAG;
5929 else if (CHIP_ID(bp) == CHIP_ID_5709_A0)
5930 bp->phy_flags |= PHY_DIS_EARLY_DAC_FLAG;
5919 5931
5920 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) || 5932 if ((CHIP_ID(bp) == CHIP_ID_5708_A0) ||
5921 (CHIP_ID(bp) == CHIP_ID_5708_B0) || 5933 (CHIP_ID(bp) == CHIP_ID_5708_B0) ||
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 13b6f9b11e01..ccbdf81c6599 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6288,6 +6288,10 @@ struct l2_fhdr {
6288 6288
6289#define BCM5708S_TX_ACTL3 0x17 6289#define BCM5708S_TX_ACTL3 0x17
6290 6290
6291#define MII_BNX2_DSP_RW_PORT 0x15
6292#define MII_BNX2_DSP_ADDRESS 0x17
6293#define MII_BNX2_DSP_EXPAND_REG 0x0f00
6294
6291#define MIN_ETHERNET_PACKET_SIZE 60 6295#define MIN_ETHERNET_PACKET_SIZE 60
6292#define MAX_ETHERNET_PACKET_SIZE 1514 6296#define MAX_ETHERNET_PACKET_SIZE 1514
6293#define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 6297#define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014
@@ -6489,6 +6493,7 @@ struct bnx2 {
6489#define PHY_INT_MODE_MASK_FLAG 0x300 6493#define PHY_INT_MODE_MASK_FLAG 0x300
6490#define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100 6494#define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100
6491#define PHY_INT_MODE_LINK_READY_FLAG 0x200 6495#define PHY_INT_MODE_LINK_READY_FLAG 0x200
6496#define PHY_DIS_EARLY_DAC_FLAG 0x400
6492 6497
6493 u32 chip_id; 6498 u32 chip_id;
6494 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */ 6499 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
@@ -6512,6 +6517,7 @@ struct bnx2 {
6512#define CHIP_ID_5708_A0 0x57080000 6517#define CHIP_ID_5708_A0 0x57080000
6513#define CHIP_ID_5708_B0 0x57081000 6518#define CHIP_ID_5708_B0 0x57081000
6514#define CHIP_ID_5708_B1 0x57081010 6519#define CHIP_ID_5708_B1 0x57081010
6520#define CHIP_ID_5709_A0 0x57090000
6515 6521
6516#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf) 6522#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf)
6517 6523
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index dc434fb6da85..0978c9ac6d2b 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -151,8 +151,8 @@ struct slave {
151 struct slave *next; 151 struct slave *next;
152 struct slave *prev; 152 struct slave *prev;
153 int delay; 153 int delay;
154 u32 jiffies; 154 unsigned long jiffies;
155 u32 last_arp_rx; 155 unsigned long last_arp_rx;
156 s8 link; /* one of BOND_LINK_XXXX */ 156 s8 link; /* one of BOND_LINK_XXXX */
157 s8 state; /* one of BOND_STATE_XXXX */ 157 s8 state; /* one of BOND_STATE_XXXX */
158 u32 original_flags; 158 u32 original_flags;
@@ -242,7 +242,8 @@ extern inline int slave_do_arp_validate(struct bonding *bond, struct slave *slav
242 return bond->params.arp_validate & (1 << slave->state); 242 return bond->params.arp_validate & (1 << slave->state);
243} 243}
244 244
245extern inline u32 slave_last_rx(struct bonding *bond, struct slave *slave) 245extern inline unsigned long slave_last_rx(struct bonding *bond,
246 struct slave *slave)
246{ 247{
247 if (slave_do_arp_validate(bond, slave)) 248 if (slave_do_arp_validate(bond, slave))
248 return slave->last_arp_rx; 249 return slave->last_arp_rx;
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index c2ae2a24629b..0cefef5e3f06 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2718,12 +2718,11 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2718 struct net_device *netdev = pci_get_drvdata(pdev); 2718 struct net_device *netdev = pci_get_drvdata(pdev);
2719 struct nic *nic = netdev_priv(netdev); 2719 struct nic *nic = netdev_priv(netdev);
2720 2720
2721#ifdef CONFIG_E100_NAPI
2722 if (netif_running(netdev)) 2721 if (netif_running(netdev))
2723 netif_poll_disable(nic->netdev); 2722 netif_poll_disable(nic->netdev);
2724#endif
2725 del_timer_sync(&nic->watchdog); 2723 del_timer_sync(&nic->watchdog);
2726 netif_carrier_off(nic->netdev); 2724 netif_carrier_off(nic->netdev);
2725 netif_device_detach(netdev);
2727 2726
2728 pci_save_state(pdev); 2727 pci_save_state(pdev);
2729 2728
@@ -2736,6 +2735,7 @@ static int e100_suspend(struct pci_dev *pdev, pm_message_t state)
2736 } 2735 }
2737 2736
2738 pci_disable_device(pdev); 2737 pci_disable_device(pdev);
2738 free_irq(pdev->irq, netdev);
2739 pci_set_power_state(pdev, PCI_D3hot); 2739 pci_set_power_state(pdev, PCI_D3hot);
2740 2740
2741 return 0; 2741 return 0;
@@ -2759,16 +2759,13 @@ static int e100_resume(struct pci_dev *pdev)
2759} 2759}
2760#endif /* CONFIG_PM */ 2760#endif /* CONFIG_PM */
2761 2761
2762
2763static void e100_shutdown(struct pci_dev *pdev) 2762static void e100_shutdown(struct pci_dev *pdev)
2764{ 2763{
2765 struct net_device *netdev = pci_get_drvdata(pdev); 2764 struct net_device *netdev = pci_get_drvdata(pdev);
2766 struct nic *nic = netdev_priv(netdev); 2765 struct nic *nic = netdev_priv(netdev);
2767 2766
2768#ifdef CONFIG_E100_NAPI
2769 if (netif_running(netdev)) 2767 if (netif_running(netdev))
2770 netif_poll_disable(nic->netdev); 2768 netif_poll_disable(nic->netdev);
2771#endif
2772 del_timer_sync(&nic->watchdog); 2769 del_timer_sync(&nic->watchdog);
2773 netif_carrier_off(nic->netdev); 2770 netif_carrier_off(nic->netdev);
2774 2771
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 39ad9f73d1ec..272e1ec51aa2 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -39,7 +39,7 @@
39#include <asm/io.h> 39#include <asm/io.h>
40 40
41#define DRV_NAME "ehea" 41#define DRV_NAME "ehea"
42#define DRV_VERSION "EHEA_0043" 42#define DRV_VERSION "EHEA_0045"
43 43
44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \ 44#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR) 45 | NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index 83fa32f72398..9de2d38a5321 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -558,12 +558,12 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
558 u32 qp_token; 558 u32 qp_token;
559 559
560 eqe = ehea_poll_eq(port->qp_eq); 560 eqe = ehea_poll_eq(port->qp_eq);
561 ehea_debug("eqe=%p", eqe); 561
562 while (eqe) { 562 while (eqe) {
563 ehea_debug("*eqe=%lx", *(u64*)eqe);
564 eqe = ehea_poll_eq(port->qp_eq);
565 qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry); 563 qp_token = EHEA_BMASK_GET(EHEA_EQE_QP_TOKEN, eqe->entry);
566 ehea_debug("next eqe=%p", eqe); 564 ehea_error("QP aff_err: entry=0x%lx, token=0x%x",
565 eqe->entry, qp_token);
566 eqe = ehea_poll_eq(port->qp_eq);
567 } 567 }
568 568
569 return IRQ_HANDLED; 569 return IRQ_HANDLED;
@@ -575,8 +575,9 @@ static struct ehea_port *ehea_get_port(struct ehea_adapter *adapter,
575 int i; 575 int i;
576 576
577 for (i = 0; i < adapter->num_ports; i++) 577 for (i = 0; i < adapter->num_ports; i++)
578 if (adapter->port[i]->logical_port_id == logical_port) 578 if (adapter->port[i])
579 return adapter->port[i]; 579 if (adapter->port[i]->logical_port_id == logical_port)
580 return adapter->port[i];
580 return NULL; 581 return NULL;
581} 582}
582 583
@@ -642,6 +643,8 @@ int ehea_sense_port_attr(struct ehea_port *port)
642 break; 643 break;
643 } 644 }
644 645
646 port->autoneg = 1;
647
645 /* Number of default QPs */ 648 /* Number of default QPs */
646 port->num_def_qps = cb0->num_default_qps; 649 port->num_def_qps = cb0->num_default_qps;
647 650
@@ -728,10 +731,7 @@ int ehea_set_portspeed(struct ehea_port *port, u32 port_speed)
728 } 731 }
729 } else { 732 } else {
730 if (hret == H_AUTHORITY) { 733 if (hret == H_AUTHORITY) {
731 ehea_info("Hypervisor denied setting port speed. Either" 734 ehea_info("Hypervisor denied setting port speed");
732 " this partition is not authorized to set "
733 "port speed or another partition has modified"
734 " port speed first.");
735 ret = -EPERM; 735 ret = -EPERM;
736 } else { 736 } else {
737 ret = -EIO; 737 ret = -EIO;
@@ -998,7 +998,7 @@ static int ehea_configure_port(struct ehea_port *port)
998 | EHEA_BMASK_SET(PXLY_RC_JUMBO_FRAME, 1); 998 | EHEA_BMASK_SET(PXLY_RC_JUMBO_FRAME, 1);
999 999
1000 for (i = 0; i < port->num_def_qps; i++) 1000 for (i = 0; i < port->num_def_qps; i++)
1001 cb0->default_qpn_arr[i] = port->port_res[i].qp->init_attr.qp_nr; 1001 cb0->default_qpn_arr[i] = port->port_res[0].qp->init_attr.qp_nr;
1002 1002
1003 if (netif_msg_ifup(port)) 1003 if (netif_msg_ifup(port))
1004 ehea_dump(cb0, sizeof(*cb0), "ehea_configure_port"); 1004 ehea_dump(cb0, sizeof(*cb0), "ehea_configure_port");
@@ -1485,11 +1485,12 @@ out:
1485 1485
1486static void ehea_promiscuous_error(u64 hret, int enable) 1486static void ehea_promiscuous_error(u64 hret, int enable)
1487{ 1487{
1488 ehea_info("Hypervisor denied %sabling promiscuous mode.%s", 1488 if (hret == H_AUTHORITY)
1489 enable == 1 ? "en" : "dis", 1489 ehea_info("Hypervisor denied %sabling promiscuous mode",
1490 hret != H_AUTHORITY ? "" : " Another partition owning a " 1490 enable == 1 ? "en" : "dis");
1491 "logical port on the same physical port might have altered " 1491 else
1492 "promiscuous mode first."); 1492 ehea_error("failed %sabling promiscuous mode",
1493 enable == 1 ? "en" : "dis");
1493} 1494}
1494 1495
1495static void ehea_promiscuous(struct net_device *dev, int enable) 1496static void ehea_promiscuous(struct net_device *dev, int enable)
@@ -2267,6 +2268,8 @@ static void ehea_tx_watchdog(struct net_device *dev)
2267int ehea_sense_adapter_attr(struct ehea_adapter *adapter) 2268int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
2268{ 2269{
2269 struct hcp_query_ehea *cb; 2270 struct hcp_query_ehea *cb;
2271 struct device_node *lhea_dn = NULL;
2272 struct device_node *eth_dn = NULL;
2270 u64 hret; 2273 u64 hret;
2271 int ret; 2274 int ret;
2272 2275
@@ -2283,7 +2286,18 @@ int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
2283 goto out_herr; 2286 goto out_herr;
2284 } 2287 }
2285 2288
2286 adapter->num_ports = cb->num_ports; 2289 /* Determine the number of available logical ports
2290 * by counting the child nodes of the lhea OFDT entry
2291 */
2292 adapter->num_ports = 0;
2293 lhea_dn = of_find_node_by_name(lhea_dn, "lhea");
2294 do {
2295 eth_dn = of_get_next_child(lhea_dn, eth_dn);
2296 if (eth_dn)
2297 adapter->num_ports++;
2298 } while ( eth_dn );
2299 of_node_put(lhea_dn);
2300
2287 adapter->max_mc_mac = cb->max_mc_mac - 1; 2301 adapter->max_mc_mac = cb->max_mc_mac - 1;
2288 ret = 0; 2302 ret = 0;
2289 2303
@@ -2302,6 +2316,7 @@ static int ehea_setup_single_port(struct ehea_port *port,
2302 struct ehea_adapter *adapter = port->adapter; 2316 struct ehea_adapter *adapter = port->adapter;
2303 struct hcp_ehea_port_cb4 *cb4; 2317 struct hcp_ehea_port_cb4 *cb4;
2304 u32 *dn_log_port_id; 2318 u32 *dn_log_port_id;
2319 int jumbo = 0;
2305 2320
2306 sema_init(&port->port_lock, 1); 2321 sema_init(&port->port_lock, 1);
2307 port->state = EHEA_PORT_DOWN; 2322 port->state = EHEA_PORT_DOWN;
@@ -2334,8 +2349,6 @@ static int ehea_setup_single_port(struct ehea_port *port,
2334 2349
2335 INIT_LIST_HEAD(&port->mc_list->list); 2350 INIT_LIST_HEAD(&port->mc_list->list);
2336 2351
2337 ehea_set_portspeed(port, EHEA_SPEED_AUTONEG);
2338
2339 ret = ehea_sense_port_attr(port); 2352 ret = ehea_sense_port_attr(port);
2340 if (ret) 2353 if (ret)
2341 goto out; 2354 goto out;
@@ -2345,13 +2358,25 @@ static int ehea_setup_single_port(struct ehea_port *port,
2345 if (!cb4) { 2358 if (!cb4) {
2346 ehea_error("no mem for cb4"); 2359 ehea_error("no mem for cb4");
2347 } else { 2360 } else {
2348 cb4->jumbo_frame = 1; 2361 hret = ehea_h_query_ehea_port(adapter->handle,
2349 hret = ehea_h_modify_ehea_port(adapter->handle, 2362 port->logical_port_id,
2350 port->logical_port_id, 2363 H_PORT_CB4,
2351 H_PORT_CB4, H_PORT_CB4_JUMBO, 2364 H_PORT_CB4_JUMBO, cb4);
2352 cb4); 2365
2353 if (hret != H_SUCCESS) { 2366 if (hret == H_SUCCESS) {
2354 ehea_info("Jumbo frames not activated"); 2367 if (cb4->jumbo_frame)
2368 jumbo = 1;
2369 else {
2370 cb4->jumbo_frame = 1;
2371 hret = ehea_h_modify_ehea_port(adapter->handle,
2372 port->
2373 logical_port_id,
2374 H_PORT_CB4,
2375 H_PORT_CB4_JUMBO,
2376 cb4);
2377 if (hret == H_SUCCESS)
2378 jumbo = 1;
2379 }
2355 } 2380 }
2356 kfree(cb4); 2381 kfree(cb4);
2357 } 2382 }
@@ -2390,6 +2415,9 @@ static int ehea_setup_single_port(struct ehea_port *port,
2390 goto out_free; 2415 goto out_free;
2391 } 2416 }
2392 2417
2418 ehea_info("%s: Jumbo frames are %sabled", dev->name,
2419 jumbo == 1 ? "en" : "dis");
2420
2393 port->netdev = dev; 2421 port->netdev = dev;
2394 ret = 0; 2422 ret = 0;
2395 goto out; 2423 goto out;
@@ -2471,14 +2499,16 @@ static int __devinit ehea_probe(struct ibmebus_dev *dev,
2471 2499
2472 adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle", 2500 adapter_handle = (u64*)get_property(dev->ofdev.node, "ibm,hea-handle",
2473 NULL); 2501 NULL);
2474 if (!adapter_handle) { 2502 if (adapter_handle)
2503 adapter->handle = *adapter_handle;
2504
2505 if (!adapter->handle) {
2475 dev_err(&dev->ofdev.dev, "failed getting handle for adapter" 2506 dev_err(&dev->ofdev.dev, "failed getting handle for adapter"
2476 " '%s'\n", dev->ofdev.node->full_name); 2507 " '%s'\n", dev->ofdev.node->full_name);
2477 ret = -ENODEV; 2508 ret = -ENODEV;
2478 goto out_free_ad; 2509 goto out_free_ad;
2479 } 2510 }
2480 2511
2481 adapter->handle = *adapter_handle;
2482 adapter->pd = EHEA_PD_ID; 2512 adapter->pd = EHEA_PD_ID;
2483 2513
2484 dev->ofdev.dev.driver_data = adapter; 2514 dev->ofdev.dev.driver_data = adapter;
@@ -2568,6 +2598,7 @@ static int __devexit ehea_remove(struct ibmebus_dev *dev)
2568 destroy_workqueue(adapter->ehea_wq); 2598 destroy_workqueue(adapter->ehea_wq);
2569 2599
2570 ibmebus_free_irq(NULL, adapter->neq->attr.ist1, adapter); 2600 ibmebus_free_irq(NULL, adapter->neq->attr.ist1, adapter);
2601 tasklet_kill(&adapter->neq_tasklet);
2571 2602
2572 ehea_destroy_eq(adapter->neq); 2603 ehea_destroy_eq(adapter->neq);
2573 2604
diff --git a/drivers/net/ehea/ehea_phyp.c b/drivers/net/ehea/ehea_phyp.c
index 0cfc2bc1a27b..37716e05e808 100644
--- a/drivers/net/ehea/ehea_phyp.c
+++ b/drivers/net/ehea/ehea_phyp.c
@@ -94,6 +94,7 @@ static long ehea_plpar_hcall9(unsigned long opcode,
94{ 94{
95 long ret; 95 long ret;
96 int i, sleep_msecs; 96 int i, sleep_msecs;
97 u8 cb_cat;
97 98
98 for (i = 0; i < 5; i++) { 99 for (i = 0; i < 5; i++) {
99 ret = plpar_hcall9(opcode, outs, 100 ret = plpar_hcall9(opcode, outs,
@@ -106,7 +107,13 @@ static long ehea_plpar_hcall9(unsigned long opcode,
106 continue; 107 continue;
107 } 108 }
108 109
109 if (ret < H_SUCCESS) 110 cb_cat = EHEA_BMASK_GET(H_MEHEAPORT_CAT, arg2);
111
112 if ((ret < H_SUCCESS) && !(((ret == H_AUTHORITY)
113 && (opcode == H_MODIFY_HEA_PORT))
114 && (((cb_cat == H_PORT_CB4) && ((arg3 == H_PORT_CB4_JUMBO)
115 || (arg3 == H_PORT_CB4_SPEED))) || ((cb_cat == H_PORT_CB7)
116 && (arg3 == H_PORT_CB7_DUCQPN)))))
110 ehea_error("opcode=%lx ret=%lx" 117 ehea_error("opcode=%lx ret=%lx"
111 " arg1=%lx arg2=%lx arg3=%lx arg4=%lx" 118 " arg1=%lx arg2=%lx arg3=%lx arg4=%lx"
112 " arg5=%lx arg6=%lx arg7=%lx arg8=%lx" 119 " arg5=%lx arg6=%lx arg7=%lx arg8=%lx"
@@ -120,7 +127,6 @@ static long ehea_plpar_hcall9(unsigned long opcode,
120 outs[0], outs[1], outs[2], outs[3], 127 outs[0], outs[1], outs[2], outs[3],
121 outs[4], outs[5], outs[6], outs[7], 128 outs[4], outs[5], outs[6], outs[7],
122 outs[8]); 129 outs[8]);
123
124 return ret; 130 return ret;
125 } 131 }
126 132
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c
index c2c5fd419bd0..ff6839477306 100644
--- a/drivers/net/fs_enet/mac-fec.c
+++ b/drivers/net/fs_enet/mac-fec.c
@@ -104,9 +104,9 @@ static int do_pd_setup(struct fs_enet_private *fep)
104 fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); 104 fep->interrupt = platform_get_irq_byname(pdev,"interrupt");
105 if (fep->interrupt < 0) 105 if (fep->interrupt < 0)
106 return -EINVAL; 106 return -EINVAL;
107 107
108 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); 108 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
109 fep->fec.fecp =(void*)r->start; 109 fep->fec.fecp = ioremap(r->start, r->end - r->start + 1);
110 110
111 if(fep->fec.fecp == NULL) 111 if(fep->fec.fecp == NULL)
112 return -EINVAL; 112 return -EINVAL;
@@ -319,11 +319,14 @@ static void restart(struct net_device *dev)
319 * Clear any outstanding interrupt. 319 * Clear any outstanding interrupt.
320 */ 320 */
321 FW(fecp, ievent, 0xffc0); 321 FW(fecp, ievent, 0xffc0);
322#ifndef CONFIG_PPC_MERGE
322 FW(fecp, ivec, (fep->interrupt / 2) << 29); 323 FW(fecp, ivec, (fep->interrupt / 2) << 29);
323 324#else
325 FW(fecp, ivec, (virq_to_hw(fep->interrupt) / 2) << 29);
326#endif
324 327
325 /* 328 /*
326 * adjust to speed (only for DUET & RMII) 329 * adjust to speed (only for DUET & RMII)
327 */ 330 */
328#ifdef CONFIG_DUET 331#ifdef CONFIG_DUET
329 if (fpi->use_rmii) { 332 if (fpi->use_rmii) {
@@ -418,6 +421,7 @@ static void stop(struct net_device *dev)
418 421
419static void pre_request_irq(struct net_device *dev, int irq) 422static void pre_request_irq(struct net_device *dev, int irq)
420{ 423{
424#ifndef CONFIG_PPC_MERGE
421 immap_t *immap = fs_enet_immap; 425 immap_t *immap = fs_enet_immap;
422 u32 siel; 426 u32 siel;
423 427
@@ -431,6 +435,7 @@ static void pre_request_irq(struct net_device *dev, int irq)
431 siel &= ~(0x80000000 >> (irq & ~1)); 435 siel &= ~(0x80000000 >> (irq & ~1));
432 out_be32(&immap->im_siu_conf.sc_siel, siel); 436 out_be32(&immap->im_siu_conf.sc_siel, siel);
433 } 437 }
438#endif
434} 439}
435 440
436static void post_free_irq(struct net_device *dev, int irq) 441static void post_free_irq(struct net_device *dev, int irq)
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c
index 95ec5872c507..afd7fca7c6c4 100644
--- a/drivers/net/fs_enet/mac-scc.c
+++ b/drivers/net/fs_enet/mac-scc.c
@@ -121,13 +121,13 @@ static int do_pd_setup(struct fs_enet_private *fep)
121 return -EINVAL; 121 return -EINVAL;
122 122
123 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); 123 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs");
124 fep->scc.sccp = (void *)r->start; 124 fep->scc.sccp = ioremap(r->start, r->end - r->start + 1);
125 125
126 if (fep->scc.sccp == NULL) 126 if (fep->scc.sccp == NULL)
127 return -EINVAL; 127 return -EINVAL;
128 128
129 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram"); 129 r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "pram");
130 fep->scc.ep = (void *)r->start; 130 fep->scc.ep = ioremap(r->start, r->end - r->start + 1);
131 131
132 if (fep->scc.ep == NULL) 132 if (fep->scc.ep == NULL)
133 return -EINVAL; 133 return -EINVAL;
@@ -397,6 +397,7 @@ static void stop(struct net_device *dev)
397 397
398static void pre_request_irq(struct net_device *dev, int irq) 398static void pre_request_irq(struct net_device *dev, int irq)
399{ 399{
400#ifndef CONFIG_PPC_MERGE
400 immap_t *immap = fs_enet_immap; 401 immap_t *immap = fs_enet_immap;
401 u32 siel; 402 u32 siel;
402 403
@@ -410,6 +411,7 @@ static void pre_request_irq(struct net_device *dev, int irq)
410 siel &= ~(0x80000000 >> (irq & ~1)); 411 siel &= ~(0x80000000 >> (irq & ~1));
411 out_be32(&immap->im_siu_conf.sc_siel, siel); 412 out_be32(&immap->im_siu_conf.sc_siel, siel);
412 } 413 }
414#endif
413} 415}
414 416
415static void post_free_irq(struct net_device *dev, int irq) 417static void post_free_irq(struct net_device *dev, int irq)
diff --git a/drivers/net/hamradio/Kconfig b/drivers/net/hamradio/Kconfig
index 896aa02000d7..feb0ada7a025 100644
--- a/drivers/net/hamradio/Kconfig
+++ b/drivers/net/hamradio/Kconfig
@@ -113,7 +113,7 @@ config SCC_TRXECHO
113 113
114config BAYCOM_SER_FDX 114config BAYCOM_SER_FDX
115 tristate "BAYCOM ser12 fullduplex driver for AX.25" 115 tristate "BAYCOM ser12 fullduplex driver for AX.25"
116 depends on AX25 116 depends on AX25 && !S390
117 select CRC_CCITT 117 select CRC_CCITT
118 ---help--- 118 ---help---
119 This is one of two drivers for Baycom style simple amateur radio 119 This is one of two drivers for Baycom style simple amateur radio
@@ -133,7 +133,7 @@ config BAYCOM_SER_FDX
133 133
134config BAYCOM_SER_HDX 134config BAYCOM_SER_HDX
135 tristate "BAYCOM ser12 halfduplex driver for AX.25" 135 tristate "BAYCOM ser12 halfduplex driver for AX.25"
136 depends on AX25 136 depends on AX25 && !S390
137 select CRC_CCITT 137 select CRC_CCITT
138 ---help--- 138 ---help---
139 This is one of two drivers for Baycom style simple amateur radio 139 This is one of two drivers for Baycom style simple amateur radio
@@ -181,7 +181,7 @@ config BAYCOM_EPP
181 181
182config YAM 182config YAM
183 tristate "YAM driver for AX.25" 183 tristate "YAM driver for AX.25"
184 depends on AX25 184 depends on AX25 && !S390
185 help 185 help
186 The YAM is a modem for packet radio which connects to the serial 186 The YAM is a modem for packet radio which connects to the serial
187 port and includes some of the functions of a Terminal Node 187 port and includes some of the functions of a Terminal Node
diff --git a/drivers/net/irda/irda-usb.c b/drivers/net/irda/irda-usb.c
index 3ca1082ec776..340ee99652eb 100644
--- a/drivers/net/irda/irda-usb.c
+++ b/drivers/net/irda/irda-usb.c
@@ -441,25 +441,13 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
441 goto drop; 441 goto drop;
442 } 442 }
443 443
444 /* Make sure there is room for IrDA-USB header. The actual 444 memcpy(self->tx_buff + self->header_length, skb->data, skb->len);
445 * allocation will be done lower in skb_push().
446 * Also, we don't use directly skb_cow(), because it require
447 * headroom >= 16, which force unnecessary copies - Jean II */
448 if (skb_headroom(skb) < self->header_length) {
449 IRDA_DEBUG(0, "%s(), Insuficient skb headroom.\n", __FUNCTION__);
450 if (skb_cow(skb, self->header_length)) {
451 IRDA_WARNING("%s(), failed skb_cow() !!!\n", __FUNCTION__);
452 goto drop;
453 }
454 }
455 445
456 /* Change setting for next frame */ 446 /* Change setting for next frame */
457
458 if (self->capability & IUC_STIR421X) { 447 if (self->capability & IUC_STIR421X) {
459 __u8 turnaround_time; 448 __u8 turnaround_time;
460 __u8* frame; 449 __u8* frame = self->tx_buff;
461 turnaround_time = get_turnaround_time( skb ); 450 turnaround_time = get_turnaround_time( skb );
462 frame= skb_push(skb, self->header_length);
463 irda_usb_build_header(self, frame, 0); 451 irda_usb_build_header(self, frame, 0);
464 frame[2] = turnaround_time; 452 frame[2] = turnaround_time;
465 if ((skb->len != 0) && 453 if ((skb->len != 0) &&
@@ -472,17 +460,17 @@ static int irda_usb_hard_xmit(struct sk_buff *skb, struct net_device *netdev)
472 frame[1] = 0; 460 frame[1] = 0;
473 } 461 }
474 } else { 462 } else {
475 irda_usb_build_header(self, skb_push(skb, self->header_length), 0); 463 irda_usb_build_header(self, self->tx_buff, 0);
476 } 464 }
477 465
478 /* FIXME: Make macro out of this one */ 466 /* FIXME: Make macro out of this one */
479 ((struct irda_skb_cb *)skb->cb)->context = self; 467 ((struct irda_skb_cb *)skb->cb)->context = self;
480 468
481 usb_fill_bulk_urb(urb, self->usbdev, 469 usb_fill_bulk_urb(urb, self->usbdev,
482 usb_sndbulkpipe(self->usbdev, self->bulk_out_ep), 470 usb_sndbulkpipe(self->usbdev, self->bulk_out_ep),
483 skb->data, IRDA_SKB_MAX_MTU, 471 self->tx_buff, skb->len + self->header_length,
484 write_bulk_callback, skb); 472 write_bulk_callback, skb);
485 urb->transfer_buffer_length = skb->len; 473
486 /* This flag (URB_ZERO_PACKET) indicates that what we send is not 474 /* This flag (URB_ZERO_PACKET) indicates that what we send is not
487 * a continuous stream of data but separate packets. 475 * a continuous stream of data but separate packets.
488 * In this case, the USB layer will insert an empty USB frame (TD) 476 * In this case, the USB layer will insert an empty USB frame (TD)
@@ -1455,6 +1443,9 @@ static inline void irda_usb_close(struct irda_usb_cb *self)
1455 /* Remove the speed buffer */ 1443 /* Remove the speed buffer */
1456 kfree(self->speed_buff); 1444 kfree(self->speed_buff);
1457 self->speed_buff = NULL; 1445 self->speed_buff = NULL;
1446
1447 kfree(self->tx_buff);
1448 self->tx_buff = NULL;
1458} 1449}
1459 1450
1460/********************** USB CONFIG SUBROUTINES **********************/ 1451/********************** USB CONFIG SUBROUTINES **********************/
@@ -1524,8 +1515,6 @@ static inline int irda_usb_parse_endpoints(struct irda_usb_cb *self, struct usb_
1524 1515
1525 IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n", 1516 IRDA_DEBUG(0, "%s(), And our endpoints are : in=%02X, out=%02X (%d), int=%02X\n",
1526 __FUNCTION__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep); 1517 __FUNCTION__, self->bulk_in_ep, self->bulk_out_ep, self->bulk_out_mtu, self->bulk_int_ep);
1527 /* Should be 8, 16, 32 or 64 bytes */
1528 IRDA_ASSERT(self->bulk_out_mtu == 64, ;);
1529 1518
1530 return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0)); 1519 return((self->bulk_in_ep != 0) && (self->bulk_out_ep != 0));
1531} 1520}
@@ -1753,9 +1742,14 @@ static int irda_usb_probe(struct usb_interface *intf,
1753 1742
1754 memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU); 1743 memset(self->speed_buff, 0, IRDA_USB_SPEED_MTU);
1755 1744
1745 self->tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self->header_length,
1746 GFP_KERNEL);
1747 if (self->tx_buff == NULL)
1748 goto err_out_4;
1749
1756 ret = irda_usb_open(self); 1750 ret = irda_usb_open(self);
1757 if (ret) 1751 if (ret)
1758 goto err_out_4; 1752 goto err_out_5;
1759 1753
1760 IRDA_MESSAGE("IrDA: Registered device %s\n", net->name); 1754 IRDA_MESSAGE("IrDA: Registered device %s\n", net->name);
1761 usb_set_intfdata(intf, self); 1755 usb_set_intfdata(intf, self);
@@ -1766,14 +1760,14 @@ static int irda_usb_probe(struct usb_interface *intf,
1766 self->needspatch = (ret < 0); 1760 self->needspatch = (ret < 0);
1767 if (self->needspatch) { 1761 if (self->needspatch) {
1768 IRDA_ERROR("STIR421X: Couldn't upload patch\n"); 1762 IRDA_ERROR("STIR421X: Couldn't upload patch\n");
1769 goto err_out_5; 1763 goto err_out_6;
1770 } 1764 }
1771 1765
1772 /* replace IrDA class descriptor with what patched device is now reporting */ 1766 /* replace IrDA class descriptor with what patched device is now reporting */
1773 irda_desc = irda_usb_find_class_desc (self->usbintf); 1767 irda_desc = irda_usb_find_class_desc (self->usbintf);
1774 if (irda_desc == NULL) { 1768 if (irda_desc == NULL) {
1775 ret = -ENODEV; 1769 ret = -ENODEV;
1776 goto err_out_5; 1770 goto err_out_6;
1777 } 1771 }
1778 if (self->irda_desc) 1772 if (self->irda_desc)
1779 kfree (self->irda_desc); 1773 kfree (self->irda_desc);
@@ -1782,9 +1776,10 @@ static int irda_usb_probe(struct usb_interface *intf,
1782 } 1776 }
1783 1777
1784 return 0; 1778 return 0;
1785 1779err_out_6:
1786err_out_5:
1787 unregister_netdev(self->netdev); 1780 unregister_netdev(self->netdev);
1781err_out_5:
1782 kfree(self->tx_buff);
1788err_out_4: 1783err_out_4:
1789 kfree(self->speed_buff); 1784 kfree(self->speed_buff);
1790err_out_3: 1785err_out_3:
diff --git a/drivers/net/irda/irda-usb.h b/drivers/net/irda/irda-usb.h
index 6b2271f18e77..e846c38224a3 100644
--- a/drivers/net/irda/irda-usb.h
+++ b/drivers/net/irda/irda-usb.h
@@ -156,6 +156,7 @@ struct irda_usb_cb {
156 struct irlap_cb *irlap; /* The link layer we are binded to */ 156 struct irlap_cb *irlap; /* The link layer we are binded to */
157 struct qos_info qos; 157 struct qos_info qos;
158 char *speed_buff; /* Buffer for speed changes */ 158 char *speed_buff; /* Buffer for speed changes */
159 char *tx_buff;
159 160
160 struct timeval stamp; 161 struct timeval stamp;
161 struct timeval now; 162 struct timeval now;
diff --git a/drivers/net/irda/stir4200.c b/drivers/net/irda/stir4200.c
index c14a74634fd5..20d306fea4cb 100644
--- a/drivers/net/irda/stir4200.c
+++ b/drivers/net/irda/stir4200.c
@@ -59,7 +59,7 @@
59#include <asm/byteorder.h> 59#include <asm/byteorder.h>
60#include <asm/unaligned.h> 60#include <asm/unaligned.h>
61 61
62MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); 62MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>");
63MODULE_DESCRIPTION("IrDA-USB Dongle Driver for SigmaTel STIr4200"); 63MODULE_DESCRIPTION("IrDA-USB Dongle Driver for SigmaTel STIr4200");
64MODULE_LICENSE("GPL"); 64MODULE_LICENSE("GPL");
65 65
diff --git a/drivers/net/irda/vlsi_ir.c b/drivers/net/irda/vlsi_ir.c
index 18c68193bf14..e2b1af618450 100644
--- a/drivers/net/irda/vlsi_ir.c
+++ b/drivers/net/irda/vlsi_ir.c
@@ -166,7 +166,7 @@ static void vlsi_proc_pdev(struct seq_file *seq, struct pci_dev *pdev)
166 unsigned i; 166 unsigned i;
167 167
168 seq_printf(seq, "\n%s (vid/did: %04x/%04x)\n", 168 seq_printf(seq, "\n%s (vid/did: %04x/%04x)\n",
169 PCIDEV_NAME(pdev), (int)pdev->vendor, (int)pdev->device); 169 pci_name(pdev), (int)pdev->vendor, (int)pdev->device);
170 seq_printf(seq, "pci-power-state: %u\n", (unsigned) pdev->current_state); 170 seq_printf(seq, "pci-power-state: %u\n", (unsigned) pdev->current_state);
171 seq_printf(seq, "resources: irq=%u / io=0x%04x / dma_mask=0x%016Lx\n", 171 seq_printf(seq, "resources: irq=%u / io=0x%04x / dma_mask=0x%016Lx\n",
172 pdev->irq, (unsigned)pci_resource_start(pdev, 0), (unsigned long long)pdev->dma_mask); 172 pdev->irq, (unsigned)pci_resource_start(pdev, 0), (unsigned long long)pdev->dma_mask);
@@ -1401,7 +1401,7 @@ static void vlsi_tx_timeout(struct net_device *ndev)
1401 1401
1402 if (vlsi_start_hw(idev)) 1402 if (vlsi_start_hw(idev))
1403 IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n", 1403 IRDA_ERROR("%s: failed to restart hw - %s(%s) unusable!\n",
1404 __FUNCTION__, PCIDEV_NAME(idev->pdev), ndev->name); 1404 __FUNCTION__, pci_name(idev->pdev), ndev->name);
1405 else 1405 else
1406 netif_start_queue(ndev); 1406 netif_start_queue(ndev);
1407} 1407}
@@ -1643,7 +1643,7 @@ vlsi_irda_probe(struct pci_dev *pdev, const struct pci_device_id *id)
1643 pdev->current_state = 0; /* hw must be running now */ 1643 pdev->current_state = 0; /* hw must be running now */
1644 1644
1645 IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n", 1645 IRDA_MESSAGE("%s: IrDA PCI controller %s detected\n",
1646 drivername, PCIDEV_NAME(pdev)); 1646 drivername, pci_name(pdev));
1647 1647
1648 if ( !pci_resource_start(pdev,0) 1648 if ( !pci_resource_start(pdev,0)
1649 || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) { 1649 || !(pci_resource_flags(pdev,0) & IORESOURCE_IO) ) {
@@ -1728,7 +1728,7 @@ static void __devexit vlsi_irda_remove(struct pci_dev *pdev)
1728 1728
1729 pci_set_drvdata(pdev, NULL); 1729 pci_set_drvdata(pdev, NULL);
1730 1730
1731 IRDA_MESSAGE("%s: %s removed\n", drivername, PCIDEV_NAME(pdev)); 1731 IRDA_MESSAGE("%s: %s removed\n", drivername, pci_name(pdev));
1732} 1732}
1733 1733
1734#ifdef CONFIG_PM 1734#ifdef CONFIG_PM
@@ -1748,7 +1748,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
1748 1748
1749 if (!ndev) { 1749 if (!ndev) {
1750 IRDA_ERROR("%s - %s: no netdevice \n", 1750 IRDA_ERROR("%s - %s: no netdevice \n",
1751 __FUNCTION__, PCIDEV_NAME(pdev)); 1751 __FUNCTION__, pci_name(pdev));
1752 return 0; 1752 return 0;
1753 } 1753 }
1754 idev = ndev->priv; 1754 idev = ndev->priv;
@@ -1759,7 +1759,7 @@ static int vlsi_irda_suspend(struct pci_dev *pdev, pm_message_t state)
1759 pdev->current_state = state.event; 1759 pdev->current_state = state.event;
1760 } 1760 }
1761 else 1761 else
1762 IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, PCIDEV_NAME(pdev), pdev->current_state, state.event); 1762 IRDA_ERROR("%s - %s: invalid suspend request %u -> %u\n", __FUNCTION__, pci_name(pdev), pdev->current_state, state.event);
1763 up(&idev->sem); 1763 up(&idev->sem);
1764 return 0; 1764 return 0;
1765 } 1765 }
@@ -1787,7 +1787,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev)
1787 1787
1788 if (!ndev) { 1788 if (!ndev) {
1789 IRDA_ERROR("%s - %s: no netdevice \n", 1789 IRDA_ERROR("%s - %s: no netdevice \n",
1790 __FUNCTION__, PCIDEV_NAME(pdev)); 1790 __FUNCTION__, pci_name(pdev));
1791 return 0; 1791 return 0;
1792 } 1792 }
1793 idev = ndev->priv; 1793 idev = ndev->priv;
@@ -1795,7 +1795,7 @@ static int vlsi_irda_resume(struct pci_dev *pdev)
1795 if (pdev->current_state == 0) { 1795 if (pdev->current_state == 0) {
1796 up(&idev->sem); 1796 up(&idev->sem);
1797 IRDA_WARNING("%s - %s: already resumed\n", 1797 IRDA_WARNING("%s - %s: already resumed\n",
1798 __FUNCTION__, PCIDEV_NAME(pdev)); 1798 __FUNCTION__, pci_name(pdev));
1799 return 0; 1799 return 0;
1800 } 1800 }
1801 1801
diff --git a/drivers/net/irda/vlsi_ir.h b/drivers/net/irda/vlsi_ir.h
index c37f0bc4c7f9..2d3b773d8e35 100644
--- a/drivers/net/irda/vlsi_ir.h
+++ b/drivers/net/irda/vlsi_ir.h
@@ -41,39 +41,6 @@
41#define PCI_CLASS_SUBCLASS_MASK 0xffff 41#define PCI_CLASS_SUBCLASS_MASK 0xffff
42#endif 42#endif
43 43
44/* in recent 2.5 interrupt handlers have non-void return value */
45#ifndef IRQ_RETVAL
46typedef void irqreturn_t;
47#define IRQ_NONE
48#define IRQ_HANDLED
49#define IRQ_RETVAL(x)
50#endif
51
52/* some stuff need to check kernelversion. Not all 2.5 stuff was present
53 * in early 2.5.x - the test is merely to separate 2.4 from 2.5
54 */
55#include <linux/version.h>
56
57#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)
58
59/* PDE() introduced in 2.5.4 */
60#ifdef CONFIG_PROC_FS
61#define PDE(inode) ((inode)->i_private)
62#endif
63
64/* irda crc16 calculation exported in 2.5.42 */
65#define irda_calc_crc16(fcs,buf,len) (GOOD_FCS)
66
67/* we use this for unified pci device name access */
68#define PCIDEV_NAME(pdev) ((pdev)->name)
69
70#else /* 2.5 or later */
71
72/* whatever we get from the associated struct device - bus:slot:dev.fn id */
73#define PCIDEV_NAME(pdev) (pci_name(pdev))
74
75#endif
76
77/* ================================================================ */ 44/* ================================================================ */
78 45
79/* non-standard PCI registers */ 46/* non-standard PCI registers */
diff --git a/drivers/net/mv643xx_eth.c b/drivers/net/mv643xx_eth.c
index c41ae4286eea..b3bf86422734 100644
--- a/drivers/net/mv643xx_eth.c
+++ b/drivers/net/mv643xx_eth.c
@@ -314,6 +314,13 @@ int mv643xx_eth_free_tx_descs(struct net_device *dev, int force)
314 314
315 while (mp->tx_desc_count > 0) { 315 while (mp->tx_desc_count > 0) {
316 spin_lock_irqsave(&mp->lock, flags); 316 spin_lock_irqsave(&mp->lock, flags);
317
318 /* tx_desc_count might have changed before acquiring the lock */
319 if (mp->tx_desc_count <= 0) {
320 spin_unlock_irqrestore(&mp->lock, flags);
321 return released;
322 }
323
317 tx_index = mp->tx_used_desc_q; 324 tx_index = mp->tx_used_desc_q;
318 desc = &mp->p_tx_desc_area[tx_index]; 325 desc = &mp->p_tx_desc_area[tx_index];
319 cmd_sts = desc->cmd_sts; 326 cmd_sts = desc->cmd_sts;
@@ -332,13 +339,13 @@ int mv643xx_eth_free_tx_descs(struct net_device *dev, int force)
332 if (skb) 339 if (skb)
333 mp->tx_skb[tx_index] = NULL; 340 mp->tx_skb[tx_index] = NULL;
334 341
335 spin_unlock_irqrestore(&mp->lock, flags);
336
337 if (cmd_sts & ETH_ERROR_SUMMARY) { 342 if (cmd_sts & ETH_ERROR_SUMMARY) {
338 printk("%s: Error in TX\n", dev->name); 343 printk("%s: Error in TX\n", dev->name);
339 mp->stats.tx_errors++; 344 mp->stats.tx_errors++;
340 } 345 }
341 346
347 spin_unlock_irqrestore(&mp->lock, flags);
348
342 if (cmd_sts & ETH_TX_FIRST_DESC) 349 if (cmd_sts & ETH_TX_FIRST_DESC)
343 dma_unmap_single(NULL, addr, count, DMA_TO_DEVICE); 350 dma_unmap_single(NULL, addr, count, DMA_TO_DEVICE);
344 else 351 else
diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index 6490acf05305..e8598b809228 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -63,12 +63,11 @@
63 63
64#include "netxen_nic_hw.h" 64#include "netxen_nic_hw.h"
65 65
66#define NETXEN_NIC_BUILD_NO "4" 66#define NETXEN_NIC_BUILD_NO "2"
67#define _NETXEN_NIC_LINUX_MAJOR 3 67#define _NETXEN_NIC_LINUX_MAJOR 3
68#define _NETXEN_NIC_LINUX_MINOR 3 68#define _NETXEN_NIC_LINUX_MINOR 3
69#define _NETXEN_NIC_LINUX_SUBVERSION 2 69#define _NETXEN_NIC_LINUX_SUBVERSION 3
70#define NETXEN_NIC_LINUX_VERSIONID "3.3.2" "-" NETXEN_NIC_BUILD_NO 70#define NETXEN_NIC_LINUX_VERSIONID "3.3.3" "-" NETXEN_NIC_BUILD_NO
71#define NETXEN_NIC_FW_VERSIONID "3.3.2"
72 71
73#define RCV_DESC_RINGSIZE \ 72#define RCV_DESC_RINGSIZE \
74 (sizeof(struct rcv_desc) * adapter->max_rx_desc_count) 73 (sizeof(struct rcv_desc) * adapter->max_rx_desc_count)
@@ -240,49 +239,39 @@ extern unsigned long long netxen_dma_mask;
240 239
241typedef u32 netxen_ctx_msg; 240typedef u32 netxen_ctx_msg;
242 241
243#define _netxen_set_bits(config_word, start, bits, val) {\
244 unsigned long long mask = (((1ULL << (bits)) - 1) << (start)); \
245 unsigned long long value = (val); \
246 (config_word) &= ~mask; \
247 (config_word) |= (((value) << (start)) & mask); \
248}
249
250#define netxen_set_msg_peg_id(config_word, val) \ 242#define netxen_set_msg_peg_id(config_word, val) \
251 _netxen_set_bits(config_word, 0, 2, val) 243 ((config_word) &= ~3, (config_word) |= val & 3)
252#define netxen_set_msg_privid(config_word) \ 244#define netxen_set_msg_privid(config_word) \
253 set_bit(2, (unsigned long*)&config_word) 245 ((config_word) |= 1 << 2)
254#define netxen_set_msg_count(config_word, val) \ 246#define netxen_set_msg_count(config_word, val) \
255 _netxen_set_bits(config_word, 3, 15, val) 247 ((config_word) &= ~(0x7fff<<3), (config_word) |= (val & 0x7fff) << 3)
256#define netxen_set_msg_ctxid(config_word, val) \ 248#define netxen_set_msg_ctxid(config_word, val) \
257 _netxen_set_bits(config_word, 18, 10, val) 249 ((config_word) &= ~(0x3ff<<18), (config_word) |= (val & 0x3ff) << 18)
258#define netxen_set_msg_opcode(config_word, val) \ 250#define netxen_set_msg_opcode(config_word, val) \
259 _netxen_set_bits(config_word, 28, 4, val) 251 ((config_word) &= ~(0xf<<24), (config_word) |= (val & 0xf) << 24)
260 252
261struct netxen_rcv_context { 253struct netxen_rcv_context {
262 u32 rcv_ring_addr_lo; 254 __le64 rcv_ring_addr;
263 u32 rcv_ring_addr_hi; 255 __le32 rcv_ring_size;
264 u32 rcv_ring_size; 256 __le32 rsrvd;
265 u32 rsrvd;
266}; 257};
267 258
268struct netxen_ring_ctx { 259struct netxen_ring_ctx {
269 260
270 /* one command ring */ 261 /* one command ring */
271 u64 cmd_consumer_offset; 262 __le64 cmd_consumer_offset;
272 u32 cmd_ring_addr_lo; 263 __le64 cmd_ring_addr;
273 u32 cmd_ring_addr_hi; 264 __le32 cmd_ring_size;
274 u32 cmd_ring_size; 265 __le32 rsrvd;
275 u32 rsrvd;
276 266
277 /* three receive rings */ 267 /* three receive rings */
278 struct netxen_rcv_context rcv_ctx[3]; 268 struct netxen_rcv_context rcv_ctx[3];
279 269
280 /* one status ring */ 270 /* one status ring */
281 u32 sts_ring_addr_lo; 271 __le64 sts_ring_addr;
282 u32 sts_ring_addr_hi; 272 __le32 sts_ring_size;
283 u32 sts_ring_size;
284 273
285 u32 ctx_id; 274 __le32 ctx_id;
286} __attribute__ ((aligned(64))); 275} __attribute__ ((aligned(64)));
287 276
288/* 277/*
@@ -306,81 +295,85 @@ struct netxen_ring_ctx {
306 ((cmd_desc)->port_ctxid |= ((var) & 0x0F)) 295 ((cmd_desc)->port_ctxid |= ((var) & 0x0F))
307 296
308#define netxen_set_cmd_desc_flags(cmd_desc, val) \ 297#define netxen_set_cmd_desc_flags(cmd_desc, val) \
309 _netxen_set_bits((cmd_desc)->flags_opcode, 0, 7, val) 298 ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x7f), \
299 (cmd_desc)->flags_opcode |= cpu_to_le16((val) & 0x7f))
310#define netxen_set_cmd_desc_opcode(cmd_desc, val) \ 300#define netxen_set_cmd_desc_opcode(cmd_desc, val) \
311 _netxen_set_bits((cmd_desc)->flags_opcode, 7, 6, val) 301 ((cmd_desc)->flags_opcode &= ~cpu_to_le16(0x3f<<7), \
302 (cmd_desc)->flags_opcode |= cpu_to_le16((val) & (0x3f<<7)))
312 303
313#define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \ 304#define netxen_set_cmd_desc_num_of_buff(cmd_desc, val) \
314 _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 0, 8, val); 305 ((cmd_desc)->num_of_buffers_total_length &= ~cpu_to_le32(0xff), \
306 (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32((val) & 0xff))
315#define netxen_set_cmd_desc_totallength(cmd_desc, val) \ 307#define netxen_set_cmd_desc_totallength(cmd_desc, val) \
316 _netxen_set_bits((cmd_desc)->num_of_buffers_total_length, 8, 24, val); 308 ((cmd_desc)->num_of_buffers_total_length &= cpu_to_le32(0xff), \
309 (cmd_desc)->num_of_buffers_total_length |= cpu_to_le32(val << 24))
317 310
318#define netxen_get_cmd_desc_opcode(cmd_desc) \ 311#define netxen_get_cmd_desc_opcode(cmd_desc) \
319 (((cmd_desc)->flags_opcode >> 7) & 0x003F) 312 ((le16_to_cpu((cmd_desc)->flags_opcode) >> 7) & 0x003F)
320#define netxen_get_cmd_desc_totallength(cmd_desc) \ 313#define netxen_get_cmd_desc_totallength(cmd_desc) \
321 (((cmd_desc)->num_of_buffers_total_length >> 8) & 0x0FFFFFF) 314 (le32_to_cpu((cmd_desc)->num_of_buffers_total_length) >> 8)
322 315
323struct cmd_desc_type0 { 316struct cmd_desc_type0 {
324 u8 tcp_hdr_offset; /* For LSO only */ 317 u8 tcp_hdr_offset; /* For LSO only */
325 u8 ip_hdr_offset; /* For LSO only */ 318 u8 ip_hdr_offset; /* For LSO only */
326 /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */ 319 /* Bit pattern: 0-6 flags, 7-12 opcode, 13-15 unused */
327 u16 flags_opcode; 320 __le16 flags_opcode;
328 /* Bit pattern: 0-7 total number of segments, 321 /* Bit pattern: 0-7 total number of segments,
329 8-31 Total size of the packet */ 322 8-31 Total size of the packet */
330 u32 num_of_buffers_total_length; 323 __le32 num_of_buffers_total_length;
331 union { 324 union {
332 struct { 325 struct {
333 u32 addr_low_part2; 326 __le32 addr_low_part2;
334 u32 addr_high_part2; 327 __le32 addr_high_part2;
335 }; 328 };
336 u64 addr_buffer2; 329 __le64 addr_buffer2;
337 }; 330 };
338 331
339 u16 reference_handle; /* changed to u16 to add mss */ 332 __le16 reference_handle; /* changed to u16 to add mss */
340 u16 mss; /* passed by NDIS_PACKET for LSO */ 333 __le16 mss; /* passed by NDIS_PACKET for LSO */
341 /* Bit pattern 0-3 port, 0-3 ctx id */ 334 /* Bit pattern 0-3 port, 0-3 ctx id */
342 u8 port_ctxid; 335 u8 port_ctxid;
343 u8 total_hdr_length; /* LSO only : MAC+IP+TCP Hdr size */ 336 u8 total_hdr_length; /* LSO only : MAC+IP+TCP Hdr size */
344 u16 conn_id; /* IPSec offoad only */ 337 __le16 conn_id; /* IPSec offoad only */
345 338
346 union { 339 union {
347 struct { 340 struct {
348 u32 addr_low_part3; 341 __le32 addr_low_part3;
349 u32 addr_high_part3; 342 __le32 addr_high_part3;
350 }; 343 };
351 u64 addr_buffer3; 344 __le64 addr_buffer3;
352 }; 345 };
353 union { 346 union {
354 struct { 347 struct {
355 u32 addr_low_part1; 348 __le32 addr_low_part1;
356 u32 addr_high_part1; 349 __le32 addr_high_part1;
357 }; 350 };
358 u64 addr_buffer1; 351 __le64 addr_buffer1;
359 }; 352 };
360 353
361 u16 buffer1_length; 354 __le16 buffer1_length;
362 u16 buffer2_length; 355 __le16 buffer2_length;
363 u16 buffer3_length; 356 __le16 buffer3_length;
364 u16 buffer4_length; 357 __le16 buffer4_length;
365 358
366 union { 359 union {
367 struct { 360 struct {
368 u32 addr_low_part4; 361 __le32 addr_low_part4;
369 u32 addr_high_part4; 362 __le32 addr_high_part4;
370 }; 363 };
371 u64 addr_buffer4; 364 __le64 addr_buffer4;
372 }; 365 };
373 366
374 u64 unused; 367 __le64 unused;
375 368
376} __attribute__ ((aligned(64))); 369} __attribute__ ((aligned(64)));
377 370
378/* Note: sizeof(rcv_desc) should always be a mutliple of 2 */ 371/* Note: sizeof(rcv_desc) should always be a mutliple of 2 */
379struct rcv_desc { 372struct rcv_desc {
380 u16 reference_handle; 373 __le16 reference_handle;
381 u16 reserved; 374 __le16 reserved;
382 u32 buffer_length; /* allocated buffer length (usually 2K) */ 375 __le32 buffer_length; /* allocated buffer length (usually 2K) */
383 u64 addr_buffer; 376 __le64 addr_buffer;
384}; 377};
385 378
386/* opcode field in status_desc */ 379/* opcode field in status_desc */
@@ -406,36 +399,36 @@ struct rcv_desc {
406 (((status_desc)->lro & 0x80) >> 7) 399 (((status_desc)->lro & 0x80) >> 7)
407 400
408#define netxen_get_sts_port(status_desc) \ 401#define netxen_get_sts_port(status_desc) \
409 ((status_desc)->status_desc_data & 0x0F) 402 (le64_to_cpu((status_desc)->status_desc_data) & 0x0F)
410#define netxen_get_sts_status(status_desc) \ 403#define netxen_get_sts_status(status_desc) \
411 (((status_desc)->status_desc_data >> 4) & 0x0F) 404 ((le64_to_cpu((status_desc)->status_desc_data) >> 4) & 0x0F)
412#define netxen_get_sts_type(status_desc) \ 405#define netxen_get_sts_type(status_desc) \
413 (((status_desc)->status_desc_data >> 8) & 0x0F) 406 ((le64_to_cpu((status_desc)->status_desc_data) >> 8) & 0x0F)
414#define netxen_get_sts_totallength(status_desc) \ 407#define netxen_get_sts_totallength(status_desc) \
415 (((status_desc)->status_desc_data >> 12) & 0xFFFF) 408 ((le64_to_cpu((status_desc)->status_desc_data) >> 12) & 0xFFFF)
416#define netxen_get_sts_refhandle(status_desc) \ 409#define netxen_get_sts_refhandle(status_desc) \
417 (((status_desc)->status_desc_data >> 28) & 0xFFFF) 410 ((le64_to_cpu((status_desc)->status_desc_data) >> 28) & 0xFFFF)
418#define netxen_get_sts_prot(status_desc) \ 411#define netxen_get_sts_prot(status_desc) \
419 (((status_desc)->status_desc_data >> 44) & 0x0F) 412 ((le64_to_cpu((status_desc)->status_desc_data) >> 44) & 0x0F)
420#define netxen_get_sts_owner(status_desc) \ 413#define netxen_get_sts_owner(status_desc) \
421 (((status_desc)->status_desc_data >> 56) & 0x03) 414 ((le64_to_cpu((status_desc)->status_desc_data) >> 56) & 0x03)
422#define netxen_get_sts_opcode(status_desc) \ 415#define netxen_get_sts_opcode(status_desc) \
423 (((status_desc)->status_desc_data >> 58) & 0x03F) 416 ((le64_to_cpu((status_desc)->status_desc_data) >> 58) & 0x03F)
424 417
425#define netxen_clear_sts_owner(status_desc) \ 418#define netxen_clear_sts_owner(status_desc) \
426 ((status_desc)->status_desc_data &= \ 419 ((status_desc)->status_desc_data &= \
427 ~(((unsigned long long)3) << 56 )) 420 ~cpu_to_le64(((unsigned long long)3) << 56 ))
428#define netxen_set_sts_owner(status_desc, val) \ 421#define netxen_set_sts_owner(status_desc, val) \
429 ((status_desc)->status_desc_data |= \ 422 ((status_desc)->status_desc_data |= \
430 (((unsigned long long)((val) & 0x3)) << 56 )) 423 cpu_to_le64(((unsigned long long)((val) & 0x3)) << 56 ))
431 424
432struct status_desc { 425struct status_desc {
433 /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length 426 /* Bit pattern: 0-3 port, 4-7 status, 8-11 type, 12-27 total_length
434 28-43 reference_handle, 44-47 protocol, 48-52 unused 427 28-43 reference_handle, 44-47 protocol, 48-52 unused
435 53-55 desc_cnt, 56-57 owner, 58-63 opcode 428 53-55 desc_cnt, 56-57 owner, 58-63 opcode
436 */ 429 */
437 u64 status_desc_data; 430 __le64 status_desc_data;
438 u32 hash_value; 431 __le32 hash_value;
439 u8 hash_type; 432 u8 hash_type;
440 u8 msg_type; 433 u8 msg_type;
441 u8 unused; 434 u8 unused;
@@ -1006,9 +999,9 @@ void netxen_niu_gbe_set_mii_mode(struct netxen_adapter *adapter, int port,
1006void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port, 999void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter, int port,
1007 long enable); 1000 long enable);
1008int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg, 1001int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, long reg,
1009 __le32 * readval); 1002 __u32 * readval);
1010int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy, 1003int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, long phy,
1011 long reg, __le32 val); 1004 long reg, __u32 val);
1012 1005
1013/* Functions available from netxen_nic_hw.c */ 1006/* Functions available from netxen_nic_hw.c */
1014int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu); 1007int netxen_nic_set_mtu_xgb(struct netxen_port *port, int new_mtu);
diff --git a/drivers/net/netxen/netxen_nic_ethtool.c b/drivers/net/netxen/netxen_nic_ethtool.c
index 34044616b3c8..c381d77a7336 100644
--- a/drivers/net/netxen/netxen_nic_ethtool.c
+++ b/drivers/net/netxen/netxen_nic_ethtool.c
@@ -218,7 +218,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
218{ 218{
219 struct netxen_port *port = netdev_priv(dev); 219 struct netxen_port *port = netdev_priv(dev);
220 struct netxen_adapter *adapter = port->adapter; 220 struct netxen_adapter *adapter = port->adapter;
221 __le32 status; 221 __u32 status;
222 222
223 /* read which mode */ 223 /* read which mode */
224 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 224 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
@@ -226,7 +226,7 @@ netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
226 if (adapter->phy_write 226 if (adapter->phy_write
227 && adapter->phy_write(adapter, port->portnum, 227 && adapter->phy_write(adapter, port->portnum,
228 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, 228 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
229 (__le32) ecmd->autoneg) != 0) 229 ecmd->autoneg) != 0)
230 return -EIO; 230 return -EIO;
231 else 231 else
232 port->link_autoneg = ecmd->autoneg; 232 port->link_autoneg = ecmd->autoneg;
@@ -279,7 +279,7 @@ static int netxen_nic_get_regs_len(struct net_device *dev)
279} 279}
280 280
281struct netxen_niu_regs { 281struct netxen_niu_regs {
282 __le32 reg[NETXEN_NIC_REGS_COUNT]; 282 __u32 reg[NETXEN_NIC_REGS_COUNT];
283}; 283};
284 284
285static struct netxen_niu_regs niu_registers[] = { 285static struct netxen_niu_regs niu_registers[] = {
@@ -372,7 +372,7 @@ netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
372{ 372{
373 struct netxen_port *port = netdev_priv(dev); 373 struct netxen_port *port = netdev_priv(dev);
374 struct netxen_adapter *adapter = port->adapter; 374 struct netxen_adapter *adapter = port->adapter;
375 __le32 mode, *regs_buff = p; 375 __u32 mode, *regs_buff = p;
376 void __iomem *addr; 376 void __iomem *addr;
377 int i, window; 377 int i, window;
378 378
@@ -415,7 +415,7 @@ static u32 netxen_nic_get_link(struct net_device *dev)
415{ 415{
416 struct netxen_port *port = netdev_priv(dev); 416 struct netxen_port *port = netdev_priv(dev);
417 struct netxen_adapter *adapter = port->adapter; 417 struct netxen_adapter *adapter = port->adapter;
418 __le32 status; 418 __u32 status;
419 419
420 /* read which mode */ 420 /* read which mode */
421 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 421 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
@@ -482,13 +482,13 @@ netxen_nic_get_pauseparam(struct net_device *dev,
482{ 482{
483 struct netxen_port *port = netdev_priv(dev); 483 struct netxen_port *port = netdev_priv(dev);
484 struct netxen_adapter *adapter = port->adapter; 484 struct netxen_adapter *adapter = port->adapter;
485 __le32 val; 485 __u32 val;
486 486
487 if (adapter->ahw.board_type == NETXEN_NIC_GBE) { 487 if (adapter->ahw.board_type == NETXEN_NIC_GBE) {
488 /* get flow control settings */ 488 /* get flow control settings */
489 netxen_nic_read_w0(adapter, 489 netxen_nic_read_w0(adapter,
490 NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), 490 NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum),
491 (u32 *) & val); 491 &val);
492 pause->rx_pause = netxen_gb_get_rx_flowctl(val); 492 pause->rx_pause = netxen_gb_get_rx_flowctl(val);
493 pause->tx_pause = netxen_gb_get_tx_flowctl(val); 493 pause->tx_pause = netxen_gb_get_tx_flowctl(val);
494 /* get autoneg settings */ 494 /* get autoneg settings */
@@ -502,7 +502,7 @@ netxen_nic_set_pauseparam(struct net_device *dev,
502{ 502{
503 struct netxen_port *port = netdev_priv(dev); 503 struct netxen_port *port = netdev_priv(dev);
504 struct netxen_adapter *adapter = port->adapter; 504 struct netxen_adapter *adapter = port->adapter;
505 __le32 val; 505 __u32 val;
506 unsigned int autoneg; 506 unsigned int autoneg;
507 507
508 /* read mode */ 508 /* read mode */
@@ -522,13 +522,13 @@ netxen_nic_set_pauseparam(struct net_device *dev,
522 522
523 netxen_nic_write_w0(adapter, 523 netxen_nic_write_w0(adapter,
524 NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum), 524 NETXEN_NIU_GB_MAC_CONFIG_0(port->portnum),
525 *(u32 *) (&val)); 525 *&val);
526 /* set autoneg */ 526 /* set autoneg */
527 autoneg = pause->autoneg; 527 autoneg = pause->autoneg;
528 if (adapter->phy_write 528 if (adapter->phy_write
529 && adapter->phy_write(adapter, port->portnum, 529 && adapter->phy_write(adapter, port->portnum,
530 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG, 530 NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
531 (__le32) autoneg) != 0) 531 autoneg) != 0)
532 return -EIO; 532 return -EIO;
533 else { 533 else {
534 port->link_autoneg = pause->autoneg; 534 port->link_autoneg = pause->autoneg;
@@ -543,7 +543,7 @@ static int netxen_nic_reg_test(struct net_device *dev)
543 struct netxen_port *port = netdev_priv(dev); 543 struct netxen_port *port = netdev_priv(dev);
544 struct netxen_adapter *adapter = port->adapter; 544 struct netxen_adapter *adapter = port->adapter;
545 u32 data_read, data_written, save; 545 u32 data_read, data_written, save;
546 __le32 mode; 546 __u32 mode;
547 547
548 /* 548 /*
549 * first test the "Read Only" registers by writing which mode 549 * first test the "Read Only" registers by writing which mode
diff --git a/drivers/net/netxen/netxen_nic_hw.c b/drivers/net/netxen/netxen_nic_hw.c
index c0c31d1914a7..f263232f499f 100644
--- a/drivers/net/netxen/netxen_nic_hw.c
+++ b/drivers/net/netxen/netxen_nic_hw.c
@@ -95,7 +95,7 @@ void netxen_nic_set_multi(struct net_device *netdev)
95 struct netxen_port *port = netdev_priv(netdev); 95 struct netxen_port *port = netdev_priv(netdev);
96 struct netxen_adapter *adapter = port->adapter; 96 struct netxen_adapter *adapter = port->adapter;
97 struct dev_mc_list *mc_ptr; 97 struct dev_mc_list *mc_ptr;
98 __le32 netxen_mac_addr_cntl_data = 0; 98 __u32 netxen_mac_addr_cntl_data = 0;
99 99
100 mc_ptr = netdev->mc_list; 100 mc_ptr = netdev->mc_list;
101 if (netdev->flags & IFF_PROMISC) { 101 if (netdev->flags & IFF_PROMISC) {
@@ -236,8 +236,9 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
236 } 236 }
237 memset(addr, 0, sizeof(struct netxen_ring_ctx)); 237 memset(addr, 0, sizeof(struct netxen_ring_ctx));
238 adapter->ctx_desc = (struct netxen_ring_ctx *)addr; 238 adapter->ctx_desc = (struct netxen_ring_ctx *)addr;
239 adapter->ctx_desc->cmd_consumer_offset = adapter->ctx_desc_phys_addr 239 adapter->ctx_desc->cmd_consumer_offset =
240 + sizeof(struct netxen_ring_ctx); 240 cpu_to_le64(adapter->ctx_desc_phys_addr +
241 sizeof(struct netxen_ring_ctx));
241 adapter->cmd_consumer = (uint32_t *) (((char *)addr) + 242 adapter->cmd_consumer = (uint32_t *) (((char *)addr) +
242 sizeof(struct netxen_ring_ctx)); 243 sizeof(struct netxen_ring_ctx));
243 244
@@ -253,11 +254,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
253 return -ENOMEM; 254 return -ENOMEM;
254 } 255 }
255 256
256 adapter->ctx_desc->cmd_ring_addr_lo = 257 adapter->ctx_desc->cmd_ring_addr =
257 hw->cmd_desc_phys_addr & 0xffffffffUL; 258 cpu_to_le64(hw->cmd_desc_phys_addr);
258 adapter->ctx_desc->cmd_ring_addr_hi = 259 adapter->ctx_desc->cmd_ring_size =
259 ((u64) hw->cmd_desc_phys_addr >> 32); 260 cpu_to_le32(adapter->max_tx_desc_count);
260 adapter->ctx_desc->cmd_ring_size = adapter->max_tx_desc_count;
261 261
262 hw->cmd_desc_head = (struct cmd_desc_type0 *)addr; 262 hw->cmd_desc_head = (struct cmd_desc_type0 *)addr;
263 263
@@ -278,12 +278,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
278 return err; 278 return err;
279 } 279 }
280 rcv_desc->desc_head = (struct rcv_desc *)addr; 280 rcv_desc->desc_head = (struct rcv_desc *)addr;
281 adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_lo = 281 adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr =
282 rcv_desc->phys_addr & 0xffffffffUL; 282 cpu_to_le64(rcv_desc->phys_addr);
283 adapter->ctx_desc->rcv_ctx[ring].rcv_ring_addr_hi =
284 ((u64) rcv_desc->phys_addr >> 32);
285 adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size = 283 adapter->ctx_desc->rcv_ctx[ring].rcv_ring_size =
286 rcv_desc->max_rx_desc_count; 284 cpu_to_le32(rcv_desc->max_rx_desc_count);
287 } 285 }
288 286
289 addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE, 287 addr = netxen_alloc(adapter->ahw.pdev, STATUS_DESC_RINGSIZE,
@@ -297,11 +295,10 @@ int netxen_nic_hw_resources(struct netxen_adapter *adapter)
297 return err; 295 return err;
298 } 296 }
299 recv_ctx->rcv_status_desc_head = (struct status_desc *)addr; 297 recv_ctx->rcv_status_desc_head = (struct status_desc *)addr;
300 adapter->ctx_desc->sts_ring_addr_lo = 298 adapter->ctx_desc->sts_ring_addr =
301 recv_ctx->rcv_status_desc_phys_addr & 0xffffffffUL; 299 cpu_to_le64(recv_ctx->rcv_status_desc_phys_addr);
302 adapter->ctx_desc->sts_ring_addr_hi = 300 adapter->ctx_desc->sts_ring_size =
303 ((u64) recv_ctx->rcv_status_desc_phys_addr >> 32); 301 cpu_to_le32(adapter->max_rx_desc_count);
304 adapter->ctx_desc->sts_ring_size = adapter->max_rx_desc_count;
305 302
306 } 303 }
307 /* Window = 1 */ 304 /* Window = 1 */
@@ -387,10 +384,6 @@ void netxen_tso_check(struct netxen_adapter *adapter,
387 } 384 }
388 adapter->stats.xmitcsummed++; 385 adapter->stats.xmitcsummed++;
389 desc->tcp_hdr_offset = skb->h.raw - skb->data; 386 desc->tcp_hdr_offset = skb->h.raw - skb->data;
390 netxen_set_cmd_desc_totallength(desc,
391 cpu_to_le32
392 (netxen_get_cmd_desc_totallength
393 (desc)));
394 desc->ip_hdr_offset = skb->nh.raw - skb->data; 387 desc->ip_hdr_offset = skb->nh.raw - skb->data;
395} 388}
396 389
@@ -867,9 +860,9 @@ netxen_crb_writelit_adapter(struct netxen_adapter *adapter, unsigned long off,
867void netxen_nic_set_link_parameters(struct netxen_port *port) 860void netxen_nic_set_link_parameters(struct netxen_port *port)
868{ 861{
869 struct netxen_adapter *adapter = port->adapter; 862 struct netxen_adapter *adapter = port->adapter;
870 __le32 status; 863 __u32 status;
871 __le32 autoneg; 864 __u32 autoneg;
872 __le32 mode; 865 __u32 mode;
873 866
874 netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode); 867 netxen_nic_read_w0(adapter, NETXEN_NIU_MODE, &mode);
875 if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */ 868 if (netxen_get_niu_enable_ge(mode)) { /* Gb 10/100/1000 Mbps mode */
@@ -984,7 +977,8 @@ void netxen_nic_flash_print(struct netxen_adapter *adapter)
984 _NETXEN_NIC_LINUX_MAJOR, fw_major); 977 _NETXEN_NIC_LINUX_MAJOR, fw_major);
985 adapter->driver_mismatch = 1; 978 adapter->driver_mismatch = 1;
986 } 979 }
987 if (fw_minor != _NETXEN_NIC_LINUX_MINOR) { 980 if (fw_minor != _NETXEN_NIC_LINUX_MINOR &&
981 fw_minor != (_NETXEN_NIC_LINUX_MINOR + 1)) {
988 printk(KERN_ERR "The mismatch in driver version and firmware " 982 printk(KERN_ERR "The mismatch in driver version and firmware "
989 "version minor number\n" 983 "version minor number\n"
990 "Driver version minor number = %d \t" 984 "Driver version minor number = %d \t"
diff --git a/drivers/net/netxen/netxen_nic_hw.h b/drivers/net/netxen/netxen_nic_hw.h
index 0685633a9c1e..ab1112eb1b0d 100644
--- a/drivers/net/netxen/netxen_nic_hw.h
+++ b/drivers/net/netxen/netxen_nic_hw.h
@@ -124,28 +124,28 @@ typedef enum {
124 */ 124 */
125 125
126#define netxen_gb_enable_tx(config_word) \ 126#define netxen_gb_enable_tx(config_word) \
127 set_bit(0, (unsigned long*)(&config_word)) 127 ((config_word) |= 1 << 0)
128#define netxen_gb_enable_rx(config_word) \ 128#define netxen_gb_enable_rx(config_word) \
129 set_bit(2, (unsigned long*)(&config_word)) 129 ((config_word) |= 1 << 2)
130#define netxen_gb_tx_flowctl(config_word) \ 130#define netxen_gb_tx_flowctl(config_word) \
131 set_bit(4, (unsigned long*)(&config_word)) 131 ((config_word) |= 1 << 4)
132#define netxen_gb_rx_flowctl(config_word) \ 132#define netxen_gb_rx_flowctl(config_word) \
133 set_bit(5, (unsigned long*)(&config_word)) 133 ((config_word) |= 1 << 5)
134#define netxen_gb_tx_reset_pb(config_word) \ 134#define netxen_gb_tx_reset_pb(config_word) \
135 set_bit(16, (unsigned long*)(&config_word)) 135 ((config_word) |= 1 << 16)
136#define netxen_gb_rx_reset_pb(config_word) \ 136#define netxen_gb_rx_reset_pb(config_word) \
137 set_bit(17, (unsigned long*)(&config_word)) 137 ((config_word) |= 1 << 17)
138#define netxen_gb_tx_reset_mac(config_word) \ 138#define netxen_gb_tx_reset_mac(config_word) \
139 set_bit(18, (unsigned long*)(&config_word)) 139 ((config_word) |= 1 << 18)
140#define netxen_gb_rx_reset_mac(config_word) \ 140#define netxen_gb_rx_reset_mac(config_word) \
141 set_bit(19, (unsigned long*)(&config_word)) 141 ((config_word) |= 1 << 19)
142#define netxen_gb_soft_reset(config_word) \ 142#define netxen_gb_soft_reset(config_word) \
143 set_bit(31, (unsigned long*)(&config_word)) 143 ((config_word) |= 1 << 31)
144 144
145#define netxen_gb_unset_tx_flowctl(config_word) \ 145#define netxen_gb_unset_tx_flowctl(config_word) \
146 clear_bit(4, (unsigned long *)(&config_word)) 146 ((config_word) &= ~(1 << 4))
147#define netxen_gb_unset_rx_flowctl(config_word) \ 147#define netxen_gb_unset_rx_flowctl(config_word) \
148 clear_bit(5, (unsigned long*)(&config_word)) 148 ((config_word) &= ~(1 << 5))
149 149
150#define netxen_gb_get_tx_synced(config_word) \ 150#define netxen_gb_get_tx_synced(config_word) \
151 _netxen_crb_get_bit((config_word), 1) 151 _netxen_crb_get_bit((config_word), 1)
@@ -171,15 +171,15 @@ typedef enum {
171 */ 171 */
172 172
173#define netxen_gb_set_duplex(config_word) \ 173#define netxen_gb_set_duplex(config_word) \
174 set_bit(0, (unsigned long*)&config_word) 174 ((config_word) |= 1 << 0)
175#define netxen_gb_set_crc_enable(config_word) \ 175#define netxen_gb_set_crc_enable(config_word) \
176 set_bit(1, (unsigned long*)&config_word) 176 ((config_word) |= 1 << 1)
177#define netxen_gb_set_padshort(config_word) \ 177#define netxen_gb_set_padshort(config_word) \
178 set_bit(2, (unsigned long*)&config_word) 178 ((config_word) |= 1 << 2)
179#define netxen_gb_set_checklength(config_word) \ 179#define netxen_gb_set_checklength(config_word) \
180 set_bit(4, (unsigned long*)&config_word) 180 ((config_word) |= 1 << 4)
181#define netxen_gb_set_hugeframes(config_word) \ 181#define netxen_gb_set_hugeframes(config_word) \
182 set_bit(5, (unsigned long*)&config_word) 182 ((config_word) |= 1 << 5)
183#define netxen_gb_set_preamblelen(config_word, val) \ 183#define netxen_gb_set_preamblelen(config_word, val) \
184 ((config_word) |= ((val) << 12) & 0xF000) 184 ((config_word) |= ((val) << 12) & 0xF000)
185#define netxen_gb_set_intfmode(config_word, val) \ 185#define netxen_gb_set_intfmode(config_word, val) \
@@ -190,9 +190,9 @@ typedef enum {
190#define netxen_gb_set_mii_mgmt_clockselect(config_word, val) \ 190#define netxen_gb_set_mii_mgmt_clockselect(config_word, val) \
191 ((config_word) |= ((val) & 0x07)) 191 ((config_word) |= ((val) & 0x07))
192#define netxen_gb_mii_mgmt_reset(config_word) \ 192#define netxen_gb_mii_mgmt_reset(config_word) \
193 set_bit(31, (unsigned long*)&config_word) 193 ((config_word) |= 1 << 31)
194#define netxen_gb_mii_mgmt_unset(config_word) \ 194#define netxen_gb_mii_mgmt_unset(config_word) \
195 clear_bit(31, (unsigned long*)&config_word) 195 ((config_word) &= ~(1 << 31))
196 196
197/* 197/*
198 * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3) 198 * NIU GB MII Mgmt Command Register (applies to GB0, GB1, GB2, GB3)
@@ -201,7 +201,7 @@ typedef enum {
201 */ 201 */
202 202
203#define netxen_gb_mii_mgmt_set_read_cycle(config_word) \ 203#define netxen_gb_mii_mgmt_set_read_cycle(config_word) \
204 set_bit(0, (unsigned long*)&config_word) 204 ((config_word) |= 1 << 0)
205#define netxen_gb_mii_mgmt_reg_addr(config_word, val) \ 205#define netxen_gb_mii_mgmt_reg_addr(config_word, val) \
206 ((config_word) |= ((val) & 0x1F)) 206 ((config_word) |= ((val) & 0x1F))
207#define netxen_gb_mii_mgmt_phy_addr(config_word, val) \ 207#define netxen_gb_mii_mgmt_phy_addr(config_word, val) \
@@ -274,9 +274,9 @@ typedef enum {
274#define netxen_set_phy_speed(config_word, val) \ 274#define netxen_set_phy_speed(config_word, val) \
275 ((config_word) |= ((val & 0x03) << 14)) 275 ((config_word) |= ((val & 0x03) << 14))
276#define netxen_set_phy_duplex(config_word) \ 276#define netxen_set_phy_duplex(config_word) \
277 set_bit(13, (unsigned long*)&config_word) 277 ((config_word) |= 1 << 13)
278#define netxen_clear_phy_duplex(config_word) \ 278#define netxen_clear_phy_duplex(config_word) \
279 clear_bit(13, (unsigned long*)&config_word) 279 ((config_word) &= ~(1 << 13))
280 280
281#define netxen_get_phy_jabber(config_word) \ 281#define netxen_get_phy_jabber(config_word) \
282 _netxen_crb_get_bit(config_word, 0) 282 _netxen_crb_get_bit(config_word, 0)
@@ -350,11 +350,11 @@ typedef enum {
350 _netxen_crb_get_bit(config_word, 15) 350 _netxen_crb_get_bit(config_word, 15)
351 351
352#define netxen_set_phy_int_link_status_changed(config_word) \ 352#define netxen_set_phy_int_link_status_changed(config_word) \
353 set_bit(10, (unsigned long*)&config_word) 353 ((config_word) |= 1 << 10)
354#define netxen_set_phy_int_autoneg_completed(config_word) \ 354#define netxen_set_phy_int_autoneg_completed(config_word) \
355 set_bit(11, (unsigned long*)&config_word) 355 ((config_word) |= 1 << 11)
356#define netxen_set_phy_int_speed_changed(config_word) \ 356#define netxen_set_phy_int_speed_changed(config_word) \
357 set_bit(14, (unsigned long*)&config_word) 357 ((config_word) |= 1 << 14)
358 358
359/* 359/*
360 * NIU Mode Register. 360 * NIU Mode Register.
@@ -382,22 +382,22 @@ typedef enum {
382 */ 382 */
383 383
384#define netxen_set_gb_drop_gb0(config_word) \ 384#define netxen_set_gb_drop_gb0(config_word) \
385 set_bit(0, (unsigned long*)&config_word) 385 ((config_word) |= 1 << 0)
386#define netxen_set_gb_drop_gb1(config_word) \ 386#define netxen_set_gb_drop_gb1(config_word) \
387 set_bit(1, (unsigned long*)&config_word) 387 ((config_word) |= 1 << 1)
388#define netxen_set_gb_drop_gb2(config_word) \ 388#define netxen_set_gb_drop_gb2(config_word) \
389 set_bit(2, (unsigned long*)&config_word) 389 ((config_word) |= 1 << 2)
390#define netxen_set_gb_drop_gb3(config_word) \ 390#define netxen_set_gb_drop_gb3(config_word) \
391 set_bit(3, (unsigned long*)&config_word) 391 ((config_word) |= 1 << 3)
392 392
393#define netxen_clear_gb_drop_gb0(config_word) \ 393#define netxen_clear_gb_drop_gb0(config_word) \
394 clear_bit(0, (unsigned long*)&config_word) 394 ((config_word) &= ~(1 << 0))
395#define netxen_clear_gb_drop_gb1(config_word) \ 395#define netxen_clear_gb_drop_gb1(config_word) \
396 clear_bit(1, (unsigned long*)&config_word) 396 ((config_word) &= ~(1 << 1))
397#define netxen_clear_gb_drop_gb2(config_word) \ 397#define netxen_clear_gb_drop_gb2(config_word) \
398 clear_bit(2, (unsigned long*)&config_word) 398 ((config_word) &= ~(1 << 2))
399#define netxen_clear_gb_drop_gb3(config_word) \ 399#define netxen_clear_gb_drop_gb3(config_word) \
400 clear_bit(3, (unsigned long*)&config_word) 400 ((config_word) &= ~(1 << 3))
401 401
402/* 402/*
403 * NIU XG MAC Config Register 403 * NIU XG MAC Config Register
@@ -413,7 +413,7 @@ typedef enum {
413 */ 413 */
414 414
415#define netxen_xg_soft_reset(config_word) \ 415#define netxen_xg_soft_reset(config_word) \
416 set_bit(4, (unsigned long*)&config_word) 416 ((config_word) |= 1 << 4)
417 417
418/* 418/*
419 * MAC Control Register 419 * MAC Control Register
@@ -433,19 +433,19 @@ typedef enum {
433#define netxen_nic_mcr_set_id_pool0(config, val) \ 433#define netxen_nic_mcr_set_id_pool0(config, val) \
434 ((config) |= ((val) &0x03)) 434 ((config) |= ((val) &0x03))
435#define netxen_nic_mcr_set_enable_xtnd0(config) \ 435#define netxen_nic_mcr_set_enable_xtnd0(config) \
436 (set_bit(3, (unsigned long *)&(config))) 436 ((config) |= 1 << 3)
437#define netxen_nic_mcr_set_id_pool1(config, val) \ 437#define netxen_nic_mcr_set_id_pool1(config, val) \
438 ((config) |= (((val) & 0x03) << 4)) 438 ((config) |= (((val) & 0x03) << 4))
439#define netxen_nic_mcr_set_enable_xtnd1(config) \ 439#define netxen_nic_mcr_set_enable_xtnd1(config) \
440 (set_bit(6, (unsigned long *)&(config))) 440 ((config) |= 1 << 6)
441#define netxen_nic_mcr_set_id_pool2(config, val) \ 441#define netxen_nic_mcr_set_id_pool2(config, val) \
442 ((config) |= (((val) & 0x03) << 8)) 442 ((config) |= (((val) & 0x03) << 8))
443#define netxen_nic_mcr_set_enable_xtnd2(config) \ 443#define netxen_nic_mcr_set_enable_xtnd2(config) \
444 (set_bit(10, (unsigned long *)&(config))) 444 ((config) |= 1 << 10)
445#define netxen_nic_mcr_set_id_pool3(config, val) \ 445#define netxen_nic_mcr_set_id_pool3(config, val) \
446 ((config) |= (((val) & 0x03) << 12)) 446 ((config) |= (((val) & 0x03) << 12))
447#define netxen_nic_mcr_set_enable_xtnd3(config) \ 447#define netxen_nic_mcr_set_enable_xtnd3(config) \
448 (set_bit(14, (unsigned long *)&(config))) 448 ((config) |= 1 << 14)
449#define netxen_nic_mcr_set_mode_select(config, val) \ 449#define netxen_nic_mcr_set_mode_select(config, val) \
450 ((config) |= (((val) & 0x03) << 24)) 450 ((config) |= (((val) & 0x03) << 24))
451#define netxen_nic_mcr_set_enable_pool(config, val) \ 451#define netxen_nic_mcr_set_enable_pool(config, val) \
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c
index c3e41f368554..973af96337a9 100644
--- a/drivers/net/netxen/netxen_nic_init.c
+++ b/drivers/net/netxen/netxen_nic_init.c
@@ -690,8 +690,7 @@ int netxen_nic_rx_has_work(struct netxen_adapter *adapter)
690 desc_head = recv_ctx->rcv_status_desc_head; 690 desc_head = recv_ctx->rcv_status_desc_head;
691 desc = &desc_head[consumer]; 691 desc = &desc_head[consumer];
692 692
693 if (((le16_to_cpu(netxen_get_sts_owner(desc))) 693 if (netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)
694 & STATUS_OWNER_HOST))
695 return 1; 694 return 1;
696 } 695 }
697 696
@@ -787,11 +786,11 @@ netxen_process_rcv(struct netxen_adapter *adapter, int ctxid,
787 struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)]; 786 struct netxen_port *port = adapter->port[netxen_get_sts_port(desc)];
788 struct pci_dev *pdev = port->pdev; 787 struct pci_dev *pdev = port->pdev;
789 struct net_device *netdev = port->netdev; 788 struct net_device *netdev = port->netdev;
790 int index = le16_to_cpu(netxen_get_sts_refhandle(desc)); 789 int index = netxen_get_sts_refhandle(desc);
791 struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]); 790 struct netxen_recv_context *recv_ctx = &(adapter->recv_ctx[ctxid]);
792 struct netxen_rx_buffer *buffer; 791 struct netxen_rx_buffer *buffer;
793 struct sk_buff *skb; 792 struct sk_buff *skb;
794 u32 length = le16_to_cpu(netxen_get_sts_totallength(desc)); 793 u32 length = netxen_get_sts_totallength(desc);
795 u32 desc_ctx; 794 u32 desc_ctx;
796 struct netxen_rcv_desc_ctx *rcv_desc; 795 struct netxen_rcv_desc_ctx *rcv_desc;
797 int ret; 796 int ret;
@@ -918,16 +917,14 @@ u32 netxen_process_rcv_ring(struct netxen_adapter *adapter, int ctxid, int max)
918 */ 917 */
919 while (count < max) { 918 while (count < max) {
920 desc = &desc_head[consumer]; 919 desc = &desc_head[consumer];
921 if (! 920 if (!(netxen_get_sts_owner(desc) & STATUS_OWNER_HOST)) {
922 (le16_to_cpu(netxen_get_sts_owner(desc)) &
923 STATUS_OWNER_HOST)) {
924 DPRINTK(ERR, "desc %p ownedby %x\n", desc, 921 DPRINTK(ERR, "desc %p ownedby %x\n", desc,
925 netxen_get_sts_owner(desc)); 922 netxen_get_sts_owner(desc));
926 break; 923 break;
927 } 924 }
928 netxen_process_rcv(adapter, ctxid, desc); 925 netxen_process_rcv(adapter, ctxid, desc);
929 netxen_clear_sts_owner(desc); 926 netxen_clear_sts_owner(desc);
930 netxen_set_sts_owner(desc, cpu_to_le16(STATUS_OWNER_PHANTOM)); 927 netxen_set_sts_owner(desc, STATUS_OWNER_PHANTOM);
931 consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1); 928 consumer = (consumer + 1) & (adapter->max_rx_desc_count - 1);
932 count++; 929 count++;
933 } 930 }
@@ -1232,7 +1229,7 @@ void netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, uint32_t ctx,
1232 1229
1233 /* make a rcv descriptor */ 1230 /* make a rcv descriptor */
1234 pdesc->reference_handle = cpu_to_le16(buffer->ref_handle); 1231 pdesc->reference_handle = cpu_to_le16(buffer->ref_handle);
1235 pdesc->buffer_length = cpu_to_le16(rcv_desc->dma_size); 1232 pdesc->buffer_length = cpu_to_le32(rcv_desc->dma_size);
1236 pdesc->addr_buffer = cpu_to_le64(buffer->dma); 1233 pdesc->addr_buffer = cpu_to_le64(buffer->dma);
1237 DPRINTK(INFO, "done writing descripter\n"); 1234 DPRINTK(INFO, "done writing descripter\n");
1238 producer = 1235 producer =
diff --git a/drivers/net/netxen/netxen_nic_isr.c b/drivers/net/netxen/netxen_nic_isr.c
index 06847d4252c3..be366e48007c 100644
--- a/drivers/net/netxen/netxen_nic_isr.c
+++ b/drivers/net/netxen/netxen_nic_isr.c
@@ -79,7 +79,7 @@ void netxen_indicate_link_status(struct netxen_adapter *adapter, u32 portno,
79void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno, 79void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno,
80 u32 enable) 80 u32 enable)
81{ 81{
82 __le32 int_src; 82 __u32 int_src;
83 struct netxen_port *port; 83 struct netxen_port *port;
84 84
85 /* This should clear the interrupt source */ 85 /* This should clear the interrupt source */
@@ -110,7 +110,7 @@ void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno,
110 /* write it down later.. */ 110 /* write it down later.. */
111 if ((netxen_get_phy_int_speed_changed(int_src)) 111 if ((netxen_get_phy_int_speed_changed(int_src))
112 || (netxen_get_phy_int_link_status_changed(int_src))) { 112 || (netxen_get_phy_int_link_status_changed(int_src))) {
113 __le32 status; 113 __u32 status;
114 114
115 DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n"); 115 DPRINTK(INFO, "SPEED CHANGED OR LINK STATUS CHANGED \n");
116 116
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index 8a5792fea774..69c1b9d23a1a 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -117,7 +117,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
117 void __iomem *mem_ptr1 = NULL; 117 void __iomem *mem_ptr1 = NULL;
118 void __iomem *mem_ptr2 = NULL; 118 void __iomem *mem_ptr2 = NULL;
119 119
120 u8 *db_ptr = NULL; 120 u8 __iomem *db_ptr = NULL;
121 unsigned long mem_base, mem_len, db_base, db_len; 121 unsigned long mem_base, mem_len, db_base, db_len;
122 int pci_using_dac, i, err; 122 int pci_using_dac, i, err;
123 int ring; 123 int ring;
@@ -191,7 +191,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
191 db_len); 191 db_len);
192 192
193 db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES); 193 db_ptr = ioremap(db_base, NETXEN_DB_MAPSIZE_BYTES);
194 if (db_ptr == 0UL) { 194 if (!db_ptr) {
195 printk(KERN_ERR "%s: Failed to allocate doorbell map.", 195 printk(KERN_ERR "%s: Failed to allocate doorbell map.",
196 netxen_nic_driver_name); 196 netxen_nic_driver_name);
197 err = -EIO; 197 err = -EIO;
@@ -818,7 +818,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
818 /* Take skb->data itself */ 818 /* Take skb->data itself */
819 pbuf = &adapter->cmd_buf_arr[producer]; 819 pbuf = &adapter->cmd_buf_arr[producer];
820 if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) { 820 if ((netdev->features & NETIF_F_TSO) && skb_shinfo(skb)->gso_size > 0) {
821 pbuf->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); 821 pbuf->mss = skb_shinfo(skb)->gso_size;
822 hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size); 822 hwdesc->mss = cpu_to_le16(skb_shinfo(skb)->gso_size);
823 } else { 823 } else {
824 pbuf->mss = 0; 824 pbuf->mss = 0;
@@ -882,7 +882,7 @@ static int netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
882 hwdesc->addr_buffer3 = cpu_to_le64(temp_dma); 882 hwdesc->addr_buffer3 = cpu_to_le64(temp_dma);
883 break; 883 break;
884 case 3: 884 case 3:
885 hwdesc->buffer4_length = temp_len; 885 hwdesc->buffer4_length = cpu_to_le16(temp_len);
886 hwdesc->addr_buffer4 = cpu_to_le64(temp_dma); 886 hwdesc->addr_buffer4 = cpu_to_le64(temp_dma);
887 break; 887 break;
888 } 888 }
@@ -1144,7 +1144,7 @@ static int __init netxen_init_module(void)
1144 if ((netxen_workq = create_singlethread_workqueue("netxen")) == 0) 1144 if ((netxen_workq = create_singlethread_workqueue("netxen")) == 0)
1145 return -ENOMEM; 1145 return -ENOMEM;
1146 1146
1147 return pci_module_init(&netxen_driver); 1147 return pci_register_driver(&netxen_driver);
1148} 1148}
1149 1149
1150module_init(netxen_init_module); 1150module_init(netxen_init_module);
diff --git a/drivers/net/netxen/netxen_nic_niu.c b/drivers/net/netxen/netxen_nic_niu.c
index 4987dc765d99..40d7003a371c 100644
--- a/drivers/net/netxen/netxen_nic_niu.c
+++ b/drivers/net/netxen/netxen_nic_niu.c
@@ -89,15 +89,15 @@ static inline int phy_unlock(struct netxen_adapter *adapter)
89 * 89 *
90 */ 90 */
91int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy, 91int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
92 long reg, __le32 * readval) 92 long reg, __u32 * readval)
93{ 93{
94 long timeout = 0; 94 long timeout = 0;
95 long result = 0; 95 long result = 0;
96 long restore = 0; 96 long restore = 0;
97 __le32 address; 97 __u32 address;
98 __le32 command; 98 __u32 command;
99 __le32 status; 99 __u32 status;
100 __le32 mac_cfg0; 100 __u32 mac_cfg0;
101 101
102 if (phy_lock(adapter) != 0) { 102 if (phy_lock(adapter) != 0) {
103 return -1; 103 return -1;
@@ -112,7 +112,7 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
112 &mac_cfg0, 4)) 112 &mac_cfg0, 4))
113 return -EIO; 113 return -EIO;
114 if (netxen_gb_get_soft_reset(mac_cfg0)) { 114 if (netxen_gb_get_soft_reset(mac_cfg0)) {
115 __le32 temp; 115 __u32 temp;
116 temp = 0; 116 temp = 0;
117 netxen_gb_tx_reset_pb(temp); 117 netxen_gb_tx_reset_pb(temp);
118 netxen_gb_rx_reset_pb(temp); 118 netxen_gb_rx_reset_pb(temp);
@@ -184,15 +184,15 @@ int netxen_niu_gbe_phy_read(struct netxen_adapter *adapter, long phy,
184 * 184 *
185 */ 185 */
186int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter, 186int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter,
187 long phy, long reg, __le32 val) 187 long phy, long reg, __u32 val)
188{ 188{
189 long timeout = 0; 189 long timeout = 0;
190 long result = 0; 190 long result = 0;
191 long restore = 0; 191 long restore = 0;
192 __le32 address; 192 __u32 address;
193 __le32 command; 193 __u32 command;
194 __le32 status; 194 __u32 status;
195 __le32 mac_cfg0; 195 __u32 mac_cfg0;
196 196
197 /* 197 /*
198 * MII mgmt all goes through port 0 MAC interface, so it 198 * MII mgmt all goes through port 0 MAC interface, so it
@@ -203,7 +203,7 @@ int netxen_niu_gbe_phy_write(struct netxen_adapter *adapter,
203 &mac_cfg0, 4)) 203 &mac_cfg0, 4))
204 return -EIO; 204 return -EIO;
205 if (netxen_gb_get_soft_reset(mac_cfg0)) { 205 if (netxen_gb_get_soft_reset(mac_cfg0)) {
206 __le32 temp; 206 __u32 temp;
207 temp = 0; 207 temp = 0;
208 netxen_gb_tx_reset_pb(temp); 208 netxen_gb_tx_reset_pb(temp);
209 netxen_gb_rx_reset_pb(temp); 209 netxen_gb_rx_reset_pb(temp);
@@ -269,7 +269,7 @@ int netxen_niu_gbe_enable_phy_interrupts(struct netxen_adapter *adapter,
269 int port) 269 int port)
270{ 270{
271 int result = 0; 271 int result = 0;
272 __le32 enable = 0; 272 __u32 enable = 0;
273 netxen_set_phy_int_link_status_changed(enable); 273 netxen_set_phy_int_link_status_changed(enable);
274 netxen_set_phy_int_autoneg_completed(enable); 274 netxen_set_phy_int_autoneg_completed(enable);
275 netxen_set_phy_int_speed_changed(enable); 275 netxen_set_phy_int_speed_changed(enable);
@@ -402,7 +402,7 @@ void netxen_niu_gbe_set_gmii_mode(struct netxen_adapter *adapter,
402int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port) 402int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
403{ 403{
404 int result = 0; 404 int result = 0;
405 __le32 status; 405 __u32 status;
406 if (adapter->disable_phy_interrupts) 406 if (adapter->disable_phy_interrupts)
407 adapter->disable_phy_interrupts(adapter, port); 407 adapter->disable_phy_interrupts(adapter, port);
408 mdelay(2); 408 mdelay(2);
@@ -410,7 +410,7 @@ int netxen_niu_gbe_init_port(struct netxen_adapter *adapter, int port)
410 if (0 == 410 if (0 ==
411 netxen_niu_gbe_phy_read(adapter, port, 411 netxen_niu_gbe_phy_read(adapter, port,
412 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, 412 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
413 (__le32 *) & status)) { 413 &status)) {
414 if (netxen_get_phy_link(status)) { 414 if (netxen_get_phy_link(status)) {
415 if (netxen_get_phy_speed(status) == 2) { 415 if (netxen_get_phy_speed(status) == 2) {
416 netxen_niu_gbe_set_gmii_mode(adapter, port, 1); 416 netxen_niu_gbe_set_gmii_mode(adapter, port, 1);
@@ -489,7 +489,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter,
489 int port, long enable) 489 int port, long enable)
490{ 490{
491 int result = 0; 491 int result = 0;
492 __le32 int_src; 492 __u32 int_src;
493 493
494 printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d" 494 printk(KERN_INFO PFX "NETXEN: Handling PHY interrupt on port %d"
495 " (device enable = %d)\n", (int)port, (int)enable); 495 " (device enable = %d)\n", (int)port, (int)enable);
@@ -530,7 +530,7 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter,
530 printk(KERN_INFO PFX "autoneg_error "); 530 printk(KERN_INFO PFX "autoneg_error ");
531 if ((netxen_get_phy_int_speed_changed(int_src)) 531 if ((netxen_get_phy_int_speed_changed(int_src))
532 || (netxen_get_phy_int_link_status_changed(int_src))) { 532 || (netxen_get_phy_int_link_status_changed(int_src))) {
533 __le32 status; 533 __u32 status;
534 534
535 printk(KERN_INFO PFX 535 printk(KERN_INFO PFX
536 "speed_changed or link status changed"); 536 "speed_changed or link status changed");
@@ -583,9 +583,9 @@ int netxen_niu_gbe_handle_phy_interrupt(struct netxen_adapter *adapter,
583int netxen_niu_macaddr_get(struct netxen_adapter *adapter, 583int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
584 int phy, netxen_ethernet_macaddr_t * addr) 584 int phy, netxen_ethernet_macaddr_t * addr)
585{ 585{
586 u64 result = 0; 586 u32 stationhigh;
587 __le32 stationhigh; 587 u32 stationlow;
588 __le32 stationlow; 588 u8 val[8];
589 589
590 if (addr == NULL) 590 if (addr == NULL)
591 return -EINVAL; 591 return -EINVAL;
@@ -598,10 +598,10 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
598 if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), 598 if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy),
599 &stationlow, 4)) 599 &stationlow, 4))
600 return -EIO; 600 return -EIO;
601 ((__le32 *)val)[1] = cpu_to_le32(stationhigh);
602 ((__le32 *)val)[0] = cpu_to_le32(stationlow);
601 603
602 result = (u64) netxen_gb_get_stationaddress_low(stationlow); 604 memcpy(addr, val + 2, 6);
603 result |= (u64) stationhigh << 16;
604 memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t));
605 605
606 return 0; 606 return 0;
607} 607}
@@ -613,24 +613,25 @@ int netxen_niu_macaddr_get(struct netxen_adapter *adapter,
613int netxen_niu_macaddr_set(struct netxen_port *port, 613int netxen_niu_macaddr_set(struct netxen_port *port,
614 netxen_ethernet_macaddr_t addr) 614 netxen_ethernet_macaddr_t addr)
615{ 615{
616 __le32 temp = 0; 616 u8 temp[4];
617 u32 val;
617 struct netxen_adapter *adapter = port->adapter; 618 struct netxen_adapter *adapter = port->adapter;
618 int phy = port->portnum; 619 int phy = port->portnum;
619 unsigned char mac_addr[6]; 620 unsigned char mac_addr[6];
620 int i; 621 int i;
621 622
622 for (i = 0; i < 10; i++) { 623 for (i = 0; i < 10; i++) {
623 memcpy(&temp, addr, 2); 624 temp[0] = temp[1] = 0;
624 temp <<= 16; 625 memcpy(temp + 2, addr, 2);
626 val = le32_to_cpu(*(__le32 *)temp);
625 if (netxen_nic_hw_write_wx 627 if (netxen_nic_hw_write_wx
626 (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &temp, 4)) 628 (adapter, NETXEN_NIU_GB_STATION_ADDR_1(phy), &val, 4))
627 return -EIO; 629 return -EIO;
628 630
629 temp = 0; 631 memcpy(temp, ((u8 *) addr) + 2, sizeof(__le32));
630 632 val = le32_to_cpu(*(__le32 *)temp);
631 memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32));
632 if (netxen_nic_hw_write_wx 633 if (netxen_nic_hw_write_wx
633 (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &temp, 4)) 634 (adapter, NETXEN_NIU_GB_STATION_ADDR_0(phy), &val, 4))
634 return -2; 635 return -2;
635 636
636 netxen_niu_macaddr_get(adapter, phy, 637 netxen_niu_macaddr_get(adapter, phy,
@@ -659,9 +660,9 @@ int netxen_niu_macaddr_set(struct netxen_port *port,
659int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter, 660int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter,
660 int port, netxen_niu_gbe_ifmode_t mode) 661 int port, netxen_niu_gbe_ifmode_t mode)
661{ 662{
662 __le32 mac_cfg0; 663 __u32 mac_cfg0;
663 __le32 mac_cfg1; 664 __u32 mac_cfg1;
664 __le32 mii_cfg; 665 __u32 mii_cfg;
665 666
666 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) 667 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
667 return -EINVAL; 668 return -EINVAL;
@@ -736,7 +737,7 @@ int netxen_niu_enable_gbe_port(struct netxen_adapter *adapter,
736/* Disable a GbE interface */ 737/* Disable a GbE interface */
737int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port) 738int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port)
738{ 739{
739 __le32 mac_cfg0; 740 __u32 mac_cfg0;
740 741
741 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) 742 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
742 return -EINVAL; 743 return -EINVAL;
@@ -752,7 +753,7 @@ int netxen_niu_disable_gbe_port(struct netxen_adapter *adapter, int port)
752/* Disable an XG interface */ 753/* Disable an XG interface */
753int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port) 754int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port)
754{ 755{
755 __le32 mac_cfg; 756 __u32 mac_cfg;
756 757
757 if (port != 0) 758 if (port != 0)
758 return -EINVAL; 759 return -EINVAL;
@@ -769,7 +770,7 @@ int netxen_niu_disable_xg_port(struct netxen_adapter *adapter, int port)
769int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port, 770int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port,
770 netxen_niu_prom_mode_t mode) 771 netxen_niu_prom_mode_t mode)
771{ 772{
772 __le32 reg; 773 __u32 reg;
773 774
774 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) 775 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
775 return -EINVAL; 776 return -EINVAL;
@@ -826,22 +827,21 @@ int netxen_niu_set_promiscuous_mode(struct netxen_adapter *adapter, int port,
826int netxen_niu_xg_macaddr_set(struct netxen_port *port, 827int netxen_niu_xg_macaddr_set(struct netxen_port *port,
827 netxen_ethernet_macaddr_t addr) 828 netxen_ethernet_macaddr_t addr)
828{ 829{
829 __le32 temp = 0; 830 u8 temp[4];
831 u32 val;
830 struct netxen_adapter *adapter = port->adapter; 832 struct netxen_adapter *adapter = port->adapter;
831 833
832 memcpy(&temp, addr, 2); 834 temp[0] = temp[1] = 0;
833 temp = cpu_to_le32(temp); 835 memcpy(temp + 2, addr, 2);
834 temp <<= 16; 836 val = le32_to_cpu(*(__le32 *)temp);
835 if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, 837 if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1,
836 &temp, 4)) 838 &val, 4))
837 return -EIO; 839 return -EIO;
838 840
839 temp = 0;
840
841 memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32)); 841 memcpy(&temp, ((u8 *) addr) + 2, sizeof(__le32));
842 temp = cpu_to_le32(temp); 842 val = le32_to_cpu(*(__le32 *)temp);
843 if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI, 843 if (netxen_nic_hw_write_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_HI,
844 &temp, 4)) 844 &val, 4))
845 return -EIO; 845 return -EIO;
846 846
847 return 0; 847 return 0;
@@ -854,9 +854,9 @@ int netxen_niu_xg_macaddr_set(struct netxen_port *port,
854int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy, 854int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy,
855 netxen_ethernet_macaddr_t * addr) 855 netxen_ethernet_macaddr_t * addr)
856{ 856{
857 __le32 stationhigh; 857 u32 stationhigh;
858 __le32 stationlow; 858 u32 stationlow;
859 u64 result; 859 u8 val[8];
860 860
861 if (addr == NULL) 861 if (addr == NULL)
862 return -EINVAL; 862 return -EINVAL;
@@ -869,10 +869,10 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy,
869 if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1, 869 if (netxen_nic_hw_read_wx(adapter, NETXEN_NIU_XGE_STATION_ADDR_0_1,
870 &stationlow, 4)) 870 &stationlow, 4))
871 return -EIO; 871 return -EIO;
872 ((__le32 *)val)[1] = cpu_to_le32(stationhigh);
873 ((__le32 *)val)[0] = cpu_to_le32(stationlow);
872 874
873 result = ((u64) stationlow) >> 16; 875 memcpy(addr, val + 2, 6);
874 result |= (u64) stationhigh << 16;
875 memcpy(*addr, &result, sizeof(netxen_ethernet_macaddr_t));
876 876
877 return 0; 877 return 0;
878} 878}
@@ -880,7 +880,7 @@ int netxen_niu_xg_macaddr_get(struct netxen_adapter *adapter, int phy,
880int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter, 880int netxen_niu_xg_set_promiscuous_mode(struct netxen_adapter *adapter,
881 int port, netxen_niu_prom_mode_t mode) 881 int port, netxen_niu_prom_mode_t mode)
882{ 882{
883 __le32 reg; 883 __u32 reg;
884 884
885 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS)) 885 if ((port < 0) || (port > NETXEN_NIU_MAX_GBE_PORTS))
886 return -EINVAL; 886 return -EINVAL;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index 342f4062de0b..461e8274ef69 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -606,11 +606,14 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
606{ 606{
607 kio_addr_t ioaddr = dev->base_addr; 607 kio_addr_t ioaddr = dev->base_addr;
608 struct el3_private *priv = netdev_priv(dev); 608 struct el3_private *priv = netdev_priv(dev);
609 unsigned long flags;
609 610
610 DEBUG(3, "%s: el3_start_xmit(length = %ld) called, " 611 DEBUG(3, "%s: el3_start_xmit(length = %ld) called, "
611 "status %4.4x.\n", dev->name, (long)skb->len, 612 "status %4.4x.\n", dev->name, (long)skb->len,
612 inw(ioaddr + EL3_STATUS)); 613 inw(ioaddr + EL3_STATUS));
613 614
615 spin_lock_irqsave(&priv->lock, flags);
616
614 priv->stats.tx_bytes += skb->len; 617 priv->stats.tx_bytes += skb->len;
615 618
616 /* Put out the doubleword header... */ 619 /* Put out the doubleword header... */
@@ -628,6 +631,7 @@ static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
628 631
629 dev_kfree_skb(skb); 632 dev_kfree_skb(skb);
630 pop_tx_status(dev); 633 pop_tx_status(dev);
634 spin_unlock_irqrestore(&priv->lock, flags);
631 635
632 return 0; 636 return 0;
633} 637}
@@ -729,14 +733,13 @@ static void media_check(unsigned long arg)
729 733
730 if (!netif_device_present(dev)) goto reschedule; 734 if (!netif_device_present(dev)) goto reschedule;
731 735
732 EL3WINDOW(1);
733 /* Check for pending interrupt with expired latency timer: with 736 /* Check for pending interrupt with expired latency timer: with
734 this, we can limp along even if the interrupt is blocked */ 737 this, we can limp along even if the interrupt is blocked */
735 if ((inw(ioaddr + EL3_STATUS) & IntLatch) && 738 if ((inw(ioaddr + EL3_STATUS) & IntLatch) &&
736 (inb(ioaddr + EL3_TIMER) == 0xff)) { 739 (inb(ioaddr + EL3_TIMER) == 0xff)) {
737 if (!lp->fast_poll) 740 if (!lp->fast_poll)
738 printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name); 741 printk(KERN_WARNING "%s: interrupt(s) dropped!\n", dev->name);
739 el3_interrupt(dev->irq, lp); 742 el3_interrupt(dev->irq, dev);
740 lp->fast_poll = HZ; 743 lp->fast_poll = HZ;
741 } 744 }
742 if (lp->fast_poll) { 745 if (lp->fast_poll) {
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c
index 096d4a100bf2..86135397f430 100644
--- a/drivers/net/phy/fixed.c
+++ b/drivers/net/phy/fixed.c
@@ -349,7 +349,7 @@ static int __init fixed_init(void)
349 fixed_mdio_register_device(0, 100, 1); 349 fixed_mdio_register_device(0, 100, 1);
350#endif 350#endif
351 351
352#ifdef CONFIX_FIXED_MII_10_FDX 352#ifdef CONFIG_FIXED_MII_10_FDX
353 fixed_mdio_register_device(0, 10, 1); 353 fixed_mdio_register_device(0, 10, 1);
354#endif 354#endif
355 return 0; 355 return 0;
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index e175f3910b18..9765fa661467 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -286,6 +286,7 @@ int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd)
286 286
287 return 0; 287 return 0;
288} 288}
289EXPORT_SYMBOL(phy_ethtool_sset);
289 290
290int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd) 291int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd)
291{ 292{
@@ -302,7 +303,7 @@ int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd)
302 303
303 return 0; 304 return 0;
304} 305}
305 306EXPORT_SYMBOL(phy_ethtool_gset);
306 307
307/* Note that this function is currently incompatible with the 308/* Note that this function is currently incompatible with the
308 * PHYCONTROL layer. It changes registers without regard to 309 * PHYCONTROL layer. It changes registers without regard to
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c
index 250cdbeefdfd..1dd66b8ea0fa 100644
--- a/drivers/net/s2io.c
+++ b/drivers/net/s2io.c
@@ -556,10 +556,9 @@ static int init_shared_mem(struct s2io_nic *nic)
556 } 556 }
557 } 557 }
558 558
559 nic->ufo_in_band_v = kmalloc((sizeof(u64) * size), GFP_KERNEL); 559 nic->ufo_in_band_v = kcalloc(size, sizeof(u64), GFP_KERNEL);
560 if (!nic->ufo_in_band_v) 560 if (!nic->ufo_in_band_v)
561 return -ENOMEM; 561 return -ENOMEM;
562 memset(nic->ufo_in_band_v, 0, size);
563 562
564 /* Allocation and initialization of RXDs in Rings */ 563 /* Allocation and initialization of RXDs in Rings */
565 size = 0; 564 size = 0;
diff --git a/drivers/net/skge.c b/drivers/net/skge.c
index deedfd5f8226..45283f3f95e4 100644
--- a/drivers/net/skge.c
+++ b/drivers/net/skge.c
@@ -60,7 +60,7 @@
60#define LINK_HZ (HZ/2) 60#define LINK_HZ (HZ/2)
61 61
62MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver"); 62MODULE_DESCRIPTION("SysKonnect Gigabit Ethernet driver");
63MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); 63MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>");
64MODULE_LICENSE("GPL"); 64MODULE_LICENSE("GPL");
65MODULE_VERSION(DRV_VERSION); 65MODULE_VERSION(DRV_VERSION);
66 66
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index a6601e8d423c..822dd0b13133 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -3639,29 +3639,6 @@ static int sky2_resume(struct pci_dev *pdev)
3639out: 3639out:
3640 return err; 3640 return err;
3641} 3641}
3642
3643/* BIOS resume runs after device (it's a bug in PM)
3644 * as a temporary workaround on suspend/resume leave MSI disabled
3645 */
3646static int sky2_suspend_late(struct pci_dev *pdev, pm_message_t state)
3647{
3648 struct sky2_hw *hw = pci_get_drvdata(pdev);
3649
3650 free_irq(pdev->irq, hw);
3651 if (hw->msi) {
3652 pci_disable_msi(pdev);
3653 hw->msi = 0;
3654 }
3655 return 0;
3656}
3657
3658static int sky2_resume_early(struct pci_dev *pdev)
3659{
3660 struct sky2_hw *hw = pci_get_drvdata(pdev);
3661 struct net_device *dev = hw->dev[0];
3662
3663 return request_irq(pdev->irq, sky2_intr, IRQF_SHARED, dev->name, hw);
3664}
3665#endif 3642#endif
3666 3643
3667static struct pci_driver sky2_driver = { 3644static struct pci_driver sky2_driver = {
@@ -3672,8 +3649,6 @@ static struct pci_driver sky2_driver = {
3672#ifdef CONFIG_PM 3649#ifdef CONFIG_PM
3673 .suspend = sky2_suspend, 3650 .suspend = sky2_suspend,
3674 .resume = sky2_resume, 3651 .resume = sky2_resume,
3675 .suspend_late = sky2_suspend_late,
3676 .resume_early = sky2_resume_early,
3677#endif 3652#endif
3678}; 3653};
3679 3654
@@ -3691,6 +3666,6 @@ module_init(sky2_init_module);
3691module_exit(sky2_cleanup_module); 3666module_exit(sky2_cleanup_module);
3692 3667
3693MODULE_DESCRIPTION("Marvell Yukon 2 Gigabit Ethernet driver"); 3668MODULE_DESCRIPTION("Marvell Yukon 2 Gigabit Ethernet driver");
3694MODULE_AUTHOR("Stephen Hemminger <shemminger@osdl.org>"); 3669MODULE_AUTHOR("Stephen Hemminger <shemminger@linux-foundation.org>");
3695MODULE_LICENSE("GPL"); 3670MODULE_LICENSE("GPL");
3696MODULE_VERSION(DRV_VERSION); 3671MODULE_VERSION(DRV_VERSION);
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index 880d9fdd7c67..43af61438449 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -968,11 +968,11 @@ static void smc911x_phy_configure(struct work_struct *work)
968 * We should not be called if phy_type is zero. 968 * We should not be called if phy_type is zero.
969 */ 969 */
970 if (lp->phy_type == 0) 970 if (lp->phy_type == 0)
971 goto smc911x_phy_configure_exit; 971 goto smc911x_phy_configure_exit_nolock;
972 972
973 if (smc911x_phy_reset(dev, phyaddr)) { 973 if (smc911x_phy_reset(dev, phyaddr)) {
974 printk("%s: PHY reset timed out\n", dev->name); 974 printk("%s: PHY reset timed out\n", dev->name);
975 goto smc911x_phy_configure_exit; 975 goto smc911x_phy_configure_exit_nolock;
976 } 976 }
977 spin_lock_irqsave(&lp->lock, flags); 977 spin_lock_irqsave(&lp->lock, flags);
978 978
@@ -1041,6 +1041,7 @@ static void smc911x_phy_configure(struct work_struct *work)
1041 1041
1042smc911x_phy_configure_exit: 1042smc911x_phy_configure_exit:
1043 spin_unlock_irqrestore(&lp->lock, flags); 1043 spin_unlock_irqrestore(&lp->lock, flags);
1044smc911x_phy_configure_exit_nolock:
1044 lp->work_pending = 0; 1045 lp->work_pending = 0;
1045} 1046}
1046 1047
diff --git a/drivers/net/spider_net.c b/drivers/net/spider_net.c
index ebb6aa39f9c7..8ea2fc1b96cb 100644
--- a/drivers/net/spider_net.c
+++ b/drivers/net/spider_net.c
@@ -1925,6 +1925,8 @@ spider_net_stop(struct net_device *netdev)
1925 /* release chains */ 1925 /* release chains */
1926 spider_net_release_tx_chain(card, 1); 1926 spider_net_release_tx_chain(card, 1);
1927 1927
1928 spider_net_free_rx_chain_contents(card);
1929
1928 spider_net_free_chain(card, &card->tx_chain); 1930 spider_net_free_chain(card, &card->tx_chain);
1929 spider_net_free_chain(card, &card->rx_chain); 1931 spider_net_free_chain(card, &card->rx_chain);
1930 1932