| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: if_urtwn.c,v 1.59.2.11 2020/04/16 17:24:49 nat Exp $ */ | | 1 | /* $NetBSD: if_urtwn.c,v 1.59.2.12 2020/04/17 13:44:37 martin 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 | * Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au> | | 7 | * Copyright (c) 2016 Nathanial Sloss <nathanialsloss@yahoo.com.au> |
8 | * | | 8 | * |
9 | * Permission to use, copy, modify, and distribute this software for any | | 9 | * Permission to use, copy, modify, and distribute this software for any |
10 | * purpose with or without fee is hereby granted, provided that the above | | 10 | * purpose with or without fee is hereby granted, provided that the above |
11 | * copyright notice and this permission notice appear in all copies. | | 11 | * copyright notice and this permission notice appear in all copies. |
12 | * | | 12 | * |
13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | | 13 | * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES |
14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | | 14 | * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF |
| @@ -32,27 +32,27 @@ | | | @@ -32,27 +32,27 @@ |
32 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | | 32 | * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR |
33 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | | 33 | * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES |
34 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | | 34 | * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN |
35 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | | 35 | * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF |
36 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | | 36 | * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. |
37 | */ | | 37 | */ |
38 | | | 38 | |
39 | /*- | | 39 | /*- |
40 | * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU | | 40 | * Driver for Realtek RTL8188CE-VAU/RTL8188CUS/RTL8188EU/RTL8188RU/RTL8192CU |
41 | * RTL8192EU. | | 41 | * RTL8192EU. |
42 | */ | | 42 | */ |
43 | | | 43 | |
44 | #include <sys/cdefs.h> | | 44 | #include <sys/cdefs.h> |
45 | __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.59.2.11 2020/04/16 17:24:49 nat Exp $"); | | 45 | __KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.59.2.12 2020/04/17 13:44:37 martin Exp $"); |
46 | | | 46 | |
47 | #ifdef _KERNEL_OPT | | 47 | #ifdef _KERNEL_OPT |
48 | #include "opt_inet.h" | | 48 | #include "opt_inet.h" |
49 | #include "opt_usb.h" | | 49 | #include "opt_usb.h" |
50 | #endif | | 50 | #endif |
51 | | | 51 | |
52 | #include <sys/param.h> | | 52 | #include <sys/param.h> |
53 | #include <sys/sockio.h> | | 53 | #include <sys/sockio.h> |
54 | #include <sys/sysctl.h> | | 54 | #include <sys/sysctl.h> |
55 | #include <sys/mbuf.h> | | 55 | #include <sys/mbuf.h> |
56 | #include <sys/kernel.h> | | 56 | #include <sys/kernel.h> |
57 | #include <sys/kmem.h> | | 57 | #include <sys/kmem.h> |
58 | #include <sys/socket.h> | | 58 | #include <sys/socket.h> |
| @@ -3442,27 +3442,29 @@ urtwn_vap_delete(struct ieee80211vap *va | | | @@ -3442,27 +3442,29 @@ urtwn_vap_delete(struct ieee80211vap *va |
3442 | static void | | 3442 | static void |
3443 | urtwn_parent(struct ieee80211com *ic) | | 3443 | urtwn_parent(struct ieee80211com *ic) |
3444 | { | | 3444 | { |
3445 | struct urtwn_softc *sc __unused = ic->ic_softc; | | 3445 | struct urtwn_softc *sc __unused = ic->ic_softc; |
3446 | | | 3446 | |
3447 | DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__)); | | 3447 | DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__)); |
3448 | | | 3448 | |
3449 | /* Not sure what to do here yet. */ | | 3449 | /* Not sure what to do here yet. */ |
3450 | } | | 3450 | } |
3451 | | | 3451 | |
3452 | static void | | 3452 | static void |
3453 | urtwn_scan_start(struct ieee80211com *ic) | | 3453 | urtwn_scan_start(struct ieee80211com *ic) |
3454 | { | | 3454 | { |
3455 | //struct urtwn_softc *sc = ic->ic_softc; | | 3455 | #ifdef URTWN_DEBUG |
| | | 3456 | struct urtwn_softc *sc = ic->ic_softc; |
| | | 3457 | #endif |
3456 | //uint32_t reg; | | 3458 | //uint32_t reg; |
3457 | //int s; | | 3459 | //int s; |
3458 | | | 3460 | |
3459 | DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__)); | | 3461 | DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__)); |
3460 | | | 3462 | |
3461 | /* | | 3463 | /* |
3462 | * Not sure what to do here yet. Try #1: do what was in the | | 3464 | * Not sure what to do here yet. Try #1: do what was in the |
3463 | * state machine. NNN | | 3465 | * state machine. NNN |
3464 | */ | | 3466 | */ |
3465 | #if NOTWITHSTATEMACHINEOVERRIDE | | 3467 | #if NOTWITHSTATEMACHINEOVERRIDE |
3466 | /* | | 3468 | /* |
3467 | * Begin of scanning | | 3469 | * Begin of scanning |
3468 | */ | | 3470 | */ |
| @@ -3505,27 +3507,29 @@ urtwn_scan_start(struct ieee80211com *ic | | | @@ -3505,27 +3507,29 @@ urtwn_scan_start(struct ieee80211com *ic |
3505 | urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); | | 3507 | urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); |
3506 | | | 3508 | |
3507 | urtwn_set_chan(sc, ic->ic_curchan, | | 3509 | urtwn_set_chan(sc, ic->ic_curchan, |
3508 | IEEE80211_HTINFO_2NDCHAN_NONE); | | 3510 | IEEE80211_HTINFO_2NDCHAN_NONE); |
3509 | | | 3511 | |
3510 | mutex_exit(&sc->sc_write_mtx); | | 3512 | mutex_exit(&sc->sc_write_mtx); |
3511 | splx(s); | | 3513 | splx(s); |
3512 | #endif | | 3514 | #endif |
3513 | } | | 3515 | } |
3514 | | | 3516 | |
3515 | static void | | 3517 | static void |
3516 | urtwn_scan_end(struct ieee80211com *ic) | | 3518 | urtwn_scan_end(struct ieee80211com *ic) |
3517 | { | | 3519 | { |
3518 | //struct urtwn_softc *sc = ic->ic_softc; | | 3520 | #ifdef URTWN_DEBUG |
| | | 3521 | struct urtwn_softc *sc = ic->ic_softc; |
| | | 3522 | #endif |
3519 | | | 3523 | |
3520 | DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__)); | | 3524 | DPRINTFN(DBG_FN, ("%s: %s\n",device_xname(sc->sc_dev), __func__)); |
3521 | | | 3525 | |
3522 | #ifdef NOTWITHSTATEMACHINEOVERRIDE | | 3526 | #ifdef NOTWITHSTATEMACHINEOVERRIDE |
3523 | /* | | 3527 | /* |
3524 | * End of scanning | | 3528 | * End of scanning |
3525 | */ | | 3529 | */ |
3526 | | | 3530 | |
3527 | mutex_enter(&sc->sc_write_mtx); | | 3531 | mutex_enter(&sc->sc_write_mtx); |
3528 | | | 3532 | |
3529 | /* flush 4-AC Queue after site_survey */ | | 3533 | /* flush 4-AC Queue after site_survey */ |
3530 | urtwn_write_1(sc, R92C_TXPAUSE, 0x0); | | 3534 | urtwn_write_1(sc, R92C_TXPAUSE, 0x0); |
3531 | | | 3535 | |