2 * Copyright 2007 Luis R. Rodriguez <mcgrof@winlab.rutgers.edu>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Compatibility file for Linux wireless for kernels 2.6.31.
11 #include <linux/compat.h>
13 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31))
15 #include <linux/netdevice.h>
18 * genl_register_family_with_ops - register a generic netlink family
19 * @family: generic netlink family
20 * @ops: operations to be registered
21 * @n_ops: number of elements to register
23 * Registers the specified family and operations from the specified table.
24 * Only one family may be registered with the same family name or identifier.
26 * The family id may equal GENL_ID_GENERATE causing an unique id to
27 * be automatically generated and assigned.
29 * Either a doit or dumpit callback must be specified for every registered
30 * operation or the function will fail. Only one operation structure per
31 * command identifier may be registered.
33 * See include/net/genetlink.h for more documenation on the operations
36 * This is equivalent to calling genl_register_family() followed by
37 * genl_register_ops() for every operation entry in the table taking
38 * care to unregister the family on error path.
40 * Return 0 on success or a negative error code.
42 int genl_register_family_with_ops(struct genl_family *family,
43 struct genl_ops *ops, size_t n_ops)
47 err = genl_register_family(family);
51 for (i = 0; i < n_ops; ++i, ++ops) {
52 err = genl_register_ops(family, ops);
58 genl_unregister_family(family);
61 EXPORT_SYMBOL(genl_register_family_with_ops);
63 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,31)) */