move away from syscall counts towards operation counts
[trinity.git] / ioctls / ozwpan.c
blob6742477a39d6aa0442821a0bfd8074eee8b70e0a
1 #include <linux/ioctl.h>
2 #include <linux/types.h>
4 #include "ioctls.h"
5 #include "utils.h"
7 /* drivers/staging/ozwpan/ozappif.h */
9 /* -----------------------------------------------------------------------------
10 * Copyright (c) 2011 Ozmo Inc
11 * Released under the GNU General Public License Version 2 (GPLv2).
12 * -----------------------------------------------------------------------------
15 #define OZ_IOCTL_MAGIC 0xf4
17 struct oz_mac_addr {
18 __u8 a[6];
21 #define OZ_MAX_PDS 8
23 struct oz_pd_list {
24 __u32 count;
25 struct oz_mac_addr addr[OZ_MAX_PDS];
28 #define OZ_MAX_BINDING_LEN 32
30 struct oz_binding_info {
31 char name[OZ_MAX_BINDING_LEN];
34 #define OZ_IOCTL_GET_PD_LIST _IOR(OZ_IOCTL_MAGIC, 0, struct oz_pd_list)
35 #define OZ_IOCTL_SET_ACTIVE_PD _IOW(OZ_IOCTL_MAGIC, 1, struct oz_mac_addr)
36 #define OZ_IOCTL_GET_ACTIVE_PD _IOR(OZ_IOCTL_MAGIC, 2, struct oz_mac_addr)
37 #define OZ_IOCTL_ADD_BINDING _IOW(OZ_IOCTL_MAGIC, 3, struct oz_binding_info)
38 #define OZ_IOCTL_REMOVE_BINDING _IOW(OZ_IOCTL_MAGIC, 4, struct oz_binding_info)
39 #define OZ_IOCTL_MAX 5
41 static const struct ioctl ozwpan_ioctls[] = {
42 IOCTL(OZ_IOCTL_GET_PD_LIST),
43 IOCTL(OZ_IOCTL_SET_ACTIVE_PD),
44 IOCTL(OZ_IOCTL_GET_ACTIVE_PD),
45 IOCTL(OZ_IOCTL_ADD_BINDING),
46 IOCTL(OZ_IOCTL_REMOVE_BINDING),
49 static const char *const ozwpan_devs[] = {
50 "ozwpan",
53 static const struct ioctl_group ozwpan_grp = {
54 .devtype = DEV_CHAR,
55 .devs = ozwpan_devs,
56 .devs_cnt = ARRAY_SIZE(ozwpan_devs),
57 .sanitise = pick_random_ioctl,
58 .ioctls = ozwpan_ioctls,
59 .ioctls_cnt = ARRAY_SIZE(ozwpan_ioctls),
62 REG_IOCTL_GROUP(ozwpan_grp)