view rvinterf/etmsync/fserr.c @ 923:10b4bed10192

gsm-fw/L1: fix for the DSP patch corruption bug The L1 code we got from the LoCosto fw contains a feature for DSP CPU load measurement. This feature is a LoCosto-ism, i.e., not applicable to earlier DBB chips (Calypso) with their respective earlier DSP ROMs. Most of the code dealing with that feature is conditionalized as #if (DSP >= 38), but one spot was missed, and the MCU code was writing into an API word dealing with this feature. In TCS211 this DSP API word happens to be used by the DSP code patch, hence that write was corrupting the patched DSP code.
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 19 Oct 2015 17:13:56 +0000
parents 244f08f58e51
children
line wrap: on
line source

/*
 * FFS error decoding
 */

#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include "etm.h"
#include "ffs.h"
#include "ffserr.h"

static struct errtab {
	int	errcode;
	char	*desc;
} errtab[] = {
	{TMFFS_ERR_NODEVICE, "EFFS_NODEVICE: flash device unknown"},
	{TMFFS_ERR_CORRUPTED, "EFFS_CORRUPTED: filesystem corrupted"},
	{TMFFS_ERR_NOPREFORMAT, "EFFS_NOPREFORMAT: ffs not preformatted"},
	{TMFFS_ERR_NOFORMAT, "EFFS_NOFORMAT: ffs not formatted"},
	{TMFFS_ERR_BADFORMAT,
		"EFFS_BADFORMAT: incompatible ffs version, reformat needed"},
	{TMFFS_ERR_MAGIC, "EFFS_MAGIC: bad magic"},
	{TMFFS_ERR_AGAIN, "EFFS_AGAIN: not ready, try again later"},
	{TMFFS_ERR_NOSYS, "EFFS_NOSYS: function not implemented"},
	{TMFFS_ERR_DRIVER, "EFFS_DRIVER: ffs device driver error"},
	{TMFFS_ERR_NOSPACE, "EFFS_NOSPACE: out of data space"},
	{TMFFS_ERR_FSFULL, "EFFS_FSFULL: file system full, no free inodes"},
	{TMFFS_ERR_BADNAME, "EFFS_BADNAME: bad filename"},
	{TMFFS_ERR_NOTFOUND, "EFFS_NOTFOUND: object not found"},
	{TMFFS_ERR_EXISTS, "EFFS_EXISTS: object exists"},
	{TMFFS_ERR_ACCESS, "EFFS_ACCESS: access permission violation"},
	{TMFFS_ERR_NAMETOOLONG, "EFFS_NAMETOOLONG"},
	{TMFFS_ERR_INVALID, "EFFS_INVALID"},
	{TMFFS_ERR_DIRNOTEMPTY, "EFFS_DIRNOTEMPTY"},
	{TMFFS_ERR_NOTADIR, "EFFS_NOTADIR"},
	{TMFFS_ERR_SPARE, "EFFS_SPARE"},
	{TMFFS_ERR_FILETOOBIG, "EFFS_FILETOOBIG"},
	{TMFFS_ERR_NOTAFILE, "EFFS_NOTAFILE"},
	{TMFFS_ERR_PATHTOODEEP, "EFFS_PATHTOODEEP"},
	{TMFFS_ERR_NUMFD, "EFFS_NUMFD: max number of open files reached"},
	{TMFFS_ERR_BADFD, "EFFS_BADFD: bad file descriptor"},
	{TMFFS_ERR_BADOP, "EFFS_BADOP: bad operation"},
	{TMFFS_ERR_LOCKED, "EFFS_LOCKED: the file is locked"},
	{TMFFS_ERR_TOOBIG, "EFFS_TOOBIG: tmffs buffer overflow"},
	{TMFFS_ERR_MEMORY, "EFFS_MEMORY: out of memory"},
	{TMFFS_ERR_MSGSEND, "EFFS_MSGSEND: message send failed"},
	{TMFFS_ERR_SIBLINGLOOP, "EFFS_SIBLINGLOOP: directory sibling loop"},
	{TMFFS_ERR_NOBLOCKS, "EFFS_NOBLOCKS: debug error?"},
	{TMFFS_ERR_DBR, "EFFS_DBR: debug error?"},
	{TMFFS_ERR_RECLAIMLOOP, "EFFS_RECLAIMLOOP: debug error?"},
	{0, 0}
};

report_ffs_err(oper, errcode)
	char *oper;
{
	struct errtab *tp;
	char *errdesc;

	for (tp = errtab; tp->errcode; tp++)
		if (tp->errcode == errcode)
			break;
	errdesc = tp->desc;
	if (!errdesc)
		errdesc = "unknown";
	printf("%s: FFS error %d (%s)\n", oper, errcode, errdesc);
}