software/drivers/sd8887/src/wlan/mapp/uaputl/uaputl.c
/**
 *  @brief Creates management frame control request and send to driver
 *
 *  @param argc     Number of arguments
 *  @param argv     Pointer to the arguments
 *  @return         UAP_SUCCESS/UAP_FAILURE
 */
@brief Creates management frame control request and send to driver
@param argc     Number of arguments
@param argv     Pointer to the arguments
@return         UAP_SUCCESS/UAP_FAILURE
@brief Creates management frame control request and send to driver @param argc Number of arguments @param argv Pointer to the arguments @return UAP_SUCCESS / UAP_FAILURE
int
apcmd_mgmt_frame_control(int argc, char *argv[])
{
	int opt;
	mgmt_frame_ctrl param;	
	struct ifreq ifr;
	t_s32 sockfd;
	while ((opt = getopt_long(argc, argv, "+", cmd_options, NULL)) != -1) {
		switch (opt) {
		default:
			print_mgmtframectrl_usage();
			return UAP_SUCCESS;
		}
	}
	argc -= optind;
	argv += optind;
	if (argc > 1) {
		printf("ERR:wrong arguments.\n");
		print_mgmtframectrl_usage();
		return UAP_FAILURE;
	}
	if ((argc) && (IS_HEX_OR_DIGIT(argv[0]) == UAP_FAILURE)) {
		printf("ERR: Invalid argument %s\n", argv[0]);
		print_mgmtframectrl_usage();
		return UAP_FAILURE;
	}
	memset(&param, 0, sizeof(mgmt_frame_ctrl));
	param.subcmd = UAP_MGMT_FRAME_CONTROL;
	if (argc) {
		param.action = ACTION_SET;
		param.mask = (t_u16)A2HEXDECIMAL(argv[0]);
	} else {
		param.action = ACTION_GET;
	}
	if ((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0) {
		printf("ERR:Cannot open socket\n");
		return UAP_FAILURE;
	}
	memset(&ifr, 0, sizeof(ifr));
	strncpy(ifr.ifr_ifrn.ifrn_name, dev_name, strlen(dev_name));
	ifr.ifr_ifru.ifru_data = (void *)&param;
	errno = 0;
	if (ioctl(sockfd, UAP_IOCTL_CMD, &ifr)) {
		perror("");
		printf("ERR:UAP_IOCTL_CMD failed\n");
		close(sockfd);
		return UAP_FAILURE;
	}
	if (!argc) {
		printf("Management Frame control mask = 0x%02x\n",
		       (int)param.mask);
	}
	close(sockfd);
	return UAP_SUCCESS;
}
int apcmd_mgmt_frame_control ( int argc , char * argv [ ] ) { int opt ; mgmt_frame_ctrl param ; struct ifreq ifr ; t_s32 sockfd ; while ( ( opt = getopt_long ( argc , argv , " " , cmd_options , NULL ) ) != -1 ) { switch ( opt ) { default : print_mgmtframectrl_usage ( ) ; return UAP_SUCCESS ; } } argc -= optind ; argv += optind ; if ( argc > 1 ) { printf ( " \n " ) ; print_mgmtframectrl_usage ( ) ; return UAP_FAILURE ; } if ( ( argc ) && ( IS_HEX_OR_DIGIT ( argv [ 0 ] ) == UAP_FAILURE ) ) { printf ( " \n " , argv [ 0 ] ) ; print_mgmtframectrl_usage ( ) ; return UAP_FAILURE ; } memset ( & param , 0 , sizeof ( mgmt_frame_ctrl ) ) ; param . subcmd = UAP_MGMT_FRAME_CONTROL ; if ( argc ) { param . action = ACTION_SET ; param . mask = ( t_u16 ) A2HEXDECIMAL ( argv [ 0 ] ) ; } else { param . action = ACTION_GET ; } if ( ( sockfd = socket ( AF_INET , SOCK_STREAM , 0 ) ) < 0 ) { printf ( " \n " ) ; return UAP_FAILURE ; } memset ( & ifr , 0 , sizeof ( ifr ) ) ; strncpy ( ifr . ifr_ifrn . ifrn_name , dev_name , strlen ( dev_name ) ) ; ifr . ifr_ifru . ifru_data = ( void * ) & param ; errno = 0 ; if ( ioctl ( sockfd , UAP_IOCTL_CMD , & ifr ) ) { perror ( " " ) ; printf ( " \n " ) ; close ( sockfd ) ; return UAP_FAILURE ; } if ( ! argc ) { printf ( " \n " , ( int ) param . mask ) ; } close ( sockfd ) ; return UAP_SUCCESS ; }
@brief Creates management frame control request and send to driver
  @param argc     Number of arguments
  @param argv     Pointer to the arguments
  @return         UAP_SUCCESS/UAP_FAILURE
@brief Creates management frame control request and send to driver @param argc Number of arguments @param argv Pointer to the arguments @return UAP_SUCCESS / UAP_FAILURE
/* Action =0, Mask =0 */ /* Check arguments */ /* Open socket */ /* Initialize the ifr structure */ /* Perform ioctl */ /* Close socket */