Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src-draft/trunk]: src/sys/dev/usb Remove some unused (already disabled) #if ...
details: https://anonhg.NetBSD.org/src-all/rev/e5a120ba524b
branches: trunk
changeset: 371632:e5a120ba524b
user: Martin Husemann <martin%NetBSD.org@localhost>
date: Sun Feb 20 10:25:41 2022 +0100
description:
Remove some unused (already disabled) #if stuff.
diffstat:
sys/dev/usb/if_urtwn.c | 336 -------------------------------------------------
1 files changed, 0 insertions(+), 336 deletions(-)
diffs (truncated from 353 to 300 lines):
diff -r d249c30328dd -r e5a120ba524b sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c Wed Feb 09 19:44:29 2022 +0100
+++ b/sys/dev/usb/if_urtwn.c Sun Feb 20 10:25:41 2022 +0100
@@ -1340,10 +1340,6 @@
addr++;
}
}
-#ifdef URTWN_DEBUG
- if (urtwn_debug & DBG_REG) {
- }
-#endif
addr = 0x10;
for (i = 0; i < 6; i++)
@@ -1680,338 +1676,6 @@
ni->ni_txrate = 0;
}
-#if OLDSTUFF
-static int
-urtwn_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
-{
- struct urtwn_softc *sc = vap->iv_ic->ic_softc;
- struct urtwn_cmd_newstate cmd;
-
- DPRINTFN(DBG_FN, ("%s: %s: nstate=%s(%d), arg=%d\n",
- device_xname(sc->sc_uw.uw_dev), __func__,
- ieee80211_state_name[nstate], nstate, arg));
-
- callout_stop(&sc->sc_scan_to);
- callout_stop(&sc->sc_calib_to);
-
- /* Do it in a process context. */
- cmd.state = nstate;
- cmd.arg = arg;
- urtwn_do_async(sc, urtwn_newstate_cb, &cmd, sizeof(cmd));
- return 0;
-}
-
-static void
-urtwn_newstate_cb(struct urtwn_softc *sc, void *arg)
-{
- /* XXX VAP is wrong! */
- struct ieee80211vap *vap = TAILQ_FIRST(&(sc->sc_uw.uw_ic.ic_vaps));
- struct urtwn_cmd_newstate *cmd = arg;
- struct ieee80211com *ic = &sc->sc_uw.uw_ic;
- struct ieee80211_node *ni;
- enum ieee80211_state ostate = vap->iv_state;
- enum ieee80211_state nstate = cmd->state;
- uint32_t reg;
- uint8_t sifs_time, msr;
-
- DPRINTFN(DBG_FN|DBG_STM, ("%s: %s: %s(%d)->%s(%d)\n",
- device_xname(sc->sc_uw.uw_dev), __func__,
- ieee80211_state_name[ostate], ostate,
- ieee80211_state_name[nstate], nstate));
-
- usbwifi_lock_ic(&sc->sc_uw);
-
- callout_stop(&sc->sc_scan_to);
- callout_stop(&sc->sc_calib_to);
-
- switch (ostate) {
- case IEEE80211_S_INIT:
- break;
-
- case IEEE80211_S_SCAN:
- if (nstate != IEEE80211_S_SCAN) {
- /*
- * End of scanning
- */
- /* flush 4-AC Queue after site_survey */
- urtwn_write_1(sc, R92C_TXPAUSE, 0x0);
-
- /* Allow Rx from our BSSID only. */
- urtwn_write_4(sc, R92C_RCR,
- urtwn_read_4(sc, R92C_RCR) |
- R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN);
- }
- break;
-
- case IEEE80211_S_AUTH:
- case IEEE80211_S_ASSOC:
- break;
-
- case IEEE80211_S_RUN:
- /* Turn link LED off. */
- urtwn_set_led(sc, URTWN_LED_LINK, 0);
-
- /* Set media status to 'No Link'. */
- urtwn_set_nettype0_msr(sc, R92C_CR_NETTYPE_NOLINK);
-
- /* Stop Rx of data frames. */
- urtwn_write_2(sc, R92C_RXFLTMAP2, 0);
-
- /* Reset TSF. */
- urtwn_write_1(sc, R92C_DUAL_TSF_RST, 0x03);
-
- /* Disable TSF synchronization. */
- urtwn_write_1(sc, R92C_BCN_CTRL,
- urtwn_read_1(sc, R92C_BCN_CTRL) |
- R92C_BCN_CTRL_DIS_TSF_UDT0);
-
- /* Back to 20MHz mode */
- urtwn_set_chan(sc, ic->ic_curchan,
- IEEE80211_HTINFO_2NDCHAN_NONE);
-
- if (ic->ic_opmode == IEEE80211_M_IBSS ||
- ic->ic_opmode == IEEE80211_M_HOSTAP) {
- /* Stop BCN */
- urtwn_write_1(sc, R92C_BCN_CTRL,
- urtwn_read_1(sc, R92C_BCN_CTRL) &
- ~(R92C_BCN_CTRL_EN_BCN | R92C_BCN_CTRL_TXBCN_RPT));
- }
-
- /* Reset EDCA parameters. */
- urtwn_write_4(sc, R92C_EDCA_VO_PARAM, 0x002f3217);
- urtwn_write_4(sc, R92C_EDCA_VI_PARAM, 0x005e4317);
- urtwn_write_4(sc, R92C_EDCA_BE_PARAM, 0x00105320);
- urtwn_write_4(sc, R92C_EDCA_BK_PARAM, 0x0000a444);
-
- /* flush all cam entries */
- urtwn_cam_init(sc);
- break;
- case IEEE80211_S_CAC:
- case IEEE80211_S_CSA:
- case IEEE80211_S_SLEEP:
- printf ("URTWN UNKNOWN oSTATE: %d\n", ostate);
- /* NNN what do we do in these states? XXX */
- break;
- }
-
- switch (nstate) {
- case IEEE80211_S_INIT:
- /* Turn link LED off. */
- urtwn_set_led(sc, URTWN_LED_LINK, 0);
- break;
-
- case IEEE80211_S_SCAN:
- if (ostate != IEEE80211_S_SCAN) {
- /*
- * Begin of scanning
- */
-
- /* Set gain for scanning. */
- reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0));
- reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20);
- urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg);
-
- if (!ISSET(sc->chip, URTWN_CHIP_88E)) {
- reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1));
- reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x20);
- urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg);
- }
-
- /* Set media status to 'No Link'. */
- urtwn_set_nettype0_msr(sc, R92C_CR_NETTYPE_NOLINK);
-
- /* Allow Rx from any BSSID. */
- urtwn_write_4(sc, R92C_RCR,
- urtwn_read_4(sc, R92C_RCR) &
- ~(R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN));
-
- /* Stop Rx of data frames. */
- urtwn_write_2(sc, R92C_RXFLTMAP2, 0);
-
- /* Disable update TSF */
- urtwn_write_1(sc, R92C_BCN_CTRL,
- urtwn_read_1(sc, R92C_BCN_CTRL) |
- R92C_BCN_CTRL_DIS_TSF_UDT0);
- }
-
- /* Make link LED blink during scan. */
- urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink);
-
- /* Pause AC Tx queues. */
- urtwn_write_1(sc, R92C_TXPAUSE,
- urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f);
-
- urtwn_set_chan(sc, ic->ic_curchan,
- IEEE80211_HTINFO_2NDCHAN_NONE);
-
- /* Start periodic scan. */
- if (!sc->sc_dying)
- callout_schedule(&sc->sc_scan_to, hz / 5);
- break;
-
- case IEEE80211_S_AUTH:
- /* Set initial gain under link. */
- reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(0));
- reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32);
- urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(0), reg);
-
- if (!ISSET(sc->chip, URTWN_CHIP_88E)) {
- reg = urtwn_bb_read(sc, R92C_OFDM0_AGCCORE1(1));
- reg = RW(reg, R92C_OFDM0_AGCCORE1_GAIN, 0x32);
- urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg);
- }
-
- /* Set media status to 'No Link'. */
- urtwn_set_nettype0_msr(sc, R92C_CR_NETTYPE_NOLINK);
-
- /* Allow Rx from any BSSID. */
- urtwn_write_4(sc, R92C_RCR,
- urtwn_read_4(sc, R92C_RCR) &
- ~(R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN));
-
- urtwn_set_chan(sc, ic->ic_curchan,
- IEEE80211_HTINFO_2NDCHAN_NONE);
- break;
-
- case IEEE80211_S_ASSOC:
- break;
-
- case IEEE80211_S_RUN:
- ni = vap->iv_bss;
-
- /* XXX: Set 20MHz mode */
- urtwn_set_chan(sc, ic->ic_curchan,
- IEEE80211_HTINFO_2NDCHAN_NONE);
-
- if (ic->ic_opmode == IEEE80211_M_MONITOR) {
- /* Back to 20MHz mode */
- urtwn_set_chan(sc, ic->ic_curchan,
- IEEE80211_HTINFO_2NDCHAN_NONE);
-
- /* Set media status to 'No Link'. */
- urtwn_set_nettype0_msr(sc, R92C_CR_NETTYPE_NOLINK);
-
- /* Enable Rx of data frames. */
- urtwn_write_2(sc, R92C_RXFLTMAP2, 0xffff);
-
- /* Allow Rx from any BSSID. */
- urtwn_write_4(sc, R92C_RCR,
- urtwn_read_4(sc, R92C_RCR) &
- ~(R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN));
-
- /* Accept Rx data/control/management frames */
- urtwn_write_4(sc, R92C_RCR,
- urtwn_read_4(sc, R92C_RCR) |
- R92C_RCR_ADF | R92C_RCR_ACF | R92C_RCR_AMF);
-
- /* Turn link LED on. */
- urtwn_set_led(sc, URTWN_LED_LINK, 1);
- break;
- }
-
- /* Set media status to 'Associated'. */
- urtwn_set_nettype0_msr(sc, urtwn_get_nettype(sc));
-
- /* Set BSSID. */
- urtwn_write_4(sc, R92C_BSSID + 0, LE_READ_4(&ni->ni_bssid[0]));
- urtwn_write_4(sc, R92C_BSSID + 4, LE_READ_2(&ni->ni_bssid[4]));
-
- if (ic->ic_curmode == IEEE80211_MODE_11B) {
- urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 0);
- } else if (ic->ic_curmode == IEEE80211_MODE_11G) {
- /* 802.11b/g */
- urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 3);
- } else /* IEEE_MODE_11NG */
- urtwn_write_1(sc, R92C_INIRTS_RATE_SEL, 11);
-
- /* Enable Rx of data frames. */
- urtwn_write_2(sc, R92C_RXFLTMAP2, 0xffff);
-
- /* Set beacon interval. */
- urtwn_write_2(sc, R92C_BCN_INTERVAL, ni->ni_intval);
-
- msr = urtwn_read_1(sc, R92C_MSR);
- msr &= R92C_MSR_MASK;
- switch (ic->ic_opmode) {
- case IEEE80211_M_STA:
- /* Allow Rx from our BSSID only. */
- urtwn_write_4(sc, R92C_RCR,
- urtwn_read_4(sc, R92C_RCR) |
- R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN);
-
- /* Enable TSF synchronization. */
- urtwn_tsf_sync_enable(sc);
-
- msr |= R92C_MSR_INFRA;
- break;
- case IEEE80211_M_HOSTAP:
- urtwn_write_2(sc, R92C_BCNTCFG, 0x000f);
-
- /* Allow Rx from any BSSID. */
- urtwn_write_4(sc, R92C_RCR,
- urtwn_read_4(sc, R92C_RCR) &
- ~(R92C_RCR_CBSSID_DATA | R92C_RCR_CBSSID_BCN));
-
- /* Reset TSF timer to zero. */
- reg = urtwn_read_4(sc, R92C_TCR);
- reg &= ~0x01;
- urtwn_write_4(sc, R92C_TCR, reg);
- reg |= 0x01;
- urtwn_write_4(sc, R92C_TCR, reg);
-
- msr |= R92C_MSR_AP;
- break;
- default:
Home |
Main Index |
Thread Index |
Old Index