diff options
Diffstat (limited to 'drivers/net/ibm_newemac')
-rw-r--r-- | drivers/net/ibm_newemac/core.c | 43 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/core.h | 1 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/mal.c | 1 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/rgmii.c | 1 | ||||
-rw-r--r-- | drivers/net/ibm_newemac/zmii.c | 1 |
5 files changed, 27 insertions, 20 deletions
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 3fae87559791..dd873cc41c2b 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/bitops.h> | 39 | #include <linux/bitops.h> |
40 | #include <linux/workqueue.h> | 40 | #include <linux/workqueue.h> |
41 | #include <linux/of.h> | 41 | #include <linux/of.h> |
42 | #include <linux/slab.h> | ||
42 | 43 | ||
43 | #include <asm/processor.h> | 44 | #include <asm/processor.h> |
44 | #include <asm/io.h> | 45 | #include <asm/io.h> |
@@ -391,11 +392,11 @@ static void emac_hash_mc(struct emac_instance *dev) | |||
391 | struct dev_mc_list *dmi; | 392 | struct dev_mc_list *dmi; |
392 | int i; | 393 | int i; |
393 | 394 | ||
394 | DBG(dev, "hash_mc %d" NL, dev->ndev->mc_count); | 395 | DBG(dev, "hash_mc %d" NL, netdev_mc_count(dev->ndev)); |
395 | 396 | ||
396 | memset(gaht_temp, 0, sizeof (gaht_temp)); | 397 | memset(gaht_temp, 0, sizeof (gaht_temp)); |
397 | 398 | ||
398 | for (dmi = dev->ndev->mc_list; dmi; dmi = dmi->next) { | 399 | netdev_for_each_mc_addr(dmi, dev->ndev) { |
399 | int slot, reg, mask; | 400 | int slot, reg, mask; |
400 | DBG2(dev, "mc %pM" NL, dmi->dmi_addr); | 401 | DBG2(dev, "mc %pM" NL, dmi->dmi_addr); |
401 | 402 | ||
@@ -425,9 +426,9 @@ static inline u32 emac_iff2rmr(struct net_device *ndev) | |||
425 | if (ndev->flags & IFF_PROMISC) | 426 | if (ndev->flags & IFF_PROMISC) |
426 | r |= EMAC_RMR_PME; | 427 | r |= EMAC_RMR_PME; |
427 | else if (ndev->flags & IFF_ALLMULTI || | 428 | else if (ndev->flags & IFF_ALLMULTI || |
428 | (ndev->mc_count > EMAC_XAHT_SLOTS(dev))) | 429 | (netdev_mc_count(ndev) > EMAC_XAHT_SLOTS(dev))) |
429 | r |= EMAC_RMR_PMME; | 430 | r |= EMAC_RMR_PMME; |
430 | else if (ndev->mc_count > 0) | 431 | else if (!netdev_mc_empty(ndev)) |
431 | r |= EMAC_RMR_MAE; | 432 | r |= EMAC_RMR_MAE; |
432 | 433 | ||
433 | return r; | 434 | return r; |
@@ -1976,27 +1977,27 @@ static int emac_ethtool_set_settings(struct net_device *ndev, | |||
1976 | if (cmd->autoneg == AUTONEG_DISABLE) { | 1977 | if (cmd->autoneg == AUTONEG_DISABLE) { |
1977 | switch (cmd->speed) { | 1978 | switch (cmd->speed) { |
1978 | case SPEED_10: | 1979 | case SPEED_10: |
1979 | if (cmd->duplex == DUPLEX_HALF | 1980 | if (cmd->duplex == DUPLEX_HALF && |
1980 | && !(f & SUPPORTED_10baseT_Half)) | 1981 | !(f & SUPPORTED_10baseT_Half)) |
1981 | return -EINVAL; | 1982 | return -EINVAL; |
1982 | if (cmd->duplex == DUPLEX_FULL | 1983 | if (cmd->duplex == DUPLEX_FULL && |
1983 | && !(f & SUPPORTED_10baseT_Full)) | 1984 | !(f & SUPPORTED_10baseT_Full)) |
1984 | return -EINVAL; | 1985 | return -EINVAL; |
1985 | break; | 1986 | break; |
1986 | case SPEED_100: | 1987 | case SPEED_100: |
1987 | if (cmd->duplex == DUPLEX_HALF | 1988 | if (cmd->duplex == DUPLEX_HALF && |
1988 | && !(f & SUPPORTED_100baseT_Half)) | 1989 | !(f & SUPPORTED_100baseT_Half)) |
1989 | return -EINVAL; | 1990 | return -EINVAL; |
1990 | if (cmd->duplex == DUPLEX_FULL | 1991 | if (cmd->duplex == DUPLEX_FULL && |
1991 | && !(f & SUPPORTED_100baseT_Full)) | 1992 | !(f & SUPPORTED_100baseT_Full)) |
1992 | return -EINVAL; | 1993 | return -EINVAL; |
1993 | break; | 1994 | break; |
1994 | case SPEED_1000: | 1995 | case SPEED_1000: |
1995 | if (cmd->duplex == DUPLEX_HALF | 1996 | if (cmd->duplex == DUPLEX_HALF && |
1996 | && !(f & SUPPORTED_1000baseT_Half)) | 1997 | !(f & SUPPORTED_1000baseT_Half)) |
1997 | return -EINVAL; | 1998 | return -EINVAL; |
1998 | if (cmd->duplex == DUPLEX_FULL | 1999 | if (cmd->duplex == DUPLEX_FULL && |
1999 | && !(f & SUPPORTED_1000baseT_Full)) | 2000 | !(f & SUPPORTED_1000baseT_Full)) |
2000 | return -EINVAL; | 2001 | return -EINVAL; |
2001 | break; | 2002 | break; |
2002 | default: | 2003 | default: |
@@ -2149,9 +2150,12 @@ static int emac_ethtool_nway_reset(struct net_device *ndev) | |||
2149 | return res; | 2150 | return res; |
2150 | } | 2151 | } |
2151 | 2152 | ||
2152 | static int emac_ethtool_get_stats_count(struct net_device *ndev) | 2153 | static int emac_ethtool_get_sset_count(struct net_device *ndev, int stringset) |
2153 | { | 2154 | { |
2154 | return EMAC_ETHTOOL_STATS_COUNT; | 2155 | if (stringset == ETH_SS_STATS) |
2156 | return EMAC_ETHTOOL_STATS_COUNT; | ||
2157 | else | ||
2158 | return -EINVAL; | ||
2155 | } | 2159 | } |
2156 | 2160 | ||
2157 | static void emac_ethtool_get_strings(struct net_device *ndev, u32 stringset, | 2161 | static void emac_ethtool_get_strings(struct net_device *ndev, u32 stringset, |
@@ -2182,7 +2186,6 @@ static void emac_ethtool_get_drvinfo(struct net_device *ndev, | |||
2182 | info->fw_version[0] = '\0'; | 2186 | info->fw_version[0] = '\0'; |
2183 | sprintf(info->bus_info, "PPC 4xx EMAC-%d %s", | 2187 | sprintf(info->bus_info, "PPC 4xx EMAC-%d %s", |
2184 | dev->cell_index, dev->ofdev->node->full_name); | 2188 | dev->cell_index, dev->ofdev->node->full_name); |
2185 | info->n_stats = emac_ethtool_get_stats_count(ndev); | ||
2186 | info->regdump_len = emac_ethtool_get_regs_len(ndev); | 2189 | info->regdump_len = emac_ethtool_get_regs_len(ndev); |
2187 | } | 2190 | } |
2188 | 2191 | ||
@@ -2202,7 +2205,7 @@ static const struct ethtool_ops emac_ethtool_ops = { | |||
2202 | .get_rx_csum = emac_ethtool_get_rx_csum, | 2205 | .get_rx_csum = emac_ethtool_get_rx_csum, |
2203 | 2206 | ||
2204 | .get_strings = emac_ethtool_get_strings, | 2207 | .get_strings = emac_ethtool_get_strings, |
2205 | .get_stats_count = emac_ethtool_get_stats_count, | 2208 | .get_sset_count = emac_ethtool_get_sset_count, |
2206 | .get_ethtool_stats = emac_ethtool_get_ethtool_stats, | 2209 | .get_ethtool_stats = emac_ethtool_get_ethtool_stats, |
2207 | 2210 | ||
2208 | .get_link = ethtool_op_get_link, | 2211 | .get_link = ethtool_op_get_link, |
diff --git a/drivers/net/ibm_newemac/core.h b/drivers/net/ibm_newemac/core.h index 18d56c6c4238..b1cbe6fdfc7a 100644 --- a/drivers/net/ibm_newemac/core.h +++ b/drivers/net/ibm_newemac/core.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #include <linux/dma-mapping.h> | 34 | #include <linux/dma-mapping.h> |
35 | #include <linux/spinlock.h> | 35 | #include <linux/spinlock.h> |
36 | #include <linux/of_platform.h> | 36 | #include <linux/of_platform.h> |
37 | #include <linux/slab.h> | ||
37 | 38 | ||
38 | #include <asm/io.h> | 39 | #include <asm/io.h> |
39 | #include <asm/dcr.h> | 40 | #include <asm/dcr.h> |
diff --git a/drivers/net/ibm_newemac/mal.c b/drivers/net/ibm_newemac/mal.c index 2a2fc17b2878..5b3d94419fe6 100644 --- a/drivers/net/ibm_newemac/mal.c +++ b/drivers/net/ibm_newemac/mal.c | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <linux/delay.h> | 28 | #include <linux/delay.h> |
29 | #include <linux/slab.h> | ||
29 | 30 | ||
30 | #include "core.h" | 31 | #include "core.h" |
31 | #include <asm/dcr-regs.h> | 32 | #include <asm/dcr-regs.h> |
diff --git a/drivers/net/ibm_newemac/rgmii.c b/drivers/net/ibm_newemac/rgmii.c index 8d76cb89dbd6..5b90d34c8455 100644 --- a/drivers/net/ibm_newemac/rgmii.c +++ b/drivers/net/ibm_newemac/rgmii.c | |||
@@ -21,6 +21,7 @@ | |||
21 | * option) any later version. | 21 | * option) any later version. |
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | #include <linux/slab.h> | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/ethtool.h> | 26 | #include <linux/ethtool.h> |
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |
diff --git a/drivers/net/ibm_newemac/zmii.c b/drivers/net/ibm_newemac/zmii.c index 17b154124943..1f038f808ab3 100644 --- a/drivers/net/ibm_newemac/zmii.c +++ b/drivers/net/ibm_newemac/zmii.c | |||
@@ -21,6 +21,7 @@ | |||
21 | * option) any later version. | 21 | * option) any later version. |
22 | * | 22 | * |
23 | */ | 23 | */ |
24 | #include <linux/slab.h> | ||
24 | #include <linux/kernel.h> | 25 | #include <linux/kernel.h> |
25 | #include <linux/ethtool.h> | 26 | #include <linux/ethtool.h> |
26 | #include <asm/io.h> | 27 | #include <asm/io.h> |