aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-02-19 16:03:15 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-19 16:03:15 -0500
commit32efe08d77f5902ce7315fc9003c010ffffb8268 (patch)
tree40a88e6bae4e797cafce33f16a25e350c038f9bb /drivers/net
parentda1943164677ae2cdd630196b79089d476726348 (diff)
parentb01543dfe67bb1d191998e90d20534dc354de059 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c Small minor conflict in bnx2x, wherein one commit changed how statistics were stored in software, and another commit fixed endianness bugs wrt. reading the values provided by the chip in memory. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/3com/3c59x.c2
-rw-r--r--drivers/net/ethernet/broadcom/bcm63xx_enet.c2
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c17
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c8
-rw-r--r--drivers/net/ethernet/freescale/fec.c2
-rw-r--r--drivers/net/ethernet/mellanox/mlx4/eq.c5
-rw-r--r--drivers/net/ethernet/micrel/ks8851.c2
-rw-r--r--drivers/net/ethernet/micrel/ks8851_mll.c14
-rw-r--r--drivers/net/ethernet/octeon/octeon_mgmt.c4
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/common.h1
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/enh_desc.c2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/norm_desc.c2
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac.h5
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c7
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_main.c205
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c4
-rw-r--r--drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c21
-rw-r--r--drivers/net/ethernet/ti/cpmac.c4
-rw-r--r--drivers/net/ethernet/xscale/ixp4xx_eth.c3
-rw-r--r--drivers/net/usb/ipheth.c5
-rw-r--r--drivers/net/veth.c4
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c4
22 files changed, 163 insertions, 160 deletions
diff --git a/drivers/net/ethernet/3com/3c59x.c b/drivers/net/ethernet/3com/3c59x.c
index 1282f048dfad..e463d1036829 100644
--- a/drivers/net/ethernet/3com/3c59x.c
+++ b/drivers/net/ethernet/3com/3c59x.c
@@ -1841,7 +1841,7 @@ vortex_timer(unsigned long data)
1841 ok = 1; 1841 ok = 1;
1842 } 1842 }
1843 1843
1844 if (!netif_carrier_ok(dev)) 1844 if (dev->flags & IFF_SLAVE || !netif_carrier_ok(dev))
1845 next_tick = 5*HZ; 1845 next_tick = 5*HZ;
1846 1846
1847 if (vp->medialock) 1847 if (vp->medialock)
diff --git a/drivers/net/ethernet/broadcom/bcm63xx_enet.c b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
index 986019b2c849..c7ca7ec065ee 100644
--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
@@ -797,7 +797,7 @@ static int bcm_enet_open(struct net_device *dev)
797 if (priv->has_phy) { 797 if (priv->has_phy) {
798 /* connect to PHY */ 798 /* connect to PHY */
799 snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, 799 snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT,
800 priv->mac_id ? "1" : "0", priv->phy_id); 800 priv->mii_bus->id, priv->phy_id);
801 801
802 phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0, 802 phydev = phy_connect(dev, phy_id, bcm_enet_adjust_phy_link, 0,
803 PHY_INTERFACE_MODE_MII); 803 PHY_INTERFACE_MODE_MII);
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index 8e809c1408b4..644d8e9f61b1 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -117,10 +117,6 @@ static int dropless_fc;
117module_param(dropless_fc, int, 0); 117module_param(dropless_fc, int, 0);
118MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring"); 118MODULE_PARM_DESC(dropless_fc, " Pause on exhausted host ring");
119 119
120static int poll;
121module_param(poll, int, 0);
122MODULE_PARM_DESC(poll, " Use polling (for debug)");
123
124static int mrrs = -1; 120static int mrrs = -1;
125module_param(mrrs, int, 0); 121module_param(mrrs, int, 0);
126MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)"); 122MODULE_PARM_DESC(mrrs, " Force Max Read Req Size (0..3) (for debug)");
@@ -4853,20 +4849,11 @@ void bnx2x_drv_pulse(struct bnx2x *bp)
4853 4849
4854static void bnx2x_timer(unsigned long data) 4850static void bnx2x_timer(unsigned long data)
4855{ 4851{
4856 u8 cos;
4857 struct bnx2x *bp = (struct bnx2x *) data; 4852 struct bnx2x *bp = (struct bnx2x *) data;
4858 4853
4859 if (!netif_running(bp->dev)) 4854 if (!netif_running(bp->dev))
4860 return; 4855 return;
4861 4856
4862 if (poll) {
4863 struct bnx2x_fastpath *fp = &bp->fp[0];
4864
4865 for_each_cos_in_tx_queue(fp, cos)
4866 bnx2x_tx_int(bp, &fp->txdata[cos]);
4867 bnx2x_rx_int(fp, 1000);
4868 }
4869
4870 if (!BP_NOMCP(bp)) { 4857 if (!BP_NOMCP(bp)) {
4871 int mb_idx = BP_FW_MB_IDX(bp); 4858 int mb_idx = BP_FW_MB_IDX(bp);
4872 u32 drv_pulse; 4859 u32 drv_pulse;
@@ -10131,7 +10118,6 @@ static void __devinit bnx2x_set_modes_bitmap(struct bnx2x *bp)
10131static int __devinit bnx2x_init_bp(struct bnx2x *bp) 10118static int __devinit bnx2x_init_bp(struct bnx2x *bp)
10132{ 10119{
10133 int func; 10120 int func;
10134 int timer_interval;
10135 int rc; 10121 int rc;
10136 10122
10137 mutex_init(&bp->port.phy_mutex); 10123 mutex_init(&bp->port.phy_mutex);
@@ -10199,8 +10185,7 @@ static int __devinit bnx2x_init_bp(struct bnx2x *bp)
10199 bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR; 10185 bp->tx_ticks = (50 / BNX2X_BTR) * BNX2X_BTR;
10200 bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR; 10186 bp->rx_ticks = (25 / BNX2X_BTR) * BNX2X_BTR;
10201 10187
10202 timer_interval = (CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ); 10188 bp->current_interval = CHIP_REV_IS_SLOW(bp) ? 5*HZ : HZ;
10203 bp->current_interval = (poll ? poll : timer_interval);
10204 10189
10205 init_timer(&bp->timer); 10190 init_timer(&bp->timer);
10206 bp->timer.expires = jiffies + bp->current_interval; 10191 bp->timer.expires = jiffies + bp->current_interval;
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
index abd310d71512..14c961beaadb 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_stats.c
@@ -1006,14 +1006,14 @@ static int bnx2x_storm_stats_update(struct bnx2x *bp)
1006 estats->rx_stat_ifhcinbadoctets_lo); 1006 estats->rx_stat_ifhcinbadoctets_lo);
1007 1007
1008 ADD_64(estats->total_bytes_received_hi, 1008 ADD_64(estats->total_bytes_received_hi,
1009 tfunc->rcv_error_bytes.hi, 1009 le32_to_cpu(tfunc->rcv_error_bytes.hi),
1010 estats->total_bytes_received_lo, 1010 estats->total_bytes_received_lo,
1011 tfunc->rcv_error_bytes.lo); 1011 le32_to_cpu(tfunc->rcv_error_bytes.lo));
1012 1012
1013 ADD_64(estats->error_bytes_received_hi, 1013 ADD_64(estats->error_bytes_received_hi,
1014 tfunc->rcv_error_bytes.hi, 1014 le32_to_cpu(tfunc->rcv_error_bytes.hi),
1015 estats->error_bytes_received_lo, 1015 estats->error_bytes_received_lo,
1016 tfunc->rcv_error_bytes.lo); 1016 le32_to_cpu(tfunc->rcv_error_bytes.lo));
1017 1017
1018 UPDATE_ESTAT(etherstatsoverrsizepkts, rx_stat_dot3statsframestoolong); 1018 UPDATE_ESTAT(etherstatsoverrsizepkts, rx_stat_dot3statsframestoolong);
1019 1019
diff --git a/drivers/net/ethernet/freescale/fec.c b/drivers/net/ethernet/freescale/fec.c
index 0ee2ca7baaf3..a12b3f5bc025 100644
--- a/drivers/net/ethernet/freescale/fec.c
+++ b/drivers/net/ethernet/freescale/fec.c
@@ -986,7 +986,7 @@ static int fec_enet_mii_probe(struct net_device *ndev)
986 printk(KERN_INFO 986 printk(KERN_INFO
987 "%s: no PHY, assuming direct connection to switch\n", 987 "%s: no PHY, assuming direct connection to switch\n",
988 ndev->name); 988 ndev->name);
989 strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); 989 strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE);
990 phy_id = 0; 990 phy_id = 0;
991 } 991 }
992 992
diff --git a/drivers/net/ethernet/mellanox/mlx4/eq.c b/drivers/net/ethernet/mellanox/mlx4/eq.c
index 55d7bd4e210a..8fa41f3082cf 100644
--- a/drivers/net/ethernet/mellanox/mlx4/eq.c
+++ b/drivers/net/ethernet/mellanox/mlx4/eq.c
@@ -815,8 +815,9 @@ int mlx4_init_eq_table(struct mlx4_dev *dev)
815 int err; 815 int err;
816 int i; 816 int i;
817 817
818 priv->eq_table.uar_map = kcalloc(sizeof *priv->eq_table.uar_map, 818 priv->eq_table.uar_map = kcalloc(mlx4_num_eq_uar(dev),
819 mlx4_num_eq_uar(dev), GFP_KERNEL); 819 sizeof *priv->eq_table.uar_map,
820 GFP_KERNEL);
820 if (!priv->eq_table.uar_map) { 821 if (!priv->eq_table.uar_map) {
821 err = -ENOMEM; 822 err = -ENOMEM;
822 goto err_out_free; 823 goto err_out_free;
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 42a6a20efb15..c722aa607d07 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -583,7 +583,7 @@ static void ks8851_rx_pkts(struct ks8851_net *ks)
583 ks8851_dbg_dumpkkt(ks, rxpkt); 583 ks8851_dbg_dumpkkt(ks, rxpkt);
584 584
585 skb->protocol = eth_type_trans(skb, ks->netdev); 585 skb->protocol = eth_type_trans(skb, ks->netdev);
586 netif_rx(skb); 586 netif_rx_ni(skb);
587 587
588 ks->netdev->stats.rx_packets++; 588 ks->netdev->stats.rx_packets++;
589 ks->netdev->stats.rx_bytes += rxlen; 589 ks->netdev->stats.rx_bytes += rxlen;
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index 180460f4e41f..10d57983df05 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -394,7 +394,6 @@ union ks_tx_hdr {
394 * @msg_enable : The message flags controlling driver output (see ethtool). 394 * @msg_enable : The message flags controlling driver output (see ethtool).
395 * @frame_cnt : number of frames received. 395 * @frame_cnt : number of frames received.
396 * @bus_width : i/o bus width. 396 * @bus_width : i/o bus width.
397 * @irq : irq number assigned to this device.
398 * @rc_rxqcr : Cached copy of KS_RXQCR. 397 * @rc_rxqcr : Cached copy of KS_RXQCR.
399 * @rc_txcr : Cached copy of KS_TXCR. 398 * @rc_txcr : Cached copy of KS_TXCR.
400 * @rc_ier : Cached copy of KS_IER. 399 * @rc_ier : Cached copy of KS_IER.
@@ -441,7 +440,6 @@ struct ks_net {
441 u32 msg_enable; 440 u32 msg_enable;
442 u32 frame_cnt; 441 u32 frame_cnt;
443 int bus_width; 442 int bus_width;
444 int irq;
445 443
446 u16 rc_rxqcr; 444 u16 rc_rxqcr;
447 u16 rc_txcr; 445 u16 rc_txcr;
@@ -907,10 +905,10 @@ static int ks_net_open(struct net_device *netdev)
907 netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__); 905 netif_dbg(ks, ifup, ks->netdev, "%s - entry\n", __func__);
908 906
909 /* reset the HW */ 907 /* reset the HW */
910 err = request_irq(ks->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev); 908 err = request_irq(netdev->irq, ks_irq, KS_INT_FLAGS, DRV_NAME, netdev);
911 909
912 if (err) { 910 if (err) {
913 pr_err("Failed to request IRQ: %d: %d\n", ks->irq, err); 911 pr_err("Failed to request IRQ: %d: %d\n", netdev->irq, err);
914 return err; 912 return err;
915 } 913 }
916 914
@@ -955,7 +953,7 @@ static int ks_net_stop(struct net_device *netdev)
955 953
956 /* set powermode to soft power down to save power */ 954 /* set powermode to soft power down to save power */
957 ks_set_powermode(ks, PMECR_PM_SOFTDOWN); 955 ks_set_powermode(ks, PMECR_PM_SOFTDOWN);
958 free_irq(ks->irq, netdev); 956 free_irq(netdev->irq, netdev);
959 mutex_unlock(&ks->lock); 957 mutex_unlock(&ks->lock);
960 return 0; 958 return 0;
961} 959}
@@ -1544,10 +1542,10 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
1544 if (!ks->hw_addr_cmd) 1542 if (!ks->hw_addr_cmd)
1545 goto err_ioremap1; 1543 goto err_ioremap1;
1546 1544
1547 ks->irq = platform_get_irq(pdev, 0); 1545 netdev->irq = platform_get_irq(pdev, 0);
1548 1546
1549 if (ks->irq < 0) { 1547 if (netdev->irq < 0) {
1550 err = ks->irq; 1548 err = netdev->irq;
1551 goto err_get_irq; 1549 goto err_get_irq;
1552 } 1550 }
1553 1551
diff --git a/drivers/net/ethernet/octeon/octeon_mgmt.c b/drivers/net/ethernet/octeon/octeon_mgmt.c
index 212f43b308a3..cd827ff4a021 100644
--- a/drivers/net/ethernet/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/octeon/octeon_mgmt.c
@@ -670,7 +670,7 @@ static void octeon_mgmt_adjust_link(struct net_device *netdev)
670static int octeon_mgmt_init_phy(struct net_device *netdev) 670static int octeon_mgmt_init_phy(struct net_device *netdev)
671{ 671{
672 struct octeon_mgmt *p = netdev_priv(netdev); 672 struct octeon_mgmt *p = netdev_priv(netdev);
673 char phy_id[20]; 673 char phy_id[MII_BUS_ID_SIZE + 3];
674 674
675 if (octeon_is_simulation()) { 675 if (octeon_is_simulation()) {
676 /* No PHYs in the simulator. */ 676 /* No PHYs in the simulator. */
@@ -678,7 +678,7 @@ static int octeon_mgmt_init_phy(struct net_device *netdev)
678 return 0; 678 return 0;
679 } 679 }
680 680
681 snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "0", p->port); 681 snprintf(phy_id, sizeof(phy_id), PHY_ID_FMT, "mdio-octeon-0", p->port);
682 682
683 p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0, 683 p->phydev = phy_connect(netdev, phy_id, octeon_mgmt_adjust_link, 0,
684 PHY_INTERFACE_MODE_MII); 684 PHY_INTERFACE_MODE_MII);
diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
index d0b814ef0675..0319d640f728 100644
--- a/drivers/net/ethernet/stmicro/stmmac/common.h
+++ b/drivers/net/ethernet/stmicro/stmmac/common.h
@@ -67,6 +67,7 @@ struct stmmac_extra_stats {
67 unsigned long ipc_csum_error; 67 unsigned long ipc_csum_error;
68 unsigned long rx_collision; 68 unsigned long rx_collision;
69 unsigned long rx_crc; 69 unsigned long rx_crc;
70 unsigned long dribbling_bit;
70 unsigned long rx_length; 71 unsigned long rx_length;
71 unsigned long rx_mii; 72 unsigned long rx_mii;
72 unsigned long rx_multicast; 73 unsigned long rx_multicast;
diff --git a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
index d87976364ec5..ad1b627f8ec2 100644
--- a/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/enh_desc.c
@@ -201,7 +201,7 @@ static int enh_desc_get_rx_status(void *data, struct stmmac_extra_stats *x,
201 201
202 if (unlikely(p->des01.erx.dribbling)) { 202 if (unlikely(p->des01.erx.dribbling)) {
203 CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n"); 203 CHIP_DBG(KERN_ERR "GMAC RX: dribbling error\n");
204 ret = discard_frame; 204 x->dribbling_bit++;
205 } 205 }
206 if (unlikely(p->des01.erx.sa_filter_fail)) { 206 if (unlikely(p->des01.erx.sa_filter_fail)) {
207 CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n"); 207 CHIP_DBG(KERN_ERR "GMAC RX : Source Address filter fail\n");
diff --git a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
index fda5d2b31d3a..25953bb45a73 100644
--- a/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
+++ b/drivers/net/ethernet/stmicro/stmmac/norm_desc.c
@@ -104,7 +104,7 @@ static int ndesc_get_rx_status(void *data, struct stmmac_extra_stats *x,
104 ret = discard_frame; 104 ret = discard_frame;
105 } 105 }
106 if (unlikely(p->des01.rx.dribbling)) 106 if (unlikely(p->des01.rx.dribbling))
107 ret = discard_frame; 107 x->dribbling_bit++;
108 108
109 if (unlikely(p->des01.rx.length_error)) { 109 if (unlikely(p->des01.rx.length_error)) {
110 x->rx_length++; 110 x->rx_length++;
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac.h b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
index 120740020e2c..b4b095fdcf29 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac.h
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac.h
@@ -21,7 +21,7 @@
21*******************************************************************************/ 21*******************************************************************************/
22 22
23#define STMMAC_RESOURCE_NAME "stmmaceth" 23#define STMMAC_RESOURCE_NAME "stmmaceth"
24#define DRV_MODULE_VERSION "Dec_2011" 24#define DRV_MODULE_VERSION "Feb_2012"
25#include <linux/stmmac.h> 25#include <linux/stmmac.h>
26#include <linux/phy.h> 26#include <linux/phy.h>
27#include "common.h" 27#include "common.h"
@@ -97,4 +97,5 @@ int stmmac_resume(struct net_device *ndev);
97int stmmac_suspend(struct net_device *ndev); 97int stmmac_suspend(struct net_device *ndev);
98int stmmac_dvr_remove(struct net_device *ndev); 98int stmmac_dvr_remove(struct net_device *ndev);
99struct stmmac_priv *stmmac_dvr_probe(struct device *device, 99struct stmmac_priv *stmmac_dvr_probe(struct device *device,
100 struct plat_stmmacenet_data *plat_dat); 100 struct plat_stmmacenet_data *plat_dat,
101 void __iomem *addr);
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
index 9573303a706b..f98e1511660f 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c
@@ -47,23 +47,25 @@ struct stmmac_stats {
47 offsetof(struct stmmac_priv, xstats.m)} 47 offsetof(struct stmmac_priv, xstats.m)}
48 48
49static const struct stmmac_stats stmmac_gstrings_stats[] = { 49static const struct stmmac_stats stmmac_gstrings_stats[] = {
50 /* Transmit errors */
50 STMMAC_STAT(tx_underflow), 51 STMMAC_STAT(tx_underflow),
51 STMMAC_STAT(tx_carrier), 52 STMMAC_STAT(tx_carrier),
52 STMMAC_STAT(tx_losscarrier), 53 STMMAC_STAT(tx_losscarrier),
53 STMMAC_STAT(vlan_tag), 54 STMMAC_STAT(vlan_tag),
54 STMMAC_STAT(tx_deferred), 55 STMMAC_STAT(tx_deferred),
55 STMMAC_STAT(tx_vlan), 56 STMMAC_STAT(tx_vlan),
56 STMMAC_STAT(rx_vlan),
57 STMMAC_STAT(tx_jabber), 57 STMMAC_STAT(tx_jabber),
58 STMMAC_STAT(tx_frame_flushed), 58 STMMAC_STAT(tx_frame_flushed),
59 STMMAC_STAT(tx_payload_error), 59 STMMAC_STAT(tx_payload_error),
60 STMMAC_STAT(tx_ip_header_error), 60 STMMAC_STAT(tx_ip_header_error),
61 /* Receive errors */
61 STMMAC_STAT(rx_desc), 62 STMMAC_STAT(rx_desc),
62 STMMAC_STAT(sa_filter_fail), 63 STMMAC_STAT(sa_filter_fail),
63 STMMAC_STAT(overflow_error), 64 STMMAC_STAT(overflow_error),
64 STMMAC_STAT(ipc_csum_error), 65 STMMAC_STAT(ipc_csum_error),
65 STMMAC_STAT(rx_collision), 66 STMMAC_STAT(rx_collision),
66 STMMAC_STAT(rx_crc), 67 STMMAC_STAT(rx_crc),
68 STMMAC_STAT(dribbling_bit),
67 STMMAC_STAT(rx_length), 69 STMMAC_STAT(rx_length),
68 STMMAC_STAT(rx_mii), 70 STMMAC_STAT(rx_mii),
69 STMMAC_STAT(rx_multicast), 71 STMMAC_STAT(rx_multicast),
@@ -73,6 +75,8 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
73 STMMAC_STAT(sa_rx_filter_fail), 75 STMMAC_STAT(sa_rx_filter_fail),
74 STMMAC_STAT(rx_missed_cntr), 76 STMMAC_STAT(rx_missed_cntr),
75 STMMAC_STAT(rx_overflow_cntr), 77 STMMAC_STAT(rx_overflow_cntr),
78 STMMAC_STAT(rx_vlan),
79 /* Tx/Rx IRQ errors */
76 STMMAC_STAT(tx_undeflow_irq), 80 STMMAC_STAT(tx_undeflow_irq),
77 STMMAC_STAT(tx_process_stopped_irq), 81 STMMAC_STAT(tx_process_stopped_irq),
78 STMMAC_STAT(tx_jabber_irq), 82 STMMAC_STAT(tx_jabber_irq),
@@ -82,6 +86,7 @@ static const struct stmmac_stats stmmac_gstrings_stats[] = {
82 STMMAC_STAT(rx_watchdog_irq), 86 STMMAC_STAT(rx_watchdog_irq),
83 STMMAC_STAT(tx_early_irq), 87 STMMAC_STAT(tx_early_irq),
84 STMMAC_STAT(fatal_bus_error_irq), 88 STMMAC_STAT(fatal_bus_error_irq),
89 /* Extra info */
85 STMMAC_STAT(threshold), 90 STMMAC_STAT(threshold),
86 STMMAC_STAT(tx_pkt_n), 91 STMMAC_STAT(tx_pkt_n),
87 STMMAC_STAT(rx_pkt_n), 92 STMMAC_STAT(rx_pkt_n),
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index ab36dfcbd817..e85ffbd54830 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -241,7 +241,7 @@ static void stmmac_adjust_link(struct net_device *dev)
241 case 1000: 241 case 1000:
242 if (likely(priv->plat->has_gmac)) 242 if (likely(priv->plat->has_gmac))
243 ctrl &= ~priv->hw->link.port; 243 ctrl &= ~priv->hw->link.port;
244 stmmac_hw_fix_mac_speed(priv); 244 stmmac_hw_fix_mac_speed(priv);
245 break; 245 break;
246 case 100: 246 case 100:
247 case 10: 247 case 10:
@@ -785,7 +785,7 @@ static u32 stmmac_get_synopsys_id(struct stmmac_priv *priv)
785 u32 uid = ((hwid & 0x0000ff00) >> 8); 785 u32 uid = ((hwid & 0x0000ff00) >> 8);
786 u32 synid = (hwid & 0x000000ff); 786 u32 synid = (hwid & 0x000000ff);
787 787
788 pr_info("STMMAC - user ID: 0x%x, Synopsys ID: 0x%x\n", 788 pr_info("stmmac - user ID: 0x%x, Synopsys ID: 0x%x\n",
789 uid, synid); 789 uid, synid);
790 790
791 return synid; 791 return synid;
@@ -869,38 +869,6 @@ static int stmmac_get_hw_features(struct stmmac_priv *priv)
869 return hw_cap; 869 return hw_cap;
870} 870}
871 871
872/**
873 * stmmac_mac_device_setup
874 * @dev : device pointer
875 * Description: this is to attach the GMAC or MAC 10/100
876 * main core structures that will be completed during the
877 * open step.
878 */
879static int stmmac_mac_device_setup(struct net_device *dev)
880{
881 struct stmmac_priv *priv = netdev_priv(dev);
882
883 struct mac_device_info *device;
884
885 if (priv->plat->has_gmac)
886 device = dwmac1000_setup(priv->ioaddr);
887 else
888 device = dwmac100_setup(priv->ioaddr);
889
890 if (!device)
891 return -ENOMEM;
892
893 priv->hw = device;
894 priv->hw->ring = &ring_mode_ops;
895
896 if (device_can_wakeup(priv->device)) {
897 priv->wolopts = WAKE_MAGIC; /* Magic Frame as default */
898 enable_irq_wake(priv->wol_irq);
899 }
900
901 return 0;
902}
903
904static void stmmac_check_ether_addr(struct stmmac_priv *priv) 872static void stmmac_check_ether_addr(struct stmmac_priv *priv)
905{ 873{
906 /* verify if the MAC address is valid, in case of failures it 874 /* verify if the MAC address is valid, in case of failures it
@@ -930,20 +898,8 @@ static int stmmac_open(struct net_device *dev)
930 struct stmmac_priv *priv = netdev_priv(dev); 898 struct stmmac_priv *priv = netdev_priv(dev);
931 int ret; 899 int ret;
932 900
933 /* MAC HW device setup */
934 ret = stmmac_mac_device_setup(dev);
935 if (ret < 0)
936 return ret;
937
938 stmmac_check_ether_addr(priv); 901 stmmac_check_ether_addr(priv);
939 902
940 stmmac_verify_args();
941
942 /* Override with kernel parameters if supplied XXX CRS XXX
943 * this needs to have multiple instances */
944 if ((phyaddr >= 0) && (phyaddr <= 31))
945 priv->plat->phy_addr = phyaddr;
946
947 /* MDIO bus Registration */ 903 /* MDIO bus Registration */
948 ret = stmmac_mdio_register(dev); 904 ret = stmmac_mdio_register(dev);
949 if (ret < 0) { 905 if (ret < 0) {
@@ -975,44 +931,6 @@ static int stmmac_open(struct net_device *dev)
975 goto open_error; 931 goto open_error;
976 } 932 }
977 933
978 stmmac_get_synopsys_id(priv);
979
980 priv->hw_cap_support = stmmac_get_hw_features(priv);
981
982 if (priv->hw_cap_support) {
983 pr_info(" Support DMA HW capability register");
984
985 /* We can override some gmac/dma configuration fields: e.g.
986 * enh_desc, tx_coe (e.g. that are passed through the
987 * platform) with the values from the HW capability
988 * register (if supported).
989 */
990 priv->plat->enh_desc = priv->dma_cap.enh_desc;
991 priv->plat->tx_coe = priv->dma_cap.tx_coe;
992 priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
993
994 /* By default disable wol on magic frame if not supported */
995 if (!priv->dma_cap.pmt_magic_frame)
996 priv->wolopts &= ~WAKE_MAGIC;
997
998 } else
999 pr_info(" No HW DMA feature register supported");
1000
1001 /* Select the enhnaced/normal descriptor structures */
1002 stmmac_selec_desc_mode(priv);
1003
1004 /* PMT module is not integrated in all the MAC devices. */
1005 if (priv->plat->pmt) {
1006 pr_info(" Remote wake-up capable\n");
1007 device_set_wakeup_capable(priv->device, 1);
1008 }
1009
1010 priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr);
1011 if (priv->rx_coe)
1012 pr_info(" Checksum Offload Engine supported\n");
1013 if (priv->plat->tx_coe)
1014 pr_info(" Checksum insertion supported\n");
1015
1016 /* Create and initialize the TX/RX descriptors chains. */ 934 /* Create and initialize the TX/RX descriptors chains. */
1017 priv->dma_tx_size = STMMAC_ALIGN(dma_txsize); 935 priv->dma_tx_size = STMMAC_ALIGN(dma_txsize);
1018 priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize); 936 priv->dma_rx_size = STMMAC_ALIGN(dma_rxsize);
@@ -1029,14 +947,14 @@ static int stmmac_open(struct net_device *dev)
1029 947
1030 /* Copy the MAC addr into the HW */ 948 /* Copy the MAC addr into the HW */
1031 priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0); 949 priv->hw->mac->set_umac_addr(priv->ioaddr, dev->dev_addr, 0);
950
1032 /* If required, perform hw setup of the bus. */ 951 /* If required, perform hw setup of the bus. */
1033 if (priv->plat->bus_setup) 952 if (priv->plat->bus_setup)
1034 priv->plat->bus_setup(priv->ioaddr); 953 priv->plat->bus_setup(priv->ioaddr);
954
1035 /* Initialize the MAC Core */ 955 /* Initialize the MAC Core */
1036 priv->hw->mac->core_init(priv->ioaddr); 956 priv->hw->mac->core_init(priv->ioaddr);
1037 957
1038 netdev_update_features(dev);
1039
1040 /* Request the IRQ lines */ 958 /* Request the IRQ lines */
1041 ret = request_irq(dev->irq, stmmac_interrupt, 959 ret = request_irq(dev->irq, stmmac_interrupt,
1042 IRQF_SHARED, dev->name, dev); 960 IRQF_SHARED, dev->name, dev);
@@ -1046,6 +964,17 @@ static int stmmac_open(struct net_device *dev)
1046 goto open_error; 964 goto open_error;
1047 } 965 }
1048 966
967 /* Request the Wake IRQ in case of another line is used for WoL */
968 if (priv->wol_irq != dev->irq) {
969 ret = request_irq(priv->wol_irq, stmmac_interrupt,
970 IRQF_SHARED, dev->name, dev);
971 if (unlikely(ret < 0)) {
972 pr_err("%s: ERROR: allocating the ext WoL IRQ %d "
973 "(error: %d)\n", __func__, priv->wol_irq, ret);
974 goto open_error_wolirq;
975 }
976 }
977
1049 /* Enable the MAC Rx/Tx */ 978 /* Enable the MAC Rx/Tx */
1050 stmmac_set_mac(priv->ioaddr, true); 979 stmmac_set_mac(priv->ioaddr, true);
1051 980
@@ -1061,7 +990,7 @@ static int stmmac_open(struct net_device *dev)
1061#ifdef CONFIG_STMMAC_DEBUG_FS 990#ifdef CONFIG_STMMAC_DEBUG_FS
1062 ret = stmmac_init_fs(dev); 991 ret = stmmac_init_fs(dev);
1063 if (ret < 0) 992 if (ret < 0)
1064 pr_warning("\tFailed debugFS registration"); 993 pr_warning("%s: failed debugFS registration\n", __func__);
1065#endif 994#endif
1066 /* Start the ball rolling... */ 995 /* Start the ball rolling... */
1067 DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name); 996 DBG(probe, DEBUG, "%s: DMA RX/TX processes started...\n", dev->name);
@@ -1071,6 +1000,7 @@ static int stmmac_open(struct net_device *dev)
1071#ifdef CONFIG_STMMAC_TIMER 1000#ifdef CONFIG_STMMAC_TIMER
1072 priv->tm->timer_start(tmrate); 1001 priv->tm->timer_start(tmrate);
1073#endif 1002#endif
1003
1074 /* Dump DMA/MAC registers */ 1004 /* Dump DMA/MAC registers */
1075 if (netif_msg_hw(priv)) { 1005 if (netif_msg_hw(priv)) {
1076 priv->hw->mac->dump_regs(priv->ioaddr); 1006 priv->hw->mac->dump_regs(priv->ioaddr);
@@ -1086,6 +1016,9 @@ static int stmmac_open(struct net_device *dev)
1086 1016
1087 return 0; 1017 return 0;
1088 1018
1019open_error_wolirq:
1020 free_irq(dev->irq, dev);
1021
1089open_error: 1022open_error:
1090#ifdef CONFIG_STMMAC_TIMER 1023#ifdef CONFIG_STMMAC_TIMER
1091 kfree(priv->tm); 1024 kfree(priv->tm);
@@ -1126,6 +1059,8 @@ static int stmmac_release(struct net_device *dev)
1126 1059
1127 /* Free the IRQ lines */ 1060 /* Free the IRQ lines */
1128 free_irq(dev->irq, dev); 1061 free_irq(dev->irq, dev);
1062 if (priv->wol_irq != dev->irq)
1063 free_irq(priv->wol_irq, dev);
1129 1064
1130 /* Stop TX/RX DMA and clear the descriptors */ 1065 /* Stop TX/RX DMA and clear the descriptors */
1131 priv->hw->dma->stop_tx(priv->ioaddr); 1066 priv->hw->dma->stop_tx(priv->ioaddr);
@@ -1788,13 +1723,77 @@ static const struct net_device_ops stmmac_netdev_ops = {
1788}; 1723};
1789 1724
1790/** 1725/**
1726 * stmmac_hw_init - Init the MAC device
1727 * @priv : pointer to the private device structure.
1728 * Description: this function detects which MAC device
1729 * (GMAC/MAC10-100) has to attached, checks the HW capability
1730 * (if supported) and sets the driver's features (for example
1731 * to use the ring or chaine mode or support the normal/enh
1732 * descriptor structure).
1733 */
1734static int stmmac_hw_init(struct stmmac_priv *priv)
1735{
1736 int ret = 0;
1737 struct mac_device_info *mac;
1738
1739 /* Identify the MAC HW device */
1740 if (priv->plat->has_gmac)
1741 mac = dwmac1000_setup(priv->ioaddr);
1742 else
1743 mac = dwmac100_setup(priv->ioaddr);
1744 if (!mac)
1745 return -ENOMEM;
1746
1747 priv->hw = mac;
1748
1749 /* To use the chained or ring mode */
1750 priv->hw->ring = &ring_mode_ops;
1751
1752 /* Get and dump the chip ID */
1753 stmmac_get_synopsys_id(priv);
1754
1755 /* Get the HW capability (new GMAC newer than 3.50a) */
1756 priv->hw_cap_support = stmmac_get_hw_features(priv);
1757 if (priv->hw_cap_support) {
1758 pr_info(" DMA HW capability register supported");
1759
1760 /* We can override some gmac/dma configuration fields: e.g.
1761 * enh_desc, tx_coe (e.g. that are passed through the
1762 * platform) with the values from the HW capability
1763 * register (if supported).
1764 */
1765 priv->plat->enh_desc = priv->dma_cap.enh_desc;
1766 priv->plat->tx_coe = priv->dma_cap.tx_coe;
1767 priv->plat->pmt = priv->dma_cap.pmt_remote_wake_up;
1768 } else
1769 pr_info(" No HW DMA feature register supported");
1770
1771 /* Select the enhnaced/normal descriptor structures */
1772 stmmac_selec_desc_mode(priv);
1773
1774 priv->rx_coe = priv->hw->mac->rx_coe(priv->ioaddr);
1775 if (priv->rx_coe)
1776 pr_info(" RX Checksum Offload Engine supported\n");
1777 if (priv->plat->tx_coe)
1778 pr_info(" TX Checksum insertion supported\n");
1779
1780 if (priv->plat->pmt) {
1781 pr_info(" Wake-Up On Lan supported\n");
1782 device_set_wakeup_capable(priv->device, 1);
1783 }
1784
1785 return ret;
1786}
1787
1788/**
1791 * stmmac_dvr_probe 1789 * stmmac_dvr_probe
1792 * @device: device pointer 1790 * @device: device pointer
1793 * Description: this is the main probe function used to 1791 * Description: this is the main probe function used to
1794 * call the alloc_etherdev, allocate the priv structure. 1792 * call the alloc_etherdev, allocate the priv structure.
1795 */ 1793 */
1796struct stmmac_priv *stmmac_dvr_probe(struct device *device, 1794struct stmmac_priv *stmmac_dvr_probe(struct device *device,
1797 struct plat_stmmacenet_data *plat_dat) 1795 struct plat_stmmacenet_data *plat_dat,
1796 void __iomem *addr)
1798{ 1797{
1799 int ret = 0; 1798 int ret = 0;
1800 struct net_device *ndev = NULL; 1799 struct net_device *ndev = NULL;
@@ -1812,10 +1811,27 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
1812 1811
1813 ether_setup(ndev); 1812 ether_setup(ndev);
1814 1813
1815 ndev->netdev_ops = &stmmac_netdev_ops;
1816 stmmac_set_ethtool_ops(ndev); 1814 stmmac_set_ethtool_ops(ndev);
1815 priv->pause = pause;
1816 priv->plat = plat_dat;
1817 priv->ioaddr = addr;
1818 priv->dev->base_addr = (unsigned long)addr;
1819
1820 /* Verify driver arguments */
1821 stmmac_verify_args();
1822
1823 /* Override with kernel parameters if supplied XXX CRS XXX
1824 * this needs to have multiple instances */
1825 if ((phyaddr >= 0) && (phyaddr <= 31))
1826 priv->plat->phy_addr = phyaddr;
1827
1828 /* Init MAC and get the capabilities */
1829 stmmac_hw_init(priv);
1830
1831 ndev->netdev_ops = &stmmac_netdev_ops;
1817 1832
1818 ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM; 1833 ndev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1834 NETIF_F_RXCSUM;
1819 ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA; 1835 ndev->features |= ndev->hw_features | NETIF_F_HIGHDMA;
1820 ndev->watchdog_timeo = msecs_to_jiffies(watchdog); 1836 ndev->watchdog_timeo = msecs_to_jiffies(watchdog);
1821#ifdef STMMAC_VLAN_TAG_USED 1837#ifdef STMMAC_VLAN_TAG_USED
@@ -1827,8 +1843,6 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
1827 if (flow_ctrl) 1843 if (flow_ctrl)
1828 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */ 1844 priv->flow_ctrl = FLOW_AUTO; /* RX/TX pause on */
1829 1845
1830 priv->pause = pause;
1831 priv->plat = plat_dat;
1832 netif_napi_add(ndev, &priv->napi, stmmac_poll, 64); 1846 netif_napi_add(ndev, &priv->napi, stmmac_poll, 64);
1833 1847
1834 spin_lock_init(&priv->lock); 1848 spin_lock_init(&priv->lock);
@@ -1836,15 +1850,10 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
1836 1850
1837 ret = register_netdev(ndev); 1851 ret = register_netdev(ndev);
1838 if (ret) { 1852 if (ret) {
1839 pr_err("%s: ERROR %i registering the device\n", 1853 pr_err("%s: ERROR %i registering the device\n", __func__, ret);
1840 __func__, ret);
1841 goto error; 1854 goto error;
1842 } 1855 }
1843 1856
1844 DBG(probe, DEBUG, "%s: Scatter/Gather: %s - HW checksums: %s\n",
1845 ndev->name, (ndev->features & NETIF_F_SG) ? "on" : "off",
1846 (ndev->features & NETIF_F_IP_CSUM) ? "on" : "off");
1847
1848 return priv; 1857 return priv;
1849 1858
1850error: 1859error:
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
index 4e12884bab39..da66ed7c3c5d 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_pci.c
@@ -96,13 +96,11 @@ static int __devinit stmmac_pci_probe(struct pci_dev *pdev,
96 96
97 stmmac_default_data(); 97 stmmac_default_data();
98 98
99 priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat); 99 priv = stmmac_dvr_probe(&(pdev->dev), &plat_dat, addr);
100 if (!priv) { 100 if (!priv) {
101 pr_err("%s: main driver probe failed", __func__); 101 pr_err("%s: main driver probe failed", __func__);
102 goto err_out; 102 goto err_out;
103 } 103 }
104 priv->ioaddr = addr;
105 priv->dev->base_addr = (unsigned long)addr;
106 priv->dev->irq = pdev->irq; 104 priv->dev->irq = pdev->irq;
107 priv->wol_irq = pdev->irq; 105 priv->wol_irq = pdev->irq;
108 106
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
index 11af27ef4930..3aad9810237c 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
@@ -59,16 +59,20 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
59 goto out_release_region; 59 goto out_release_region;
60 } 60 }
61 plat_dat = pdev->dev.platform_data; 61 plat_dat = pdev->dev.platform_data;
62 priv = stmmac_dvr_probe(&(pdev->dev), plat_dat); 62
63 /* Custom initialisation (if needed)*/
64 if (plat_dat->init) {
65 ret = plat_dat->init(pdev);
66 if (unlikely(ret))
67 goto out_unmap;
68 }
69
70 priv = stmmac_dvr_probe(&(pdev->dev), plat_dat, addr);
63 if (!priv) { 71 if (!priv) {
64 pr_err("%s: main driver probe failed", __func__); 72 pr_err("%s: main driver probe failed", __func__);
65 goto out_unmap; 73 goto out_unmap;
66 } 74 }
67 75
68 priv->ioaddr = addr;
69 /* Set the I/O base addr */
70 priv->dev->base_addr = (unsigned long)addr;
71
72 /* Get the MAC information */ 76 /* Get the MAC information */
73 priv->dev->irq = platform_get_irq_byname(pdev, "macirq"); 77 priv->dev->irq = platform_get_irq_byname(pdev, "macirq");
74 if (priv->dev->irq == -ENXIO) { 78 if (priv->dev->irq == -ENXIO) {
@@ -92,13 +96,6 @@ static int stmmac_pltfr_probe(struct platform_device *pdev)
92 96
93 platform_set_drvdata(pdev, priv->dev); 97 platform_set_drvdata(pdev, priv->dev);
94 98
95 /* Custom initialisation */
96 if (priv->plat->init) {
97 ret = priv->plat->init(pdev);
98 if (unlikely(ret))
99 goto out_unmap;
100 }
101
102 pr_debug("STMMAC platform driver registration completed"); 99 pr_debug("STMMAC platform driver registration completed");
103 100
104 return 0; 101 return 0;
diff --git a/drivers/net/ethernet/ti/cpmac.c b/drivers/net/ethernet/ti/cpmac.c
index 97e1df330a17..860c2526f08d 100644
--- a/drivers/net/ethernet/ti/cpmac.c
+++ b/drivers/net/ethernet/ti/cpmac.c
@@ -1122,7 +1122,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1122 pdata = pdev->dev.platform_data; 1122 pdata = pdev->dev.platform_data;
1123 1123
1124 if (external_switch || dumb_switch) { 1124 if (external_switch || dumb_switch) {
1125 strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ 1125 strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
1126 phy_id = pdev->id; 1126 phy_id = pdev->id;
1127 } else { 1127 } else {
1128 for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) { 1128 for (phy_id = 0; phy_id < PHY_MAX_ADDR; phy_id++) {
@@ -1138,7 +1138,7 @@ static int __devinit cpmac_probe(struct platform_device *pdev)
1138 if (phy_id == PHY_MAX_ADDR) { 1138 if (phy_id == PHY_MAX_ADDR) {
1139 dev_err(&pdev->dev, "no PHY present, falling back " 1139 dev_err(&pdev->dev, "no PHY present, falling back "
1140 "to switch on MDIO bus 0\n"); 1140 "to switch on MDIO bus 0\n");
1141 strncpy(mdio_bus_id, "0", MII_BUS_ID_SIZE); /* fixed phys bus */ 1141 strncpy(mdio_bus_id, "fixed-0", MII_BUS_ID_SIZE); /* fixed phys bus */
1142 phy_id = pdev->id; 1142 phy_id = pdev->id;
1143 } 1143 }
1144 1144
diff --git a/drivers/net/ethernet/xscale/ixp4xx_eth.c b/drivers/net/ethernet/xscale/ixp4xx_eth.c
index 72a854f05bb8..41a8b5a9849e 100644
--- a/drivers/net/ethernet/xscale/ixp4xx_eth.c
+++ b/drivers/net/ethernet/xscale/ixp4xx_eth.c
@@ -1416,7 +1416,8 @@ static int __devinit eth_init_one(struct platform_device *pdev)
1416 __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control); 1416 __raw_writel(DEFAULT_CORE_CNTRL, &port->regs->core_control);
1417 udelay(50); 1417 udelay(50);
1418 1418
1419 snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT, "0", plat->phy); 1419 snprintf(phy_id, MII_BUS_ID_SIZE + 3, PHY_ID_FMT,
1420 mdio_bus->id, plat->phy);
1420 port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0, 1421 port->phydev = phy_connect(dev, phy_id, &ixp4xx_adjust_link, 0,
1421 PHY_INTERFACE_MODE_MII); 1422 PHY_INTERFACE_MODE_MII);
1422 if (IS_ERR(port->phydev)) { 1423 if (IS_ERR(port->phydev)) {
diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
index e84662db51cc..dd78c4cbd459 100644
--- a/drivers/net/usb/ipheth.c
+++ b/drivers/net/usb/ipheth.c
@@ -60,6 +60,7 @@
60#define USB_PRODUCT_IPHONE_3GS 0x1294 60#define USB_PRODUCT_IPHONE_3GS 0x1294
61#define USB_PRODUCT_IPHONE_4 0x1297 61#define USB_PRODUCT_IPHONE_4 0x1297
62#define USB_PRODUCT_IPHONE_4_VZW 0x129c 62#define USB_PRODUCT_IPHONE_4_VZW 0x129c
63#define USB_PRODUCT_IPHONE_4S 0x12a0
63 64
64#define IPHETH_USBINTF_CLASS 255 65#define IPHETH_USBINTF_CLASS 255
65#define IPHETH_USBINTF_SUBCLASS 253 66#define IPHETH_USBINTF_SUBCLASS 253
@@ -103,6 +104,10 @@ static struct usb_device_id ipheth_table[] = {
103 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW, 104 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4_VZW,
104 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS, 105 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
105 IPHETH_USBINTF_PROTO) }, 106 IPHETH_USBINTF_PROTO) },
107 { USB_DEVICE_AND_INTERFACE_INFO(
108 USB_VENDOR_APPLE, USB_PRODUCT_IPHONE_4S,
109 IPHETH_USBINTF_CLASS, IPHETH_USBINTF_SUBCLASS,
110 IPHETH_USBINTF_PROTO) },
106 { } 111 { }
107}; 112};
108MODULE_DEVICE_TABLE(usb, ipheth_table); 113MODULE_DEVICE_TABLE(usb, ipheth_table);
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index b8a697f5cb69..5852361032c4 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -422,7 +422,9 @@ static void veth_dellink(struct net_device *dev, struct list_head *head)
422 unregister_netdevice_queue(peer, head); 422 unregister_netdevice_queue(peer, head);
423} 423}
424 424
425static const struct nla_policy veth_policy[VETH_INFO_MAX + 1]; 425static const struct nla_policy veth_policy[VETH_INFO_MAX + 1] = {
426 [VETH_INFO_PEER] = { .len = sizeof(struct ifinfomsg) },
427};
426 428
427static struct rtnl_link_ops veth_link_ops = { 429static struct rtnl_link_ops veth_link_ops = {
428 .kind = DRV_NAME, 430 .kind = DRV_NAME,
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 5cb2199435d2..653fe728e4a2 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1493,7 +1493,7 @@ static int rtl_pci_init(struct ieee80211_hw *hw, struct pci_dev *pdev)
1493 return err; 1493 return err;
1494 } 1494 }
1495 1495
1496 return 1; 1496 return 0;
1497} 1497}
1498 1498
1499static int rtl_pci_start(struct ieee80211_hw *hw) 1499static int rtl_pci_start(struct ieee80211_hw *hw)
@@ -1860,7 +1860,7 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1860 } 1860 }
1861 1861
1862 /* Init PCI sw */ 1862 /* Init PCI sw */
1863 err = !rtl_pci_init(hw, pdev); 1863 err = rtl_pci_init(hw, pdev);
1864 if (err) { 1864 if (err) {
1865 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n"); 1865 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Failed to init PCI\n");
1866 goto fail3; 1866 goto fail3;