Commit 55a73f32 authored by Vikram Narayanan's avatar Vikram Narayanan
Browse files

foobar: touch more flags/features

parent 93fb82b5
...@@ -46,6 +46,10 @@ static int __init dummy_init_module(void) ...@@ -46,6 +46,10 @@ static int __init dummy_init_module(void)
return -ENOMEM; return -ENOMEM;
dev_dummy->foobardev_ops = &dummy_foobardev_ops; dev_dummy->foobardev_ops = &dummy_foobardev_ops;
dev_dummy->features = FOOBAR_PRIV_ALLOC;
dev_dummy->flags = FOO_LOOPBACK;
err = register_foobar(dev_dummy); err = register_foobar(dev_dummy);
if (err < 0) if (err < 0)
goto err; goto err;
......
...@@ -12,7 +12,7 @@ int register_foobar(struct foobar_device *dev) ...@@ -12,7 +12,7 @@ int register_foobar(struct foobar_device *dev)
dev->features |= FOOBAR_SOFTIRQ_ENABLE; dev->features |= FOOBAR_SOFTIRQ_ENABLE;
dev->wanted_features = dev->features & dev->hw_features; dev->wanted_features = dev->features & dev->hw_features;
if (!(dev->flags & FOO_LOOPBACK)) if (dev->flags & FOO_LOOPBACK)
dev->hw_features |= FOOBAR_ZERO_COPY; dev->hw_features |= FOOBAR_ZERO_COPY;
/* Init, if this function is available */ /* Init, if this function is available */
...@@ -55,4 +55,3 @@ void free_foobardev(struct foobar_device *dev) ...@@ -55,4 +55,3 @@ void free_foobardev(struct foobar_device *dev)
kfree(dev); kfree(dev);
} }
EXPORT_SYMBOL(free_foobardev); EXPORT_SYMBOL(free_foobardev);
...@@ -7,6 +7,7 @@ typedef u64 foobar_features_t; ...@@ -7,6 +7,7 @@ typedef u64 foobar_features_t;
#define FOOBAR_IRQ_DELAY (1 << 10) #define FOOBAR_IRQ_DELAY (1 << 10)
#define FOOBAR_SOFTIRQ_ENABLE (1 << 11) #define FOOBAR_SOFTIRQ_ENABLE (1 << 11)
#define FOOBAR_ZERO_COPY (1 << 12) #define FOOBAR_ZERO_COPY (1 << 12)
#define FOOBAR_PRIV_ALLOC (1 << 13)
/* flags */ /* flags */
#define FOO_LOOPBACK 4 #define FOO_LOOPBACK 4
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment