Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/rtwn/if_rtwn.c
Show First 20 Lines • Show All 574 Lines • ▼ Show 20 Lines | rtwn_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ], int unit, | ||||
vap->iv_key_set = rtwn_key_set; | vap->iv_key_set = rtwn_key_set; | ||||
vap->iv_key_delete = rtwn_key_delete; | vap->iv_key_delete = rtwn_key_delete; | ||||
vap->iv_max_aid = sc->macid_limit; | vap->iv_max_aid = sc->macid_limit; | ||||
/* 802.11n parameters */ | /* 802.11n parameters */ | ||||
vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_16; | vap->iv_ampdu_density = IEEE80211_HTCAP_MPDUDENSITY_16; | ||||
vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K; | vap->iv_ampdu_rxmax = IEEE80211_HTCAP_MAXRXAMPDU_64K; | ||||
TIMEOUT_TASK_INIT(taskqueue_thread, &uvp->tx_beacon_csa, 0, | |||||
rtwn_tx_beacon_csa, vap); | |||||
if (opmode == IEEE80211_M_IBSS) { | if (opmode == IEEE80211_M_IBSS) { | ||||
uvp->recv_mgmt = vap->iv_recv_mgmt; | uvp->recv_mgmt = vap->iv_recv_mgmt; | ||||
vap->iv_recv_mgmt = rtwn_adhoc_recv_mgmt; | vap->iv_recv_mgmt = rtwn_adhoc_recv_mgmt; | ||||
TASK_INIT(&uvp->tsf_sync_adhoc_task, 0, | TASK_INIT(&uvp->tsf_sync_adhoc_task, 0, | ||||
rtwn_tsf_sync_adhoc_task, vap); | rtwn_tsf_sync_adhoc_task, vap); | ||||
callout_init(&uvp->tsf_sync_adhoc, 0); | callout_init(&uvp->tsf_sync_adhoc, 0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 471 Lines • ▼ Show 20 Lines | if (vap->iv_bss->ni_chan == IEEE80211_CHAN_ANYC && | ||||
error = uvp->newstate(vap, nstate, arg); | error = uvp->newstate(vap, nstate, arg); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
early_newstate = 1; | early_newstate = 1; | ||||
} else | } else | ||||
early_newstate = 0; | early_newstate = 0; | ||||
if (ostate == IEEE80211_S_CSA) { | |||||
taskqueue_cancel_timeout(taskqueue_thread, | |||||
&uvp->tx_beacon_csa, NULL); | |||||
/* | |||||
* In multi-vap case second counter may not be cleared | |||||
* properly. | |||||
*/ | |||||
vap->iv_csa_count = 0; | |||||
} | |||||
IEEE80211_UNLOCK(ic); | IEEE80211_UNLOCK(ic); | ||||
RTWN_LOCK(sc); | RTWN_LOCK(sc); | ||||
if (ostate == IEEE80211_S_RUN) { | |||||
if (ostate == IEEE80211_S_CSA) { | |||||
/* Unblock all queues (multi-vap case). */ | |||||
rtwn_write_1(sc, R92C_TXPAUSE, 0); | |||||
} | |||||
if ((ostate == IEEE80211_S_RUN && nstate != IEEE80211_S_CSA) || | |||||
ostate == IEEE80211_S_CSA) { | |||||
sc->vaps_running--; | sc->vaps_running--; | ||||
/* Set media status to 'No Link'. */ | /* Set media status to 'No Link'. */ | ||||
rtwn_set_mode(sc, R92C_MSR_NOLINK, uvp->id); | rtwn_set_mode(sc, R92C_MSR_NOLINK, uvp->id); | ||||
if (vap->iv_opmode == IEEE80211_M_IBSS) { | if (vap->iv_opmode == IEEE80211_M_IBSS) { | ||||
/* Stop periodical TSF synchronization. */ | /* Stop periodical TSF synchronization. */ | ||||
callout_stop(&uvp->tsf_sync_adhoc); | callout_stop(&uvp->tsf_sync_adhoc); | ||||
▲ Show 20 Lines • Show All 54 Lines • ▼ Show 20 Lines | case IEEE80211_S_RUN: | ||||
error = rtwn_run(sc, vap); | error = rtwn_run(sc, vap); | ||||
if (error != 0) { | if (error != 0) { | ||||
device_printf(sc->sc_dev, | device_printf(sc->sc_dev, | ||||
"%s: could not move to RUN state\n", __func__); | "%s: could not move to RUN state\n", __func__); | ||||
break; | break; | ||||
} | } | ||||
sc->vaps_running++; | sc->vaps_running++; | ||||
break; | |||||
case IEEE80211_S_CSA: | |||||
/* Block all Tx queues (except beacon queue). */ | |||||
rtwn_setbits_1(sc, R92C_TXPAUSE, 0, | |||||
R92C_TX_QUEUE_AC | R92C_TX_QUEUE_MGT | R92C_TX_QUEUE_HIGH); | |||||
break; | break; | ||||
default: | default: | ||||
break; | break; | ||||
} | } | ||||
RTWN_UNLOCK(sc); | RTWN_UNLOCK(sc); | ||||
IEEE80211_LOCK(ic); | IEEE80211_LOCK(ic); | ||||
if (error != 0) | if (error != 0) | ||||
▲ Show 20 Lines • Show All 844 Lines • Show Last 20 Lines |