software/drivers/sd8887/src/wlan/mapp/mlanconfig/mlanconfig.c
/**
 *  @brief Provides interface to perform read/write operations on regsiter
 *
 *  Command: mlanconfig mlanX regrdwr <type> <offset> [value]
 *
 *  @param argc     Number of arguments
 *  @param argv     Pointer to the arguments
 *
 *  @return         MLAN_STATUS_SUCCESS--success, otherwise--fail
 */
@brief Provides interface to perform read/write operations on regsiter
Command: mlanconfig mlanX regrdwr   [value]

@param argc     Number of arguments
@param argv     Pointer to the arguments


@brief Provides interface to perform read / write operations on regsiter Command : mlanconfig mlanX regrdwr [ value ] @param argc Number of arguments @param argv Pointer to the arguments
static int
process_regrdwr(int argc, char *argv[])
{
	struct iwreq iwr;
	int ioctl_val, subioctl_val;
	t_u32 type, offset, value;
	t_u8 buf[100];
	HostCmd_DS_GEN *hostcmd = (HostCmd_DS_GEN *)buf;
	int ret = MLAN_STATUS_SUCCESS;
	if ((argc < 5) || (argc > 6)) {
		printf("Parameters for regrdwr: <type> <offset> [value]\n");
		return -EINVAL;
	}
	if (get_priv_ioctl("hostcmd",
			   &ioctl_val, &subioctl_val) == MLAN_STATUS_FAILURE) {
		return -EOPNOTSUPP;
	}
	type = a2hex_or_atoi(argv[3]);
	offset = a2hex_or_atoi(argv[4]);
	if (argc > 5)
		value = a2hex_or_atoi(argv[5]);
	if ((ret = prepare_hostcmd_regrdwr(type, offset,
					   (argc > 5) ? &value : NULL, buf))) {
		return ret;
	}
	memset(&iwr, 0, sizeof(iwr));
	strncpy(iwr.ifr_name, dev_name, IFNAMSIZ - 1);
	iwr.u.data.pointer = buf;
	iwr.u.data.length = le16_to_cpu(hostcmd->size);
	iwr.u.data.flags = 0;
	if (ioctl(sockfd, ioctl_val, &iwr)) {
		fprintf(stderr,
			"mlanconfig: MLANHOSTCMD is not supported by %s\n",
			dev_name);
		return MLAN_STATUS_FAILURE;
	}
	ret = process_host_cmd_resp(buf);
	return ret;
}
static int process_regrdwr ( int argc , char * argv [ ] ) { struct iwreq iwr ; int ioctl_val , subioctl_val ; t_u32 type , offset , value ; t_u8 buf [ 100 ] ; HostCmd_DS_GEN * hostcmd = ( HostCmd_DS_GEN * ) buf ; int ret = MLAN_STATUS_SUCCESS ; if ( ( argc < 5 ) || ( argc > 6 ) ) { printf ( " \n " ) ; return - EINVAL ; } if ( get_priv_ioctl ( " " , & ioctl_val , & subioctl_val ) == MLAN_STATUS_FAILURE ) { return - EOPNOTSUPP ; } type = a2hex_or_atoi ( argv [ 3 ] ) ; offset = a2hex_or_atoi ( argv [ 4 ] ) ; if ( argc > 5 ) value = a2hex_or_atoi ( argv [ 5 ] ) ; if ( ( ret = prepare_hostcmd_regrdwr ( type , offset , ( argc > 5 ) ? & value : NULL , buf ) ) ) { return ret ; } memset ( & iwr , 0 , sizeof ( iwr ) ) ; strncpy ( iwr . ifr_name , dev_name , IFNAMSIZ - 1 ) ; iwr . u . data . pointer = buf ; iwr . u . data . length = le16_to_cpu ( hostcmd -> size ) ; iwr . u . data . flags = 0 ; if ( ioctl ( sockfd , ioctl_val , & iwr ) ) { fprintf ( stderr , " \n " , dev_name ) ; return MLAN_STATUS_FAILURE ; } ret = process_host_cmd_resp ( buf ) ; return ret ; }
@brief Provides interface to perform read/write operations on regsiter
  Command: mlanconfig mlanX regrdwr <type> <offset> [value]
@brief Provides interface to perform read / write operations on regsiter Command : mlanconfig mlanX regrdwr <type > <offset > [ value ]
/* Check arguments */