#include <linux/rtnetlink.h>
#include <net/cfg802154.h>
#include <net/genetlink.h>
#include <net/mac802154.h>
#include <net/netlink.h>
#include <net/nl802154.h>
#include <net/sock.h>
#include "nl802154.h"
#include "rdev-ops.h"
#include "core.h"
static struct genl_family nl802154_fam;
enum nl802154_multicast_groups { … };
static const struct genl_multicast_group nl802154_mcgrps[] = …;
static struct wpan_dev *
__cfg802154_wpan_dev_from_attrs(struct net *netns, struct nlattr **attrs)
{ … }
static struct cfg802154_registered_device *
__cfg802154_rdev_from_attrs(struct net *netns, struct nlattr **attrs)
{ … }
static struct cfg802154_registered_device *
cfg802154_get_dev_from_info(struct net *netns, struct genl_info *info)
{ … }
static const struct nla_policy nl802154_policy[NL802154_ATTR_MAX+1] = …;
static int
nl802154_prepare_wpan_dev_dump(struct sk_buff *skb,
struct netlink_callback *cb,
struct cfg802154_registered_device **rdev,
struct wpan_dev **wpan_dev)
{ … }
static void
nl802154_finish_wpan_dev_dump(struct cfg802154_registered_device *rdev)
{ … }
static inline void *nl802154hdr_put(struct sk_buff *skb, u32 portid, u32 seq,
int flags, u8 cmd)
{ … }
static int
nl802154_put_flags(struct sk_buff *msg, int attr, u32 mask)
{ … }
static int
nl802154_send_wpan_phy_channels(struct cfg802154_registered_device *rdev,
struct sk_buff *msg)
{ … }
static int
nl802154_put_capabilities(struct sk_buff *msg,
struct cfg802154_registered_device *rdev)
{ … }
static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,
enum nl802154_commands cmd,
struct sk_buff *msg, u32 portid, u32 seq,
int flags)
{ … }
struct nl802154_dump_wpan_phy_state { … };
static int nl802154_dump_wpan_phy_parse(struct sk_buff *skb,
struct netlink_callback *cb,
struct nl802154_dump_wpan_phy_state *state)
{ … }
static int
nl802154_dump_wpan_phy(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static int nl802154_dump_wpan_phy_done(struct netlink_callback *cb)
{ … }
static int nl802154_get_wpan_phy(struct sk_buff *skb, struct genl_info *info)
{ … }
static inline u64 wpan_dev_id(struct wpan_dev *wpan_dev)
{ … }
#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
#include <net/ieee802154_netdev.h>
static int
ieee802154_llsec_send_key_id(struct sk_buff *msg,
const struct ieee802154_llsec_key_id *desc)
{ … }
static int nl802154_get_llsec_params(struct sk_buff *msg,
struct cfg802154_registered_device *rdev,
struct wpan_dev *wpan_dev)
{ … }
#endif
static int
nl802154_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flags,
struct cfg802154_registered_device *rdev,
struct wpan_dev *wpan_dev)
{ … }
static int
nl802154_dump_interface(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static int nl802154_get_interface(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_new_interface(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_del_interface(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_channel(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_cca_mode(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_cca_ed_level(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_tx_power(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_pan_id(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_short_addr(struct sk_buff *skb, struct genl_info *info)
{ … }
static int
nl802154_set_backoff_exponent(struct sk_buff *skb, struct genl_info *info)
{ … }
static int
nl802154_set_max_csma_backoffs(struct sk_buff *skb, struct genl_info *info)
{ … }
static int
nl802154_set_max_frame_retries(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_lbt_mode(struct sk_buff *skb, struct genl_info *info)
{ … }
static int
nl802154_set_ackreq_default(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_wpan_phy_netns(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_prep_scan_event_msg(struct sk_buff *msg,
struct cfg802154_registered_device *rdev,
struct wpan_dev *wpan_dev,
u32 portid, u32 seq, int flags, u8 cmd,
struct ieee802154_coord_desc *desc)
{ … }
int nl802154_scan_event(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
struct ieee802154_coord_desc *desc)
{ … }
EXPORT_SYMBOL_GPL(…);
static int nl802154_trigger_scan(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_prep_scan_msg(struct sk_buff *msg,
struct cfg802154_registered_device *rdev,
struct wpan_dev *wpan_dev, u32 portid,
u32 seq, int flags, u8 cmd, u8 arg)
{ … }
static int nl802154_send_scan_msg(struct cfg802154_registered_device *rdev,
struct wpan_dev *wpan_dev, u8 cmd, u8 arg)
{ … }
int nl802154_scan_started(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
int nl802154_scan_done(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
enum nl802154_scan_done_reasons reason)
{ … }
EXPORT_SYMBOL_GPL(…);
static int nl802154_abort_scan(struct sk_buff *skb, struct genl_info *info)
{ … }
static int
nl802154_send_beacons(struct sk_buff *skb, struct genl_info *info)
{ … }
void nl802154_beaconing_done(struct wpan_dev *wpan_dev)
{ … }
EXPORT_SYMBOL_GPL(…);
static int
nl802154_stop_beacons(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_associate(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_disassociate(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_set_max_associations(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_send_peer_info(struct sk_buff *msg,
struct netlink_callback *cb,
u32 seq, int flags,
struct cfg802154_registered_device *rdev,
struct wpan_dev *wpan_dev,
struct ieee802154_pan_device *peer,
enum nl802154_peer_type type)
{ … }
static int nl802154_list_associations(struct sk_buff *skb,
struct netlink_callback *cb)
{ … }
#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
static const struct nla_policy nl802154_dev_addr_policy[NL802154_DEV_ADDR_ATTR_MAX + 1] = …;
static int
ieee802154_llsec_parse_dev_addr(struct nlattr *nla,
struct ieee802154_addr *addr)
{ … }
static const struct nla_policy nl802154_key_id_policy[NL802154_KEY_ID_ATTR_MAX + 1] = …;
static int
ieee802154_llsec_parse_key_id(struct nlattr *nla,
struct ieee802154_llsec_key_id *desc)
{ … }
static int nl802154_set_llsec_params(struct sk_buff *skb,
struct genl_info *info)
{ … }
static int nl802154_send_key(struct sk_buff *msg, u32 cmd, u32 portid,
u32 seq, int flags,
struct cfg802154_registered_device *rdev,
struct net_device *dev,
const struct ieee802154_llsec_key_entry *key)
{ … }
static int
nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static const struct nla_policy nl802154_key_policy[NL802154_KEY_ATTR_MAX + 1] = …;
static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_send_device(struct sk_buff *msg, u32 cmd, u32 portid,
u32 seq, int flags,
struct cfg802154_registered_device *rdev,
struct net_device *dev,
const struct ieee802154_llsec_device *dev_desc)
{ … }
static int
nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static const struct nla_policy nl802154_dev_policy[NL802154_DEV_ATTR_MAX + 1] = …;
static int
ieee802154_llsec_parse_device(struct nlattr *nla,
struct ieee802154_llsec_device *dev)
{ … }
static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_send_devkey(struct sk_buff *msg, u32 cmd, u32 portid,
u32 seq, int flags,
struct cfg802154_registered_device *rdev,
struct net_device *dev, __le64 extended_addr,
const struct ieee802154_llsec_device_key *devkey)
{ … }
static int
nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static const struct nla_policy nl802154_devkey_policy[NL802154_DEVKEY_ATTR_MAX + 1] = …;
static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *info)
{ … }
static int nl802154_send_seclevel(struct sk_buff *msg, u32 cmd, u32 portid,
u32 seq, int flags,
struct cfg802154_registered_device *rdev,
struct net_device *dev,
const struct ieee802154_llsec_seclevel *sl)
{ … }
static int
nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb)
{ … }
static const struct nla_policy nl802154_seclevel_policy[NL802154_SECLEVEL_ATTR_MAX + 1] = …;
static int
llsec_parse_seclevel(struct nlattr *nla, struct ieee802154_llsec_seclevel *sl)
{ … }
static int nl802154_add_llsec_seclevel(struct sk_buff *skb,
struct genl_info *info)
{ … }
static int nl802154_del_llsec_seclevel(struct sk_buff *skb,
struct genl_info *info)
{ … }
#endif
#define NL802154_FLAG_NEED_WPAN_PHY …
#define NL802154_FLAG_NEED_NETDEV …
#define NL802154_FLAG_NEED_RTNL …
#define NL802154_FLAG_CHECK_NETDEV_UP …
#define NL802154_FLAG_NEED_WPAN_DEV …
static int nl802154_pre_doit(const struct genl_split_ops *ops,
struct sk_buff *skb,
struct genl_info *info)
{ … }
static void nl802154_post_doit(const struct genl_split_ops *ops,
struct sk_buff *skb,
struct genl_info *info)
{ … }
static const struct genl_ops nl802154_ops[] = …;
static struct genl_family nl802154_fam __ro_after_init = …;
int __init nl802154_init(void)
{ … }
void nl802154_exit(void)
{ … }