xref: /openbmc/linux/net/ieee802154/nl_policy.c (revision 2c21d11518b688cd4c8e7ddfcd4ba41482ad075b)
1*2c21d115SSergey Lapin /*
2*2c21d115SSergey Lapin  * nl802154.h
3*2c21d115SSergey Lapin  *
4*2c21d115SSergey Lapin  * Copyright (C) 2007, 2008 Siemens AG
5*2c21d115SSergey Lapin  *
6*2c21d115SSergey Lapin  * This program is free software; you can redistribute it and/or modify
7*2c21d115SSergey Lapin  * it under the terms of the GNU General Public License version 2
8*2c21d115SSergey Lapin  * as published by the Free Software Foundation.
9*2c21d115SSergey Lapin  *
10*2c21d115SSergey Lapin  * This program is distributed in the hope that it will be useful,
11*2c21d115SSergey Lapin  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12*2c21d115SSergey Lapin  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13*2c21d115SSergey Lapin  * GNU General Public License for more details.
14*2c21d115SSergey Lapin  *
15*2c21d115SSergey Lapin  * You should have received a copy of the GNU General Public License along
16*2c21d115SSergey Lapin  * with this program; if not, write to the Free Software Foundation, Inc.,
17*2c21d115SSergey Lapin  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18*2c21d115SSergey Lapin  *
19*2c21d115SSergey Lapin  */
20*2c21d115SSergey Lapin 
21*2c21d115SSergey Lapin #include <linux/kernel.h>
22*2c21d115SSergey Lapin #include <net/netlink.h>
23*2c21d115SSergey Lapin #include <linux/nl802154.h>
24*2c21d115SSergey Lapin 
25*2c21d115SSergey Lapin #define NLA_HW_ADDR NLA_U64
26*2c21d115SSergey Lapin 
27*2c21d115SSergey Lapin struct nla_policy ieee802154_policy[IEEE802154_ATTR_MAX + 1] = {
28*2c21d115SSergey Lapin 	[IEEE802154_ATTR_DEV_NAME] = { .type = NLA_STRING, },
29*2c21d115SSergey Lapin 	[IEEE802154_ATTR_DEV_INDEX] = { .type = NLA_U32, },
30*2c21d115SSergey Lapin 
31*2c21d115SSergey Lapin 	[IEEE802154_ATTR_STATUS] = { .type = NLA_U8, },
32*2c21d115SSergey Lapin 	[IEEE802154_ATTR_SHORT_ADDR] = { .type = NLA_U16, },
33*2c21d115SSergey Lapin 	[IEEE802154_ATTR_HW_ADDR] = { .type = NLA_HW_ADDR, },
34*2c21d115SSergey Lapin 	[IEEE802154_ATTR_PAN_ID] = { .type = NLA_U16, },
35*2c21d115SSergey Lapin 	[IEEE802154_ATTR_CHANNEL] = { .type = NLA_U8, },
36*2c21d115SSergey Lapin 	[IEEE802154_ATTR_COORD_SHORT_ADDR] = { .type = NLA_U16, },
37*2c21d115SSergey Lapin 	[IEEE802154_ATTR_COORD_HW_ADDR] = { .type = NLA_HW_ADDR, },
38*2c21d115SSergey Lapin 	[IEEE802154_ATTR_COORD_PAN_ID] = { .type = NLA_U16, },
39*2c21d115SSergey Lapin 	[IEEE802154_ATTR_SRC_SHORT_ADDR] = { .type = NLA_U16, },
40*2c21d115SSergey Lapin 	[IEEE802154_ATTR_SRC_HW_ADDR] = { .type = NLA_HW_ADDR, },
41*2c21d115SSergey Lapin 	[IEEE802154_ATTR_SRC_PAN_ID] = { .type = NLA_U16, },
42*2c21d115SSergey Lapin 	[IEEE802154_ATTR_DEST_SHORT_ADDR] = { .type = NLA_U16, },
43*2c21d115SSergey Lapin 	[IEEE802154_ATTR_DEST_HW_ADDR] = { .type = NLA_HW_ADDR, },
44*2c21d115SSergey Lapin 	[IEEE802154_ATTR_DEST_PAN_ID] = { .type = NLA_U16, },
45*2c21d115SSergey Lapin 
46*2c21d115SSergey Lapin 	[IEEE802154_ATTR_CAPABILITY] = { .type = NLA_U8, },
47*2c21d115SSergey Lapin 	[IEEE802154_ATTR_REASON] = { .type = NLA_U8, },
48*2c21d115SSergey Lapin 	[IEEE802154_ATTR_SCAN_TYPE] = { .type = NLA_U8, },
49*2c21d115SSergey Lapin 	[IEEE802154_ATTR_CHANNELS] = { .type = NLA_U32, },
50*2c21d115SSergey Lapin 	[IEEE802154_ATTR_DURATION] = { .type = NLA_U8, },
51*2c21d115SSergey Lapin 	[IEEE802154_ATTR_ED_LIST] = { .len = 27 },
52*2c21d115SSergey Lapin };
53