aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2x00config.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2008-08-29 15:04:26 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:24:11 -0400
commit0262ab0df64a67d4c0ed7577a29b7d866819cc68 (patch)
tree95c5e7842787c60140fe6c35ff7a1bc8b43bebaf /drivers/net/wireless/rt2x00/rt2x00config.c
parentde9cc7a4e6f975ca5e91cf8745b3e35a7e780bae (diff)
rt2x00: Fix race conditions in flag handling
Some of the flags should be accessed atomically to prevent race conditions. The flags that are most important are those that can change often and indicate the actual state of the device, queue or queue entry. The big flag rename was done to move all state flags to the same naming type as the other rt2x00dev flags and made sure all places where the flags were used were changed. ;) Thanks to Stephen for most of the queue flags updates, which fixes some of the most obvious consequences of the race conditions. Among those the notorious: rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0. rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0. rt2x00queue_write_tx_frame: Error - Arrived at non-free entry in the non-full queue 0. Signed-off-by: Stephen Blackheath <tramp.enshrine.stephen@blacksapphire.com> 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.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2x00config.c b/drivers/net/wireless/rt2x00/rt2x00config.c
index ea37c7962043..ca051f50ef10 100644
--- a/drivers/net/wireless/rt2x00/rt2x00config.c
+++ b/drivers/net/wireless/rt2x00/rt2x00config.c
@@ -121,7 +121,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
121 * Antenna setup changes require the RX to be disabled, 121 * Antenna setup changes require the RX to be disabled,
122 * else the changes will be ignored by the device. 122 * else the changes will be ignored by the device.
123 */ 123 */
124 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags)) 124 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
125 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF_LINK); 125 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_OFF_LINK);
126 126
127 /* 127 /*
@@ -136,7 +136,7 @@ void rt2x00lib_config_antenna(struct rt2x00_dev *rt2x00dev,
136 rt2x00dev->link.ant.active.rx = libconf.ant.rx; 136 rt2x00dev->link.ant.active.rx = libconf.ant.rx;
137 rt2x00dev->link.ant.active.tx = libconf.ant.tx; 137 rt2x00dev->link.ant.active.tx = libconf.ant.tx;
138 138
139 if (test_bit(DEVICE_ENABLED_RADIO, &rt2x00dev->flags)) 139 if (test_bit(DEVICE_STATE_ENABLED_RADIO, &rt2x00dev->flags))
140 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK); 140 rt2x00lib_toggle_rx(rt2x00dev, STATE_RADIO_RX_ON_LINK);
141} 141}
142 142