aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac802154
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 15:44:46 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 05:44:42 -0400
commitedea8f7c75ec6c238130bd7e74d9f6f4c26e97b0 (patch)
treed195877b5647f91cd83399f4f8b1462e7f19d24e /net/mac802154
parent8329fcf11f5c2ae2fb7b1f56f05b0bb899babc85 (diff)
cfg802154: introduce wpan phy flags
This patch introduce a flag property for the wpan phy structure. The current flag settings in ieee802154_hw are accessable in mac802154 layer only which is okay for flags which indicates MAC handling which are done by phy. For real PHY layer settings like cca mode, transmit power, cca energy detection level. The difference between these flags are that the MAC handling flags are only handled in mac802154/HardMac layer e.g. on an interface up. The phy settings are direct netlink calls from nl802154 into the driver layer and the nl802154 need to have a chance to check if the driver supports this handling before sending to the next layer. We also check now on PHY flags while dumping and setting pib attributes. In comparing with MIB attributes the 802.15.4 gives us an default value which we assume when a transceiver implement less functionality. In case of MIB settings the nl802154 layer doesn't need to check on the ieee802154_hw flags then. 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/mac_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/mac802154/mac_cmd.c b/net/mac802154/mac_cmd.c
index bdccb4ecd30f..6dcbb3b5994c 100644
--- a/net/mac802154/mac_cmd.c
+++ b/net/mac802154/mac_cmd.c
@@ -91,19 +91,19 @@ static int mac802154_set_mac_params(struct net_device *dev,
91 wpan_dev->frame_retries = params->frame_retries; 91 wpan_dev->frame_retries = params->frame_retries;
92 wpan_dev->lbt = params->lbt; 92 wpan_dev->lbt = params->lbt;
93 93
94 if (local->hw.flags & IEEE802154_HW_TXPOWER) { 94 if (local->hw.phy->flags & WPAN_PHY_FLAG_TXPOWER) {
95 ret = drv_set_tx_power(local, params->transmit_power); 95 ret = drv_set_tx_power(local, params->transmit_power);
96 if (ret < 0) 96 if (ret < 0)
97 return ret; 97 return ret;
98 } 98 }
99 99
100 if (local->hw.flags & IEEE802154_HW_CCA_MODE) { 100 if (local->hw.phy->flags & WPAN_PHY_FLAG_CCA_MODE) {
101 ret = drv_set_cca_mode(local, &params->cca); 101 ret = drv_set_cca_mode(local, &params->cca);
102 if (ret < 0) 102 if (ret < 0)
103 return ret; 103 return ret;
104 } 104 }
105 105
106 if (local->hw.flags & IEEE802154_HW_CCA_ED_LEVEL) { 106 if (local->hw.phy->flags & WPAN_PHY_FLAG_CCA_ED_LEVEL) {
107 ret = drv_set_cca_ed_level(local, params->cca_ed_level); 107 ret = drv_set_cca_ed_level(local, params->cca_ed_level);
108 if (ret < 0) 108 if (ret < 0)
109 return ret; 109 return ret;