diff options
author | Jiri Pirko <jpirko@redhat.com> | 2011-12-08 19:52:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-08 19:52:37 -0500 |
commit | 8e586137e6b63af1e881b328466ab5ffbe562510 (patch) | |
tree | da0767e1b1361aa24bd32f485453079e31854c0c | |
parent | 7da82c06ded105bf601bfa0eafc92e84eb0ceeed (diff) |
net: make vlan ndo_vlan_rx_[add/kill]_vid return error value
Let caller know the result of adding/removing vlan id to/from vlan
filter.
In some drivers I make those functions to just return 0. But in those
where there is able to see if hw setup went correctly, return value is
set appropriately.
Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
28 files changed, 210 insertions, 107 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 3216c514fdc8..d72c37f03e50 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -428,7 +428,7 @@ int bond_dev_queue_xmit(struct bonding *bond, struct sk_buff *skb, | |||
428 | * @bond_dev: bonding net device that got called | 428 | * @bond_dev: bonding net device that got called |
429 | * @vid: vlan id being added | 429 | * @vid: vlan id being added |
430 | */ | 430 | */ |
431 | static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) | 431 | static int bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) |
432 | { | 432 | { |
433 | struct bonding *bond = netdev_priv(bond_dev); | 433 | struct bonding *bond = netdev_priv(bond_dev); |
434 | struct slave *slave; | 434 | struct slave *slave; |
@@ -448,7 +448,10 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) | |||
448 | if (res) { | 448 | if (res) { |
449 | pr_err("%s: Error: Failed to add vlan id %d\n", | 449 | pr_err("%s: Error: Failed to add vlan id %d\n", |
450 | bond_dev->name, vid); | 450 | bond_dev->name, vid); |
451 | return res; | ||
451 | } | 452 | } |
453 | |||
454 | return 0; | ||
452 | } | 455 | } |
453 | 456 | ||
454 | /** | 457 | /** |
@@ -456,7 +459,7 @@ static void bond_vlan_rx_add_vid(struct net_device *bond_dev, uint16_t vid) | |||
456 | * @bond_dev: bonding net device that got called | 459 | * @bond_dev: bonding net device that got called |
457 | * @vid: vlan id being removed | 460 | * @vid: vlan id being removed |
458 | */ | 461 | */ |
459 | static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) | 462 | static int bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) |
460 | { | 463 | { |
461 | struct bonding *bond = netdev_priv(bond_dev); | 464 | struct bonding *bond = netdev_priv(bond_dev); |
462 | struct slave *slave; | 465 | struct slave *slave; |
@@ -476,7 +479,10 @@ static void bond_vlan_rx_kill_vid(struct net_device *bond_dev, uint16_t vid) | |||
476 | if (res) { | 479 | if (res) { |
477 | pr_err("%s: Error: Failed to remove vlan id %d\n", | 480 | pr_err("%s: Error: Failed to remove vlan id %d\n", |
478 | bond_dev->name, vid); | 481 | bond_dev->name, vid); |
482 | return res; | ||
479 | } | 483 | } |
484 | |||
485 | return 0; | ||
480 | } | 486 | } |
481 | 487 | ||
482 | static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *slave_dev) | 488 | static void bond_add_vlans_on_slave(struct bonding *bond, struct net_device *slave_dev) |
diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c index a446e251908b..cb4f38a17f20 100644 --- a/drivers/net/ethernet/adaptec/starfire.c +++ b/drivers/net/ethernet/adaptec/starfire.c | |||
@@ -607,7 +607,7 @@ static const struct ethtool_ops ethtool_ops; | |||
607 | 607 | ||
608 | 608 | ||
609 | #ifdef VLAN_SUPPORT | 609 | #ifdef VLAN_SUPPORT |
610 | static void netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 610 | static int netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
611 | { | 611 | { |
612 | struct netdev_private *np = netdev_priv(dev); | 612 | struct netdev_private *np = netdev_priv(dev); |
613 | 613 | ||
@@ -617,9 +617,11 @@ static void netdev_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
617 | set_bit(vid, np->active_vlans); | 617 | set_bit(vid, np->active_vlans); |
618 | set_rx_mode(dev); | 618 | set_rx_mode(dev); |
619 | spin_unlock(&np->lock); | 619 | spin_unlock(&np->lock); |
620 | |||
621 | return 0; | ||
620 | } | 622 | } |
621 | 623 | ||
622 | static void netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 624 | static int netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
623 | { | 625 | { |
624 | struct netdev_private *np = netdev_priv(dev); | 626 | struct netdev_private *np = netdev_priv(dev); |
625 | 627 | ||
@@ -629,6 +631,8 @@ static void netdev_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
629 | clear_bit(vid, np->active_vlans); | 631 | clear_bit(vid, np->active_vlans); |
630 | set_rx_mode(dev); | 632 | set_rx_mode(dev); |
631 | spin_unlock(&np->lock); | 633 | spin_unlock(&np->lock); |
634 | |||
635 | return 0; | ||
632 | } | 636 | } |
633 | #endif /* VLAN_SUPPORT */ | 637 | #endif /* VLAN_SUPPORT */ |
634 | 638 | ||
diff --git a/drivers/net/ethernet/brocade/bna/bnad.c b/drivers/net/ethernet/brocade/bna/bnad.c index 7f3091e7eb42..aac3a3b710a0 100644 --- a/drivers/net/ethernet/brocade/bna/bnad.c +++ b/drivers/net/ethernet/brocade/bna/bnad.c | |||
@@ -2968,7 +2968,7 @@ bnad_change_mtu(struct net_device *netdev, int new_mtu) | |||
2968 | return err; | 2968 | return err; |
2969 | } | 2969 | } |
2970 | 2970 | ||
2971 | static void | 2971 | static int |
2972 | bnad_vlan_rx_add_vid(struct net_device *netdev, | 2972 | bnad_vlan_rx_add_vid(struct net_device *netdev, |
2973 | unsigned short vid) | 2973 | unsigned short vid) |
2974 | { | 2974 | { |
@@ -2976,7 +2976,7 @@ bnad_vlan_rx_add_vid(struct net_device *netdev, | |||
2976 | unsigned long flags; | 2976 | unsigned long flags; |
2977 | 2977 | ||
2978 | if (!bnad->rx_info[0].rx) | 2978 | if (!bnad->rx_info[0].rx) |
2979 | return; | 2979 | return 0; |
2980 | 2980 | ||
2981 | mutex_lock(&bnad->conf_mutex); | 2981 | mutex_lock(&bnad->conf_mutex); |
2982 | 2982 | ||
@@ -2986,9 +2986,11 @@ bnad_vlan_rx_add_vid(struct net_device *netdev, | |||
2986 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 2986 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
2987 | 2987 | ||
2988 | mutex_unlock(&bnad->conf_mutex); | 2988 | mutex_unlock(&bnad->conf_mutex); |
2989 | |||
2990 | return 0; | ||
2989 | } | 2991 | } |
2990 | 2992 | ||
2991 | static void | 2993 | static int |
2992 | bnad_vlan_rx_kill_vid(struct net_device *netdev, | 2994 | bnad_vlan_rx_kill_vid(struct net_device *netdev, |
2993 | unsigned short vid) | 2995 | unsigned short vid) |
2994 | { | 2996 | { |
@@ -2996,7 +2998,7 @@ bnad_vlan_rx_kill_vid(struct net_device *netdev, | |||
2996 | unsigned long flags; | 2998 | unsigned long flags; |
2997 | 2999 | ||
2998 | if (!bnad->rx_info[0].rx) | 3000 | if (!bnad->rx_info[0].rx) |
2999 | return; | 3001 | return 0; |
3000 | 3002 | ||
3001 | mutex_lock(&bnad->conf_mutex); | 3003 | mutex_lock(&bnad->conf_mutex); |
3002 | 3004 | ||
@@ -3006,6 +3008,8 @@ bnad_vlan_rx_kill_vid(struct net_device *netdev, | |||
3006 | spin_unlock_irqrestore(&bnad->bna_lock, flags); | 3008 | spin_unlock_irqrestore(&bnad->bna_lock, flags); |
3007 | 3009 | ||
3008 | mutex_unlock(&bnad->conf_mutex); | 3010 | mutex_unlock(&bnad->conf_mutex); |
3011 | |||
3012 | return 0; | ||
3009 | } | 3013 | } |
3010 | 3014 | ||
3011 | #ifdef CONFIG_NET_POLL_CONTROLLER | 3015 | #ifdef CONFIG_NET_POLL_CONTROLLER |
diff --git a/drivers/net/ethernet/cisco/enic/enic_dev.c b/drivers/net/ethernet/cisco/enic/enic_dev.c index fd6247b3c0ee..bf0fc56dba19 100644 --- a/drivers/net/ethernet/cisco/enic/enic_dev.c +++ b/drivers/net/ethernet/cisco/enic/enic_dev.c | |||
@@ -212,23 +212,29 @@ int enic_dev_deinit_done(struct enic *enic, int *status) | |||
212 | } | 212 | } |
213 | 213 | ||
214 | /* rtnl lock is held */ | 214 | /* rtnl lock is held */ |
215 | void enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 215 | int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
216 | { | 216 | { |
217 | struct enic *enic = netdev_priv(netdev); | 217 | struct enic *enic = netdev_priv(netdev); |
218 | int err; | ||
218 | 219 | ||
219 | spin_lock(&enic->devcmd_lock); | 220 | spin_lock(&enic->devcmd_lock); |
220 | enic_add_vlan(enic, vid); | 221 | err = enic_add_vlan(enic, vid); |
221 | spin_unlock(&enic->devcmd_lock); | 222 | spin_unlock(&enic->devcmd_lock); |
223 | |||
224 | return err; | ||
222 | } | 225 | } |
223 | 226 | ||
224 | /* rtnl lock is held */ | 227 | /* rtnl lock is held */ |
225 | void enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 228 | int enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
226 | { | 229 | { |
227 | struct enic *enic = netdev_priv(netdev); | 230 | struct enic *enic = netdev_priv(netdev); |
231 | int err; | ||
228 | 232 | ||
229 | spin_lock(&enic->devcmd_lock); | 233 | spin_lock(&enic->devcmd_lock); |
230 | enic_del_vlan(enic, vid); | 234 | err = enic_del_vlan(enic, vid); |
231 | spin_unlock(&enic->devcmd_lock); | 235 | spin_unlock(&enic->devcmd_lock); |
236 | |||
237 | return err; | ||
232 | } | 238 | } |
233 | 239 | ||
234 | int enic_dev_enable2(struct enic *enic, int active) | 240 | int enic_dev_enable2(struct enic *enic, int active) |
diff --git a/drivers/net/ethernet/cisco/enic/enic_dev.h b/drivers/net/ethernet/cisco/enic/enic_dev.h index 1f83a4747ba0..da1cba3c410e 100644 --- a/drivers/net/ethernet/cisco/enic/enic_dev.h +++ b/drivers/net/ethernet/cisco/enic/enic_dev.h | |||
@@ -46,8 +46,8 @@ int enic_dev_packet_filter(struct enic *enic, int directed, int multicast, | |||
46 | int broadcast, int promisc, int allmulti); | 46 | int broadcast, int promisc, int allmulti); |
47 | int enic_dev_add_addr(struct enic *enic, u8 *addr); | 47 | int enic_dev_add_addr(struct enic *enic, u8 *addr); |
48 | int enic_dev_del_addr(struct enic *enic, u8 *addr); | 48 | int enic_dev_del_addr(struct enic *enic, u8 *addr); |
49 | void enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid); | 49 | int enic_vlan_rx_add_vid(struct net_device *netdev, u16 vid); |
50 | void enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); | 50 | int enic_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); |
51 | int enic_dev_notify_unset(struct enic *enic); | 51 | int enic_dev_notify_unset(struct enic *enic); |
52 | int enic_dev_hang_notify(struct enic *enic); | 52 | int enic_dev_hang_notify(struct enic *enic); |
53 | int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic); | 53 | int enic_dev_set_ig_vlan_rewrite_mode(struct enic *enic); |
diff --git a/drivers/net/ethernet/emulex/benet/be_main.c b/drivers/net/ethernet/emulex/benet/be_main.c index 3854fb0610ba..b8a526f9efc8 100644 --- a/drivers/net/ethernet/emulex/benet/be_main.c +++ b/drivers/net/ethernet/emulex/benet/be_main.c | |||
@@ -780,31 +780,35 @@ static int be_vid_config(struct be_adapter *adapter, bool vf, u32 vf_num) | |||
780 | return status; | 780 | return status; |
781 | } | 781 | } |
782 | 782 | ||
783 | static void be_vlan_add_vid(struct net_device *netdev, u16 vid) | 783 | static int be_vlan_add_vid(struct net_device *netdev, u16 vid) |
784 | { | 784 | { |
785 | struct be_adapter *adapter = netdev_priv(netdev); | 785 | struct be_adapter *adapter = netdev_priv(netdev); |
786 | 786 | ||
787 | adapter->vlans_added++; | 787 | adapter->vlans_added++; |
788 | if (!be_physfn(adapter)) | 788 | if (!be_physfn(adapter)) |
789 | return; | 789 | return 0; |
790 | 790 | ||
791 | adapter->vlan_tag[vid] = 1; | 791 | adapter->vlan_tag[vid] = 1; |
792 | if (adapter->vlans_added <= (adapter->max_vlans + 1)) | 792 | if (adapter->vlans_added <= (adapter->max_vlans + 1)) |
793 | be_vid_config(adapter, false, 0); | 793 | be_vid_config(adapter, false, 0); |
794 | |||
795 | return 0; | ||
794 | } | 796 | } |
795 | 797 | ||
796 | static void be_vlan_rem_vid(struct net_device *netdev, u16 vid) | 798 | static int be_vlan_rem_vid(struct net_device *netdev, u16 vid) |
797 | { | 799 | { |
798 | struct be_adapter *adapter = netdev_priv(netdev); | 800 | struct be_adapter *adapter = netdev_priv(netdev); |
799 | 801 | ||
800 | adapter->vlans_added--; | 802 | adapter->vlans_added--; |
801 | 803 | ||
802 | if (!be_physfn(adapter)) | 804 | if (!be_physfn(adapter)) |
803 | return; | 805 | return 0; |
804 | 806 | ||
805 | adapter->vlan_tag[vid] = 0; | 807 | adapter->vlan_tag[vid] = 0; |
806 | if (adapter->vlans_added <= adapter->max_vlans) | 808 | if (adapter->vlans_added <= adapter->max_vlans) |
807 | be_vid_config(adapter, false, 0); | 809 | be_vid_config(adapter, false, 0); |
810 | |||
811 | return 0; | ||
808 | } | 812 | } |
809 | 813 | ||
810 | static void be_set_rx_mode(struct net_device *netdev) | 814 | static void be_set_rx_mode(struct net_device *netdev) |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index bfeccbfde236..3554414eb5e2 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -2114,17 +2114,19 @@ static int ehea_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2114 | return NETDEV_TX_OK; | 2114 | return NETDEV_TX_OK; |
2115 | } | 2115 | } |
2116 | 2116 | ||
2117 | static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 2117 | static int ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
2118 | { | 2118 | { |
2119 | struct ehea_port *port = netdev_priv(dev); | 2119 | struct ehea_port *port = netdev_priv(dev); |
2120 | struct ehea_adapter *adapter = port->adapter; | 2120 | struct ehea_adapter *adapter = port->adapter; |
2121 | struct hcp_ehea_port_cb1 *cb1; | 2121 | struct hcp_ehea_port_cb1 *cb1; |
2122 | int index; | 2122 | int index; |
2123 | u64 hret; | 2123 | u64 hret; |
2124 | int err = 0; | ||
2124 | 2125 | ||
2125 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); | 2126 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); |
2126 | if (!cb1) { | 2127 | if (!cb1) { |
2127 | pr_err("no mem for cb1\n"); | 2128 | pr_err("no mem for cb1\n"); |
2129 | err = -ENOMEM; | ||
2128 | goto out; | 2130 | goto out; |
2129 | } | 2131 | } |
2130 | 2132 | ||
@@ -2132,6 +2134,7 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
2132 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2134 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2133 | if (hret != H_SUCCESS) { | 2135 | if (hret != H_SUCCESS) { |
2134 | pr_err("query_ehea_port failed\n"); | 2136 | pr_err("query_ehea_port failed\n"); |
2137 | err = -EINVAL; | ||
2135 | goto out; | 2138 | goto out; |
2136 | } | 2139 | } |
2137 | 2140 | ||
@@ -2140,24 +2143,28 @@ static void ehea_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
2140 | 2143 | ||
2141 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, | 2144 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, |
2142 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2145 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2143 | if (hret != H_SUCCESS) | 2146 | if (hret != H_SUCCESS) { |
2144 | pr_err("modify_ehea_port failed\n"); | 2147 | pr_err("modify_ehea_port failed\n"); |
2148 | err = -EINVAL; | ||
2149 | } | ||
2145 | out: | 2150 | out: |
2146 | free_page((unsigned long)cb1); | 2151 | free_page((unsigned long)cb1); |
2147 | return; | 2152 | return err; |
2148 | } | 2153 | } |
2149 | 2154 | ||
2150 | static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 2155 | static int ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
2151 | { | 2156 | { |
2152 | struct ehea_port *port = netdev_priv(dev); | 2157 | struct ehea_port *port = netdev_priv(dev); |
2153 | struct ehea_adapter *adapter = port->adapter; | 2158 | struct ehea_adapter *adapter = port->adapter; |
2154 | struct hcp_ehea_port_cb1 *cb1; | 2159 | struct hcp_ehea_port_cb1 *cb1; |
2155 | int index; | 2160 | int index; |
2156 | u64 hret; | 2161 | u64 hret; |
2162 | int err = 0; | ||
2157 | 2163 | ||
2158 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); | 2164 | cb1 = (void *)get_zeroed_page(GFP_KERNEL); |
2159 | if (!cb1) { | 2165 | if (!cb1) { |
2160 | pr_err("no mem for cb1\n"); | 2166 | pr_err("no mem for cb1\n"); |
2167 | err = -ENOMEM; | ||
2161 | goto out; | 2168 | goto out; |
2162 | } | 2169 | } |
2163 | 2170 | ||
@@ -2165,6 +2172,7 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
2165 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2172 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2166 | if (hret != H_SUCCESS) { | 2173 | if (hret != H_SUCCESS) { |
2167 | pr_err("query_ehea_port failed\n"); | 2174 | pr_err("query_ehea_port failed\n"); |
2175 | err = -EINVAL; | ||
2168 | goto out; | 2176 | goto out; |
2169 | } | 2177 | } |
2170 | 2178 | ||
@@ -2173,10 +2181,13 @@ static void ehea_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
2173 | 2181 | ||
2174 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, | 2182 | hret = ehea_h_modify_ehea_port(adapter->handle, port->logical_port_id, |
2175 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); | 2183 | H_PORT_CB1, H_PORT_CB1_ALL, cb1); |
2176 | if (hret != H_SUCCESS) | 2184 | if (hret != H_SUCCESS) { |
2177 | pr_err("modify_ehea_port failed\n"); | 2185 | pr_err("modify_ehea_port failed\n"); |
2186 | err = -EINVAL; | ||
2187 | } | ||
2178 | out: | 2188 | out: |
2179 | free_page((unsigned long)cb1); | 2189 | free_page((unsigned long)cb1); |
2190 | return err; | ||
2180 | } | 2191 | } |
2181 | 2192 | ||
2182 | int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) | 2193 | int ehea_activate_qp(struct ehea_adapter *adapter, struct ehea_qp *qp) |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 82f4ef142259..053f01289eff 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -169,8 +169,8 @@ static int e1000_82547_fifo_workaround(struct e1000_adapter *adapter, | |||
169 | static bool e1000_vlan_used(struct e1000_adapter *adapter); | 169 | static bool e1000_vlan_used(struct e1000_adapter *adapter); |
170 | static void e1000_vlan_mode(struct net_device *netdev, | 170 | static void e1000_vlan_mode(struct net_device *netdev, |
171 | netdev_features_t features); | 171 | netdev_features_t features); |
172 | static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); | 172 | static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid); |
173 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); | 173 | static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); |
174 | static void e1000_restore_vlan(struct e1000_adapter *adapter); | 174 | static void e1000_restore_vlan(struct e1000_adapter *adapter); |
175 | 175 | ||
176 | #ifdef CONFIG_PM | 176 | #ifdef CONFIG_PM |
@@ -4604,7 +4604,7 @@ static void e1000_vlan_mode(struct net_device *netdev, | |||
4604 | e1000_irq_enable(adapter); | 4604 | e1000_irq_enable(adapter); |
4605 | } | 4605 | } |
4606 | 4606 | ||
4607 | static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 4607 | static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
4608 | { | 4608 | { |
4609 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4609 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4610 | struct e1000_hw *hw = &adapter->hw; | 4610 | struct e1000_hw *hw = &adapter->hw; |
@@ -4613,7 +4613,7 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
4613 | if ((hw->mng_cookie.status & | 4613 | if ((hw->mng_cookie.status & |
4614 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && | 4614 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN_SUPPORT) && |
4615 | (vid == adapter->mng_vlan_id)) | 4615 | (vid == adapter->mng_vlan_id)) |
4616 | return; | 4616 | return 0; |
4617 | 4617 | ||
4618 | if (!e1000_vlan_used(adapter)) | 4618 | if (!e1000_vlan_used(adapter)) |
4619 | e1000_vlan_filter_on_off(adapter, true); | 4619 | e1000_vlan_filter_on_off(adapter, true); |
@@ -4625,9 +4625,11 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
4625 | e1000_write_vfta(hw, index, vfta); | 4625 | e1000_write_vfta(hw, index, vfta); |
4626 | 4626 | ||
4627 | set_bit(vid, adapter->active_vlans); | 4627 | set_bit(vid, adapter->active_vlans); |
4628 | |||
4629 | return 0; | ||
4628 | } | 4630 | } |
4629 | 4631 | ||
4630 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 4632 | static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
4631 | { | 4633 | { |
4632 | struct e1000_adapter *adapter = netdev_priv(netdev); | 4634 | struct e1000_adapter *adapter = netdev_priv(netdev); |
4633 | struct e1000_hw *hw = &adapter->hw; | 4635 | struct e1000_hw *hw = &adapter->hw; |
@@ -4648,6 +4650,8 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
4648 | 4650 | ||
4649 | if (!e1000_vlan_used(adapter)) | 4651 | if (!e1000_vlan_used(adapter)) |
4650 | e1000_vlan_filter_on_off(adapter, false); | 4652 | e1000_vlan_filter_on_off(adapter, false); |
4653 | |||
4654 | return 0; | ||
4651 | } | 4655 | } |
4652 | 4656 | ||
4653 | static void e1000_restore_vlan(struct e1000_adapter *adapter) | 4657 | static void e1000_restore_vlan(struct e1000_adapter *adapter) |
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index 93ae0c26d434..90953b4d6bfa 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -2522,7 +2522,7 @@ clean_rx: | |||
2522 | return work_done; | 2522 | return work_done; |
2523 | } | 2523 | } |
2524 | 2524 | ||
2525 | static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 2525 | static int e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
2526 | { | 2526 | { |
2527 | struct e1000_adapter *adapter = netdev_priv(netdev); | 2527 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2528 | struct e1000_hw *hw = &adapter->hw; | 2528 | struct e1000_hw *hw = &adapter->hw; |
@@ -2532,7 +2532,7 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
2532 | if ((adapter->hw.mng_cookie.status & | 2532 | if ((adapter->hw.mng_cookie.status & |
2533 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN) && | 2533 | E1000_MNG_DHCP_COOKIE_STATUS_VLAN) && |
2534 | (vid == adapter->mng_vlan_id)) | 2534 | (vid == adapter->mng_vlan_id)) |
2535 | return; | 2535 | return 0; |
2536 | 2536 | ||
2537 | /* add VID to filter table */ | 2537 | /* add VID to filter table */ |
2538 | if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) { | 2538 | if (adapter->flags & FLAG_HAS_HW_VLAN_FILTER) { |
@@ -2543,9 +2543,11 @@ static void e1000_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
2543 | } | 2543 | } |
2544 | 2544 | ||
2545 | set_bit(vid, adapter->active_vlans); | 2545 | set_bit(vid, adapter->active_vlans); |
2546 | |||
2547 | return 0; | ||
2546 | } | 2548 | } |
2547 | 2549 | ||
2548 | static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 2550 | static int e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
2549 | { | 2551 | { |
2550 | struct e1000_adapter *adapter = netdev_priv(netdev); | 2552 | struct e1000_adapter *adapter = netdev_priv(netdev); |
2551 | struct e1000_hw *hw = &adapter->hw; | 2553 | struct e1000_hw *hw = &adapter->hw; |
@@ -2556,7 +2558,7 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
2556 | (vid == adapter->mng_vlan_id)) { | 2558 | (vid == adapter->mng_vlan_id)) { |
2557 | /* release control to f/w */ | 2559 | /* release control to f/w */ |
2558 | e1000e_release_hw_control(adapter); | 2560 | e1000e_release_hw_control(adapter); |
2559 | return; | 2561 | return 0; |
2560 | } | 2562 | } |
2561 | 2563 | ||
2562 | /* remove VID from filter table */ | 2564 | /* remove VID from filter table */ |
@@ -2568,6 +2570,8 @@ static void e1000_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
2568 | } | 2570 | } |
2569 | 2571 | ||
2570 | clear_bit(vid, adapter->active_vlans); | 2572 | clear_bit(vid, adapter->active_vlans); |
2573 | |||
2574 | return 0; | ||
2571 | } | 2575 | } |
2572 | 2576 | ||
2573 | /** | 2577 | /** |
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 143cfebe3182..89d576ce5776 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -148,8 +148,8 @@ static int igb_ioctl(struct net_device *, struct ifreq *, int cmd); | |||
148 | static void igb_tx_timeout(struct net_device *); | 148 | static void igb_tx_timeout(struct net_device *); |
149 | static void igb_reset_task(struct work_struct *); | 149 | static void igb_reset_task(struct work_struct *); |
150 | static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features); | 150 | static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features); |
151 | static void igb_vlan_rx_add_vid(struct net_device *, u16); | 151 | static int igb_vlan_rx_add_vid(struct net_device *, u16); |
152 | static void igb_vlan_rx_kill_vid(struct net_device *, u16); | 152 | static int igb_vlan_rx_kill_vid(struct net_device *, u16); |
153 | static void igb_restore_vlan(struct igb_adapter *); | 153 | static void igb_restore_vlan(struct igb_adapter *); |
154 | static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32 , u8); | 154 | static void igb_rar_set_qsel(struct igb_adapter *, u8 *, u32 , u8); |
155 | static void igb_ping_all_vfs(struct igb_adapter *); | 155 | static void igb_ping_all_vfs(struct igb_adapter *); |
@@ -6491,7 +6491,7 @@ static void igb_vlan_mode(struct net_device *netdev, netdev_features_t features) | |||
6491 | igb_rlpml_set(adapter); | 6491 | igb_rlpml_set(adapter); |
6492 | } | 6492 | } |
6493 | 6493 | ||
6494 | static void igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 6494 | static int igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
6495 | { | 6495 | { |
6496 | struct igb_adapter *adapter = netdev_priv(netdev); | 6496 | struct igb_adapter *adapter = netdev_priv(netdev); |
6497 | struct e1000_hw *hw = &adapter->hw; | 6497 | struct e1000_hw *hw = &adapter->hw; |
@@ -6504,9 +6504,11 @@ static void igb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
6504 | igb_vfta_set(hw, vid, true); | 6504 | igb_vfta_set(hw, vid, true); |
6505 | 6505 | ||
6506 | set_bit(vid, adapter->active_vlans); | 6506 | set_bit(vid, adapter->active_vlans); |
6507 | |||
6508 | return 0; | ||
6507 | } | 6509 | } |
6508 | 6510 | ||
6509 | static void igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 6511 | static int igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
6510 | { | 6512 | { |
6511 | struct igb_adapter *adapter = netdev_priv(netdev); | 6513 | struct igb_adapter *adapter = netdev_priv(netdev); |
6512 | struct e1000_hw *hw = &adapter->hw; | 6514 | struct e1000_hw *hw = &adapter->hw; |
@@ -6521,6 +6523,8 @@ static void igb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
6521 | igb_vfta_set(hw, vid, false); | 6523 | igb_vfta_set(hw, vid, false); |
6522 | 6524 | ||
6523 | clear_bit(vid, adapter->active_vlans); | 6525 | clear_bit(vid, adapter->active_vlans); |
6526 | |||
6527 | return 0; | ||
6524 | } | 6528 | } |
6525 | 6529 | ||
6526 | static void igb_restore_vlan(struct igb_adapter *adapter) | 6530 | static void igb_restore_vlan(struct igb_adapter *adapter) |
diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c index c358973ce414..fd3da3076c2f 100644 --- a/drivers/net/ethernet/intel/igbvf/netdev.c +++ b/drivers/net/ethernet/intel/igbvf/netdev.c | |||
@@ -1176,18 +1176,20 @@ static void igbvf_set_rlpml(struct igbvf_adapter *adapter) | |||
1176 | e1000_rlpml_set_vf(hw, max_frame_size); | 1176 | e1000_rlpml_set_vf(hw, max_frame_size); |
1177 | } | 1177 | } |
1178 | 1178 | ||
1179 | static void igbvf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 1179 | static int igbvf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
1180 | { | 1180 | { |
1181 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 1181 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
1182 | struct e1000_hw *hw = &adapter->hw; | 1182 | struct e1000_hw *hw = &adapter->hw; |
1183 | 1183 | ||
1184 | if (hw->mac.ops.set_vfta(hw, vid, true)) | 1184 | if (hw->mac.ops.set_vfta(hw, vid, true)) { |
1185 | dev_err(&adapter->pdev->dev, "Failed to add vlan id %d\n", vid); | 1185 | dev_err(&adapter->pdev->dev, "Failed to add vlan id %d\n", vid); |
1186 | else | 1186 | return -EINVAL; |
1187 | set_bit(vid, adapter->active_vlans); | 1187 | } |
1188 | set_bit(vid, adapter->active_vlans); | ||
1189 | return 0; | ||
1188 | } | 1190 | } |
1189 | 1191 | ||
1190 | static void igbvf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 1192 | static int igbvf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
1191 | { | 1193 | { |
1192 | struct igbvf_adapter *adapter = netdev_priv(netdev); | 1194 | struct igbvf_adapter *adapter = netdev_priv(netdev); |
1193 | struct e1000_hw *hw = &adapter->hw; | 1195 | struct e1000_hw *hw = &adapter->hw; |
@@ -1197,11 +1199,13 @@ static void igbvf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
1197 | if (!test_bit(__IGBVF_DOWN, &adapter->state)) | 1199 | if (!test_bit(__IGBVF_DOWN, &adapter->state)) |
1198 | igbvf_irq_enable(adapter); | 1200 | igbvf_irq_enable(adapter); |
1199 | 1201 | ||
1200 | if (hw->mac.ops.set_vfta(hw, vid, false)) | 1202 | if (hw->mac.ops.set_vfta(hw, vid, false)) { |
1201 | dev_err(&adapter->pdev->dev, | 1203 | dev_err(&adapter->pdev->dev, |
1202 | "Failed to remove vlan id %d\n", vid); | 1204 | "Failed to remove vlan id %d\n", vid); |
1203 | else | 1205 | return -EINVAL; |
1204 | clear_bit(vid, adapter->active_vlans); | 1206 | } |
1207 | clear_bit(vid, adapter->active_vlans); | ||
1208 | return 0; | ||
1205 | } | 1209 | } |
1206 | 1210 | ||
1207 | static void igbvf_restore_vlan(struct igbvf_adapter *adapter) | 1211 | static void igbvf_restore_vlan(struct igbvf_adapter *adapter) |
diff --git a/drivers/net/ethernet/intel/ixgb/ixgb_main.c b/drivers/net/ethernet/intel/ixgb/ixgb_main.c index 247cf9219e03..c573655f3307 100644 --- a/drivers/net/ethernet/intel/ixgb/ixgb_main.c +++ b/drivers/net/ethernet/intel/ixgb/ixgb_main.c | |||
@@ -101,8 +101,8 @@ static void ixgb_tx_timeout_task(struct work_struct *work); | |||
101 | 101 | ||
102 | static void ixgb_vlan_strip_enable(struct ixgb_adapter *adapter); | 102 | static void ixgb_vlan_strip_enable(struct ixgb_adapter *adapter); |
103 | static void ixgb_vlan_strip_disable(struct ixgb_adapter *adapter); | 103 | static void ixgb_vlan_strip_disable(struct ixgb_adapter *adapter); |
104 | static void ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid); | 104 | static int ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid); |
105 | static void ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); | 105 | static int ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid); |
106 | static void ixgb_restore_vlan(struct ixgb_adapter *adapter); | 106 | static void ixgb_restore_vlan(struct ixgb_adapter *adapter); |
107 | 107 | ||
108 | #ifdef CONFIG_NET_POLL_CONTROLLER | 108 | #ifdef CONFIG_NET_POLL_CONTROLLER |
@@ -2217,7 +2217,7 @@ ixgb_vlan_strip_disable(struct ixgb_adapter *adapter) | |||
2217 | IXGB_WRITE_REG(&adapter->hw, CTRL0, ctrl); | 2217 | IXGB_WRITE_REG(&adapter->hw, CTRL0, ctrl); |
2218 | } | 2218 | } |
2219 | 2219 | ||
2220 | static void | 2220 | static int |
2221 | ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 2221 | ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
2222 | { | 2222 | { |
2223 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 2223 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
@@ -2230,9 +2230,11 @@ ixgb_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
2230 | vfta |= (1 << (vid & 0x1F)); | 2230 | vfta |= (1 << (vid & 0x1F)); |
2231 | ixgb_write_vfta(&adapter->hw, index, vfta); | 2231 | ixgb_write_vfta(&adapter->hw, index, vfta); |
2232 | set_bit(vid, adapter->active_vlans); | 2232 | set_bit(vid, adapter->active_vlans); |
2233 | |||
2234 | return 0; | ||
2233 | } | 2235 | } |
2234 | 2236 | ||
2235 | static void | 2237 | static int |
2236 | ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 2238 | ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
2237 | { | 2239 | { |
2238 | struct ixgb_adapter *adapter = netdev_priv(netdev); | 2240 | struct ixgb_adapter *adapter = netdev_priv(netdev); |
@@ -2245,6 +2247,8 @@ ixgb_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
2245 | vfta &= ~(1 << (vid & 0x1F)); | 2247 | vfta &= ~(1 << (vid & 0x1F)); |
2246 | ixgb_write_vfta(&adapter->hw, index, vfta); | 2248 | ixgb_write_vfta(&adapter->hw, index, vfta); |
2247 | clear_bit(vid, adapter->active_vlans); | 2249 | clear_bit(vid, adapter->active_vlans); |
2250 | |||
2251 | return 0; | ||
2248 | } | 2252 | } |
2249 | 2253 | ||
2250 | static void | 2254 | static void |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 1b28ed9d8cc1..5d94ce1c0fc3 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -3044,7 +3044,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter) | |||
3044 | hw->mac.ops.enable_rx_dma(hw, rxctrl); | 3044 | hw->mac.ops.enable_rx_dma(hw, rxctrl); |
3045 | } | 3045 | } |
3046 | 3046 | ||
3047 | static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 3047 | static int ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
3048 | { | 3048 | { |
3049 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 3049 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
3050 | struct ixgbe_hw *hw = &adapter->hw; | 3050 | struct ixgbe_hw *hw = &adapter->hw; |
@@ -3053,9 +3053,11 @@ static void ixgbe_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
3053 | /* add VID to filter table */ | 3053 | /* add VID to filter table */ |
3054 | hw->mac.ops.set_vfta(&adapter->hw, vid, pool_ndx, true); | 3054 | hw->mac.ops.set_vfta(&adapter->hw, vid, pool_ndx, true); |
3055 | set_bit(vid, adapter->active_vlans); | 3055 | set_bit(vid, adapter->active_vlans); |
3056 | |||
3057 | return 0; | ||
3056 | } | 3058 | } |
3057 | 3059 | ||
3058 | static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 3060 | static int ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
3059 | { | 3061 | { |
3060 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 3062 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
3061 | struct ixgbe_hw *hw = &adapter->hw; | 3063 | struct ixgbe_hw *hw = &adapter->hw; |
@@ -3064,6 +3066,8 @@ static void ixgbe_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
3064 | /* remove VID from filter table */ | 3066 | /* remove VID from filter table */ |
3065 | hw->mac.ops.set_vfta(&adapter->hw, vid, pool_ndx, false); | 3067 | hw->mac.ops.set_vfta(&adapter->hw, vid, pool_ndx, false); |
3066 | clear_bit(vid, adapter->active_vlans); | 3068 | clear_bit(vid, adapter->active_vlans); |
3069 | |||
3070 | return 0; | ||
3067 | } | 3071 | } |
3068 | 3072 | ||
3069 | /** | 3073 | /** |
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c index 5d1a64398169..891162d1610c 100644 --- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | |||
@@ -1403,7 +1403,7 @@ static void ixgbevf_configure_rx(struct ixgbevf_adapter *adapter) | |||
1403 | } | 1403 | } |
1404 | } | 1404 | } |
1405 | 1405 | ||
1406 | static void ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 1406 | static int ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
1407 | { | 1407 | { |
1408 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | 1408 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); |
1409 | struct ixgbe_hw *hw = &adapter->hw; | 1409 | struct ixgbe_hw *hw = &adapter->hw; |
@@ -1412,9 +1412,11 @@ static void ixgbevf_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
1412 | if (hw->mac.ops.set_vfta) | 1412 | if (hw->mac.ops.set_vfta) |
1413 | hw->mac.ops.set_vfta(hw, vid, 0, true); | 1413 | hw->mac.ops.set_vfta(hw, vid, 0, true); |
1414 | set_bit(vid, adapter->active_vlans); | 1414 | set_bit(vid, adapter->active_vlans); |
1415 | |||
1416 | return 0; | ||
1415 | } | 1417 | } |
1416 | 1418 | ||
1417 | static void ixgbevf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 1419 | static int ixgbevf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
1418 | { | 1420 | { |
1419 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); | 1421 | struct ixgbevf_adapter *adapter = netdev_priv(netdev); |
1420 | struct ixgbe_hw *hw = &adapter->hw; | 1422 | struct ixgbe_hw *hw = &adapter->hw; |
@@ -1423,6 +1425,8 @@ static void ixgbevf_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
1423 | if (hw->mac.ops.set_vfta) | 1425 | if (hw->mac.ops.set_vfta) |
1424 | hw->mac.ops.set_vfta(hw, vid, 0, false); | 1426 | hw->mac.ops.set_vfta(hw, vid, 0, false); |
1425 | clear_bit(vid, adapter->active_vlans); | 1427 | clear_bit(vid, adapter->active_vlans); |
1428 | |||
1429 | return 0; | ||
1426 | } | 1430 | } |
1427 | 1431 | ||
1428 | static void ixgbevf_restore_vlan(struct ixgbevf_adapter *adapter) | 1432 | static void ixgbevf_restore_vlan(struct ixgbevf_adapter *adapter) |
diff --git a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c index 4c5bbb3aad31..2083f3b5d689 100644 --- a/drivers/net/ethernet/mellanox/mlx4/en_netdev.c +++ b/drivers/net/ethernet/mellanox/mlx4/en_netdev.c | |||
@@ -45,7 +45,7 @@ | |||
45 | #include "mlx4_en.h" | 45 | #include "mlx4_en.h" |
46 | #include "en_port.h" | 46 | #include "en_port.h" |
47 | 47 | ||
48 | static void mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 48 | static int mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
49 | { | 49 | { |
50 | struct mlx4_en_priv *priv = netdev_priv(dev); | 50 | struct mlx4_en_priv *priv = netdev_priv(dev); |
51 | struct mlx4_en_dev *mdev = priv->mdev; | 51 | struct mlx4_en_dev *mdev = priv->mdev; |
@@ -67,9 +67,10 @@ static void mlx4_en_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
67 | en_err(priv, "failed adding vlan %d\n", vid); | 67 | en_err(priv, "failed adding vlan %d\n", vid); |
68 | mutex_unlock(&mdev->state_lock); | 68 | mutex_unlock(&mdev->state_lock); |
69 | 69 | ||
70 | return 0; | ||
70 | } | 71 | } |
71 | 72 | ||
72 | static void mlx4_en_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 73 | static int mlx4_en_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
73 | { | 74 | { |
74 | struct mlx4_en_priv *priv = netdev_priv(dev); | 75 | struct mlx4_en_priv *priv = netdev_priv(dev); |
75 | struct mlx4_en_dev *mdev = priv->mdev; | 76 | struct mlx4_en_dev *mdev = priv->mdev; |
@@ -93,6 +94,8 @@ static void mlx4_en_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
93 | en_err(priv, "Failed configuring VLAN filter\n"); | 94 | en_err(priv, "Failed configuring VLAN filter\n"); |
94 | } | 95 | } |
95 | mutex_unlock(&mdev->state_lock); | 96 | mutex_unlock(&mdev->state_lock); |
97 | |||
98 | return 0; | ||
96 | } | 99 | } |
97 | 100 | ||
98 | u64 mlx4_en_mac_to_u64(u8 *addr) | 101 | u64 mlx4_en_mac_to_u64(u8 *addr) |
diff --git a/drivers/net/ethernet/neterion/vxge/vxge-main.c b/drivers/net/ethernet/neterion/vxge/vxge-main.c index 16d4d8e913c3..ef76725454d2 100644 --- a/drivers/net/ethernet/neterion/vxge/vxge-main.c +++ b/drivers/net/ethernet/neterion/vxge/vxge-main.c | |||
@@ -3305,7 +3305,7 @@ static void vxge_tx_watchdog(struct net_device *dev) | |||
3305 | * | 3305 | * |
3306 | * Add the vlan id to the devices vlan id table | 3306 | * Add the vlan id to the devices vlan id table |
3307 | */ | 3307 | */ |
3308 | static void | 3308 | static int |
3309 | vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 3309 | vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
3310 | { | 3310 | { |
3311 | struct vxgedev *vdev = netdev_priv(dev); | 3311 | struct vxgedev *vdev = netdev_priv(dev); |
@@ -3320,6 +3320,7 @@ vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
3320 | vxge_hw_vpath_vid_add(vpath->handle, vid); | 3320 | vxge_hw_vpath_vid_add(vpath->handle, vid); |
3321 | } | 3321 | } |
3322 | set_bit(vid, vdev->active_vlans); | 3322 | set_bit(vid, vdev->active_vlans); |
3323 | return 0; | ||
3323 | } | 3324 | } |
3324 | 3325 | ||
3325 | /** | 3326 | /** |
@@ -3329,7 +3330,7 @@ vxge_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
3329 | * | 3330 | * |
3330 | * Remove the vlan id from the device's vlan id table | 3331 | * Remove the vlan id from the device's vlan id table |
3331 | */ | 3332 | */ |
3332 | static void | 3333 | static int |
3333 | vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 3334 | vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
3334 | { | 3335 | { |
3335 | struct vxgedev *vdev = netdev_priv(dev); | 3336 | struct vxgedev *vdev = netdev_priv(dev); |
@@ -3348,6 +3349,7 @@ vxge_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
3348 | vxge_debug_entryexit(VXGE_TRACE, | 3349 | vxge_debug_entryexit(VXGE_TRACE, |
3349 | "%s:%d Exiting...", __func__, __LINE__); | 3350 | "%s:%d Exiting...", __func__, __LINE__); |
3350 | clear_bit(vid, vdev->active_vlans); | 3351 | clear_bit(vid, vdev->active_vlans); |
3352 | return 0; | ||
3351 | } | 3353 | } |
3352 | 3354 | ||
3353 | static const struct net_device_ops vxge_netdev_ops = { | 3355 | static const struct net_device_ops vxge_netdev_ops = { |
diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c index 823f845ddc04..69b8e4ef14d9 100644 --- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c +++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c | |||
@@ -97,8 +97,8 @@ static int qlcnicvf_config_bridged_mode(struct qlcnic_adapter *, u32); | |||
97 | static int qlcnicvf_start_firmware(struct qlcnic_adapter *); | 97 | static int qlcnicvf_start_firmware(struct qlcnic_adapter *); |
98 | static void qlcnic_set_netdev_features(struct qlcnic_adapter *, | 98 | static void qlcnic_set_netdev_features(struct qlcnic_adapter *, |
99 | struct qlcnic_esw_func_cfg *); | 99 | struct qlcnic_esw_func_cfg *); |
100 | static void qlcnic_vlan_rx_add(struct net_device *, u16); | 100 | static int qlcnic_vlan_rx_add(struct net_device *, u16); |
101 | static void qlcnic_vlan_rx_del(struct net_device *, u16); | 101 | static int qlcnic_vlan_rx_del(struct net_device *, u16); |
102 | 102 | ||
103 | /* PCI Device ID Table */ | 103 | /* PCI Device ID Table */ |
104 | #define ENTRY(device) \ | 104 | #define ENTRY(device) \ |
@@ -735,20 +735,22 @@ qlcnic_set_vlan_config(struct qlcnic_adapter *adapter, | |||
735 | adapter->pvid = 0; | 735 | adapter->pvid = 0; |
736 | } | 736 | } |
737 | 737 | ||
738 | static void | 738 | static int |
739 | qlcnic_vlan_rx_add(struct net_device *netdev, u16 vid) | 739 | qlcnic_vlan_rx_add(struct net_device *netdev, u16 vid) |
740 | { | 740 | { |
741 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 741 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
742 | set_bit(vid, adapter->vlans); | 742 | set_bit(vid, adapter->vlans); |
743 | return 0; | ||
743 | } | 744 | } |
744 | 745 | ||
745 | static void | 746 | static int |
746 | qlcnic_vlan_rx_del(struct net_device *netdev, u16 vid) | 747 | qlcnic_vlan_rx_del(struct net_device *netdev, u16 vid) |
747 | { | 748 | { |
748 | struct qlcnic_adapter *adapter = netdev_priv(netdev); | 749 | struct qlcnic_adapter *adapter = netdev_priv(netdev); |
749 | 750 | ||
750 | qlcnic_restore_indev_addr(netdev, NETDEV_DOWN); | 751 | qlcnic_restore_indev_addr(netdev, NETDEV_DOWN); |
751 | clear_bit(vid, adapter->vlans); | 752 | clear_bit(vid, adapter->vlans); |
753 | return 0; | ||
752 | } | 754 | } |
753 | 755 | ||
754 | static void | 756 | static void |
diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c index 1ce4e08037b8..b54898737284 100644 --- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c +++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c | |||
@@ -2349,56 +2349,66 @@ static int qlge_set_features(struct net_device *ndev, | |||
2349 | return 0; | 2349 | return 0; |
2350 | } | 2350 | } |
2351 | 2351 | ||
2352 | static void __qlge_vlan_rx_add_vid(struct ql_adapter *qdev, u16 vid) | 2352 | static int __qlge_vlan_rx_add_vid(struct ql_adapter *qdev, u16 vid) |
2353 | { | 2353 | { |
2354 | u32 enable_bit = MAC_ADDR_E; | 2354 | u32 enable_bit = MAC_ADDR_E; |
2355 | int err; | ||
2355 | 2356 | ||
2356 | if (ql_set_mac_addr_reg | 2357 | err = ql_set_mac_addr_reg(qdev, (u8 *) &enable_bit, |
2357 | (qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) { | 2358 | MAC_ADDR_TYPE_VLAN, vid); |
2359 | if (err) | ||
2358 | netif_err(qdev, ifup, qdev->ndev, | 2360 | netif_err(qdev, ifup, qdev->ndev, |
2359 | "Failed to init vlan address.\n"); | 2361 | "Failed to init vlan address.\n"); |
2360 | } | 2362 | return err; |
2361 | } | 2363 | } |
2362 | 2364 | ||
2363 | static void qlge_vlan_rx_add_vid(struct net_device *ndev, u16 vid) | 2365 | static int qlge_vlan_rx_add_vid(struct net_device *ndev, u16 vid) |
2364 | { | 2366 | { |
2365 | struct ql_adapter *qdev = netdev_priv(ndev); | 2367 | struct ql_adapter *qdev = netdev_priv(ndev); |
2366 | int status; | 2368 | int status; |
2369 | int err; | ||
2367 | 2370 | ||
2368 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); | 2371 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); |
2369 | if (status) | 2372 | if (status) |
2370 | return; | 2373 | return status; |
2371 | 2374 | ||
2372 | __qlge_vlan_rx_add_vid(qdev, vid); | 2375 | err = __qlge_vlan_rx_add_vid(qdev, vid); |
2373 | set_bit(vid, qdev->active_vlans); | 2376 | set_bit(vid, qdev->active_vlans); |
2374 | 2377 | ||
2375 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); | 2378 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); |
2379 | |||
2380 | return err; | ||
2376 | } | 2381 | } |
2377 | 2382 | ||
2378 | static void __qlge_vlan_rx_kill_vid(struct ql_adapter *qdev, u16 vid) | 2383 | static int __qlge_vlan_rx_kill_vid(struct ql_adapter *qdev, u16 vid) |
2379 | { | 2384 | { |
2380 | u32 enable_bit = 0; | 2385 | u32 enable_bit = 0; |
2386 | int err; | ||
2381 | 2387 | ||
2382 | if (ql_set_mac_addr_reg | 2388 | err = ql_set_mac_addr_reg(qdev, (u8 *) &enable_bit, |
2383 | (qdev, (u8 *) &enable_bit, MAC_ADDR_TYPE_VLAN, vid)) { | 2389 | MAC_ADDR_TYPE_VLAN, vid); |
2390 | if (err) | ||
2384 | netif_err(qdev, ifup, qdev->ndev, | 2391 | netif_err(qdev, ifup, qdev->ndev, |
2385 | "Failed to clear vlan address.\n"); | 2392 | "Failed to clear vlan address.\n"); |
2386 | } | 2393 | return err; |
2387 | } | 2394 | } |
2388 | 2395 | ||
2389 | static void qlge_vlan_rx_kill_vid(struct net_device *ndev, u16 vid) | 2396 | static int qlge_vlan_rx_kill_vid(struct net_device *ndev, u16 vid) |
2390 | { | 2397 | { |
2391 | struct ql_adapter *qdev = netdev_priv(ndev); | 2398 | struct ql_adapter *qdev = netdev_priv(ndev); |
2392 | int status; | 2399 | int status; |
2400 | int err; | ||
2393 | 2401 | ||
2394 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); | 2402 | status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK); |
2395 | if (status) | 2403 | if (status) |
2396 | return; | 2404 | return status; |
2397 | 2405 | ||
2398 | __qlge_vlan_rx_kill_vid(qdev, vid); | 2406 | err = __qlge_vlan_rx_kill_vid(qdev, vid); |
2399 | clear_bit(vid, qdev->active_vlans); | 2407 | clear_bit(vid, qdev->active_vlans); |
2400 | 2408 | ||
2401 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); | 2409 | ql_sem_unlock(qdev, SEM_MAC_ADDR_MASK); |
2410 | |||
2411 | return err; | ||
2402 | } | 2412 | } |
2403 | 2413 | ||
2404 | static void qlge_restore_vlan(struct ql_adapter *qdev) | 2414 | static void qlge_restore_vlan(struct ql_adapter *qdev) |
diff --git a/drivers/net/ethernet/tehuti/tehuti.c b/drivers/net/ethernet/tehuti/tehuti.c index 3a90af6d111c..4b19e9b0606b 100644 --- a/drivers/net/ethernet/tehuti/tehuti.c +++ b/drivers/net/ethernet/tehuti/tehuti.c | |||
@@ -727,9 +727,10 @@ static void __bdx_vlan_rx_vid(struct net_device *ndev, uint16_t vid, int enable) | |||
727 | * @ndev network device | 727 | * @ndev network device |
728 | * @vid VLAN vid to add | 728 | * @vid VLAN vid to add |
729 | */ | 729 | */ |
730 | static void bdx_vlan_rx_add_vid(struct net_device *ndev, uint16_t vid) | 730 | static int bdx_vlan_rx_add_vid(struct net_device *ndev, uint16_t vid) |
731 | { | 731 | { |
732 | __bdx_vlan_rx_vid(ndev, vid, 1); | 732 | __bdx_vlan_rx_vid(ndev, vid, 1); |
733 | return 0; | ||
733 | } | 734 | } |
734 | 735 | ||
735 | /* | 736 | /* |
@@ -737,9 +738,10 @@ static void bdx_vlan_rx_add_vid(struct net_device *ndev, uint16_t vid) | |||
737 | * @ndev network device | 738 | * @ndev network device |
738 | * @vid VLAN vid to kill | 739 | * @vid VLAN vid to kill |
739 | */ | 740 | */ |
740 | static void bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid) | 741 | static int bdx_vlan_rx_kill_vid(struct net_device *ndev, unsigned short vid) |
741 | { | 742 | { |
742 | __bdx_vlan_rx_vid(ndev, vid, 0); | 743 | __bdx_vlan_rx_vid(ndev, vid, 0); |
744 | return 0; | ||
743 | } | 745 | } |
744 | 746 | ||
745 | /** | 747 | /** |
diff --git a/drivers/net/ethernet/via/via-rhine.c b/drivers/net/ethernet/via/via-rhine.c index 5587ecdf32e3..bcdbdc72b558 100644 --- a/drivers/net/ethernet/via/via-rhine.c +++ b/drivers/net/ethernet/via/via-rhine.c | |||
@@ -488,8 +488,8 @@ static int netdev_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); | |||
488 | static const struct ethtool_ops netdev_ethtool_ops; | 488 | static const struct ethtool_ops netdev_ethtool_ops; |
489 | static int rhine_close(struct net_device *dev); | 489 | static int rhine_close(struct net_device *dev); |
490 | static void rhine_shutdown (struct pci_dev *pdev); | 490 | static void rhine_shutdown (struct pci_dev *pdev); |
491 | static void rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid); | 491 | static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid); |
492 | static void rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); | 492 | static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid); |
493 | static void rhine_set_cam(void __iomem *ioaddr, int idx, u8 *addr); | 493 | static void rhine_set_cam(void __iomem *ioaddr, int idx, u8 *addr); |
494 | static void rhine_set_vlan_cam(void __iomem *ioaddr, int idx, u8 *addr); | 494 | static void rhine_set_vlan_cam(void __iomem *ioaddr, int idx, u8 *addr); |
495 | static void rhine_set_cam_mask(void __iomem *ioaddr, u32 mask); | 495 | static void rhine_set_cam_mask(void __iomem *ioaddr, u32 mask); |
@@ -1261,7 +1261,7 @@ static void rhine_update_vcam(struct net_device *dev) | |||
1261 | rhine_set_vlan_cam_mask(ioaddr, vCAMmask); | 1261 | rhine_set_vlan_cam_mask(ioaddr, vCAMmask); |
1262 | } | 1262 | } |
1263 | 1263 | ||
1264 | static void rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 1264 | static int rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
1265 | { | 1265 | { |
1266 | struct rhine_private *rp = netdev_priv(dev); | 1266 | struct rhine_private *rp = netdev_priv(dev); |
1267 | 1267 | ||
@@ -1269,9 +1269,10 @@ static void rhine_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
1269 | set_bit(vid, rp->active_vlans); | 1269 | set_bit(vid, rp->active_vlans); |
1270 | rhine_update_vcam(dev); | 1270 | rhine_update_vcam(dev); |
1271 | spin_unlock_irq(&rp->lock); | 1271 | spin_unlock_irq(&rp->lock); |
1272 | return 0; | ||
1272 | } | 1273 | } |
1273 | 1274 | ||
1274 | static void rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 1275 | static int rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
1275 | { | 1276 | { |
1276 | struct rhine_private *rp = netdev_priv(dev); | 1277 | struct rhine_private *rp = netdev_priv(dev); |
1277 | 1278 | ||
@@ -1279,6 +1280,7 @@ static void rhine_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
1279 | clear_bit(vid, rp->active_vlans); | 1280 | clear_bit(vid, rp->active_vlans); |
1280 | rhine_update_vcam(dev); | 1281 | rhine_update_vcam(dev); |
1281 | spin_unlock_irq(&rp->lock); | 1282 | spin_unlock_irq(&rp->lock); |
1283 | return 0; | ||
1282 | } | 1284 | } |
1283 | 1285 | ||
1284 | static void init_registers(struct net_device *dev) | 1286 | static void init_registers(struct net_device *dev) |
diff --git a/drivers/net/ethernet/via/via-velocity.c b/drivers/net/ethernet/via/via-velocity.c index 59bb5fd56afe..4128d6b8cc28 100644 --- a/drivers/net/ethernet/via/via-velocity.c +++ b/drivers/net/ethernet/via/via-velocity.c | |||
@@ -522,7 +522,7 @@ static void velocity_init_cam_filter(struct velocity_info *vptr) | |||
522 | mac_set_vlan_cam_mask(regs, vptr->vCAMmask); | 522 | mac_set_vlan_cam_mask(regs, vptr->vCAMmask); |
523 | } | 523 | } |
524 | 524 | ||
525 | static void velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 525 | static int velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
526 | { | 526 | { |
527 | struct velocity_info *vptr = netdev_priv(dev); | 527 | struct velocity_info *vptr = netdev_priv(dev); |
528 | 528 | ||
@@ -530,9 +530,10 @@ static void velocity_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
530 | set_bit(vid, vptr->active_vlans); | 530 | set_bit(vid, vptr->active_vlans); |
531 | velocity_init_cam_filter(vptr); | 531 | velocity_init_cam_filter(vptr); |
532 | spin_unlock_irq(&vptr->lock); | 532 | spin_unlock_irq(&vptr->lock); |
533 | return 0; | ||
533 | } | 534 | } |
534 | 535 | ||
535 | static void velocity_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 536 | static int velocity_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
536 | { | 537 | { |
537 | struct velocity_info *vptr = netdev_priv(dev); | 538 | struct velocity_info *vptr = netdev_priv(dev); |
538 | 539 | ||
@@ -540,6 +541,7 @@ static void velocity_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid | |||
540 | clear_bit(vid, vptr->active_vlans); | 541 | clear_bit(vid, vptr->active_vlans); |
541 | velocity_init_cam_filter(vptr); | 542 | velocity_init_cam_filter(vptr); |
542 | spin_unlock_irq(&vptr->lock); | 543 | spin_unlock_irq(&vptr->lock); |
544 | return 0; | ||
543 | } | 545 | } |
544 | 546 | ||
545 | static void velocity_init_rx_ring_indexes(struct velocity_info *vptr) | 547 | static void velocity_init_rx_ring_indexes(struct velocity_info *vptr) |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index 74134970b709..2511bc5c34f3 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -520,7 +520,7 @@ static struct rtnl_link_stats64 *macvlan_dev_get_stats64(struct net_device *dev, | |||
520 | return stats; | 520 | return stats; |
521 | } | 521 | } |
522 | 522 | ||
523 | static void macvlan_vlan_rx_add_vid(struct net_device *dev, | 523 | static int macvlan_vlan_rx_add_vid(struct net_device *dev, |
524 | unsigned short vid) | 524 | unsigned short vid) |
525 | { | 525 | { |
526 | struct macvlan_dev *vlan = netdev_priv(dev); | 526 | struct macvlan_dev *vlan = netdev_priv(dev); |
@@ -528,10 +528,11 @@ static void macvlan_vlan_rx_add_vid(struct net_device *dev, | |||
528 | const struct net_device_ops *ops = lowerdev->netdev_ops; | 528 | const struct net_device_ops *ops = lowerdev->netdev_ops; |
529 | 529 | ||
530 | if (ops->ndo_vlan_rx_add_vid) | 530 | if (ops->ndo_vlan_rx_add_vid) |
531 | ops->ndo_vlan_rx_add_vid(lowerdev, vid); | 531 | return ops->ndo_vlan_rx_add_vid(lowerdev, vid); |
532 | return 0; | ||
532 | } | 533 | } |
533 | 534 | ||
534 | static void macvlan_vlan_rx_kill_vid(struct net_device *dev, | 535 | static int macvlan_vlan_rx_kill_vid(struct net_device *dev, |
535 | unsigned short vid) | 536 | unsigned short vid) |
536 | { | 537 | { |
537 | struct macvlan_dev *vlan = netdev_priv(dev); | 538 | struct macvlan_dev *vlan = netdev_priv(dev); |
@@ -539,7 +540,8 @@ static void macvlan_vlan_rx_kill_vid(struct net_device *dev, | |||
539 | const struct net_device_ops *ops = lowerdev->netdev_ops; | 540 | const struct net_device_ops *ops = lowerdev->netdev_ops; |
540 | 541 | ||
541 | if (ops->ndo_vlan_rx_kill_vid) | 542 | if (ops->ndo_vlan_rx_kill_vid) |
542 | ops->ndo_vlan_rx_kill_vid(lowerdev, vid); | 543 | return ops->ndo_vlan_rx_kill_vid(lowerdev, vid); |
544 | return 0; | ||
543 | } | 545 | } |
544 | 546 | ||
545 | static void macvlan_ethtool_get_drvinfo(struct net_device *dev, | 547 | static void macvlan_ethtool_get_drvinfo(struct net_device *dev, |
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 064155d56bce..8e8bf958539e 100644 --- a/drivers/net/team/team.c +++ b/drivers/net/team/team.c | |||
@@ -902,7 +902,7 @@ team_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats) | |||
902 | return stats; | 902 | return stats; |
903 | } | 903 | } |
904 | 904 | ||
905 | static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid) | 905 | static int team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid) |
906 | { | 906 | { |
907 | struct team *team = netdev_priv(dev); | 907 | struct team *team = netdev_priv(dev); |
908 | struct team_port *port; | 908 | struct team_port *port; |
@@ -915,9 +915,11 @@ static void team_vlan_rx_add_vid(struct net_device *dev, uint16_t vid) | |||
915 | ops->ndo_vlan_rx_add_vid(port->dev, vid); | 915 | ops->ndo_vlan_rx_add_vid(port->dev, vid); |
916 | } | 916 | } |
917 | rcu_read_unlock(); | 917 | rcu_read_unlock(); |
918 | |||
919 | return 0; | ||
918 | } | 920 | } |
919 | 921 | ||
920 | static void team_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) | 922 | static int team_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) |
921 | { | 923 | { |
922 | struct team *team = netdev_priv(dev); | 924 | struct team *team = netdev_priv(dev); |
923 | struct team_port *port; | 925 | struct team_port *port; |
@@ -930,6 +932,8 @@ static void team_vlan_rx_kill_vid(struct net_device *dev, uint16_t vid) | |||
930 | ops->ndo_vlan_rx_kill_vid(port->dev, vid); | 932 | ops->ndo_vlan_rx_kill_vid(port->dev, vid); |
931 | } | 933 | } |
932 | rcu_read_unlock(); | 934 | rcu_read_unlock(); |
935 | |||
936 | return 0; | ||
933 | } | 937 | } |
934 | 938 | ||
935 | static int team_add_slave(struct net_device *dev, struct net_device *port_dev) | 939 | static int team_add_slave(struct net_device *dev, struct net_device *port_dev) |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index 5a961720f64c..609c51f90e6c 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
@@ -855,7 +855,7 @@ static void virtnet_set_rx_mode(struct net_device *dev) | |||
855 | kfree(buf); | 855 | kfree(buf); |
856 | } | 856 | } |
857 | 857 | ||
858 | static void virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid) | 858 | static int virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid) |
859 | { | 859 | { |
860 | struct virtnet_info *vi = netdev_priv(dev); | 860 | struct virtnet_info *vi = netdev_priv(dev); |
861 | struct scatterlist sg; | 861 | struct scatterlist sg; |
@@ -865,9 +865,10 @@ static void virtnet_vlan_rx_add_vid(struct net_device *dev, u16 vid) | |||
865 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, | 865 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, |
866 | VIRTIO_NET_CTRL_VLAN_ADD, &sg, 1, 0)) | 866 | VIRTIO_NET_CTRL_VLAN_ADD, &sg, 1, 0)) |
867 | dev_warn(&dev->dev, "Failed to add VLAN ID %d.\n", vid); | 867 | dev_warn(&dev->dev, "Failed to add VLAN ID %d.\n", vid); |
868 | return 0; | ||
868 | } | 869 | } |
869 | 870 | ||
870 | static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid) | 871 | static int virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid) |
871 | { | 872 | { |
872 | struct virtnet_info *vi = netdev_priv(dev); | 873 | struct virtnet_info *vi = netdev_priv(dev); |
873 | struct scatterlist sg; | 874 | struct scatterlist sg; |
@@ -877,6 +878,7 @@ static void virtnet_vlan_rx_kill_vid(struct net_device *dev, u16 vid) | |||
877 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, | 878 | if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_VLAN, |
878 | VIRTIO_NET_CTRL_VLAN_DEL, &sg, 1, 0)) | 879 | VIRTIO_NET_CTRL_VLAN_DEL, &sg, 1, 0)) |
879 | dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid); | 880 | dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid); |
881 | return 0; | ||
880 | } | 882 | } |
881 | 883 | ||
882 | static void virtnet_get_ringparam(struct net_device *dev, | 884 | static void virtnet_get_ringparam(struct net_device *dev, |
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c index d96bfb1ac20b..1c2ae11a9e35 100644 --- a/drivers/net/vmxnet3/vmxnet3_drv.c +++ b/drivers/net/vmxnet3/vmxnet3_drv.c | |||
@@ -1926,7 +1926,7 @@ vmxnet3_restore_vlan(struct vmxnet3_adapter *adapter) | |||
1926 | } | 1926 | } |
1927 | 1927 | ||
1928 | 1928 | ||
1929 | static void | 1929 | static int |
1930 | vmxnet3_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | 1930 | vmxnet3_vlan_rx_add_vid(struct net_device *netdev, u16 vid) |
1931 | { | 1931 | { |
1932 | struct vmxnet3_adapter *adapter = netdev_priv(netdev); | 1932 | struct vmxnet3_adapter *adapter = netdev_priv(netdev); |
@@ -1943,10 +1943,12 @@ vmxnet3_vlan_rx_add_vid(struct net_device *netdev, u16 vid) | |||
1943 | } | 1943 | } |
1944 | 1944 | ||
1945 | set_bit(vid, adapter->active_vlans); | 1945 | set_bit(vid, adapter->active_vlans); |
1946 | |||
1947 | return 0; | ||
1946 | } | 1948 | } |
1947 | 1949 | ||
1948 | 1950 | ||
1949 | static void | 1951 | static int |
1950 | vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | 1952 | vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) |
1951 | { | 1953 | { |
1952 | struct vmxnet3_adapter *adapter = netdev_priv(netdev); | 1954 | struct vmxnet3_adapter *adapter = netdev_priv(netdev); |
@@ -1963,6 +1965,8 @@ vmxnet3_vlan_rx_kill_vid(struct net_device *netdev, u16 vid) | |||
1963 | } | 1965 | } |
1964 | 1966 | ||
1965 | clear_bit(vid, adapter->active_vlans); | 1967 | clear_bit(vid, adapter->active_vlans); |
1968 | |||
1969 | return 0; | ||
1966 | } | 1970 | } |
1967 | 1971 | ||
1968 | 1972 | ||
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index a21ae3d549db..c4e2004bd0e8 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -301,21 +301,21 @@ static void qeth_l2_process_vlans(struct qeth_card *card) | |||
301 | spin_unlock_bh(&card->vlanlock); | 301 | spin_unlock_bh(&card->vlanlock); |
302 | } | 302 | } |
303 | 303 | ||
304 | static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 304 | static int qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
305 | { | 305 | { |
306 | struct qeth_card *card = dev->ml_priv; | 306 | struct qeth_card *card = dev->ml_priv; |
307 | struct qeth_vlan_vid *id; | 307 | struct qeth_vlan_vid *id; |
308 | 308 | ||
309 | QETH_CARD_TEXT_(card, 4, "aid:%d", vid); | 309 | QETH_CARD_TEXT_(card, 4, "aid:%d", vid); |
310 | if (!vid) | 310 | if (!vid) |
311 | return; | 311 | return 0; |
312 | if (card->info.type == QETH_CARD_TYPE_OSM) { | 312 | if (card->info.type == QETH_CARD_TYPE_OSM) { |
313 | QETH_CARD_TEXT(card, 3, "aidOSM"); | 313 | QETH_CARD_TEXT(card, 3, "aidOSM"); |
314 | return; | 314 | return 0; |
315 | } | 315 | } |
316 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { | 316 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { |
317 | QETH_CARD_TEXT(card, 3, "aidREC"); | 317 | QETH_CARD_TEXT(card, 3, "aidREC"); |
318 | return; | 318 | return 0; |
319 | } | 319 | } |
320 | id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC); | 320 | id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC); |
321 | if (id) { | 321 | if (id) { |
@@ -324,10 +324,13 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
324 | spin_lock_bh(&card->vlanlock); | 324 | spin_lock_bh(&card->vlanlock); |
325 | list_add_tail(&id->list, &card->vid_list); | 325 | list_add_tail(&id->list, &card->vid_list); |
326 | spin_unlock_bh(&card->vlanlock); | 326 | spin_unlock_bh(&card->vlanlock); |
327 | } else { | ||
328 | return -ENOMEM; | ||
327 | } | 329 | } |
330 | return 0; | ||
328 | } | 331 | } |
329 | 332 | ||
330 | static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 333 | static int qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
331 | { | 334 | { |
332 | struct qeth_vlan_vid *id, *tmpid = NULL; | 335 | struct qeth_vlan_vid *id, *tmpid = NULL; |
333 | struct qeth_card *card = dev->ml_priv; | 336 | struct qeth_card *card = dev->ml_priv; |
@@ -335,11 +338,11 @@ static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
335 | QETH_CARD_TEXT_(card, 4, "kid:%d", vid); | 338 | QETH_CARD_TEXT_(card, 4, "kid:%d", vid); |
336 | if (card->info.type == QETH_CARD_TYPE_OSM) { | 339 | if (card->info.type == QETH_CARD_TYPE_OSM) { |
337 | QETH_CARD_TEXT(card, 3, "kidOSM"); | 340 | QETH_CARD_TEXT(card, 3, "kidOSM"); |
338 | return; | 341 | return 0; |
339 | } | 342 | } |
340 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { | 343 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { |
341 | QETH_CARD_TEXT(card, 3, "kidREC"); | 344 | QETH_CARD_TEXT(card, 3, "kidREC"); |
342 | return; | 345 | return 0; |
343 | } | 346 | } |
344 | spin_lock_bh(&card->vlanlock); | 347 | spin_lock_bh(&card->vlanlock); |
345 | list_for_each_entry(id, &card->vid_list, list) { | 348 | list_for_each_entry(id, &card->vid_list, list) { |
@@ -355,6 +358,7 @@ static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
355 | kfree(tmpid); | 358 | kfree(tmpid); |
356 | } | 359 | } |
357 | qeth_l2_set_multicast_list(card->dev); | 360 | qeth_l2_set_multicast_list(card->dev); |
361 | return 0; | ||
358 | } | 362 | } |
359 | 363 | ||
360 | static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode) | 364 | static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode) |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index b2a55e3fde0b..b3b045c21e2c 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -1869,15 +1869,15 @@ static void qeth_l3_free_vlan_addresses(struct qeth_card *card, | |||
1869 | qeth_l3_free_vlan_addresses6(card, vid); | 1869 | qeth_l3_free_vlan_addresses6(card, vid); |
1870 | } | 1870 | } |
1871 | 1871 | ||
1872 | static void qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | 1872 | static int qeth_l3_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) |
1873 | { | 1873 | { |
1874 | struct qeth_card *card = dev->ml_priv; | 1874 | struct qeth_card *card = dev->ml_priv; |
1875 | 1875 | ||
1876 | set_bit(vid, card->active_vlans); | 1876 | set_bit(vid, card->active_vlans); |
1877 | return; | 1877 | return 0; |
1878 | } | 1878 | } |
1879 | 1879 | ||
1880 | static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | 1880 | static int qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) |
1881 | { | 1881 | { |
1882 | struct qeth_card *card = dev->ml_priv; | 1882 | struct qeth_card *card = dev->ml_priv; |
1883 | unsigned long flags; | 1883 | unsigned long flags; |
@@ -1885,7 +1885,7 @@ static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
1885 | QETH_CARD_TEXT_(card, 4, "kid:%d", vid); | 1885 | QETH_CARD_TEXT_(card, 4, "kid:%d", vid); |
1886 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { | 1886 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { |
1887 | QETH_CARD_TEXT(card, 3, "kidREC"); | 1887 | QETH_CARD_TEXT(card, 3, "kidREC"); |
1888 | return; | 1888 | return 0; |
1889 | } | 1889 | } |
1890 | spin_lock_irqsave(&card->vlanlock, flags); | 1890 | spin_lock_irqsave(&card->vlanlock, flags); |
1891 | /* unregister IP addresses of vlan device */ | 1891 | /* unregister IP addresses of vlan device */ |
@@ -1893,6 +1893,7 @@ static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
1893 | clear_bit(vid, card->active_vlans); | 1893 | clear_bit(vid, card->active_vlans); |
1894 | spin_unlock_irqrestore(&card->vlanlock, flags); | 1894 | spin_unlock_irqrestore(&card->vlanlock, flags); |
1895 | qeth_l3_set_multicast_list(card->dev); | 1895 | qeth_l3_set_multicast_list(card->dev); |
1896 | return 0; | ||
1896 | } | 1897 | } |
1897 | 1898 | ||
1898 | static inline int qeth_l3_rebuild_skb(struct qeth_card *card, | 1899 | static inline int qeth_l3_rebuild_skb(struct qeth_card *card, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index eef257c76a40..f7bff9615728 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -792,11 +792,11 @@ struct netdev_tc_txq { | |||
792 | * 3. Update dev->stats asynchronously and atomically, and define | 792 | * 3. Update dev->stats asynchronously and atomically, and define |
793 | * neither operation. | 793 | * neither operation. |
794 | * | 794 | * |
795 | * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); | 795 | * int (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); |
796 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) | 796 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) |
797 | * this function is called when a VLAN id is registered. | 797 | * this function is called when a VLAN id is registered. |
798 | * | 798 | * |
799 | * void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid); | 799 | * int (*ndo_vlan_rx_kill_vid)(struct net_device *dev, unsigned short vid); |
800 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) | 800 | * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) |
801 | * this function is called when a VLAN id is unregistered. | 801 | * this function is called when a VLAN id is unregistered. |
802 | * | 802 | * |
@@ -911,9 +911,9 @@ struct net_device_ops { | |||
911 | struct rtnl_link_stats64 *storage); | 911 | struct rtnl_link_stats64 *storage); |
912 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | 912 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
913 | 913 | ||
914 | void (*ndo_vlan_rx_add_vid)(struct net_device *dev, | 914 | int (*ndo_vlan_rx_add_vid)(struct net_device *dev, |
915 | unsigned short vid); | 915 | unsigned short vid); |
916 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, | 916 | int (*ndo_vlan_rx_kill_vid)(struct net_device *dev, |
917 | unsigned short vid); | 917 | unsigned short vid); |
918 | #ifdef CONFIG_NET_POLL_CONTROLLER | 918 | #ifdef CONFIG_NET_POLL_CONTROLLER |
919 | void (*ndo_poll_controller)(struct net_device *dev); | 919 | void (*ndo_poll_controller)(struct net_device *dev); |