diff options
Diffstat (limited to 'net/core/dev.c')
| -rw-r--r-- | net/core/dev.c | 28 | 
1 files changed, 15 insertions, 13 deletions
diff --git a/net/core/dev.c b/net/core/dev.c index 3721db716350..b1b0c8d4d7df 100644 --- a/net/core/dev.c +++ b/net/core/dev.c @@ -2420,7 +2420,7 @@ EXPORT_SYMBOL(netdev_rx_csum_fault);   * 2. No high memory really exists on this machine.   */ -static int illegal_highdma(struct net_device *dev, struct sk_buff *skb) +static int illegal_highdma(const struct net_device *dev, struct sk_buff *skb)  {  #ifdef CONFIG_HIGHMEM  	int i; @@ -2495,34 +2495,36 @@ static int dev_gso_segment(struct sk_buff *skb, netdev_features_t features)  }  static netdev_features_t harmonize_features(struct sk_buff *skb, -	netdev_features_t features) +					    const struct net_device *dev, +					    netdev_features_t features)  {  	if (skb->ip_summed != CHECKSUM_NONE &&  	    !can_checksum_protocol(features, skb_network_protocol(skb))) {  		features &= ~NETIF_F_ALL_CSUM; -	} else if (illegal_highdma(skb->dev, skb)) { +	} else if (illegal_highdma(dev, skb)) {  		features &= ~NETIF_F_SG;  	}  	return features;  } -netdev_features_t netif_skb_features(struct sk_buff *skb) +netdev_features_t netif_skb_dev_features(struct sk_buff *skb, +					 const struct net_device *dev)  {  	__be16 protocol = skb->protocol; -	netdev_features_t features = skb->dev->features; +	netdev_features_t features = dev->features; -	if (skb_shinfo(skb)->gso_segs > skb->dev->gso_max_segs) +	if (skb_shinfo(skb)->gso_segs > dev->gso_max_segs)  		features &= ~NETIF_F_GSO_MASK;  	if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) {  		struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;  		protocol = veh->h_vlan_encapsulated_proto;  	} else if (!vlan_tx_tag_present(skb)) { -		return harmonize_features(skb, features); +		return harmonize_features(skb, dev, features);  	} -	features &= (skb->dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX | +	features &= (dev->vlan_features | NETIF_F_HW_VLAN_CTAG_TX |  					       NETIF_F_HW_VLAN_STAG_TX);  	if (protocol == htons(ETH_P_8021Q) || protocol == htons(ETH_P_8021AD)) @@ -2530,9 +2532,9 @@ netdev_features_t netif_skb_features(struct sk_buff *skb)  				NETIF_F_GEN_CSUM | NETIF_F_HW_VLAN_CTAG_TX |  				NETIF_F_HW_VLAN_STAG_TX; -	return harmonize_features(skb, features); +	return harmonize_features(skb, dev, features);  } -EXPORT_SYMBOL(netif_skb_features); +EXPORT_SYMBOL(netif_skb_dev_features);  int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,  			struct netdev_queue *txq) @@ -2803,7 +2805,7 @@ EXPORT_SYMBOL(dev_loopback_xmit);   *      the BH enable code must have IRQs enabled so that it will not deadlock.   *          --BLG   */ -int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv) +static int __dev_queue_xmit(struct sk_buff *skb, void *accel_priv)  {  	struct net_device *dev = skb->dev;  	struct netdev_queue *txq; @@ -4637,7 +4639,7 @@ struct net_device *netdev_master_upper_dev_get_rcu(struct net_device *dev)  }  EXPORT_SYMBOL(netdev_master_upper_dev_get_rcu); -int netdev_adjacent_sysfs_add(struct net_device *dev, +static int netdev_adjacent_sysfs_add(struct net_device *dev,  			      struct net_device *adj_dev,  			      struct list_head *dev_list)  { @@ -4647,7 +4649,7 @@ int netdev_adjacent_sysfs_add(struct net_device *dev,  	return sysfs_create_link(&(dev->dev.kobj), &(adj_dev->dev.kobj),  				 linkname);  } -void netdev_adjacent_sysfs_del(struct net_device *dev, +static void netdev_adjacent_sysfs_del(struct net_device *dev,  			       char *name,  			       struct list_head *dev_list)  {  | 
