Lines Matching defs:tspec
35 static inline u8 wmm_ac_get_tsid(const struct wmm_tspec_element *tspec)
37 return (tspec->ts_info[0] >> 1) & 0x0f;
41 static u8 wmm_ac_get_direction(const struct wmm_tspec_element *tspec)
43 return (tspec->ts_info[0] >> 5) & 0x03;
47 static u8 wmm_ac_get_user_priority(const struct wmm_tspec_element *tspec)
49 return (tspec->ts_info[1] >> 3) & 0x07;
70 const struct wmm_tspec_element *tspec)
74 u16 admitted_time = le_to_host16(tspec->medium_time);
75 u8 up = wmm_ac_get_user_priority(tspec);
77 u8 dir = wmm_ac_get_direction(tspec);
78 u8 tsid = wmm_ac_get_tsid(tspec);
84 "WMM AC: tspec (ac=%d, dir=%d) already exists!",
89 /* copy tspec */
90 _tspec = os_memdup(tspec, sizeof(*_tspec));
121 struct wmm_tspec_element *tspec = wpa_s->tspecs[ac][dir];
124 if (!tspec)
127 tsid = wmm_ac_get_tsid(tspec);
131 if (wmm_ac_get_direction(tspec) != WMM_AC_DIR_DOWNLINK)
151 "tsid=%u", wmm_ac_get_tsid(&req->tspec));
166 wmm_ac_get_tsid(&addts_req->tspec),
167 wmm_ac_get_user_priority(&addts_req->tspec));
182 /* category + action code + dialog token + status + sizeof(tspec) */
183 buf = wpabuf_alloc(4 + sizeof(req->tspec));
193 wpabuf_put_data(buf, &req->tspec, sizeof(req->tspec));
209 const struct wmm_tspec_element *tspec,
215 /* category + action code + dialog token + status + sizeof(tspec) */
216 buf = wpabuf_alloc(4 + sizeof(*tspec));
222 /* category + action code + dialog token + status + sizeof(tspec) */
227 wpabuf_put_data(buf, tspec, sizeof(*tspec));
240 /* return the AC using the given TSPEC tid */
268 struct wmm_tspec_element *tspec;
276 tspec = &addts_req->tspec;
284 tspec->eid = WLAN_EID_VENDOR_SPECIFIC;
285 tspec->length = sizeof(*tspec) - 2; /* reduce eid and length */
286 tspec->oui[0] = 0x00;
287 tspec->oui[1] = 0x50;
288 tspec->oui[2] = 0xf2;
289 tspec->oui_type = WMM_OUI_TYPE;
290 tspec->oui_subtype = WMM_OUI_SUBTYPE_TSPEC_ELEMENT;
291 tspec->version = WMM_VERSION;
293 tspec->ts_info[0] = params->tsid << 1;
294 tspec->ts_info[0] |= params->direction << 5;
295 tspec->ts_info[0] |= WMM_AC_ACCESS_POLICY_EDCA << 7;
296 tspec->ts_info[1] = uapsd << 2;
297 tspec->ts_info[1] |= params->user_priority << 3;
298 tspec->ts_info[2] = 0;
300 tspec->nominal_msdu_size = host_to_le16(params->nominal_msdu_size);
302 tspec->nominal_msdu_size |=
305 tspec->mean_data_rate = host_to_le32(params->mean_data_rate);
306 tspec->minimum_phy_rate = host_to_le32(params->minimum_phy_rate);
307 tspec->surplus_bandwidth_allowance =
343 /* same tsid - this tspec will replace the current one */
551 struct wmm_tspec_element tspec;
567 tspec = *wpa_s->tspecs[ac][dir];
571 wmm_ac_send_delts(wpa_s, &tspec, wpa_s->bssid);
632 const struct wmm_tspec_element *tspec)
638 tsid = wmm_ac_get_tsid(tspec);
661 const struct wmm_tspec_element *tspec)
667 tsid = wmm_ac_get_tsid(tspec);
668 dir = wmm_ac_get_direction(tspec);
669 up = wmm_ac_get_user_priority(tspec);
682 tsid != wmm_ac_get_tsid(&req->tspec) ||
683 up != wmm_ac_get_user_priority(&req->tspec) ||
684 dir != wmm_ac_get_direction(&req->tspec)) {
716 le_to_host16(tspec->medium_time), ac, dir);
718 if (wmm_ac_add_ts(wpa_s, sa, tspec))
724 /* ask the ap to delete the tspec */
725 wmm_ac_send_delts(wpa_s, tspec, sa);
739 struct wmm_tspec_element *tspec;
791 wpa_printf(MSG_DEBUG, "WMM AC: missing or wrong length TSPEC");
795 tspec = (struct wmm_tspec_element *)(elems.wmm_tspec - 2);
804 tspec);
807 wmm_ac_handle_delts(wpa_s, sa, tspec);
871 struct wmm_tspec_element *tspec;
875 tspec = wpa_s->tspecs[ac][idx];
876 if (!tspec)
881 dir = wmm_ac_get_direction(tspec);
883 tsid = wmm_ac_get_tsid(tspec);
884 up = wmm_ac_get_user_priority(tspec);
894 le_to_host16(tspec->medium_time));