Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/usb/wlan/if_rsu.c
Show First 20 Lines • Show All 1,505 Lines • ▼ Show 20 Lines | case IEEE80211_S_AUTH: | ||||
break; | break; | ||||
case IEEE80211_S_RUN: | case IEEE80211_S_RUN: | ||||
/* Flush all AC queues. */ | /* Flush all AC queues. */ | ||||
rsu_write_1(sc, R92S_TXPAUSE, 0); | rsu_write_1(sc, R92S_TXPAUSE, 0); | ||||
ni = ieee80211_ref_node(vap->iv_bss); | ni = ieee80211_ref_node(vap->iv_bss); | ||||
rs = &ni->ni_rates; | rs = &ni->ni_rates; | ||||
/* Indicate highest supported rate. */ | /* Indicate highest supported rate. */ | ||||
ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1]; | ni->ni_txrate = rs->rates[rs->rs_nrates - 1].rs_index; | ||||
(void) rsu_set_fw_power_state(sc, RSU_PWR_SLEEP); | (void) rsu_set_fw_power_state(sc, RSU_PWR_SLEEP); | ||||
ieee80211_free_node(ni); | ieee80211_free_node(ni); | ||||
startcal = 1; | startcal = 1; | ||||
break; | break; | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
if (startcal != 0) { | if (startcal != 0) { | ||||
▲ Show 20 Lines • Show All 398 Lines • ▼ Show 20 Lines | #ifdef USB_DEBUG | ||||
} | } | ||||
#endif | #endif | ||||
return (rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, &cmd, sizeof(cmd))); | return (rsu_fw_cmd(sc, R92S_CMD_SITE_SURVEY, &cmd, sizeof(cmd))); | ||||
} | } | ||||
static int | static int | ||||
rsu_join_bss(struct rsu_softc *sc, struct ieee80211_node *ni) | rsu_join_bss(struct rsu_softc *sc, struct ieee80211_node *ni) | ||||
{ | { | ||||
const struct ieee80211_rate_t *rate; | |||||
const struct ieee80211_rateset *rs; | |||||
struct ieee80211com *ic = &sc->sc_ic; | struct ieee80211com *ic = &sc->sc_ic; | ||||
struct ieee80211vap *vap = ni->ni_vap; | struct ieee80211vap *vap = ni->ni_vap; | ||||
struct ndis_wlan_bssid_ex *bss; | struct ndis_wlan_bssid_ex *bss; | ||||
struct ndis_802_11_fixed_ies *fixed; | struct ndis_802_11_fixed_ies *fixed; | ||||
struct r92s_fw_cmd_auth auth; | struct r92s_fw_cmd_auth auth; | ||||
uint8_t buf[sizeof(*bss) + 128] __aligned(4); | uint8_t buf[sizeof(*bss) + 128] __aligned(4); | ||||
uint8_t *frm; | uint8_t *frm; | ||||
uint8_t opmode; | uint8_t opmode; | ||||
int error; | int i, error; | ||||
RSU_ASSERT_LOCKED(sc); | RSU_ASSERT_LOCKED(sc); | ||||
/* Let the FW decide the opmode based on the capinfo field. */ | /* Let the FW decide the opmode based on the capinfo field. */ | ||||
opmode = NDIS802_11AUTOUNKNOWN; | opmode = NDIS802_11AUTOUNKNOWN; | ||||
RSU_DPRINTF(sc, RSU_DEBUG_RESET, | RSU_DPRINTF(sc, RSU_DEBUG_RESET, | ||||
"%s: setting operating mode to %d\n", | "%s: setting operating mode to %d\n", | ||||
__func__, opmode); | __func__, opmode); | ||||
Show All 26 Lines | if (ic->ic_curmode == IEEE80211_MODE_11B) | ||||
bss->networktype = htole32(NDIS802_11DS); | bss->networktype = htole32(NDIS802_11DS); | ||||
else | else | ||||
bss->networktype = htole32(NDIS802_11OFDM24); | bss->networktype = htole32(NDIS802_11OFDM24); | ||||
bss->config.len = htole32(sizeof(bss->config)); | bss->config.len = htole32(sizeof(bss->config)); | ||||
bss->config.bintval = htole32(ni->ni_intval); | bss->config.bintval = htole32(ni->ni_intval); | ||||
bss->config.dsconfig = htole32(ieee80211_chan2ieee(ic, ni->ni_chan)); | bss->config.dsconfig = htole32(ieee80211_chan2ieee(ic, ni->ni_chan)); | ||||
bss->inframode = htole32(NDIS802_11INFRASTRUCTURE); | bss->inframode = htole32(NDIS802_11INFRASTRUCTURE); | ||||
/* XXX verify how this is supposed to look! */ | /* XXX verify how this is supposed to look! */ | ||||
memcpy(bss->supprates, ni->ni_rates.rs_rates, | rs = &ni->ni_rates; | ||||
ni->ni_rates.rs_nrates); | for (i = 0; i < rs->rs_nrates; i++) { | ||||
rate = ieee80211_get_rate(rs->rates[i].rs_index); | |||||
bss->supprates[i] = rate->value; | |||||
} | |||||
/* Write the fixed fields of the beacon frame. */ | /* Write the fixed fields of the beacon frame. */ | ||||
fixed = (struct ndis_802_11_fixed_ies *)&bss[1]; | fixed = (struct ndis_802_11_fixed_ies *)&bss[1]; | ||||
memcpy(&fixed->tstamp, ni->ni_tstamp.data, 8); | memcpy(&fixed->tstamp, ni->ni_tstamp.data, 8); | ||||
fixed->bintval = htole16(ni->ni_intval); | fixed->bintval = htole16(ni->ni_intval); | ||||
fixed->capabilities = htole16(ni->ni_capinfo); | fixed->capabilities = htole16(ni->ni_capinfo); | ||||
/* Write IEs to be included in the association request. */ | /* Write IEs to be included in the association request. */ | ||||
frm = (uint8_t *)&fixed[1]; | frm = (uint8_t *)&fixed[1]; | ||||
frm = ieee80211_add_rsn(frm, vap); | frm = ieee80211_add_rsn(frm, vap); | ||||
▲ Show 20 Lines • Show All 1,753 Lines • Show Last 20 Lines |