Lines 55-60
__FBSDID("$FreeBSD$");
Link Here
|
55 |
|
55 |
|
56 |
#include <dev/rtwn/if_rtwn_debug.h> |
56 |
#include <dev/rtwn/if_rtwn_debug.h> |
57 |
|
57 |
|
|
|
58 |
#include <dev/rtwn/usb/rtwn_usb_var.h> |
59 |
|
58 |
#include <dev/rtwn/rtl8192c/r92c.h> |
60 |
#include <dev/rtwn/rtl8192c/r92c.h> |
59 |
|
61 |
|
60 |
#include <dev/rtwn/rtl8192e/r92e.h> |
62 |
#include <dev/rtwn/rtl8192e/r92e.h> |
Lines 226-233
r92e_power_on(struct rtwn_softc *sc)
Link Here
|
226 |
if (res != 0) \ |
228 |
if (res != 0) \ |
227 |
return (EIO); \ |
229 |
return (EIO); \ |
228 |
} while(0) |
230 |
} while(0) |
|
|
231 |
struct rtwn_usb_softc *uc; |
229 |
int ntries; |
232 |
int ntries; |
230 |
|
233 |
|
|
|
234 |
if ((uc = RTWN_USB_SOFTC(sc)) != NULL) { |
235 |
RTWN_LOCK(sc); |
236 |
uc->uc_write_delay = 1; |
237 |
RTWN_UNLOCK(sc); |
238 |
} |
239 |
|
231 |
if (rtwn_read_4(sc, R92C_SYS_CFG) & R92C_SYS_CFG_TRP_BT_EN) |
240 |
if (rtwn_read_4(sc, R92C_SYS_CFG) & R92C_SYS_CFG_TRP_BT_EN) |
232 |
RTWN_CHK(rtwn_write_1(sc, R92C_LDO_SWR_CTRL, 0xc3)); |
241 |
RTWN_CHK(rtwn_write_1(sc, R92C_LDO_SWR_CTRL, 0xc3)); |
233 |
else { |
242 |
else { |
Lines 254-259
r92e_power_on(struct rtwn_softc *sc)
Link Here
|
254 |
rtwn_delay(sc, 10); |
263 |
rtwn_delay(sc, 10); |
255 |
} |
264 |
} |
256 |
if (ntries == 5000) { |
265 |
if (ntries == 5000) { |
|
|
266 |
if (uc != NULL) { |
267 |
RTWN_LOCK(sc); |
268 |
uc->uc_write_delay = 0; |
269 |
RTWN_UNLOCK(sc); |
270 |
} |
257 |
device_printf(sc->sc_dev, |
271 |
device_printf(sc->sc_dev, |
258 |
"timeout waiting for chip power up\n"); |
272 |
"timeout waiting for chip power up\n"); |
259 |
return (ETIMEDOUT); |
273 |
return (ETIMEDOUT); |
Lines 271-278
r92e_power_on(struct rtwn_softc *sc)
Link Here
|
271 |
break; |
285 |
break; |
272 |
rtwn_delay(sc, 10); |
286 |
rtwn_delay(sc, 10); |
273 |
} |
287 |
} |
274 |
if (ntries == 5000) |
288 |
if (ntries == 5000) { |
|
|
289 |
if (uc != NULL) { |
290 |
RTWN_LOCK(sc); |
291 |
uc->uc_write_delay = 0; |
292 |
RTWN_UNLOCK(sc); |
293 |
} |
275 |
return (ETIMEDOUT); |
294 |
return (ETIMEDOUT); |
|
|
295 |
} |
276 |
|
296 |
|
277 |
/* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ |
297 |
/* Enable MAC DMA/WMAC/SCHEDULE/SEC blocks. */ |
278 |
RTWN_CHK(rtwn_write_2(sc, R92C_CR, 0)); |
298 |
RTWN_CHK(rtwn_write_2(sc, R92C_CR, 0)); |
Lines 283-288
r92e_power_on(struct rtwn_softc *sc)
Link Here
|
283 |
((sc->sc_hwcrypto != RTWN_CRYPTO_SW) ? R92C_CR_ENSEC : 0) | |
303 |
((sc->sc_hwcrypto != RTWN_CRYPTO_SW) ? R92C_CR_ENSEC : 0) | |
284 |
R92C_CR_CALTMR_EN)); |
304 |
R92C_CR_CALTMR_EN)); |
285 |
|
305 |
|
|
|
306 |
if (uc != NULL) { |
307 |
RTWN_LOCK(sc); |
308 |
uc->uc_write_delay = 0; |
309 |
RTWN_UNLOCK(sc); |
310 |
} |
286 |
return (0); |
311 |
return (0); |
287 |
} |
312 |
} |
288 |
|
313 |
|