add ssize_t definition to site files, fix up size for x86_64
[openwrt.git] / package / switch / src / switch-core.c
index 87aa972..c34386b 100644 (file)
@@ -404,6 +404,21 @@ switch_vlan_config *switch_parse_vlan(switch_driver *driver, char *buf)
 }
 
 
+int switch_device_registered (char* device) {
+       struct list_head *pos;
+       switch_driver *new;
+
+       list_for_each(pos, &drivers.list) {
+               if (strcmp(list_entry(pos, switch_driver, list)->interface, device) == 0) {
+                       printk("There is already a switch registered on the device '%s'\n", device);
+                       return -EINVAL;
+               }
+       }
+
+       return 0;
+}
+
+
 int switch_register_driver(switch_driver *driver)
 {
        struct list_head *pos;
@@ -476,6 +491,7 @@ static void __exit switch_exit(void)
 MODULE_AUTHOR("Felix Fietkau <openwrt@nbd.name>");
 MODULE_LICENSE("GPL");
 
+EXPORT_SYMBOL(switch_device_registered);
 EXPORT_SYMBOL(switch_register_driver);
 EXPORT_SYMBOL(switch_unregister_driver);
 EXPORT_SYMBOL(switch_parse_vlan);
This page took 0.021114 seconds and 4 git commands to generate.