Commit 2c21d115 authored by Sergey Lapin's avatar Sergey Lapin Committed by David S. Miller

net: add NL802154 interface for configuration of 802.15.4 devices

Add a netlink interface for configuration of IEEE 802.15.4 device. Also this
interface specifies events notification sent by devices towards higher layers.
Signed-off-by: default avatarDmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: default avatarSergey Lapin <slapin@ossfans.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9ec76716
/*
* nl802154.h
*
* Copyright (C) 2007, 2008, 2009 Siemens AG
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef NL802154_H
#define NL802154_H
#define IEEE802154_NL_NAME "802.15.4 MAC"
#define IEEE802154_MCAST_COORD_NAME "coordinator"
#define IEEE802154_MCAST_BEACON_NAME "beacon"
enum {
__IEEE802154_ATTR_INVALID,
IEEE802154_ATTR_DEV_NAME,
IEEE802154_ATTR_DEV_INDEX,
IEEE802154_ATTR_STATUS,
IEEE802154_ATTR_SHORT_ADDR,
IEEE802154_ATTR_HW_ADDR,
IEEE802154_ATTR_PAN_ID,
IEEE802154_ATTR_CHANNEL,
IEEE802154_ATTR_COORD_SHORT_ADDR,
IEEE802154_ATTR_COORD_HW_ADDR,
IEEE802154_ATTR_COORD_PAN_ID,
IEEE802154_ATTR_SRC_SHORT_ADDR,
IEEE802154_ATTR_SRC_HW_ADDR,
IEEE802154_ATTR_SRC_PAN_ID,
IEEE802154_ATTR_DEST_SHORT_ADDR,
IEEE802154_ATTR_DEST_HW_ADDR,
IEEE802154_ATTR_DEST_PAN_ID,
IEEE802154_ATTR_CAPABILITY,
IEEE802154_ATTR_REASON,
IEEE802154_ATTR_SCAN_TYPE,
IEEE802154_ATTR_CHANNELS,
IEEE802154_ATTR_DURATION,
IEEE802154_ATTR_ED_LIST,
IEEE802154_ATTR_BCN_ORD,
IEEE802154_ATTR_SF_ORD,
IEEE802154_ATTR_PAN_COORD,
IEEE802154_ATTR_BAT_EXT,
IEEE802154_ATTR_COORD_REALIGN,
IEEE802154_ATTR_SEC,
__IEEE802154_ATTR_MAX,
};
#define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1)
extern struct nla_policy ieee802154_policy[];
/* commands */
/* REQ should be responded with CONF
* and INDIC with RESP
*/
enum {
__IEEE802154_COMMAND_INVALID,
IEEE802154_ASSOCIATE_REQ,
IEEE802154_ASSOCIATE_CONF,
IEEE802154_DISASSOCIATE_REQ,
IEEE802154_DISASSOCIATE_CONF,
IEEE802154_GET_REQ,
IEEE802154_GET_CONF,
IEEE802154_RESET_REQ,
IEEE802154_RESET_CONF,
IEEE802154_SCAN_REQ,
IEEE802154_SCAN_CONF,
IEEE802154_SET_REQ,
IEEE802154_SET_CONF,
IEEE802154_START_REQ,
IEEE802154_START_CONF,
IEEE802154_SYNC_REQ,
IEEE802154_POLL_REQ,
IEEE802154_POLL_CONF,
IEEE802154_ASSOCIATE_INDIC,
IEEE802154_ASSOCIATE_RESP,
IEEE802154_DISASSOCIATE_INDIC,
IEEE802154_BEACON_NOTIFY_INDIC,
IEEE802154_ORPHAN_INDIC,
IEEE802154_ORPHAN_RESP,
IEEE802154_COMM_STATUS_INDIC,
IEEE802154_SYNC_LOSS_INDIC,
IEEE802154_GTS_REQ, /* Not supported yet */
IEEE802154_GTS_INDIC, /* Not supported yet */
IEEE802154_GTS_CONF, /* Not supported yet */
IEEE802154_RX_ENABLE_REQ, /* Not supported yet */
IEEE802154_RX_ENABLE_CONF, /* Not supported yet */
__IEEE802154_CMD_MAX,
};
#define IEEE802154_CMD_MAX (__IEEE802154_CMD_MAX - 1)
#endif
/*
* nl802154.h
*
* Copyright (C) 2007, 2008, 2009 Siemens AG
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#ifndef IEEE802154_NL_H
#define IEEE802154_NL_H
struct net_device;
struct ieee802154_addr;
int ieee802154_nl_assoc_indic(struct net_device *dev,
struct ieee802154_addr *addr, u8 cap);
int ieee802154_nl_assoc_confirm(struct net_device *dev,
u16 short_addr, u8 status);
int ieee802154_nl_disassoc_indic(struct net_device *dev,
struct ieee802154_addr *addr, u8 reason);
int ieee802154_nl_disassoc_confirm(struct net_device *dev,
u8 status);
int ieee802154_nl_scan_confirm(struct net_device *dev,
u8 status, u8 scan_type, u32 unscanned,
u8 *edl/*, struct list_head *pan_desc_list */);
int ieee802154_nl_beacon_indic(struct net_device *dev, u16 panid,
u16 coord_addr);
#endif
obj-$(CONFIG_IEEE802154) += af_802154.o
obj-$(CONFIG_IEEE802154) += nl802154.o af_802154.o
nl802154-y := netlink.o nl_policy.o
af_802154-y := af_ieee802154.o raw.o dgram.o
ccflags-y += -Wall -DDEBUG
This diff is collapsed.
/*
* nl802154.h
*
* Copyright (C) 2007, 2008 Siemens AG
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
*/
#include <linux/kernel.h>
#include <net/netlink.h>
#include <linux/nl802154.h>
#define NLA_HW_ADDR NLA_U64
struct nla_policy ieee802154_policy[IEEE802154_ATTR_MAX + 1] = {
[IEEE802154_ATTR_DEV_NAME] = { .type = NLA_STRING, },
[IEEE802154_ATTR_DEV_INDEX] = { .type = NLA_U32, },
[IEEE802154_ATTR_STATUS] = { .type = NLA_U8, },
[IEEE802154_ATTR_SHORT_ADDR] = { .type = NLA_U16, },
[IEEE802154_ATTR_HW_ADDR] = { .type = NLA_HW_ADDR, },
[IEEE802154_ATTR_PAN_ID] = { .type = NLA_U16, },
[IEEE802154_ATTR_CHANNEL] = { .type = NLA_U8, },
[IEEE802154_ATTR_COORD_SHORT_ADDR] = { .type = NLA_U16, },
[IEEE802154_ATTR_COORD_HW_ADDR] = { .type = NLA_HW_ADDR, },
[IEEE802154_ATTR_COORD_PAN_ID] = { .type = NLA_U16, },
[IEEE802154_ATTR_SRC_SHORT_ADDR] = { .type = NLA_U16, },
[IEEE802154_ATTR_SRC_HW_ADDR] = { .type = NLA_HW_ADDR, },
[IEEE802154_ATTR_SRC_PAN_ID] = { .type = NLA_U16, },
[IEEE802154_ATTR_DEST_SHORT_ADDR] = { .type = NLA_U16, },
[IEEE802154_ATTR_DEST_HW_ADDR] = { .type = NLA_HW_ADDR, },
[IEEE802154_ATTR_DEST_PAN_ID] = { .type = NLA_U16, },
[IEEE802154_ATTR_CAPABILITY] = { .type = NLA_U8, },
[IEEE802154_ATTR_REASON] = { .type = NLA_U8, },
[IEEE802154_ATTR_SCAN_TYPE] = { .type = NLA_U8, },
[IEEE802154_ATTR_CHANNELS] = { .type = NLA_U32, },
[IEEE802154_ATTR_DURATION] = { .type = NLA_U8, },
[IEEE802154_ATTR_ED_LIST] = { .len = 27 },
};
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