aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00config.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2007-09-25 14:55:39 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-10-10 19:53:03 -0400
commit066cb637b1b562bebd09d237bfaaca6724f247e5 (patch)
tree340b3902e69246cb73e820bbd9994bd1bdcca402 /drivers/net/wireless/rt2x00/rt2x00config.c
parent12dadb9009723dd0512091643e6e403f9e1b25cb (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.c27
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
49void rt2x00lib_config_type(struct rt2x00_dev *rt2x00dev, int type) 49void 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
69void rt2x00lib_config(struct rt2x00_dev *rt2x00dev, struct ieee80211_conf *conf) 55void 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 }