view rvinterf/etmsync/fdcmd.c @ 884:353daaa6014d

gsm-fw/gpf/conf/gsmcomp.c: increased max partition in the voice-only config The code we got from TCS211 had the maximum prim pool partition size set to 900 bytes in the voice-only config (no FAX_AND_DATA, no GPRS) and to 1600 bytes in every other config. As it turns out, this "minimized" config breaks when the AT command interface is used with %CPI enabled, as the responsible code in ATI does an ACI_MALLOC of 1012 bytes. TI may have considered this case to be unsupported usage (perhaps they didn't care about the combination of a voice-only PS with AT command control), but we do want this use case to work without crashing. Solution: I made the largest prim pool the same as it is with FAX_AND_DATA: 3 partitions of 1600 bytes.
author Space Falcon <falcon@ivan.Harhan.ORG>
date Sat, 27 Jun 2015 07:31:30 +0000
parents 69e8ae2b5ba2
children
line wrap: on
line source

/*
 * File descriptor debug commands
 */

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "etm.h"
#include "ffs.h"
#include "tmffs2.h"
#include "limits.h"
#include "localtypes.h"
#include "localstruct.h"
#include "cmdtab.h"
#include "exitcodes.h"

cmd_fd_open(argc, argv)
	char **argv;
{
	int rc, fd;

	rc = fd_open(argv[1], strtoul(argv[2], 0, 16), &fd);
	if (rc)
		return(rc);
	printf("%d\n", fd);
	return(0);
}

cmd_fd_read(argc, argv)
	char **argv;
{
	u_char databuf[MAX_READ_DATA];
	int rc, sz, off, l;

	rc = fd_read(strtoul(argv[1], 0, 0), databuf, strtoul(argv[2], 0, 0),
			&sz);
	if (rc)
		return(rc);
	printf("%d bytes read\n", sz);
	for (off = 0; off < sz; off += 16) {
		l = sz - off;
		if (l > 16)
			l = 16;
		hexdump_line(off, databuf + off, l);
	}
	return(0);
}

cmd_fd_close(argc, argv)
	char **argv;
{
	return fd_close(strtoul(argv[1], 0, 0));
}

struct cmdtab fd_cmds[] = {
	{"close", 1, 1, cmd_fd_close},
	{"open", 2, 2, cmd_fd_open},
	{"read", 2, 2, cmd_fd_read},
	{0, 0, 0, 0}
};

cmd_fd(argc, argv)
	char **argv;
{
	struct cmdtab *tp;
	int extargs;

	for (tp = fd_cmds; tp->cmd; tp++)
		if (!strcmp(tp->cmd, argv[1]))
			break;
	if (!tp->func) {
		fprintf(stderr, "error: no such fd command\n");
		return(ERROR_USAGE);
	}
	extargs = argc - 2;
	if (extargs > tp->maxargs) {
		fprintf(stderr, "error: too many arguments\n");
		return(ERROR_USAGE);
	}
	if (extargs < tp->minargs) {
		fprintf(stderr, "error: too few arguments\n");
		return(ERROR_USAGE);
	}
	return tp->func(argc - 1, argv + 1);
}