ocelot.c (2491b544ff3aa9717d427033206fa793be53429d) | ocelot.c (2c1d029a017f23e912f5d549ad8a2d84428a5017) |
---|---|
1// SPDX-License-Identifier: (GPL-2.0 OR MIT) 2/* 3 * Microsemi Ocelot Switch driver 4 * 5 * Copyright (c) 2017 Microsemi Corporation 6 */ 7#include <linux/etherdevice.h> 8#include <linux/ethtool.h> --- 896 unchanged lines hidden (view full) --- 905} 906 907static int ocelot_set_features(struct net_device *dev, 908 netdev_features_t features) 909{ 910 struct ocelot_port *port = netdev_priv(dev); 911 netdev_features_t changed = dev->features ^ features; 912 | 1// SPDX-License-Identifier: (GPL-2.0 OR MIT) 2/* 3 * Microsemi Ocelot Switch driver 4 * 5 * Copyright (c) 2017 Microsemi Corporation 6 */ 7#include <linux/etherdevice.h> 8#include <linux/ethtool.h> --- 896 unchanged lines hidden (view full) --- 905} 906 907static int ocelot_set_features(struct net_device *dev, 908 netdev_features_t features) 909{ 910 struct ocelot_port *port = netdev_priv(dev); 911 netdev_features_t changed = dev->features ^ features; 912 |
913 if ((dev->features & NETIF_F_HW_TC) > (features & NETIF_F_HW_TC) && 914 port->tc.offload_cnt) { 915 netdev_err(dev, 916 "Cannot disable HW TC offload while offloads active\n"); 917 return -EBUSY; 918 } 919 |
|
913 if (changed & NETIF_F_HW_VLAN_CTAG_FILTER) 914 ocelot_vlan_mode(port, features); 915 916 return 0; 917} 918 919static int ocelot_get_port_parent_id(struct net_device *dev, 920 struct netdev_phys_item_id *ppid) --- 17 unchanged lines hidden (view full) --- 938 .ndo_get_stats64 = ocelot_get_stats64, 939 .ndo_fdb_add = ocelot_fdb_add, 940 .ndo_fdb_del = ocelot_fdb_del, 941 .ndo_fdb_dump = ocelot_fdb_dump, 942 .ndo_vlan_rx_add_vid = ocelot_vlan_rx_add_vid, 943 .ndo_vlan_rx_kill_vid = ocelot_vlan_rx_kill_vid, 944 .ndo_set_features = ocelot_set_features, 945 .ndo_get_port_parent_id = ocelot_get_port_parent_id, | 920 if (changed & NETIF_F_HW_VLAN_CTAG_FILTER) 921 ocelot_vlan_mode(port, features); 922 923 return 0; 924} 925 926static int ocelot_get_port_parent_id(struct net_device *dev, 927 struct netdev_phys_item_id *ppid) --- 17 unchanged lines hidden (view full) --- 945 .ndo_get_stats64 = ocelot_get_stats64, 946 .ndo_fdb_add = ocelot_fdb_add, 947 .ndo_fdb_del = ocelot_fdb_del, 948 .ndo_fdb_dump = ocelot_fdb_dump, 949 .ndo_vlan_rx_add_vid = ocelot_vlan_rx_add_vid, 950 .ndo_vlan_rx_kill_vid = ocelot_vlan_rx_kill_vid, 951 .ndo_set_features = ocelot_set_features, 952 .ndo_get_port_parent_id = ocelot_get_port_parent_id, |
953 .ndo_setup_tc = ocelot_setup_tc, |
|
946}; 947 948static void ocelot_get_strings(struct net_device *netdev, u32 sset, u8 *data) 949{ 950 struct ocelot_port *port = netdev_priv(netdev); 951 struct ocelot *ocelot = port->ocelot; 952 int i; 953 --- 704 unchanged lines hidden (view full) --- 1658 ocelot_port->chip_port = port; 1659 ocelot_port->phy = phy; 1660 INIT_LIST_HEAD(&ocelot_port->mc); 1661 ocelot->ports[port] = ocelot_port; 1662 1663 dev->netdev_ops = &ocelot_port_netdev_ops; 1664 dev->ethtool_ops = &ocelot_ethtool_ops; 1665 | 954}; 955 956static void ocelot_get_strings(struct net_device *netdev, u32 sset, u8 *data) 957{ 958 struct ocelot_port *port = netdev_priv(netdev); 959 struct ocelot *ocelot = port->ocelot; 960 int i; 961 --- 704 unchanged lines hidden (view full) --- 1666 ocelot_port->chip_port = port; 1667 ocelot_port->phy = phy; 1668 INIT_LIST_HEAD(&ocelot_port->mc); 1669 ocelot->ports[port] = ocelot_port; 1670 1671 dev->netdev_ops = &ocelot_port_netdev_ops; 1672 dev->ethtool_ops = &ocelot_ethtool_ops; 1673 |
1666 dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_RXFCS; 1667 dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; | 1674 dev->hw_features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_RXFCS | 1675 NETIF_F_HW_TC; 1676 dev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | NETIF_F_HW_TC; |
1668 1669 memcpy(dev->dev_addr, ocelot->base_mac, ETH_ALEN); 1670 dev->dev_addr[ETH_ALEN - 1] += port; 1671 ocelot_mact_learn(ocelot, PGID_CPU, dev->dev_addr, ocelot_port->pvid, 1672 ENTRYTYPE_LOCKED); 1673 1674 err = register_netdev(dev); 1675 if (err) { --- 157 unchanged lines hidden --- | 1677 1678 memcpy(dev->dev_addr, ocelot->base_mac, ETH_ALEN); 1679 dev->dev_addr[ETH_ALEN - 1] += port; 1680 ocelot_mact_learn(ocelot, PGID_CPU, dev->dev_addr, ocelot_port->pvid, 1681 ENTRYTYPE_LOCKED); 1682 1683 err = register_netdev(dev); 1684 if (err) { --- 157 unchanged lines hidden --- |