• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/net/core/

Lines Matching defs:net

18  *		David Hinds <dahinds@users.sourceforge.net>
99 #include <net/net_namespace.h>
100 #include <net/sock.h>
105 #include <net/dst.h>
106 #include <net/pkt_sched.h>
107 #include <net/checksum.h>
108 #include <net/xfrm.h>
116 #include <net/wext.h>
117 #include <net/iw_handler.h>
126 #include <net/ip.h>
133 #include "net-sysfs.h"
215 static inline struct hlist_head *dev_name_hash(struct net *net, const char *name)
218 return &net->dev_name_head[hash_32(hash, NETDEV_HASHBITS)];
221 static inline struct hlist_head *dev_index_hash(struct net *net, int ifindex)
223 return &net->dev_index_head[ifindex & (NETDEV_HASHENTRIES - 1)];
243 struct net *net = dev_net(dev);
248 list_add_tail_rcu(&dev->dev_list, &net->dev_base_head);
249 hlist_add_head_rcu(&dev->name_hlist, dev_name_hash(net, dev->name));
251 dev_index_hash(net, dev->ifindex));
610 * @net: the applicable net namespace
620 struct net_device *__dev_get_by_name(struct net *net, const char *name)
624 struct hlist_head *head = dev_name_hash(net, name);
636 * @net: the applicable net namespace
646 struct net_device *dev_get_by_name_rcu(struct net *net, const char *name)
650 struct hlist_head *head = dev_name_hash(net, name);
662 * @net: the applicable net namespace
672 struct net_device *dev_get_by_name(struct net *net, const char *name)
677 dev = dev_get_by_name_rcu(net, name);
687 * @net: the applicable net namespace
697 struct net_device *__dev_get_by_index(struct net *net, int ifindex)
701 struct hlist_head *head = dev_index_hash(net, ifindex);
713 * @net: the applicable net namespace
722 struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex)
726 struct hlist_head *head = dev_index_hash(net, ifindex);
739 * @net: the applicable net namespace
748 struct net_device *dev_get_by_index(struct net *net, int ifindex)
753 dev = dev_get_by_index_rcu(net, ifindex);
763 * @net: the applicable net namespace
776 struct net_device *dev_getbyhwaddr(struct net *net, unsigned short type, char *ha)
782 for_each_netdev(net, dev)
791 struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short type)
796 for_each_netdev(net, dev)
804 struct net_device *dev_getfirstbyhwtype(struct net *net, unsigned short type)
809 for_each_netdev_rcu(net, dev)
822 * @net: the applicable net namespace
831 struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short if_flags,
837 for_each_netdev_rcu(net, dev) {
875 * @net: network namespace to allocate the device name in
888 static int __dev_alloc_name(struct net *net, const char *name, char *buf)
911 for_each_netdev(net, d) {
929 if (!__dev_get_by_name(net, buf))
956 struct net *net;
960 net = dev_net(dev);
961 ret = __dev_alloc_name(net, name, buf);
970 struct net *net;
973 net = dev_net(dev);
980 else if (__dev_get_by_name(net, name))
1001 struct net *net;
1006 net = dev_net(dev);
1033 hlist_add_head_rcu(&dev->name_hlist, dev_name_hash(net, dev->name));
1124 * @net: the applicable net namespace
1132 void dev_load(struct net *net, const char *name)
1137 dev = dev_get_by_name_rcu(net, name);
1348 * Disable Large Receive Offload (LRO) on a net device. Must be
1392 struct net *net;
1401 for_each_net(net) {
1402 for_each_netdev(net, dev) {
1421 for_each_net(net) {
1422 for_each_netdev(net, dev) {
3806 static int dev_ifname(struct net *net, struct ifreq __user *arg)
3819 dev = dev_get_by_index_rcu(net, ifr.ifr_ifindex);
3839 static int dev_ifconf(struct net *net, char __user *arg)
3863 for_each_netdev(net, dev) {
3898 struct net *net = seq_file_net(seq);
3907 for_each_netdev_rcu(net, dev)
3956 * /proc/net interface to create /proc/net/dev
4156 static int __net_init dev_proc_net_init(struct net *net)
4160 if (!proc_net_fops_create(net, "dev", S_IRUGO, &dev_seq_fops))
4162 if (!proc_net_fops_create(net, "softnet_stat", S_IRUGO, &softnet_seq_fops))
4164 if (!proc_net_fops_create(net, "ptype", S_IRUGO, &ptype_seq_fops))
4167 if (wext_proc_init(net))
4173 proc_net_remove(net, "ptype");
4175 proc_net_remove(net, "softnet_stat");
4177 proc_net_remove(net, "dev");
4181 static void __net_exit dev_proc_net_exit(struct net *net)
4183 wext_proc_exit(net);
4185 proc_net_remove(net, "ptype");
4186 proc_net_remove(net, "softnet_stat");
4187 proc_net_remove(net, "dev");
4605 static int dev_ifsioc_locked(struct net *net, struct ifreq *ifr, unsigned int cmd)
4608 struct net_device *dev = dev_get_by_name_rcu(net, ifr->ifr_name);
4672 static int dev_ifsioc(struct net *net, struct ifreq *ifr, unsigned int cmd)
4675 struct net_device *dev = __dev_get_by_name(net, ifr->ifr_name);
4779 * @net: the applicable net namespace
4789 int dev_ioctl(struct net *net, unsigned int cmd, void __user *arg)
4802 ret = dev_ifconf(net, (char __user *) arg);
4807 return dev_ifname(net, (struct ifreq __user *)arg);
4837 dev_load(net, ifr.ifr_name);
4839 ret = dev_ifsioc_locked(net, &ifr, cmd);
4851 dev_load(net, ifr.ifr_name);
4853 ret = dev_ethtool(net, &ifr);
4875 dev_load(net, ifr.ifr_name);
4877 ret = dev_ifsioc(net, &ifr, cmd);
4917 dev_load(net, ifr.ifr_name);
4919 ret = dev_ifsioc(net, &ifr, cmd);
4939 dev_load(net, ifr.ifr_name);
4941 ret = dev_ifsioc(net, &ifr, cmd);
4950 return wext_handle_ioctl(net, &ifr, cmd, arg);
4958 * @net: the applicable net namespace
4964 static int dev_new_index(struct net *net)
4970 if (!__dev_get_by_index(net, ifindex))
5167 struct net *net = dev_net(dev);
5176 BUG_ON(!net);
5216 dev->ifindex = dev_new_index(net);
5802 * @net: network namespace
5813 int dev_change_net_namespace(struct net_device *dev, struct net *net, const char *pat)
5831 if (net_eq(dev_net(dev), net))
5838 if (__dev_get_by_name(net, dev->name)) {
5875 dev_net_set(dev, net);
5878 if (__dev_get_by_index(net, dev->ifindex)) {
5880 dev->ifindex = dev_new_index(net);
6013 static int __net_init netdev_init(struct net *net)
6015 INIT_LIST_HEAD(&net->dev_base_head);
6017 net->dev_name_head = netdev_create_hash();
6018 if (net->dev_name_head == NULL)
6021 net->dev_index_head = netdev_create_hash();
6022 if (net->dev_index_head == NULL)
6028 kfree(net->dev_name_head);
6123 static void __net_exit netdev_exit(struct net *net)
6125 kfree(net->dev_name_head);
6126 kfree(net->dev_index_head);
6134 static void __net_exit default_device_exit(struct net *net)
6142 for_each_netdev_safe(net, dev, aux) {
6174 struct net *net;
6178 list_for_each_entry(net, net_list, exit_list) {
6179 for_each_netdev_reverse(net, dev) {