software/drivers/sd8887/src/wlan/mapp/mlanutl/mlanroamagent.c
/**
 *  @brief          Issue setra event command
 *
 *  @param argc     number of arguments
 *  @param argv     A pointer to argument array
 *
 *  @return         MLAN_STATUS_SUCCESS--success, otherwise--fail
 */
@brief          Issue setra event command
@param argc     number of arguments
@param argv     A pointer to argument array


@brief Issue setra event command @param argc number of arguments @param argv A pointer to argument array
static int
roamSetEventBitmap(int argc, char *argv[])
{
	int i, enableFlag, found = 0;
	t_u8 value;
	if (argc > 4 || argc < 2) {
		printf("Invalid Usage \n");
		return MLAN_STATUS_FAILURE;
	}
	if (strncmp(argv[0], "enable", strlen("enable")) == 0) {
		enableFlag = 3;
		value = HOST_EVENT_NBOR_DISABLE & HOST_EVENT_ROAM_DISABLE
			& HOST_EVENT_STATE_DISABLE;
	} else if (strncmp(argv[0], "disable", strlen("disable")) == 0) {
		enableFlag = 2;
		value = HOST_EVENT_NBOR_ENABLE | HOST_EVENT_ROAM_ENABLE
			| HOST_EVENT_STATE_ENABLE;
	} else {
		printf("Invalid parameter %s \n", argv[0]);
		return MLAN_STATUS_FAILURE;
	}
	for (i = 1; i < argc; i++) {
		found = 0;
		if (strncmp(argv[i], "neighbor", strlen("neighbor")) == 0) {
			found = 1;
			if (enableFlag == 3) {
				value |= HOST_EVENT_NBOR_ENABLE;
			} else {
				value &= HOST_EVENT_NBOR_DISABLE;
			}
		}
		if (strncmp(argv[i], "roam", strlen("roam")) == 0) {
			found = 1;
			if (enableFlag == 3) {
				value |= HOST_EVENT_ROAM_ENABLE;
			} else {
				value &= HOST_EVENT_ROAM_DISABLE;
			}
		}
		if (strncmp(argv[i], "state", strlen("state")) == 0) {
			found = 1;
			if (enableFlag == 3) {
				value |= HOST_EVENT_STATE_ENABLE;
			} else {
				value &= HOST_EVENT_STATE_DISABLE;
			}
		}
		if (found == 0) {
			printf("Invalid parameter %s \n", argv[i]);
			return MLAN_STATUS_FAILURE;
		}
	}
	return roamSetControl(argc, argv, enableFlag, value);
}
static int roamSetEventBitmap ( int argc , char * argv [ ] ) { int i , enableFlag , found = 0 ; t_u8 value ; if ( argc > 4 || argc < 2 ) { printf ( " \n " ) ; return MLAN_STATUS_FAILURE ; } if ( strncmp ( argv [ 0 ] , " " , strlen ( " " ) ) == 0 ) { enableFlag = 3 ; value = HOST_EVENT_NBOR_DISABLE & HOST_EVENT_ROAM_DISABLE & HOST_EVENT_STATE_DISABLE ; } else if ( strncmp ( argv [ 0 ] , " " , strlen ( " " ) ) == 0 ) { enableFlag = 2 ; value = HOST_EVENT_NBOR_ENABLE | HOST_EVENT_ROAM_ENABLE | HOST_EVENT_STATE_ENABLE ; } else { printf ( " \n " , argv [ 0 ] ) ; return MLAN_STATUS_FAILURE ; } for ( i = 1 ; i < argc ; i ++ ) { found = 0 ; if ( strncmp ( argv [ i ] , " " , strlen ( " " ) ) == 0 ) { found = 1 ; if ( enableFlag == 3 ) { value |= HOST_EVENT_NBOR_ENABLE ; } else { value &= HOST_EVENT_NBOR_DISABLE ; } } if ( strncmp ( argv [ i ] , " " , strlen ( " " ) ) == 0 ) { found = 1 ; if ( enableFlag == 3 ) { value |= HOST_EVENT_ROAM_ENABLE ; } else { value &= HOST_EVENT_ROAM_DISABLE ; } } if ( strncmp ( argv [ i ] , " " , strlen ( " " ) ) == 0 ) { found = 1 ; if ( enableFlag == 3 ) { value |= HOST_EVENT_STATE_ENABLE ; } else { value &= HOST_EVENT_STATE_DISABLE ; } } if ( found == 0 ) { printf ( " \n " , argv [ i ] ) ; return MLAN_STATUS_FAILURE ; } } return roamSetControl ( argc , argv , enableFlag , value ) ; }
@brief          Issue setra event command
  @param argc     number of arguments
  @param argv     A pointer to argument array
@brief Issue setra event command @param argc number of arguments @param argv A pointer to argument array