software/drivers/sd8887/src/wlan/mlan/mlan_join.c
/**
 *  @brief This function is to find specific IE.
 *
 *  @param ie           A pointer to ie buffer
 *  @param ie_len    Length of ie buffer
 *  @param ie_type  Type of ie that wants to be found in ie buffer
 *
 *  @return     MFALSE if not found; MTURE if found
 */
@brief This function is to find specific IE.
@param ie           A pointer to ie buffer
@param ie_len    Length of ie buffer
@param ie_type  Type of ie that wants to be found in ie buffer

@return     MFALSE if not found; MTURE if found
@brief This function is to find specific IE . @param ie A pointer to ie buffer @param ie_len Length of ie buffer @param ie_type Type of ie that wants to be found in ie buffer @return MFALSE if not found ; MTURE if found
t_u8
wlan_find_ie(t_u8 *ie, t_u8 ie_len, t_u8 ie_type)
{
	IEEEtypes_Header_t *pheader = MNULL;
	t_u8 *pos = MNULL;
	t_s8 ret_len;
	t_u8 ret = MFALSE;
	ENTER();
	pos = (t_u8 *)ie;
	ret_len = ie_len;
	while (ret_len >= 2) {
		pheader = (IEEEtypes_Header_t *)pos;
		if (pheader->len + sizeof(IEEEtypes_Header_t) > ret_len) {
			PRINTM(MMSG, "invalid IE length = %d left len %d\n",
			       pheader->len, ret_len);
			break;
		}
		if (pheader->element_id == ie_type) {
			ret = MTRUE;
			break;
		}
		ret_len -= pheader->len + sizeof(IEEEtypes_Header_t);
		pos += pheader->len + sizeof(IEEEtypes_Header_t);
	}
	LEAVE();
	return ret;
}
t_u8 wlan_find_ie ( t_u8 * ie , t_u8 ie_len , t_u8 ie_type ) { IEEEtypes_Header_t * pheader = MNULL ; t_u8 * pos = MNULL ; t_s8 ret_len ; t_u8 ret = MFALSE ; ENTER ( ) ; pos = ( t_u8 * ) ie ; ret_len = ie_len ; while ( ret_len >= 2 ) { pheader = ( IEEEtypes_Header_t * ) pos ; if ( pheader -> len + sizeof ( IEEEtypes_Header_t ) > ret_len ) { PRINTM ( MMSG , " \n " , pheader -> len , ret_len ) ; break ; } if ( pheader -> element_id == ie_type ) { ret = MTRUE ; break ; } ret_len -= pheader -> len + sizeof ( IEEEtypes_Header_t ) ; pos += pheader -> len + sizeof ( IEEEtypes_Header_t ) ; } LEAVE ( ) ; return ret ; }
@brief This function is to find specific IE.
@brief This function is to find specific IE .