/*
* Enable RX.
*/
- rt2x00lib_toggle_rx(rt2x00dev, 1);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
/*
* Start the TX queues.
/*
* Disable RX.
*/
- rt2x00lib_toggle_rx(rt2x00dev, 0);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
/*
* Disable radio.
rt2x00dev->ops->lib->set_device_state(rt2x00dev, STATE_RADIO_OFF);
}
-void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int enable)
+void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state)
{
- enum dev_state state = enable ? STATE_RADIO_RX_ON : STATE_RADIO_RX_OFF;
-
/*
* When we are disabling the RX, we should also stop the link tuner.
*/
- if (!enable)
+ if (state == STATE_RADIO_RX_OFF)
rt2x00lib_stop_link_tuner(rt2x00dev);
rt2x00dev->ops->lib->set_device_state(rt2x00dev, state);
/*
* When we are enabling the RX, we should also start the link tuner.
*/
- if (enable && is_interface_present(&rt2x00dev->interface))
+ if (state == STATE_RADIO_RX_ON &&
+ is_interface_present(&rt2x00dev->interface))
rt2x00lib_start_link_tuner(rt2x00dev);
}
*/
int rt2x00lib_enable_radio(struct rt2x00_dev *rt2x00dev);
void rt2x00lib_disable_radio(struct rt2x00_dev *rt2x00dev);
-void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, int enable);
+void rt2x00lib_toggle_rx(struct rt2x00_dev *rt2x00dev, enum dev_state state);
void rt2x00lib_reset_link_tuner(struct rt2x00_dev *rt2x00dev);
/*
if (!conf->radio_enabled)
rt2x00lib_disable_radio(rt2x00dev);
else
- rt2x00lib_toggle_rx(rt2x00dev, 0);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF);
}
rt2x00lib_config(rt2x00dev, conf, 0);
* Reenable RX only if the radio should be on.
*/
if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags))
- rt2x00lib_toggle_rx(rt2x00dev, 1);
+ rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON);
else if (conf->radio_enabled)
return rt2x00lib_enable_radio(rt2x00dev);