contrib/hostapd/hostapd/wme.c
u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid)
{
	u8 *pos = eid;
	struct wmm_parameter_element *wmm =
		(struct wmm_parameter_element *) (pos + 2);
	int e;

	if (!hapd->conf->wmm_enabled)
		return eid;
	eid[0] = WLAN_EID_VENDOR_SPECIFIC;
	wmm->oui[0] = 0x00;
	wmm->oui[1] = 0x50;
	wmm->oui[2] = 0xf2;
	wmm->oui_type = WMM_OUI_TYPE;
	wmm->oui_subtype = WMM_OUI_SUBTYPE_PARAMETER_ELEMENT;
	wmm->version = WMM_VERSION;
	wmm->qos_info = hapd->parameter_set_count & 0xf;

	/* fill in a parameter set record for each AC */
	for (e = 0; e < 4; e++) {
		struct wmm_ac_parameter *ac = &wmm->ac[e];
		struct hostapd_wmm_ac_params *acp =
			&hapd->iconf->wmm_ac_params[e];

		ac->aci_aifsn = wmm_aci_aifsn(acp->aifs,
					      acp->admission_control_mandatory,
					      e);
		ac->cw = wmm_ecw(acp->cwmin, acp->cwmax);
		ac->txop_limit = host_to_le16(acp->txop_limit);
	}

	pos = (u8 *) (wmm + 1);
	eid[1] = pos - eid - 2; /* element length */

	return pos;
}
/*
 * Add WMM Parameter Element to Beacon, Probe Response, and (Re)Association
 * Response frames.
 */
Add WMM Parameter Element to Beacon, Probe Response, and (Re)Association
Response frames.
Add WMM Parameter Element to Beacon Probe Response and ( Re ) Association Response frames .
u8 * hostapd_eid_wmm(struct hostapd_data *hapd, u8 *eid)
{
	u8 *pos = eid;
	struct wmm_parameter_element *wmm =
		(struct wmm_parameter_element *) (pos + 2);
	int e;
	if (!hapd->conf->wmm_enabled)
		return eid;
	eid[0] = WLAN_EID_VENDOR_SPECIFIC;
	wmm->oui[0] = 0x00;
	wmm->oui[1] = 0x50;
	wmm->oui[2] = 0xf2;
	wmm->oui_type = WMM_OUI_TYPE;
	wmm->oui_subtype = WMM_OUI_SUBTYPE_PARAMETER_ELEMENT;
	wmm->version = WMM_VERSION;
	wmm->qos_info = hapd->parameter_set_count & 0xf;
	for (e = 0; e < 4; e++) {
		struct wmm_ac_parameter *ac = &wmm->ac[e];
		struct hostapd_wmm_ac_params *acp =
			&hapd->iconf->wmm_ac_params[e];
		ac->aci_aifsn = wmm_aci_aifsn(acp->aifs,
					      acp->admission_control_mandatory,
					      e);
		ac->cw = wmm_ecw(acp->cwmin, acp->cwmax);
		ac->txop_limit = host_to_le16(acp->txop_limit);
	}
	pos = (u8 *) (wmm + 1);
	eid[1] = pos - eid - 2; 
	return pos;
}
u8 * hostapd_eid_wmm ( struct hostapd_data * hapd , u8 * eid ) { u8 * pos = eid ; struct wmm_parameter_element * wmm = ( struct wmm_parameter_element * ) ( pos + 2 ) ; int e ; if ( ! hapd -> conf -> wmm_enabled ) return eid ; eid [ 0 ] = WLAN_EID_VENDOR_SPECIFIC ; wmm -> oui [ 0 ] = 0x00 ; wmm -> oui [ 1 ] = 0x50 ; wmm -> oui [ 2 ] = 0xf2 ; wmm -> oui_type = WMM_OUI_TYPE ; wmm -> oui_subtype = WMM_OUI_SUBTYPE_PARAMETER_ELEMENT ; wmm -> version = WMM_VERSION ; wmm -> qos_info = hapd -> parameter_set_count & 0xf ; for ( e = 0 ; e < 4 ; e ++ ) { struct wmm_ac_parameter * ac = & wmm -> ac [ e ] ; struct hostapd_wmm_ac_params * acp = & hapd -> iconf -> wmm_ac_params [ e ] ; ac -> aci_aifsn = wmm_aci_aifsn ( acp -> aifs , acp -> admission_control_mandatory , e ) ; ac -> cw = wmm_ecw ( acp -> cwmin , acp -> cwmax ) ; ac -> txop_limit = host_to_le16 ( acp -> txop_limit ) ; } pos = ( u8 * ) ( wmm + 1 ) ; eid [ 1 ] = pos - eid - 2 ; return pos ; }
Add WMM Parameter Element to Beacon, Probe Response, and (Re)Association
 Response frames.
Add WMM Parameter Element to Beacon Probe Response and ( Re ) Association Response frames .
/* fill in a parameter set record for each AC */ /* element length */