{
A_UINT32 TagId;
A_UINT32 TagLen;
- A_UINT8 *TagData;
+ u8 *TagData;
} tPsTagEntry, *tpPsTagEntry;
typedef struct tRamPatch
{
A_UINT16 Len;
- A_UINT8 * Data;
+ u8 *Data;
} tRamPatch, *ptRamPatch;
typedef struct ST_PS_DATA_FORMAT {
enum eType eDataType;
- A_BOOL bIsArray;
+ bool bIsArray;
}ST_PS_DATA_FORMAT;
typedef struct ST_READ_STATUS {
/* Stores the number of patch commands */
static A_UINT32 Patch_Count = 0;
static A_UINT32 Total_tag_lenght = 0;
-A_BOOL BDADDR = FALSE;
+bool BDADDR = false;
A_UINT32 StartTagId;
tPsTagEntry PsTagEntry[RAMPS_MAX_PS_TAGS_PER_FILE];
tRamPatch RamPatch[MAX_NUM_PATCH_ENTRY];
-A_STATUS AthParseFilesUnified(A_UCHAR *srcbuffer,A_UINT32 srclen, int FileFormat);
+int AthParseFilesUnified(A_UCHAR *srcbuffer,A_UINT32 srclen, int FileFormat);
char AthReadChar(A_UCHAR *buffer, A_UINT32 len,A_UINT32 *pos);
-char * AthGetLine(char * buffer, int maxlen, A_UCHAR *srcbuffer,A_UINT32 len,A_UINT32 *pos);
-static A_STATUS AthPSCreateHCICommand(A_UCHAR Opcode, A_UINT32 Param1,PSCmdPacket *PSPatchPacket,A_UINT32 *index);
+char *AthGetLine(char *buffer, int maxlen, A_UCHAR *srcbuffer,A_UINT32 len,A_UINT32 *pos);
+static int AthPSCreateHCICommand(A_UCHAR Opcode, A_UINT32 Param1,PSCmdPacket *PSPatchPacket,A_UINT32 *index);
/* Function to reads the next character from the input buffer */
char AthReadChar(A_UCHAR *buffer, A_UINT32 len,A_UINT32 *pos)
}
}
/* PS parser helper function */
-unsigned int uGetInputDataFormat(char* pCharLine, ST_PS_DATA_FORMAT *pstFormat)
+unsigned int uGetInputDataFormat(char *pCharLine, ST_PS_DATA_FORMAT *pstFormat)
{
if(pCharLine[0] != '[') {
pstFormat->eDataType = eHex;
return (0x0FFF);
}
}
-A_STATUS AthParseFilesUnified(A_UCHAR *srcbuffer,A_UINT32 srclen, int FileFormat)
+int AthParseFilesUnified(A_UCHAR *srcbuffer,A_UINT32 srclen, int FileFormat)
{
- char *Buffer;
- char *pCharLine;
- A_UINT8 TagCount;
+ char *Buffer;
+ char *pCharLine;
+ u8 TagCount;
A_UINT16 ByteCount;
- A_UINT8 ParseSection=RAM_PS_SECTION;
+ u8 ParseSection=RAM_PS_SECTION;
A_UINT32 pos;
return A_ERROR;
}
PsTagEntry[TagCount].TagLen = ByteCount;
- PsTagEntry[TagCount].TagData = (A_UINT8*)A_MALLOC(ByteCount);
+ PsTagEntry[TagCount].TagData = (u8 *)A_MALLOC(ByteCount);
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,(" TAG Length %d Tag Index %d \n",PsTagEntry[TagCount].TagLen,TagCount));
stReadStatus.uSection = 3;
stReadStatus.uLineCount = 0;
if((stPS_DataFormat.eDataType == eHex) && stPS_DataFormat.bIsArray == true) {
while(uReadCount > 0) {
PsTagEntry[TagCount].TagData[stReadStatus.uByteCount] =
- (A_UINT8)(hex_to_bin(pCharLine[stReadStatus.uCharCount]) << 4)
- | (A_UINT8)(hex_to_bin(pCharLine[stReadStatus.uCharCount + 1]));
+ (u8)(hex_to_bin(pCharLine[stReadStatus.uCharCount]) << 4)
+ | (u8)(hex_to_bin(pCharLine[stReadStatus.uCharCount + 1]));
PsTagEntry[TagCount].TagData[stReadStatus.uByteCount+1] =
- (A_UINT8)(hex_to_bin(pCharLine[stReadStatus.uCharCount + 3]) << 4)
- | (A_UINT8)(hex_to_bin(pCharLine[stReadStatus.uCharCount + 4]));
+ (u8)(hex_to_bin(pCharLine[stReadStatus.uCharCount + 3]) << 4)
+ | (u8)(hex_to_bin(pCharLine[stReadStatus.uCharCount + 4]));
stReadStatus.uCharCount += 6; // read two bytes, plus a space;
stReadStatus.uByteCount += 2;
/********************/
-A_STATUS GetNextTwoChar(A_UCHAR *srcbuffer,A_UINT32 len, A_UINT32 *pos, char * buffer)
+int GetNextTwoChar(A_UCHAR *srcbuffer,A_UINT32 len, A_UINT32 *pos, char *buffer)
{
unsigned char ch;
return A_OK;
}
-A_STATUS AthDoParsePatch(A_UCHAR *patchbuffer, A_UINT32 patchlen)
+int AthDoParsePatch(A_UCHAR *patchbuffer, A_UINT32 patchlen)
{
- char Byte[3];
- char Line[MAX_BYTE_LENGTH + 1];
+ char Byte[3];
+ char Line[MAX_BYTE_LENGTH + 1];
int ByteCount,ByteCount_Org;
int count;
int i,j,k;
return A_ERROR;
}
RamPatch[Patch_Count].Len= MAX_BYTE_LENGTH;
- RamPatch[Patch_Count].Data = (A_UINT8*)A_MALLOC(MAX_BYTE_LENGTH);
+ RamPatch[Patch_Count].Data = (u8 *)A_MALLOC(MAX_BYTE_LENGTH);
Patch_Count ++;
RamPatch[Patch_Count].Len= (ByteCount & 0xFF);
if(ByteCount != 0) {
- RamPatch[Patch_Count].Data = (A_UINT8*)A_MALLOC(ByteCount);
+ RamPatch[Patch_Count].Data = (u8 *)A_MALLOC(ByteCount);
Patch_Count ++;
}
count = 0;
/********************/
-A_STATUS AthDoParsePS(A_UCHAR *srcbuffer, A_UINT32 srclen)
+int AthDoParsePS(A_UCHAR *srcbuffer, A_UINT32 srclen)
{
- A_STATUS status;
+ int status;
int i;
- A_BOOL BDADDR_Present = A_ERROR;
+ bool BDADDR_Present = false;
Tag_Count = 0;
Total_tag_lenght = 0;
- BDADDR = FALSE;
+ BDADDR = false;
status = A_ERROR;
else{
for(i=0; i<Tag_Count; i++){
if(PsTagEntry[i].TagId == 1){
- BDADDR_Present = A_OK;
+ BDADDR_Present = true;
AR_DEBUG_PRINTF(ATH_DEBUG_ERR,("BD ADDR is present in Patch File \r\n"));
}
return status;
}
-char * AthGetLine(char * buffer, int maxlen, A_UCHAR *srcbuffer,A_UINT32 len,A_UINT32 *pos)
+char *AthGetLine(char *buffer, int maxlen, A_UCHAR *srcbuffer,A_UINT32 len,A_UINT32 *pos)
{
int count;
int AthCreateCommandList(PSCmdPacket **HciPacketList, A_UINT32 *numPackets)
{
- A_UINT8 count;
+ u8 count;
A_UINT32 NumcmdEntry = 0;
A_UINT32 Crc = 0;
////////////////////////
/////////////
-static A_STATUS AthPSCreateHCICommand(A_UCHAR Opcode, A_UINT32 Param1,PSCmdPacket *PSPatchPacket,A_UINT32 *index)
+static int AthPSCreateHCICommand(A_UCHAR Opcode, A_UINT32 Param1,PSCmdPacket *PSPatchPacket,A_UINT32 *index)
{
A_UCHAR *HCI_PS_Command;
A_UINT32 Length;
case PS_WRITE:
for(i=0;i< Param1;i++){
if(PsTagEntry[i].TagId ==1)
- BDADDR = TRUE;
+ BDADDR = true;
HCI_PS_Command = (A_UCHAR *) A_MALLOC(PsTagEntry[i].TagLen+HCI_COMMAND_HEADER);
if(HCI_PS_Command == NULL){
}
return A_OK;
}
-A_STATUS AthFreeCommandList(PSCmdPacket **HciPacketList, A_UINT32 numPackets)
+int AthFreeCommandList(PSCmdPacket **HciPacketList, A_UINT32 numPackets)
{
int i;
if(*HciPacketList == NULL) {