#include <linux/if.h>
#include <linux/if_ether.h>
#include <linux/if_packet.h>
+#include <linux/kobject.h>
#include <asm/atomic.h>
#include <asm/cache.h>
/* this will get initialized at each interface type init routine */
struct divert_blk *divert;
#endif /* CONFIG_NET_DIVERT */
+
+ /* generic object representation */
+ struct kobject kobj;
};
int netdev_fastroute_obstacles;
#endif
+static struct subsystem net_subsys;
+
/*******************************************************************************
notifier_call_chain(&netdev_chain, NETDEV_REGISTER, dev);
net_run_sbin_hotplug(dev, "register");
- ret = 0;
+
+ snprintf(dev->kobj.name,KOBJ_NAME_LEN,dev->name);
+ kobj_set_kset_s(dev,net_subsys);
+ ret = kobject_register(&dev->kobj);
out:
return ret;
/* Shutdown queueing discipline. */
dev_shutdown(dev);
-
+
net_run_sbin_hotplug(dev, "unregister");
/* Notify protocols, that we are about to destroy
goto out;
}
+ kobject_unregister(&dev->kobj);
+
/* Last reference is our one */
if (atomic_read(&dev->refcnt) == 1)
goto out;
extern void dv_init(void);
#endif /* CONFIG_NET_DIVERT */
+static decl_subsys(net,NULL);
+
/*
* This is called single threaded during boot, so no need
if (dev_proc_init())
goto out;
+ subsystem_register(&net_subsys);
+
#ifdef CONFIG_NET_DIVERT
dv_init();
#endif /* CONFIG_NET_DIVERT */