software/drivers/sd8887/src/wlan/mapp/uaputl/uaputl.c
/**
 *  @brief Creates tx_data_pause request and sends to driver
 *
 *
 *  @param argc     Number of arguments
 *  @param argv     Pointer to the arguments
 *  @return         UAP_SUCCESS/UAP_FAILURE
 */
@brief Creates tx_data_pause request and sends to driver
@param argc     Number of arguments
@param argv     Pointer to the arguments
@return         UAP_SUCCESS/UAP_FAILURE
@brief Creates tx_data_pause request and sends to driver @param argc Number of arguments @param argv Pointer to the arguments @return UAP_SUCCESS / UAP_FAILURE
int
apcmd_txdatapause(int argc, char *argv[])
{
	int opt;
	tx_data_pause_para param;
	while ((opt = getopt_long(argc, argv, "+", cmd_options, NULL)) != -1) {
		switch (opt) {
		default:
			print_txdatapause_usage();
			return UAP_SUCCESS;
		}
	}
	argc -= optind;
	argv += optind;
	memset(&param, 0, sizeof(param));
	if (argc > 2) {
		printf("ERR: Wrong number of arguments\n");
		print_txdatapause_usage();
		return UAP_FAILURE;
	}
	param.subcmd = UAP_TX_DATA_PAUSE;
	if (argc) {
		if (argc >= 1) {
			if ((IS_HEX_OR_DIGIT(argv[0]) == UAP_FAILURE) ||
			    ((atoi(argv[0]) < TX_DATA_PAUSE_DISABLE) ||
			     (atoi(argv[0]) > TX_DATA_PAUSE_ENABLE))) {
				printf("ERR: First argument can either be 0 or 1\n");
				print_txdatapause_usage();
				return UAP_FAILURE;
			}
		}
		if (argc == 1) {
			param.action = ACTION_GET;
			if (UAP_FAILURE == send_txpause_ioctl(&param)) {
				return UAP_FAILURE;
			}
		}
		param.action = ACTION_SET;
		param.txpause = (t_u16)A2HEXDECIMAL(argv[0]);
		if (argc == 2) {
			if (IS_HEX_OR_DIGIT(argv[1]) == UAP_FAILURE) {
				printf("ERR: Max buffer length must be numeric\n");
				print_txdatapause_usage();
				return UAP_FAILURE;
			}
			param.txbufcnt = (t_u16)A2HEXDECIMAL(argv[1]);
		}
	} else {
		param.action = ACTION_GET;
	}
	if (UAP_FAILURE == send_txpause_ioctl(&param))
		return UAP_FAILURE;
	if ((argc == 2) && ((t_u16)A2HEXDECIMAL(argv[1]) != param.txbufcnt)) {
		printf("Max number of TX buffer allowed for all PS client: %d\n", param.txbufcnt);
		return UAP_FAILURE;
	}
	if (!argc) {
		printf("Tx data pause: %s\n",
		       (param.txpause == 1) ? "enabled" : "disabled");
		printf("Max number of TX buffer allowed for all PS client: %d\n", param.txbufcnt);
	}
	return UAP_SUCCESS;
}
int apcmd_txdatapause ( int argc , char * argv [ ] ) { int opt ; tx_data_pause_para param ; while ( ( opt = getopt_long ( argc , argv , " " , cmd_options , NULL ) ) != -1 ) { switch ( opt ) { default : print_txdatapause_usage ( ) ; return UAP_SUCCESS ; } } argc -= optind ; argv += optind ; memset ( & param , 0 , sizeof ( param ) ) ; if ( argc > 2 ) { printf ( " \n " ) ; print_txdatapause_usage ( ) ; return UAP_FAILURE ; } param . subcmd = UAP_TX_DATA_PAUSE ; if ( argc ) { if ( argc >= 1 ) { if ( ( IS_HEX_OR_DIGIT ( argv [ 0 ] ) == UAP_FAILURE ) || ( ( atoi ( argv [ 0 ] ) < TX_DATA_PAUSE_DISABLE ) || ( atoi ( argv [ 0 ] ) > TX_DATA_PAUSE_ENABLE ) ) ) { printf ( " \n " ) ; print_txdatapause_usage ( ) ; return UAP_FAILURE ; } } if ( argc == 1 ) { param . action = ACTION_GET ; if ( UAP_FAILURE == send_txpause_ioctl ( & param ) ) { return UAP_FAILURE ; } } param . action = ACTION_SET ; param . txpause = ( t_u16 ) A2HEXDECIMAL ( argv [ 0 ] ) ; if ( argc == 2 ) { if ( IS_HEX_OR_DIGIT ( argv [ 1 ] ) == UAP_FAILURE ) { printf ( " \n " ) ; print_txdatapause_usage ( ) ; return UAP_FAILURE ; } param . txbufcnt = ( t_u16 ) A2HEXDECIMAL ( argv [ 1 ] ) ; } } else { param . action = ACTION_GET ; } if ( UAP_FAILURE == send_txpause_ioctl ( & param ) ) return UAP_FAILURE ; if ( ( argc == 2 ) && ( ( t_u16 ) A2HEXDECIMAL ( argv [ 1 ] ) != param . txbufcnt ) ) { printf ( " \n " , param . txbufcnt ) ; return UAP_FAILURE ; } if ( ! argc ) { printf ( " \n " , ( param . txpause == 1 ) ? " " : " " ) ; printf ( " \n " , param . txbufcnt ) ; } return UAP_SUCCESS ; }
@brief Creates tx_data_pause request and sends to driver
  @param argc     Number of arguments
  @param argv     Pointer to the arguments
  @return         UAP_SUCCESS/UAP_FAILURE
@brief Creates tx_data_pause request and sends to driver @param argc Number of arguments @param argv Pointer to the arguments @return UAP_SUCCESS / UAP_FAILURE
/* Check arguments */