X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=datapath%2Fdp_sysfs_if.c;h=b40523aaeebfdb0c14804b90741f2a9319b944c2;hb=2ed7d6e227c009f0f6bdabbb85262d8aac896e00;hp=8aa03a7672f993b8f5a618b544b2ed18f4e421b1;hpb=b4a7d61582ef3a09a666106a926c8912201dfe72;p=openvswitch diff --git a/datapath/dp_sysfs_if.c b/datapath/dp_sysfs_if.c index 8aa03a76..b40523aa 100644 --- a/datapath/dp_sysfs_if.c +++ b/datapath/dp_sysfs_if.c @@ -30,6 +30,15 @@ struct brport_attribute { ssize_t (*store)(struct dp_port *, unsigned long); }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36) +#define BRPORT_ATTR(_name,_mode,_show,_store) \ +struct brport_attribute brport_attr_##_name = { \ + .attr = {.name = __stringify(_name), \ + .mode = _mode }, \ + .show = _show, \ + .store = _store, \ +}; +#else #define BRPORT_ATTR(_name,_mode,_show,_store) \ struct brport_attribute brport_attr_##_name = { \ .attr = {.name = __stringify(_name), \ @@ -38,6 +47,7 @@ struct brport_attribute brport_attr_##_name = { \ .show = _show, \ .store = _store, \ }; +#endif static ssize_t show_path_cost(struct dp_port *p, char *buf) { @@ -177,7 +187,7 @@ static ssize_t brport_store(struct kobject * kobj, if (!capable(CAP_NET_ADMIN)) return -EPERM; - printk("%s: xxx writing port parms not supported yet!\n", + printk("%s: xxx writing port parms not supported yet!\n", dp_name(p->dp)); return ret;