software/drivers/sd8887/src/wlan/mlan/mlan_join.c
/**
 *  @brief This function is to find FT AKM in RSN.
 *
 *  @param pmpriv       A pointer to mlan_private structure
 *
 *  @param rsn_ie       A pointer to rsn_ie
 *
 */
@brief This function is to find FT AKM in RSN.
@param pmpriv       A pointer to mlan_private structure


@brief This function is to find FT AKM in RSN . @param pmpriv A pointer to mlan_private structure
t_u8
wlan_ft_akm_is_used(mlan_private *pmpriv, t_u8 *rsn_ie)
{
	t_u8 *temp;
	t_u16 count;
	t_u16 pairwise_cipher_count = 0;
	t_u16 akm_suite_count = 0;
	t_u8 found = 0;
	t_u8 rsn_ft_1x_oui[4] = { 0x00, 0x0f, 0xac, 0x03 };
	t_u8 rsn_ft_psk_oui[4] = { 0x00, 0x0f, 0xac, 0x04 };
	t_u8 rsn_ft_sae_oui[4] = { 0x00, 0x0f, 0xac, 0x09 };
	mlan_adapter *pmadapter = pmpriv->adapter;
	ENTER();
	if (!rsn_ie)
		goto done;
	if (rsn_ie[0] != RSN_IE)
		goto done;
	count = *(t_u16 *)(rsn_ie + 2 + 2 + 4 * sizeof(t_u8));
	pairwise_cipher_count = wlan_le16_to_cpu(count);
	count = *(t_u16 *)(rsn_ie + 2 + 2 + 4 * sizeof(t_u8)
			   + sizeof(t_u16) + pairwise_cipher_count * 4);
	akm_suite_count = wlan_le16_to_cpu(count);
	temp = (t_u8 *)(rsn_ie + 2 + sizeof(t_u16) + 4 * sizeof(t_u8)
			+ sizeof(t_u16) + pairwise_cipher_count
			* 4 + sizeof(t_u16));
	while (akm_suite_count) {
		if (!memcmp
		    (pmadapter, temp, rsn_ft_1x_oui, sizeof(rsn_ft_1x_oui)) ||
		    !memcmp(pmadapter, temp, rsn_ft_psk_oui,
			    sizeof(rsn_ft_psk_oui)) ||
		    !memcmp(pmadapter, temp, rsn_ft_sae_oui,
			    sizeof(rsn_ft_sae_oui))) {
			found = 1;
			break;
		}
		temp += 4;
		akm_suite_count--;
	}
done:
	LEAVE();
	return found;
}
t_u8 wlan_ft_akm_is_used ( mlan_private * pmpriv , t_u8 * rsn_ie ) { t_u8 * temp ; t_u16 count ; t_u16 pairwise_cipher_count = 0 ; t_u16 akm_suite_count = 0 ; t_u8 found = 0 ; t_u8 rsn_ft_1x_oui [ 4 ] = { 0x00 , 0x0f , 0xac , 0x03 } ; t_u8 rsn_ft_psk_oui [ 4 ] = { 0x00 , 0x0f , 0xac , 0x04 } ; t_u8 rsn_ft_sae_oui [ 4 ] = { 0x00 , 0x0f , 0xac , 0x09 } ; mlan_adapter * pmadapter = pmpriv -> adapter ; ENTER ( ) ; if ( ! rsn_ie ) goto done ; if ( rsn_ie [ 0 ] != RSN_IE ) goto done ; count = * ( t_u16 * ) ( rsn_ie + 2 + 2 + 4 * sizeof ( t_u8 ) ) ; pairwise_cipher_count = wlan_le16_to_cpu ( count ) ; count = * ( t_u16 * ) ( rsn_ie + 2 + 2 + 4 * sizeof ( t_u8 ) + sizeof ( t_u16 ) + pairwise_cipher_count * 4 ) ; akm_suite_count = wlan_le16_to_cpu ( count ) ; temp = ( t_u8 * ) ( rsn_ie + 2 + sizeof ( t_u16 ) + 4 * sizeof ( t_u8 ) + sizeof ( t_u16 ) + pairwise_cipher_count * 4 + sizeof ( t_u16 ) ) ; while ( akm_suite_count ) { if ( ! memcmp ( pmadapter , temp , rsn_ft_1x_oui , sizeof ( rsn_ft_1x_oui ) ) || ! memcmp ( pmadapter , temp , rsn_ft_psk_oui , sizeof ( rsn_ft_psk_oui ) ) || ! memcmp ( pmadapter , temp , rsn_ft_sae_oui , sizeof ( rsn_ft_sae_oui ) ) ) { found = 1 ; break ; } temp += 4 ; akm_suite_count -- ; } done : LEAVE ( ) ; return found ; }
@brief This function is to find FT AKM in RSN.
@brief This function is to find FT AKM in RSN .
/*  2 bytes header + 2 bytes version + 4 bytes group_cipher_suite +
	 *  2 bytes pairwise_cipher_count + pairwise_cipher_count * PAIRWISE_CIPHER_SUITE_LEN (4) +
	 *  2 bytes akm_suite_count + akm_suite_count * AKM_SUITE_LEN (4)
	 */