Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f646968f authored by Patrick McHardy's avatar Patrick McHardy Committed by David S. Miller
Browse files

net: vlan: rename NETIF_F_HW_VLAN_* feature flags to NETIF_F_HW_VLAN_CTAG_*



Rename the hardware VLAN acceleration features to include "CTAG" to indicate
that they only support CTAGs. Follow up patches will introduce 802.1ad
server provider tagging (STAGs) and require the distinction for hardware not
supporting acclerating both.

Signed-off-by: default avatarPatrick McHardy <kaber@trash.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c2962897
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -1599,7 +1599,7 @@ static void nes_vlan_mode(struct net_device *netdev, struct nes_device *nesdev,

	/* Enable/Disable VLAN Stripping */
	u32temp = nes_read_indexed(nesdev, NES_IDX_PCIX_DIAG);
	if (features & NETIF_F_HW_VLAN_RX)
	if (features & NETIF_F_HW_VLAN_CTAG_RX)
		u32temp &= 0xfdffffff;
	else
		u32temp	|= 0x02000000;
@@ -1614,10 +1614,10 @@ static netdev_features_t nes_fix_features(struct net_device *netdev, netdev_feat
	 * Since there is no support for separate rx/tx vlan accel
	 * enable/disable make sure tx flag is always in same state as rx.
	 */
	if (features & NETIF_F_HW_VLAN_RX)
		features |= NETIF_F_HW_VLAN_TX;
	if (features & NETIF_F_HW_VLAN_CTAG_RX)
		features |= NETIF_F_HW_VLAN_CTAG_TX;
	else
		features &= ~NETIF_F_HW_VLAN_TX;
		features &= ~NETIF_F_HW_VLAN_CTAG_TX;

	return features;
}
@@ -1628,7 +1628,7 @@ static int nes_set_features(struct net_device *netdev, netdev_features_t feature
	struct nes_device *nesdev = nesvnic->nesdev;
	u32 changed = netdev->features ^ features;

	if (changed & NETIF_F_HW_VLAN_RX)
	if (changed & NETIF_F_HW_VLAN_CTAG_RX)
		nes_vlan_mode(netdev, nesdev, features);

	return 0;
@@ -1706,11 +1706,11 @@ struct net_device *nes_netdev_init(struct nes_device *nesdev,
	netdev->dev_addr[4] = (u8)(u64temp>>8);
	netdev->dev_addr[5] = (u8)u64temp;

	netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_RX;
	netdev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_RXCSUM | NETIF_F_HW_VLAN_CTAG_RX;
	if ((nesvnic->logical_port < 2) || (nesdev->nesadapter->hw_rev != NE020_REV))
		netdev->hw_features |= NETIF_F_TSO;

	netdev->features = netdev->hw_features | NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_TX;
	netdev->features = netdev->hw_features | NETIF_F_HIGHDMA | NETIF_F_HW_VLAN_CTAG_TX;
	netdev->hw_features |= NETIF_F_LRO;

	nes_debug(NES_DBG_INIT, "nesvnic = %p, reported features = 0x%lX, QPid = %d,"
+3 −3
Original line number Diff line number Diff line
@@ -4322,9 +4322,9 @@ static void bond_setup(struct net_device *bond_dev)
	 */

	bond_dev->hw_features = BOND_VLAN_FEATURES |
				NETIF_F_HW_VLAN_TX |
				NETIF_F_HW_VLAN_RX |
				NETIF_F_HW_VLAN_FILTER;
				NETIF_F_HW_VLAN_CTAG_TX |
				NETIF_F_HW_VLAN_CTAG_RX |
				NETIF_F_HW_VLAN_CTAG_FILTER;

	bond_dev->hw_features &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_HW_CSUM);
	bond_dev->features |= bond_dev->hw_features;
+2 −2
Original line number Diff line number Diff line
@@ -2445,9 +2445,9 @@ typhoon_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
	 * settings -- so we only allow the user to toggle the TX processing.
	 */
	dev->hw_features = NETIF_F_SG | NETIF_F_IP_CSUM | NETIF_F_TSO |
		NETIF_F_HW_VLAN_TX;
		NETIF_F_HW_VLAN_CTAG_TX;
	dev->features = dev->hw_features |
		NETIF_F_HW_VLAN_RX | NETIF_F_RXCSUM;
		NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_RXCSUM;

	if(register_netdev(dev) < 0) {
		err_msg = "unable to register netdev";
+1 −1
Original line number Diff line number Diff line
@@ -702,7 +702,7 @@ static int starfire_init_one(struct pci_dev *pdev,
#endif /* ZEROCOPY */

#ifdef VLAN_SUPPORT
	dev->features |= NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_FILTER;
	dev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_CTAG_FILTER;
#endif /* VLAN_RX_KILL_VID */
#ifdef ADDR_64BITS
	dev->features |= NETIF_F_HIGHDMA;
+1 −1
Original line number Diff line number Diff line
@@ -472,7 +472,7 @@ static int acenic_probe_one(struct pci_dev *pdev,
	ap->name = pci_name(pdev);

	dev->features |= NETIF_F_SG | NETIF_F_IP_CSUM;
	dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX;
	dev->features |= NETIF_F_HW_VLAN_CTAG_TX | NETIF_F_HW_VLAN_CTAG_RX;

	dev->watchdog_timeo = 5*HZ;

Loading