diff options
author | Alexander Aring <alex.aring@gmail.com> | 2014-10-28 18:21:24 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-28 23:19:07 +0100 |
commit | 0ea3da64fa602efa0a89502eefdb396be84d2eba (patch) | |
tree | 9438ff7ae9c8c5c8e9b6d29bab56086748ae774b /net/mac802154/ieee802154_i.h | |
parent | a543c5989d7711d984608f4e12a73218642ca865 (diff) | |
download | blackbird-obmc-linux-0ea3da64fa602efa0a89502eefdb396be84d2eba.tar.gz blackbird-obmc-linux-0ea3da64fa602efa0a89502eefdb396be84d2eba.zip |
mac802154: rework sdata state change to running
This patch reworks the handling for setting the state like mac80211. We
use bit's instead a bool variable. The mutex is not needed because it use
test and set bits which are atomic operations.
Signed-off-by: Alexander Aring <alex.aring@gmail.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/mac802154/ieee802154_i.h')
-rw-r--r-- | net/mac802154/ieee802154_i.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/net/mac802154/ieee802154_i.h b/net/mac802154/ieee802154_i.h index a379b971b13c..e34fe51043f2 100644 --- a/net/mac802154/ieee802154_i.h +++ b/net/mac802154/ieee802154_i.h @@ -67,6 +67,10 @@ enum { IEEE802154_RX_MSG = 1, }; +enum ieee802154_sdata_state_bits { + SDATA_STATE_RUNNING, +}; + /* Slave interface definition. * * Slaves represent typical network interfaces available from userspace. @@ -80,7 +84,7 @@ struct ieee802154_sub_if_data { struct net_device *dev; int type; - bool running; + unsigned long state; spinlock_t mib_lock; @@ -120,6 +124,12 @@ IEEE802154_DEV_TO_SUB_IF(const struct net_device *dev) return netdev_priv(dev); } +static inline bool +ieee802154_sdata_running(struct ieee802154_sub_if_data *sdata) +{ + return test_bit(SDATA_STATE_RUNNING, &sdata->state); +} + extern struct ieee802154_reduced_mlme_ops mac802154_mlme_reduced; extern struct ieee802154_mlme_ops mac802154_mlme_wpan; |