aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-12-10 09:33:13 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-12-18 18:19:23 -0500
commitba2a9506a76450568cbc0d51626d94cf8528c0c7 (patch)
tree71f548777d889121041d978c7806db22b04235d1 /net/mac802154
parent7fe9a3882bb37195c41ab125a0f2852398d2646a (diff)
nl802154: introduce support for cca settings
This patch adds support for setting cca parameters via nl802154. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154')
-rw-r--r--net/mac802154/cfg.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/net/mac802154/cfg.c b/net/mac802154/cfg.c
index c035708ada16..7d31da503dcf 100644
--- a/net/mac802154/cfg.c
+++ b/net/mac802154/cfg.c
@@ -87,6 +87,26 @@ ieee802154_set_channel(struct wpan_phy *wpan_phy, u8 page, u8 channel)
87} 87}
88 88
89static int 89static int
90ieee802154_set_cca_mode(struct wpan_phy *wpan_phy,
91 const struct wpan_phy_cca *cca)
92{
93 struct ieee802154_local *local = wpan_phy_priv(wpan_phy);
94 int ret;
95
96 ASSERT_RTNL();
97
98 /* check if phy support this setting */
99 if (!(local->hw.flags & IEEE802154_HW_CCA_MODE))
100 return -EOPNOTSUPP;
101
102 ret = drv_set_cca_mode(local, cca);
103 if (!ret)
104 wpan_phy->cca = *cca;
105
106 return ret;
107}
108
109static int
90ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev, 110ieee802154_set_pan_id(struct wpan_phy *wpan_phy, struct wpan_dev *wpan_dev,
91 __le16 pan_id) 111 __le16 pan_id)
92{ 112{
@@ -201,6 +221,7 @@ const struct cfg802154_ops mac802154_config_ops = {
201 .add_virtual_intf = ieee802154_add_iface, 221 .add_virtual_intf = ieee802154_add_iface,
202 .del_virtual_intf = ieee802154_del_iface, 222 .del_virtual_intf = ieee802154_del_iface,
203 .set_channel = ieee802154_set_channel, 223 .set_channel = ieee802154_set_channel,
224 .set_cca_mode = ieee802154_set_cca_mode,
204 .set_pan_id = ieee802154_set_pan_id, 225 .set_pan_id = ieee802154_set_pan_id,
205 .set_short_addr = ieee802154_set_short_addr, 226 .set_short_addr = ieee802154_set_short_addr,
206 .set_backoff_exponent = ieee802154_set_backoff_exponent, 227 .set_backoff_exponent = ieee802154_set_backoff_exponent,