Commit f25da51f authored by Alexander Aring's avatar Alexander Aring Committed by Stefan Schmidt

ieee802154: hwsim: add replacement for fakelb

This patch adds a new virtual driver mac802154_hwsim which is based on
the fakelb driver.
The fakelb driver will get deprecated and hopefully removed someday.
The main reason for doing this step is to rename the driver to
mac802154_hwsim to have a similar naming scheme as mac80211_hwsim,
which is more popular in the 802.11 wireless word and the idea is the
same behind this driver.

The new features of this driver are to have knowledge about connected
edges, which can be changed during runtime. This offers a testing
environment for routing protocols e.g. RPL.
The default behaviour is still as fakelb: two radios connected to each
other. New added radios during runtime will not be connected to other
wpan_hwsim instances.

The netlink api is not namespace aware on purpose, only the registered
wpan_phy's can be moved to namespaces. The physical layer according to
wiresless "air" communication can be handled across namespaces.

Furthermore the edges can be weighted with the LQI value according IEEE
802.15.4 which offers additional handling to mark bad or good connection
indicators to other connected virtual phys.
Signed-off-by: default avatarAlexander Aring <aring@mojatatu.com>
Signed-off-by: default avatarStefan Schmidt <stefan@datenfreihafen.org>
parent 4e54acb2
...@@ -115,3 +115,14 @@ config IEEE802154_MCR20A ...@@ -115,3 +115,14 @@ config IEEE802154_MCR20A
This driver can also be built as a module. To do so, say M here. This driver can also be built as a module. To do so, say M here.
the module will be called 'mcr20a'. the module will be called 'mcr20a'.
config IEEE802154_HWSIM
depends on IEEE802154_DRIVERS && MAC802154
tristate "Simulated radio testing tool for mac802154"
---help---
This driver is a developer testing tool that can be used to test
IEEE 802.15.4 networking stack (mac802154) functionality. This is not
needed for normal wpan usage and is only for testing.
This driver can also be built as a module. To do so say M here.
The module will be called 'mac802154_hwsim'.
...@@ -7,3 +7,4 @@ obj-$(CONFIG_IEEE802154_ATUSB) += atusb.o ...@@ -7,3 +7,4 @@ obj-$(CONFIG_IEEE802154_ATUSB) += atusb.o
obj-$(CONFIG_IEEE802154_ADF7242) += adf7242.o obj-$(CONFIG_IEEE802154_ADF7242) += adf7242.o
obj-$(CONFIG_IEEE802154_CA8210) += ca8210.o obj-$(CONFIG_IEEE802154_CA8210) += ca8210.o
obj-$(CONFIG_IEEE802154_MCR20A) += mcr20a.o obj-$(CONFIG_IEEE802154_MCR20A) += mcr20a.o
obj-$(CONFIG_IEEE802154_HWSIM) += mac802154_hwsim.o
This diff is collapsed.
#ifndef __MAC802154_HWSIM_H
#define __MAC802154_HWSIM_H
/* mac802154 hwsim netlink commands
*
* @MAC802154_HWSIM_CMD_UNSPEC: unspecified command to catch error
* @MAC802154_HWSIM_CMD_GET_RADIO: fetch information about existing radios
* @MAC802154_HWSIM_CMD_SET_RADIO: change radio parameters during runtime
* @MAC802154_HWSIM_CMD_NEW_RADIO: create a new radio with the given parameters
* returns the radio ID (>= 0) or negative on errors, if successful
* then multicast the result
* @MAC802154_HWSIM_CMD_DEL_RADIO: destroy a radio, reply is multicasted
* @MAC802154_HWSIM_CMD_GET_EDGE: fetch information about existing edges
* @MAC802154_HWSIM_CMD_SET_EDGE: change edge parameters during runtime
* @MAC802154_HWSIM_CMD_DEL_EDGE: delete edges between radios
* @MAC802154_HWSIM_CMD_NEW_EDGE: create a new edge between two radios
* @__MAC802154_HWSIM_CMD_MAX: enum limit
*/
enum {
MAC802154_HWSIM_CMD_UNSPEC,
MAC802154_HWSIM_CMD_GET_RADIO,
MAC802154_HWSIM_CMD_SET_RADIO,
MAC802154_HWSIM_CMD_NEW_RADIO,
MAC802154_HWSIM_CMD_DEL_RADIO,
MAC802154_HWSIM_CMD_GET_EDGE,
MAC802154_HWSIM_CMD_SET_EDGE,
MAC802154_HWSIM_CMD_DEL_EDGE,
MAC802154_HWSIM_CMD_NEW_EDGE,
__MAC802154_HWSIM_CMD_MAX,
};
#define MAC802154_HWSIM_CMD_MAX (__MAC802154_HWSIM_MAX - 1)
/* mac802154 hwsim netlink attributes
*
* @MAC802154_HWSIM_ATTR_UNSPEC: unspecified attribute to catch error
* @MAC802154_HWSIM_ATTR_RADIO_ID: u32 attribute to identify the radio
* @MAC802154_HWSIM_ATTR_EDGE: nested attribute of edges
* @MAC802154_HWSIM_ATTR_EDGES: list if nested attributes which contains the
* edge information according the radio id
* @__MAC802154_HWSIM_ATTR_MAX: enum limit
*/
enum {
MAC802154_HWSIM_ATTR_UNSPEC,
MAC802154_HWSIM_ATTR_RADIO_ID,
MAC802154_HWSIM_ATTR_RADIO_EDGE,
MAC802154_HWSIM_ATTR_RADIO_EDGES,
__MAC802154_HWSIM_ATTR_MAX,
};
#define MAC802154_HWSIM_ATTR_MAX (__MAC802154_HWSIM_ATTR_MAX - 1)
/* mac802154 hwsim edge netlink attributes
*
* @MAC802154_HWSIM_EDGE_ATTR_UNSPEC: unspecified attribute to catch error
* @MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID: radio id where the edge points to
* @MAC802154_HWSIM_EDGE_ATTR_LQI: LQI value which the endpoint radio will
* receive for this edge
* @__MAC802154_HWSIM_ATTR_MAX: enum limit
*/
enum {
MAC802154_HWSIM_EDGE_ATTR_UNSPEC,
MAC802154_HWSIM_EDGE_ATTR_ENDPOINT_ID,
MAC802154_HWSIM_EDGE_ATTR_LQI,
__MAC802154_HWSIM_EDGE_ATTR_MAX,
};
#define MAC802154_HWSIM_EDGE_ATTR_MAX (__MAC802154_HWSIM_EDGE_ATTR_MAX - 1)
#endif /* __MAC802154_HWSIM_H */
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