[PATCH] rt2x00: Reorganize rt2x00dev->flags

The rt2x00dev->flags has become a chaos over time,
this will reorganize the flags by renaming, deleting, adding
and properly implement the flags.

Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
Ivo van Doorn
2007-09-25 20:55:39 +02:00
committed by David S. Miller
parent 12dadb9009
commit 066cb637b1
11 changed files with 115 additions and 84 deletions

View File

@@ -48,33 +48,20 @@ void rt2x00lib_config_bssid(struct rt2x00_dev *rt2x00dev, u8 *bssid)
void rt2x00lib_config_type(struct rt2x00_dev *rt2x00dev, int type)
{
struct interface *intf = &rt2x00dev->interface;
if (!test_bit(INTERFACE_RESUME, &rt2x00dev->flags) &&
(!!test_bit(INTERFACE_ENABLED, &rt2x00dev->flags) ==
!!is_interface_present(intf)))
return;
rt2x00dev->ops->lib->config_type(rt2x00dev, type);
/*
* Update the configuration flags.
*/
if (is_interface_present(intf))
__set_bit(INTERFACE_ENABLED, &rt2x00dev->flags);
else
__clear_bit(INTERFACE_ENABLED, &rt2x00dev->flags);
if (type != INVALID_INTERFACE)
rt2x00dev->ops->lib->config_type(rt2x00dev, type);
}
void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, struct ieee80211_conf *conf)
void rt2x00lib_config(struct rt2x00_dev *rt2x00dev,
struct ieee80211_conf *conf, const int force_config)
{
int flags = 0;
/*
* If we are in RESUME state we should
* force all configuration options.
* In some situations we want to force all configurations
* to be reloaded (When resuming for instance).
*/
if (test_bit(INTERFACE_RESUME, &rt2x00dev->flags)) {
if (force_config) {
flags = CONFIG_UPDATE_ALL;
goto config;
}