Source
x
static const struct nla_policy hwsim_edge_policy[MAC802154_HWSIM_EDGE_ATTR_MAX + 1] = {
/*
* HWSIM IEEE 802.15.4 interface
*
* (C) 2018 Mojatau, Alexander Aring <aring@mojatau.com>
* Copyright 2007-2012 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.
*
* Based on fakelb, original Written by:
* Sergey Lapin <slapin@ossfans.org>
* Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
* Alexander Smirnov <alex.bluesman.smirnov@gmail.com>
*/
MODULE_DESCRIPTION("Software simulator of IEEE 802.15.4 radio(s) for mac802154");
MODULE_LICENSE("GPL");
static LIST_HEAD(hwsim_phys);
static DEFINE_MUTEX(hwsim_phys_lock);
static struct platform_device *mac802154hwsim_dev;
/* MAC802154_HWSIM netlink family */
static struct genl_family hwsim_genl_family;
static int hwsim_radio_idx;
enum hwsim_multicast_groups {
HWSIM_MCGRP_CONFIG,
};
static const struct genl_multicast_group hwsim_mcgrps[] = {
[HWSIM_MCGRP_CONFIG] = { .name = "config", },
};
struct hwsim_pib {
u8 page;
u8 channel;
struct rcu_head rcu;
};
struct hwsim_edge_info {
u8 lqi;
struct rcu_head rcu;
};
struct hwsim_edge {
struct hwsim_phy *endpoint;
struct hwsim_edge_info __rcu *info;
struct list_head list;
struct rcu_head rcu;
};
struct hwsim_phy {
struct ieee802154_hw *hw;
u32 idx;
struct hwsim_pib __rcu *pib;
bool suspended;
struct list_head edges;
struct list_head list;
};
static int hwsim_add_one(struct genl_info *info, struct device *dev,
bool init);
static void hwsim_del(struct hwsim_phy *phy);
static int hwsim_hw_ed(struct ieee802154_hw *hw, u8 *level)