summaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-27 13:42:10 +0200
committerMarcel Holtmann <marcel@holtmann.org>2015-05-27 19:29:42 +0200
commitb69644c1c72e179738dd5c7e52e99d8550189472 (patch)
treed211eea2d8c51db2e8cac0c2aa00bd4b2b9d243c /net/mac802154
parente4390592a4fc3ee10a8bc4742197fdbac3935f74 (diff)
downloadlinux-stable-b69644c1c72e179738dd5c7e52e99d8550189472.tar.gz
linux-stable-b69644c1c72e179738dd5c7e52e99d8550189472.tar.bz2
linux-stable-b69644c1c72e179738dd5c7e52e99d8550189472.zip
nl802154: add support to set cca ed level
This patch adds support for setting the current cca ed level value over nl802154. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Reviewed-by: Varka Bhadram <varkabhadram@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/cfg.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index ab12fa296eb3..317c4662e544 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -106,6 +106,24 @@ ieee802154_set_cca_mode(struct wpan_phy *wpan_phy,
}
static int
+ieee802154_set_cca_ed_level(struct wpan_phy *wpan_phy, s32 ed_level)
+{
+ struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
+ int ret;
+
+ ASSERT_RTNL();
+
+ if (wpan_phy->cca_ed_level == ed_level)
+ return 0;
+
+ ret = drv_set_cca_ed_level(local, ed_level);
+ if (!ret)
+ wpan_phy->cca_ed_level = ed_level;
+
+ return ret;
+}
+
+static int
ieee802154_set_tx_power(struct wpan_phy *wpan_phy, s32 power)
{
struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
@@ -213,6 +231,7 @@ const struct cfg802154_ops mac802154_config_ops = {
.del_virtual_intf = ieee802154_del_iface,
.set_channel = ieee802154_set_channel,
.set_cca_mode = ieee802154_set_cca_mode,
+ .set_cca_ed_level = ieee802154_set_cca_ed_level,
.set_tx_power = ieee802154_set_tx_power,
.set_pan_id = ieee802154_set_pan_id,
.set_short_addr = ieee802154_set_short_addr,