aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/rt2x00/rt2800usb.c
diff options
context:
space:
mode:
authorIvo van Doorn <ivdoorn@gmail.com>2010-08-30 15:13:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-08-31 14:22:23 -0400
commit5ffddc498c700bb45ea55efc37746cb28d601766 (patch)
treed3e49481b043ac1822142509147245bac45eb244 /drivers/net/wireless/rt2x00/rt2800usb.c
parent2035c0cf8f637e88cdd338c15570a7ad42afc552 (diff)
rt2x00: Add rt2800_wait_csr_ready
Similar to rt2800_wait_wpdma_ready() we can add a function to waiting until the CSR is ready. This centralizes some additional code into rt2800lib. Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com> Acked-by: Gertjan van Wingerde <gwingerde@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/rt2x00/rt2800usb.c')
-rw-r--r--drivers/net/wireless/rt2x00/rt2800usb.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
index 82ae58e0c5d7..b1a8e943750b 100644
--- a/drivers/net/wireless/rt2x00/rt2800usb.c
+++ b/drivers/net/wireless/rt2x00/rt2800usb.c
@@ -122,22 +122,12 @@ static void rt2800usb_toggle_rx(struct rt2x00_dev *rt2x00dev,
122static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev) 122static int rt2800usb_init_registers(struct rt2x00_dev *rt2x00dev)
123{ 123{
124 u32 reg; 124 u32 reg;
125 int i;
126 125
127 /* 126 /*
128 * Wait until BBP and RF are ready. 127 * Wait until BBP and RF are ready.
129 */ 128 */
130 for (i = 0; i < REGISTER_BUSY_COUNT; i++) { 129 if (rt2800_wait_csr_ready(rt2x00dev))
131 rt2800_register_read(rt2x00dev, MAC_CSR0, &reg);
132 if (reg && reg != ~0)
133 break;
134 msleep(1);
135 }
136
137 if (i == REGISTER_BUSY_COUNT) {
138 ERROR(rt2x00dev, "Unstable hardware.\n");
139 return -EBUSY; 130 return -EBUSY;
140 }
141 131
142 rt2800_register_read(rt2x00dev, PBF_SYS_CTRL, &reg); 132 rt2800_register_read(rt2x00dev, PBF_SYS_CTRL, &reg);
143 rt2800_register_write(rt2x00dev, PBF_SYS_CTRL, reg & ~0x00002000); 133 rt2800_register_write(rt2x00dev, PBF_SYS_CTRL, reg & ~0x00002000);