aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/cxgb4/cxgb4_main.c
diff options
context:
space:
mode:
authorDimitris Michailidis <dm@chelsio.com>2010-10-21 07:29:56 -0400
committerDavid S. Miller <davem@davemloft.net>2010-10-24 18:52:31 -0400
commit19ecae2c8fd5e54e40ace914a41d8e1beb41612c (patch)
tree34ad5ce5a7a60d514c812b18691f8eb27d24d59d /drivers/net/cxgb4/cxgb4_main.c
parent8f6d9f40476895571df039b6f1f5230ec7faebad (diff)
cxgb4: update to utilize the newer VLAN infrastructure
Signed-off-by: Dimitris Michailidis <dm@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb4/cxgb4_main.c')
-rw-r--r--drivers/net/cxgb4/cxgb4_main.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/net/cxgb4/cxgb4_main.c b/drivers/net/cxgb4/cxgb4_main.c
index 2a01a23ed409..f17703f410b3 100644
--- a/drivers/net/cxgb4/cxgb4_main.c
+++ b/drivers/net/cxgb4/cxgb4_main.c
@@ -403,7 +403,7 @@ static int link_start(struct net_device *dev)
403 * that step explicitly. 403 * that step explicitly.
404 */ 404 */
405 ret = t4_set_rxmode(pi->adapter, mb, pi->viid, dev->mtu, -1, -1, -1, 405 ret = t4_set_rxmode(pi->adapter, mb, pi->viid, dev->mtu, -1, -1, -1,
406 pi->vlan_grp != NULL, true); 406 !!(dev->features & NETIF_F_HW_VLAN_RX), true);
407 if (ret == 0) { 407 if (ret == 0) {
408 ret = t4_change_mac(pi->adapter, mb, pi->viid, 408 ret = t4_change_mac(pi->adapter, mb, pi->viid,
409 pi->xact_addr_filt, dev->dev_addr, true, 409 pi->xact_addr_filt, dev->dev_addr, true,
@@ -1881,7 +1881,24 @@ static int set_tso(struct net_device *dev, u32 value)
1881 1881
1882static int set_flags(struct net_device *dev, u32 flags) 1882static int set_flags(struct net_device *dev, u32 flags)
1883{ 1883{
1884 return ethtool_op_set_flags(dev, flags, ETH_FLAG_RXHASH); 1884 int err;
1885 unsigned long old_feat = dev->features;
1886
1887 err = ethtool_op_set_flags(dev, flags, ETH_FLAG_RXHASH |
1888 ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN);
1889 if (err)
1890 return err;
1891
1892 if ((old_feat ^ dev->features) & NETIF_F_HW_VLAN_RX) {
1893 const struct port_info *pi = netdev_priv(dev);
1894
1895 err = t4_set_rxmode(pi->adapter, pi->adapter->fn, pi->viid, -1,
1896 -1, -1, -1, !!(flags & ETH_FLAG_RXVLAN),
1897 true);
1898 if (err)
1899 dev->features = old_feat;
1900 }
1901 return err;
1885} 1902}
1886 1903
1887static int get_rss_table(struct net_device *dev, struct ethtool_rxfh_indir *p) 1904static int get_rss_table(struct net_device *dev, struct ethtool_rxfh_indir *p)
@@ -2842,15 +2859,6 @@ static int cxgb_set_mac_addr(struct net_device *dev, void *p)
2842 return 0; 2859 return 0;
2843} 2860}
2844 2861
2845static void vlan_rx_register(struct net_device *dev, struct vlan_group *grp)
2846{
2847 struct port_info *pi = netdev_priv(dev);
2848
2849 pi->vlan_grp = grp;
2850 t4_set_rxmode(pi->adapter, pi->adapter->fn, pi->viid, -1, -1, -1, -1,
2851 grp != NULL, true);
2852}
2853
2854#ifdef CONFIG_NET_POLL_CONTROLLER 2862#ifdef CONFIG_NET_POLL_CONTROLLER
2855static void cxgb_netpoll(struct net_device *dev) 2863static void cxgb_netpoll(struct net_device *dev)
2856{ 2864{
@@ -2878,7 +2886,6 @@ static const struct net_device_ops cxgb4_netdev_ops = {
2878 .ndo_validate_addr = eth_validate_addr, 2886 .ndo_validate_addr = eth_validate_addr,
2879 .ndo_do_ioctl = cxgb_ioctl, 2887 .ndo_do_ioctl = cxgb_ioctl,
2880 .ndo_change_mtu = cxgb_change_mtu, 2888 .ndo_change_mtu = cxgb_change_mtu,
2881 .ndo_vlan_rx_register = vlan_rx_register,
2882#ifdef CONFIG_NET_POLL_CONTROLLER 2889#ifdef CONFIG_NET_POLL_CONTROLLER
2883 .ndo_poll_controller = cxgb_netpoll, 2890 .ndo_poll_controller = cxgb_netpoll,
2884#endif 2891#endif