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

Commit c8f44aff authored by Michał Mirosław's avatar Michał Mirosław Committed by David S. Miller
Browse files

net: introduce and use netdev_features_t for device features sets



v2:	add couple missing conversions in drivers
	split unexporting netdev_fix_features()
	implemented %pNF
	convert sock::sk_route_(no?)caps

Signed-off-by: default avatarMichał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a59e2ecb
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -1325,11 +1325,12 @@ static int bond_sethwaddr(struct net_device *bond_dev,
	return 0;
}

static u32 bond_fix_features(struct net_device *dev, u32 features)
static netdev_features_t bond_fix_features(struct net_device *dev,
	netdev_features_t features)
{
	struct slave *slave;
	struct bonding *bond = netdev_priv(dev);
	u32 mask;
	netdev_features_t mask;
	int i;

	read_lock(&bond->lock);
@@ -1363,7 +1364,7 @@ static void bond_compute_features(struct bonding *bond)
{
	struct slave *slave;
	struct net_device *bond_dev = bond->dev;
	u32 vlan_features = BOND_VLAN_FEATURES;
	netdev_features_t vlan_features = BOND_VLAN_FEATURES;
	unsigned short max_hard_header_len = ETH_HLEN;
	int i;

@@ -1897,7 +1898,7 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev)
	struct bonding *bond = netdev_priv(bond_dev);
	struct slave *slave, *oldcurrent;
	struct sockaddr addr;
	u32 old_features = bond_dev->features;
	netdev_features_t old_features = bond_dev->features;

	/* slave is not a slave or master is not master of this slave */
	if (!(slave_dev->flags & IFF_SLAVE) ||
+8 −5
Original line number Diff line number Diff line
@@ -411,7 +411,7 @@ static void atl1c_set_multi(struct net_device *netdev)
	}
}

static void __atl1c_vlan_mode(u32 features, u32 *mac_ctrl_data)
static void __atl1c_vlan_mode(netdev_features_t features, u32 *mac_ctrl_data)
{
	if (features & NETIF_F_HW_VLAN_RX) {
		/* enable VLAN tag insert/strip */
@@ -422,7 +422,8 @@ static void __atl1c_vlan_mode(u32 features, u32 *mac_ctrl_data)
	}
}

static void atl1c_vlan_mode(struct net_device *netdev, u32 features)
static void atl1c_vlan_mode(struct net_device *netdev,
	netdev_features_t features)
{
	struct atl1c_adapter *adapter = netdev_priv(netdev);
	struct pci_dev *pdev = adapter->pdev;
@@ -482,7 +483,8 @@ static void atl1c_set_rxbufsize(struct atl1c_adapter *adapter,
		roundup(mtu + ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN, 8) : AT_RX_BUF_SIZE;
}

static u32 atl1c_fix_features(struct net_device *netdev, u32 features)
static netdev_features_t atl1c_fix_features(struct net_device *netdev,
	netdev_features_t features)
{
	/*
	 * Since there is no support for separate rx/tx vlan accel
@@ -499,9 +501,10 @@ static u32 atl1c_fix_features(struct net_device *netdev, u32 features)
	return features;
}

static int atl1c_set_features(struct net_device *netdev, u32 features)
static int atl1c_set_features(struct net_device *netdev,
	netdev_features_t features)
{
	u32 changed = netdev->features ^ features;
	netdev_features_t changed = netdev->features ^ features;

	if (changed & NETIF_F_HW_VLAN_RX)
		atl1c_vlan_mode(netdev, features);
+8 −5
Original line number Diff line number Diff line
@@ -313,7 +313,7 @@ static void atl1e_set_multi(struct net_device *netdev)
	}
}

static void __atl1e_vlan_mode(u32 features, u32 *mac_ctrl_data)
static void __atl1e_vlan_mode(netdev_features_t features, u32 *mac_ctrl_data)
{
	if (features & NETIF_F_HW_VLAN_RX) {
		/* enable VLAN tag insert/strip */
@@ -324,7 +324,8 @@ static void __atl1e_vlan_mode(u32 features, u32 *mac_ctrl_data)
	}
}

static void atl1e_vlan_mode(struct net_device *netdev, u32 features)
static void atl1e_vlan_mode(struct net_device *netdev,
	netdev_features_t features)
{
	struct atl1e_adapter *adapter = netdev_priv(netdev);
	u32 mac_ctrl_data = 0;
@@ -370,7 +371,8 @@ static int atl1e_set_mac_addr(struct net_device *netdev, void *p)
	return 0;
}

static u32 atl1e_fix_features(struct net_device *netdev, u32 features)
static netdev_features_t atl1e_fix_features(struct net_device *netdev,
	netdev_features_t features)
{
	/*
	 * Since there is no support for separate rx/tx vlan accel
@@ -384,9 +386,10 @@ static u32 atl1e_fix_features(struct net_device *netdev, u32 features)
	return features;
}

static int atl1e_set_features(struct net_device *netdev, u32 features)
static int atl1e_set_features(struct net_device *netdev,
	netdev_features_t features)
{
	u32 changed = netdev->features ^ features;
	netdev_features_t changed = netdev->features ^ features;

	if (changed & NETIF_F_HW_VLAN_RX)
		atl1e_vlan_mode(netdev, features);
+8 −5
Original line number Diff line number Diff line
@@ -361,7 +361,7 @@ static inline void atl2_irq_disable(struct atl2_adapter *adapter)
    synchronize_irq(adapter->pdev->irq);
}

static void __atl2_vlan_mode(u32 features, u32 *ctrl)
static void __atl2_vlan_mode(netdev_features_t features, u32 *ctrl)
{
	if (features & NETIF_F_HW_VLAN_RX) {
		/* enable VLAN tag insert/strip */
@@ -372,7 +372,8 @@ static void __atl2_vlan_mode(u32 features, u32 *ctrl)
	}
}

static void atl2_vlan_mode(struct net_device *netdev, u32 features)
static void atl2_vlan_mode(struct net_device *netdev,
	netdev_features_t features)
{
	struct atl2_adapter *adapter = netdev_priv(netdev);
	u32 ctrl;
@@ -391,7 +392,8 @@ static void atl2_restore_vlan(struct atl2_adapter *adapter)
	atl2_vlan_mode(adapter->netdev, adapter->netdev->features);
}

static u32 atl2_fix_features(struct net_device *netdev, u32 features)
static netdev_features_t atl2_fix_features(struct net_device *netdev,
	netdev_features_t features)
{
	/*
	 * Since there is no support for separate rx/tx vlan accel
@@ -405,9 +407,10 @@ static u32 atl2_fix_features(struct net_device *netdev, u32 features)
	return features;
}

static int atl2_set_features(struct net_device *netdev, u32 features)
static int atl2_set_features(struct net_device *netdev,
	netdev_features_t features)
{
	u32 changed = netdev->features ^ features;
	netdev_features_t changed = netdev->features ^ features;

	if (changed & NETIF_F_HW_VLAN_RX)
		atl2_vlan_mode(netdev, features);
+8 −5
Original line number Diff line number Diff line
@@ -211,7 +211,7 @@ static void atlx_link_chg_task(struct work_struct *work)
	spin_unlock_irqrestore(&adapter->lock, flags);
}

static void __atlx_vlan_mode(u32 features, u32 *ctrl)
static void __atlx_vlan_mode(netdev_features_t features, u32 *ctrl)
{
	if (features & NETIF_F_HW_VLAN_RX) {
		/* enable VLAN tag insert/strip */
@@ -222,7 +222,8 @@ static void __atlx_vlan_mode(u32 features, u32 *ctrl)
	}
}

static void atlx_vlan_mode(struct net_device *netdev, u32 features)
static void atlx_vlan_mode(struct net_device *netdev,
	netdev_features_t features)
{
	struct atlx_adapter *adapter = netdev_priv(netdev);
	unsigned long flags;
@@ -242,7 +243,8 @@ static void atlx_restore_vlan(struct atlx_adapter *adapter)
	atlx_vlan_mode(adapter->netdev, adapter->netdev->features);
}

static u32 atlx_fix_features(struct net_device *netdev, u32 features)
static netdev_features_t atlx_fix_features(struct net_device *netdev,
	netdev_features_t features)
{
	/*
	 * Since there is no support for separate rx/tx vlan accel
@@ -256,9 +258,10 @@ static u32 atlx_fix_features(struct net_device *netdev, u32 features)
	return features;
}

static int atlx_set_features(struct net_device *netdev, u32 features)
static int atlx_set_features(struct net_device *netdev,
	netdev_features_t features)
{
	u32 changed = netdev->features ^ features;
	netdev_features_t changed = netdev->features ^ features;

	if (changed & NETIF_F_HW_VLAN_RX)
		atlx_vlan_mode(netdev, features);
Loading