Mon Jan 18 02:45:05 2016 UTC ()
Use correct register definition.


(nonaka)
diff -r1.40 -r1.41 src/sys/dev/usb/if_urtwn.c

cvs diff -r1.40 -r1.41 src/sys/dev/usb/if_urtwn.c (expand / switch to unified diff)

--- src/sys/dev/usb/if_urtwn.c 2016/01/17 22:32:09 1.40
+++ src/sys/dev/usb/if_urtwn.c 2016/01/18 02:45:05 1.41
@@ -1,39 +1,39 @@ @@ -1,39 +1,39 @@
1/* $NetBSD: if_urtwn.c,v 1.40 2016/01/17 22:32:09 christos Exp $ */ 1/* $NetBSD: if_urtwn.c,v 1.41 2016/01/18 02:45:05 nonaka Exp $ */
2/* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */ 2/* $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $ */
3 3
4/*- 4/*-
5 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> 5 * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr>
6 * Copyright (c) 2014 Kevin Lo <kevlo@FreeBSD.org> 6 * Copyright (c) 2014 Kevin Lo <kevlo@FreeBSD.org>
7 * 7 *
8 * Permission to use, copy, modify, and distribute this software for any 8 * Permission to use, copy, modify, and distribute this software for any
9 * purpose with or without fee is hereby granted, provided that the above 9 * purpose with or without fee is hereby granted, provided that the above
10 * copyright notice and this permission notice appear in all copies. 10 * copyright notice and this permission notice appear in all copies.
11 * 11 *
12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 */ 19 */
20 20
21/*- 21/*-
22 * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU. 22 * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU.
23 */ 23 */
24 24
25#include <sys/cdefs.h> 25#include <sys/cdefs.h>
26__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.40 2016/01/17 22:32:09 christos Exp $"); 26__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.41 2016/01/18 02:45:05 nonaka Exp $");
27 27
28#ifdef _KERNEL_OPT 28#ifdef _KERNEL_OPT
29#include "opt_inet.h" 29#include "opt_inet.h"
30#endif 30#endif
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/sockio.h> 33#include <sys/sockio.h>
34#include <sys/sysctl.h> 34#include <sys/sysctl.h>
35#include <sys/mbuf.h> 35#include <sys/mbuf.h>
36#include <sys/kernel.h> 36#include <sys/kernel.h>
37#include <sys/socket.h> 37#include <sys/socket.h>
38#include <sys/systm.h> 38#include <sys/systm.h>
39#include <sys/malloc.h> 39#include <sys/malloc.h>
@@ -4552,27 +4552,27 @@ urtwn_chip_stop(struct urtwn_softc *sc) @@ -4552,27 +4552,27 @@ urtwn_chip_stop(struct urtwn_softc *sc)
4552 */ 4552 */
4553 /* 1. Disable GPIO[7:0] */ 4553 /* 1. Disable GPIO[7:0] */
4554 urtwn_write_2(sc, R92C_GPIO_PIN_CTRL + 2, 0x0000); 4554 urtwn_write_2(sc, R92C_GPIO_PIN_CTRL + 2, 0x0000);
4555 4555
4556 reg = urtwn_read_4(sc, R92C_GPIO_PIN_CTRL) & ~0x0000ff00; 4556 reg = urtwn_read_4(sc, R92C_GPIO_PIN_CTRL) & ~0x0000ff00;
4557 reg |= ((reg << 8) & 0x0000ff00) | 0x00ff0000; 4557 reg |= ((reg << 8) & 0x0000ff00) | 0x00ff0000;
4558 urtwn_write_4(sc, R92C_GPIO_PIN_CTRL, reg); 4558 urtwn_write_4(sc, R92C_GPIO_PIN_CTRL, reg);
4559 4559
4560 /* Disable GPIO[10:8] */ 4560 /* Disable GPIO[10:8] */
4561 urtwn_write_1(sc, R92C_GPIO_MUXCFG + 3, 0x00); 4561 urtwn_write_1(sc, R92C_GPIO_MUXCFG + 3, 0x00);
4562 4562
4563 reg = urtwn_read_2(sc, R92C_GPIO_MUXCFG + 2) & ~0x00f0; 4563 reg = urtwn_read_2(sc, R92C_GPIO_MUXCFG + 2) & ~0x00f0;
4564 reg |= (((reg & 0x000f) << 4) | 0x0780); 4564 reg |= (((reg & 0x000f) << 4) | 0x0780);
4565 urtwn_write_2(sc, R92C_GPIO_PIN_MUXCFG + 2, reg); 4565 urtwn_write_2(sc, R92C_GPIO_MUXCFG + 2, reg);
4566 4566
4567 /* Disable LED0 & 1 */ 4567 /* Disable LED0 & 1 */
4568 urtwn_write_2(sc, R92C_LEDCFG0, 0x8080); 4568 urtwn_write_2(sc, R92C_LEDCFG0, 0x8080);
4569 4569
4570 /* 4570 /*
4571 * Reset digital sequence 4571 * Reset digital sequence
4572 */ 4572 */
4573 if (disabled) { 4573 if (disabled) {
4574 /* Disable ELDR clock */ 4574 /* Disable ELDR clock */
4575 urtwn_write_2(sc, R92C_SYS_CLKR, 0x70A3); 4575 urtwn_write_2(sc, R92C_SYS_CLKR, 0x70A3);
4576 /* Isolated ELDR to PON */ 4576 /* Isolated ELDR to PON */
4577 urtwn_write_1(sc, R92C_SYS_ISO_CTRL + 1, 0x82); 4577 urtwn_write_1(sc, R92C_SYS_ISO_CTRL + 1, 0x82);
4578 } 4578 }