Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/usb/wlan/if_rum.c
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Lines | |||||
static void rum_select_antenna(struct rum_softc *); | static void rum_select_antenna(struct rum_softc *); | ||||
static void rum_enable_mrr(struct rum_softc *); | static void rum_enable_mrr(struct rum_softc *); | ||||
static void rum_set_txpreamble(struct rum_softc *); | static void rum_set_txpreamble(struct rum_softc *); | ||||
static void rum_set_basicrates(struct rum_softc *); | static void rum_set_basicrates(struct rum_softc *); | ||||
static void rum_select_band(struct rum_softc *, | static void rum_select_band(struct rum_softc *, | ||||
struct ieee80211_channel *); | struct ieee80211_channel *); | ||||
static void rum_set_chan(struct rum_softc *, | static void rum_set_chan(struct rum_softc *, | ||||
struct ieee80211_channel *); | struct ieee80211_channel *); | ||||
static void rum_set_maxretry(struct rum_softc *, | |||||
struct ieee80211vap *); | |||||
static int rum_enable_tsf_sync(struct rum_softc *); | static int rum_enable_tsf_sync(struct rum_softc *); | ||||
static void rum_enable_tsf(struct rum_softc *); | static void rum_enable_tsf(struct rum_softc *); | ||||
static void rum_abort_tsf_sync(struct rum_softc *); | static void rum_abort_tsf_sync(struct rum_softc *); | ||||
static void rum_get_tsf(struct rum_softc *, uint64_t *); | static void rum_get_tsf(struct rum_softc *, uint64_t *); | ||||
static void rum_update_slot_cb(struct rum_softc *, | static void rum_update_slot_cb(struct rum_softc *, | ||||
union sec_param *, uint8_t); | union sec_param *, uint8_t); | ||||
static void rum_update_slot(struct ieee80211com *); | static void rum_update_slot(struct ieee80211com *); | ||||
static void rum_set_bssid(struct rum_softc *, const uint8_t *); | static void rum_set_bssid(struct rum_softc *, const uint8_t *); | ||||
▲ Show 20 Lines • Show All 596 Lines • ▼ Show 20 Lines | if (ostate == IEEE80211_S_RUN) | ||||
rum_abort_tsf_sync(sc); | rum_abort_tsf_sync(sc); | ||||
break; | break; | ||||
case IEEE80211_S_RUN: | case IEEE80211_S_RUN: | ||||
ni = ieee80211_ref_node(vap->iv_bss); | ni = ieee80211_ref_node(vap->iv_bss); | ||||
if (vap->iv_opmode != IEEE80211_M_MONITOR) { | if (vap->iv_opmode != IEEE80211_M_MONITOR) { | ||||
if (ic->ic_bsschan == IEEE80211_CHAN_ANYC) { | if (ic->ic_bsschan == IEEE80211_CHAN_ANYC || | ||||
ni->ni_chan == IEEE80211_CHAN_ANYC) { | |||||
ret = EINVAL; | ret = EINVAL; | ||||
goto run_fail; | goto run_fail; | ||||
} | } | ||||
rum_update_slot_cb(sc, NULL, 0); | rum_update_slot_cb(sc, NULL, 0); | ||||
rum_enable_mrr(sc); | rum_enable_mrr(sc); | ||||
rum_set_txpreamble(sc); | rum_set_txpreamble(sc); | ||||
rum_set_basicrates(sc); | rum_set_basicrates(sc); | ||||
rum_set_maxretry(sc, vap); | |||||
IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); | IEEE80211_ADDR_COPY(sc->sc_bssid, ni->ni_bssid); | ||||
rum_set_bssid(sc, sc->sc_bssid); | rum_set_bssid(sc, sc->sc_bssid); | ||||
} | } | ||||
if (vap->iv_opmode == IEEE80211_M_HOSTAP || | if (vap->iv_opmode == IEEE80211_M_HOSTAP || | ||||
vap->iv_opmode == IEEE80211_M_IBSS) { | vap->iv_opmode == IEEE80211_M_IBSS) { | ||||
if ((ret = rum_alloc_beacon(sc, vap)) != 0) | if ((ret = rum_alloc_beacon(sc, vap)) != 0) | ||||
goto run_fail; | goto run_fail; | ||||
▲ Show 20 Lines • Show All 1,101 Lines • ▼ Show 20 Lines | rum_set_chan(struct rum_softc *sc, struct ieee80211_channel *c) | ||||
rum_bbp_write(sc, 3, bbp3); | rum_bbp_write(sc, 3, bbp3); | ||||
if (bbp94 != RT2573_BBPR94_DEFAULT) | if (bbp94 != RT2573_BBPR94_DEFAULT) | ||||
rum_bbp_write(sc, 94, bbp94); | rum_bbp_write(sc, 94, bbp94); | ||||
/* give the chip some extra time to do the switchover */ | /* give the chip some extra time to do the switchover */ | ||||
rum_pause(sc, hz / 100); | rum_pause(sc, hz / 100); | ||||
} | |||||
static void | |||||
rum_set_maxretry(struct rum_softc *sc, struct ieee80211vap *vap) | |||||
{ | |||||
const struct ieee80211_txparam *tp; | |||||
struct ieee80211_node *ni = vap->iv_bss; | |||||
struct rum_vap *rvp = RUM_VAP(vap); | |||||
tp = &vap->iv_txparms[ieee80211_chan2mode(ni->ni_chan)]; | |||||
rvp->maxretry = tp->maxretry < 0xf ? tp->maxretry : 0xf; | |||||
rum_modbits(sc, RT2573_TXRX_CSR4, RT2573_SHORT_RETRY(rvp->maxretry) | | |||||
RT2573_LONG_RETRY(rvp->maxretry), | |||||
RT2573_SHORT_RETRY_MASK | RT2573_LONG_RETRY_MASK); | |||||
} | } | ||||
/* | /* | ||||
* Enable TSF synchronization and tell h/w to start sending beacons for IBSS | * Enable TSF synchronization and tell h/w to start sending beacons for IBSS | ||||
* and HostAP operating modes. | * and HostAP operating modes. | ||||
*/ | */ | ||||
static int | static int | ||||
rum_enable_tsf_sync(struct rum_softc *sc) | rum_enable_tsf_sync(struct rum_softc *sc) | ||||
▲ Show 20 Lines • Show All 965 Lines • Show Last 20 Lines |