summaryrefslogtreecommitdiffstats
path: root/include/net/cfg802154.h
diff options
context:
space:
mode:
authorAlexander Aring <alex.aring@gmail.com>2015-05-17 15:44:44 -0400
committerMarcel Holtmann <marcel@holtmann.org>2015-05-19 05:44:42 -0400
commit791021bf13ec9d0fc14bfd8c9c4b368ace568239 (patch)
tree5e5bb4fe5815f959379b94e89194c7d5fecf5e12 /include/net/cfg802154.h
parentfea3318d20776a94afeea0460c6ee9904e60569e (diff)
mac802154: check for really changes
This patch adds check if the value is really changed inside pib/mib. If a transceiver do support only one value for e.g. max_be then this will also handle that the driver layer doesn't need to care about handling to set one value only. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'include/net/cfg802154.h')
-rw-r--r--include/net/cfg802154.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/net/cfg802154.h b/include/net/cfg802154.h
index 23abd08a310a..37abc1603285 100644
--- a/include/net/cfg802154.h
+++ b/include/net/cfg802154.h
@@ -94,6 +94,18 @@ struct wpan_phy_cca {
94 enum nl802154_cca_opts opt; 94 enum nl802154_cca_opts opt;
95}; 95};
96 96
97static inline bool
98wpan_phy_cca_cmp(const struct wpan_phy_cca *a, const struct wpan_phy_cca *b)
99{
100 if (a->mode != b->mode)
101 return false;
102
103 if (a->mode == NL802154_CCA_ENERGY_CARRIER)
104 return a->opt == b->opt;
105
106 return true;
107}
108
97struct wpan_phy { 109struct wpan_phy {
98 struct mutex pib_lock; 110 struct mutex pib_lock;
99 111