software/drivers/sd8887/src/wlan/mlan/mlan_join.c
/**
 *  @brief Append a wapi IE
 *
 *  This function is called from the network join command prep. routine.
 *    If the IE buffer has been setup by the application, this routine appends
 *    the buffer as a wapi TLV type to the request.
 *
 *  @param priv     A pointer to mlan_private structure
 *  @param ppbuffer pointer to command buffer pointer
 *
 *  @return         bytes added to the buffer
 */
@brief Append a wapi IE
This function is called from the network join command prep. routine.
If the IE buffer has been setup by the application, this routine appends
the buffer as a wapi TLV type to the request.

@param priv     A pointer to mlan_private structure
@param ppbuffer pointer to command buffer pointer

@return         bytes added to the buffer
@brief Append a wapi IE This function is called from the network join command prep . routine . If the IE buffer has been setup by the application this routine appends the buffer as a wapi TLV type to the request . @param priv A pointer to mlan_private structure @param ppbuffer pointer to command buffer pointer @return bytes added to the buffer
static int
wlan_cmd_append_wapi_ie(mlan_private *priv, t_u8 **ppbuffer)
{
	int retlen = 0;
	MrvlIEtypesHeader_t ie_header;
	ENTER();
	if (ppbuffer == MNULL) {
		LEAVE();
		return 0;
	}
	if (*ppbuffer == MNULL) {
		LEAVE();
		return 0;
	}
	if (priv->wapi_ie_len) {
		PRINTM(MCMND, "append wapi ie %d to %p\n", priv->wapi_ie_len,
		       *ppbuffer);
		ie_header.type = wlan_cpu_to_le16(TLV_TYPE_WAPI_IE);
		ie_header.len = wlan_cpu_to_le16(priv->wapi_ie_len);
		memcpy(priv->adapter, *ppbuffer, &ie_header, sizeof(ie_header));
		*ppbuffer += sizeof(ie_header);
		retlen += sizeof(ie_header);
		memcpy(priv->adapter, *ppbuffer, priv->wapi_ie,
		       priv->wapi_ie_len);
		*ppbuffer += priv->wapi_ie_len;
		retlen += priv->wapi_ie_len;
	}
	LEAVE();
	return retlen;
}
static int wlan_cmd_append_wapi_ie ( mlan_private * priv , t_u8 * * ppbuffer ) { int retlen = 0 ; MrvlIEtypesHeader_t ie_header ; ENTER ( ) ; if ( ppbuffer == MNULL ) { LEAVE ( ) ; return 0 ; } if ( * ppbuffer == MNULL ) { LEAVE ( ) ; return 0 ; } if ( priv -> wapi_ie_len ) { PRINTM ( MCMND , " \n " , priv -> wapi_ie_len , * ppbuffer ) ; ie_header . type = wlan_cpu_to_le16 ( TLV_TYPE_WAPI_IE ) ; ie_header . len = wlan_cpu_to_le16 ( priv -> wapi_ie_len ) ; memcpy ( priv -> adapter , * ppbuffer , & ie_header , sizeof ( ie_header ) ) ; * ppbuffer += sizeof ( ie_header ) ; retlen += sizeof ( ie_header ) ; memcpy ( priv -> adapter , * ppbuffer , priv -> wapi_ie , priv -> wapi_ie_len ) ; * ppbuffer += priv -> wapi_ie_len ; retlen += priv -> wapi_ie_len ; } LEAVE ( ) ; return retlen ; }
@brief Append a wapi IE
  This function is called from the network join command prep.
@brief Append a wapi IE This function is called from the network join command prep .
/* Null Checks */ /*
	 * If there is a wapi ie buffer setup, append it to the return
	 *   parameter buffer pointer.
	 */ /* Wrap the generic IE buffer with a pass through TLV type */ /* Increment the return size and the return buffer pointer param */ /* Copy the wapi IE buffer to the output buffer, advance pointer */ /* Increment the return size and the return buffer pointer param */ /* return the length appended to the buffer */