diff options
author | Ivo van Doorn <ivdoorn@gmail.com> | 2007-09-25 14:55:39 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:53:03 -0400 |
commit | 066cb637b1b562bebd09d237bfaaca6724f247e5 (patch) | |
tree | 340b3902e69246cb73e820bbd9994bd1bdcca402 /drivers/net/wireless/rt2x00/rt2x00config.c | |
parent | 12dadb9009723dd0512091643e6e403f9e1b25cb (diff) |
[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>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2x00config.c')
-rw-r--r-- | drivers/net/wireless/rt2x00/rt2x00config.c | 27 |
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c index f962ce497086..13b510687bcb 100644 --- a/drivers/net/wireless/rt2x00/rt2x00config.c +++ b/drivers/net/wireless/rt2x00/rt2x00config.c | |||
@@ -48,33 +48,20 @@ void rt2x00lib_config_bssid(struct rt2x00_dev *rt2x00dev, u8 *bssid) | |||
48 | 48 | ||
49 | void rt2x00lib_config_type(struct rt2x00_dev *rt2x00dev, int type) | 49 | void rt2x00lib_config_type(struct rt2x00_dev *rt2x00dev, int type) |
50 | { | 50 | { |
51 | struct interface *intf = &rt2x00dev->interface; | 51 | if (type != INVALID_INTERFACE) |
52 | 52 | rt2x00dev->ops->lib->config_type(rt2x00dev, type); | |
53 | if (!test_bit(INTERFACE_RESUME, &rt2x00dev->flags) && | ||
54 | (!!test_bit(INTERFACE_ENABLED, &rt2x00dev->flags) == | ||
55 | !!is_interface_present(intf))) | ||
56 | return; | ||
57 | |||
58 | rt2x00dev->ops->lib->config_type(rt2x00dev, type); | ||
59 | |||
60 | /* | ||
61 | * Update the configuration flags. | ||
62 | */ | ||
63 | if (is_interface_present(intf)) | ||
64 | __set_bit(INTERFACE_ENABLED, &rt2x00dev->flags); | ||
65 | else | ||
66 | __clear_bit(INTERFACE_ENABLED, &rt2x00dev->flags); | ||
67 | } | 53 | } |
68 | 54 | ||
69 | void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, struct ieee80211_conf *conf) | 55 | void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, |
56 | struct ieee80211_conf *conf, const int force_config) | ||
70 | { | 57 | { |
71 | int flags = 0; | 58 | int flags = 0; |
72 | 59 | ||
73 | /* | 60 | /* |
74 | * If we are in RESUME state we should | 61 | * In some situations we want to force all configurations |
75 | * force all configuration options. | 62 | * to be reloaded (When resuming for instance). |
76 | */ | 63 | */ |
77 | if (test_bit(INTERFACE_RESUME, &rt2x00dev->flags)) { | 64 | if (force_config) { |
78 | flags = CONFIG_UPDATE_ALL; | 65 | flags = CONFIG_UPDATE_ALL; |
79 | goto config; | 66 | goto config; |
80 | } | 67 | } |