software/drivers/sd8887/src/wlan/mlan/mlan_wmm.c
/**
 *  @brief Call back from the command module to allow insertion of a WMM TLV
 *
 *  If the BSS we are associating to supports WMM, add the required WMM
 *    Information IE to the association request command buffer in the form
 *    of a NXP extended IEEE IE.
 *
 *  @param priv         Pointer to the mlan_private driver data struct
 *  @param ppassoc_buf  Output parameter: Pointer to the TLV output buffer,
 *                      modified on return to point after the appended WMM TLV
 *  @param pwmm_ie      Pointer to the WMM IE for the BSS we are joining
 *  @param pht_cap      Pointer to the HT IE for the BSS we are joining
 *
 *  @return Length of data appended to the association tlv buffer
 */
@brief Call back from the command module to allow insertion of a WMM TLV
If the BSS we are associating to supports WMM, add the required WMM
Information IE to the association request command buffer in the form
of a NXP extended IEEE IE.

@param priv         Pointer to the mlan_private driver data struct
@param ppassoc_buf  Output parameter: Pointer to the TLV output buffer,
modified on return to point after the appended WMM TLV
@param pwmm_ie      Pointer to the WMM IE for the BSS we are joining
@param pht_cap      Pointer to the HT IE for the BSS we are joining

@return Length of data appended to the association tlv buffer
@brief Call back from the command module to allow insertion of a WMM TLV If the BSS we are associating to supports WMM add the required WMM Information IE to the association request command buffer in the form of a NXP extended IEEE IE . @param priv Pointer to the mlan_private driver data struct @param ppassoc_buf Output parameter : Pointer to the TLV output buffer modified on return to point after the appended WMM TLV @param pwmm_ie Pointer to the WMM IE for the BSS we are joining @param pht_cap Pointer to the HT IE for the BSS we are joining @return Length of data appended to the association tlv buffer
t_u32
wlan_wmm_process_association_req(pmlan_private priv,
				 t_u8 **ppassoc_buf,
				 IEEEtypes_WmmParameter_t *pwmm_ie,
				 IEEEtypes_HTCap_t *pht_cap)
{
	MrvlIEtypes_WmmParamSet_t *pwmm_tlv;
	t_u32 ret_len = 0;
	ENTER();
	if (!ppassoc_buf) {
		LEAVE();
		return 0;
	}
	if (!(*ppassoc_buf)) {
		LEAVE();
		return 0;
	}
	if (!pwmm_ie) {
		LEAVE();
		return 0;
	}
	PRINTM(MINFO, "WMM: process assoc req: bss->wmmIe=0x%x\n",
	       pwmm_ie->vend_hdr.element_id);
	if ((priv->wmm_required
	     || (pht_cap && (pht_cap->ieee_hdr.element_id == HT_CAPABILITY)
		 && (priv->config_bands & BAND_GN
		     || priv->config_bands & BAND_AN))
	    )
	    && pwmm_ie->vend_hdr.element_id == WMM_IE) {
		pwmm_tlv = (MrvlIEtypes_WmmParamSet_t *)*ppassoc_buf;
		pwmm_tlv->header.type = (t_u16)wmm_info_ie[0];
		pwmm_tlv->header.type = wlan_cpu_to_le16(pwmm_tlv->header.type);
		pwmm_tlv->header.len = (t_u16)wmm_info_ie[1];
		memcpy(priv->adapter, pwmm_tlv->wmm_ie, &wmm_info_ie[2],
		       pwmm_tlv->header.len);
		if (pwmm_ie->qos_info.qos_uapsd)
			memcpy(priv->adapter,
			       (t_u8 *)(pwmm_tlv->wmm_ie +
					pwmm_tlv->header.len -
					sizeof(priv->wmm_qosinfo)),
			       &priv->wmm_qosinfo, sizeof(priv->wmm_qosinfo));
		ret_len = sizeof(pwmm_tlv->header) + pwmm_tlv->header.len;
		pwmm_tlv->header.len = wlan_cpu_to_le16(pwmm_tlv->header.len);
		HEXDUMP("ASSOC_CMD: WMM IE", (t_u8 *)pwmm_tlv, ret_len);
		*ppassoc_buf += ret_len;
	}
	LEAVE();
	return ret_len;
}
t_u32 wlan_wmm_process_association_req ( pmlan_private priv , t_u8 * * ppassoc_buf , IEEEtypes_WmmParameter_t * pwmm_ie , IEEEtypes_HTCap_t * pht_cap ) { MrvlIEtypes_WmmParamSet_t * pwmm_tlv ; t_u32 ret_len = 0 ; ENTER ( ) ; if ( ! ppassoc_buf ) { LEAVE ( ) ; return 0 ; } if ( ! ( * ppassoc_buf ) ) { LEAVE ( ) ; return 0 ; } if ( ! pwmm_ie ) { LEAVE ( ) ; return 0 ; } PRINTM ( MINFO , " \n " , pwmm_ie -> vend_hdr . element_id ) ; if ( ( priv -> wmm_required || ( pht_cap && ( pht_cap -> ieee_hdr . element_id == HT_CAPABILITY ) && ( priv -> config_bands & BAND_GN || priv -> config_bands & BAND_AN ) ) ) && pwmm_ie -> vend_hdr . element_id == WMM_IE ) { pwmm_tlv = ( MrvlIEtypes_WmmParamSet_t * ) * ppassoc_buf ; pwmm_tlv -> header . type = ( t_u16 ) wmm_info_ie [ 0 ] ; pwmm_tlv -> header . type = wlan_cpu_to_le16 ( pwmm_tlv -> header . type ) ; pwmm_tlv -> header . len = ( t_u16 ) wmm_info_ie [ 1 ] ; memcpy ( priv -> adapter , pwmm_tlv -> wmm_ie , & wmm_info_ie [ 2 ] , pwmm_tlv -> header . len ) ; if ( pwmm_ie -> qos_info . qos_uapsd ) memcpy ( priv -> adapter , ( t_u8 * ) ( pwmm_tlv -> wmm_ie + pwmm_tlv -> header . len - sizeof ( priv -> wmm_qosinfo ) ) , & priv -> wmm_qosinfo , sizeof ( priv -> wmm_qosinfo ) ) ; ret_len = sizeof ( pwmm_tlv -> header ) + pwmm_tlv -> header . len ; pwmm_tlv -> header . len = wlan_cpu_to_le16 ( pwmm_tlv -> header . len ) ; HEXDUMP ( " " , ( t_u8 * ) pwmm_tlv , ret_len ) ; * ppassoc_buf += ret_len ; } LEAVE ( ) ; return ret_len ; }
@brief Call back from the command module to allow insertion of a WMM TLV
  If the BSS we are associating to supports WMM, add the required WMM
    Information IE to the association request command buffer in the form
    of a NXP extended IEEE IE.
@brief Call back from the command module to allow insertion of a WMM TLV If the BSS we are associating to supports WMM add the required WMM Information IE to the association request command buffer in the form of a NXP extended IEEE IE .
/* Null checks */