IEEE802154_RX_MSG = 1,
};
+enum ieee802154_sdata_state_bits {
+ SDATA_STATE_RUNNING,
+};
+
/* Slave interface definition.
*
* Slaves represent typical network interfaces available from userspace.
struct net_device *dev;
int type;
- bool running;
+ unsigned long state;
spinlock_t mib_lock;
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;
mutex_lock(&sdata->local->iflist_mtx);
list_for_each_entry(subif, &sdata->local->interfaces, list) {
if (subif != sdata && subif->type == sdata->type &&
- subif->running) {
+ ieee802154_sdata_running(subif)) {
mutex_unlock(&sdata->local->iflist_mtx);
return -EBUSY;
}
mutex_unlock(&sdata->local->iflist_mtx);
}
- mutex_lock(&sdata->local->iflist_mtx);
- sdata->running = true;
- mutex_unlock(&sdata->local->iflist_mtx);
+ set_bit(SDATA_STATE_RUNNING, &sdata->state);
if (local->open_count++ == 0) {
res = drv_start(local);
netif_start_queue(dev);
return 0;
err:
+ /* might already be clear but that doesn't matter */
+ clear_bit(SDATA_STATE_RUNNING, &sdata->state);
sdata->local->open_count--;
return res;
netif_stop_queue(dev);
- mutex_lock(&sdata->local->iflist_mtx);
- sdata->running = false;
- mutex_unlock(&sdata->local->iflist_mtx);
+ clear_bit(SDATA_STATE_RUNNING, &sdata->state);
if (!--local->open_count)
drv_stop(local);