software/drivers/sd8887/src/wlan/mlan/mlan_join.c
/**
 *  @brief Append a generic IE as a pass through TLV to a TLV buffer.
 *
 *  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 pass through 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 generic IE as a pass through TLV to a TLV buffer.
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 pass through 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 generic IE as a pass through TLV to a TLV buffer . 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 pass through 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_generic_ie(mlan_private *priv, t_u8 **ppbuffer)
{
	int ret_len = 0;
	MrvlIEtypesHeader_t ie_header;
	ENTER();
	if (ppbuffer == MNULL) {
		LEAVE();
		return 0;
	}
	if (*ppbuffer == MNULL) {
		LEAVE();
		return 0;
	}
	if (priv->gen_ie_buf_len) {
		PRINTM(MINFO, "append generic IE %d to %p\n",
		       priv->gen_ie_buf_len, *ppbuffer);
		ie_header.type = wlan_cpu_to_le16(TLV_TYPE_PASSTHROUGH);
		ie_header.len = wlan_cpu_to_le16(priv->gen_ie_buf_len);
		memcpy(priv->adapter, *ppbuffer, &ie_header, sizeof(ie_header));
		*ppbuffer += sizeof(ie_header);
		ret_len += sizeof(ie_header);
		memcpy(priv->adapter, *ppbuffer, priv->gen_ie_buf,
		       priv->gen_ie_buf_len);
		*ppbuffer += priv->gen_ie_buf_len;
		ret_len += priv->gen_ie_buf_len;
		priv->gen_ie_buf_len = 0;
	}
	LEAVE();
	return ret_len;
}
static int wlan_cmd_append_generic_ie ( mlan_private * priv , t_u8 * * ppbuffer ) { int ret_len = 0 ; MrvlIEtypesHeader_t ie_header ; ENTER ( ) ; if ( ppbuffer == MNULL ) { LEAVE ( ) ; return 0 ; } if ( * ppbuffer == MNULL ) { LEAVE ( ) ; return 0 ; } if ( priv -> gen_ie_buf_len ) { PRINTM ( MINFO , " \n " , priv -> gen_ie_buf_len , * ppbuffer ) ; ie_header . type = wlan_cpu_to_le16 ( TLV_TYPE_PASSTHROUGH ) ; ie_header . len = wlan_cpu_to_le16 ( priv -> gen_ie_buf_len ) ; memcpy ( priv -> adapter , * ppbuffer , & ie_header , sizeof ( ie_header ) ) ; * ppbuffer += sizeof ( ie_header ) ; ret_len += sizeof ( ie_header ) ; memcpy ( priv -> adapter , * ppbuffer , priv -> gen_ie_buf , priv -> gen_ie_buf_len ) ; * ppbuffer += priv -> gen_ie_buf_len ; ret_len += priv -> gen_ie_buf_len ; priv -> gen_ie_buf_len = 0 ; } LEAVE ( ) ; return ret_len ; }
@brief Append a generic IE as a pass through TLV to a TLV buffer.
@brief Append a generic IE as a pass through TLV to a TLV buffer .
/* Null Checks */ /*
	 * If there is a generic 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 generic IE buffer to the output buffer, advance pointer */ /* Increment the return size and the return buffer pointer param */ /* Reset the generic IE buffer */ /* return the length appended to the buffer */