software/drivers/sd8887/src/wlan/mapp/uaputl/uaputl.c
/**
 *  @brief Check cipher is valid or not
 *
 *  @param pairwisecipher    Pairwise cipher
 *  @param groupcipher       Group cipher
 *  @return         UAP_SUCCESS or UAP_FAILURE
 */
@brief Check cipher is valid or not
@param pairwisecipher    Pairwise cipher
@param groupcipher       Group cipher
@return         UAP_SUCCESS or UAP_FAILURE
@brief Check cipher is valid or not @param pairwisecipher Pairwise cipher @param groupcipher Group cipher @return UAP_SUCCESS or UAP_FAILURE
int
is_cipher_valid(int pairwisecipher, int groupcipher)
{
	HTCap_t htcap;
	t_u16 proto = 0;
	if ((pairwisecipher == CIPHER_NONE) && (groupcipher == CIPHER_NONE))
		return UAP_SUCCESS;
	if (pairwisecipher == CIPHER_TKIP) {
		if (UAP_SUCCESS == get_sys_cfg_protocol(&proto)) {
			if (proto != PROTOCOL_WPA2_MIXED) {
				memset(&htcap, 0, sizeof(htcap));
				if (UAP_SUCCESS == get_sys_cfg_11n(&htcap)) {
					if (htcap.supported_mcs_set[0]) {
						printf("ERR: WPA/TKIP cannot be used when AP operates in 802.11n mode.\n");
						return UAP_FAILURE;
					}
				}
			}
		}
	}
	if ((pairwisecipher == CIPHER_TKIP) && (groupcipher == CIPHER_TKIP))
		return UAP_SUCCESS;
	if ((pairwisecipher == CIPHER_AES_CCMP) &&
	    (groupcipher == CIPHER_AES_CCMP))
		return UAP_SUCCESS;
	if ((pairwisecipher == CIPHER_AES_CCMP) && (groupcipher == CIPHER_TKIP))
		return UAP_SUCCESS;
	if ((pairwisecipher == CIPHER_BITMAP) && (groupcipher == CIPHER_TKIP))
		return UAP_SUCCESS;
	return UAP_FAILURE;
}
int is_cipher_valid ( int pairwisecipher , int groupcipher ) { HTCap_t htcap ; t_u16 proto = 0 ; if ( ( pairwisecipher == CIPHER_NONE ) && ( groupcipher == CIPHER_NONE ) ) return UAP_SUCCESS ; if ( pairwisecipher == CIPHER_TKIP ) { if ( UAP_SUCCESS == get_sys_cfg_protocol ( & proto ) ) { if ( proto != PROTOCOL_WPA2_MIXED ) { memset ( & htcap , 0 , sizeof ( htcap ) ) ; if ( UAP_SUCCESS == get_sys_cfg_11n ( & htcap ) ) { if ( htcap . supported_mcs_set [ 0 ] ) { printf ( " \n " ) ; return UAP_FAILURE ; } } } } } if ( ( pairwisecipher == CIPHER_TKIP ) && ( groupcipher == CIPHER_TKIP ) ) return UAP_SUCCESS ; if ( ( pairwisecipher == CIPHER_AES_CCMP ) && ( groupcipher == CIPHER_AES_CCMP ) ) return UAP_SUCCESS ; if ( ( pairwisecipher == CIPHER_AES_CCMP ) && ( groupcipher == CIPHER_TKIP ) ) return UAP_SUCCESS ; if ( ( pairwisecipher == CIPHER_BITMAP ) && ( groupcipher == CIPHER_TKIP ) ) return UAP_SUCCESS ; return UAP_FAILURE ; }
@brief Check cipher is valid or not
  @param pairwisecipher    Pairwise cipher
  @param groupcipher       Group cipher
  @return         UAP_SUCCESS or UAP_FAILURE
@brief Check cipher is valid or not @param pairwisecipher Pairwise cipher @param groupcipher Group cipher @return UAP_SUCCESS or UAP_FAILURE
/* Ok to have TKIP in mixed mode */