aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/3c59x.c14
-rw-r--r--drivers/net/a2065.c12
-rw-r--r--drivers/net/arcnet/arcnet.c26
-rw-r--r--drivers/net/atl1c/atl1c_ethtool.c8
-rw-r--r--drivers/net/atlx/atl1.c8
-rw-r--r--drivers/net/bmac.c7
-rw-r--r--drivers/net/bnx2x_main.c7
-rw-r--r--drivers/net/dl2k.c17
-rw-r--r--drivers/net/e1000e/ich8lan.c94
-rw-r--r--drivers/net/ehea/ehea.h2
-rw-r--r--drivers/net/ehea/ehea_main.c3
-rw-r--r--drivers/net/epic100.c5
-rw-r--r--drivers/net/fealnx.c15
-rw-r--r--drivers/net/fec.c9
-rw-r--r--drivers/net/gianfar.c12
-rw-r--r--drivers/net/hamachi.c23
-rw-r--r--drivers/net/hamradio/baycom_epp.c2
-rw-r--r--drivers/net/hamradio/baycom_par.c2
-rw-r--r--drivers/net/hamradio/baycom_ser_fdx.c2
-rw-r--r--drivers/net/hamradio/baycom_ser_hdx.c2
-rw-r--r--drivers/net/igbvf/vf.c4
-rw-r--r--drivers/net/irda/irtty-sir.c1
-rw-r--r--drivers/net/irda/w83977af_ir.c2
-rw-r--r--drivers/net/ixgbe/ixgbe.h2
-rw-r--r--drivers/net/ixgbe/ixgbe_82598.c67
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c86
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h8
-rw-r--r--drivers/net/mlx4/cmd.c5
-rw-r--r--drivers/net/mlx4/en_rx.c5
-rw-r--r--drivers/net/mlx4/en_tx.c1
-rw-r--r--drivers/net/mlx4/main.c6
-rw-r--r--drivers/net/natsemi.c4
-rw-r--r--drivers/net/ne.c2
-rw-r--r--drivers/net/netxen/netxen_nic_main.c41
-rw-r--r--drivers/net/pci-skeleton.c2
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c13
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c15
-rw-r--r--drivers/net/pcnet32.c82
-rw-r--r--drivers/net/ppp_async.c1
-rw-r--r--drivers/net/ppp_generic.c34
-rw-r--r--drivers/net/ppp_synctty.c1
-rw-r--r--drivers/net/pppol2tp.c1
-rw-r--r--drivers/net/s6gmac.c2
-rw-r--r--drivers/net/sky2.c14
-rw-r--r--drivers/net/sky2.h1
-rw-r--r--drivers/net/starfire.c2
-rw-r--r--drivers/net/sundance.c6
-rw-r--r--drivers/net/tsi108_eth.c8
-rw-r--r--drivers/net/tulip/de2104x.c7
-rw-r--r--drivers/net/tulip/de4x5.c6
-rw-r--r--drivers/net/tulip/tulip_core.c14
-rw-r--r--drivers/net/tulip/winbond-840.c6
-rw-r--r--drivers/net/tun.c50
-rw-r--r--drivers/net/wan/hd64570.c3
-rw-r--r--drivers/net/wan/hd64572.c3
-rw-r--r--drivers/net/wan/sbni.c8
-rw-r--r--drivers/net/wireless/ath/ar9170/main.c5
-rw-r--r--drivers/net/wireless/ath/ar9170/usb.c6
-rw-r--r--drivers/net/wireless/ipw2x00/ipw2200.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c3
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c12
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c3
-rw-r--r--drivers/net/wireless/iwmc3200wifi/commands.c1
-rw-r--r--drivers/net/wireless/libertas/11d.c2
-rw-r--r--drivers/net/wireless/libertas/assoc.c18
-rw-r--r--drivers/net/wireless/libertas/hostcmd.h4
-rw-r--r--drivers/net/wireless/mwl8k.c31
-rw-r--r--drivers/net/wireless/ray_cs.c9
-rw-r--r--drivers/net/wireless/wavelan_cs.c13
-rw-r--r--drivers/net/yellowfin.c23
-rw-r--r--drivers/net/zorro8390.c3
71 files changed, 509 insertions, 409 deletions
diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 202048450eed..beb040264dbd 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -235,6 +235,7 @@ enum vortex_chips {
235 CH_3C900B_FL, 235 CH_3C900B_FL,
236 CH_3C905_1, 236 CH_3C905_1,
237 CH_3C905_2, 237 CH_3C905_2,
238 CH_3C905B_TX,
238 CH_3C905B_1, 239 CH_3C905B_1,
239 240
240 CH_3C905B_2, 241 CH_3C905B_2,
@@ -307,6 +308,8 @@ static struct vortex_chip_info {
307 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, }, 308 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
308 {"3c905 Boomerang 100baseT4", 309 {"3c905 Boomerang 100baseT4",
309 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, }, 310 PCI_USES_MASTER, IS_BOOMERANG|HAS_MII|EEPROM_RESET, 64, },
311 {"3C905B-TX Fast Etherlink XL PCI",
312 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
310 {"3c905B Cyclone 100baseTx", 313 {"3c905B Cyclone 100baseTx",
311 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, }, 314 PCI_USES_MASTER, IS_CYCLONE|HAS_NWAY|HAS_HWCKSM|EXTRA_PREAMBLE, 128, },
312 315
@@ -389,6 +392,7 @@ static struct pci_device_id vortex_pci_tbl[] = {
389 { 0x10B7, 0x900A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C900B_FL }, 392 { 0x10B7, 0x900A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C900B_FL },
390 { 0x10B7, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905_1 }, 393 { 0x10B7, 0x9050, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905_1 },
391 { 0x10B7, 0x9051, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905_2 }, 394 { 0x10B7, 0x9051, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905_2 },
395 { 0x10B7, 0x9054, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_TX },
392 { 0x10B7, 0x9055, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_1 }, 396 { 0x10B7, 0x9055, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_1 },
393 397
394 { 0x10B7, 0x9058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_2 }, 398 { 0x10B7, 0x9058, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CH_3C905B_2 },
@@ -2721,13 +2725,15 @@ dump_tx_ring(struct net_device *dev)
2721 &vp->tx_ring[vp->dirty_tx % TX_RING_SIZE]); 2725 &vp->tx_ring[vp->dirty_tx % TX_RING_SIZE]);
2722 issue_and_wait(dev, DownStall); 2726 issue_and_wait(dev, DownStall);
2723 for (i = 0; i < TX_RING_SIZE; i++) { 2727 for (i = 0; i < TX_RING_SIZE; i++) {
2724 pr_err(" %d: @%p length %8.8x status %8.8x\n", i, 2728 unsigned int length;
2725 &vp->tx_ring[i], 2729
2726#if DO_ZEROCOPY 2730#if DO_ZEROCOPY
2727 le32_to_cpu(vp->tx_ring[i].frag[0].length), 2731 length = le32_to_cpu(vp->tx_ring[i].frag[0].length);
2728#else 2732#else
2729 le32_to_cpu(vp->tx_ring[i].length), 2733 length = le32_to_cpu(vp->tx_ring[i].length);
2730#endif 2734#endif
2735 pr_err(" %d: @%p length %8.8x status %8.8x\n",
2736 i, &vp->tx_ring[i], length,
2731 le32_to_cpu(vp->tx_ring[i].status)); 2737 le32_to_cpu(vp->tx_ring[i].status));
2732 } 2738 }
2733 if (!stalled) 2739 if (!stalled)
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index 7302e4385bc4..174a81187a95 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -569,16 +569,8 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
569 569
570#ifdef DEBUG_DRIVER 570#ifdef DEBUG_DRIVER
571 /* dump the packet */ 571 /* dump the packet */
572 { 572 print_hex_dump(KERN_DEBUG, "skb->data: ", DUMP_PREFIX_NONE,
573 int i; 573 16, 1, skb->data, 64, true);
574
575 for (i = 0; i < 64; i++) {
576 if ((i % 16) == 0)
577 printk("\n" KERN_DEBUG);
578 printk ("%2.2x ", skb->data [i]);
579 }
580 printk("\n");
581 }
582#endif 574#endif
583 entry = lp->tx_new & lp->tx_ring_mod_mask; 575 entry = lp->tx_new & lp->tx_ring_mod_mask;
584 ib->btx_ring [entry].length = (-skblen) | 0xf000; 576 ib->btx_ring [entry].length = (-skblen) | 0xf000;
diff --git a/drivers/net/arcnet/arcnet.c b/drivers/net/arcnet/arcnet.c
index d6d4ab3b430c..7d227cdab9f8 100644
--- a/drivers/net/arcnet/arcnet.c
+++ b/drivers/net/arcnet/arcnet.c
@@ -158,15 +158,12 @@ module_exit(arcnet_exit);
158void arcnet_dump_skb(struct net_device *dev, 158void arcnet_dump_skb(struct net_device *dev,
159 struct sk_buff *skb, char *desc) 159 struct sk_buff *skb, char *desc)
160{ 160{
161 int i; 161 char hdr[32];
162 162
163 printk(KERN_DEBUG "%6s: skb dump (%s) follows:", dev->name, desc); 163 /* dump the packet */
164 for (i = 0; i < skb->len; i++) { 164 snprintf(hdr, sizeof(hdr), "%6s:%s skb->data:", dev->name, desc);
165 if (i % 16 == 0) 165 print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET,
166 printk("\n" KERN_DEBUG "[%04X] ", i); 166 16, 1, skb->data, skb->len, true);
167 printk("%02X ", ((u_char *) skb->data)[i]);
168 }
169 printk("\n");
170} 167}
171 168
172EXPORT_SYMBOL(arcnet_dump_skb); 169EXPORT_SYMBOL(arcnet_dump_skb);
@@ -184,6 +181,7 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum,
184 int i, length; 181 int i, length;
185 unsigned long flags = 0; 182 unsigned long flags = 0;
186 static uint8_t buf[512]; 183 static uint8_t buf[512];
184 char hdr[32];
187 185
188 /* hw.copy_from_card expects IRQ context so take the IRQ lock 186 /* hw.copy_from_card expects IRQ context so take the IRQ lock
189 to keep it single threaded */ 187 to keep it single threaded */
@@ -197,14 +195,10 @@ static void arcnet_dump_packet(struct net_device *dev, int bufnum,
197 /* if the offset[0] byte is nonzero, this is a 256-byte packet */ 195 /* if the offset[0] byte is nonzero, this is a 256-byte packet */
198 length = (buf[2] ? 256 : 512); 196 length = (buf[2] ? 256 : 512);
199 197
200 printk(KERN_DEBUG "%6s: packet dump (%s) follows:", dev->name, desc); 198 /* dump the packet */
201 for (i = 0; i < length; i++) { 199 snprintf(hdr, sizeof(hdr), "%6s:%s packet dump:", dev->name, desc);
202 if (i % 16 == 0) 200 print_hex_dump(KERN_DEBUG, hdr, DUMP_PREFIX_OFFSET,
203 printk("\n" KERN_DEBUG "[%04X] ", i); 201 16, 1, buf, length, true);
204 printk("%02X ", buf[i]);
205 }
206 printk("\n");
207
208} 202}
209 203
210#else 204#else
diff --git a/drivers/net/atl1c/atl1c_ethtool.c b/drivers/net/atl1c/atl1c_ethtool.c
index 607007d75b6f..00d11b480af3 100644
--- a/drivers/net/atl1c/atl1c_ethtool.c
+++ b/drivers/net/atl1c/atl1c_ethtool.c
@@ -232,11 +232,11 @@ static void atl1c_get_drvinfo(struct net_device *netdev,
232{ 232{
233 struct atl1c_adapter *adapter = netdev_priv(netdev); 233 struct atl1c_adapter *adapter = netdev_priv(netdev);
234 234
235 strncpy(drvinfo->driver, atl1c_driver_name, sizeof(drvinfo->driver)); 235 strlcpy(drvinfo->driver, atl1c_driver_name, sizeof(drvinfo->driver));
236 strncpy(drvinfo->version, atl1c_driver_version, 236 strlcpy(drvinfo->version, atl1c_driver_version,
237 sizeof(drvinfo->version)); 237 sizeof(drvinfo->version));
238 strncpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); 238 strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
239 strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 239 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
240 sizeof(drvinfo->bus_info)); 240 sizeof(drvinfo->bus_info));
241 drvinfo->n_stats = 0; 241 drvinfo->n_stats = 0;
242 drvinfo->testinfo_len = 0; 242 drvinfo->testinfo_len = 0;
diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
index 94d7325caf4f..8bca12f71390 100644
--- a/drivers/net/atlx/atl1.c
+++ b/drivers/net/atlx/atl1.c
@@ -3378,11 +3378,11 @@ static void atl1_get_drvinfo(struct net_device *netdev,
3378{ 3378{
3379 struct atl1_adapter *adapter = netdev_priv(netdev); 3379 struct atl1_adapter *adapter = netdev_priv(netdev);
3380 3380
3381 strncpy(drvinfo->driver, ATLX_DRIVER_NAME, sizeof(drvinfo->driver)); 3381 strlcpy(drvinfo->driver, ATLX_DRIVER_NAME, sizeof(drvinfo->driver));
3382 strncpy(drvinfo->version, ATLX_DRIVER_VERSION, 3382 strlcpy(drvinfo->version, ATLX_DRIVER_VERSION,
3383 sizeof(drvinfo->version)); 3383 sizeof(drvinfo->version));
3384 strncpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version)); 3384 strlcpy(drvinfo->fw_version, "N/A", sizeof(drvinfo->fw_version));
3385 strncpy(drvinfo->bus_info, pci_name(adapter->pdev), 3385 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
3386 sizeof(drvinfo->bus_info)); 3386 sizeof(drvinfo->bus_info));
3387 drvinfo->eedump_len = ATL1_EEDUMP_LEN; 3387 drvinfo->eedump_len = ATL1_EEDUMP_LEN;
3388} 3388}
diff --git a/drivers/net/bmac.c b/drivers/net/bmac.c
index 41600011cfd0..406f06424251 100644
--- a/drivers/net/bmac.c
+++ b/drivers/net/bmac.c
@@ -428,10 +428,11 @@ bmac_init_phy(struct net_device *dev)
428 printk(KERN_DEBUG "phy registers:"); 428 printk(KERN_DEBUG "phy registers:");
429 for (addr = 0; addr < 32; ++addr) { 429 for (addr = 0; addr < 32; ++addr) {
430 if ((addr & 7) == 0) 430 if ((addr & 7) == 0)
431 printk("\n" KERN_DEBUG); 431 printk(KERN_DEBUG);
432 printk(" %.4x", bmac_mif_read(dev, addr)); 432 printk(KERN_CONT " %.4x", bmac_mif_read(dev, addr));
433 } 433 }
434 printk("\n"); 434 printk(KERN_CONT "\n");
435
435 if (bp->is_bmac_plus) { 436 if (bp->is_bmac_plus) {
436 unsigned int capable, ctrl; 437 unsigned int capable, ctrl;
437 438
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
index c92d1a498867..665ed36a0d48 100644
--- a/drivers/net/bnx2x_main.c
+++ b/drivers/net/bnx2x_main.c
@@ -484,8 +484,9 @@ static void bnx2x_fw_dump(struct bnx2x *bp)
484 484
485 mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104); 485 mark = REG_RD(bp, MCP_REG_MCPR_SCRATCH + 0xf104);
486 mark = ((mark + 0x3) & ~0x3); 486 mark = ((mark + 0x3) & ~0x3);
487 printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n" KERN_ERR, mark); 487 printk(KERN_ERR PFX "begin fw dump (mark 0x%x)\n", mark);
488 488
489 printk(KERN_ERR PFX);
489 for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) { 490 for (offset = mark - 0x08000000; offset <= 0xF900; offset += 0x8*4) {
490 for (word = 0; word < 8; word++) 491 for (word = 0; word < 8; word++)
491 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH + 492 data[word] = htonl(REG_RD(bp, MCP_REG_MCPR_SCRATCH +
@@ -500,7 +501,7 @@ static void bnx2x_fw_dump(struct bnx2x *bp)
500 data[8] = 0x0; 501 data[8] = 0x0;
501 printk(KERN_CONT "%s", (char *)data); 502 printk(KERN_CONT "%s", (char *)data);
502 } 503 }
503 printk("\n" KERN_ERR PFX "end of fw dump\n"); 504 printk(KERN_ERR PFX "end of fw dump\n");
504} 505}
505 506
506static void bnx2x_panic_dump(struct bnx2x *bp) 507static void bnx2x_panic_dump(struct bnx2x *bp)
@@ -7453,7 +7454,7 @@ static void bnx2x_reset_task(struct work_struct *work)
7453#ifdef BNX2X_STOP_ON_ERROR 7454#ifdef BNX2X_STOP_ON_ERROR
7454 BNX2X_ERR("reset task called but STOP_ON_ERROR defined" 7455 BNX2X_ERR("reset task called but STOP_ON_ERROR defined"
7455 " so reset not done to allow debug dump,\n" 7456 " so reset not done to allow debug dump,\n"
7456 KERN_ERR " you will need to reboot when done\n"); 7457 " you will need to reboot when done\n");
7457 return; 7458 return;
7458#endif 7459#endif
7459 7460
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c
index 895d72143ee0..4b6a219fecea 100644
--- a/drivers/net/dl2k.c
+++ b/drivers/net/dl2k.c
@@ -268,8 +268,9 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
268 printk(KERN_INFO "tx_coalesce:\t%d packets\n", 268 printk(KERN_INFO "tx_coalesce:\t%d packets\n",
269 tx_coalesce); 269 tx_coalesce);
270 if (np->coalesce) 270 if (np->coalesce)
271 printk(KERN_INFO "rx_coalesce:\t%d packets\n" 271 printk(KERN_INFO
272 KERN_INFO "rx_timeout: \t%d ns\n", 272 "rx_coalesce:\t%d packets\n"
273 "rx_timeout: \t%d ns\n",
273 np->rx_coalesce, np->rx_timeout*640); 274 np->rx_coalesce, np->rx_timeout*640);
274 if (np->vlan) 275 if (np->vlan)
275 printk(KERN_INFO "vlan(id):\t%d\n", np->vlan); 276 printk(KERN_INFO "vlan(id):\t%d\n", np->vlan);
@@ -1522,9 +1523,9 @@ mii_get_media (struct net_device *dev)
1522 printk (KERN_INFO "Operating at 10 Mbps, "); 1523 printk (KERN_INFO "Operating at 10 Mbps, ");
1523 } 1524 }
1524 if (bmcr & MII_BMCR_DUPLEX_MODE) { 1525 if (bmcr & MII_BMCR_DUPLEX_MODE) {
1525 printk ("Full duplex\n"); 1526 printk (KERN_CONT "Full duplex\n");
1526 } else { 1527 } else {
1527 printk ("Half duplex\n"); 1528 printk (KERN_CONT "Half duplex\n");
1528 } 1529 }
1529 } 1530 }
1530 if (np->tx_flow) 1531 if (np->tx_flow)
@@ -1614,9 +1615,9 @@ mii_set_media (struct net_device *dev)
1614 } 1615 }
1615 if (np->full_duplex) { 1616 if (np->full_duplex) {
1616 bmcr |= MII_BMCR_DUPLEX_MODE; 1617 bmcr |= MII_BMCR_DUPLEX_MODE;
1617 printk ("Full duplex\n"); 1618 printk (KERN_CONT "Full duplex\n");
1618 } else { 1619 } else {
1619 printk ("Half duplex\n"); 1620 printk (KERN_CONT "Half duplex\n");
1620 } 1621 }
1621#if 0 1622#if 0
1622 /* Set 1000BaseT Master/Slave setting */ 1623 /* Set 1000BaseT Master/Slave setting */
@@ -1669,9 +1670,9 @@ mii_get_media_pcs (struct net_device *dev)
1669 __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR); 1670 __u16 bmcr = mii_read (dev, phy_addr, PCS_BMCR);
1670 printk (KERN_INFO "Operating at 1000 Mbps, "); 1671 printk (KERN_INFO "Operating at 1000 Mbps, ");
1671 if (bmcr & MII_BMCR_DUPLEX_MODE) { 1672 if (bmcr & MII_BMCR_DUPLEX_MODE) {
1672 printk ("Full duplex\n"); 1673 printk (KERN_CONT "Full duplex\n");
1673 } else { 1674 } else {
1674 printk ("Half duplex\n"); 1675 printk (KERN_CONT "Half duplex\n");
1675 } 1676 }
1676 } 1677 }
1677 if (np->tx_flow) 1678 if (np->tx_flow)
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index d56c7473144a..99df2abf82a9 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -338,10 +338,7 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
338{ 338{
339 struct e1000_nvm_info *nvm = &hw->nvm; 339 struct e1000_nvm_info *nvm = &hw->nvm;
340 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; 340 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
341 union ich8_hws_flash_status hsfsts; 341 u32 gfpreg, sector_base_addr, sector_end_addr;
342 u32 gfpreg;
343 u32 sector_base_addr;
344 u32 sector_end_addr;
345 u16 i; 342 u16 i;
346 343
347 /* Can't read flash registers if the register set isn't mapped. */ 344 /* Can't read flash registers if the register set isn't mapped. */
@@ -375,20 +372,6 @@ static s32 e1000_init_nvm_params_ich8lan(struct e1000_hw *hw)
375 /* Adjust to word count */ 372 /* Adjust to word count */
376 nvm->flash_bank_size /= sizeof(u16); 373 nvm->flash_bank_size /= sizeof(u16);
377 374
378 /*
379 * Make sure the flash bank size does not overwrite the 4k
380 * sector ranges. We may have 64k allotted to us but we only care
381 * about the first 2 4k sectors. Therefore, if we have anything less
382 * than 64k set in the HSFSTS register, we will reduce the bank size
383 * down to 4k and let the rest remain unused. If berasesz == 3, then
384 * we are working in 64k mode. Otherwise we are not.
385 */
386 if (nvm->flash_bank_size > E1000_ICH8_SHADOW_RAM_WORDS) {
387 hsfsts.regval = er16flash(ICH_FLASH_HSFSTS);
388 if (hsfsts.hsf_status.berasesz != 3)
389 nvm->flash_bank_size = E1000_ICH8_SHADOW_RAM_WORDS;
390 }
391
392 nvm->word_size = E1000_ICH8_SHADOW_RAM_WORDS; 375 nvm->word_size = E1000_ICH8_SHADOW_RAM_WORDS;
393 376
394 /* Clear shadow ram */ 377 /* Clear shadow ram */
@@ -594,8 +577,8 @@ static DEFINE_MUTEX(nvm_mutex);
594 **/ 577 **/
595static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw) 578static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
596{ 579{
597 u32 extcnf_ctrl; 580 u32 extcnf_ctrl, timeout = PHY_CFG_TIMEOUT;
598 u32 timeout = PHY_CFG_TIMEOUT; 581 s32 ret_val = 0;
599 582
600 might_sleep(); 583 might_sleep();
601 584
@@ -603,28 +586,46 @@ static s32 e1000_acquire_swflag_ich8lan(struct e1000_hw *hw)
603 586
604 while (timeout) { 587 while (timeout) {
605 extcnf_ctrl = er32(EXTCNF_CTRL); 588 extcnf_ctrl = er32(EXTCNF_CTRL);
589 if (!(extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG))
590 break;
606 591
607 if (!(extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG)) { 592 mdelay(1);
608 extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG; 593 timeout--;
609 ew32(EXTCNF_CTRL, extcnf_ctrl); 594 }
595
596 if (!timeout) {
597 hw_dbg(hw, "SW/FW/HW has locked the resource for too long.\n");
598 ret_val = -E1000_ERR_CONFIG;
599 goto out;
600 }
601
602 timeout = PHY_CFG_TIMEOUT * 2;
603
604 extcnf_ctrl |= E1000_EXTCNF_CTRL_SWFLAG;
605 ew32(EXTCNF_CTRL, extcnf_ctrl);
606
607 while (timeout) {
608 extcnf_ctrl = er32(EXTCNF_CTRL);
609 if (extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG)
610 break;
610 611
611 extcnf_ctrl = er32(EXTCNF_CTRL);
612 if (extcnf_ctrl & E1000_EXTCNF_CTRL_SWFLAG)
613 break;
614 }
615 mdelay(1); 612 mdelay(1);
616 timeout--; 613 timeout--;
617 } 614 }
618 615
619 if (!timeout) { 616 if (!timeout) {
620 hw_dbg(hw, "FW or HW has locked the resource for too long.\n"); 617 hw_dbg(hw, "Failed to acquire the semaphore.\n");
621 extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG; 618 extcnf_ctrl &= ~E1000_EXTCNF_CTRL_SWFLAG;
622 ew32(EXTCNF_CTRL, extcnf_ctrl); 619 ew32(EXTCNF_CTRL, extcnf_ctrl);
623 mutex_unlock(&nvm_mutex); 620 ret_val = -E1000_ERR_CONFIG;
624 return -E1000_ERR_CONFIG; 621 goto out;
625 } 622 }
626 623
627 return 0; 624out:
625 if (ret_val)
626 mutex_unlock(&nvm_mutex);
627
628 return ret_val;
628} 629}
629 630
630/** 631/**
@@ -1306,7 +1307,7 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1306 struct e1000_nvm_info *nvm = &hw->nvm; 1307 struct e1000_nvm_info *nvm = &hw->nvm;
1307 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; 1308 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
1308 u32 act_offset; 1309 u32 act_offset;
1309 s32 ret_val; 1310 s32 ret_val = 0;
1310 u32 bank = 0; 1311 u32 bank = 0;
1311 u16 i, word; 1312 u16 i, word;
1312 1313
@@ -1321,12 +1322,15 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1321 goto out; 1322 goto out;
1322 1323
1323 ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank); 1324 ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank);
1324 if (ret_val) 1325 if (ret_val) {
1325 goto release; 1326 hw_dbg(hw, "Could not detect valid bank, assuming bank 0\n");
1327 bank = 0;
1328 }
1326 1329
1327 act_offset = (bank) ? nvm->flash_bank_size : 0; 1330 act_offset = (bank) ? nvm->flash_bank_size : 0;
1328 act_offset += offset; 1331 act_offset += offset;
1329 1332
1333 ret_val = 0;
1330 for (i = 0; i < words; i++) { 1334 for (i = 0; i < words; i++) {
1331 if ((dev_spec->shadow_ram) && 1335 if ((dev_spec->shadow_ram) &&
1332 (dev_spec->shadow_ram[offset+i].modified)) { 1336 (dev_spec->shadow_ram[offset+i].modified)) {
@@ -1341,7 +1345,6 @@ static s32 e1000_read_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1341 } 1345 }
1342 } 1346 }
1343 1347
1344release:
1345 e1000_release_swflag_ich8lan(hw); 1348 e1000_release_swflag_ich8lan(hw);
1346 1349
1347out: 1350out:
@@ -1592,7 +1595,6 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1592{ 1595{
1593 struct e1000_nvm_info *nvm = &hw->nvm; 1596 struct e1000_nvm_info *nvm = &hw->nvm;
1594 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; 1597 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
1595 s32 ret_val;
1596 u16 i; 1598 u16 i;
1597 1599
1598 if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) || 1600 if ((offset >= nvm->word_size) || (words > nvm->word_size - offset) ||
@@ -1601,17 +1603,11 @@ static s32 e1000_write_nvm_ich8lan(struct e1000_hw *hw, u16 offset, u16 words,
1601 return -E1000_ERR_NVM; 1603 return -E1000_ERR_NVM;
1602 } 1604 }
1603 1605
1604 ret_val = e1000_acquire_swflag_ich8lan(hw);
1605 if (ret_val)
1606 return ret_val;
1607
1608 for (i = 0; i < words; i++) { 1606 for (i = 0; i < words; i++) {
1609 dev_spec->shadow_ram[offset+i].modified = 1; 1607 dev_spec->shadow_ram[offset+i].modified = 1;
1610 dev_spec->shadow_ram[offset+i].value = data[i]; 1608 dev_spec->shadow_ram[offset+i].value = data[i];
1611 } 1609 }
1612 1610
1613 e1000_release_swflag_ich8lan(hw);
1614
1615 return 0; 1611 return 0;
1616} 1612}
1617 1613
@@ -1652,8 +1648,8 @@ static s32 e1000_update_nvm_checksum_ich8lan(struct e1000_hw *hw)
1652 */ 1648 */
1653 ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank); 1649 ret_val = e1000_valid_nvm_bank_detect_ich8lan(hw, &bank);
1654 if (ret_val) { 1650 if (ret_val) {
1655 e1000_release_swflag_ich8lan(hw); 1651 hw_dbg(hw, "Could not detect valid bank, assuming bank 0\n");
1656 goto out; 1652 bank = 0;
1657 } 1653 }
1658 1654
1659 if (bank == 0) { 1655 if (bank == 0) {
@@ -2039,12 +2035,8 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
2039 iteration = 1; 2035 iteration = 1;
2040 break; 2036 break;
2041 case 2: 2037 case 2:
2042 if (hw->mac.type == e1000_ich9lan) { 2038 sector_size = ICH_FLASH_SEG_SIZE_8K;
2043 sector_size = ICH_FLASH_SEG_SIZE_8K; 2039 iteration = 1;
2044 iteration = flash_bank_size / ICH_FLASH_SEG_SIZE_8K;
2045 } else {
2046 return -E1000_ERR_NVM;
2047 }
2048 break; 2040 break;
2049 case 3: 2041 case 3:
2050 sector_size = ICH_FLASH_SEG_SIZE_64K; 2042 sector_size = ICH_FLASH_SEG_SIZE_64K;
@@ -2056,7 +2048,7 @@ static s32 e1000_erase_flash_bank_ich8lan(struct e1000_hw *hw, u32 bank)
2056 2048
2057 /* Start with the base address, then add the sector offset. */ 2049 /* Start with the base address, then add the sector offset. */
2058 flash_linear_addr = hw->nvm.flash_base_addr; 2050 flash_linear_addr = hw->nvm.flash_base_addr;
2059 flash_linear_addr += (bank) ? (sector_size * iteration) : 0; 2051 flash_linear_addr += (bank) ? flash_bank_size : 0;
2060 2052
2061 for (j = 0; j < iteration ; j++) { 2053 for (j = 0; j < iteration ; j++) {
2062 do { 2054 do {
diff --git a/drivers/net/ehea/ehea.h b/drivers/net/ehea/ehea.h
index 78952f8324e2..fa311a950996 100644
--- a/drivers/net/ehea/ehea.h
+++ b/drivers/net/ehea/ehea.h
@@ -40,7 +40,7 @@
40#include <asm/io.h> 40#include <asm/io.h>
41 41
42#define DRV_NAME "ehea" 42#define DRV_NAME "ehea"
43#define DRV_VERSION "EHEA_0101" 43#define DRV_VERSION "EHEA_0102"
44 44
45/* eHEA capability flags */ 45/* eHEA capability flags */
46#define DLPAR_PORT_ADD_REM 1 46#define DLPAR_PORT_ADD_REM 1
diff --git a/drivers/net/ehea/ehea_main.c b/drivers/net/ehea/ehea_main.c
index e8d46cc1bec2..977c3d358279 100644
--- a/drivers/net/ehea/ehea_main.c
+++ b/drivers/net/ehea/ehea_main.c
@@ -1545,6 +1545,9 @@ static int ehea_clean_portres(struct ehea_port *port, struct ehea_port_res *pr)
1545{ 1545{
1546 int ret, i; 1546 int ret, i;
1547 1547
1548 if (pr->qp)
1549 netif_napi_del(&pr->napi);
1550
1548 ret = ehea_destroy_qp(pr->qp); 1551 ret = ehea_destroy_qp(pr->qp);
1549 1552
1550 if (!ret) { 1553 if (!ret) {
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c
index d6a7aa3142f9..d668ff2af6e3 100644
--- a/drivers/net/epic100.c
+++ b/drivers/net/epic100.c
@@ -338,8 +338,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev,
338#ifndef MODULE 338#ifndef MODULE
339 static int printed_version; 339 static int printed_version;
340 if (!printed_version++) 340 if (!printed_version++)
341 printk (KERN_INFO "%s" KERN_INFO "%s", 341 printk(KERN_INFO "%s%s", version, version2);
342 version, version2);
343#endif 342#endif
344 343
345 card_idx++; 344 card_idx++;
@@ -1600,7 +1599,7 @@ static int __init epic_init (void)
1600{ 1599{
1601/* when a module, this is printed whether or not devices are found in probe */ 1600/* when a module, this is printed whether or not devices are found in probe */
1602#ifdef MODULE 1601#ifdef MODULE
1603 printk (KERN_INFO "%s" KERN_INFO "%s", 1602 printk (KERN_INFO "%s%s",
1604 version, version2); 1603 version, version2);
1605#endif 1604#endif
1606 1605
diff --git a/drivers/net/fealnx.c b/drivers/net/fealnx.c
index b2d617206bd9..f66da84a9398 100644
--- a/drivers/net/fealnx.c
+++ b/drivers/net/fealnx.c
@@ -1210,17 +1210,20 @@ static void fealnx_tx_timeout(struct net_device *dev)
1210 unsigned long flags; 1210 unsigned long flags;
1211 int i; 1211 int i;
1212 1212
1213 printk(KERN_WARNING "%s: Transmit timed out, status %8.8x," 1213 printk(KERN_WARNING
1214 " resetting...\n", dev->name, ioread32(ioaddr + ISR)); 1214 "%s: Transmit timed out, status %8.8x, resetting...\n",
1215 dev->name, ioread32(ioaddr + ISR));
1215 1216
1216 { 1217 {
1217 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); 1218 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring);
1218 for (i = 0; i < RX_RING_SIZE; i++) 1219 for (i = 0; i < RX_RING_SIZE; i++)
1219 printk(" %8.8x", (unsigned int) np->rx_ring[i].status); 1220 printk(KERN_CONT " %8.8x",
1220 printk("\n" KERN_DEBUG " Tx ring %p: ", np->tx_ring); 1221 (unsigned int) np->rx_ring[i].status);
1222 printk(KERN_CONT "\n");
1223 printk(KERN_DEBUG " Tx ring %p: ", np->tx_ring);
1221 for (i = 0; i < TX_RING_SIZE; i++) 1224 for (i = 0; i < TX_RING_SIZE; i++)
1222 printk(" %4.4x", np->tx_ring[i].status); 1225 printk(KERN_CONT " %4.4x", np->tx_ring[i].status);
1223 printk("\n"); 1226 printk(KERN_CONT "\n");
1224 } 1227 }
1225 1228
1226 spin_lock_irqsave(&np->lock, flags); 1229 spin_lock_irqsave(&np->lock, flags);
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index e3d99fe53ce6..967ad01b1925 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -285,6 +285,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
285{ 285{
286 struct fec_enet_private *fep = netdev_priv(dev); 286 struct fec_enet_private *fep = netdev_priv(dev);
287 struct bufdesc *bdp; 287 struct bufdesc *bdp;
288 void *bufaddr;
288 unsigned short status; 289 unsigned short status;
289 unsigned long flags; 290 unsigned long flags;
290 291
@@ -312,7 +313,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
312 status &= ~BD_ENET_TX_STATS; 313 status &= ~BD_ENET_TX_STATS;
313 314
314 /* Set buffer length and buffer pointer */ 315 /* Set buffer length and buffer pointer */
315 bdp->cbd_bufaddr = __pa(skb->data); 316 bufaddr = skb->data;
316 bdp->cbd_datlen = skb->len; 317 bdp->cbd_datlen = skb->len;
317 318
318 /* 319 /*
@@ -320,11 +321,11 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
320 * 4-byte boundaries. Use bounce buffers to copy data 321 * 4-byte boundaries. Use bounce buffers to copy data
321 * and get it aligned. Ugh. 322 * and get it aligned. Ugh.
322 */ 323 */
323 if (bdp->cbd_bufaddr & FEC_ALIGNMENT) { 324 if (((unsigned long) bufaddr) & FEC_ALIGNMENT) {
324 unsigned int index; 325 unsigned int index;
325 index = bdp - fep->tx_bd_base; 326 index = bdp - fep->tx_bd_base;
326 memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len); 327 memcpy(fep->tx_bounce[index], (void *)skb->data, skb->len);
327 bdp->cbd_bufaddr = __pa(fep->tx_bounce[index]); 328 bufaddr = fep->tx_bounce[index];
328 } 329 }
329 330
330 /* Save skb pointer */ 331 /* Save skb pointer */
@@ -336,7 +337,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
336 /* Push the data cache so the CPM does not get stale memory 337 /* Push the data cache so the CPM does not get stale memory
337 * data. 338 * data.
338 */ 339 */
339 bdp->cbd_bufaddr = dma_map_single(&dev->dev, skb->data, 340 bdp->cbd_bufaddr = dma_map_single(&dev->dev, bufaddr,
340 FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE); 341 FEC_ENET_TX_FRSIZE, DMA_TO_DEVICE);
341 342
342 /* Send it on its way. Tell FEC it's ready, interrupt when done, 343 /* Send it on its way. Tell FEC it's ready, interrupt when done,
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c
index 056ba4625780..4544da4cf3ce 100644
--- a/drivers/net/gianfar.c
+++ b/drivers/net/gianfar.c
@@ -935,6 +935,7 @@ int startup_gfar(struct net_device *dev)
935 struct gfar __iomem *regs = priv->regs; 935 struct gfar __iomem *regs = priv->regs;
936 int err = 0; 936 int err = 0;
937 u32 rctrl = 0; 937 u32 rctrl = 0;
938 u32 tctrl = 0;
938 u32 attrs = 0; 939 u32 attrs = 0;
939 940
940 gfar_write(&regs->imask, IMASK_INIT_CLEAR); 941 gfar_write(&regs->imask, IMASK_INIT_CLEAR);
@@ -1110,11 +1111,19 @@ int startup_gfar(struct net_device *dev)
1110 rctrl |= RCTRL_PADDING(priv->padding); 1111 rctrl |= RCTRL_PADDING(priv->padding);
1111 } 1112 }
1112 1113
1114 /* keep vlan related bits if it's enabled */
1115 if (priv->vlgrp) {
1116 rctrl |= RCTRL_VLEX | RCTRL_PRSDEP_INIT;
1117 tctrl |= TCTRL_VLINS;
1118 }
1119
1113 /* Init rctrl based on our settings */ 1120 /* Init rctrl based on our settings */
1114 gfar_write(&priv->regs->rctrl, rctrl); 1121 gfar_write(&priv->regs->rctrl, rctrl);
1115 1122
1116 if (dev->features & NETIF_F_IP_CSUM) 1123 if (dev->features & NETIF_F_IP_CSUM)
1117 gfar_write(&priv->regs->tctrl, TCTRL_INIT_CSUM); 1124 tctrl |= TCTRL_INIT_CSUM;
1125
1126 gfar_write(&priv->regs->tctrl, tctrl);
1118 1127
1119 /* Set the extraction length and index */ 1128 /* Set the extraction length and index */
1120 attrs = ATTRELI_EL(priv->rx_stash_size) | 1129 attrs = ATTRELI_EL(priv->rx_stash_size) |
@@ -1449,7 +1458,6 @@ static void gfar_vlan_rx_register(struct net_device *dev,
1449 1458
1450 /* Enable VLAN tag extraction */ 1459 /* Enable VLAN tag extraction */
1451 tempval = gfar_read(&priv->regs->rctrl); 1460 tempval = gfar_read(&priv->regs->rctrl);
1452 tempval |= RCTRL_VLEX;
1453 tempval |= (RCTRL_VLEX | RCTRL_PRSDEP_INIT); 1461 tempval |= (RCTRL_VLEX | RCTRL_PRSDEP_INIT);
1454 gfar_write(&priv->regs->rctrl, tempval); 1462 gfar_write(&priv->regs->rctrl, tempval);
1455 } else { 1463 } else {
diff --git a/drivers/net/hamachi.c b/drivers/net/hamachi.c
index 4e8d3728e820..635341d6a028 100644
--- a/drivers/net/hamachi.c
+++ b/drivers/net/hamachi.c
@@ -173,8 +173,8 @@ static int tx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
173 173
174static const char version[] __devinitconst = 174static const char version[] __devinitconst =
175KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n" 175KERN_INFO DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " Written by Donald Becker\n"
176KERN_INFO " Some modifications by Eric kasten <kasten@nscl.msu.edu>\n" 176" Some modifications by Eric kasten <kasten@nscl.msu.edu>\n"
177KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n"; 177" Further modifications by Keith Underwood <keithu@parl.clemson.edu>\n";
178 178
179 179
180/* IP_MF appears to be only defined in <netinet/ip.h>, however, 180/* IP_MF appears to be only defined in <netinet/ip.h>, however,
@@ -1080,11 +1080,14 @@ static void hamachi_tx_timeout(struct net_device *dev)
1080 { 1080 {
1081 printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring); 1081 printk(KERN_DEBUG " Rx ring %p: ", hmp->rx_ring);
1082 for (i = 0; i < RX_RING_SIZE; i++) 1082 for (i = 0; i < RX_RING_SIZE; i++)
1083 printk(" %8.8x", le32_to_cpu(hmp->rx_ring[i].status_n_length)); 1083 printk(KERN_CONT " %8.8x",
1084 printk("\n"KERN_DEBUG" Tx ring %p: ", hmp->tx_ring); 1084 le32_to_cpu(hmp->rx_ring[i].status_n_length));
1085 printk(KERN_CONT "\n");
1086 printk(KERN_DEBUG" Tx ring %p: ", hmp->tx_ring);
1085 for (i = 0; i < TX_RING_SIZE; i++) 1087 for (i = 0; i < TX_RING_SIZE; i++)
1086 printk(" %4.4x", le32_to_cpu(hmp->tx_ring[i].status_n_length)); 1088 printk(KERN_CONT " %4.4x",
1087 printk("\n"); 1089 le32_to_cpu(hmp->tx_ring[i].status_n_length));
1090 printk(KERN_CONT "\n");
1088 } 1091 }
1089 1092
1090 /* Reinit the hardware and make sure the Rx and Tx processes 1093 /* Reinit the hardware and make sure the Rx and Tx processes
@@ -1753,13 +1756,13 @@ static int hamachi_close(struct net_device *dev)
1753 1756
1754#ifdef __i386__ 1757#ifdef __i386__
1755 if (hamachi_debug > 2) { 1758 if (hamachi_debug > 2) {
1756 printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", 1759 printk(KERN_DEBUG " Tx ring at %8.8x:\n",
1757 (int)hmp->tx_ring_dma); 1760 (int)hmp->tx_ring_dma);
1758 for (i = 0; i < TX_RING_SIZE; i++) 1761 for (i = 0; i < TX_RING_SIZE; i++)
1759 printk(" %c #%d desc. %8.8x %8.8x.\n", 1762 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x.\n",
1760 readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ', 1763 readl(ioaddr + TxCurPtr) == (long)&hmp->tx_ring[i] ? '>' : ' ',
1761 i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr); 1764 i, hmp->tx_ring[i].status_n_length, hmp->tx_ring[i].addr);
1762 printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", 1765 printk(KERN_DEBUG " Rx ring %8.8x:\n",
1763 (int)hmp->rx_ring_dma); 1766 (int)hmp->rx_ring_dma);
1764 for (i = 0; i < RX_RING_SIZE; i++) { 1767 for (i = 0; i < RX_RING_SIZE; i++) {
1765 printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n", 1768 printk(KERN_DEBUG " %c #%d desc. %4.4x %8.8x\n",
@@ -1770,7 +1773,7 @@ static int hamachi_close(struct net_device *dev)
1770 u16 *addr = (u16 *) 1773 u16 *addr = (u16 *)
1771 hmp->rx_skbuff[i]->data; 1774 hmp->rx_skbuff[i]->data;
1772 int j; 1775 int j;
1773 1776 printk(KERN_DEBUG "Addr: ");
1774 for (j = 0; j < 0x50; j++) 1777 for (j = 0; j < 0x50; j++)
1775 printk(" %4.4x", addr[j]); 1778 printk(" %4.4x", addr[j]);
1776 printk("\n"); 1779 printk("\n");
diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c
index e229edf3261a..7bcaf7c66243 100644
--- a/drivers/net/hamradio/baycom_epp.c
+++ b/drivers/net/hamradio/baycom_epp.c
@@ -68,7 +68,7 @@ static const char paranoia_str[] = KERN_ERR
68 68
69static const char bc_drvname[] = "baycom_epp"; 69static const char bc_drvname[] = "baycom_epp";
70static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n" 70static const char bc_drvinfo[] = KERN_INFO "baycom_epp: (C) 1998-2000 Thomas Sailer, HB9JNX/AE4WA\n"
71KERN_INFO "baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n"; 71"baycom_epp: version 0.7 compiled " __TIME__ " " __DATE__ "\n";
72 72
73/* --------------------------------------------------------------------- */ 73/* --------------------------------------------------------------------- */
74 74
diff --git a/drivers/net/hamradio/baycom_par.c b/drivers/net/hamradio/baycom_par.c
index 2e6fc4dc74b1..5f5af9a606f8 100644
--- a/drivers/net/hamradio/baycom_par.c
+++ b/drivers/net/hamradio/baycom_par.c
@@ -102,7 +102,7 @@
102 102
103static const char bc_drvname[] = "baycom_par"; 103static const char bc_drvname[] = "baycom_par";
104static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" 104static const char bc_drvinfo[] = KERN_INFO "baycom_par: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
105KERN_INFO "baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n"; 105"baycom_par: version 0.9 compiled " __TIME__ " " __DATE__ "\n";
106 106
107/* --------------------------------------------------------------------- */ 107/* --------------------------------------------------------------------- */
108 108
diff --git a/drivers/net/hamradio/baycom_ser_fdx.c b/drivers/net/hamradio/baycom_ser_fdx.c
index b6a816e60c0f..aa4488e871b2 100644
--- a/drivers/net/hamradio/baycom_ser_fdx.c
+++ b/drivers/net/hamradio/baycom_ser_fdx.c
@@ -91,7 +91,7 @@
91 91
92static const char bc_drvname[] = "baycom_ser_fdx"; 92static const char bc_drvname[] = "baycom_ser_fdx";
93static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" 93static const char bc_drvinfo[] = KERN_INFO "baycom_ser_fdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
94KERN_INFO "baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; 94"baycom_ser_fdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
95 95
96/* --------------------------------------------------------------------- */ 96/* --------------------------------------------------------------------- */
97 97
diff --git a/drivers/net/hamradio/baycom_ser_hdx.c b/drivers/net/hamradio/baycom_ser_hdx.c
index 3bcc57acbe6d..88c593596020 100644
--- a/drivers/net/hamradio/baycom_ser_hdx.c
+++ b/drivers/net/hamradio/baycom_ser_hdx.c
@@ -79,7 +79,7 @@
79 79
80static const char bc_drvname[] = "baycom_ser_hdx"; 80static const char bc_drvname[] = "baycom_ser_hdx";
81static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n" 81static const char bc_drvinfo[] = KERN_INFO "baycom_ser_hdx: (C) 1996-2000 Thomas Sailer, HB9JNX/AE4WA\n"
82KERN_INFO "baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n"; 82"baycom_ser_hdx: version 0.10 compiled " __TIME__ " " __DATE__ "\n";
83 83
84/* --------------------------------------------------------------------- */ 84/* --------------------------------------------------------------------- */
85 85
diff --git a/drivers/net/igbvf/vf.c b/drivers/net/igbvf/vf.c
index 2a4faf9ade69..a9a61efa964c 100644
--- a/drivers/net/igbvf/vf.c
+++ b/drivers/net/igbvf/vf.c
@@ -274,6 +274,8 @@ static s32 e1000_set_vfta_vf(struct e1000_hw *hw, u16 vid, bool set)
274 274
275 err = mbx->ops.read_posted(hw, msgbuf, 2); 275 err = mbx->ops.read_posted(hw, msgbuf, 2);
276 276
277 msgbuf[0] &= ~E1000_VT_MSGTYPE_CTS;
278
277 /* if nacked the vlan was rejected */ 279 /* if nacked the vlan was rejected */
278 if (!err && (msgbuf[0] == (E1000_VF_SET_VLAN | E1000_VT_MSGTYPE_NACK))) 280 if (!err && (msgbuf[0] == (E1000_VF_SET_VLAN | E1000_VT_MSGTYPE_NACK)))
279 err = -E1000_ERR_MAC_INIT; 281 err = -E1000_ERR_MAC_INIT;
@@ -317,6 +319,8 @@ static void e1000_rar_set_vf(struct e1000_hw *hw, u8 * addr, u32 index)
317 if (!ret_val) 319 if (!ret_val)
318 ret_val = mbx->ops.read_posted(hw, msgbuf, 3); 320 ret_val = mbx->ops.read_posted(hw, msgbuf, 3);
319 321
322 msgbuf[0] &= ~E1000_VT_MSGTYPE_CTS;
323
320 /* if nacked the address was rejected, use "perm_addr" */ 324 /* if nacked the address was rejected, use "perm_addr" */
321 if (!ret_val && 325 if (!ret_val &&
322 (msgbuf[0] == (E1000_VF_SET_MAC_ADDR | E1000_VT_MSGTYPE_NACK))) 326 (msgbuf[0] == (E1000_VF_SET_MAC_ADDR | E1000_VT_MSGTYPE_NACK)))
diff --git a/drivers/net/irda/irtty-sir.c b/drivers/net/irda/irtty-sir.c
index d53aa9582137..20f9bc626688 100644
--- a/drivers/net/irda/irtty-sir.c
+++ b/drivers/net/irda/irtty-sir.c
@@ -31,7 +31,6 @@
31#include <linux/tty.h> 31#include <linux/tty.h>
32#include <linux/init.h> 32#include <linux/init.h>
33#include <asm/uaccess.h> 33#include <asm/uaccess.h>
34#include <linux/smp_lock.h>
35#include <linux/delay.h> 34#include <linux/delay.h>
36#include <linux/mutex.h> 35#include <linux/mutex.h>
37 36
diff --git a/drivers/net/irda/w83977af_ir.c b/drivers/net/irda/w83977af_ir.c
index 49ef76320f51..462bc437080f 100644
--- a/drivers/net/irda/w83977af_ir.c
+++ b/drivers/net/irda/w83977af_ir.c
@@ -115,7 +115,7 @@ static int __init w83977af_init(void)
115 115
116 IRDA_DEBUG(0, "%s()\n", __func__ ); 116 IRDA_DEBUG(0, "%s()\n", __func__ );
117 117
118 for (i=0; (io[i] < 2000) && (i < ARRAY_SIZE(dev_self)); i++) { 118 for (i=0; i < ARRAY_SIZE(dev_self) && io[i] < 2000; i++) {
119 if (w83977af_open(i, io[i], irq[i], dma[i]) == 0) 119 if (w83977af_open(i, io[i], irq[i], dma[i]) == 0)
120 return 0; 120 return 0;
121 } 121 }
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 62b6c028ae81..8f1f8bab0fd9 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -136,6 +136,8 @@ struct ixgbe_ring {
136 136
137 u8 queue_index; /* needed for multiqueue queue management */ 137 u8 queue_index; /* needed for multiqueue queue management */
138 138
139#define IXGBE_RING_RX_PS_ENABLED (u8)(1)
140 u8 flags; /* per ring feature flags */
139 u16 head; 141 u16 head;
140 u16 tail; 142 u16 tail;
141 143
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c
index ed0bb3b20255..1c227b0777a6 100644
--- a/drivers/net/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ixgbe/ixgbe_82598.c
@@ -50,6 +50,51 @@ static s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
50 u8 *eeprom_data); 50 u8 *eeprom_data);
51 51
52/** 52/**
53 * ixgbe_set_pcie_completion_timeout - set pci-e completion timeout
54 * @hw: pointer to the HW structure
55 *
56 * The defaults for 82598 should be in the range of 50us to 50ms,
57 * however the hardware default for these parts is 500us to 1ms which is less
58 * than the 10ms recommended by the pci-e spec. To address this we need to
59 * increase the value to either 10ms to 250ms for capability version 1 config,
60 * or 16ms to 55ms for version 2.
61 **/
62void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw)
63{
64 struct ixgbe_adapter *adapter = hw->back;
65 u32 gcr = IXGBE_READ_REG(hw, IXGBE_GCR);
66 u16 pcie_devctl2;
67
68 /* only take action if timeout value is defaulted to 0 */
69 if (gcr & IXGBE_GCR_CMPL_TMOUT_MASK)
70 goto out;
71
72 /*
73 * if capababilities version is type 1 we can write the
74 * timeout of 10ms to 250ms through the GCR register
75 */
76 if (!(gcr & IXGBE_GCR_CAP_VER2)) {
77 gcr |= IXGBE_GCR_CMPL_TMOUT_10ms;
78 goto out;
79 }
80
81 /*
82 * for version 2 capabilities we need to write the config space
83 * directly in order to set the completion timeout value for
84 * 16ms to 55ms
85 */
86 pci_read_config_word(adapter->pdev,
87 IXGBE_PCI_DEVICE_CONTROL2, &pcie_devctl2);
88 pcie_devctl2 |= IXGBE_PCI_DEVICE_CONTROL2_16ms;
89 pci_write_config_word(adapter->pdev,
90 IXGBE_PCI_DEVICE_CONTROL2, pcie_devctl2);
91out:
92 /* disable completion timeout resend */
93 gcr &= ~IXGBE_GCR_CMPL_TMOUT_RESEND;
94 IXGBE_WRITE_REG(hw, IXGBE_GCR, gcr);
95}
96
97/**
53 * ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count 98 * ixgbe_get_pcie_msix_count_82598 - Gets MSI-X vector count
54 * @hw: pointer to hardware structure 99 * @hw: pointer to hardware structure
55 * 100 *
@@ -153,6 +198,26 @@ out:
153} 198}
154 199
155/** 200/**
201 * ixgbe_start_hw_82598 - Prepare hardware for Tx/Rx
202 * @hw: pointer to hardware structure
203 *
204 * Starts the hardware using the generic start_hw function.
205 * Then set pcie completion timeout
206 **/
207s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw)
208{
209 s32 ret_val = 0;
210
211 ret_val = ixgbe_start_hw_generic(hw);
212
213 /* set the completion timeout for interface */
214 if (ret_val == 0)
215 ixgbe_set_pcie_completion_timeout(hw);
216
217 return ret_val;
218}
219
220/**
156 * ixgbe_get_link_capabilities_82598 - Determines link capabilities 221 * ixgbe_get_link_capabilities_82598 - Determines link capabilities
157 * @hw: pointer to hardware structure 222 * @hw: pointer to hardware structure
158 * @speed: pointer to link speed 223 * @speed: pointer to link speed
@@ -1086,7 +1151,7 @@ out:
1086static struct ixgbe_mac_operations mac_ops_82598 = { 1151static struct ixgbe_mac_operations mac_ops_82598 = {
1087 .init_hw = &ixgbe_init_hw_generic, 1152 .init_hw = &ixgbe_init_hw_generic,
1088 .reset_hw = &ixgbe_reset_hw_82598, 1153 .reset_hw = &ixgbe_reset_hw_82598,
1089 .start_hw = &ixgbe_start_hw_generic, 1154 .start_hw = &ixgbe_start_hw_82598,
1090 .clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic, 1155 .clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic,
1091 .get_media_type = &ixgbe_get_media_type_82598, 1156 .get_media_type = &ixgbe_get_media_type_82598,
1092 .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82598, 1157 .get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82598,
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 52d7f19de435..71df9ed9b534 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -587,7 +587,7 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
587 rx_desc = IXGBE_RX_DESC_ADV(*rx_ring, i); 587 rx_desc = IXGBE_RX_DESC_ADV(*rx_ring, i);
588 588
589 if (!bi->page_dma && 589 if (!bi->page_dma &&
590 (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED)) { 590 (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)) {
591 if (!bi->page) { 591 if (!bi->page) {
592 bi->page = alloc_page(GFP_ATOMIC); 592 bi->page = alloc_page(GFP_ATOMIC);
593 if (!bi->page) { 593 if (!bi->page) {
@@ -631,7 +631,7 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
631 } 631 }
632 /* Refresh the desc even if buffer_addrs didn't change because 632 /* Refresh the desc even if buffer_addrs didn't change because
633 * each write-back erases this info. */ 633 * each write-back erases this info. */
634 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 634 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
635 rx_desc->read.pkt_addr = cpu_to_le64(bi->page_dma); 635 rx_desc->read.pkt_addr = cpu_to_le64(bi->page_dma);
636 rx_desc->read.hdr_addr = cpu_to_le64(bi->dma); 636 rx_desc->read.hdr_addr = cpu_to_le64(bi->dma);
637 } else { 637 } else {
@@ -728,7 +728,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
728 break; 728 break;
729 (*work_done)++; 729 (*work_done)++;
730 730
731 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 731 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
732 hdr_info = le16_to_cpu(ixgbe_get_hdr_info(rx_desc)); 732 hdr_info = le16_to_cpu(ixgbe_get_hdr_info(rx_desc));
733 len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >> 733 len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >>
734 IXGBE_RXDADV_HDRBUFLEN_SHIFT; 734 IXGBE_RXDADV_HDRBUFLEN_SHIFT;
@@ -800,7 +800,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
800 rx_ring->stats.packets++; 800 rx_ring->stats.packets++;
801 rx_ring->stats.bytes += skb->len; 801 rx_ring->stats.bytes += skb->len;
802 } else { 802 } else {
803 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 803 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
804 rx_buffer_info->skb = next_buffer->skb; 804 rx_buffer_info->skb = next_buffer->skb;
805 rx_buffer_info->dma = next_buffer->dma; 805 rx_buffer_info->dma = next_buffer->dma;
806 next_buffer->skb = skb; 806 next_buffer->skb = skb;
@@ -1900,46 +1900,19 @@ static void ixgbe_configure_tx(struct ixgbe_adapter *adapter)
1900 1900
1901#define IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT 2 1901#define IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT 2
1902 1902
1903static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, int index) 1903static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter,
1904 struct ixgbe_ring *rx_ring)
1904{ 1905{
1905 struct ixgbe_ring *rx_ring;
1906 u32 srrctl; 1906 u32 srrctl;
1907 int queue0 = 0; 1907 int index;
1908 unsigned long mask;
1909 struct ixgbe_ring_feature *feature = adapter->ring_feature; 1908 struct ixgbe_ring_feature *feature = adapter->ring_feature;
1910 1909
1911 if (adapter->hw.mac.type == ixgbe_mac_82599EB) { 1910 index = rx_ring->reg_idx;
1912 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 1911 if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
1913 int dcb_i = feature[RING_F_DCB].indices; 1912 unsigned long mask;
1914 if (dcb_i == 8)
1915 queue0 = index >> 4;
1916 else if (dcb_i == 4)
1917 queue0 = index >> 5;
1918 else
1919 dev_err(&adapter->pdev->dev, "Invalid DCB "
1920 "configuration\n");
1921#ifdef IXGBE_FCOE
1922 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
1923 struct ixgbe_ring_feature *f;
1924
1925 rx_ring = &adapter->rx_ring[queue0];
1926 f = &adapter->ring_feature[RING_F_FCOE];
1927 if ((queue0 == 0) && (index > rx_ring->reg_idx))
1928 queue0 = f->mask + index -
1929 rx_ring->reg_idx - 1;
1930 }
1931#endif /* IXGBE_FCOE */
1932 } else {
1933 queue0 = index;
1934 }
1935 } else {
1936 mask = (unsigned long) feature[RING_F_RSS].mask; 1913 mask = (unsigned long) feature[RING_F_RSS].mask;
1937 queue0 = index & mask;
1938 index = index & mask; 1914 index = index & mask;
1939 } 1915 }
1940
1941 rx_ring = &adapter->rx_ring[queue0];
1942
1943 srrctl = IXGBE_READ_REG(&adapter->hw, IXGBE_SRRCTL(index)); 1916 srrctl = IXGBE_READ_REG(&adapter->hw, IXGBE_SRRCTL(index));
1944 1917
1945 srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; 1918 srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK;
@@ -1948,7 +1921,7 @@ static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, int index)
1948 srrctl |= (IXGBE_RX_HDR_SIZE << IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) & 1921 srrctl |= (IXGBE_RX_HDR_SIZE << IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) &
1949 IXGBE_SRRCTL_BSIZEHDR_MASK; 1922 IXGBE_SRRCTL_BSIZEHDR_MASK;
1950 1923
1951 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 1924 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
1952#if (PAGE_SIZE / 2) > IXGBE_MAX_RXBUFFER 1925#if (PAGE_SIZE / 2) > IXGBE_MAX_RXBUFFER
1953 srrctl |= IXGBE_MAX_RXBUFFER >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; 1926 srrctl |= IXGBE_MAX_RXBUFFER >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
1954#else 1927#else
@@ -2004,6 +1977,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2004{ 1977{
2005 u64 rdba; 1978 u64 rdba;
2006 struct ixgbe_hw *hw = &adapter->hw; 1979 struct ixgbe_hw *hw = &adapter->hw;
1980 struct ixgbe_ring *rx_ring;
2007 struct net_device *netdev = adapter->netdev; 1981 struct net_device *netdev = adapter->netdev;
2008 int max_frame = netdev->mtu + ETH_HLEN + ETH_FCS_LEN; 1982 int max_frame = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
2009 int i, j; 1983 int i, j;
@@ -2020,11 +1994,6 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2020 /* Decide whether to use packet split mode or not */ 1994 /* Decide whether to use packet split mode or not */
2021 adapter->flags |= IXGBE_FLAG_RX_PS_ENABLED; 1995 adapter->flags |= IXGBE_FLAG_RX_PS_ENABLED;
2022 1996
2023#ifdef IXGBE_FCOE
2024 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
2025 adapter->flags &= ~IXGBE_FLAG_RX_PS_ENABLED;
2026#endif /* IXGBE_FCOE */
2027
2028 /* Set the RX buffer length according to the mode */ 1997 /* Set the RX buffer length according to the mode */
2029 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 1998 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
2030 rx_buf_len = IXGBE_RX_HDR_SIZE; 1999 rx_buf_len = IXGBE_RX_HDR_SIZE;
@@ -2072,29 +2041,35 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2072 * the Base and Length of the Rx Descriptor Ring 2041 * the Base and Length of the Rx Descriptor Ring
2073 */ 2042 */
2074 for (i = 0; i < adapter->num_rx_queues; i++) { 2043 for (i = 0; i < adapter->num_rx_queues; i++) {
2075 rdba = adapter->rx_ring[i].dma; 2044 rx_ring = &adapter->rx_ring[i];
2076 j = adapter->rx_ring[i].reg_idx; 2045 rdba = rx_ring->dma;
2046 j = rx_ring->reg_idx;
2077 IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), (rdba & DMA_BIT_MASK(32))); 2047 IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), (rdba & DMA_BIT_MASK(32)));
2078 IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32)); 2048 IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32));
2079 IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), rdlen); 2049 IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), rdlen);
2080 IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0); 2050 IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0);
2081 IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0); 2051 IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0);
2082 adapter->rx_ring[i].head = IXGBE_RDH(j); 2052 rx_ring->head = IXGBE_RDH(j);
2083 adapter->rx_ring[i].tail = IXGBE_RDT(j); 2053 rx_ring->tail = IXGBE_RDT(j);
2084 adapter->rx_ring[i].rx_buf_len = rx_buf_len; 2054 rx_ring->rx_buf_len = rx_buf_len;
2055
2056 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED)
2057 rx_ring->flags |= IXGBE_RING_RX_PS_ENABLED;
2085 2058
2086#ifdef IXGBE_FCOE 2059#ifdef IXGBE_FCOE
2087 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { 2060 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
2088 struct ixgbe_ring_feature *f; 2061 struct ixgbe_ring_feature *f;
2089 f = &adapter->ring_feature[RING_F_FCOE]; 2062 f = &adapter->ring_feature[RING_F_FCOE];
2090 if ((rx_buf_len < IXGBE_FCOE_JUMBO_FRAME_SIZE) && 2063 if ((i >= f->mask) && (i < f->mask + f->indices)) {
2091 (i >= f->mask) && (i < f->mask + f->indices)) 2064 rx_ring->flags &= ~IXGBE_RING_RX_PS_ENABLED;
2092 adapter->rx_ring[i].rx_buf_len = 2065 if (rx_buf_len < IXGBE_FCOE_JUMBO_FRAME_SIZE)
2093 IXGBE_FCOE_JUMBO_FRAME_SIZE; 2066 rx_ring->rx_buf_len =
2067 IXGBE_FCOE_JUMBO_FRAME_SIZE;
2068 }
2094 } 2069 }
2095 2070
2096#endif /* IXGBE_FCOE */ 2071#endif /* IXGBE_FCOE */
2097 ixgbe_configure_srrctl(adapter, j); 2072 ixgbe_configure_srrctl(adapter, rx_ring);
2098 } 2073 }
2099 2074
2100 if (hw->mac.type == ixgbe_mac_82598EB) { 2075 if (hw->mac.type == ixgbe_mac_82598EB) {
@@ -2170,7 +2145,8 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2170 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { 2145 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
2171 /* Enable 82599 HW-RSC */ 2146 /* Enable 82599 HW-RSC */
2172 for (i = 0; i < adapter->num_rx_queues; i++) { 2147 for (i = 0; i < adapter->num_rx_queues; i++) {
2173 j = adapter->rx_ring[i].reg_idx; 2148 rx_ring = &adapter->rx_ring[i];
2149 j = rx_ring->reg_idx;
2174 rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(j)); 2150 rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(j));
2175 rscctrl |= IXGBE_RSCCTL_RSCEN; 2151 rscctrl |= IXGBE_RSCCTL_RSCEN;
2176 /* 2152 /*
@@ -2178,7 +2154,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2178 * total size of max desc * buf_len is not greater 2154 * total size of max desc * buf_len is not greater
2179 * than 65535 2155 * than 65535
2180 */ 2156 */
2181 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 2157 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
2182#if (MAX_SKB_FRAGS > 16) 2158#if (MAX_SKB_FRAGS > 16)
2183 rscctrl |= IXGBE_RSCCTL_MAXDESC_16; 2159 rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
2184#elif (MAX_SKB_FRAGS > 8) 2160#elif (MAX_SKB_FRAGS > 8)
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 17ee3890a0a1..f0f3406ef001 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -719,6 +719,12 @@
719#define IXGBE_ECC_STATUS_82599 0x110E0 719#define IXGBE_ECC_STATUS_82599 0x110E0
720#define IXGBE_BAR_CTRL_82599 0x110F4 720#define IXGBE_BAR_CTRL_82599 0x110F4
721 721
722/* PCI Express Control */
723#define IXGBE_GCR_CMPL_TMOUT_MASK 0x0000F000
724#define IXGBE_GCR_CMPL_TMOUT_10ms 0x00001000
725#define IXGBE_GCR_CMPL_TMOUT_RESEND 0x00010000
726#define IXGBE_GCR_CAP_VER2 0x00040000
727
722/* Time Sync Registers */ 728/* Time Sync Registers */
723#define IXGBE_TSYNCRXCTL 0x05188 /* Rx Time Sync Control register - RW */ 729#define IXGBE_TSYNCRXCTL 0x05188 /* Rx Time Sync Control register - RW */
724#define IXGBE_TSYNCTXCTL 0x08C00 /* Tx Time Sync Control register - RW */ 730#define IXGBE_TSYNCTXCTL 0x08C00 /* Tx Time Sync Control register - RW */
@@ -1522,6 +1528,7 @@
1522 1528
1523/* PCI Bus Info */ 1529/* PCI Bus Info */
1524#define IXGBE_PCI_LINK_STATUS 0xB2 1530#define IXGBE_PCI_LINK_STATUS 0xB2
1531#define IXGBE_PCI_DEVICE_CONTROL2 0xC8
1525#define IXGBE_PCI_LINK_WIDTH 0x3F0 1532#define IXGBE_PCI_LINK_WIDTH 0x3F0
1526#define IXGBE_PCI_LINK_WIDTH_1 0x10 1533#define IXGBE_PCI_LINK_WIDTH_1 0x10
1527#define IXGBE_PCI_LINK_WIDTH_2 0x20 1534#define IXGBE_PCI_LINK_WIDTH_2 0x20
@@ -1532,6 +1539,7 @@
1532#define IXGBE_PCI_LINK_SPEED_5000 0x2 1539#define IXGBE_PCI_LINK_SPEED_5000 0x2
1533#define IXGBE_PCI_HEADER_TYPE_REGISTER 0x0E 1540#define IXGBE_PCI_HEADER_TYPE_REGISTER 0x0E
1534#define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80 1541#define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80
1542#define IXGBE_PCI_DEVICE_CONTROL2_16ms 0x0005
1535 1543
1536/* Number of 100 microseconds we wait for PCI Express master disable */ 1544/* Number of 100 microseconds we wait for PCI Express master disable */
1537#define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800 1545#define IXGBE_PCI_MASTER_DISABLE_TIMEOUT 800
diff --git a/drivers/net/mlx4/cmd.c b/drivers/net/mlx4/cmd.c
index 2845a0560b84..65ec77dc31f5 100644
--- a/drivers/net/mlx4/cmd.c
+++ b/drivers/net/mlx4/cmd.c
@@ -80,7 +80,9 @@ enum {
80 /* Bad management packet (silently discarded): */ 80 /* Bad management packet (silently discarded): */
81 CMD_STAT_BAD_PKT = 0x30, 81 CMD_STAT_BAD_PKT = 0x30,
82 /* More outstanding CQEs in CQ than new CQ size: */ 82 /* More outstanding CQEs in CQ than new CQ size: */
83 CMD_STAT_BAD_SIZE = 0x40 83 CMD_STAT_BAD_SIZE = 0x40,
84 /* Multi Function device support required: */
85 CMD_STAT_MULTI_FUNC_REQ = 0x50,
84}; 86};
85 87
86enum { 88enum {
@@ -128,6 +130,7 @@ static int mlx4_status_to_errno(u8 status)
128 [CMD_STAT_LAM_NOT_PRE] = -EAGAIN, 130 [CMD_STAT_LAM_NOT_PRE] = -EAGAIN,
129 [CMD_STAT_BAD_PKT] = -EINVAL, 131 [CMD_STAT_BAD_PKT] = -EINVAL,
130 [CMD_STAT_BAD_SIZE] = -ENOMEM, 132 [CMD_STAT_BAD_SIZE] = -ENOMEM,
133 [CMD_STAT_MULTI_FUNC_REQ] = -EACCES,
131 }; 134 };
132 135
133 if (status >= ARRAY_SIZE(trans_table) || 136 if (status >= ARRAY_SIZE(trans_table) ||
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c
index cd084de322f4..03b781a7a182 100644
--- a/drivers/net/mlx4/en_rx.c
+++ b/drivers/net/mlx4/en_rx.c
@@ -462,8 +462,9 @@ static int mlx4_en_complete_rx_desc(struct mlx4_en_priv *priv,
462 PCI_DMA_FROMDEVICE); 462 PCI_DMA_FROMDEVICE);
463 } 463 }
464 /* Adjust size of last fragment to match actual length */ 464 /* Adjust size of last fragment to match actual length */
465 skb_frags_rx[nr - 1].size = length - 465 if (nr > 0)
466 priv->frag_info[nr - 1].frag_prefix_size; 466 skb_frags_rx[nr - 1].size = length -
467 priv->frag_info[nr - 1].frag_prefix_size;
467 return nr; 468 return nr;
468 469
469fail: 470fail:
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index cbc8ab0c6d12..0ecc1e1b013e 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -249,6 +249,7 @@ static u32 mlx4_en_free_tx_desc(struct mlx4_en_priv *priv,
249 pci_unmap_page(mdev->pdev, 249 pci_unmap_page(mdev->pdev,
250 (dma_addr_t) be64_to_cpu(data->addr), 250 (dma_addr_t) be64_to_cpu(data->addr),
251 frag->size, PCI_DMA_TODEVICE); 251 frag->size, PCI_DMA_TODEVICE);
252 ++data;
252 } 253 }
253 } 254 }
254 /* Stamp the freed descriptor */ 255 /* Stamp the freed descriptor */
diff --git a/drivers/net/mlx4/main.c b/drivers/net/mlx4/main.c
index 018348c01193..dac621b1e9fc 100644
--- a/drivers/net/mlx4/main.c
+++ b/drivers/net/mlx4/main.c
@@ -729,7 +729,10 @@ static int mlx4_init_hca(struct mlx4_dev *dev)
729 729
730 err = mlx4_QUERY_FW(dev); 730 err = mlx4_QUERY_FW(dev);
731 if (err) { 731 if (err) {
732 mlx4_err(dev, "QUERY_FW command failed, aborting.\n"); 732 if (err == -EACCES)
733 mlx4_info(dev, "non-primary physical function, skipping.\n");
734 else
735 mlx4_err(dev, "QUERY_FW command failed, aborting.\n");
733 return err; 736 return err;
734 } 737 }
735 738
@@ -1285,6 +1288,7 @@ static struct pci_device_id mlx4_pci_table[] = {
1285 { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */ 1288 { PCI_VDEVICE(MELLANOX, 0x6750) }, /* MT25408 "Hermon" EN 10GigE PCIe gen2 */
1286 { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */ 1289 { PCI_VDEVICE(MELLANOX, 0x6372) }, /* MT25458 ConnectX EN 10GBASE-T 10GigE */
1287 { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */ 1290 { PCI_VDEVICE(MELLANOX, 0x675a) }, /* MT25458 ConnectX EN 10GBASE-T+Gen2 10GigE */
1291 { PCI_VDEVICE(MELLANOX, 0x6764) }, /* MT26468 ConnectX EN 10GigE PCIe gen2*/
1288 { 0, } 1292 { 0, }
1289}; 1293};
1290 1294
diff --git a/drivers/net/natsemi.c b/drivers/net/natsemi.c
index 481aa2d287a3..32db12a27342 100644
--- a/drivers/net/natsemi.c
+++ b/drivers/net/natsemi.c
@@ -130,8 +130,8 @@ static int full_duplex[MAX_UNITS];
130static const char version[] __devinitconst = 130static const char version[] __devinitconst =
131 KERN_INFO DRV_NAME " dp8381x driver, version " 131 KERN_INFO DRV_NAME " dp8381x driver, version "
132 DRV_VERSION ", " DRV_RELDATE "\n" 132 DRV_VERSION ", " DRV_RELDATE "\n"
133 KERN_INFO " originally by Donald Becker <becker@scyld.com>\n" 133 " originally by Donald Becker <becker@scyld.com>\n"
134 KERN_INFO " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n"; 134 " 2.4.x kernel port by Jeff Garzik, Tjeerd Mulder\n";
135 135
136MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 136MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
137MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver"); 137MODULE_DESCRIPTION("National Semiconductor DP8381x series PCI Ethernet driver");
diff --git a/drivers/net/ne.c b/drivers/net/ne.c
index 5c3e242428f1..992dbfffdb05 100644
--- a/drivers/net/ne.c
+++ b/drivers/net/ne.c
@@ -321,7 +321,7 @@ static int __init ne_probe1(struct net_device *dev, unsigned long ioaddr)
321 } 321 }
322 322
323 if (ei_debug && version_printed++ == 0) 323 if (ei_debug && version_printed++ == 0)
324 printk(KERN_INFO "%s" KERN_INFO "%s", version1, version2); 324 printk(KERN_INFO "%s%s", version1, version2);
325 325
326 printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr); 326 printk(KERN_INFO "NE*000 ethercard probe at %#3lx:", ioaddr);
327 327
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c
index c91e02245815..98271f962ae4 100644
--- a/drivers/net/netxen/netxen_nic_main.c
+++ b/drivers/net/netxen/netxen_nic_main.c
@@ -222,7 +222,7 @@ netxen_napi_disable(struct netxen_adapter *adapter)
222 } 222 }
223} 223}
224 224
225static int nx_set_dma_mask(struct netxen_adapter *adapter, uint8_t revision_id) 225static int nx_set_dma_mask(struct netxen_adapter *adapter)
226{ 226{
227 struct pci_dev *pdev = adapter->pdev; 227 struct pci_dev *pdev = adapter->pdev;
228 uint64_t mask, cmask; 228 uint64_t mask, cmask;
@@ -230,19 +230,17 @@ static int nx_set_dma_mask(struct netxen_adapter *adapter, uint8_t revision_id)
230 adapter->pci_using_dac = 0; 230 adapter->pci_using_dac = 0;
231 231
232 mask = DMA_BIT_MASK(32); 232 mask = DMA_BIT_MASK(32);
233 /*
234 * Consistent DMA mask is set to 32 bit because it cannot be set to
235 * 35 bits. For P3 also leave it at 32 bits for now. Only the rings
236 * come off this pool.
237 */
238 cmask = DMA_BIT_MASK(32); 233 cmask = DMA_BIT_MASK(32);
239 234
235 if (NX_IS_REVISION_P2(adapter->ahw.revision_id)) {
240#ifndef CONFIG_IA64 236#ifndef CONFIG_IA64
241 if (revision_id >= NX_P3_B0)
242 mask = DMA_BIT_MASK(39);
243 else if (revision_id == NX_P2_C1)
244 mask = DMA_BIT_MASK(35); 237 mask = DMA_BIT_MASK(35);
245#endif 238#endif
239 } else {
240 mask = DMA_BIT_MASK(39);
241 cmask = mask;
242 }
243
246 if (pci_set_dma_mask(pdev, mask) == 0 && 244 if (pci_set_dma_mask(pdev, mask) == 0 &&
247 pci_set_consistent_dma_mask(pdev, cmask) == 0) { 245 pci_set_consistent_dma_mask(pdev, cmask) == 0) {
248 adapter->pci_using_dac = 1; 246 adapter->pci_using_dac = 1;
@@ -257,13 +255,13 @@ static int
257nx_update_dma_mask(struct netxen_adapter *adapter) 255nx_update_dma_mask(struct netxen_adapter *adapter)
258{ 256{
259 int change, shift, err; 257 int change, shift, err;
260 uint64_t mask, old_mask; 258 uint64_t mask, old_mask, old_cmask;
261 struct pci_dev *pdev = adapter->pdev; 259 struct pci_dev *pdev = adapter->pdev;
262 260
263 change = 0; 261 change = 0;
264 262
265 shift = NXRD32(adapter, CRB_DMA_SHIFT); 263 shift = NXRD32(adapter, CRB_DMA_SHIFT);
266 if (shift >= 32) 264 if (shift > 32)
267 return 0; 265 return 0;
268 266
269 if (NX_IS_REVISION_P3(adapter->ahw.revision_id) && (shift > 9)) 267 if (NX_IS_REVISION_P3(adapter->ahw.revision_id) && (shift > 9))
@@ -273,14 +271,29 @@ nx_update_dma_mask(struct netxen_adapter *adapter)
273 271
274 if (change) { 272 if (change) {
275 old_mask = pdev->dma_mask; 273 old_mask = pdev->dma_mask;
276 mask = (1ULL<<(32+shift)) - 1; 274 old_cmask = pdev->dev.coherent_dma_mask;
275
276 mask = DMA_BIT_MASK(32+shift);
277 277
278 err = pci_set_dma_mask(pdev, mask); 278 err = pci_set_dma_mask(pdev, mask);
279 if (err) 279 if (err)
280 return pci_set_dma_mask(pdev, old_mask); 280 goto err_out;
281
282 if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) {
283
284 err = pci_set_consistent_dma_mask(pdev, mask);
285 if (err)
286 goto err_out;
287 }
288 dev_info(&pdev->dev, "using %d-bit dma mask\n", 32+shift);
281 } 289 }
282 290
283 return 0; 291 return 0;
292
293err_out:
294 pci_set_dma_mask(pdev, old_mask);
295 pci_set_consistent_dma_mask(pdev, old_cmask);
296 return err;
284} 297}
285 298
286static void 299static void
@@ -1128,7 +1141,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1128 revision_id = pdev->revision; 1141 revision_id = pdev->revision;
1129 adapter->ahw.revision_id = revision_id; 1142 adapter->ahw.revision_id = revision_id;
1130 1143
1131 err = nx_set_dma_mask(adapter, revision_id); 1144 err = nx_set_dma_mask(adapter);
1132 if (err) 1145 if (err)
1133 goto err_out_free_netdev; 1146 goto err_out_free_netdev;
1134 1147
diff --git a/drivers/net/pci-skeleton.c b/drivers/net/pci-skeleton.c
index e4a93b8ed485..c47ba3610c58 100644
--- a/drivers/net/pci-skeleton.c
+++ b/drivers/net/pci-skeleton.c
@@ -105,7 +105,7 @@ IVc. Errata
105 105
106static char version[] __devinitdata = 106static char version[] __devinitdata =
107KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n" 107KERN_INFO NETDRV_DRIVER_LOAD_MSG "\n"
108KERN_INFO " Support available from http://foo.com/bar/baz.html\n"; 108" Support available from http://foo.com/bar/baz.html\n";
109 109
110/* define to 1 to enable PIO instead of MMIO */ 110/* define to 1 to enable PIO instead of MMIO */
111#undef USE_IO_OPS 111#undef USE_IO_OPS
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index f51944b28cfa..06618af1a468 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -298,14 +298,11 @@ static int __devinit ibmtr_config(struct pcmcia_device *link)
298 298
299 strcpy(info->node.dev_name, dev->name); 299 strcpy(info->node.dev_name, dev->name);
300 300
301 printk(KERN_INFO "%s: port %#3lx, irq %d,", 301 printk(KERN_INFO
302 dev->name, dev->base_addr, dev->irq); 302 "%s: port %#3lx, irq %d, mmio %#5lx, sram %#5lx, hwaddr=%pM\n",
303 printk (" mmio %#5lx,", (u_long)ti->mmio); 303 dev->name, dev->base_addr, dev->irq,
304 printk (" sram %#5lx,", (u_long)ti->sram_base << 12); 304 (u_long)ti->mmio, (u_long)(ti->sram_base << 12),
305 printk ("\n" KERN_INFO " hwaddr="); 305 dev->dev_addr);
306 for (i = 0; i < TR_ALEN; i++)
307 printk("%02X", dev->dev_addr[i]);
308 printk("\n");
309 return 0; 306 return 0;
310 307
311cs_failed: 308cs_failed:
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 0f8118a82579..dd6059076705 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -1425,15 +1425,12 @@ static void BuildLAF(int *ladrf, int *adr)
1425 ladrf[byte] |= (1 << (hashcode & 7)); 1425 ladrf[byte] |= (1 << (hashcode & 7));
1426 1426
1427#ifdef PCMCIA_DEBUG 1427#ifdef PCMCIA_DEBUG
1428 if (pc_debug > 2) { 1428 if (pc_debug > 2)
1429 printk(KERN_DEBUG " adr ="); 1429 printk(KERN_DEBUG " adr =%pM\n", adr);
1430 for (i = 0; i < 6; i++) 1430 printk(KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63] =", hashcode);
1431 printk(" %02X", adr[i]); 1431 for (i = 0; i < 8; i++)
1432 printk("\n" KERN_DEBUG " hashcode = %d(decimal), ladrf[0:63]" 1432 printk(KERN_CONT " %02X", ladrf[i]);
1433 " =", hashcode); 1433 printk(KERN_CONT "\n");
1434 for (i = 0; i < 8; i++)
1435 printk(" %02X", ladrf[i]);
1436 printk("\n");
1437 } 1434 }
1438#endif 1435#endif
1439} /* BuildLAF */ 1436} /* BuildLAF */
diff --git a/drivers/net/pcnet32.c b/drivers/net/pcnet32.c
index 955a87ac9afa..6859442f1862 100644
--- a/drivers/net/pcnet32.c
+++ b/drivers/net/pcnet32.c
@@ -485,7 +485,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev,
485 &new_ring_dma_addr); 485 &new_ring_dma_addr);
486 if (new_tx_ring == NULL) { 486 if (new_tx_ring == NULL) {
487 if (netif_msg_drv(lp)) 487 if (netif_msg_drv(lp))
488 printk("\n" KERN_ERR 488 printk(KERN_ERR
489 "%s: Consistent memory allocation failed.\n", 489 "%s: Consistent memory allocation failed.\n",
490 dev->name); 490 dev->name);
491 return; 491 return;
@@ -496,7 +496,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev,
496 GFP_ATOMIC); 496 GFP_ATOMIC);
497 if (!new_dma_addr_list) { 497 if (!new_dma_addr_list) {
498 if (netif_msg_drv(lp)) 498 if (netif_msg_drv(lp))
499 printk("\n" KERN_ERR 499 printk(KERN_ERR
500 "%s: Memory allocation failed.\n", dev->name); 500 "%s: Memory allocation failed.\n", dev->name);
501 goto free_new_tx_ring; 501 goto free_new_tx_ring;
502 } 502 }
@@ -505,7 +505,7 @@ static void pcnet32_realloc_tx_ring(struct net_device *dev,
505 GFP_ATOMIC); 505 GFP_ATOMIC);
506 if (!new_skb_list) { 506 if (!new_skb_list) {
507 if (netif_msg_drv(lp)) 507 if (netif_msg_drv(lp))
508 printk("\n" KERN_ERR 508 printk(KERN_ERR
509 "%s: Memory allocation failed.\n", dev->name); 509 "%s: Memory allocation failed.\n", dev->name);
510 goto free_new_lists; 510 goto free_new_lists;
511 } 511 }
@@ -563,7 +563,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
563 &new_ring_dma_addr); 563 &new_ring_dma_addr);
564 if (new_rx_ring == NULL) { 564 if (new_rx_ring == NULL) {
565 if (netif_msg_drv(lp)) 565 if (netif_msg_drv(lp))
566 printk("\n" KERN_ERR 566 printk(KERN_ERR
567 "%s: Consistent memory allocation failed.\n", 567 "%s: Consistent memory allocation failed.\n",
568 dev->name); 568 dev->name);
569 return; 569 return;
@@ -574,7 +574,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
574 GFP_ATOMIC); 574 GFP_ATOMIC);
575 if (!new_dma_addr_list) { 575 if (!new_dma_addr_list) {
576 if (netif_msg_drv(lp)) 576 if (netif_msg_drv(lp))
577 printk("\n" KERN_ERR 577 printk(KERN_ERR
578 "%s: Memory allocation failed.\n", dev->name); 578 "%s: Memory allocation failed.\n", dev->name);
579 goto free_new_rx_ring; 579 goto free_new_rx_ring;
580 } 580 }
@@ -583,7 +583,7 @@ static void pcnet32_realloc_rx_ring(struct net_device *dev,
583 GFP_ATOMIC); 583 GFP_ATOMIC);
584 if (!new_skb_list) { 584 if (!new_skb_list) {
585 if (netif_msg_drv(lp)) 585 if (netif_msg_drv(lp))
586 printk("\n" KERN_ERR 586 printk(KERN_ERR
587 "%s: Memory allocation failed.\n", dev->name); 587 "%s: Memory allocation failed.\n", dev->name);
588 goto free_new_lists; 588 goto free_new_lists;
589 } 589 }
@@ -1611,8 +1611,11 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1611 if (pcnet32_dwio_read_csr(ioaddr, 0) == 4 1611 if (pcnet32_dwio_read_csr(ioaddr, 0) == 4
1612 && pcnet32_dwio_check(ioaddr)) { 1612 && pcnet32_dwio_check(ioaddr)) {
1613 a = &pcnet32_dwio; 1613 a = &pcnet32_dwio;
1614 } else 1614 } else {
1615 if (pcnet32_debug & NETIF_MSG_PROBE)
1616 printk(KERN_ERR PFX "No access methods\n");
1615 goto err_release_region; 1617 goto err_release_region;
1618 }
1616 } 1619 }
1617 1620
1618 chip_version = 1621 chip_version =
@@ -1719,7 +1722,9 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1719 ret = -ENOMEM; 1722 ret = -ENOMEM;
1720 goto err_release_region; 1723 goto err_release_region;
1721 } 1724 }
1722 SET_NETDEV_DEV(dev, &pdev->dev); 1725
1726 if (pdev)
1727 SET_NETDEV_DEV(dev, &pdev->dev);
1723 1728
1724 if (pcnet32_debug & NETIF_MSG_PROBE) 1729 if (pcnet32_debug & NETIF_MSG_PROBE)
1725 printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr); 1730 printk(KERN_INFO PFX "%s at %#3lx,", chipname, ioaddr);
@@ -1766,38 +1771,38 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1766 /* Version 0x2623 and 0x2624 */ 1771 /* Version 0x2623 and 0x2624 */
1767 if (((chip_version + 1) & 0xfffe) == 0x2624) { 1772 if (((chip_version + 1) & 0xfffe) == 0x2624) {
1768 i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */ 1773 i = a->read_csr(ioaddr, 80) & 0x0C00; /* Check tx_start_pt */
1769 printk("\n" KERN_INFO " tx_start_pt(0x%04x):", i); 1774 printk(KERN_INFO " tx_start_pt(0x%04x):", i);
1770 switch (i >> 10) { 1775 switch (i >> 10) {
1771 case 0: 1776 case 0:
1772 printk(" 20 bytes,"); 1777 printk(KERN_CONT " 20 bytes,");
1773 break; 1778 break;
1774 case 1: 1779 case 1:
1775 printk(" 64 bytes,"); 1780 printk(KERN_CONT " 64 bytes,");
1776 break; 1781 break;
1777 case 2: 1782 case 2:
1778 printk(" 128 bytes,"); 1783 printk(KERN_CONT " 128 bytes,");
1779 break; 1784 break;
1780 case 3: 1785 case 3:
1781 printk("~220 bytes,"); 1786 printk(KERN_CONT "~220 bytes,");
1782 break; 1787 break;
1783 } 1788 }
1784 i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */ 1789 i = a->read_bcr(ioaddr, 18); /* Check Burst/Bus control */
1785 printk(" BCR18(%x):", i & 0xffff); 1790 printk(KERN_CONT " BCR18(%x):", i & 0xffff);
1786 if (i & (1 << 5)) 1791 if (i & (1 << 5))
1787 printk("BurstWrEn "); 1792 printk(KERN_CONT "BurstWrEn ");
1788 if (i & (1 << 6)) 1793 if (i & (1 << 6))
1789 printk("BurstRdEn "); 1794 printk(KERN_CONT "BurstRdEn ");
1790 if (i & (1 << 7)) 1795 if (i & (1 << 7))
1791 printk("DWordIO "); 1796 printk(KERN_CONT "DWordIO ");
1792 if (i & (1 << 11)) 1797 if (i & (1 << 11))
1793 printk("NoUFlow "); 1798 printk(KERN_CONT "NoUFlow ");
1794 i = a->read_bcr(ioaddr, 25); 1799 i = a->read_bcr(ioaddr, 25);
1795 printk("\n" KERN_INFO " SRAMSIZE=0x%04x,", i << 8); 1800 printk(KERN_INFO " SRAMSIZE=0x%04x,", i << 8);
1796 i = a->read_bcr(ioaddr, 26); 1801 i = a->read_bcr(ioaddr, 26);
1797 printk(" SRAM_BND=0x%04x,", i << 8); 1802 printk(KERN_CONT " SRAM_BND=0x%04x,", i << 8);
1798 i = a->read_bcr(ioaddr, 27); 1803 i = a->read_bcr(ioaddr, 27);
1799 if (i & (1 << 14)) 1804 if (i & (1 << 14))
1800 printk("LowLatRx"); 1805 printk(KERN_CONT "LowLatRx");
1801 } 1806 }
1802 } 1807 }
1803 1808
@@ -1818,7 +1823,6 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1818 1823
1819 spin_lock_init(&lp->lock); 1824 spin_lock_init(&lp->lock);
1820 1825
1821 SET_NETDEV_DEV(dev, &pdev->dev);
1822 lp->name = chipname; 1826 lp->name = chipname;
1823 lp->shared_irq = shared; 1827 lp->shared_irq = shared;
1824 lp->tx_ring_size = TX_RING_SIZE; /* default tx ring size */ 1828 lp->tx_ring_size = TX_RING_SIZE; /* default tx ring size */
@@ -1835,7 +1839,7 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1835 lp->chip_version = chip_version; 1839 lp->chip_version = chip_version;
1836 lp->msg_enable = pcnet32_debug; 1840 lp->msg_enable = pcnet32_debug;
1837 if ((cards_found >= MAX_UNITS) 1841 if ((cards_found >= MAX_UNITS)
1838 || (options[cards_found] > sizeof(options_mapping))) 1842 || (options[cards_found] >= sizeof(options_mapping)))
1839 lp->options = PCNET32_PORT_ASEL; 1843 lp->options = PCNET32_PORT_ASEL;
1840 else 1844 else
1841 lp->options = options_mapping[options[cards_found]]; 1845 lp->options = options_mapping[options[cards_found]];
@@ -1852,12 +1856,6 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1852 ((cards_found >= MAX_UNITS) || full_duplex[cards_found])) 1856 ((cards_found >= MAX_UNITS) || full_duplex[cards_found]))
1853 lp->options |= PCNET32_PORT_FD; 1857 lp->options |= PCNET32_PORT_FD;
1854 1858
1855 if (!a) {
1856 if (pcnet32_debug & NETIF_MSG_PROBE)
1857 printk(KERN_ERR PFX "No access methods\n");
1858 ret = -ENODEV;
1859 goto err_free_consistent;
1860 }
1861 lp->a = *a; 1859 lp->a = *a;
1862 1860
1863 /* prior to register_netdev, dev->name is not yet correct */ 1861 /* prior to register_netdev, dev->name is not yet correct */
@@ -1973,14 +1971,13 @@ pcnet32_probe1(unsigned long ioaddr, int shared, struct pci_dev *pdev)
1973 1971
1974 return 0; 1972 return 0;
1975 1973
1976 err_free_ring: 1974err_free_ring:
1977 pcnet32_free_ring(dev); 1975 pcnet32_free_ring(dev);
1978 err_free_consistent:
1979 pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block), 1976 pci_free_consistent(lp->pci_dev, sizeof(*lp->init_block),
1980 lp->init_block, lp->init_dma_addr); 1977 lp->init_block, lp->init_dma_addr);
1981 err_free_netdev: 1978err_free_netdev:
1982 free_netdev(dev); 1979 free_netdev(dev);
1983 err_release_region: 1980err_release_region:
1984 release_region(ioaddr, PCNET32_TOTAL_SIZE); 1981 release_region(ioaddr, PCNET32_TOTAL_SIZE);
1985 return ret; 1982 return ret;
1986} 1983}
@@ -1996,7 +1993,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
1996 &lp->tx_ring_dma_addr); 1993 &lp->tx_ring_dma_addr);
1997 if (lp->tx_ring == NULL) { 1994 if (lp->tx_ring == NULL) {
1998 if (netif_msg_drv(lp)) 1995 if (netif_msg_drv(lp))
1999 printk("\n" KERN_ERR PFX 1996 printk(KERN_ERR PFX
2000 "%s: Consistent memory allocation failed.\n", 1997 "%s: Consistent memory allocation failed.\n",
2001 name); 1998 name);
2002 return -ENOMEM; 1999 return -ENOMEM;
@@ -2008,7 +2005,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2008 &lp->rx_ring_dma_addr); 2005 &lp->rx_ring_dma_addr);
2009 if (lp->rx_ring == NULL) { 2006 if (lp->rx_ring == NULL) {
2010 if (netif_msg_drv(lp)) 2007 if (netif_msg_drv(lp))
2011 printk("\n" KERN_ERR PFX 2008 printk(KERN_ERR PFX
2012 "%s: Consistent memory allocation failed.\n", 2009 "%s: Consistent memory allocation failed.\n",
2013 name); 2010 name);
2014 return -ENOMEM; 2011 return -ENOMEM;
@@ -2018,7 +2015,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2018 GFP_ATOMIC); 2015 GFP_ATOMIC);
2019 if (!lp->tx_dma_addr) { 2016 if (!lp->tx_dma_addr) {
2020 if (netif_msg_drv(lp)) 2017 if (netif_msg_drv(lp))
2021 printk("\n" KERN_ERR PFX 2018 printk(KERN_ERR PFX
2022 "%s: Memory allocation failed.\n", name); 2019 "%s: Memory allocation failed.\n", name);
2023 return -ENOMEM; 2020 return -ENOMEM;
2024 } 2021 }
@@ -2027,7 +2024,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2027 GFP_ATOMIC); 2024 GFP_ATOMIC);
2028 if (!lp->rx_dma_addr) { 2025 if (!lp->rx_dma_addr) {
2029 if (netif_msg_drv(lp)) 2026 if (netif_msg_drv(lp))
2030 printk("\n" KERN_ERR PFX 2027 printk(KERN_ERR PFX
2031 "%s: Memory allocation failed.\n", name); 2028 "%s: Memory allocation failed.\n", name);
2032 return -ENOMEM; 2029 return -ENOMEM;
2033 } 2030 }
@@ -2036,7 +2033,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2036 GFP_ATOMIC); 2033 GFP_ATOMIC);
2037 if (!lp->tx_skbuff) { 2034 if (!lp->tx_skbuff) {
2038 if (netif_msg_drv(lp)) 2035 if (netif_msg_drv(lp))
2039 printk("\n" KERN_ERR PFX 2036 printk(KERN_ERR PFX
2040 "%s: Memory allocation failed.\n", name); 2037 "%s: Memory allocation failed.\n", name);
2041 return -ENOMEM; 2038 return -ENOMEM;
2042 } 2039 }
@@ -2045,7 +2042,7 @@ static int pcnet32_alloc_ring(struct net_device *dev, const char *name)
2045 GFP_ATOMIC); 2042 GFP_ATOMIC);
2046 if (!lp->rx_skbuff) { 2043 if (!lp->rx_skbuff) {
2047 if (netif_msg_drv(lp)) 2044 if (netif_msg_drv(lp))
2048 printk("\n" KERN_ERR PFX 2045 printk(KERN_ERR PFX
2049 "%s: Memory allocation failed.\n", name); 2046 "%s: Memory allocation failed.\n", name);
2050 return -ENOMEM; 2047 return -ENOMEM;
2051 } 2048 }
@@ -2089,6 +2086,7 @@ static void pcnet32_free_ring(struct net_device *dev)
2089static int pcnet32_open(struct net_device *dev) 2086static int pcnet32_open(struct net_device *dev)
2090{ 2087{
2091 struct pcnet32_private *lp = netdev_priv(dev); 2088 struct pcnet32_private *lp = netdev_priv(dev);
2089 struct pci_dev *pdev = lp->pci_dev;
2092 unsigned long ioaddr = dev->base_addr; 2090 unsigned long ioaddr = dev->base_addr;
2093 u16 val; 2091 u16 val;
2094 int i; 2092 int i;
@@ -2149,9 +2147,9 @@ static int pcnet32_open(struct net_device *dev)
2149 lp->a.write_csr(ioaddr, 124, val); 2147 lp->a.write_csr(ioaddr, 124, val);
2150 2148
2151 /* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */ 2149 /* Allied Telesyn AT 2700/2701 FX are 100Mbit only and do not negotiate */
2152 if (lp->pci_dev->subsystem_vendor == PCI_VENDOR_ID_AT && 2150 if (pdev && pdev->subsystem_vendor == PCI_VENDOR_ID_AT &&
2153 (lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX || 2151 (pdev->subsystem_device == PCI_SUBDEVICE_ID_AT_2700FX ||
2154 lp->pci_dev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) { 2152 pdev->subsystem_device == PCI_SUBDEVICE_ID_AT_2701FX)) {
2155 if (lp->options & PCNET32_PORT_ASEL) { 2153 if (lp->options & PCNET32_PORT_ASEL) {
2156 lp->options = PCNET32_PORT_FD | PCNET32_PORT_100; 2154 lp->options = PCNET32_PORT_FD | PCNET32_PORT_100;
2157 if (netif_msg_link(lp)) 2155 if (netif_msg_link(lp))
diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
index 17c116bb332c..6de8399d6dd9 100644
--- a/drivers/net/ppp_async.c
+++ b/drivers/net/ppp_async.c
@@ -356,6 +356,7 @@ ppp_asynctty_receive(struct tty_struct *tty, const unsigned char *buf,
356 if (!skb_queue_empty(&ap->rqueue)) 356 if (!skb_queue_empty(&ap->rqueue))
357 tasklet_schedule(&ap->tsk); 357 tasklet_schedule(&ap->tsk);
358 ap_put(ap); 358 ap_put(ap);
359 tty_unthrottle(tty);
359} 360}
360 361
361static void 362static void
diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
index d0b965517b46..7dd0868f983a 100644
--- a/drivers/net/ppp_generic.c
+++ b/drivers/net/ppp_generic.c
@@ -1384,7 +1384,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1384 1384
1385 /* create a fragment for each channel */ 1385 /* create a fragment for each channel */
1386 bits = B; 1386 bits = B;
1387 while (nfree > 0 && len > 0) { 1387 while (len > 0) {
1388 list = list->next; 1388 list = list->next;
1389 if (list == &ppp->channels) { 1389 if (list == &ppp->channels) {
1390 i = 0; 1390 i = 0;
@@ -1431,29 +1431,31 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1431 *otherwise divide it according to the speed 1431 *otherwise divide it according to the speed
1432 *of the channel we are going to transmit on 1432 *of the channel we are going to transmit on
1433 */ 1433 */
1434 if (pch->speed == 0) { 1434 if (nfree > 0) {
1435 flen = totlen/nfree ; 1435 if (pch->speed == 0) {
1436 if (nbigger > 0) { 1436 flen = totlen/nfree ;
1437 flen++; 1437 if (nbigger > 0) {
1438 nbigger--; 1438 flen++;
1439 } 1439 nbigger--;
1440 } else { 1440 }
1441 flen = (((totfree - nzero)*(totlen + hdrlen*totfree)) / 1441 } else {
1442 ((totspeed*totfree)/pch->speed)) - hdrlen; 1442 flen = (((totfree - nzero)*(totlen + hdrlen*totfree)) /
1443 if (nbigger > 0) { 1443 ((totspeed*totfree)/pch->speed)) - hdrlen;
1444 flen += ((totfree - nzero)*pch->speed)/totspeed; 1444 if (nbigger > 0) {
1445 nbigger -= ((totfree - nzero)*pch->speed)/ 1445 flen += ((totfree - nzero)*pch->speed)/totspeed;
1446 nbigger -= ((totfree - nzero)*pch->speed)/
1446 totspeed; 1447 totspeed;
1448 }
1447 } 1449 }
1450 nfree--;
1448 } 1451 }
1449 nfree--;
1450 1452
1451 /* 1453 /*
1452 *check if we are on the last channel or 1454 *check if we are on the last channel or
1453 *we exceded the lenght of the data to 1455 *we exceded the lenght of the data to
1454 *fragment 1456 *fragment
1455 */ 1457 */
1456 if ((nfree == 0) || (flen > len)) 1458 if ((nfree <= 0) || (flen > len))
1457 flen = len; 1459 flen = len;
1458 /* 1460 /*
1459 *it is not worth to tx on slow channels: 1461 *it is not worth to tx on slow channels:
@@ -1467,7 +1469,7 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
1467 continue; 1469 continue;
1468 } 1470 }
1469 1471
1470 mtu = pch->chan->mtu + 2 - hdrlen; 1472 mtu = pch->chan->mtu - hdrlen;
1471 if (mtu < 4) 1473 if (mtu < 4)
1472 mtu = 4; 1474 mtu = 4;
1473 if (flen > mtu) 1475 if (flen > mtu)
diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
index aa3d39f38e22..d2fa2db13586 100644
--- a/drivers/net/ppp_synctty.c
+++ b/drivers/net/ppp_synctty.c
@@ -397,6 +397,7 @@ ppp_sync_receive(struct tty_struct *tty, const unsigned char *buf,
397 if (!skb_queue_empty(&ap->rqueue)) 397 if (!skb_queue_empty(&ap->rqueue))
398 tasklet_schedule(&ap->tsk); 398 tasklet_schedule(&ap->tsk);
399 sp_put(ap); 399 sp_put(ap);
400 tty_unthrottle(tty);
400} 401}
401 402
402static void 403static void
diff --git a/drivers/net/pppol2tp.c b/drivers/net/pppol2tp.c
index e7935d09c896..e0f9219a0aea 100644
--- a/drivers/net/pppol2tp.c
+++ b/drivers/net/pppol2tp.c
@@ -2680,6 +2680,7 @@ out_unregister_pppol2tp_proto:
2680static void __exit pppol2tp_exit(void) 2680static void __exit pppol2tp_exit(void)
2681{ 2681{
2682 unregister_pppox_proto(PX_PROTO_OL2TP); 2682 unregister_pppox_proto(PX_PROTO_OL2TP);
2683 unregister_pernet_gen_device(pppol2tp_net_id, &pppol2tp_net_ops);
2683 proto_unregister(&pppol2tp_sk_proto); 2684 proto_unregister(&pppol2tp_sk_proto);
2684} 2685}
2685 2686
diff --git a/drivers/net/s6gmac.c b/drivers/net/s6gmac.c
index 5345e47b35ac..4525cbe8dd69 100644
--- a/drivers/net/s6gmac.c
+++ b/drivers/net/s6gmac.c
@@ -793,7 +793,7 @@ static inline int s6gmac_phy_start(struct net_device *dev)
793 struct s6gmac *pd = netdev_priv(dev); 793 struct s6gmac *pd = netdev_priv(dev);
794 int i = 0; 794 int i = 0;
795 struct phy_device *p = NULL; 795 struct phy_device *p = NULL;
796 while ((!(p = pd->mii.bus->phy_map[i])) && (i < PHY_MAX_ADDR)) 796 while ((i < PHY_MAX_ADDR) && (!(p = pd->mii.bus->phy_map[i])))
797 i++; 797 i++;
798 p = phy_connect(dev, dev_name(&p->dev), &s6gmac_adjust_link, 0, 798 p = phy_connect(dev, dev_name(&p->dev), &s6gmac_adjust_link, 0,
799 PHY_INTERFACE_MODE_RGMII); 799 PHY_INTERFACE_MODE_RGMII);
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 661abd0492ae..1415a8375093 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1488,6 +1488,8 @@ static int sky2_up(struct net_device *dev)
1488 sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL); 1488 sky2_set_vlan_mode(hw, port, sky2->vlgrp != NULL);
1489#endif 1489#endif
1490 1490
1491 sky2->restarting = 0;
1492
1491 err = sky2_rx_start(sky2); 1493 err = sky2_rx_start(sky2);
1492 if (err) 1494 if (err)
1493 goto err_out; 1495 goto err_out;
@@ -1500,6 +1502,9 @@ static int sky2_up(struct net_device *dev)
1500 1502
1501 sky2_set_multicast(dev); 1503 sky2_set_multicast(dev);
1502 1504
1505 /* wake queue incase we are restarting */
1506 netif_wake_queue(dev);
1507
1503 if (netif_msg_ifup(sky2)) 1508 if (netif_msg_ifup(sky2))
1504 printk(KERN_INFO PFX "%s: enabling interface\n", dev->name); 1509 printk(KERN_INFO PFX "%s: enabling interface\n", dev->name);
1505 return 0; 1510 return 0;
@@ -1533,6 +1538,8 @@ static inline int tx_dist(unsigned tail, unsigned head)
1533/* Number of list elements available for next tx */ 1538/* Number of list elements available for next tx */
1534static inline int tx_avail(const struct sky2_port *sky2) 1539static inline int tx_avail(const struct sky2_port *sky2)
1535{ 1540{
1541 if (unlikely(sky2->restarting))
1542 return 0;
1536 return sky2->tx_pending - tx_dist(sky2->tx_cons, sky2->tx_prod); 1543 return sky2->tx_pending - tx_dist(sky2->tx_cons, sky2->tx_prod);
1537} 1544}
1538 1545
@@ -1818,6 +1825,10 @@ static int sky2_down(struct net_device *dev)
1818 if (netif_msg_ifdown(sky2)) 1825 if (netif_msg_ifdown(sky2))
1819 printk(KERN_INFO PFX "%s: disabling interface\n", dev->name); 1826 printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
1820 1827
1828 /* explicitly shut off tx incase we're restarting */
1829 sky2->restarting = 1;
1830 netif_tx_disable(dev);
1831
1821 /* Force flow control off */ 1832 /* Force flow control off */
1822 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF); 1833 sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
1823 1834
@@ -2359,7 +2370,7 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
2359{ 2370{
2360 struct sky2_port *sky2 = netdev_priv(dev); 2371 struct sky2_port *sky2 = netdev_priv(dev);
2361 2372
2362 if (netif_running(dev)) { 2373 if (likely(netif_running(dev) && !sky2->restarting)) {
2363 netif_tx_lock(dev); 2374 netif_tx_lock(dev);
2364 sky2_tx_complete(sky2, last); 2375 sky2_tx_complete(sky2, last);
2365 netif_tx_unlock(dev); 2376 netif_tx_unlock(dev);
@@ -4283,6 +4294,7 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw,
4283 spin_lock_init(&sky2->phy_lock); 4294 spin_lock_init(&sky2->phy_lock);
4284 sky2->tx_pending = TX_DEF_PENDING; 4295 sky2->tx_pending = TX_DEF_PENDING;
4285 sky2->rx_pending = RX_DEF_PENDING; 4296 sky2->rx_pending = RX_DEF_PENDING;
4297 sky2->restarting = 0;
4286 4298
4287 hw->dev[port] = dev; 4299 hw->dev[port] = dev;
4288 4300
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index b5549c9e5107..4486b066b43f 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -2051,6 +2051,7 @@ struct sky2_port {
2051 u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */ 2051 u8 duplex; /* DUPLEX_HALF, DUPLEX_FULL */
2052 u8 rx_csum; 2052 u8 rx_csum;
2053 u8 wol; 2053 u8 wol;
2054 u8 restarting;
2054 enum flow_control flow_mode; 2055 enum flow_control flow_mode;
2055 enum flow_control flow_status; 2056 enum flow_control flow_status;
2056 2057
diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c
index 1018349a29dc..5e7645ee8ab0 100644
--- a/drivers/net/starfire.c
+++ b/drivers/net/starfire.c
@@ -180,7 +180,7 @@ static int full_duplex[MAX_UNITS] = {0, };
180/* These identify the driver base version and may not be removed. */ 180/* These identify the driver base version and may not be removed. */
181static const char version[] __devinitconst = 181static const char version[] __devinitconst =
182KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n" 182KERN_INFO "starfire.c:v1.03 7/26/2000 Written by Donald Becker <becker@scyld.com>\n"
183KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n"; 183" (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
184 184
185MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 185MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
186MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver"); 186MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver");
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index 0df6332ed9ce..d09be481bcc4 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -1698,13 +1698,13 @@ static int netdev_close(struct net_device *dev)
1698 1698
1699#ifdef __i386__ 1699#ifdef __i386__
1700 if (netif_msg_hw(np)) { 1700 if (netif_msg_hw(np)) {
1701 printk("\n"KERN_DEBUG" Tx ring at %8.8x:\n", 1701 printk(KERN_DEBUG " Tx ring at %8.8x:\n",
1702 (int)(np->tx_ring_dma)); 1702 (int)(np->tx_ring_dma));
1703 for (i = 0; i < TX_RING_SIZE; i++) 1703 for (i = 0; i < TX_RING_SIZE; i++)
1704 printk(" #%d desc. %4.4x %8.8x %8.8x.\n", 1704 printk(KERN_DEBUG " #%d desc. %4.4x %8.8x %8.8x.\n",
1705 i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr, 1705 i, np->tx_ring[i].status, np->tx_ring[i].frag[0].addr,
1706 np->tx_ring[i].frag[0].length); 1706 np->tx_ring[i].frag[0].length);
1707 printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", 1707 printk(KERN_DEBUG " Rx ring %8.8x:\n",
1708 (int)(np->rx_ring_dma)); 1708 (int)(np->rx_ring_dma));
1709 for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) { 1709 for (i = 0; i < /*RX_RING_SIZE*/4 ; i++) {
1710 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", 1710 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n",
diff --git a/drivers/net/tsi108_eth.c b/drivers/net/tsi108_eth.c
index 0f78f99f9b20..7030bd5e9848 100644
--- a/drivers/net/tsi108_eth.c
+++ b/drivers/net/tsi108_eth.c
@@ -1132,7 +1132,9 @@ static int tsi108_get_mac(struct net_device *dev)
1132 } 1132 }
1133 1133
1134 if (!is_valid_ether_addr(dev->dev_addr)) { 1134 if (!is_valid_ether_addr(dev->dev_addr)) {
1135 printk("KERN_ERR: word1: %08x, word2: %08x\n", word1, word2); 1135 printk(KERN_ERR
1136 "%s: Invalid MAC address. word1: %08x, word2: %08x\n",
1137 dev->name, word1, word2);
1136 return -EINVAL; 1138 return -EINVAL;
1137 } 1139 }
1138 1140
@@ -1201,8 +1203,8 @@ static void tsi108_set_rx_mode(struct net_device *dev)
1201 __set_bit(hash, &data->mc_hash[0]); 1203 __set_bit(hash, &data->mc_hash[0]);
1202 } else { 1204 } else {
1203 printk(KERN_ERR 1205 printk(KERN_ERR
1204 "%s: got multicast address of length %d " 1206 "%s: got multicast address of length %d instead of 6.\n",
1205 "instead of 6.\n", dev->name, 1207 dev->name,
1206 mc->dmi_addrlen); 1208 mc->dmi_addrlen);
1207 } 1209 }
1208 1210
diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c
index 769af558a345..bc8a6b263b40 100644
--- a/drivers/net/tulip/de2104x.c
+++ b/drivers/net/tulip/de2104x.c
@@ -944,9 +944,10 @@ static void de_set_media (struct de_private *de)
944 macmode &= ~FullDuplex; 944 macmode &= ~FullDuplex;
945 945
946 if (netif_msg_link(de)) { 946 if (netif_msg_link(de)) {
947 printk(KERN_INFO "%s: set link %s\n" 947 printk(KERN_INFO
948 KERN_INFO "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n" 948 "%s: set link %s\n"
949 KERN_INFO "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n", 949 "%s: mode 0x%x, sia 0x%x,0x%x,0x%x,0x%x\n"
950 "%s: set mode 0x%x, set sia 0x%x,0x%x,0x%x\n",
950 de->dev->name, media_name[media], 951 de->dev->name, media_name[media],
951 de->dev->name, dr32(MacMode), dr32(SIAStatus), 952 de->dev->name, dr32(MacMode), dr32(SIAStatus),
952 dr32(CSR13), dr32(CSR14), dr32(CSR15), 953 dr32(CSR13), dr32(CSR14), dr32(CSR15),
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index eb72d2e9ab3d..acfdccd44567 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -5059,7 +5059,7 @@ mii_get_phy(struct net_device *dev)
5059 if ((id == 0) || (id == 65535)) continue; /* Valid ID? */ 5059 if ((id == 0) || (id == 65535)) continue; /* Valid ID? */
5060 for (j=0; j<limit; j++) { /* Search PHY table */ 5060 for (j=0; j<limit; j++) { /* Search PHY table */
5061 if (id != phy_info[j].id) continue; /* ID match? */ 5061 if (id != phy_info[j].id) continue; /* ID match? */
5062 for (k=0; lp->phy[k].id && (k < DE4X5_MAX_PHY); k++); 5062 for (k=0; k < DE4X5_MAX_PHY && lp->phy[k].id; k++);
5063 if (k < DE4X5_MAX_PHY) { 5063 if (k < DE4X5_MAX_PHY) {
5064 memcpy((char *)&lp->phy[k], 5064 memcpy((char *)&lp->phy[k],
5065 (char *)&phy_info[j], sizeof(struct phy_table)); 5065 (char *)&phy_info[j], sizeof(struct phy_table));
@@ -5072,7 +5072,7 @@ mii_get_phy(struct net_device *dev)
5072 break; 5072 break;
5073 } 5073 }
5074 if ((j == limit) && (i < DE4X5_MAX_MII)) { 5074 if ((j == limit) && (i < DE4X5_MAX_MII)) {
5075 for (k=0; lp->phy[k].id && (k < DE4X5_MAX_PHY); k++); 5075 for (k=0; k < DE4X5_MAX_PHY && lp->phy[k].id; k++);
5076 lp->phy[k].addr = i; 5076 lp->phy[k].addr = i;
5077 lp->phy[k].id = id; 5077 lp->phy[k].id = id;
5078 lp->phy[k].spd.reg = GENERIC_REG; /* ANLPA register */ 5078 lp->phy[k].spd.reg = GENERIC_REG; /* ANLPA register */
@@ -5091,7 +5091,7 @@ mii_get_phy(struct net_device *dev)
5091 purgatory: 5091 purgatory:
5092 lp->active = 0; 5092 lp->active = 0;
5093 if (lp->phy[0].id) { /* Reset the PHY devices */ 5093 if (lp->phy[0].id) { /* Reset the PHY devices */
5094 for (k=0; lp->phy[k].id && (k < DE4X5_MAX_PHY); k++) { /*For each PHY*/ 5094 for (k=0; k < DE4X5_MAX_PHY && lp->phy[k].id; k++) { /*For each PHY*/
5095 mii_wr(MII_CR_RST, MII_CR, lp->phy[k].addr, DE4X5_MII); 5095 mii_wr(MII_CR_RST, MII_CR, lp->phy[k].addr, DE4X5_MII);
5096 while (mii_rd(MII_CR, lp->phy[k].addr, DE4X5_MII) & MII_CR_RST); 5096 while (mii_rd(MII_CR, lp->phy[k].addr, DE4X5_MII) & MII_CR_RST);
5097 5097
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c
index 9d46638d250e..019050f273a2 100644
--- a/drivers/net/tulip/tulip_core.c
+++ b/drivers/net/tulip/tulip_core.c
@@ -570,16 +570,18 @@ static void tulip_tx_timeout(struct net_device *dev)
570 (unsigned int)tp->rx_ring[i].buffer2, 570 (unsigned int)tp->rx_ring[i].buffer2,
571 buf[0], buf[1], buf[2]); 571 buf[0], buf[1], buf[2]);
572 for (j = 0; buf[j] != 0xee && j < 1600; j++) 572 for (j = 0; buf[j] != 0xee && j < 1600; j++)
573 if (j < 100) printk(" %2.2x", buf[j]); 573 if (j < 100)
574 printk(" j=%d.\n", j); 574 printk(KERN_CONT " %2.2x", buf[j]);
575 printk(KERN_CONT " j=%d.\n", j);
575 } 576 }
576 printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring); 577 printk(KERN_DEBUG " Rx ring %8.8x: ", (int)tp->rx_ring);
577 for (i = 0; i < RX_RING_SIZE; i++) 578 for (i = 0; i < RX_RING_SIZE; i++)
578 printk(" %8.8x", (unsigned int)tp->rx_ring[i].status); 579 printk(KERN_CONT " %8.8x",
579 printk("\n" KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring); 580 (unsigned int)tp->rx_ring[i].status);
581 printk(KERN_DEBUG " Tx ring %8.8x: ", (int)tp->tx_ring);
580 for (i = 0; i < TX_RING_SIZE; i++) 582 for (i = 0; i < TX_RING_SIZE; i++)
581 printk(" %8.8x", (unsigned int)tp->tx_ring[i].status); 583 printk(KERN_CONT " %8.8x", (unsigned int)tp->tx_ring[i].status);
582 printk("\n"); 584 printk(KERN_CONT "\n");
583 } 585 }
584#endif 586#endif
585 587
diff --git a/drivers/net/tulip/winbond-840.c b/drivers/net/tulip/winbond-840.c
index 6bc7540b216e..1853530a32a2 100644
--- a/drivers/net/tulip/winbond-840.c
+++ b/drivers/net/tulip/winbond-840.c
@@ -142,7 +142,7 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
142static const char version[] __initconst = 142static const char version[] __initconst =
143 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) " 143 KERN_INFO DRV_NAME ".c:v" DRV_VERSION " (2.4 port) "
144 DRV_RELDATE " Donald Becker <becker@scyld.com>\n" 144 DRV_RELDATE " Donald Becker <becker@scyld.com>\n"
145 KERN_INFO " http://www.scyld.com/network/drivers.html\n"; 145 " http://www.scyld.com/network/drivers.html\n";
146 146
147MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 147MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
148MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver"); 148MODULE_DESCRIPTION("Winbond W89c840 Ethernet driver");
@@ -939,7 +939,7 @@ static void tx_timeout(struct net_device *dev)
939 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring); 939 printk(KERN_DEBUG " Rx ring %p: ", np->rx_ring);
940 for (i = 0; i < RX_RING_SIZE; i++) 940 for (i = 0; i < RX_RING_SIZE; i++)
941 printk(" %8.8x", (unsigned int)np->rx_ring[i].status); 941 printk(" %8.8x", (unsigned int)np->rx_ring[i].status);
942 printk("\n"KERN_DEBUG" Tx ring %p: ", np->tx_ring); 942 printk(KERN_DEBUG" Tx ring %p: ", np->tx_ring);
943 for (i = 0; i < TX_RING_SIZE; i++) 943 for (i = 0; i < TX_RING_SIZE; i++)
944 printk(" %8.8x", np->tx_ring[i].status); 944 printk(" %8.8x", np->tx_ring[i].status);
945 printk("\n"); 945 printk("\n");
@@ -1520,7 +1520,7 @@ static int netdev_close(struct net_device *dev)
1520 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n", 1520 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x.\n",
1521 i, np->tx_ring[i].length, 1521 i, np->tx_ring[i].length,
1522 np->tx_ring[i].status, np->tx_ring[i].buffer1); 1522 np->tx_ring[i].status, np->tx_ring[i].buffer1);
1523 printk("\n"KERN_DEBUG " Rx ring %8.8x:\n", 1523 printk(KERN_DEBUG " Rx ring %8.8x:\n",
1524 (int)np->rx_ring); 1524 (int)np->rx_ring);
1525 for (i = 0; i < RX_RING_SIZE; i++) { 1525 for (i = 0; i < RX_RING_SIZE; i++) {
1526 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n", 1526 printk(KERN_DEBUG " #%d desc. %4.4x %4.4x %8.8x\n",
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index a998b6a9c245..2533f5cf2e4b 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1052,20 +1052,15 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr)
1052 return err; 1052 return err;
1053} 1053}
1054 1054
1055static int tun_get_iff(struct net *net, struct file *file, struct ifreq *ifr) 1055static int tun_get_iff(struct net *net, struct tun_struct *tun,
1056 struct ifreq *ifr)
1056{ 1057{
1057 struct tun_struct *tun = tun_get(file);
1058
1059 if (!tun)
1060 return -EBADFD;
1061
1062 DBG(KERN_INFO "%s: tun_get_iff\n", tun->dev->name); 1058 DBG(KERN_INFO "%s: tun_get_iff\n", tun->dev->name);
1063 1059
1064 strcpy(ifr->ifr_name, tun->dev->name); 1060 strcpy(ifr->ifr_name, tun->dev->name);
1065 1061
1066 ifr->ifr_flags = tun_flags(tun); 1062 ifr->ifr_flags = tun_flags(tun);
1067 1063
1068 tun_put(tun);
1069 return 0; 1064 return 0;
1070} 1065}
1071 1066
@@ -1115,8 +1110,8 @@ static int set_offload(struct net_device *dev, unsigned long arg)
1115 return 0; 1110 return 0;
1116} 1111}
1117 1112
1118static int tun_chr_ioctl(struct inode *inode, struct file *file, 1113static long tun_chr_ioctl(struct file *file, unsigned int cmd,
1119 unsigned int cmd, unsigned long arg) 1114 unsigned long arg)
1120{ 1115{
1121 struct tun_file *tfile = file->private_data; 1116 struct tun_file *tfile = file->private_data;
1122 struct tun_struct *tun; 1117 struct tun_struct *tun;
@@ -1138,34 +1133,32 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1138 (unsigned int __user*)argp); 1133 (unsigned int __user*)argp);
1139 } 1134 }
1140 1135
1136 rtnl_lock();
1137
1141 tun = __tun_get(tfile); 1138 tun = __tun_get(tfile);
1142 if (cmd == TUNSETIFF && !tun) { 1139 if (cmd == TUNSETIFF && !tun) {
1143 int err;
1144
1145 ifr.ifr_name[IFNAMSIZ-1] = '\0'; 1140 ifr.ifr_name[IFNAMSIZ-1] = '\0';
1146 1141
1147 rtnl_lock(); 1142 ret = tun_set_iff(tfile->net, file, &ifr);
1148 err = tun_set_iff(tfile->net, file, &ifr);
1149 rtnl_unlock();
1150 1143
1151 if (err) 1144 if (ret)
1152 return err; 1145 goto unlock;
1153 1146
1154 if (copy_to_user(argp, &ifr, sizeof(ifr))) 1147 if (copy_to_user(argp, &ifr, sizeof(ifr)))
1155 return -EFAULT; 1148 ret = -EFAULT;
1156 return 0; 1149 goto unlock;
1157 } 1150 }
1158 1151
1159 1152 ret = -EBADFD;
1160 if (!tun) 1153 if (!tun)
1161 return -EBADFD; 1154 goto unlock;
1162 1155
1163 DBG(KERN_INFO "%s: tun_chr_ioctl cmd %d\n", tun->dev->name, cmd); 1156 DBG(KERN_INFO "%s: tun_chr_ioctl cmd %d\n", tun->dev->name, cmd);
1164 1157
1165 ret = 0; 1158 ret = 0;
1166 switch (cmd) { 1159 switch (cmd) {
1167 case TUNGETIFF: 1160 case TUNGETIFF:
1168 ret = tun_get_iff(current->nsproxy->net_ns, file, &ifr); 1161 ret = tun_get_iff(current->nsproxy->net_ns, tun, &ifr);
1169 if (ret) 1162 if (ret)
1170 break; 1163 break;
1171 1164
@@ -1211,7 +1204,6 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1211 1204
1212 case TUNSETLINK: 1205 case TUNSETLINK:
1213 /* Only allow setting the type when the interface is down */ 1206 /* Only allow setting the type when the interface is down */
1214 rtnl_lock();
1215 if (tun->dev->flags & IFF_UP) { 1207 if (tun->dev->flags & IFF_UP) {
1216 DBG(KERN_INFO "%s: Linktype set failed because interface is up\n", 1208 DBG(KERN_INFO "%s: Linktype set failed because interface is up\n",
1217 tun->dev->name); 1209 tun->dev->name);
@@ -1221,7 +1213,6 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1221 DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type); 1213 DBG(KERN_INFO "%s: linktype set to %d\n", tun->dev->name, tun->dev->type);
1222 ret = 0; 1214 ret = 0;
1223 } 1215 }
1224 rtnl_unlock();
1225 break; 1216 break;
1226 1217
1227#ifdef TUN_DEBUG 1218#ifdef TUN_DEBUG
@@ -1230,9 +1221,7 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1230 break; 1221 break;
1231#endif 1222#endif
1232 case TUNSETOFFLOAD: 1223 case TUNSETOFFLOAD:
1233 rtnl_lock();
1234 ret = set_offload(tun->dev, arg); 1224 ret = set_offload(tun->dev, arg);
1235 rtnl_unlock();
1236 break; 1225 break;
1237 1226
1238 case TUNSETTXFILTER: 1227 case TUNSETTXFILTER:
@@ -1240,9 +1229,7 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1240 ret = -EINVAL; 1229 ret = -EINVAL;
1241 if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV) 1230 if ((tun->flags & TUN_TYPE_MASK) != TUN_TAP_DEV)
1242 break; 1231 break;
1243 rtnl_lock();
1244 ret = update_filter(&tun->txflt, (void __user *)arg); 1232 ret = update_filter(&tun->txflt, (void __user *)arg);
1245 rtnl_unlock();
1246 break; 1233 break;
1247 1234
1248 case SIOCGIFHWADDR: 1235 case SIOCGIFHWADDR:
@@ -1258,9 +1245,7 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1258 DBG(KERN_DEBUG "%s: set hw address: %pM\n", 1245 DBG(KERN_DEBUG "%s: set hw address: %pM\n",
1259 tun->dev->name, ifr.ifr_hwaddr.sa_data); 1246 tun->dev->name, ifr.ifr_hwaddr.sa_data);
1260 1247
1261 rtnl_lock();
1262 ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr); 1248 ret = dev_set_mac_address(tun->dev, &ifr.ifr_hwaddr);
1263 rtnl_unlock();
1264 break; 1249 break;
1265 1250
1266 case TUNGETSNDBUF: 1251 case TUNGETSNDBUF:
@@ -1283,7 +1268,10 @@ static int tun_chr_ioctl(struct inode *inode, struct file *file,
1283 break; 1268 break;
1284 }; 1269 };
1285 1270
1286 tun_put(tun); 1271unlock:
1272 rtnl_unlock();
1273 if (tun)
1274 tun_put(tun);
1287 return ret; 1275 return ret;
1288} 1276}
1289 1277
@@ -1371,7 +1359,7 @@ static const struct file_operations tun_fops = {
1371 .write = do_sync_write, 1359 .write = do_sync_write,
1372 .aio_write = tun_chr_aio_write, 1360 .aio_write = tun_chr_aio_write,
1373 .poll = tun_chr_poll, 1361 .poll = tun_chr_poll,
1374 .ioctl = tun_chr_ioctl, 1362 .unlocked_ioctl = tun_chr_ioctl,
1375 .open = tun_chr_open, 1363 .open = tun_chr_open,
1376 .release = tun_chr_close, 1364 .release = tun_chr_close,
1377 .fasync = tun_chr_fasync 1365 .fasync = tun_chr_fasync
diff --git a/drivers/net/wan/hd64570.c b/drivers/net/wan/hd64570.c
index 223238de475c..1ea1ef6c3b96 100644
--- a/drivers/net/wan/hd64570.c
+++ b/drivers/net/wan/hd64570.c
@@ -584,8 +584,9 @@ static void sca_dump_rings(struct net_device *dev)
584 sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in"); 584 sca_in(DSR_RX(phy_node(port)), card) & DSR_DE ? "" : "in");
585 for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++) 585 for (cnt = 0; cnt < port_to_card(port)->rx_ring_buffers; cnt++)
586 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); 586 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat)));
587 printk(KERN_CONT "\n");
587 588
588 printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " 589 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
589 "last=%u %sactive", 590 "last=%u %sactive",
590 sca_inw(get_dmac_tx(port) + CDAL, card), 591 sca_inw(get_dmac_tx(port) + CDAL, card),
591 sca_inw(get_dmac_tx(port) + EDAL, card), 592 sca_inw(get_dmac_tx(port) + EDAL, card),
diff --git a/drivers/net/wan/hd64572.c b/drivers/net/wan/hd64572.c
index 497b003d7239..f099c34a3ae2 100644
--- a/drivers/net/wan/hd64572.c
+++ b/drivers/net/wan/hd64572.c
@@ -529,8 +529,9 @@ static void sca_dump_rings(struct net_device *dev)
529 sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in"); 529 sca_in(DSR_RX(port->chan), card) & DSR_DE ? "" : "in");
530 for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++) 530 for (cnt = 0; cnt < port->card->rx_ring_buffers; cnt++)
531 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat))); 531 printk(" %02X", readb(&(desc_address(port, cnt, 0)->stat)));
532 printk(KERN_CONT "\n");
532 533
533 printk("\n" KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u " 534 printk(KERN_DEBUG "TX ring: CDA=%u EDA=%u DSR=%02X in=%u "
534 "last=%u %sactive", 535 "last=%u %sactive",
535 sca_inl(get_dmac_tx(port) + CDAL, card), 536 sca_inl(get_dmac_tx(port) + CDAL, card),
536 sca_inl(get_dmac_tx(port) + EDAL, card), 537 sca_inl(get_dmac_tx(port) + EDAL, card),
diff --git a/drivers/net/wan/sbni.c b/drivers/net/wan/sbni.c
index 545178e6765d..85c02a2ec2e7 100644
--- a/drivers/net/wan/sbni.c
+++ b/drivers/net/wan/sbni.c
@@ -326,11 +326,9 @@ sbni_pci_probe( struct net_device *dev )
326 } 326 }
327 327
328 if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs) 328 if (pci_irq_line <= 0 || pci_irq_line >= nr_irqs)
329 printk( KERN_WARNING " WARNING: The PCI BIOS assigned " 329 printk( KERN_WARNING
330 "this PCI card to IRQ %d, which is unlikely " 330 " WARNING: The PCI BIOS assigned this PCI card to IRQ %d, which is unlikely to work!.\n"
331 "to work!.\n" 331 " You should use the PCI BIOS setup to assign a valid IRQ line.\n",
332 KERN_WARNING " You should use the PCI BIOS "
333 "setup to assign a valid IRQ line.\n",
334 pci_irq_line ); 332 pci_irq_line );
335 333
336 /* avoiding re-enable dual adapters */ 334 /* avoiding re-enable dual adapters */
diff --git a/drivers/net/wireless/ath/ar9170/main.c b/drivers/net/wireless/ath/ar9170/main.c
index 4fc389ae74b4..ea8c9419336d 100644
--- a/drivers/net/wireless/ath/ar9170/main.c
+++ b/drivers/net/wireless/ath/ar9170/main.c
@@ -2458,13 +2458,14 @@ static int ar9170_conf_tx(struct ieee80211_hw *hw, u16 queue,
2458 int ret; 2458 int ret;
2459 2459
2460 mutex_lock(&ar->mutex); 2460 mutex_lock(&ar->mutex);
2461 if ((param) && !(queue > __AR9170_NUM_TXQ)) { 2461 if (queue < __AR9170_NUM_TXQ) {
2462 memcpy(&ar->edcf[ar9170_qos_hwmap[queue]], 2462 memcpy(&ar->edcf[ar9170_qos_hwmap[queue]],
2463 param, sizeof(*param)); 2463 param, sizeof(*param));
2464 2464
2465 ret = ar9170_set_qos(ar); 2465 ret = ar9170_set_qos(ar);
2466 } else 2466 } else {
2467 ret = -EINVAL; 2467 ret = -EINVAL;
2468 }
2468 2469
2469 mutex_unlock(&ar->mutex); 2470 mutex_unlock(&ar->mutex);
2470 return ret; 2471 return ret;
diff --git a/drivers/net/wireless/ath/ar9170/usb.c b/drivers/net/wireless/ath/ar9170/usb.c
index 1aec7afdffa7..e0138ac8bf50 100644
--- a/drivers/net/wireless/ath/ar9170/usb.c
+++ b/drivers/net/wireless/ath/ar9170/usb.c
@@ -598,11 +598,15 @@ static int ar9170_usb_request_firmware(struct ar9170_usb *aru)
598 598
599 err = request_firmware(&aru->init_values, "ar9170-1.fw", 599 err = request_firmware(&aru->init_values, "ar9170-1.fw",
600 &aru->udev->dev); 600 &aru->udev->dev);
601 if (err) {
602 dev_err(&aru->udev->dev, "file with init values not found.\n");
603 return err;
604 }
601 605
602 err = request_firmware(&aru->firmware, "ar9170-2.fw", &aru->udev->dev); 606 err = request_firmware(&aru->firmware, "ar9170-2.fw", &aru->udev->dev);
603 if (err) { 607 if (err) {
604 release_firmware(aru->init_values); 608 release_firmware(aru->init_values);
605 dev_err(&aru->udev->dev, "file with init values not found.\n"); 609 dev_err(&aru->udev->dev, "firmware file not found.\n");
606 return err; 610 return err;
607 } 611 }
608 612
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 2dc1cdbb4939..07f171c4d30e 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -6226,7 +6226,7 @@ static void ipw_add_scan_channels(struct ipw_priv *priv,
6226 }; 6226 };
6227 6227
6228 u8 channel; 6228 u8 channel;
6229 while (channel_index < IPW_SCAN_CHANNELS) { 6229 while (channel_index < IPW_SCAN_CHANNELS - 1) {
6230 channel = 6230 channel =
6231 priv->speed_scan[priv->speed_scan_pos]; 6231 priv->speed_scan[priv->speed_scan_pos];
6232 if (channel == 0) { 6232 if (channel == 0) {
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 6797076bd45f..2ffbd27d01d2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -1596,6 +1596,9 @@ int iwl_setup_mac(struct iwl_priv *priv)
1596 1596
1597 hw->wiphy->custom_regulatory = true; 1597 hw->wiphy->custom_regulatory = true;
1598 1598
1599 /* Firmware does not support this */
1600 hw->wiphy->disable_beacon_hints = true;
1601
1599 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX; 1602 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX;
1600 /* we create the 802.11 header and a zero-length SSID element */ 1603 /* we create the 802.11 header and a zero-length SSID element */
1601 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2; 1604 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 7707a2655994..6748a3fb9669 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -310,18 +310,18 @@ static ssize_t iwl_dbgfs_nvm_read(struct file *file,
310 return -ENODATA; 310 return -ENODATA;
311 } 311 }
312 312
313 ptr = priv->eeprom;
314 if (!ptr) {
315 IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
316 return -ENOMEM;
317 }
318
313 /* 4 characters for byte 0xYY */ 319 /* 4 characters for byte 0xYY */
314 buf = kzalloc(buf_size, GFP_KERNEL); 320 buf = kzalloc(buf_size, GFP_KERNEL);
315 if (!buf) { 321 if (!buf) {
316 IWL_ERR(priv, "Can not allocate Buffer\n"); 322 IWL_ERR(priv, "Can not allocate Buffer\n");
317 return -ENOMEM; 323 return -ENOMEM;
318 } 324 }
319
320 ptr = priv->eeprom;
321 if (!ptr) {
322 IWL_ERR(priv, "Invalid EEPROM/OTP memory\n");
323 return -ENOMEM;
324 }
325 pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n", 325 pos += scnprintf(buf + pos, buf_size - pos, "NVM Type: %s\n",
326 (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP) 326 (priv->nvm_device_type == NVM_DEVICE_TYPE_OTP)
327 ? "OTP" : "EEPROM"); 327 ? "OTP" : "EEPROM");
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 5ded8983b915..ea051b739ba2 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3905,6 +3905,9 @@ static int iwl3945_setup_mac(struct iwl_priv *priv)
3905 3905
3906 hw->wiphy->custom_regulatory = true; 3906 hw->wiphy->custom_regulatory = true;
3907 3907
3908 /* Firmware does not support this */
3909 hw->wiphy->disable_beacon_hints = true;
3910
3908 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945; 3911 hw->wiphy->max_scan_ssids = PROBE_OPTION_MAX_3945;
3909 /* we create the 802.11 header and a zero-length SSID element */ 3912 /* we create the 802.11 header and a zero-length SSID element */
3910 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2; 3913 hw->wiphy->max_scan_ie_len = IWL_MAX_PROBE_REQUEST - 24 - 2;
diff --git a/drivers/net/wireless/iwmc3200wifi/commands.c b/drivers/net/wireless/iwmc3200wifi/commands.c
index f0c8acdb71a4..a68a2aff3c1e 100644
--- a/drivers/net/wireless/iwmc3200wifi/commands.c
+++ b/drivers/net/wireless/iwmc3200wifi/commands.c
@@ -233,6 +233,7 @@ int iwm_store_rxiq_calib_result(struct iwm_priv *iwm)
233 eeprom_rxiq = iwm_eeprom_access(iwm, IWM_EEPROM_CALIB_RXIQ); 233 eeprom_rxiq = iwm_eeprom_access(iwm, IWM_EEPROM_CALIB_RXIQ);
234 if (IS_ERR(eeprom_rxiq)) { 234 if (IS_ERR(eeprom_rxiq)) {
235 IWM_ERR(iwm, "Couldn't access EEPROM RX IQ entry\n"); 235 IWM_ERR(iwm, "Couldn't access EEPROM RX IQ entry\n");
236 kfree(rxiq);
236 return PTR_ERR(eeprom_rxiq); 237 return PTR_ERR(eeprom_rxiq);
237 } 238 }
238 239
diff --git a/drivers/net/wireless/libertas/11d.c b/drivers/net/wireless/libertas/11d.c
index 9a5408e7d94a..5c6968101f0d 100644
--- a/drivers/net/wireless/libertas/11d.c
+++ b/drivers/net/wireless/libertas/11d.c
@@ -47,7 +47,7 @@ static u8 lbs_region_2_code(u8 *region)
47{ 47{
48 u8 i; 48 u8 i;
49 49
50 for (i = 0; region[i] && i < COUNTRY_CODE_LEN; i++) 50 for (i = 0; i < COUNTRY_CODE_LEN && region[i]; i++)
51 region[i] = toupper(region[i]); 51 region[i] = toupper(region[i]);
52 52
53 for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) { 53 for (i = 0; i < ARRAY_SIZE(region_code_mapping); i++) {
diff --git a/drivers/net/wireless/libertas/assoc.c b/drivers/net/wireless/libertas/assoc.c
index 1902b6f0b78c..385b50f4b105 100644
--- a/drivers/net/wireless/libertas/assoc.c
+++ b/drivers/net/wireless/libertas/assoc.c
@@ -1,7 +1,6 @@
1/* Copyright (C) 2006, Red Hat, Inc. */ 1/* Copyright (C) 2006, Red Hat, Inc. */
2 2
3#include <linux/types.h> 3#include <linux/types.h>
4#include <linux/kernel.h>
5#include <linux/etherdevice.h> 4#include <linux/etherdevice.h>
6#include <linux/ieee80211.h> 5#include <linux/ieee80211.h>
7#include <linux/if_arp.h> 6#include <linux/if_arp.h>
@@ -44,21 +43,21 @@ static int get_common_rates(struct lbs_private *priv,
44 u16 *rates_size) 43 u16 *rates_size)
45{ 44{
46 u8 *card_rates = lbs_bg_rates; 45 u8 *card_rates = lbs_bg_rates;
46 size_t num_card_rates = sizeof(lbs_bg_rates);
47 int ret = 0, i, j; 47 int ret = 0, i, j;
48 u8 tmp[(ARRAY_SIZE(lbs_bg_rates) - 1) * (*rates_size - 1)]; 48 u8 tmp[30];
49 size_t tmp_size = 0; 49 size_t tmp_size = 0;
50 50
51 /* For each rate in card_rates that exists in rate1, copy to tmp */ 51 /* For each rate in card_rates that exists in rate1, copy to tmp */
52 for (i = 0; i < ARRAY_SIZE(lbs_bg_rates) && card_rates[i]; i++) { 52 for (i = 0; card_rates[i] && (i < num_card_rates); i++) {
53 for (j = 0; j < *rates_size && rates[j]; j++) { 53 for (j = 0; rates[j] && (j < *rates_size); j++) {
54 if (rates[j] == card_rates[i]) 54 if (rates[j] == card_rates[i])
55 tmp[tmp_size++] = card_rates[i]; 55 tmp[tmp_size++] = card_rates[i];
56 } 56 }
57 } 57 }
58 58
59 lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size); 59 lbs_deb_hex(LBS_DEB_JOIN, "AP rates ", rates, *rates_size);
60 lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, 60 lbs_deb_hex(LBS_DEB_JOIN, "card rates ", card_rates, num_card_rates);
61 ARRAY_SIZE(lbs_bg_rates));
62 lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size); 61 lbs_deb_hex(LBS_DEB_JOIN, "common rates", tmp, tmp_size);
63 lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate); 62 lbs_deb_join("TX data rate 0x%02x\n", priv->cur_rate);
64 63
@@ -70,7 +69,10 @@ static int get_common_rates(struct lbs_private *priv,
70 lbs_pr_alert("Previously set fixed data rate %#x isn't " 69 lbs_pr_alert("Previously set fixed data rate %#x isn't "
71 "compatible with the network.\n", priv->cur_rate); 70 "compatible with the network.\n", priv->cur_rate);
72 ret = -1; 71 ret = -1;
72 goto done;
73 } 73 }
74 ret = 0;
75
74done: 76done:
75 memset(rates, 0, *rates_size); 77 memset(rates, 0, *rates_size);
76 *rates_size = min_t(int, tmp_size, *rates_size); 78 *rates_size = min_t(int, tmp_size, *rates_size);
@@ -318,7 +320,7 @@ static int lbs_associate(struct lbs_private *priv,
318 rates = (struct mrvl_ie_rates_param_set *) pos; 320 rates = (struct mrvl_ie_rates_param_set *) pos;
319 rates->header.type = cpu_to_le16(TLV_TYPE_RATES); 321 rates->header.type = cpu_to_le16(TLV_TYPE_RATES);
320 memcpy(&rates->rates, &bss->rates, MAX_RATES); 322 memcpy(&rates->rates, &bss->rates, MAX_RATES);
321 tmplen = min_t(u16, ARRAY_SIZE(rates->rates), MAX_RATES); 323 tmplen = MAX_RATES;
322 if (get_common_rates(priv, rates->rates, &tmplen)) { 324 if (get_common_rates(priv, rates->rates, &tmplen)) {
323 ret = -1; 325 ret = -1;
324 goto done; 326 goto done;
@@ -592,7 +594,7 @@ static int lbs_adhoc_join(struct lbs_private *priv,
592 594
593 /* Copy Data rates from the rates recorded in scan response */ 595 /* Copy Data rates from the rates recorded in scan response */
594 memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates)); 596 memset(cmd.bss.rates, 0, sizeof(cmd.bss.rates));
595 ratesize = min_t(u16, ARRAY_SIZE(cmd.bss.rates), MAX_RATES); 597 ratesize = min_t(u16, sizeof(cmd.bss.rates), MAX_RATES);
596 memcpy(cmd.bss.rates, bss->rates, ratesize); 598 memcpy(cmd.bss.rates, bss->rates, ratesize);
597 if (get_common_rates(priv, cmd.bss.rates, &ratesize)) { 599 if (get_common_rates(priv, cmd.bss.rates, &ratesize)) {
598 lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n"); 600 lbs_deb_join("ADHOC_JOIN: get_common_rates returned error.\n");
diff --git a/drivers/net/wireless/libertas/hostcmd.h b/drivers/net/wireless/libertas/hostcmd.h
index 0a2e29140add..c8a1998d4744 100644
--- a/drivers/net/wireless/libertas/hostcmd.h
+++ b/drivers/net/wireless/libertas/hostcmd.h
@@ -56,8 +56,8 @@ struct rxpd {
56 u8 bss_type; 56 u8 bss_type;
57 /* BSS number */ 57 /* BSS number */
58 u8 bss_num; 58 u8 bss_num;
59 } bss; 59 } __attribute__ ((packed)) bss;
60 } u; 60 } __attribute__ ((packed)) u;
61 61
62 /* SNR */ 62 /* SNR */
63 u8 snr; 63 u8 snr;
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 4f725473fb73..8a6d3afe4122 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -261,7 +261,7 @@ struct mwl8k_vif {
261 */ 261 */
262}; 262};
263 263
264#define MWL8K_VIF(_vif) (struct mwl8k_vif *)(&((_vif)->drv_priv)) 264#define MWL8K_VIF(_vif) ((struct mwl8k_vif *)&((_vif)->drv_priv))
265 265
266static const struct ieee80211_channel mwl8k_channels[] = { 266static const struct ieee80211_channel mwl8k_channels[] = {
267 { .center_freq = 2412, .hw_value = 1, }, 267 { .center_freq = 2412, .hw_value = 1, },
@@ -1012,6 +1012,8 @@ static int rxq_process(struct ieee80211_hw *hw, int index, int limit)
1012 rmb(); 1012 rmb();
1013 1013
1014 skb = rxq->rx_skb[rxq->rx_head]; 1014 skb = rxq->rx_skb[rxq->rx_head];
1015 if (skb == NULL)
1016 break;
1015 rxq->rx_skb[rxq->rx_head] = NULL; 1017 rxq->rx_skb[rxq->rx_head] = NULL;
1016 1018
1017 rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS; 1019 rxq->rx_head = (rxq->rx_head + 1) % MWL8K_RX_DESCS;
@@ -1592,6 +1594,9 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1592 timeout = wait_for_completion_timeout(&cmd_wait, 1594 timeout = wait_for_completion_timeout(&cmd_wait,
1593 msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS)); 1595 msecs_to_jiffies(MWL8K_CMD_TIMEOUT_MS));
1594 1596
1597 pci_unmap_single(priv->pdev, dma_addr, dma_size,
1598 PCI_DMA_BIDIRECTIONAL);
1599
1595 result = &cmd->result; 1600 result = &cmd->result;
1596 if (!timeout) { 1601 if (!timeout) {
1597 spin_lock_irq(&priv->fw_lock); 1602 spin_lock_irq(&priv->fw_lock);
@@ -1611,8 +1616,6 @@ static int mwl8k_post_cmd(struct ieee80211_hw *hw, struct mwl8k_cmd_pkt *cmd)
1611 *result); 1616 *result);
1612 } 1617 }
1613 1618
1614 pci_unmap_single(priv->pdev, dma_addr, dma_size,
1615 PCI_DMA_BIDIRECTIONAL);
1616 return rc; 1619 return rc;
1617} 1620}
1618 1621
@@ -1655,18 +1658,18 @@ static int mwl8k_cmd_get_hw_spec(struct ieee80211_hw *hw)
1655 memset(cmd->perm_addr, 0xff, sizeof(cmd->perm_addr)); 1658 memset(cmd->perm_addr, 0xff, sizeof(cmd->perm_addr));
1656 cmd->ps_cookie = cpu_to_le32(priv->cookie_dma); 1659 cmd->ps_cookie = cpu_to_le32(priv->cookie_dma);
1657 cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rx_desc_dma); 1660 cmd->rx_queue_ptr = cpu_to_le32(priv->rxq[0].rx_desc_dma);
1658 cmd->num_tx_queues = MWL8K_TX_QUEUES; 1661 cmd->num_tx_queues = cpu_to_le32(MWL8K_TX_QUEUES);
1659 for (i = 0; i < MWL8K_TX_QUEUES; i++) 1662 for (i = 0; i < MWL8K_TX_QUEUES; i++)
1660 cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].tx_desc_dma); 1663 cmd->tx_queue_ptrs[i] = cpu_to_le32(priv->txq[i].tx_desc_dma);
1661 cmd->num_tx_desc_per_queue = MWL8K_TX_DESCS; 1664 cmd->num_tx_desc_per_queue = cpu_to_le32(MWL8K_TX_DESCS);
1662 cmd->total_rx_desc = MWL8K_RX_DESCS; 1665 cmd->total_rx_desc = cpu_to_le32(MWL8K_RX_DESCS);
1663 1666
1664 rc = mwl8k_post_cmd(hw, &cmd->header); 1667 rc = mwl8k_post_cmd(hw, &cmd->header);
1665 1668
1666 if (!rc) { 1669 if (!rc) {
1667 SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr); 1670 SET_IEEE80211_PERM_ADDR(hw, cmd->perm_addr);
1668 priv->num_mcaddrs = le16_to_cpu(cmd->num_mcaddrs); 1671 priv->num_mcaddrs = le16_to_cpu(cmd->num_mcaddrs);
1669 priv->fw_rev = cmd->fw_rev; 1672 priv->fw_rev = le32_to_cpu(cmd->fw_rev);
1670 priv->hw_rev = cmd->hw_rev; 1673 priv->hw_rev = cmd->hw_rev;
1671 priv->region_code = le16_to_cpu(cmd->region_code); 1674 priv->region_code = le16_to_cpu(cmd->region_code);
1672 } 1675 }
@@ -3216,15 +3219,19 @@ static int mwl8k_configure_filter_wt(struct work_struct *wt)
3216 struct dev_addr_list *mclist = worker->mclist; 3219 struct dev_addr_list *mclist = worker->mclist;
3217 3220
3218 struct mwl8k_priv *priv = hw->priv; 3221 struct mwl8k_priv *priv = hw->priv;
3219 struct mwl8k_vif *mv_vif;
3220 int rc = 0; 3222 int rc = 0;
3221 3223
3222 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) { 3224 if (changed_flags & FIF_BCN_PRBRESP_PROMISC) {
3223 if (*total_flags & FIF_BCN_PRBRESP_PROMISC) 3225 if (*total_flags & FIF_BCN_PRBRESP_PROMISC)
3224 rc = mwl8k_cmd_set_pre_scan(hw); 3226 rc = mwl8k_cmd_set_pre_scan(hw);
3225 else { 3227 else {
3226 mv_vif = MWL8K_VIF(priv->vif); 3228 u8 *bssid;
3227 rc = mwl8k_cmd_set_post_scan(hw, mv_vif->bssid); 3229
3230 bssid = "\x00\x00\x00\x00\x00\x00";
3231 if (priv->vif != NULL)
3232 bssid = MWL8K_VIF(priv->vif)->bssid;
3233
3234 rc = mwl8k_cmd_set_post_scan(hw, bssid);
3228 } 3235 }
3229 } 3236 }
3230 3237
@@ -3725,6 +3732,8 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev)
3725 3732
3726 ieee80211_stop_queues(hw); 3733 ieee80211_stop_queues(hw);
3727 3734
3735 ieee80211_unregister_hw(hw);
3736
3728 /* Remove tx reclaim tasklet */ 3737 /* Remove tx reclaim tasklet */
3729 tasklet_kill(&priv->tx_reclaim_task); 3738 tasklet_kill(&priv->tx_reclaim_task);
3730 3739
@@ -3738,8 +3747,6 @@ static void __devexit mwl8k_remove(struct pci_dev *pdev)
3738 for (i = 0; i < MWL8K_TX_QUEUES; i++) 3747 for (i = 0; i < MWL8K_TX_QUEUES; i++)
3739 mwl8k_txq_reclaim(hw, i, 1); 3748 mwl8k_txq_reclaim(hw, i, 1);
3740 3749
3741 ieee80211_unregister_hw(hw);
3742
3743 for (i = 0; i < MWL8K_TX_QUEUES; i++) 3750 for (i = 0; i < MWL8K_TX_QUEUES; i++)
3744 mwl8k_txq_deinit(hw, i); 3751 mwl8k_txq_deinit(hw, i);
3745 3752
diff --git a/drivers/net/wireless/ray_cs.c b/drivers/net/wireless/ray_cs.c
index 2be78201633f..325206969c97 100644
--- a/drivers/net/wireless/ray_cs.c
+++ b/drivers/net/wireless/ray_cs.c
@@ -2424,11 +2424,10 @@ static void untranslate(ray_dev_t *local, struct sk_buff *skb, int len)
2424 2424
2425#ifdef PCMCIA_DEBUG 2425#ifdef PCMCIA_DEBUG
2426 if (pc_debug > 3) { 2426 if (pc_debug > 3) {
2427 int i; 2427 print_hex_dump(KERN_DEBUG, "skb->data before untranslate: ",
2428 printk(KERN_DEBUG "skb->data before untranslate"); 2428 DUMP_PREFIX_NONE, 16, 1,
2429 for (i = 0; i < 64; i++) 2429 skb->data, 64, true);
2430 printk("%02x ", skb->data[i]); 2430 printk(KERN_DEBUG
2431 printk("\n" KERN_DEBUG
2432 "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n", 2431 "type = %08x, xsap = %02x%02x%02x, org = %02x02x02x\n",
2433 ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl, 2432 ntohs(type), psnap->dsap, psnap->ssap, psnap->ctrl,
2434 psnap->org[0], psnap->org[1], psnap->org[2]); 2433 psnap->org[0], psnap->org[1], psnap->org[2]);
diff --git a/drivers/net/wireless/wavelan_cs.c b/drivers/net/wireless/wavelan_cs.c
index 9dd241adc379..b9748d432019 100644
--- a/drivers/net/wireless/wavelan_cs.c
+++ b/drivers/net/wireless/wavelan_cs.c
@@ -3556,17 +3556,8 @@ wv_82593_config(struct net_device * dev)
3556 cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */ 3556 cfblk.rcvstop = TRUE; /* Enable Receive Stop Register */
3557 3557
3558#ifdef DEBUG_I82593_SHOW 3558#ifdef DEBUG_I82593_SHOW
3559 { 3559 print_hex_dump(KERN_DEBUG, "wavelan_cs: config block: ", DUMP_PREFIX_NONE,
3560 u_char *c = (u_char *) &cfblk; 3560 16, 1, &cfblk, sizeof(struct i82593_conf_block), false);
3561 int i;
3562 printk(KERN_DEBUG "wavelan_cs: config block:");
3563 for(i = 0; i < sizeof(struct i82593_conf_block); i++,c++)
3564 {
3565 if((i % 16) == 0) printk("\n" KERN_DEBUG);
3566 printk("%02x ", *c);
3567 }
3568 printk("\n");
3569 }
3570#endif 3561#endif
3571 3562
3572 /* Copy the config block to the i82593 */ 3563 /* Copy the config block to the i82593 */
diff --git a/drivers/net/yellowfin.c b/drivers/net/yellowfin.c
index c3722b40a651..76764237cde6 100644
--- a/drivers/net/yellowfin.c
+++ b/drivers/net/yellowfin.c
@@ -109,7 +109,7 @@ static int gx_fix;
109/* These identify the driver base version and may not be removed. */ 109/* These identify the driver base version and may not be removed. */
110static const char version[] __devinitconst = 110static const char version[] __devinitconst =
111 KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n" 111 KERN_INFO DRV_NAME ".c:v1.05 1/09/2001 Written by Donald Becker <becker@scyld.com>\n"
112 KERN_INFO " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n"; 112 " (unofficial 2.4.x port, " DRV_VERSION ", " DRV_RELDATE ")\n";
113 113
114MODULE_AUTHOR("Donald Becker <becker@scyld.com>"); 114MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
115MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver"); 115MODULE_DESCRIPTION("Packet Engines Yellowfin G-NIC Gigabit Ethernet driver");
@@ -700,12 +700,15 @@ static void yellowfin_tx_timeout(struct net_device *dev)
700 int i; 700 int i;
701 printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring); 701 printk(KERN_WARNING " Rx ring %p: ", yp->rx_ring);
702 for (i = 0; i < RX_RING_SIZE; i++) 702 for (i = 0; i < RX_RING_SIZE; i++)
703 printk(" %8.8x", yp->rx_ring[i].result_status); 703 printk(KERN_CONT " %8.8x",
704 printk("\n"KERN_WARNING" Tx ring %p: ", yp->tx_ring); 704 yp->rx_ring[i].result_status);
705 printk(KERN_CONT "\n");
706 printk(KERN_WARNING" Tx ring %p: ", yp->tx_ring);
705 for (i = 0; i < TX_RING_SIZE; i++) 707 for (i = 0; i < TX_RING_SIZE; i++)
706 printk(" %4.4x /%8.8x", yp->tx_status[i].tx_errs, 708 printk(KERN_CONT " %4.4x /%8.8x",
707 yp->tx_ring[i].result_status); 709 yp->tx_status[i].tx_errs,
708 printk("\n"); 710 yp->tx_ring[i].result_status);
711 printk(KERN_CONT "\n");
709 } 712 }
710 713
711 /* If the hardware is found to hang regularly, we will update the code 714 /* If the hardware is found to hang regularly, we will update the code
@@ -1216,20 +1219,20 @@ static int yellowfin_close(struct net_device *dev)
1216 1219
1217#if defined(__i386__) 1220#if defined(__i386__)
1218 if (yellowfin_debug > 2) { 1221 if (yellowfin_debug > 2) {
1219 printk("\n"KERN_DEBUG" Tx ring at %8.8llx:\n", 1222 printk(KERN_DEBUG" Tx ring at %8.8llx:\n",
1220 (unsigned long long)yp->tx_ring_dma); 1223 (unsigned long long)yp->tx_ring_dma);
1221 for (i = 0; i < TX_RING_SIZE*2; i++) 1224 for (i = 0; i < TX_RING_SIZE*2; i++)
1222 printk(" %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n", 1225 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x %8.8x.\n",
1223 ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ', 1226 ioread32(ioaddr + TxPtr) == (long)&yp->tx_ring[i] ? '>' : ' ',
1224 i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr, 1227 i, yp->tx_ring[i].dbdma_cmd, yp->tx_ring[i].addr,
1225 yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status); 1228 yp->tx_ring[i].branch_addr, yp->tx_ring[i].result_status);
1226 printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status); 1229 printk(KERN_DEBUG " Tx status %p:\n", yp->tx_status);
1227 for (i = 0; i < TX_RING_SIZE; i++) 1230 for (i = 0; i < TX_RING_SIZE; i++)
1228 printk(" #%d status %4.4x %4.4x %4.4x %4.4x.\n", 1231 printk(KERN_DEBUG " #%d status %4.4x %4.4x %4.4x %4.4x.\n",
1229 i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs, 1232 i, yp->tx_status[i].tx_cnt, yp->tx_status[i].tx_errs,
1230 yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused); 1233 yp->tx_status[i].total_tx_cnt, yp->tx_status[i].paused);
1231 1234
1232 printk("\n"KERN_DEBUG " Rx ring %8.8llx:\n", 1235 printk(KERN_DEBUG " Rx ring %8.8llx:\n",
1233 (unsigned long long)yp->rx_ring_dma); 1236 (unsigned long long)yp->rx_ring_dma);
1234 for (i = 0; i < RX_RING_SIZE; i++) { 1237 for (i = 0; i < RX_RING_SIZE; i++) {
1235 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n", 1238 printk(KERN_DEBUG " %c #%d desc. %8.8x %8.8x %8.8x\n",
diff --git a/drivers/net/zorro8390.c b/drivers/net/zorro8390.c
index 37c84e3b8be0..81c753a617ab 100644
--- a/drivers/net/zorro8390.c
+++ b/drivers/net/zorro8390.c
@@ -120,6 +120,9 @@ static int __devinit zorro8390_init_one(struct zorro_dev *z,
120 for (i = ARRAY_SIZE(cards)-1; i >= 0; i--) 120 for (i = ARRAY_SIZE(cards)-1; i >= 0; i--)
121 if (z->id == cards[i].id) 121 if (z->id == cards[i].id)
122 break; 122 break;
123 if (i < 0)
124 return -ENODEV;
125
123 board = z->resource.start; 126 board = z->resource.start;
124 ioaddr = board+cards[i].offset; 127 ioaddr = board+cards[i].offset;
125 dev = alloc_ei_netdev(); 128 dev = alloc_ei_netdev();