};
enum rtl_flag {
+ RTL_FLAG_TASK_ENABLED,
RTL_FLAG_TASK_SLOW_PENDING,
RTL_FLAG_TASK_RESET_PENDING,
RTL_FLAG_TASK_PHY_PENDING,
DECLARE_BITMAP(flags, RTL_FLAG_MAX);
struct mutex mutex;
struct work_struct work;
- bool enabled;
} wk;
unsigned features;
rtl_lock_work(tp);
- tp->wk.enabled = true;
+ set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
napi_enable(&tp->napi);
rtl_lock_work(tp);
- if (!netif_running(dev) || !tp->wk.enabled)
+ if (!netif_running(dev) ||
+ !test_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags))
goto out_unlock;
for (i = 0; i < ARRAY_SIZE(rtl_work); i++) {
rtl8169_update_counters(dev);
rtl_lock_work(tp);
- tp->wk.enabled = false;
+ clear_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
rtl8169_down(dev);
rtl_unlock_work(tp);
rtl_lock_work(tp);
napi_disable(&tp->napi);
- tp->wk.enabled = false;
+ clear_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
rtl_unlock_work(tp);
rtl_pll_power_down(tp);
rtl_pll_power_up(tp);
- tp->wk.enabled = true;
+ set_bit(RTL_FLAG_TASK_ENABLED, tp->wk.flags);
rtl_schedule_task(tp, RTL_FLAG_TASK_RESET_PENDING);
}