aboutsummaryrefslogtreecommitdiffstats
path: root/package/lqtapi/src/tapi/tapi-nl.c
diff options
context:
space:
mode:
authorJohn Crispin <john@openwrt.org>2010-11-03 19:12:34 +0000
committerJohn Crispin <john@openwrt.org>2010-11-03 19:12:34 +0000
commita8b2a07f375edefec242de9f20d4aefafa927517 (patch)
treed15f5bb696bfa9dfd9555788d411e0ba59b99a65 /package/lqtapi/src/tapi/tapi-nl.c
parent72ae8452cda47d6e18e664097a4adbc0eee3fc7b (diff)
downloadupstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.gz
upstream-a8b2a07f375edefec242de9f20d4aefafa927517.tar.bz2
upstream-a8b2a07f375edefec242de9f20d4aefafa927517.zip
* adds a rewrite of the tapi drivers + sip app. this is the result of lars' gsoc 2010 project, Thanks !
SVN-Revision: 23840
Diffstat (limited to 'package/lqtapi/src/tapi/tapi-nl.c')
-rw-r--r--package/lqtapi/src/tapi/tapi-nl.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/package/lqtapi/src/tapi/tapi-nl.c b/package/lqtapi/src/tapi/tapi-nl.c
new file mode 100644
index 0000000000..c066742b65
--- /dev/null
+++ b/package/lqtapi/src/tapi/tapi-nl.c
@@ -0,0 +1,62 @@
+
+static struct tapi_attr default_port[] = {
+ [PORTS] = {
+ .type = TAPI_TYPE_PORTS,
+ .name = "ports",
+ .description = "foobar",
+ .set = tapi_set_ports,
+ .get = tapi_get_ports,
+ },
+};
+
+static const struct nla_policy tapi_policy[] = {
+ [TAPI_ATTR_ID] = { .type = NLA_U32 },
+ [TAPI_ATTR_PORT] = { .type = NLA_U32 },
+ [TAPI_ATTR_ENDPOINT] = { .type = NLA_U32 },
+ [TAPI_ATTR_STREAM] = { .type = NLA_U32 }
+};
+
+static const struct nla_policy tapi_port_policy[] = {
+ [TAPI_PORT_ID] = { .type = NLA_U32 },
+};
+
+static const struct nla_policy tapi_endpoint_policy[] = {
+ [TAPI_ENDPOINT_ID] = { .type = NLA_U32 },
+};
+
+static const struct nla_policy tapi_stream_policy[] = {
+ [TAPI_STREAM_ID] = { .type = NLA_U32 },
+};
+
+static struct genl_family tapi_nl_family = {
+ .id = GENL_ID_GENERATE,
+ .name = "tapi",
+ .hdrsize = 0,
+ .version = 1,
+ .maxattr = ARRAY_SIZE(tapi_policy),
+};
+
+
+
+static struct genl_ops tapi_nl_ops[] = {
+ TAPI_NL_OP(TAPI_CMD_LIST, list_attr),
+
+};
+
+static int __init tapi_nl_init(void)
+{
+ ret = genl_unregister_family(&tapi_nl_family);
+ if (ret)
+ return ret;
+
+ genl_register_ops(&tapi_nl_family, tapi_nl_ops);
+
+ return 0;
+}
+module_init(tapi_nl_init);
+
+static void __exit tapi_nl_exit(void)
+{
+ genl_unregister_family(&tapi_nl_family);
+}
+