software/drivers/sd8887/src/wlan/mapp/mlanconfig/mlanconfig.c
/**
 *  @brief Send a DELTS command to the associated AP
 *
 *  Process a given conf file for a specific TSPEC data block.  Send the
 *    TSPEC along with any other IEs to the driver/firmware for transmission
 *    in a DELTS request to the associated AP.
 *
 *  Return the execution status of the command.  There is no response to a
 *    DELTS from the AP.
 *
 *  mlanconfig mlanX delts <filename.conf> <section# of tspec>
 *
 *  @param argc     number of arguments
 *  @param argv     A pointer to arguments array
 *
 *  @return         MLAN_STATUS_SUCCESS--success, otherwise--fail
 */
@brief Send a DELTS command to the associated AP
Process a given conf file for a specific TSPEC data block.  Send the
TSPEC along with any other IEs to the driver/firmware for transmission
in a DELTS request to the associated AP.

Return the execution status of the command.  There is no response to a
DELTS from the AP.

mlanconfig mlanX delts  

@param argc     number of arguments
@param argv     A pointer to arguments array


@brief Send a DELTS command to the associated AP Process a given conf file for a specific TSPEC data block . Send the TSPEC along with any other IEs to the driver / firmware for transmission in a DELTS request to the associated AP . Return the execution status of the command . There is no response to a DELTS from the AP . mlanconfig mlanX delts @param argc number of arguments @param argv A pointer to arguments array
static int
process_delts(int argc, char *argv[])
{
	int ioctl_val, subioctl_val;
	struct iwreq iwr;
	wlan_ioctl_wmm_delts_req_t deltsReq;
	FILE *fp = NULL;
	char filename[48];
	char config_id[20];
	memset(&deltsReq, 0x00, sizeof(deltsReq));
	memset(filename, 0x00, sizeof(filename));
	if (get_priv_ioctl("delts",
			   &ioctl_val, &subioctl_val) == MLAN_STATUS_FAILURE) {
		return -EOPNOTSUPP;
	}
	if (argc != 5) {
		fprintf(stderr, "Invalid number of parameters!\n");
		return -EINVAL;
	}
	strncpy(filename, argv[3], sizeof(filename) - 1);
	if ((fp = fopen(filename, "r")) == NULL) {
		perror("fopen");
		fprintf(stderr, "Cannot open file %s\n", argv[3]);
		return -EFAULT;
	}
	snprintf(config_id, sizeof(config_id), "tspec%d", atoi(argv[4]));
	deltsReq.ieDataLen = fparse_for_cmd_and_hex(fp,
						    deltsReq.ieData,
						    (t_u8 *)config_id);
	if (deltsReq.ieDataLen > 0) {
		printf("Found %d bytes in the %s section of conf file %s\n",
		       (int)deltsReq.ieDataLen, config_id, filename);
	} else {
		fprintf(stderr, "section %s not found in %s\n",
			config_id, filename);
		if (fp)
			fclose(fp);
		return -EFAULT;
	}
	printf("Cmd Input:\n");
	hexdump(config_id, deltsReq.ieData, deltsReq.ieDataLen, ' ');
	strncpy(iwr.ifr_name, dev_name, IFNAMSIZ - 1);
	iwr.u.data.flags = subioctl_val;
	iwr.u.data.pointer = (caddr_t) & deltsReq;
	iwr.u.data.length = (sizeof(deltsReq)
			     - sizeof(deltsReq.ieData)
			     + deltsReq.ieDataLen);
	if (ioctl(sockfd, ioctl_val, &iwr) < 0) {
		perror("mlanconfig: delts ioctl");
		if (fp)
			fclose(fp);
		return -EFAULT;
	}
	printf("Cmd Output:\n");
	printf("DELTS Command Result = %d\n", deltsReq.commandResult);
	if (fp)
		fclose(fp);
	return MLAN_STATUS_SUCCESS;
}
static int process_delts ( int argc , char * argv [ ] ) { int ioctl_val , subioctl_val ; struct iwreq iwr ; wlan_ioctl_wmm_delts_req_t deltsReq ; FILE * fp = NULL ; char filename [ 48 ] ; char config_id [ 20 ] ; memset ( & deltsReq , 0x00 , sizeof ( deltsReq ) ) ; memset ( filename , 0x00 , sizeof ( filename ) ) ; if ( get_priv_ioctl ( " " , & ioctl_val , & subioctl_val ) == MLAN_STATUS_FAILURE ) { return - EOPNOTSUPP ; } if ( argc != 5 ) { fprintf ( stderr , " \n " ) ; return - EINVAL ; } strncpy ( filename , argv [ 3 ] , sizeof ( filename ) - 1 ) ; if ( ( fp = fopen ( filename , " " ) ) == NULL ) { perror ( " " ) ; fprintf ( stderr , " \n " , argv [ 3 ] ) ; return - EFAULT ; } snprintf ( config_id , sizeof ( config_id ) , " " , atoi ( argv [ 4 ] ) ) ; deltsReq . ieDataLen = fparse_for_cmd_and_hex ( fp , deltsReq . ieData , ( t_u8 * ) config_id ) ; if ( deltsReq . ieDataLen > 0 ) { printf ( " \n " , ( int ) deltsReq . ieDataLen , config_id , filename ) ; } else { fprintf ( stderr , " \n " , config_id , filename ) ; if ( fp ) fclose ( fp ) ; return - EFAULT ; } printf ( " \n " ) ; hexdump ( config_id , deltsReq . ieData , deltsReq . ieDataLen , ' ' ) ; strncpy ( iwr . ifr_name , dev_name , IFNAMSIZ - 1 ) ; iwr . u . data . flags = subioctl_val ; iwr . u . data . pointer = ( caddr_t ) & deltsReq ; iwr . u . data . length = ( sizeof ( deltsReq ) - sizeof ( deltsReq . ieData ) + deltsReq . ieDataLen ) ; if ( ioctl ( sockfd , ioctl_val , & iwr ) < 0 ) { perror ( " " ) ; if ( fp ) fclose ( fp ) ; return - EFAULT ; } printf ( " \n " ) ; printf ( " \n " , deltsReq . commandResult ) ; if ( fp ) fclose ( fp ) ; return MLAN_STATUS_SUCCESS ; }
@brief Send a DELTS command to the associated AP
  Process a given conf file for a specific TSPEC data block.
@brief Send a DELTS command to the associated AP Process a given conf file for a specific TSPEC data block .