aboutsummaryrefslogtreecommitdiffstats
path: root/net/ieee802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2014-12-10 09:33:12 -0500
committerMarcel Holtmann <marcel@holtmann.org>2014-12-18 18:19:23 -0500
commit7fe9a3882bb37195c41ab125a0f2852398d2646a (patch)
tree2575090079228f59a93466eaf2d1b69524b97e8a /net/ieee802154
parentb40d6376ff470572e2fafb20ca06a68f2d7940cb (diff)
ieee802154: rework cca setting
The current cca setting handle is a driver specific call. We need to introduce some 802.15.4 specific layer and mapping 802.15.4 cca modes to driver specific ones inside the 802.15.4 driver. This patch will add such 802.15.4 layer and mapping the cca settings to driver specific ones. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/ieee802154')
-rw-r--r--net/ieee802154/nl-mac.c4
-rw-r--r--net/ieee802154/nl802154.c2
-rw-r--r--net/ieee802154/sysfs.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/net/ieee802154/nl-mac.c b/net/ieee802154/nl-mac.c
index cd919493c976..3c902e9516fb 100644
--- a/net/ieee802154/nl-mac.c
+++ b/net/ieee802154/nl-mac.c
@@ -121,7 +121,7 @@ static int ieee802154_nl_fill_iface(struct sk_buff *msg, u32 portid,
121 params.transmit_power) || 121 params.transmit_power) ||
122 nla_put_u8(msg, IEEE802154_ATTR_LBT_ENABLED, params.lbt) || 122 nla_put_u8(msg, IEEE802154_ATTR_LBT_ENABLED, params.lbt) ||
123 nla_put_u8(msg, IEEE802154_ATTR_CCA_MODE, 123 nla_put_u8(msg, IEEE802154_ATTR_CCA_MODE,
124 params.cca_mode) || 124 params.cca.mode) ||
125 nla_put_s32(msg, IEEE802154_ATTR_CCA_ED_LEVEL, 125 nla_put_s32(msg, IEEE802154_ATTR_CCA_ED_LEVEL,
126 params.cca_ed_level) || 126 params.cca_ed_level) ||
127 nla_put_u8(msg, IEEE802154_ATTR_CSMA_RETRIES, 127 nla_put_u8(msg, IEEE802154_ATTR_CSMA_RETRIES,
@@ -516,7 +516,7 @@ int ieee802154_set_macparams(struct sk_buff *skb, struct genl_info *info)
516 params.lbt = nla_get_u8(info->attrs[IEEE802154_ATTR_LBT_ENABLED]); 516 params.lbt = nla_get_u8(info->attrs[IEEE802154_ATTR_LBT_ENABLED]);
517 517
518 if (info->attrs[IEEE802154_ATTR_CCA_MODE]) 518 if (info->attrs[IEEE802154_ATTR_CCA_MODE])
519 params.cca_mode = nla_get_u8(info->attrs[IEEE802154_ATTR_CCA_MODE]); 519 params.cca.mode = nla_get_u8(info->attrs[IEEE802154_ATTR_CCA_MODE]);
520 520
521 if (info->attrs[IEEE802154_ATTR_CCA_ED_LEVEL]) 521 if (info->attrs[IEEE802154_ATTR_CCA_ED_LEVEL])
522 params.cca_ed_level = nla_get_s32(info->attrs[IEEE802154_ATTR_CCA_ED_LEVEL]); 522 params.cca_ed_level = nla_get_s32(info->attrs[IEEE802154_ATTR_CCA_ED_LEVEL]);
diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 889647744697..1efbe4250024 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -291,7 +291,7 @@ static int nl802154_send_wpan_phy(struct cfg802154_registered_device *rdev,
291 291
292 /* cca mode */ 292 /* cca mode */
293 if (nla_put_u8(msg, NL802154_ATTR_CCA_MODE, 293 if (nla_put_u8(msg, NL802154_ATTR_CCA_MODE,
294 rdev->wpan_phy.cca_mode)) 294 rdev->wpan_phy.cca.mode))
295 goto nla_put_failure; 295 goto nla_put_failure;
296 296
297 if (nla_put_s8(msg, NL802154_ATTR_TX_POWER, 297 if (nla_put_s8(msg, NL802154_ATTR_TX_POWER,
diff --git a/net/ieee802154/sysfs.c b/net/ieee802154/sysfs.c
index 1613b9c65dfa..dff55c2d87f3 100644
--- a/net/ieee802154/sysfs.c
+++ b/net/ieee802154/sysfs.c
@@ -68,7 +68,7 @@ static DEVICE_ATTR_RO(name)
68MASTER_SHOW(current_channel, "%d"); 68MASTER_SHOW(current_channel, "%d");
69MASTER_SHOW(current_page, "%d"); 69MASTER_SHOW(current_page, "%d");
70MASTER_SHOW(transmit_power, "%d +- 1 dB"); 70MASTER_SHOW(transmit_power, "%d +- 1 dB");
71MASTER_SHOW(cca_mode, "%d"); 71MASTER_SHOW_COMPLEX(cca_mode, "%d", phy->cca.mode);
72 72
73static ssize_t channels_supported_show(struct device *dev, 73static ssize_t channels_supported_show(struct device *dev,
74 struct device_attribute *attr, 74 struct device_attribute *attr,