dev.c (1268afe676ee9431a229fc68a2efb0dad4d5852f) | dev.c (cbda10fa97d72c7a1923be4426171aa90e8c6dab) |
---|---|
1/* 2 * NET3 Protocol independent device support routines. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 1987 unchanged lines hidden (view full) --- 1996 ((features & NETIF_F_V6_CSUM) && 1997 protocol == htons(ETH_P_IPV6)) || 1998 ((features & NETIF_F_FCOE_CRC) && 1999 protocol == htons(ETH_P_FCOE))); 2000} 2001 2002static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) 2003{ | 1/* 2 * NET3 Protocol independent device support routines. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU General Public License 6 * as published by the Free Software Foundation; either version 7 * 2 of the License, or (at your option) any later version. 8 * --- 1987 unchanged lines hidden (view full) --- 1996 ((features & NETIF_F_V6_CSUM) && 1997 protocol == htons(ETH_P_IPV6)) || 1998 ((features & NETIF_F_FCOE_CRC) && 1999 protocol == htons(ETH_P_FCOE))); 2000} 2001 2002static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) 2003{ |
2004 if (!can_checksum_protocol(features, protocol)) { | 2004 if (!can_checksum_protocol(protocol, features)) { |
2005 features &= ~NETIF_F_ALL_CSUM; 2006 features &= ~NETIF_F_SG; 2007 } else if (illegal_highdma(skb->dev, skb)) { 2008 features &= ~NETIF_F_SG; 2009 } 2010 2011 return features; 2012} --- 2554 unchanged lines hidden (view full) --- 4567 4568 if (!err && dev->flags & IFF_UP) 4569 call_netdevice_notifiers(NETDEV_CHANGEMTU, dev); 4570 return err; 4571} 4572EXPORT_SYMBOL(dev_set_mtu); 4573 4574/** | 2005 features &= ~NETIF_F_ALL_CSUM; 2006 features &= ~NETIF_F_SG; 2007 } else if (illegal_highdma(skb->dev, skb)) { 2008 features &= ~NETIF_F_SG; 2009 } 2010 2011 return features; 2012} --- 2554 unchanged lines hidden (view full) --- 4567 4568 if (!err && dev->flags & IFF_UP) 4569 call_netdevice_notifiers(NETDEV_CHANGEMTU, dev); 4570 return err; 4571} 4572EXPORT_SYMBOL(dev_set_mtu); 4573 4574/** |
4575 * dev_set_group - Change group this device belongs to 4576 * @dev: device 4577 * @new_group: group this device should belong to 4578 */ 4579void dev_set_group(struct net_device *dev, int new_group) 4580{ 4581 dev->group = new_group; 4582} 4583EXPORT_SYMBOL(dev_set_group); 4584 4585/** |
|
4575 * dev_set_mac_address - Change Media Access Control Address 4576 * @dev: device 4577 * @sa: new address 4578 * 4579 * Change the hardware (MAC) address of the device 4580 */ 4581int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa) 4582{ --- 1090 unchanged lines hidden (view full) --- 5673 INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list); 5674 dev->ethtool_ntuple_list.count = 0; 5675 INIT_LIST_HEAD(&dev->napi_list); 5676 INIT_LIST_HEAD(&dev->unreg_list); 5677 INIT_LIST_HEAD(&dev->link_watch_list); 5678 dev->priv_flags = IFF_XMIT_DST_RELEASE; 5679 setup(dev); 5680 strcpy(dev->name, name); | 4586 * dev_set_mac_address - Change Media Access Control Address 4587 * @dev: device 4588 * @sa: new address 4589 * 4590 * Change the hardware (MAC) address of the device 4591 */ 4592int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa) 4593{ --- 1090 unchanged lines hidden (view full) --- 5684 INIT_LIST_HEAD(&dev->ethtool_ntuple_list.list); 5685 dev->ethtool_ntuple_list.count = 0; 5686 INIT_LIST_HEAD(&dev->napi_list); 5687 INIT_LIST_HEAD(&dev->unreg_list); 5688 INIT_LIST_HEAD(&dev->link_watch_list); 5689 dev->priv_flags = IFF_XMIT_DST_RELEASE; 5690 setup(dev); 5691 strcpy(dev->name, name); |
5692 dev->group = INIT_NETDEV_GROUP; |
|
5681 return dev; 5682 5683free_pcpu: 5684 free_percpu(dev->pcpu_refcnt); 5685 kfree(dev->_tx); 5686#ifdef CONFIG_RPS 5687 kfree(dev->_rx); 5688#endif --- 624 unchanged lines hidden --- | 5693 return dev; 5694 5695free_pcpu: 5696 free_percpu(dev->pcpu_refcnt); 5697 kfree(dev->_tx); 5698#ifdef CONFIG_RPS 5699 kfree(dev->_rx); 5700#endif --- 624 unchanged lines hidden --- |