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_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 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(struct rum_softc *); | static void rum_update_slot_cb(struct rum_softc *, | ||||
union sec_param *, uint8_t, uint8_t); | |||||
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 *); | ||||
static void rum_set_macaddr(struct rum_softc *, const uint8_t *); | static void rum_set_macaddr(struct rum_softc *, const uint8_t *); | ||||
static void rum_update_mcast(struct ieee80211com *); | static void rum_update_mcast(struct ieee80211com *); | ||||
static void rum_update_promisc(struct ieee80211com *); | static void rum_update_promisc(struct ieee80211com *); | ||||
static void rum_setpromisc(struct rum_softc *); | static void rum_setpromisc(struct rum_softc *); | ||||
static const char *rum_get_rf(int); | static const char *rum_get_rf(int); | ||||
static void rum_read_eeprom(struct rum_softc *); | static void rum_read_eeprom(struct rum_softc *); | ||||
static int rum_bbp_wakeup(struct rum_softc *); | static int rum_bbp_wakeup(struct rum_softc *); | ||||
▲ Show 20 Lines • Show All 292 Lines • ▼ Show 20 Lines | rum_attach(device_t self) | ||||
ic->ic_raw_xmit = rum_raw_xmit; | ic->ic_raw_xmit = rum_raw_xmit; | ||||
ic->ic_scan_start = rum_scan_start; | ic->ic_scan_start = rum_scan_start; | ||||
ic->ic_scan_end = rum_scan_end; | ic->ic_scan_end = rum_scan_end; | ||||
ic->ic_set_channel = rum_set_channel; | ic->ic_set_channel = rum_set_channel; | ||||
ic->ic_transmit = rum_transmit; | ic->ic_transmit = rum_transmit; | ||||
ic->ic_parent = rum_parent; | ic->ic_parent = rum_parent; | ||||
ic->ic_vap_create = rum_vap_create; | ic->ic_vap_create = rum_vap_create; | ||||
ic->ic_vap_delete = rum_vap_delete; | ic->ic_vap_delete = rum_vap_delete; | ||||
ic->ic_updateslot = rum_update_slot; | |||||
ic->ic_update_mcast = rum_update_mcast; | ic->ic_update_mcast = rum_update_mcast; | ||||
ieee80211_radiotap_attach(ic, | ieee80211_radiotap_attach(ic, | ||||
&sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), | &sc->sc_txtap.wt_ihdr, sizeof(sc->sc_txtap), | ||||
RT2573_TX_RADIOTAP_PRESENT, | RT2573_TX_RADIOTAP_PRESENT, | ||||
&sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap), | &sc->sc_rxtap.wr_ihdr, sizeof(sc->sc_rxtap), | ||||
RT2573_RX_RADIOTAP_PRESENT); | RT2573_RX_RADIOTAP_PRESENT); | ||||
▲ Show 20 Lines • Show All 253 Lines • ▼ Show 20 Lines | rum_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg) | ||||
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) { | ||||
ret = EINVAL; | ret = EINVAL; | ||||
goto run_fail; | goto run_fail; | ||||
} | } | ||||
rum_update_slot(sc); | rum_update_slot_cb(sc, NULL, 0, 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); | ||||
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 || | ||||
▲ Show 20 Lines • Show All 1,060 Lines • ▼ Show 20 Lines | |||||
static void | static void | ||||
rum_get_tsf(struct rum_softc *sc, uint64_t *buf) | rum_get_tsf(struct rum_softc *sc, uint64_t *buf) | ||||
{ | { | ||||
rum_read_multi(sc, RT2573_TXRX_CSR12, buf, sizeof (*buf)); | rum_read_multi(sc, RT2573_TXRX_CSR12, buf, sizeof (*buf)); | ||||
} | } | ||||
static void | static void | ||||
rum_update_slot(struct rum_softc *sc) | rum_update_slot_cb(struct rum_softc *sc, union sec_param *data, uint8_t rv_id, | ||||
uint8_t rvp_id) | |||||
{ | { | ||||
struct ieee80211com *ic = &sc->sc_ic; | struct ieee80211com *ic = &sc->sc_ic; | ||||
uint8_t slottime; | uint8_t slottime; | ||||
slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; | slottime = (ic->ic_flags & IEEE80211_F_SHSLOT) ? 9 : 20; | ||||
rum_modbits(sc, RT2573_MAC_CSR9, slottime, 0xff); | rum_modbits(sc, RT2573_MAC_CSR9, slottime, 0xff); | ||||
DPRINTF("setting slot time to %uus\n", slottime); | DPRINTF("setting slot time to %uus\n", slottime); | ||||
} | |||||
static void | |||||
rum_update_slot(struct ieee80211com *ic) | |||||
{ | |||||
rum_cmd_sleepable(ic->ic_softc, NULL, 0, 0, 0, rum_update_slot_cb); | |||||
} | } | ||||
static void | static void | ||||
rum_set_bssid(struct rum_softc *sc, const uint8_t *bssid) | rum_set_bssid(struct rum_softc *sc, const uint8_t *bssid) | ||||
{ | { | ||||
rum_write(sc, RT2573_MAC_CSR4, | rum_write(sc, RT2573_MAC_CSR4, | ||||
bssid[0] | bssid[1] << 8 | bssid[2] << 16 | bssid[3] << 24); | bssid[0] | bssid[1] << 8 | bssid[2] << 16 | bssid[3] << 24); | ||||
▲ Show 20 Lines • Show All 594 Lines • Show Last 20 Lines |