{
might_sleep();
+ local->started = true;
+
return local->ops->start(&local->hw);
}
might_sleep();
local->ops->stop(&local->hw);
+
+ local->started = false;
}
static inline int drv_set_channel(struct ieee802154_local *local,
*/
struct workqueue_struct *workqueue;
- /* SoftMAC device is registered and running. One can add subinterfaces.
- * This flag should be modified under slaves_mtx and RTNL, so you can
- * read them using any of protection methods.
- */
bool started;
struct tasklet_struct tasklet;
struct sk_buff_head skb_queue;
};
-#define MAC802154_DEVICE_STOPPED 0x00
-#define MAC802154_DEVICE_RUN 0x01
-
enum {
IEEE802154_RX_MSG = 1,
};
SET_NETDEV_DEV(dev, &local->phy->dev);
- mutex_lock(&local->iflist_mtx);
- if (!local->started) {
- mutex_unlock(&local->iflist_mtx);
- return -ENODEV;
- }
- mutex_unlock(&local->iflist_mtx);
-
err = register_netdev(dev);
if (err < 0)
return err;
if (rc < 0)
goto out_wq;
- rtnl_lock();
-
- mutex_lock(&local->iflist_mtx);
- local->started = MAC802154_DEVICE_RUN;
- mutex_unlock(&local->iflist_mtx);
-
- rtnl_unlock();
-
return 0;
out_wq:
rtnl_lock();
- mutex_lock(&local->iflist_mtx);
- local->started = MAC802154_DEVICE_STOPPED;
- mutex_unlock(&local->iflist_mtx);
-
list_for_each_entry_safe(sdata, next, &local->interfaces, list) {
mutex_lock(&sdata->local->iflist_mtx);
list_del(&sdata->list);