diff options
35 files changed, 288 insertions, 241 deletions
diff --git a/Documentation/networking/bonding.txt b/Documentation/networking/bonding.txt index 5ede7473b425..08762750f121 100644 --- a/Documentation/networking/bonding.txt +++ b/Documentation/networking/bonding.txt | |||
@@ -1242,7 +1242,7 @@ monitoring is enabled, and vice-versa. | |||
1242 | To add ARP targets: | 1242 | To add ARP targets: |
1243 | # echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target | 1243 | # echo +192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target |
1244 | # echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target | 1244 | # echo +192.168.0.101 > /sys/class/net/bond0/bonding/arp_ip_target |
1245 | NOTE: up to 10 target addresses may be specified. | 1245 | NOTE: up to 16 target addresses may be specified. |
1246 | 1246 | ||
1247 | To remove an ARP target: | 1247 | To remove an ARP target: |
1248 | # echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target | 1248 | # echo -192.168.0.100 > /sys/class/net/bond0/bonding/arp_ip_target |
diff --git a/MAINTAINERS b/MAINTAINERS index ca2997a45766..abedca58d8bd 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -3916,19 +3916,12 @@ F: Documentation/blockdev/nbd.txt | |||
3916 | F: drivers/block/nbd.c | 3916 | F: drivers/block/nbd.c |
3917 | F: include/linux/nbd.h | 3917 | F: include/linux/nbd.h |
3918 | 3918 | ||
3919 | NETWORK DEVICE DRIVERS | ||
3920 | P: Jeff Garzik | ||
3921 | M: jgarzik@pobox.com | ||
3922 | L: netdev@vger.kernel.org | ||
3923 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git | ||
3924 | S: Maintained | ||
3925 | F: drivers/net/ | ||
3926 | |||
3927 | NETWORKING [GENERAL] | 3919 | NETWORKING [GENERAL] |
3928 | P: Networking Team | 3920 | P: David S. Miller |
3929 | M: netdev@vger.kernel.org | 3921 | M: davem@davemloft.net |
3930 | L: netdev@vger.kernel.org | 3922 | L: netdev@vger.kernel.org |
3931 | W: http://linux-net.osdl.org/ | 3923 | W: http://linux-net.osdl.org/ |
3924 | T: git kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git | ||
3932 | S: Maintained | 3925 | S: Maintained |
3933 | F: net/ | 3926 | F: net/ |
3934 | F: include/net/ | 3927 | F: include/net/ |
diff --git a/drivers/net/ariadne.c b/drivers/net/ariadne.c index e1d72e06f3e1..58e8d522e5bc 100644 --- a/drivers/net/ariadne.c +++ b/drivers/net/ariadne.c | |||
@@ -155,6 +155,18 @@ static struct zorro_driver ariadne_driver = { | |||
155 | .remove = __devexit_p(ariadne_remove_one), | 155 | .remove = __devexit_p(ariadne_remove_one), |
156 | }; | 156 | }; |
157 | 157 | ||
158 | static const struct net_device_ops ariadne_netdev_ops = { | ||
159 | .ndo_open = ariadne_open, | ||
160 | .ndo_stop = ariadne_close, | ||
161 | .ndo_start_xmit = ariadne_start_xmit, | ||
162 | .ndo_tx_timeout = ariadne_tx_timeout, | ||
163 | .ndo_get_stats = ariadne_get_stats, | ||
164 | .ndo_set_multicast_list = set_multicast_list, | ||
165 | .ndo_validate_addr = eth_validate_addr, | ||
166 | .ndo_change_mtu = eth_change_mtu, | ||
167 | .ndo_set_mac_address = eth_mac_addr, | ||
168 | }; | ||
169 | |||
158 | static int __devinit ariadne_init_one(struct zorro_dev *z, | 170 | static int __devinit ariadne_init_one(struct zorro_dev *z, |
159 | const struct zorro_device_id *ent) | 171 | const struct zorro_device_id *ent) |
160 | { | 172 | { |
@@ -197,13 +209,8 @@ static int __devinit ariadne_init_one(struct zorro_dev *z, | |||
197 | dev->mem_start = ZTWO_VADDR(mem_start); | 209 | dev->mem_start = ZTWO_VADDR(mem_start); |
198 | dev->mem_end = dev->mem_start+ARIADNE_RAM_SIZE; | 210 | dev->mem_end = dev->mem_start+ARIADNE_RAM_SIZE; |
199 | 211 | ||
200 | dev->open = &ariadne_open; | 212 | dev->netdev_ops = &ariadne_netdev_ops; |
201 | dev->stop = &ariadne_close; | ||
202 | dev->hard_start_xmit = &ariadne_start_xmit; | ||
203 | dev->tx_timeout = &ariadne_tx_timeout; | ||
204 | dev->watchdog_timeo = 5*HZ; | 213 | dev->watchdog_timeo = 5*HZ; |
205 | dev->get_stats = &ariadne_get_stats; | ||
206 | dev->set_multicast_list = &set_multicast_list; | ||
207 | 214 | ||
208 | err = register_netdev(dev); | 215 | err = register_netdev(dev); |
209 | if (err) { | 216 | if (err) { |
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c index 4bc6901b3819..627bc75da17d 100644 --- a/drivers/net/arm/am79c961a.c +++ b/drivers/net/arm/am79c961a.c | |||
@@ -665,6 +665,20 @@ static void __init am79c961_banner(void) | |||
665 | if (net_debug && version_printed++ == 0) | 665 | if (net_debug && version_printed++ == 0) |
666 | printk(KERN_INFO "%s", version); | 666 | printk(KERN_INFO "%s", version); |
667 | } | 667 | } |
668 | static const struct net_device_ops am79c961_netdev_ops = { | ||
669 | .ndo_open = am79c961_open, | ||
670 | .ndo_stop = am79c961_close, | ||
671 | .ndo_start_xmit = am79c961_sendpacket, | ||
672 | .ndo_get_stats = am79c961_getstats, | ||
673 | .ndo_set_multicast_list = am79c961_setmulticastlist, | ||
674 | .ndo_tx_timeout = am79c961_timeout, | ||
675 | .ndo_validate_addr = eth_validate_addr, | ||
676 | .ndo_change_mtu = eth_change_mtu, | ||
677 | .ndo_set_mac_address = eth_mac_addr, | ||
678 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
679 | .ndo_poll_controller = am79c961_poll_controller, | ||
680 | #endif | ||
681 | }; | ||
668 | 682 | ||
669 | static int __init am79c961_probe(struct platform_device *pdev) | 683 | static int __init am79c961_probe(struct platform_device *pdev) |
670 | { | 684 | { |
@@ -732,15 +746,7 @@ static int __init am79c961_probe(struct platform_device *pdev) | |||
732 | if (am79c961_hw_init(dev)) | 746 | if (am79c961_hw_init(dev)) |
733 | goto release; | 747 | goto release; |
734 | 748 | ||
735 | dev->open = am79c961_open; | 749 | dev->netdev_ops = &am79c961_netdev_ops; |
736 | dev->stop = am79c961_close; | ||
737 | dev->hard_start_xmit = am79c961_sendpacket; | ||
738 | dev->get_stats = am79c961_getstats; | ||
739 | dev->set_multicast_list = am79c961_setmulticastlist; | ||
740 | dev->tx_timeout = am79c961_timeout; | ||
741 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
742 | dev->poll_controller = am79c961_poll_controller; | ||
743 | #endif | ||
744 | 750 | ||
745 | ret = register_netdev(dev); | 751 | ret = register_netdev(dev); |
746 | if (ret == 0) { | 752 | if (ret == 0) { |
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c index 442938d50380..7f4bc8ae5462 100644 --- a/drivers/net/arm/at91_ether.c +++ b/drivers/net/arm/at91_ether.c | |||
@@ -577,7 +577,7 @@ static void at91ether_sethashtable(struct net_device *dev) | |||
577 | /* | 577 | /* |
578 | * Enable/Disable promiscuous and multicast modes. | 578 | * Enable/Disable promiscuous and multicast modes. |
579 | */ | 579 | */ |
580 | static void at91ether_set_rx_mode(struct net_device *dev) | 580 | static void at91ether_set_multicast_list(struct net_device *dev) |
581 | { | 581 | { |
582 | unsigned long cfg; | 582 | unsigned long cfg; |
583 | 583 | ||
@@ -808,7 +808,7 @@ static int at91ether_close(struct net_device *dev) | |||
808 | /* | 808 | /* |
809 | * Transmit packet. | 809 | * Transmit packet. |
810 | */ | 810 | */ |
811 | static int at91ether_tx(struct sk_buff *skb, struct net_device *dev) | 811 | static int at91ether_start_xmit(struct sk_buff *skb, struct net_device *dev) |
812 | { | 812 | { |
813 | struct at91_private *lp = netdev_priv(dev); | 813 | struct at91_private *lp = netdev_priv(dev); |
814 | 814 | ||
@@ -828,7 +828,7 @@ static int at91ether_tx(struct sk_buff *skb, struct net_device *dev) | |||
828 | 828 | ||
829 | dev->trans_start = jiffies; | 829 | dev->trans_start = jiffies; |
830 | } else { | 830 | } else { |
831 | printk(KERN_ERR "at91_ether.c: at91ether_tx() called, but device is busy!\n"); | 831 | printk(KERN_ERR "at91_ether.c: at91ether_start_xmit() called, but device is busy!\n"); |
832 | return 1; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb) | 832 | return 1; /* if we return anything but zero, dev.c:1055 calls kfree_skb(skb) |
833 | on this skb, he also reports -ENETDOWN and printk's, so either | 833 | on this skb, he also reports -ENETDOWN and printk's, so either |
834 | we free and return(0) or don't free and return 1 */ | 834 | we free and return(0) or don't free and return 1 */ |
@@ -965,6 +965,21 @@ static void at91ether_poll_controller(struct net_device *dev) | |||
965 | } | 965 | } |
966 | #endif | 966 | #endif |
967 | 967 | ||
968 | static const struct net_device_ops at91ether_netdev_ops = { | ||
969 | .ndo_open = at91ether_open, | ||
970 | .ndo_stop = at91ether_close, | ||
971 | .ndo_start_xmit = at91ether_start_xmit, | ||
972 | .ndo_get_stats = at91ether_stats, | ||
973 | .ndo_set_multicast_list = at91ether_set_multicast_list, | ||
974 | .ndo_set_mac_address = set_mac_address, | ||
975 | .ndo_do_ioctl = at91ether_ioctl, | ||
976 | .ndo_validate_addr = eth_validate_addr, | ||
977 | .ndo_change_mtu = eth_change_mtu, | ||
978 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
979 | .ndo_poll_controller = at91ether_poll_controller, | ||
980 | #endif | ||
981 | }; | ||
982 | |||
968 | /* | 983 | /* |
969 | * Initialize the ethernet interface | 984 | * Initialize the ethernet interface |
970 | */ | 985 | */ |
@@ -1005,17 +1020,8 @@ static int __init at91ether_setup(unsigned long phy_type, unsigned short phy_add | |||
1005 | spin_lock_init(&lp->lock); | 1020 | spin_lock_init(&lp->lock); |
1006 | 1021 | ||
1007 | ether_setup(dev); | 1022 | ether_setup(dev); |
1008 | dev->open = at91ether_open; | 1023 | dev->netdev_ops = &at91ether_netdev_ops; |
1009 | dev->stop = at91ether_close; | ||
1010 | dev->hard_start_xmit = at91ether_tx; | ||
1011 | dev->get_stats = at91ether_stats; | ||
1012 | dev->set_multicast_list = at91ether_set_rx_mode; | ||
1013 | dev->set_mac_address = set_mac_address; | ||
1014 | dev->ethtool_ops = &at91ether_ethtool_ops; | 1024 | dev->ethtool_ops = &at91ether_ethtool_ops; |
1015 | dev->do_ioctl = at91ether_ioctl; | ||
1016 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1017 | dev->poll_controller = at91ether_poll_controller; | ||
1018 | #endif | ||
1019 | 1025 | ||
1020 | SET_NETDEV_DEV(dev, &pdev->dev); | 1026 | SET_NETDEV_DEV(dev, &pdev->dev); |
1021 | 1027 | ||
diff --git a/drivers/net/arm/ep93xx_eth.c b/drivers/net/arm/ep93xx_eth.c index cc7708775da0..41736772c1dd 100644 --- a/drivers/net/arm/ep93xx_eth.c +++ b/drivers/net/arm/ep93xx_eth.c | |||
@@ -770,7 +770,18 @@ static struct ethtool_ops ep93xx_ethtool_ops = { | |||
770 | .get_link = ep93xx_get_link, | 770 | .get_link = ep93xx_get_link, |
771 | }; | 771 | }; |
772 | 772 | ||
773 | struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) | 773 | static const struct net_device_ops ep93xx_netdev_ops = { |
774 | .ndo_open = ep93xx_open, | ||
775 | .ndo_stop = ep93xx_close, | ||
776 | .ndo_start_xmit = ep93xx_xmit, | ||
777 | .ndo_get_stats = ep93xx_get_stats, | ||
778 | .ndo_do_ioctl = ep93xx_ioctl, | ||
779 | .ndo_validate_addr = eth_validate_addr, | ||
780 | .ndo_change_mtu = eth_change_mtu, | ||
781 | .ndo_set_mac_address = eth_mac_addr, | ||
782 | }; | ||
783 | |||
784 | static struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) | ||
774 | { | 785 | { |
775 | struct net_device *dev; | 786 | struct net_device *dev; |
776 | 787 | ||
@@ -780,12 +791,8 @@ struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data) | |||
780 | 791 | ||
781 | memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN); | 792 | memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN); |
782 | 793 | ||
783 | dev->get_stats = ep93xx_get_stats; | ||
784 | dev->ethtool_ops = &ep93xx_ethtool_ops; | 794 | dev->ethtool_ops = &ep93xx_ethtool_ops; |
785 | dev->hard_start_xmit = ep93xx_xmit; | 795 | dev->netdev_ops = &ep93xx_netdev_ops; |
786 | dev->open = ep93xx_open; | ||
787 | dev->stop = ep93xx_close; | ||
788 | dev->do_ioctl = ep93xx_ioctl; | ||
789 | 796 | ||
790 | dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; | 797 | dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM; |
791 | 798 | ||
diff --git a/drivers/net/arm/ether1.c b/drivers/net/arm/ether1.c index e380de454463..edf770f639fa 100644 --- a/drivers/net/arm/ether1.c +++ b/drivers/net/arm/ether1.c | |||
@@ -991,6 +991,18 @@ static void __devinit ether1_banner(void) | |||
991 | printk(KERN_INFO "%s", version); | 991 | printk(KERN_INFO "%s", version); |
992 | } | 992 | } |
993 | 993 | ||
994 | static const struct net_device_ops ether1_netdev_ops = { | ||
995 | .ndo_open = ether1_open, | ||
996 | .ndo_stop = ether1_close, | ||
997 | .ndo_start_xmit = ether1_sendpacket, | ||
998 | .ndo_get_stats = ether1_getstats, | ||
999 | .ndo_set_multicast_list = ether1_setmulticastlist, | ||
1000 | .ndo_tx_timeout = ether1_timeout, | ||
1001 | .ndo_validate_addr = eth_validate_addr, | ||
1002 | .ndo_change_mtu = eth_change_mtu, | ||
1003 | .ndo_set_mac_address = eth_mac_addr, | ||
1004 | }; | ||
1005 | |||
994 | static int __devinit | 1006 | static int __devinit |
995 | ether1_probe(struct expansion_card *ec, const struct ecard_id *id) | 1007 | ether1_probe(struct expansion_card *ec, const struct ecard_id *id) |
996 | { | 1008 | { |
@@ -1031,12 +1043,7 @@ ether1_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
1031 | goto free; | 1043 | goto free; |
1032 | } | 1044 | } |
1033 | 1045 | ||
1034 | dev->open = ether1_open; | 1046 | dev->netdev_ops = ðer1_netdev_ops; |
1035 | dev->stop = ether1_close; | ||
1036 | dev->hard_start_xmit = ether1_sendpacket; | ||
1037 | dev->get_stats = ether1_getstats; | ||
1038 | dev->set_multicast_list = ether1_setmulticastlist; | ||
1039 | dev->tx_timeout = ether1_timeout; | ||
1040 | dev->watchdog_timeo = 5 * HZ / 100; | 1047 | dev->watchdog_timeo = 5 * HZ / 100; |
1041 | 1048 | ||
1042 | ret = register_netdev(dev); | 1049 | ret = register_netdev(dev); |
diff --git a/drivers/net/arm/ether3.c b/drivers/net/arm/ether3.c index 21a7bef12d3b..ec8a1ae1e887 100644 --- a/drivers/net/arm/ether3.c +++ b/drivers/net/arm/ether3.c | |||
@@ -770,6 +770,18 @@ static void __devinit ether3_banner(void) | |||
770 | printk(KERN_INFO "%s", version); | 770 | printk(KERN_INFO "%s", version); |
771 | } | 771 | } |
772 | 772 | ||
773 | static const struct net_device_ops ether3_netdev_ops = { | ||
774 | .ndo_open = ether3_open, | ||
775 | .ndo_stop = ether3_close, | ||
776 | .ndo_start_xmit = ether3_sendpacket, | ||
777 | .ndo_get_stats = ether3_getstats, | ||
778 | .ndo_set_multicast_list = ether3_setmulticastlist, | ||
779 | .ndo_tx_timeout = ether3_timeout, | ||
780 | .ndo_validate_addr = eth_validate_addr, | ||
781 | .ndo_change_mtu = eth_change_mtu, | ||
782 | .ndo_set_mac_address = eth_mac_addr, | ||
783 | }; | ||
784 | |||
773 | static int __devinit | 785 | static int __devinit |
774 | ether3_probe(struct expansion_card *ec, const struct ecard_id *id) | 786 | ether3_probe(struct expansion_card *ec, const struct ecard_id *id) |
775 | { | 787 | { |
@@ -846,12 +858,7 @@ ether3_probe(struct expansion_card *ec, const struct ecard_id *id) | |||
846 | goto free; | 858 | goto free; |
847 | } | 859 | } |
848 | 860 | ||
849 | dev->open = ether3_open; | 861 | dev->netdev_ops = ðer3_netdev_ops; |
850 | dev->stop = ether3_close; | ||
851 | dev->hard_start_xmit = ether3_sendpacket; | ||
852 | dev->get_stats = ether3_getstats; | ||
853 | dev->set_multicast_list = ether3_setmulticastlist; | ||
854 | dev->tx_timeout = ether3_timeout; | ||
855 | dev->watchdog_timeo = 5 * HZ / 100; | 862 | dev->watchdog_timeo = 5 * HZ / 100; |
856 | 863 | ||
857 | ret = register_netdev(dev); | 864 | ret = register_netdev(dev); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 99610f358c40..63369b6b14d4 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -2570,7 +2570,7 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave) | |||
2570 | 2570 | ||
2571 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { | 2571 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { |
2572 | if (!targets[i]) | 2572 | if (!targets[i]) |
2573 | continue; | 2573 | break; |
2574 | pr_debug("basa: target %x\n", targets[i]); | 2574 | pr_debug("basa: target %x\n", targets[i]); |
2575 | if (list_empty(&bond->vlan_list)) { | 2575 | if (list_empty(&bond->vlan_list)) { |
2576 | pr_debug("basa: empty vlan: arp_send\n"); | 2576 | pr_debug("basa: empty vlan: arp_send\n"); |
@@ -2677,7 +2677,6 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 | |||
2677 | int i; | 2677 | int i; |
2678 | __be32 *targets = bond->params.arp_targets; | 2678 | __be32 *targets = bond->params.arp_targets; |
2679 | 2679 | ||
2680 | targets = bond->params.arp_targets; | ||
2681 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { | 2680 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) { |
2682 | pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n", | 2681 | pr_debug("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n", |
2683 | &sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip)); | 2682 | &sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip)); |
@@ -3303,7 +3302,7 @@ static void bond_info_show_master(struct seq_file *seq) | |||
3303 | 3302 | ||
3304 | for(i = 0; (i < BOND_MAX_ARP_TARGETS) ;i++) { | 3303 | for(i = 0; (i < BOND_MAX_ARP_TARGETS) ;i++) { |
3305 | if (!bond->params.arp_targets[i]) | 3304 | if (!bond->params.arp_targets[i]) |
3306 | continue; | 3305 | break; |
3307 | if (printed) | 3306 | if (printed) |
3308 | seq_printf(seq, ","); | 3307 | seq_printf(seq, ","); |
3309 | seq_printf(seq, " %pI4", &bond->params.arp_targets[i]); | 3308 | seq_printf(seq, " %pI4", &bond->params.arp_targets[i]); |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 18cf4787874c..d28731535226 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -684,17 +684,15 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
684 | goto out; | 684 | goto out; |
685 | } | 685 | } |
686 | /* look for an empty slot to put the target in, and check for dupes */ | 686 | /* look for an empty slot to put the target in, and check for dupes */ |
687 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { | 687 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { |
688 | if (targets[i] == newtarget) { /* duplicate */ | 688 | if (targets[i] == newtarget) { /* duplicate */ |
689 | printk(KERN_ERR DRV_NAME | 689 | printk(KERN_ERR DRV_NAME |
690 | ": %s: ARP target %pI4 is already present\n", | 690 | ": %s: ARP target %pI4 is already present\n", |
691 | bond->dev->name, &newtarget); | 691 | bond->dev->name, &newtarget); |
692 | if (done) | ||
693 | targets[i] = 0; | ||
694 | ret = -EINVAL; | 692 | ret = -EINVAL; |
695 | goto out; | 693 | goto out; |
696 | } | 694 | } |
697 | if (targets[i] == 0 && !done) { | 695 | if (targets[i] == 0) { |
698 | printk(KERN_INFO DRV_NAME | 696 | printk(KERN_INFO DRV_NAME |
699 | ": %s: adding ARP target %pI4.\n", | 697 | ": %s: adding ARP target %pI4.\n", |
700 | bond->dev->name, &newtarget); | 698 | bond->dev->name, &newtarget); |
@@ -720,12 +718,16 @@ static ssize_t bonding_store_arp_targets(struct device *d, | |||
720 | goto out; | 718 | goto out; |
721 | } | 719 | } |
722 | 720 | ||
723 | for (i = 0; (i < BOND_MAX_ARP_TARGETS); i++) { | 721 | for (i = 0; (i < BOND_MAX_ARP_TARGETS) && !done; i++) { |
724 | if (targets[i] == newtarget) { | 722 | if (targets[i] == newtarget) { |
723 | int j; | ||
725 | printk(KERN_INFO DRV_NAME | 724 | printk(KERN_INFO DRV_NAME |
726 | ": %s: removing ARP target %pI4.\n", | 725 | ": %s: removing ARP target %pI4.\n", |
727 | bond->dev->name, &newtarget); | 726 | bond->dev->name, &newtarget); |
728 | targets[i] = 0; | 727 | for (j = i; (j < (BOND_MAX_ARP_TARGETS-1)) && targets[j+1]; j++) |
728 | targets[j] = targets[j+1]; | ||
729 | |||
730 | targets[j] = 0; | ||
729 | done = 1; | 731 | done = 1; |
730 | } | 732 | } |
731 | } | 733 | } |
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index d37465020bcc..11d5db16ed9c 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -3745,14 +3745,14 @@ static int nv_napi_poll(struct napi_struct *napi, int budget) | |||
3745 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); | 3745 | mod_timer(&np->nic_poll, jiffies + POLL_WAIT); |
3746 | } | 3746 | } |
3747 | spin_unlock_irqrestore(&np->lock, flags); | 3747 | spin_unlock_irqrestore(&np->lock, flags); |
3748 | __napi_complete(napi); | 3748 | napi_complete(napi); |
3749 | return rx_work; | 3749 | return rx_work; |
3750 | } | 3750 | } |
3751 | 3751 | ||
3752 | if (rx_work < budget) { | 3752 | if (rx_work < budget) { |
3753 | /* re-enable interrupts | 3753 | /* re-enable interrupts |
3754 | (msix not enabled in napi) */ | 3754 | (msix not enabled in napi) */ |
3755 | __napi_complete(napi); | 3755 | napi_complete(napi); |
3756 | 3756 | ||
3757 | writel(np->irqmask, base + NvRegIrqMask); | 3757 | writel(np->irqmask, base + NvRegIrqMask); |
3758 | } | 3758 | } |
diff --git a/drivers/net/fs_enet/fs_enet-main.c b/drivers/net/fs_enet/fs_enet-main.c index b037ce9857bf..a9cbc3191a2a 100644 --- a/drivers/net/fs_enet/fs_enet-main.c +++ b/drivers/net/fs_enet/fs_enet-main.c | |||
@@ -1019,6 +1019,22 @@ out_put_phy: | |||
1019 | #define IS_FEC(match) 0 | 1019 | #define IS_FEC(match) 0 |
1020 | #endif | 1020 | #endif |
1021 | 1021 | ||
1022 | static const struct net_device_ops fs_enet_netdev_ops = { | ||
1023 | .ndo_open = fs_enet_open, | ||
1024 | .ndo_stop = fs_enet_close, | ||
1025 | .ndo_get_stats = fs_enet_get_stats, | ||
1026 | .ndo_start_xmit = fs_enet_start_xmit, | ||
1027 | .ndo_tx_timeout = fs_timeout, | ||
1028 | .ndo_set_multicast_list = fs_set_multicast_list, | ||
1029 | .ndo_do_ioctl = fs_ioctl, | ||
1030 | .ndo_validate_addr = eth_validate_addr, | ||
1031 | .ndo_set_mac_address = eth_mac_addr, | ||
1032 | .ndo_change_mtu = eth_change_mtu, | ||
1033 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1034 | .ndo_poll_controller = fs_enet_netpoll, | ||
1035 | #endif | ||
1036 | }; | ||
1037 | |||
1022 | static int __devinit fs_enet_probe(struct of_device *ofdev, | 1038 | static int __devinit fs_enet_probe(struct of_device *ofdev, |
1023 | const struct of_device_id *match) | 1039 | const struct of_device_id *match) |
1024 | { | 1040 | { |
@@ -1093,22 +1109,13 @@ static int __devinit fs_enet_probe(struct of_device *ofdev, | |||
1093 | fep->tx_ring = fpi->tx_ring; | 1109 | fep->tx_ring = fpi->tx_ring; |
1094 | fep->rx_ring = fpi->rx_ring; | 1110 | fep->rx_ring = fpi->rx_ring; |
1095 | 1111 | ||
1096 | ndev->open = fs_enet_open; | 1112 | ndev->netdev_ops = &fs_enet_netdev_ops; |
1097 | ndev->hard_start_xmit = fs_enet_start_xmit; | ||
1098 | ndev->tx_timeout = fs_timeout; | ||
1099 | ndev->watchdog_timeo = 2 * HZ; | 1113 | ndev->watchdog_timeo = 2 * HZ; |
1100 | ndev->stop = fs_enet_close; | ||
1101 | ndev->get_stats = fs_enet_get_stats; | ||
1102 | ndev->set_multicast_list = fs_set_multicast_list; | ||
1103 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
1104 | ndev->poll_controller = fs_enet_netpoll; | ||
1105 | #endif | ||
1106 | if (fpi->use_napi) | 1114 | if (fpi->use_napi) |
1107 | netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi, | 1115 | netif_napi_add(ndev, &fep->napi, fs_enet_rx_napi, |
1108 | fpi->napi_weight); | 1116 | fpi->napi_weight); |
1109 | 1117 | ||
1110 | ndev->ethtool_ops = &fs_ethtool_ops; | 1118 | ndev->ethtool_ops = &fs_ethtool_ops; |
1111 | ndev->do_ioctl = fs_ioctl; | ||
1112 | 1119 | ||
1113 | init_timer(&fep->phy_timer_list); | 1120 | init_timer(&fep->phy_timer_list); |
1114 | 1121 | ||
diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index 77e4b5b52fc8..806533c831c7 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c | |||
@@ -2686,6 +2686,32 @@ static int __devinit emac_init_config(struct emac_instance *dev) | |||
2686 | return 0; | 2686 | return 0; |
2687 | } | 2687 | } |
2688 | 2688 | ||
2689 | static const struct net_device_ops emac_netdev_ops = { | ||
2690 | .ndo_open = emac_open, | ||
2691 | .ndo_stop = emac_close, | ||
2692 | .ndo_get_stats = emac_stats, | ||
2693 | .ndo_set_multicast_list = emac_set_multicast_list, | ||
2694 | .ndo_do_ioctl = emac_ioctl, | ||
2695 | .ndo_tx_timeout = emac_tx_timeout, | ||
2696 | .ndo_validate_addr = eth_validate_addr, | ||
2697 | .ndo_set_mac_address = eth_mac_addr, | ||
2698 | .ndo_start_xmit = emac_start_xmit, | ||
2699 | .ndo_change_mtu = eth_change_mtu, | ||
2700 | }; | ||
2701 | |||
2702 | static const struct net_device_ops emac_gige_netdev_ops = { | ||
2703 | .ndo_open = emac_open, | ||
2704 | .ndo_stop = emac_close, | ||
2705 | .ndo_get_stats = emac_stats, | ||
2706 | .ndo_set_multicast_list = emac_set_multicast_list, | ||
2707 | .ndo_do_ioctl = emac_ioctl, | ||
2708 | .ndo_tx_timeout = emac_tx_timeout, | ||
2709 | .ndo_validate_addr = eth_validate_addr, | ||
2710 | .ndo_set_mac_address = eth_mac_addr, | ||
2711 | .ndo_start_xmit = emac_start_xmit_sg, | ||
2712 | .ndo_change_mtu = emac_change_mtu, | ||
2713 | }; | ||
2714 | |||
2689 | static int __devinit emac_probe(struct of_device *ofdev, | 2715 | static int __devinit emac_probe(struct of_device *ofdev, |
2690 | const struct of_device_id *match) | 2716 | const struct of_device_id *match) |
2691 | { | 2717 | { |
@@ -2827,23 +2853,14 @@ static int __devinit emac_probe(struct of_device *ofdev, | |||
2827 | if (err != 0) | 2853 | if (err != 0) |
2828 | goto err_detach_tah; | 2854 | goto err_detach_tah; |
2829 | 2855 | ||
2830 | /* Fill in the driver function table */ | ||
2831 | ndev->open = &emac_open; | ||
2832 | if (dev->tah_dev) | 2856 | if (dev->tah_dev) |
2833 | ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; | 2857 | ndev->features |= NETIF_F_IP_CSUM | NETIF_F_SG; |
2834 | ndev->tx_timeout = &emac_tx_timeout; | ||
2835 | ndev->watchdog_timeo = 5 * HZ; | 2858 | ndev->watchdog_timeo = 5 * HZ; |
2836 | ndev->stop = &emac_close; | ||
2837 | ndev->get_stats = &emac_stats; | ||
2838 | ndev->set_multicast_list = &emac_set_multicast_list; | ||
2839 | ndev->do_ioctl = &emac_ioctl; | ||
2840 | if (emac_phy_supports_gige(dev->phy_mode)) { | 2859 | if (emac_phy_supports_gige(dev->phy_mode)) { |
2841 | ndev->hard_start_xmit = &emac_start_xmit_sg; | 2860 | ndev->netdev_ops = &emac_gige_netdev_ops; |
2842 | ndev->change_mtu = &emac_change_mtu; | ||
2843 | dev->commac.ops = &emac_commac_sg_ops; | 2861 | dev->commac.ops = &emac_commac_sg_ops; |
2844 | } else { | 2862 | } else |
2845 | ndev->hard_start_xmit = &emac_start_xmit; | 2863 | ndev->netdev_ops = &emac_netdev_ops; |
2846 | } | ||
2847 | SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); | 2864 | SET_ETHTOOL_OPS(ndev, &emac_ethtool_ops); |
2848 | 2865 | ||
2849 | netif_carrier_off(ndev); | 2866 | netif_carrier_off(ndev); |
diff --git a/drivers/net/igb/e1000_mac.c b/drivers/net/igb/e1000_mac.c index f4c315b5a900..472f3f124840 100644 --- a/drivers/net/igb/e1000_mac.c +++ b/drivers/net/igb/e1000_mac.c | |||
@@ -111,7 +111,7 @@ void igb_clear_vfta(struct e1000_hw *hw) | |||
111 | * Writes value at the given offset in the register array which stores | 111 | * Writes value at the given offset in the register array which stores |
112 | * the VLAN filter table. | 112 | * the VLAN filter table. |
113 | **/ | 113 | **/ |
114 | void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value) | 114 | static void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value) |
115 | { | 115 | { |
116 | array_wr32(E1000_VFTA, offset, value); | 116 | array_wr32(E1000_VFTA, offset, value); |
117 | wrfl(); | 117 | wrfl(); |
diff --git a/drivers/net/igb/e1000_mac.h b/drivers/net/igb/e1000_mac.h index a34de5269637..1d690b4c9ae4 100644 --- a/drivers/net/igb/e1000_mac.h +++ b/drivers/net/igb/e1000_mac.h | |||
@@ -66,7 +66,6 @@ void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index); | |||
66 | s32 igb_check_alt_mac_addr(struct e1000_hw *hw); | 66 | s32 igb_check_alt_mac_addr(struct e1000_hw *hw); |
67 | void igb_reset_adaptive(struct e1000_hw *hw); | 67 | void igb_reset_adaptive(struct e1000_hw *hw); |
68 | void igb_update_adaptive(struct e1000_hw *hw); | 68 | void igb_update_adaptive(struct e1000_hw *hw); |
69 | void igb_write_vfta(struct e1000_hw *hw, u32 offset, u32 value); | ||
70 | 69 | ||
71 | bool igb_enable_mng_pass_thru(struct e1000_hw *hw); | 70 | bool igb_enable_mng_pass_thru(struct e1000_hw *hw); |
72 | 71 | ||
diff --git a/drivers/net/igb/e1000_mbx.c b/drivers/net/igb/e1000_mbx.c index fe71c7ddaa05..840782fb5736 100644 --- a/drivers/net/igb/e1000_mbx.c +++ b/drivers/net/igb/e1000_mbx.c | |||
@@ -188,7 +188,7 @@ out: | |||
188 | * returns SUCCESS if it successfully received a message notification and | 188 | * returns SUCCESS if it successfully received a message notification and |
189 | * copied it into the receive buffer. | 189 | * copied it into the receive buffer. |
190 | **/ | 190 | **/ |
191 | s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) | 191 | static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) |
192 | { | 192 | { |
193 | struct e1000_mbx_info *mbx = &hw->mbx; | 193 | struct e1000_mbx_info *mbx = &hw->mbx; |
194 | s32 ret_val = -E1000_ERR_MBX; | 194 | s32 ret_val = -E1000_ERR_MBX; |
@@ -214,7 +214,7 @@ out: | |||
214 | * returns SUCCESS if it successfully copied message into the buffer and | 214 | * returns SUCCESS if it successfully copied message into the buffer and |
215 | * received an ack to that message within delay * timeout period | 215 | * received an ack to that message within delay * timeout period |
216 | **/ | 216 | **/ |
217 | s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) | 217 | static s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) |
218 | { | 218 | { |
219 | struct e1000_mbx_info *mbx = &hw->mbx; | 219 | struct e1000_mbx_info *mbx = &hw->mbx; |
220 | s32 ret_val = 0; | 220 | s32 ret_val = 0; |
@@ -232,19 +232,6 @@ out: | |||
232 | return ret_val; | 232 | return ret_val; |
233 | } | 233 | } |
234 | 234 | ||
235 | /** | ||
236 | * e1000_init_mbx_ops_generic - Initialize NVM function pointers | ||
237 | * @hw: pointer to the HW structure | ||
238 | * | ||
239 | * Setups up the function pointers to no-op functions | ||
240 | **/ | ||
241 | void e1000_init_mbx_ops_generic(struct e1000_hw *hw) | ||
242 | { | ||
243 | struct e1000_mbx_info *mbx = &hw->mbx; | ||
244 | mbx->ops.read_posted = igb_read_posted_mbx; | ||
245 | mbx->ops.write_posted = igb_write_posted_mbx; | ||
246 | } | ||
247 | |||
248 | static s32 igb_check_for_bit_pf(struct e1000_hw *hw, u32 mask) | 235 | static s32 igb_check_for_bit_pf(struct e1000_hw *hw, u32 mask) |
249 | { | 236 | { |
250 | u32 mbvficr = rd32(E1000_MBVFICR); | 237 | u32 mbvficr = rd32(E1000_MBVFICR); |
diff --git a/drivers/net/igb/e1000_mbx.h b/drivers/net/igb/e1000_mbx.h index 6ec9890a8f7a..ebc02ea3f198 100644 --- a/drivers/net/igb/e1000_mbx.h +++ b/drivers/net/igb/e1000_mbx.h | |||
@@ -67,8 +67,6 @@ | |||
67 | 67 | ||
68 | s32 igb_read_mbx(struct e1000_hw *, u32 *, u16, u16); | 68 | s32 igb_read_mbx(struct e1000_hw *, u32 *, u16, u16); |
69 | s32 igb_write_mbx(struct e1000_hw *, u32 *, u16, u16); | 69 | s32 igb_write_mbx(struct e1000_hw *, u32 *, u16, u16); |
70 | s32 igb_read_posted_mbx(struct e1000_hw *, u32 *, u16, u16); | ||
71 | s32 igb_write_posted_mbx(struct e1000_hw *, u32 *, u16, u16); | ||
72 | s32 igb_check_for_msg(struct e1000_hw *, u16); | 70 | s32 igb_check_for_msg(struct e1000_hw *, u16); |
73 | s32 igb_check_for_ack(struct e1000_hw *, u16); | 71 | s32 igb_check_for_ack(struct e1000_hw *, u16); |
74 | s32 igb_check_for_rst(struct e1000_hw *, u16); | 72 | s32 igb_check_for_rst(struct e1000_hw *, u16); |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index db7274e62228..08c801490c72 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -1261,25 +1261,32 @@ static int __devinit igb_probe(struct pci_dev *pdev, | |||
1261 | int i; | 1261 | int i; |
1262 | unsigned char mac_addr[ETH_ALEN]; | 1262 | unsigned char mac_addr[ETH_ALEN]; |
1263 | 1263 | ||
1264 | if (num_vfs) | 1264 | if (num_vfs) { |
1265 | adapter->vf_data = kcalloc(num_vfs, | 1265 | adapter->vf_data = kcalloc(num_vfs, |
1266 | sizeof(struct vf_data_storage), | 1266 | sizeof(struct vf_data_storage), |
1267 | GFP_KERNEL); | 1267 | GFP_KERNEL); |
1268 | if (!adapter->vf_data) { | 1268 | if (!adapter->vf_data) { |
1269 | dev_err(&pdev->dev, "Could not allocate VF private " | 1269 | dev_err(&pdev->dev, |
1270 | "data - IOV enable failed\n"); | 1270 | "Could not allocate VF private data - " |
1271 | } else { | 1271 | "IOV enable failed\n"); |
1272 | err = pci_enable_sriov(pdev, num_vfs); | ||
1273 | if (!err) { | ||
1274 | adapter->vfs_allocated_count = num_vfs; | ||
1275 | dev_info(&pdev->dev, "%d vfs allocated\n", num_vfs); | ||
1276 | for (i = 0; i < adapter->vfs_allocated_count; i++) { | ||
1277 | random_ether_addr(mac_addr); | ||
1278 | igb_set_vf_mac(adapter, i, mac_addr); | ||
1279 | } | ||
1280 | } else { | 1272 | } else { |
1281 | kfree(adapter->vf_data); | 1273 | err = pci_enable_sriov(pdev, num_vfs); |
1282 | adapter->vf_data = NULL; | 1274 | if (!err) { |
1275 | adapter->vfs_allocated_count = num_vfs; | ||
1276 | dev_info(&pdev->dev, | ||
1277 | "%d vfs allocated\n", | ||
1278 | num_vfs); | ||
1279 | for (i = 0; | ||
1280 | i < adapter->vfs_allocated_count; | ||
1281 | i++) { | ||
1282 | random_ether_addr(mac_addr); | ||
1283 | igb_set_vf_mac(adapter, i, | ||
1284 | mac_addr); | ||
1285 | } | ||
1286 | } else { | ||
1287 | kfree(adapter->vf_data); | ||
1288 | adapter->vf_data = NULL; | ||
1289 | } | ||
1283 | } | 1290 | } |
1284 | } | 1291 | } |
1285 | } | 1292 | } |
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h index 936ed2a9435f..4bff35e46871 100644 --- a/drivers/net/igbvf/igbvf.h +++ b/drivers/net/igbvf/igbvf.h | |||
@@ -321,14 +321,11 @@ extern void igbvf_set_ethtool_ops(struct net_device *); | |||
321 | extern int igbvf_up(struct igbvf_adapter *); | 321 | extern int igbvf_up(struct igbvf_adapter *); |
322 | extern void igbvf_down(struct igbvf_adapter *); | 322 | extern void igbvf_down(struct igbvf_adapter *); |
323 | extern void igbvf_reinit_locked(struct igbvf_adapter *); | 323 | extern void igbvf_reinit_locked(struct igbvf_adapter *); |
324 | extern void igbvf_reset(struct igbvf_adapter *); | ||
325 | extern int igbvf_setup_rx_resources(struct igbvf_adapter *, struct igbvf_ring *); | 324 | extern int igbvf_setup_rx_resources(struct igbvf_adapter *, struct igbvf_ring *); |
326 | extern int igbvf_setup_tx_resources(struct igbvf_adapter *, struct igbvf_ring *); | 325 | extern int igbvf_setup_tx_resources(struct igbvf_adapter *, struct igbvf_ring *); |
327 | extern void igbvf_free_rx_resources(struct igbvf_ring *); | 326 | extern void igbvf_free_rx_resources(struct igbvf_ring *); |
328 | extern void igbvf_free_tx_resources(struct igbvf_ring *); | 327 | extern void igbvf_free_tx_resources(struct igbvf_ring *); |
329 | extern void igbvf_update_stats(struct igbvf_adapter *); | 328 | extern void igbvf_update_stats(struct igbvf_adapter *); |
330 | extern void igbvf_set_interrupt_capability(struct igbvf_adapter *); | ||
331 | extern void igbvf_reset_interrupt_capability(struct igbvf_adapter *); | ||
332 | 329 | ||
333 | extern unsigned int copybreak; | 330 | extern unsigned int copybreak; |
334 | 331 | ||
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index c5648420dedf..b774666ad3cf 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -52,6 +52,9 @@ static const char igbvf_driver_string[] = | |||
52 | static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation."; | 52 | static const char igbvf_copyright[] = "Copyright (c) 2009 Intel Corporation."; |
53 | 53 | ||
54 | static int igbvf_poll(struct napi_struct *napi, int budget); | 54 | static int igbvf_poll(struct napi_struct *napi, int budget); |
55 | static void igbvf_reset(struct igbvf_adapter *); | ||
56 | static void igbvf_set_interrupt_capability(struct igbvf_adapter *); | ||
57 | static void igbvf_reset_interrupt_capability(struct igbvf_adapter *); | ||
55 | 58 | ||
56 | static struct igbvf_info igbvf_vf_info = { | 59 | static struct igbvf_info igbvf_vf_info = { |
57 | .mac = e1000_vfadapt, | 60 | .mac = e1000_vfadapt, |
@@ -990,7 +993,7 @@ static void igbvf_configure_msix(struct igbvf_adapter *adapter) | |||
990 | e1e_flush(); | 993 | e1e_flush(); |
991 | } | 994 | } |
992 | 995 | ||
993 | void igbvf_reset_interrupt_capability(struct igbvf_adapter *adapter) | 996 | static void igbvf_reset_interrupt_capability(struct igbvf_adapter *adapter) |
994 | { | 997 | { |
995 | if (adapter->msix_entries) { | 998 | if (adapter->msix_entries) { |
996 | pci_disable_msix(adapter->pdev); | 999 | pci_disable_msix(adapter->pdev); |
@@ -1005,7 +1008,7 @@ void igbvf_reset_interrupt_capability(struct igbvf_adapter *adapter) | |||
1005 | * Attempt to configure interrupts using the best available | 1008 | * Attempt to configure interrupts using the best available |
1006 | * capabilities of the hardware and kernel. | 1009 | * capabilities of the hardware and kernel. |
1007 | **/ | 1010 | **/ |
1008 | void igbvf_set_interrupt_capability(struct igbvf_adapter *adapter) | 1011 | static void igbvf_set_interrupt_capability(struct igbvf_adapter *adapter) |
1009 | { | 1012 | { |
1010 | int err = -ENOMEM; | 1013 | int err = -ENOMEM; |
1011 | int i; | 1014 | int i; |
@@ -1447,7 +1450,7 @@ static void igbvf_configure(struct igbvf_adapter *adapter) | |||
1447 | * set/changed during runtime. After reset the device needs to be | 1450 | * set/changed during runtime. After reset the device needs to be |
1448 | * properly configured for Rx, Tx etc. | 1451 | * properly configured for Rx, Tx etc. |
1449 | */ | 1452 | */ |
1450 | void igbvf_reset(struct igbvf_adapter *adapter) | 1453 | static void igbvf_reset(struct igbvf_adapter *adapter) |
1451 | { | 1454 | { |
1452 | struct e1000_mac_info *mac = &adapter->hw.mac; | 1455 | struct e1000_mac_info *mac = &adapter->hw.mac; |
1453 | struct net_device *netdev = adapter->netdev; | 1456 | struct net_device *netdev = adapter->netdev; |
diff --git a/drivers/net/igbvf/vf.c b/drivers/net/igbvf/vf.c index aa246c93279d..2a4faf9ade69 100644 --- a/drivers/net/igbvf/vf.c +++ b/drivers/net/igbvf/vf.c | |||
@@ -44,7 +44,7 @@ static s32 e1000_set_vfta_vf(struct e1000_hw *, u16, bool); | |||
44 | * e1000_init_mac_params_vf - Inits MAC params | 44 | * e1000_init_mac_params_vf - Inits MAC params |
45 | * @hw: pointer to the HW structure | 45 | * @hw: pointer to the HW structure |
46 | **/ | 46 | **/ |
47 | s32 e1000_init_mac_params_vf(struct e1000_hw *hw) | 47 | static s32 e1000_init_mac_params_vf(struct e1000_hw *hw) |
48 | { | 48 | { |
49 | struct e1000_mac_info *mac = &hw->mac; | 49 | struct e1000_mac_info *mac = &hw->mac; |
50 | 50 | ||
diff --git a/drivers/net/igbvf/vf.h b/drivers/net/igbvf/vf.h index ec07228f9478..1e8ce3741a67 100644 --- a/drivers/net/igbvf/vf.h +++ b/drivers/net/igbvf/vf.h | |||
@@ -259,7 +259,6 @@ struct e1000_hw { | |||
259 | /* These functions must be implemented by drivers */ | 259 | /* These functions must be implemented by drivers */ |
260 | void e1000_rlpml_set_vf(struct e1000_hw *, u16); | 260 | void e1000_rlpml_set_vf(struct e1000_hw *, u16); |
261 | void e1000_init_function_pointers_vf(struct e1000_hw *hw); | 261 | void e1000_init_function_pointers_vf(struct e1000_hw *hw); |
262 | s32 e1000_init_mac_params_vf(struct e1000_hw *hw); | ||
263 | 262 | ||
264 | 263 | ||
265 | #endif /* _E1000_VF_H_ */ | 264 | #endif /* _E1000_VF_H_ */ |
diff --git a/drivers/net/ixgbe/ixgbe_82598.c b/drivers/net/ixgbe/ixgbe_82598.c index de4db0dc7879..4791238c3f6e 100644 --- a/drivers/net/ixgbe/ixgbe_82598.c +++ b/drivers/net/ixgbe/ixgbe_82598.c | |||
@@ -885,61 +885,6 @@ static s32 ixgbe_clear_vfta_82598(struct ixgbe_hw *hw) | |||
885 | } | 885 | } |
886 | 886 | ||
887 | /** | 887 | /** |
888 | * ixgbe_blink_led_start_82598 - Blink LED based on index. | ||
889 | * @hw: pointer to hardware structure | ||
890 | * @index: led number to blink | ||
891 | **/ | ||
892 | static s32 ixgbe_blink_led_start_82598(struct ixgbe_hw *hw, u32 index) | ||
893 | { | ||
894 | ixgbe_link_speed speed = 0; | ||
895 | bool link_up = 0; | ||
896 | u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); | ||
897 | u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); | ||
898 | |||
899 | /* | ||
900 | * Link must be up to auto-blink the LEDs on the 82598EB MAC; | ||
901 | * force it if link is down. | ||
902 | */ | ||
903 | hw->mac.ops.check_link(hw, &speed, &link_up, false); | ||
904 | |||
905 | if (!link_up) { | ||
906 | autoc_reg |= IXGBE_AUTOC_FLU; | ||
907 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); | ||
908 | msleep(10); | ||
909 | } | ||
910 | |||
911 | led_reg &= ~IXGBE_LED_MODE_MASK(index); | ||
912 | led_reg |= IXGBE_LED_BLINK(index); | ||
913 | IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg); | ||
914 | IXGBE_WRITE_FLUSH(hw); | ||
915 | |||
916 | return 0; | ||
917 | } | ||
918 | |||
919 | /** | ||
920 | * ixgbe_blink_led_stop_82598 - Stop blinking LED based on index. | ||
921 | * @hw: pointer to hardware structure | ||
922 | * @index: led number to stop blinking | ||
923 | **/ | ||
924 | static s32 ixgbe_blink_led_stop_82598(struct ixgbe_hw *hw, u32 index) | ||
925 | { | ||
926 | u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); | ||
927 | u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); | ||
928 | |||
929 | autoc_reg &= ~IXGBE_AUTOC_FLU; | ||
930 | autoc_reg |= IXGBE_AUTOC_AN_RESTART; | ||
931 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); | ||
932 | |||
933 | led_reg &= ~IXGBE_LED_MODE_MASK(index); | ||
934 | led_reg &= ~IXGBE_LED_BLINK(index); | ||
935 | led_reg |= IXGBE_LED_LINK_ACTIVE << IXGBE_LED_MODE_SHIFT(index); | ||
936 | IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg); | ||
937 | IXGBE_WRITE_FLUSH(hw); | ||
938 | |||
939 | return 0; | ||
940 | } | ||
941 | |||
942 | /** | ||
943 | * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register | 888 | * ixgbe_read_analog_reg8_82598 - Reads 8 bit Atlas analog register |
944 | * @hw: pointer to hardware structure | 889 | * @hw: pointer to hardware structure |
945 | * @reg: analog register to read | 890 | * @reg: analog register to read |
@@ -1128,8 +1073,8 @@ static struct ixgbe_mac_operations mac_ops_82598 = { | |||
1128 | .get_link_capabilities = &ixgbe_get_link_capabilities_82598, | 1073 | .get_link_capabilities = &ixgbe_get_link_capabilities_82598, |
1129 | .led_on = &ixgbe_led_on_generic, | 1074 | .led_on = &ixgbe_led_on_generic, |
1130 | .led_off = &ixgbe_led_off_generic, | 1075 | .led_off = &ixgbe_led_off_generic, |
1131 | .blink_led_start = &ixgbe_blink_led_start_82598, | 1076 | .blink_led_start = &ixgbe_blink_led_start_generic, |
1132 | .blink_led_stop = &ixgbe_blink_led_stop_82598, | 1077 | .blink_led_stop = &ixgbe_blink_led_stop_generic, |
1133 | .set_rar = &ixgbe_set_rar_generic, | 1078 | .set_rar = &ixgbe_set_rar_generic, |
1134 | .clear_rar = &ixgbe_clear_rar_generic, | 1079 | .clear_rar = &ixgbe_clear_rar_generic, |
1135 | .set_vmdq = &ixgbe_set_vmdq_82598, | 1080 | .set_vmdq = &ixgbe_set_vmdq_82598, |
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index beae7e012609..29771fbaa42d 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -68,8 +68,6 @@ s32 ixgbe_clear_vmdq_82599(struct ixgbe_hw *hw, u32 rar, u32 vmdq); | |||
68 | s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan, | 68 | s32 ixgbe_set_vfta_82599(struct ixgbe_hw *hw, u32 vlan, |
69 | u32 vind, bool vlan_on); | 69 | u32 vind, bool vlan_on); |
70 | s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw); | 70 | s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw); |
71 | s32 ixgbe_blink_led_stop_82599(struct ixgbe_hw *hw, u32 index); | ||
72 | s32 ixgbe_blink_led_start_82599(struct ixgbe_hw *hw, u32 index); | ||
73 | s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw); | 71 | s32 ixgbe_init_uta_tables_82599(struct ixgbe_hw *hw); |
74 | s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); | 72 | s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val); |
75 | s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); | 73 | s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val); |
@@ -991,40 +989,6 @@ s32 ixgbe_clear_vfta_82599(struct ixgbe_hw *hw) | |||
991 | } | 989 | } |
992 | 990 | ||
993 | /** | 991 | /** |
994 | * ixgbe_blink_led_start_82599 - Blink LED based on index. | ||
995 | * @hw: pointer to hardware structure | ||
996 | * @index: led number to blink | ||
997 | **/ | ||
998 | s32 ixgbe_blink_led_start_82599(struct ixgbe_hw *hw, u32 index) | ||
999 | { | ||
1000 | u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); | ||
1001 | |||
1002 | led_reg &= ~IXGBE_LED_MODE_MASK(index); | ||
1003 | led_reg |= IXGBE_LED_BLINK(index); | ||
1004 | IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg); | ||
1005 | IXGBE_WRITE_FLUSH(hw); | ||
1006 | |||
1007 | return 0; | ||
1008 | } | ||
1009 | |||
1010 | /** | ||
1011 | * ixgbe_blink_led_stop_82599 - Stop blinking LED based on index. | ||
1012 | * @hw: pointer to hardware structure | ||
1013 | * @index: led number to stop blinking | ||
1014 | **/ | ||
1015 | s32 ixgbe_blink_led_stop_82599(struct ixgbe_hw *hw, u32 index) | ||
1016 | { | ||
1017 | u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); | ||
1018 | |||
1019 | led_reg &= ~IXGBE_LED_MODE_MASK(index); | ||
1020 | led_reg &= ~IXGBE_LED_BLINK(index); | ||
1021 | IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg); | ||
1022 | IXGBE_WRITE_FLUSH(hw); | ||
1023 | |||
1024 | return 0; | ||
1025 | } | ||
1026 | |||
1027 | /** | ||
1028 | * ixgbe_init_uta_tables_82599 - Initialize the Unicast Table Array | 992 | * ixgbe_init_uta_tables_82599 - Initialize the Unicast Table Array |
1029 | * @hw: pointer to hardware structure | 993 | * @hw: pointer to hardware structure |
1030 | **/ | 994 | **/ |
@@ -1243,8 +1207,8 @@ static struct ixgbe_mac_operations mac_ops_82599 = { | |||
1243 | .get_link_capabilities = &ixgbe_get_link_capabilities_82599, | 1207 | .get_link_capabilities = &ixgbe_get_link_capabilities_82599, |
1244 | .led_on = &ixgbe_led_on_generic, | 1208 | .led_on = &ixgbe_led_on_generic, |
1245 | .led_off = &ixgbe_led_off_generic, | 1209 | .led_off = &ixgbe_led_off_generic, |
1246 | .blink_led_start = &ixgbe_blink_led_start_82599, | 1210 | .blink_led_start = &ixgbe_blink_led_start_generic, |
1247 | .blink_led_stop = &ixgbe_blink_led_stop_82599, | 1211 | .blink_led_stop = &ixgbe_blink_led_stop_generic, |
1248 | .set_rar = &ixgbe_set_rar_generic, | 1212 | .set_rar = &ixgbe_set_rar_generic, |
1249 | .clear_rar = &ixgbe_clear_rar_generic, | 1213 | .clear_rar = &ixgbe_clear_rar_generic, |
1250 | .set_vmdq = &ixgbe_set_vmdq_82599, | 1214 | .set_vmdq = &ixgbe_set_vmdq_82599, |
diff --git a/drivers/net/ixgbe/ixgbe_common.c b/drivers/net/ixgbe/ixgbe_common.c index 63ab6671d08e..5567519676d5 100644 --- a/drivers/net/ixgbe/ixgbe_common.c +++ b/drivers/net/ixgbe/ixgbe_common.c | |||
@@ -2071,3 +2071,58 @@ s32 ixgbe_enable_rx_dma_generic(struct ixgbe_hw *hw, u32 regval) | |||
2071 | 2071 | ||
2072 | return 0; | 2072 | return 0; |
2073 | } | 2073 | } |
2074 | |||
2075 | /** | ||
2076 | * ixgbe_blink_led_start_generic - Blink LED based on index. | ||
2077 | * @hw: pointer to hardware structure | ||
2078 | * @index: led number to blink | ||
2079 | **/ | ||
2080 | s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index) | ||
2081 | { | ||
2082 | ixgbe_link_speed speed = 0; | ||
2083 | bool link_up = 0; | ||
2084 | u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); | ||
2085 | u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); | ||
2086 | |||
2087 | /* | ||
2088 | * Link must be up to auto-blink the LEDs; | ||
2089 | * Force it if link is down. | ||
2090 | */ | ||
2091 | hw->mac.ops.check_link(hw, &speed, &link_up, false); | ||
2092 | |||
2093 | if (!link_up) { | ||
2094 | autoc_reg |= IXGBE_AUTOC_FLU; | ||
2095 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); | ||
2096 | msleep(10); | ||
2097 | } | ||
2098 | |||
2099 | led_reg &= ~IXGBE_LED_MODE_MASK(index); | ||
2100 | led_reg |= IXGBE_LED_BLINK(index); | ||
2101 | IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg); | ||
2102 | IXGBE_WRITE_FLUSH(hw); | ||
2103 | |||
2104 | return 0; | ||
2105 | } | ||
2106 | |||
2107 | /** | ||
2108 | * ixgbe_blink_led_stop_generic - Stop blinking LED based on index. | ||
2109 | * @hw: pointer to hardware structure | ||
2110 | * @index: led number to stop blinking | ||
2111 | **/ | ||
2112 | s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index) | ||
2113 | { | ||
2114 | u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC); | ||
2115 | u32 led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); | ||
2116 | |||
2117 | autoc_reg &= ~IXGBE_AUTOC_FLU; | ||
2118 | autoc_reg |= IXGBE_AUTOC_AN_RESTART; | ||
2119 | IXGBE_WRITE_REG(hw, IXGBE_AUTOC, autoc_reg); | ||
2120 | |||
2121 | led_reg &= ~IXGBE_LED_MODE_MASK(index); | ||
2122 | led_reg &= ~IXGBE_LED_BLINK(index); | ||
2123 | led_reg |= IXGBE_LED_LINK_ACTIVE << IXGBE_LED_MODE_SHIFT(index); | ||
2124 | IXGBE_WRITE_REG(hw, IXGBE_LEDCTL, led_reg); | ||
2125 | IXGBE_WRITE_FLUSH(hw); | ||
2126 | |||
2127 | return 0; | ||
2128 | } | ||
diff --git a/drivers/net/ixgbe/ixgbe_common.h b/drivers/net/ixgbe/ixgbe_common.h index 24f73e719c3f..dd260890ad0a 100644 --- a/drivers/net/ixgbe/ixgbe_common.h +++ b/drivers/net/ixgbe/ixgbe_common.h | |||
@@ -76,6 +76,9 @@ s32 ixgbe_disable_pcie_master(struct ixgbe_hw *hw); | |||
76 | s32 ixgbe_read_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 *val); | 76 | s32 ixgbe_read_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 *val); |
77 | s32 ixgbe_write_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 val); | 77 | s32 ixgbe_write_analog_reg8_generic(struct ixgbe_hw *hw, u32 reg, u8 val); |
78 | 78 | ||
79 | s32 ixgbe_blink_led_start_generic(struct ixgbe_hw *hw, u32 index); | ||
80 | s32 ixgbe_blink_led_stop_generic(struct ixgbe_hw *hw, u32 index); | ||
81 | |||
79 | #define IXGBE_WRITE_REG(a, reg, value) writel((value), ((a)->hw_addr + (reg))) | 82 | #define IXGBE_WRITE_REG(a, reg, value) writel((value), ((a)->hw_addr + (reg))) |
80 | 83 | ||
81 | #ifndef writeq | 84 | #ifndef writeq |
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index aafc120f164e..f0a20facc650 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -943,6 +943,24 @@ static void ixgbe_get_strings(struct net_device *netdev, u32 stringset, | |||
943 | } | 943 | } |
944 | 944 | ||
945 | 945 | ||
946 | static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter, | ||
947 | struct ethtool_wolinfo *wol) | ||
948 | { | ||
949 | struct ixgbe_hw *hw = &adapter->hw; | ||
950 | int retval = 1; | ||
951 | |||
952 | switch(hw->device_id) { | ||
953 | case IXGBE_DEV_ID_82599_KX4: | ||
954 | retval = 0; | ||
955 | break; | ||
956 | default: | ||
957 | wol->supported = 0; | ||
958 | retval = 0; | ||
959 | } | ||
960 | |||
961 | return retval; | ||
962 | } | ||
963 | |||
946 | static void ixgbe_get_wol(struct net_device *netdev, | 964 | static void ixgbe_get_wol(struct net_device *netdev, |
947 | struct ethtool_wolinfo *wol) | 965 | struct ethtool_wolinfo *wol) |
948 | { | 966 | { |
@@ -952,7 +970,8 @@ static void ixgbe_get_wol(struct net_device *netdev, | |||
952 | WAKE_BCAST | WAKE_MAGIC; | 970 | WAKE_BCAST | WAKE_MAGIC; |
953 | wol->wolopts = 0; | 971 | wol->wolopts = 0; |
954 | 972 | ||
955 | if (!device_can_wakeup(&adapter->pdev->dev)) | 973 | if (ixgbe_wol_exclusion(adapter, wol) || |
974 | !device_can_wakeup(&adapter->pdev->dev)) | ||
956 | return; | 975 | return; |
957 | 976 | ||
958 | if (adapter->wol & IXGBE_WUFC_EX) | 977 | if (adapter->wol & IXGBE_WUFC_EX) |
@@ -974,6 +993,9 @@ static int ixgbe_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol) | |||
974 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) | 993 | if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE)) |
975 | return -EOPNOTSUPP; | 994 | return -EOPNOTSUPP; |
976 | 995 | ||
996 | if (ixgbe_wol_exclusion(adapter, wol)) | ||
997 | return wol->wolopts ? -EOPNOTSUPP : 0; | ||
998 | |||
977 | adapter->wol = 0; | 999 | adapter->wol = 0; |
978 | 1000 | ||
979 | if (wol->wolopts & WAKE_UCAST) | 1001 | if (wol->wolopts & WAKE_UCAST) |
diff --git a/drivers/net/phy/fixed.c b/drivers/net/phy/fixed.c index cf24cc34debe..e7070515d2e3 100644 --- a/drivers/net/phy/fixed.c +++ b/drivers/net/phy/fixed.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/mii.h> | 19 | #include <linux/mii.h> |
20 | #include <linux/phy.h> | 20 | #include <linux/phy.h> |
21 | #include <linux/phy_fixed.h> | 21 | #include <linux/phy_fixed.h> |
22 | #include <linux/err.h> | ||
22 | 23 | ||
23 | #define MII_REGS_NUM 29 | 24 | #define MII_REGS_NUM 29 |
24 | 25 | ||
@@ -207,8 +208,8 @@ static int __init fixed_mdio_bus_init(void) | |||
207 | int ret; | 208 | int ret; |
208 | 209 | ||
209 | pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0); | 210 | pdev = platform_device_register_simple("Fixed MDIO bus", 0, NULL, 0); |
210 | if (!pdev) { | 211 | if (IS_ERR(pdev)) { |
211 | ret = -ENOMEM; | 212 | ret = PTR_ERR(pdev); |
212 | goto err_pdev; | 213 | goto err_pdev; |
213 | } | 214 | } |
214 | 215 | ||
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 6a736dda3ee2..7a837c465960 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -12443,8 +12443,13 @@ static int __devinit tg3_get_device_address(struct tg3 *tp) | |||
12443 | /* Next, try NVRAM. */ | 12443 | /* Next, try NVRAM. */ |
12444 | if (!tg3_nvram_read_be32(tp, mac_offset + 0, &hi) && | 12444 | if (!tg3_nvram_read_be32(tp, mac_offset + 0, &hi) && |
12445 | !tg3_nvram_read_be32(tp, mac_offset + 4, &lo)) { | 12445 | !tg3_nvram_read_be32(tp, mac_offset + 4, &lo)) { |
12446 | memcpy(&dev->dev_addr[0], ((char *)&hi) + 2, 2); | 12446 | dev->dev_addr[0] = ((hi >> 16) & 0xff); |
12447 | memcpy(&dev->dev_addr[2], (char *)&lo, sizeof(lo)); | 12447 | dev->dev_addr[1] = ((hi >> 24) & 0xff); |
12448 | dev->dev_addr[2] = ((lo >> 0) & 0xff); | ||
12449 | dev->dev_addr[3] = ((lo >> 8) & 0xff); | ||
12450 | dev->dev_addr[4] = ((lo >> 16) & 0xff); | ||
12451 | dev->dev_addr[5] = ((lo >> 24) & 0xff); | ||
12452 | |||
12448 | } | 12453 | } |
12449 | /* Finally just fetch it out of the MAC control regs. */ | 12454 | /* Finally just fetch it out of the MAC control regs. */ |
12450 | else { | 12455 | else { |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index fb53ef872df3..754a4b182c1d 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -377,7 +377,7 @@ static void velocity_print_info(struct velocity_info *vptr); | |||
377 | static int velocity_open(struct net_device *dev); | 377 | static int velocity_open(struct net_device *dev); |
378 | static int velocity_change_mtu(struct net_device *dev, int mtu); | 378 | static int velocity_change_mtu(struct net_device *dev, int mtu); |
379 | static int velocity_xmit(struct sk_buff *skb, struct net_device *dev); | 379 | static int velocity_xmit(struct sk_buff *skb, struct net_device *dev); |
380 | static int velocity_intr(int irq, void *dev_instance); | 380 | static irqreturn_t velocity_intr(int irq, void *dev_instance); |
381 | static void velocity_set_multi(struct net_device *dev); | 381 | static void velocity_set_multi(struct net_device *dev); |
382 | static struct net_device_stats *velocity_get_stats(struct net_device *dev); | 382 | static struct net_device_stats *velocity_get_stats(struct net_device *dev); |
383 | static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | 383 | static int velocity_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); |
@@ -2215,7 +2215,7 @@ out: | |||
2215 | * efficiently as possible. | 2215 | * efficiently as possible. |
2216 | */ | 2216 | */ |
2217 | 2217 | ||
2218 | static int velocity_intr(int irq, void *dev_instance) | 2218 | static irqreturn_t velocity_intr(int irq, void *dev_instance) |
2219 | { | 2219 | { |
2220 | struct net_device *dev = dev_instance; | 2220 | struct net_device *dev = dev_instance; |
2221 | struct velocity_info *vptr = netdev_priv(dev); | 2221 | struct velocity_info *vptr = netdev_priv(dev); |
diff --git a/include/net/udp.h b/include/net/udp.h index 93dbe294d459..90e6ce56be65 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -124,8 +124,6 @@ static inline void udp_lib_close(struct sock *sk, long timeout) | |||
124 | sk_common_release(sk); | 124 | sk_common_release(sk); |
125 | } | 125 | } |
126 | 126 | ||
127 | extern int ipv4_rcv_saddr_equal(const struct sock *sk1, | ||
128 | const struct sock *sk2); | ||
129 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, | 127 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, |
130 | int (*)(const struct sock*,const struct sock*)); | 128 | int (*)(const struct sock*,const struct sock*)); |
131 | 129 | ||
diff --git a/net/802/tr.c b/net/802/tr.c index e7eb13084d71..e874447ad144 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -561,6 +561,9 @@ static int rif_seq_show(struct seq_file *seq, void *v) | |||
561 | } | 561 | } |
562 | seq_putc(seq, '\n'); | 562 | seq_putc(seq, '\n'); |
563 | } | 563 | } |
564 | |||
565 | if (dev) | ||
566 | dev_put(dev); | ||
564 | } | 567 | } |
565 | return 0; | 568 | return 0; |
566 | } | 569 | } |
diff --git a/net/core/dev.c b/net/core/dev.c index 91d792d17e09..ea8eb2214b09 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -1430,7 +1430,7 @@ void netif_device_detach(struct net_device *dev) | |||
1430 | { | 1430 | { |
1431 | if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) && | 1431 | if (test_and_clear_bit(__LINK_STATE_PRESENT, &dev->state) && |
1432 | netif_running(dev)) { | 1432 | netif_running(dev)) { |
1433 | netif_stop_queue(dev); | 1433 | netif_tx_stop_all_queues(dev); |
1434 | } | 1434 | } |
1435 | } | 1435 | } |
1436 | EXPORT_SYMBOL(netif_device_detach); | 1436 | EXPORT_SYMBOL(netif_device_detach); |
@@ -1445,7 +1445,7 @@ void netif_device_attach(struct net_device *dev) | |||
1445 | { | 1445 | { |
1446 | if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && | 1446 | if (!test_and_set_bit(__LINK_STATE_PRESENT, &dev->state) && |
1447 | netif_running(dev)) { | 1447 | netif_running(dev)) { |
1448 | netif_wake_queue(dev); | 1448 | netif_tx_wake_all_queues(dev); |
1449 | __netdev_watchdog_up(dev); | 1449 | __netdev_watchdog_up(dev); |
1450 | } | 1450 | } |
1451 | } | 1451 | } |
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c index bda08a09357d..7a1d1ce22e66 100644 --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c | |||
@@ -222,7 +222,7 @@ fail: | |||
222 | return error; | 222 | return error; |
223 | } | 223 | } |
224 | 224 | ||
225 | int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2) | 225 | static int ipv4_rcv_saddr_equal(const struct sock *sk1, const struct sock *sk2) |
226 | { | 226 | { |
227 | struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2); | 227 | struct inet_sock *inet1 = inet_sk(sk1), *inet2 = inet_sk(sk2); |
228 | 228 | ||
@@ -1823,7 +1823,6 @@ EXPORT_SYMBOL(udp_lib_getsockopt); | |||
1823 | EXPORT_SYMBOL(udp_lib_setsockopt); | 1823 | EXPORT_SYMBOL(udp_lib_setsockopt); |
1824 | EXPORT_SYMBOL(udp_poll); | 1824 | EXPORT_SYMBOL(udp_poll); |
1825 | EXPORT_SYMBOL(udp_lib_get_port); | 1825 | EXPORT_SYMBOL(udp_lib_get_port); |
1826 | EXPORT_SYMBOL(ipv4_rcv_saddr_equal); | ||
1827 | 1826 | ||
1828 | #ifdef CONFIG_PROC_FS | 1827 | #ifdef CONFIG_PROC_FS |
1829 | EXPORT_SYMBOL(udp_proc_register); | 1828 | EXPORT_SYMBOL(udp_proc_register); |
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 6842dd2edd5b..8905712cfbb8 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -53,6 +53,8 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) | |||
53 | { | 53 | { |
54 | const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr; | 54 | const struct in6_addr *sk_rcv_saddr6 = &inet6_sk(sk)->rcv_saddr; |
55 | const struct in6_addr *sk2_rcv_saddr6 = inet6_rcv_saddr(sk2); | 55 | const struct in6_addr *sk2_rcv_saddr6 = inet6_rcv_saddr(sk2); |
56 | __be32 sk_rcv_saddr = inet_sk(sk)->rcv_saddr; | ||
57 | __be32 sk2_rcv_saddr = inet_rcv_saddr(sk2); | ||
56 | int sk_ipv6only = ipv6_only_sock(sk); | 58 | int sk_ipv6only = ipv6_only_sock(sk); |
57 | int sk2_ipv6only = inet_v6_ipv6only(sk2); | 59 | int sk2_ipv6only = inet_v6_ipv6only(sk2); |
58 | int addr_type = ipv6_addr_type(sk_rcv_saddr6); | 60 | int addr_type = ipv6_addr_type(sk_rcv_saddr6); |
@@ -60,7 +62,9 @@ int ipv6_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2) | |||
60 | 62 | ||
61 | /* if both are mapped, treat as IPv4 */ | 63 | /* if both are mapped, treat as IPv4 */ |
62 | if (addr_type == IPV6_ADDR_MAPPED && addr_type2 == IPV6_ADDR_MAPPED) | 64 | if (addr_type == IPV6_ADDR_MAPPED && addr_type2 == IPV6_ADDR_MAPPED) |
63 | return ipv4_rcv_saddr_equal(sk, sk2); | 65 | return (!sk2_ipv6only && |
66 | (!sk_rcv_saddr || !sk2_rcv_saddr || | ||
67 | sk_rcv_saddr == sk2_rcv_saddr)); | ||
64 | 68 | ||
65 | if (addr_type2 == IPV6_ADDR_ANY && | 69 | if (addr_type2 == IPV6_ADDR_ANY && |
66 | !(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED)) | 70 | !(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED)) |