Changeset View
Changeset View
Standalone View
Standalone View
sys/net80211/ieee80211_sta.c
Show First 20 Lines • Show All 1,155 Lines • ▼ Show 20 Lines | ieee80211_parse_wmeie(uint8_t *frm, const struct ieee80211_frame *wh, | ||||
return 1; | return 1; | ||||
} | } | ||||
int | int | ||||
ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, | ieee80211_parse_wmeparams(struct ieee80211vap *vap, uint8_t *frm, | ||||
const struct ieee80211_frame *wh, uint8_t *qosinfo) | const struct ieee80211_frame *wh, uint8_t *qosinfo) | ||||
{ | { | ||||
#define MS(_v, _f) (((_v) & _f) >> _f##_S) | |||||
struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; | struct ieee80211_wme_state *wme = &vap->iv_ic->ic_wme; | ||||
u_int len = frm[1], qosinfo_count; | u_int len = frm[1], qosinfo_count; | ||||
int i; | int i; | ||||
*qosinfo = 0; | *qosinfo = 0; | ||||
if (len < sizeof(struct ieee80211_wme_param)-2) { | if (len < sizeof(struct ieee80211_wme_param)-2) { | ||||
IEEE80211_DISCARD_IE(vap, | IEEE80211_DISCARD_IE(vap, | ||||
IEEE80211_MSG_ELEMID | IEEE80211_MSG_WME, | IEEE80211_MSG_ELEMID | IEEE80211_MSG_WME, | ||||
wh, "WME", "too short, len %u", len); | wh, "WME", "too short, len %u", len); | ||||
return -1; | return -1; | ||||
} | } | ||||
*qosinfo = frm[__offsetof(struct ieee80211_wme_param, param_qosInfo)]; | *qosinfo = frm[__offsetof(struct ieee80211_wme_param, param_qosInfo)]; | ||||
qosinfo_count = *qosinfo & WME_QOSINFO_COUNT; | qosinfo_count = *qosinfo & WME_QOSINFO_COUNT; | ||||
/* XXX do proper check for wraparound */ | /* XXX do proper check for wraparound */ | ||||
if (qosinfo_count == wme->wme_wmeChanParams.cap_info) | if (qosinfo_count == wme->wme_wmeChanParams.cap_info) | ||||
return 0; | return 0; | ||||
frm += __offsetof(struct ieee80211_wme_param, params_acParams); | frm += __offsetof(struct ieee80211_wme_param, params_acParams); | ||||
for (i = 0; i < WME_NUM_AC; i++) { | for (i = 0; i < WME_NUM_AC; i++) { | ||||
struct wmeParams *wmep = | struct wmeParams *wmep = | ||||
&wme->wme_wmeChanParams.cap_wmeParams[i]; | &wme->wme_wmeChanParams.cap_wmeParams[i]; | ||||
/* NB: ACI not used */ | /* NB: ACI not used */ | ||||
wmep->wmep_acm = MS(frm[0], WME_PARAM_ACM); | wmep->wmep_acm = _IEEE80211_MASKSHIFT(frm[0], WME_PARAM_ACM); | ||||
wmep->wmep_aifsn = MS(frm[0], WME_PARAM_AIFSN); | wmep->wmep_aifsn = _IEEE80211_MASKSHIFT(frm[0], WME_PARAM_AIFSN); | ||||
wmep->wmep_logcwmin = MS(frm[1], WME_PARAM_LOGCWMIN); | wmep->wmep_logcwmin = _IEEE80211_MASKSHIFT(frm[1], WME_PARAM_LOGCWMIN); | ||||
wmep->wmep_logcwmax = MS(frm[1], WME_PARAM_LOGCWMAX); | wmep->wmep_logcwmax = _IEEE80211_MASKSHIFT(frm[1], WME_PARAM_LOGCWMAX); | ||||
wmep->wmep_txopLimit = le16dec(frm+2); | wmep->wmep_txopLimit = le16dec(frm+2); | ||||
IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, | IEEE80211_DPRINTF(vap, IEEE80211_MSG_WME, | ||||
"%s: WME: %d: acm=%d aifsn=%d logcwmin=%d logcwmax=%d txopLimit=%d\n", | "%s: WME: %d: acm=%d aifsn=%d logcwmin=%d logcwmax=%d txopLimit=%d\n", | ||||
__func__, | __func__, | ||||
i, | i, | ||||
wmep->wmep_acm, | wmep->wmep_acm, | ||||
wmep->wmep_aifsn, | wmep->wmep_aifsn, | ||||
wmep->wmep_logcwmin, | wmep->wmep_logcwmin, | ||||
wmep->wmep_logcwmax, | wmep->wmep_logcwmax, | ||||
wmep->wmep_txopLimit); | wmep->wmep_txopLimit); | ||||
frm += 4; | frm += 4; | ||||
} | } | ||||
wme->wme_wmeChanParams.cap_info = qosinfo_count; | wme->wme_wmeChanParams.cap_info = qosinfo_count; | ||||
return 1; | return 1; | ||||
#undef MS | |||||
} | } | ||||
/* | /* | ||||
* Process 11h Channel Switch Announcement (CSA) ie. If this | * Process 11h Channel Switch Announcement (CSA) ie. If this | ||||
* is the first CSA then initiate the switch. Otherwise we | * is the first CSA then initiate the switch. Otherwise we | ||||
* track state and trigger completion and/or cancel of the switch. | * track state and trigger completion and/or cancel of the switch. | ||||
* XXX should be public for IBSS use | * XXX should be public for IBSS use | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 836 Lines • Show Last 20 Lines |