struct datapath;
#include <linux/version.h>
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,18)
/* brc_sysfs_dp.c */
int brc_sysfs_add_dp(struct datapath *dp);
int brc_sysfs_del_dp(struct datapath *dp);
/* brc_sysfs_if.c */
int brc_sysfs_add_if(struct net_bridge_port *p);
int brc_sysfs_del_if(struct net_bridge_port *p);
-#else
-static inline int brc_sysfs_add_dp(struct datapath *dp) { return 0; }
-static inline int brc_sysfs_del_dp(struct datapath *dp) { return 0; }
-static inline int brc_sysfs_add_if(struct net_bridge_port *p) { return 0; }
-static inline int brc_sysfs_del_if(struct net_bridge_port *p) { return 0; }
-#endif
#endif /* brc_sysfs.h */
#include <linux/version.h>
-#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,18)
/*
* Sysfs attributes of bridge for OpenFlow
#include "datapath.h"
#include "dp_dev.h"
+#if LINUX_VERSION_CODE == KERNEL_VERSION(2,6,18)
#define to_dev(obj) container_of(obj, struct device, kobj)
/* Hack to attempt to build on more platforms. */
return 0;
}
-#endif /* Only support 2.6.18 */
+#else
+int brc_sysfs_add_dp(struct datapath *dp) { return 0; }
+int brc_sysfs_del_dp(struct datapath *dp) { return 0; }
+int brc_sysfs_add_if(struct net_bridge_port *p) { return 0; }
+int brc_sysfs_del_if(struct net_bridge_port *p)
+{
+ dev_put(p->dev);
+ kfree(p);
+ return 0;
+}
+#endif