aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2500usb.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-11-21 20:05:11 -0500
committerDavid S. Miller <davem@davemloft.net>2008-11-21 20:05:11 -0500
commit6c0bce37ffc8f000a516fadf6dee84579c4c8f9b (patch)
tree273af34d6f777b1ecb0fce7b2685e868064e6cf9 /drivers/net/wireless/rt2x00/rt2500usb.c
parente243455d345ef62751723671bc2605a2f6032ceb (diff)
parenta1eb5fe319beb9e181aa52c8adf75ad9aab56a89 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2500usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2500usb.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2500usb.c b/drivers/net/wireless/rt2x00/rt2500usb.c
index 639d5a2f84e2..e6bae4ae4c47 100644
--- a/drivers/net/wireless/rt2x00/rt2500usb.c
+++ b/drivers/net/wireless/rt2x00/rt2500usb.c
@@ -47,7 +47,7 @@
47 * between each attampt. When the busy bit is still set at that time, 47 * between each attampt. When the busy bit is still set at that time,
48 * the access attempt is considered to have failed, 48 * the access attempt is considered to have failed,
49 * and we will print an error. 49 * and we will print an error.
50 * If the usb_cache_mutex is already held then the _lock variants must 50 * If the csr_mutex is already held then the _lock variants must
51 * be used instead. 51 * be used instead.
52 */ 52 */
53static inline void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev, 53static inline void rt2500usb_register_read(struct rt2x00_dev *rt2x00dev,
@@ -132,7 +132,7 @@ static void rt2500usb_bbp_write(struct rt2x00_dev *rt2x00dev,
132{ 132{
133 u16 reg; 133 u16 reg;
134 134
135 mutex_lock(&rt2x00dev->usb_cache_mutex); 135 mutex_lock(&rt2x00dev->csr_mutex);
136 136
137 /* 137 /*
138 * Wait until the BBP becomes ready. 138 * Wait until the BBP becomes ready.
@@ -151,12 +151,12 @@ static void rt2500usb_bbp_write(struct rt2x00_dev *rt2x00dev,
151 151
152 rt2500usb_register_write_lock(rt2x00dev, PHY_CSR7, reg); 152 rt2500usb_register_write_lock(rt2x00dev, PHY_CSR7, reg);
153 153
154 mutex_unlock(&rt2x00dev->usb_cache_mutex); 154 mutex_unlock(&rt2x00dev->csr_mutex);
155 155
156 return; 156 return;
157 157
158exit_fail: 158exit_fail:
159 mutex_unlock(&rt2x00dev->usb_cache_mutex); 159 mutex_unlock(&rt2x00dev->csr_mutex);
160 160
161 ERROR(rt2x00dev, "PHY_CSR8 register busy. Write failed.\n"); 161 ERROR(rt2x00dev, "PHY_CSR8 register busy. Write failed.\n");
162} 162}
@@ -166,7 +166,7 @@ static void rt2500usb_bbp_read(struct rt2x00_dev *rt2x00dev,
166{ 166{
167 u16 reg; 167 u16 reg;
168 168
169 mutex_lock(&rt2x00dev->usb_cache_mutex); 169 mutex_lock(&rt2x00dev->csr_mutex);
170 170
171 /* 171 /*
172 * Wait until the BBP becomes ready. 172 * Wait until the BBP becomes ready.
@@ -194,12 +194,12 @@ static void rt2500usb_bbp_read(struct rt2x00_dev *rt2x00dev,
194 rt2500usb_register_read_lock(rt2x00dev, PHY_CSR7, &reg); 194 rt2500usb_register_read_lock(rt2x00dev, PHY_CSR7, &reg);
195 *value = rt2x00_get_field16(reg, PHY_CSR7_DATA); 195 *value = rt2x00_get_field16(reg, PHY_CSR7_DATA);
196 196
197 mutex_unlock(&rt2x00dev->usb_cache_mutex); 197 mutex_unlock(&rt2x00dev->csr_mutex);
198 198
199 return; 199 return;
200 200
201exit_fail: 201exit_fail:
202 mutex_unlock(&rt2x00dev->usb_cache_mutex); 202 mutex_unlock(&rt2x00dev->csr_mutex);
203 203
204 ERROR(rt2x00dev, "PHY_CSR8 register busy. Read failed.\n"); 204 ERROR(rt2x00dev, "PHY_CSR8 register busy. Read failed.\n");
205 *value = 0xff; 205 *value = 0xff;
@@ -214,7 +214,7 @@ static void rt2500usb_rf_write(struct rt2x00_dev *rt2x00dev,
214 if (!word) 214 if (!word)
215 return; 215 return;
216 216
217 mutex_lock(&rt2x00dev->usb_cache_mutex); 217 mutex_lock(&rt2x00dev->csr_mutex);
218 218
219 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 219 for (i = 0; i < REGISTER_BUSY_COUNT; i++) {
220 rt2500usb_register_read_lock(rt2x00dev, PHY_CSR10, &reg); 220 rt2500usb_register_read_lock(rt2x00dev, PHY_CSR10, &reg);
@@ -223,7 +223,7 @@ static void rt2500usb_rf_write(struct rt2x00_dev *rt2x00dev,
223 udelay(REGISTER_BUSY_DELAY); 223 udelay(REGISTER_BUSY_DELAY);
224 } 224 }
225 225
226 mutex_unlock(&rt2x00dev->usb_cache_mutex); 226 mutex_unlock(&rt2x00dev->csr_mutex);
227 ERROR(rt2x00dev, "PHY_CSR10 register busy. Write failed.\n"); 227 ERROR(rt2x00dev, "PHY_CSR10 register busy. Write failed.\n");
228 return; 228 return;
229 229
@@ -241,7 +241,7 @@ rf_write:
241 rt2500usb_register_write_lock(rt2x00dev, PHY_CSR10, reg); 241 rt2500usb_register_write_lock(rt2x00dev, PHY_CSR10, reg);
242 rt2x00_rf_write(rt2x00dev, word, value); 242 rt2x00_rf_write(rt2x00dev, word, value);
243 243
244 mutex_unlock(&rt2x00dev->usb_cache_mutex); 244 mutex_unlock(&rt2x00dev->csr_mutex);
245} 245}
246 246
247#ifdef CONFIG_RT2X00_LIB_DEBUGFS 247#ifdef CONFIG_RT2X00_LIB_DEBUGFS
@@ -385,7 +385,7 @@ static void rt2500usb_config_intf(struct rt2x00_dev *rt2x00dev,
385 /* 385 /*
386 * Enable beacon config 386 * Enable beacon config
387 */ 387 */
388 bcn_preload = PREAMBLE + get_duration(IEEE80211_HEADER, 20); 388 bcn_preload = PREAMBLE + GET_DURATION(IEEE80211_HEADER, 20);
389 rt2500usb_register_read(rt2x00dev, TXRX_CSR20, &reg); 389 rt2500usb_register_read(rt2x00dev, TXRX_CSR20, &reg);
390 rt2x00_set_field16(&reg, TXRX_CSR20_OFFSET, bcn_preload >> 6); 390 rt2x00_set_field16(&reg, TXRX_CSR20_OFFSET, bcn_preload >> 6);
391 rt2x00_set_field16(&reg, TXRX_CSR20_BCN_EXPECT_WINDOW, 391 rt2x00_set_field16(&reg, TXRX_CSR20_BCN_EXPECT_WINDOW,
@@ -1777,8 +1777,7 @@ static const struct rt2x00lib_ops rt2500usb_rt2x00_ops = {
1777 .probe_hw = rt2500usb_probe_hw, 1777 .probe_hw = rt2500usb_probe_hw,
1778 .initialize = rt2x00usb_initialize, 1778 .initialize = rt2x00usb_initialize,
1779 .uninitialize = rt2x00usb_uninitialize, 1779 .uninitialize = rt2x00usb_uninitialize,
1780 .init_rxentry = rt2x00usb_init_rxentry, 1780 .clear_entry = rt2x00usb_clear_entry,
1781 .init_txentry = rt2x00usb_init_txentry,
1782 .set_device_state = rt2500usb_set_device_state, 1781 .set_device_state = rt2500usb_set_device_state,
1783 .link_stats = rt2500usb_link_stats, 1782 .link_stats = rt2500usb_link_stats,
1784 .reset_tuner = rt2500usb_reset_tuner, 1783 .reset_tuner = rt2500usb_reset_tuner,