提交 d1b19dff 编写于 作者: E Eric Dumazet 提交者: David S. Miller

net: net/core/dev.c cleanups

Pure style cleanup patch before surgery :)
Signed-off-by: NEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 137742cf
...@@ -191,7 +191,6 @@ static struct list_head ptype_all __read_mostly; /* Taps */ ...@@ -191,7 +191,6 @@ static struct list_head ptype_all __read_mostly; /* Taps */
* semaphore held. * semaphore held.
*/ */
DEFINE_RWLOCK(dev_base_lock); DEFINE_RWLOCK(dev_base_lock);
EXPORT_SYMBOL(dev_base_lock); EXPORT_SYMBOL(dev_base_lock);
#define NETDEV_HASHBITS 8 #define NETDEV_HASHBITS 8
...@@ -248,6 +247,7 @@ static RAW_NOTIFIER_HEAD(netdev_chain); ...@@ -248,6 +247,7 @@ static RAW_NOTIFIER_HEAD(netdev_chain);
*/ */
DEFINE_PER_CPU(struct softnet_data, softnet_data); DEFINE_PER_CPU(struct softnet_data, softnet_data);
EXPORT_PER_CPU_SYMBOL(softnet_data);
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
/* /*
...@@ -381,6 +381,7 @@ void dev_add_pack(struct packet_type *pt) ...@@ -381,6 +381,7 @@ void dev_add_pack(struct packet_type *pt)
} }
spin_unlock_bh(&ptype_lock); spin_unlock_bh(&ptype_lock);
} }
EXPORT_SYMBOL(dev_add_pack);
/** /**
* __dev_remove_pack - remove packet handler * __dev_remove_pack - remove packet handler
...@@ -418,6 +419,8 @@ void __dev_remove_pack(struct packet_type *pt) ...@@ -418,6 +419,8 @@ void __dev_remove_pack(struct packet_type *pt)
out: out:
spin_unlock_bh(&ptype_lock); spin_unlock_bh(&ptype_lock);
} }
EXPORT_SYMBOL(__dev_remove_pack);
/** /**
* dev_remove_pack - remove packet handler * dev_remove_pack - remove packet handler
* @pt: packet type declaration * @pt: packet type declaration
...@@ -436,6 +439,7 @@ void dev_remove_pack(struct packet_type *pt) ...@@ -436,6 +439,7 @@ void dev_remove_pack(struct packet_type *pt)
synchronize_net(); synchronize_net();
} }
EXPORT_SYMBOL(dev_remove_pack);
/****************************************************************************** /******************************************************************************
...@@ -499,6 +503,7 @@ int netdev_boot_setup_check(struct net_device *dev) ...@@ -499,6 +503,7 @@ int netdev_boot_setup_check(struct net_device *dev)
} }
return 0; return 0;
} }
EXPORT_SYMBOL(netdev_boot_setup_check);
/** /**
...@@ -591,6 +596,7 @@ struct net_device *__dev_get_by_name(struct net *net, const char *name) ...@@ -591,6 +596,7 @@ struct net_device *__dev_get_by_name(struct net *net, const char *name)
} }
return NULL; return NULL;
} }
EXPORT_SYMBOL(__dev_get_by_name);
/** /**
* dev_get_by_name - find a device by its name * dev_get_by_name - find a device by its name
...@@ -615,6 +621,7 @@ struct net_device *dev_get_by_name(struct net *net, const char *name) ...@@ -615,6 +621,7 @@ struct net_device *dev_get_by_name(struct net *net, const char *name)
read_unlock(&dev_base_lock); read_unlock(&dev_base_lock);
return dev; return dev;
} }
EXPORT_SYMBOL(dev_get_by_name);
/** /**
* __dev_get_by_index - find a device by its ifindex * __dev_get_by_index - find a device by its ifindex
...@@ -640,6 +647,7 @@ struct net_device *__dev_get_by_index(struct net *net, int ifindex) ...@@ -640,6 +647,7 @@ struct net_device *__dev_get_by_index(struct net *net, int ifindex)
} }
return NULL; return NULL;
} }
EXPORT_SYMBOL(__dev_get_by_index);
/** /**
...@@ -664,6 +672,7 @@ struct net_device *dev_get_by_index(struct net *net, int ifindex) ...@@ -664,6 +672,7 @@ struct net_device *dev_get_by_index(struct net *net, int ifindex)
read_unlock(&dev_base_lock); read_unlock(&dev_base_lock);
return dev; return dev;
} }
EXPORT_SYMBOL(dev_get_by_index);
/** /**
* dev_getbyhwaddr - find a device by its hardware address * dev_getbyhwaddr - find a device by its hardware address
...@@ -693,7 +702,6 @@ struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type, char *h ...@@ -693,7 +702,6 @@ struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type, char *h
return NULL; return NULL;
} }
EXPORT_SYMBOL(dev_getbyhwaddr); EXPORT_SYMBOL(dev_getbyhwaddr);
struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type) struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type)
...@@ -707,7 +715,6 @@ struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type) ...@@ -707,7 +715,6 @@ struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type)
return NULL; return NULL;
} }
EXPORT_SYMBOL(__dev_getfirstbyhwtype); EXPORT_SYMBOL(__dev_getfirstbyhwtype);
struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type) struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type)
...@@ -721,7 +728,6 @@ struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type) ...@@ -721,7 +728,6 @@ struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type)
rtnl_unlock(); rtnl_unlock();
return dev; return dev;
} }
EXPORT_SYMBOL(dev_getfirstbyhwtype); EXPORT_SYMBOL(dev_getfirstbyhwtype);
/** /**
...@@ -736,7 +742,8 @@ EXPORT_SYMBOL(dev_getfirstbyhwtype); ...@@ -736,7 +742,8 @@ EXPORT_SYMBOL(dev_getfirstbyhwtype);
* dev_put to indicate they have finished with it. * dev_put to indicate they have finished with it.
*/ */
struct net_device * dev_get_by_flags(struct net *net, unsigned short if_flags, unsigned short mask) struct net_device *dev_get_by_flags(struct net *net, unsigned short if_flags,
unsigned short mask)
{ {
struct net_device *dev, *ret; struct net_device *dev, *ret;
...@@ -752,6 +759,7 @@ struct net_device * dev_get_by_flags(struct net *net, unsigned short if_flags, u ...@@ -752,6 +759,7 @@ struct net_device * dev_get_by_flags(struct net *net, unsigned short if_flags, u
read_unlock(&dev_base_lock); read_unlock(&dev_base_lock);
return ret; return ret;
} }
EXPORT_SYMBOL(dev_get_by_flags);
/** /**
* dev_valid_name - check if name is okay for network device * dev_valid_name - check if name is okay for network device
...@@ -777,6 +785,7 @@ int dev_valid_name(const char *name) ...@@ -777,6 +785,7 @@ int dev_valid_name(const char *name)
} }
return 1; return 1;
} }
EXPORT_SYMBOL(dev_valid_name);
/** /**
* __dev_alloc_name - allocate a name for a device * __dev_alloc_name - allocate a name for a device
...@@ -870,6 +879,7 @@ int dev_alloc_name(struct net_device *dev, const char *name) ...@@ -870,6 +879,7 @@ int dev_alloc_name(struct net_device *dev, const char *name)
strlcpy(dev->name, buf, IFNAMSIZ); strlcpy(dev->name, buf, IFNAMSIZ);
return ret; return ret;
} }
EXPORT_SYMBOL(dev_alloc_name);
/** /**
...@@ -906,8 +916,7 @@ int dev_change_name(struct net_device *dev, const char *newname) ...@@ -906,8 +916,7 @@ int dev_change_name(struct net_device *dev, const char *newname)
err = dev_alloc_name(dev, newname); err = dev_alloc_name(dev, newname);
if (err < 0) if (err < 0)
return err; return err;
} } else if (__dev_get_by_name(net, newname))
else if (__dev_get_by_name(net, newname))
return -EEXIST; return -EEXIST;
else else
strlcpy(dev->name, newname, IFNAMSIZ); strlcpy(dev->name, newname, IFNAMSIZ);
...@@ -970,7 +979,7 @@ int dev_set_alias(struct net_device *dev, const char *alias, size_t len) ...@@ -970,7 +979,7 @@ int dev_set_alias(struct net_device *dev, const char *alias, size_t len)
return 0; return 0;
} }
dev->ifalias = krealloc(dev->ifalias, len+1, GFP_KERNEL); dev->ifalias = krealloc(dev->ifalias, len + 1, GFP_KERNEL);
if (!dev->ifalias) if (!dev->ifalias)
return -ENOMEM; return -ENOMEM;
...@@ -1006,6 +1015,7 @@ void netdev_state_change(struct net_device *dev) ...@@ -1006,6 +1015,7 @@ void netdev_state_change(struct net_device *dev)
rtmsg_ifinfo(RTM_NEWLINK, dev, 0); rtmsg_ifinfo(RTM_NEWLINK, dev, 0);
} }
} }
EXPORT_SYMBOL(netdev_state_change);
void netdev_bonding_change(struct net_device *dev) void netdev_bonding_change(struct net_device *dev)
{ {
...@@ -1034,6 +1044,7 @@ void dev_load(struct net *net, const char *name) ...@@ -1034,6 +1044,7 @@ void dev_load(struct net *net, const char *name)
if (!dev && capable(CAP_SYS_MODULE)) if (!dev && capable(CAP_SYS_MODULE))
request_module("%s", name); request_module("%s", name);
} }
EXPORT_SYMBOL(dev_load);
/** /**
* dev_open - prepare an interface for use. * dev_open - prepare an interface for use.
...@@ -1118,6 +1129,7 @@ int dev_open(struct net_device *dev) ...@@ -1118,6 +1129,7 @@ int dev_open(struct net_device *dev)
return ret; return ret;
} }
EXPORT_SYMBOL(dev_open);
/** /**
* dev_close - shutdown an interface. * dev_close - shutdown an interface.
...@@ -1184,6 +1196,7 @@ int dev_close(struct net_device *dev) ...@@ -1184,6 +1196,7 @@ int dev_close(struct net_device *dev)
return 0; return 0;
} }
EXPORT_SYMBOL(dev_close);
/** /**
...@@ -1279,6 +1292,7 @@ int register_netdevice_notifier(struct notifier_block *nb) ...@@ -1279,6 +1292,7 @@ int register_netdevice_notifier(struct notifier_block *nb)
raw_notifier_chain_unregister(&netdev_chain, nb); raw_notifier_chain_unregister(&netdev_chain, nb);
goto unlock; goto unlock;
} }
EXPORT_SYMBOL(register_netdevice_notifier);
/** /**
* unregister_netdevice_notifier - unregister a network notifier block * unregister_netdevice_notifier - unregister a network notifier block
...@@ -1299,6 +1313,7 @@ int unregister_netdevice_notifier(struct notifier_block *nb) ...@@ -1299,6 +1313,7 @@ int unregister_netdevice_notifier(struct notifier_block *nb)
rtnl_unlock(); rtnl_unlock();
return err; return err;
} }
EXPORT_SYMBOL(unregister_netdevice_notifier);
/** /**
* call_netdevice_notifiers - call all network notifier blocks * call_netdevice_notifiers - call all network notifier blocks
...@@ -1321,11 +1336,13 @@ void net_enable_timestamp(void) ...@@ -1321,11 +1336,13 @@ void net_enable_timestamp(void)
{ {
atomic_inc(&netstamp_needed); atomic_inc(&netstamp_needed);
} }
EXPORT_SYMBOL(net_enable_timestamp);
void net_disable_timestamp(void) void net_disable_timestamp(void)
{ {
atomic_dec(&netstamp_needed); atomic_dec(&netstamp_needed);
} }
EXPORT_SYMBOL(net_disable_timestamp);
static inline void net_timestamp(struct sk_buff *skb) static inline void net_timestamp(struct sk_buff *skb)
{ {
...@@ -1359,7 +1376,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) ...@@ -1359,7 +1376,7 @@ static void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
if ((ptype->dev == dev || !ptype->dev) && if ((ptype->dev == dev || !ptype->dev) &&
(ptype->af_packet_priv == NULL || (ptype->af_packet_priv == NULL ||
(struct sock *)ptype->af_packet_priv != skb->sk)) { (struct sock *)ptype->af_packet_priv != skb->sk)) {
struct sk_buff *skb2= skb_clone(skb, GFP_ATOMIC); struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC);
if (!skb2) if (!skb2)
break; break;
...@@ -1527,6 +1544,7 @@ int skb_checksum_help(struct sk_buff *skb) ...@@ -1527,6 +1544,7 @@ int skb_checksum_help(struct sk_buff *skb)
out: out:
return ret; return ret;
} }
EXPORT_SYMBOL(skb_checksum_help);
/** /**
* skb_gso_segment - Perform segmentation on skb. * skb_gso_segment - Perform segmentation on skb.
...@@ -1589,7 +1607,6 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features) ...@@ -1589,7 +1607,6 @@ struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
return segs; return segs;
} }
EXPORT_SYMBOL(skb_gso_segment); EXPORT_SYMBOL(skb_gso_segment);
/* Take action when hardware reception checksum errors are detected. */ /* Take action when hardware reception checksum errors are detected. */
...@@ -1755,7 +1772,7 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb) ...@@ -1755,7 +1772,7 @@ u16 skb_tx_hash(const struct net_device *dev, const struct sk_buff *skb)
if (skb_rx_queue_recorded(skb)) { if (skb_rx_queue_recorded(skb)) {
hash = skb_get_rx_queue(skb); hash = skb_get_rx_queue(skb);
while (unlikely (hash >= dev->real_num_tx_queues)) while (unlikely(hash >= dev->real_num_tx_queues))
hash -= dev->real_num_tx_queues; hash -= dev->real_num_tx_queues;
return hash; return hash;
} }
...@@ -1890,7 +1907,7 @@ int dev_queue_xmit(struct sk_buff *skb) ...@@ -1890,7 +1907,7 @@ int dev_queue_xmit(struct sk_buff *skb)
q = rcu_dereference(txq->qdisc); q = rcu_dereference(txq->qdisc);
#ifdef CONFIG_NET_CLS_ACT #ifdef CONFIG_NET_CLS_ACT
skb->tc_verd = SET_TC_AT(skb->tc_verd,AT_EGRESS); skb->tc_verd = SET_TC_AT(skb->tc_verd, AT_EGRESS);
#endif #endif
if (q->enqueue) { if (q->enqueue) {
rc = __dev_xmit_skb(skb, q, dev, txq); rc = __dev_xmit_skb(skb, q, dev, txq);
...@@ -1946,6 +1963,7 @@ int dev_queue_xmit(struct sk_buff *skb) ...@@ -1946,6 +1963,7 @@ int dev_queue_xmit(struct sk_buff *skb)
rcu_read_unlock_bh(); rcu_read_unlock_bh();
return rc; return rc;
} }
EXPORT_SYMBOL(dev_queue_xmit);
/*======================================================================= /*=======================================================================
...@@ -2012,6 +2030,7 @@ int netif_rx(struct sk_buff *skb) ...@@ -2012,6 +2030,7 @@ int netif_rx(struct sk_buff *skb)
kfree_skb(skb); kfree_skb(skb);
return NET_RX_DROP; return NET_RX_DROP;
} }
EXPORT_SYMBOL(netif_rx);
int netif_rx_ni(struct sk_buff *skb) int netif_rx_ni(struct sk_buff *skb)
{ {
...@@ -2025,7 +2044,6 @@ int netif_rx_ni(struct sk_buff *skb) ...@@ -2025,7 +2044,6 @@ int netif_rx_ni(struct sk_buff *skb)
return err; return err;
} }
EXPORT_SYMBOL(netif_rx_ni); EXPORT_SYMBOL(netif_rx_ni);
static void net_tx_action(struct softirq_action *h) static void net_tx_action(struct softirq_action *h)
...@@ -2358,6 +2376,7 @@ int netif_receive_skb(struct sk_buff *skb) ...@@ -2358,6 +2376,7 @@ int netif_receive_skb(struct sk_buff *skb)
rcu_read_unlock(); rcu_read_unlock();
return ret; return ret;
} }
EXPORT_SYMBOL(netif_receive_skb);
/* Network device is going away, flush any packets still pending */ /* Network device is going away, flush any packets still pending */
static void flush_backlog(void *arg) static void flush_backlog(void *arg)
...@@ -2874,7 +2893,7 @@ static void net_rx_action(struct softirq_action *h) ...@@ -2874,7 +2893,7 @@ static void net_rx_action(struct softirq_action *h)
goto out; goto out;
} }
static gifconf_func_t * gifconf_list [NPROTO]; static gifconf_func_t *gifconf_list[NPROTO];
/** /**
* register_gifconf - register a SIOCGIF handler * register_gifconf - register a SIOCGIF handler
...@@ -2885,13 +2904,14 @@ static gifconf_func_t * gifconf_list [NPROTO]; ...@@ -2885,13 +2904,14 @@ static gifconf_func_t * gifconf_list [NPROTO];
* that is passed must not be freed or reused until it has been replaced * that is passed must not be freed or reused until it has been replaced
* by another handler. * by another handler.
*/ */
int register_gifconf(unsigned int family, gifconf_func_t * gifconf) int register_gifconf(unsigned int family, gifconf_func_t *gifconf)
{ {
if (family >= NPROTO) if (family >= NPROTO)
return -EINVAL; return -EINVAL;
gifconf_list[family] = gifconf; gifconf_list[family] = gifconf;
return 0; return 0;
} }
EXPORT_SYMBOL(register_gifconf);
/* /*
...@@ -3102,7 +3122,7 @@ static int softnet_seq_show(struct seq_file *seq, void *v) ...@@ -3102,7 +3122,7 @@ static int softnet_seq_show(struct seq_file *seq, void *v)
seq_printf(seq, "%08x %08x %08x %08x %08x %08x %08x %08x %08x\n", seq_printf(seq, "%08x %08x %08x %08x %08x %08x %08x %08x %08x\n",
s->total, s->dropped, s->time_squeeze, 0, s->total, s->dropped, s->time_squeeze, 0,
0, 0, 0, 0, /* was fastroute */ 0, 0, 0, 0, /* was fastroute */
s->cpu_collision ); s->cpu_collision);
return 0; return 0;
} }
...@@ -3338,6 +3358,7 @@ int netdev_set_master(struct net_device *slave, struct net_device *master) ...@@ -3338,6 +3358,7 @@ int netdev_set_master(struct net_device *slave, struct net_device *master)
rtmsg_ifinfo(RTM_NEWLINK, slave, IFF_SLAVE); rtmsg_ifinfo(RTM_NEWLINK, slave, IFF_SLAVE);
return 0; return 0;
} }
EXPORT_SYMBOL(netdev_set_master);
static void dev_change_rx_flags(struct net_device *dev, int flags) static void dev_change_rx_flags(struct net_device *dev, int flags)
{ {
...@@ -3416,6 +3437,7 @@ int dev_set_promiscuity(struct net_device *dev, int inc) ...@@ -3416,6 +3437,7 @@ int dev_set_promiscuity(struct net_device *dev, int inc)
dev_set_rx_mode(dev); dev_set_rx_mode(dev);
return err; return err;
} }
EXPORT_SYMBOL(dev_set_promiscuity);
/** /**
* dev_set_allmulti - update allmulti count on a device * dev_set_allmulti - update allmulti count on a device
...@@ -3459,6 +3481,7 @@ int dev_set_allmulti(struct net_device *dev, int inc) ...@@ -3459,6 +3481,7 @@ int dev_set_allmulti(struct net_device *dev, int inc)
} }
return 0; return 0;
} }
EXPORT_SYMBOL(dev_set_allmulti);
/* /*
* Upload unicast and multicast address lists to device and * Upload unicast and multicast address lists to device and
...@@ -4088,6 +4111,7 @@ unsigned dev_get_flags(const struct net_device *dev) ...@@ -4088,6 +4111,7 @@ unsigned dev_get_flags(const struct net_device *dev)
return flags; return flags;
} }
EXPORT_SYMBOL(dev_get_flags);
/** /**
* dev_change_flags - change device settings * dev_change_flags - change device settings
...@@ -4138,12 +4162,13 @@ int dev_change_flags(struct net_device *dev, unsigned flags) ...@@ -4138,12 +4162,13 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
} }
if (dev->flags & IFF_UP && if (dev->flags & IFF_UP &&
((old_flags ^ dev->flags) &~ (IFF_UP | IFF_PROMISC | IFF_ALLMULTI | ((old_flags ^ dev->flags) & ~(IFF_UP | IFF_PROMISC | IFF_ALLMULTI |
IFF_VOLATILE))) IFF_VOLATILE)))
call_netdevice_notifiers(NETDEV_CHANGE, dev); call_netdevice_notifiers(NETDEV_CHANGE, dev);
if ((flags ^ dev->gflags) & IFF_PROMISC) { if ((flags ^ dev->gflags) & IFF_PROMISC) {
int inc = (flags & IFF_PROMISC) ? +1 : -1; int inc = (flags & IFF_PROMISC) ? 1 : -1;
dev->gflags ^= IFF_PROMISC; dev->gflags ^= IFF_PROMISC;
dev_set_promiscuity(dev, inc); dev_set_promiscuity(dev, inc);
} }
...@@ -4153,7 +4178,8 @@ int dev_change_flags(struct net_device *dev, unsigned flags) ...@@ -4153,7 +4178,8 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
IFF_ALLMULTI is requested not asking us and not reporting. IFF_ALLMULTI is requested not asking us and not reporting.
*/ */
if ((flags ^ dev->gflags) & IFF_ALLMULTI) { if ((flags ^ dev->gflags) & IFF_ALLMULTI) {
int inc = (flags & IFF_ALLMULTI) ? +1 : -1; int inc = (flags & IFF_ALLMULTI) ? 1 : -1;
dev->gflags ^= IFF_ALLMULTI; dev->gflags ^= IFF_ALLMULTI;
dev_set_allmulti(dev, inc); dev_set_allmulti(dev, inc);
} }
...@@ -4165,6 +4191,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags) ...@@ -4165,6 +4191,7 @@ int dev_change_flags(struct net_device *dev, unsigned flags)
return ret; return ret;
} }
EXPORT_SYMBOL(dev_change_flags);
/** /**
* dev_set_mtu - Change maximum transfer unit * dev_set_mtu - Change maximum transfer unit
...@@ -4198,6 +4225,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu) ...@@ -4198,6 +4225,7 @@ int dev_set_mtu(struct net_device *dev, int new_mtu)
call_netdevice_notifiers(NETDEV_CHANGEMTU, dev); call_netdevice_notifiers(NETDEV_CHANGEMTU, dev);
return err; return err;
} }
EXPORT_SYMBOL(dev_set_mtu);
/** /**
* dev_set_mac_address - Change Media Access Control Address * dev_set_mac_address - Change Media Access Control Address
...@@ -4222,6 +4250,7 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa) ...@@ -4222,6 +4250,7 @@ int dev_set_mac_address(struct net_device *dev, struct sockaddr *sa)
call_netdevice_notifiers(NETDEV_CHANGEADDR, dev); call_netdevice_notifiers(NETDEV_CHANGEADDR, dev);
return err; return err;
} }
EXPORT_SYMBOL(dev_set_mac_address);
/* /*
* Perform the SIOCxIFxxx calls, inside read_lock(dev_base_lock) * Perform the SIOCxIFxxx calls, inside read_lock(dev_base_lock)
...@@ -4365,7 +4394,6 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd) ...@@ -4365,7 +4394,6 @@ static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
/* /*
* Unknown or private ioctl * Unknown or private ioctl
*/ */
default: default:
if ((cmd >= SIOCDEVPRIVATE && if ((cmd >= SIOCDEVPRIVATE &&
cmd <= SIOCDEVPRIVATE + 15) || cmd <= SIOCDEVPRIVATE + 15) ||
...@@ -4840,6 +4868,7 @@ int register_netdevice(struct net_device *dev) ...@@ -4840,6 +4868,7 @@ int register_netdevice(struct net_device *dev)
dev->netdev_ops->ndo_uninit(dev); dev->netdev_ops->ndo_uninit(dev);
goto out; goto out;
} }
EXPORT_SYMBOL(register_netdevice);
/** /**
* init_dummy_netdev - init a dummy network device for NAPI * init_dummy_netdev - init a dummy network device for NAPI
...@@ -5126,6 +5155,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, ...@@ -5126,6 +5155,8 @@ struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
} }
dev = PTR_ALIGN(p, NETDEV_ALIGN); dev = PTR_ALIGN(p, NETDEV_ALIGN);
pr_err("%s dev=%p queue_count=%d tx=%p\n", name, dev, queue_count, tx);
WARN_ON(queue_count == 1);
dev->padded = (char *)dev - (char *)p; dev->padded = (char *)dev - (char *)p;
if (dev_addr_init(dev)) if (dev_addr_init(dev))
...@@ -5192,6 +5223,7 @@ void free_netdev(struct net_device *dev) ...@@ -5192,6 +5223,7 @@ void free_netdev(struct net_device *dev)
/* will free via device release */ /* will free via device release */
put_device(&dev->dev); put_device(&dev->dev);
} }
EXPORT_SYMBOL(free_netdev);
/** /**
* synchronize_net - Synchronize with packet receive processing * synchronize_net - Synchronize with packet receive processing
...@@ -5204,6 +5236,7 @@ void synchronize_net(void) ...@@ -5204,6 +5236,7 @@ void synchronize_net(void)
might_sleep(); might_sleep();
synchronize_rcu(); synchronize_rcu();
} }
EXPORT_SYMBOL(synchronize_net);
/** /**
* unregister_netdevice - remove device from the kernel * unregister_netdevice - remove device from the kernel
...@@ -5224,6 +5257,7 @@ void unregister_netdevice(struct net_device *dev) ...@@ -5224,6 +5257,7 @@ void unregister_netdevice(struct net_device *dev)
/* Finish processing unregister after unlock */ /* Finish processing unregister after unlock */
net_set_todo(dev); net_set_todo(dev);
} }
EXPORT_SYMBOL(unregister_netdevice);
/** /**
* unregister_netdev - remove device from the kernel * unregister_netdev - remove device from the kernel
...@@ -5242,7 +5276,6 @@ void unregister_netdev(struct net_device *dev) ...@@ -5242,7 +5276,6 @@ void unregister_netdev(struct net_device *dev)
unregister_netdevice(dev); unregister_netdevice(dev);
rtnl_unlock(); rtnl_unlock();
} }
EXPORT_SYMBOL(unregister_netdev); EXPORT_SYMBOL(unregister_netdev);
/** /**
...@@ -5658,41 +5691,3 @@ static int __init initialize_hashrnd(void) ...@@ -5658,41 +5691,3 @@ static int __init initialize_hashrnd(void)
late_initcall_sync(initialize_hashrnd); late_initcall_sync(initialize_hashrnd);
EXPORT_SYMBOL(__dev_get_by_index);
EXPORT_SYMBOL(__dev_get_by_name);
EXPORT_SYMBOL(__dev_remove_pack);
EXPORT_SYMBOL(dev_valid_name);
EXPORT_SYMBOL(dev_add_pack);
EXPORT_SYMBOL(dev_alloc_name);
EXPORT_SYMBOL(dev_close);
EXPORT_SYMBOL(dev_get_by_flags);
EXPORT_SYMBOL(dev_get_by_index);
EXPORT_SYMBOL(dev_get_by_name);
EXPORT_SYMBOL(dev_open);
EXPORT_SYMBOL(dev_queue_xmit);
EXPORT_SYMBOL(dev_remove_pack);
EXPORT_SYMBOL(dev_set_allmulti);
EXPORT_SYMBOL(dev_set_promiscuity);
EXPORT_SYMBOL(dev_change_flags);
EXPORT_SYMBOL(dev_set_mtu);
EXPORT_SYMBOL(dev_set_mac_address);
EXPORT_SYMBOL(free_netdev);
EXPORT_SYMBOL(netdev_boot_setup_check);
EXPORT_SYMBOL(netdev_set_master);
EXPORT_SYMBOL(netdev_state_change);
EXPORT_SYMBOL(netif_receive_skb);
EXPORT_SYMBOL(netif_rx);
EXPORT_SYMBOL(register_gifconf);
EXPORT_SYMBOL(register_netdevice);
EXPORT_SYMBOL(register_netdevice_notifier);
EXPORT_SYMBOL(skb_checksum_help);
EXPORT_SYMBOL(synchronize_net);
EXPORT_SYMBOL(unregister_netdevice);
EXPORT_SYMBOL(unregister_netdevice_notifier);
EXPORT_SYMBOL(net_enable_timestamp);
EXPORT_SYMBOL(net_disable_timestamp);
EXPORT_SYMBOL(dev_get_flags);
EXPORT_SYMBOL(dev_load);
EXPORT_PER_CPU_SYMBOL(softnet_data);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册