diff options
author | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-06-19 14:34:05 +0000 |
---|---|---|
committer | markster <markster@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-06-19 14:34:05 +0000 |
commit | 6446efb93dc10bb2d42fd664480fc1c8b8b0e456 (patch) | |
tree | 422ddc80377b61d6b7e3107c376d5d7e82b3de01 /include/octrpc | |
parent | 790db3fbe391a9147a1de81e9877c8a8640bd4f6 (diff) |
Merge the giant mess that is the Octasic API
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1117 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'include/octrpc')
-rw-r--r-- | include/octrpc/oct6100_rpc_protocol.h | 344 | ||||
-rw-r--r-- | include/octrpc/rpc_protocol.h | 107 |
2 files changed, 451 insertions, 0 deletions
diff --git a/include/octrpc/oct6100_rpc_protocol.h b/include/octrpc/oct6100_rpc_protocol.h new file mode 100644 index 0000000..a017a34 --- /dev/null +++ b/include/octrpc/oct6100_rpc_protocol.h @@ -0,0 +1,344 @@ +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +File: oct6100_rpc_protocol.h + +Copyright (c) 2002 Octasic Inc. All rights reserved. + +Description: + +This section defines the intent of the file. + +This source code is Octasic Confidential. Use of and access to this code +is covered by the Octasic Device Enabling Software License Agreement. +Acknowledgement of the Octasic Device Enabling Software License was +required for access to this code. A copy was also provided with the release. + + +$Octasic_Release: OCT610xAPI-01.00-PR37 $ + +$Octasic_Revision: 4 $ + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ + +#ifndef __OCT6100_RPC_PROTOCOL_H__ +#define __OCT6100_RPC_PROTOCOL_H__ + +/***************************** INCLUDE FILES *******************************/ + + +/***************************** DEFINES *************************************/ +#define cOCTRPC_INTERFACE_VERSION 0x00010002 + +/* Octasic commands */ +#define cOCT6100_RPC_CHIP_LIST 0xFF000000 +#define cOCT6100_RPC_CHIP_CHOICE 0xFF000001 +#define cOCT6100_RPC_ENV_DISCONNECT 0xFF000002 + +/* Commands */ +/* Read commands */ +#define cOCT6100_RPC_READ_WORD 0x00000000 +#define cOCT6100_RPC_READ_BURST 0x00000001 +#define cOCT6100_RPC_READ_DEBUG 0x00000002 +#define cOCT6100_RPC_READ_ARRAY 0x00000003 +#define cOCT6100_RPC_API_DISCONNECT 0x00000004 + +/* Write commands */ +#define cOCT6100_RPC_WRITE_WORD 0x00000010 +#define cOCT6100_RPC_WRITE_BURST 0x00000011 +#define cOCT6100_RPC_WRITE_SMEAR 0x00000012 +#define cOCT6100_RPC_WRITE_INC 0x00000013 + +/* Debug commands.*/ +#define cOCT6100_RPC_SET_HOT_CHANNEL 0x00000014 +#define cOCT6100_RPC_GET_DEBUG_CHAN_INDEX 0x00000015 + +#define cOCTRPC_UNKNOWN_COMMAND_NUM 0xFFFFFFFF + +/* Errors */ +#define cOCT6100_RPCERR_OK 0x00000000 +#define cOCT6100_RPCERR_INVALID_COMMAND_NUMBER 0x00000001 +#define cOCT6100_RPCERR_INVALID_COMMAND_PAYLOAD 0x00000002 +#define cOCT6100_RPCERR_INVALID_COMMAND_LENGTH 0x00000003 + +/***************************** TYPES ***************************************/ + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_READ_WORD + +Description: Command structure for the read of one word. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulAddress Address at which to read. +OUT ulReadData The word read, returned. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_READ_WORD_ +{ + UINT32 IN ulAddress; + UINT32 OUT ulReadData; + +} tOCT6100_RPC_READ_WORD, *tPOCT6100_RPC_READ_WORD; + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_READ_BURST + +Description: Command structure for a read burst. The burst starts at the + given address and reads the specified number of consecutive + words. + + Whereas every command structure uses a complete dword for every + member, irrespective of the size of data unit needed, this + structure does not do so for the read data. To save bandwidth + the read data words are returned two per dword. + +Example packet: 31 16 15 0 + ------------------------------------------- + | ulAddress = 0x100 | + ------------------------------------------- + | ulBurstLength = 0x3 | + ------------------------------------------- + aulReadData -> | D0 | D1 | + ------------------------------------------- + | D2 | xx | + ------------------------------------------- + + Dy is the read data at ulAddress + 2 * y. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulAddress Address at which to read. +IN ulBurstLength The number of consecutive words to be read. +OUT aulReadData The read data returned. The dwords of the structure + starting at this address are arranged as indicated in + the example packet above. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_READ_BURST_ +{ + UINT32 IN ulAddress; + UINT32 IN ulBurstLength; + UINT32 OUT aulReadData[ 1 ]; + +} tOCT6100_RPC_READ_BURST, *tPOCT6100_RPC_READ_BURST; + + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_READ_ARRAY + +Description: Command structure for a variable number of reads. The reads do + not have to be at contiguous addresses. + + Whereas every command structure uses a complete dword for every + member, irrespective of the size of data unit needed, this + structure does not do so for the read data. To save bandwidth + the read data words are returned two per dword, and the + parity bits are returned 16 per dword (two parity bits per read + access). + +Example packet: 31 16 15 0 + ------------------------------------------- + | ulArrayLength = 0x3 | + ------------------------------------------- + aulArrayData ->| A0 | + ------------------------------------------- + | A1 | + ------------------------------------------- + | A2 | + ------------------------------------------- + | D0 | D1 | + ------------------------------------------- + | D2 | xx | + ------------------------------------------- + + Ay is the address for access y. + Dy is the read data at Ay. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulArrayLength Number of reads to do. +IN OUT aulArrayData The addresses at which to read (IN) and the read data + returned (OUT). The dwords of the command structure + starting at this address are arranged as indicated in + the example packet above. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_READ_ARRAY +{ + UINT32 IN ulArrayLength; + UINT32 IN OUT aulArrayData[ 1 ]; + +} tOCT6100_RPC_READ_ARRAY, *tPOCT6100_RPC_READ_ARRAY; + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_WRITE_WORD + +Description: Command structure for the write of one word. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulAddress Address at which to write. +IN ulWriteData The word to write. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_WRITE_WORD_ +{ + UINT32 IN ulAddress; + UINT32 IN ulParity; + UINT32 IN ulWriteData; + +} tOCT6100_RPC_WRITE_WORD, *tPOCT6100_RPC_WRITE_WORD; + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_WRITE_SMEAR + +Description: Command structure for the write of one word at one or many + consecutive addresses. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulAddress Address of first write. +IN ulSmearLength Number of consecutive addresses to write. +IN ulWriteData The word to write at each address. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_WRITE_SMEAR_ +{ + UINT32 IN ulAddress; + UINT32 IN ulSmearLength; + UINT32 IN ulParity; + UINT32 IN ulWriteData; + +} tOCT6100_RPC_WRITE_SMEAR, *tPOCT6100_RPC_WRITE_SMEAR; + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_WRITE_INC + +Description: Command structure for the write of an incremental pattern at + one or many consecutive addresses. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulAddress Address of first write. +IN ulIncLength Number of consecutive addresses to write. +IN ulWriteData The first word of the incremental pattern. For each + consecutive write the word will be incremented by 1. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_WRITE_INC_ +{ + UINT32 IN ulAddress; + UINT32 IN ulIncLength; + UINT32 IN ulParity; + UINT32 IN ulWriteData; + +} tOCT6100_RPC_WRITE_INC, *tPOCT6100_RPC_WRITE_INC; + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_WRITE_BURST + +Description: Command structure for a write burst. The burst starts at the + given address and writes a given word for each address. + + Whereas every command structure uses a complete dword for every + member, irrespective of the size of data unit needed, this + structure does not do so for the write data. To save bandwidth + the write data words are sent two per dword. + +Example packet: 31 16 15 0 + ------------------------------------------- + | ulAddress = 0x100 | + ------------------------------------------- + | ulBurstLength = 0x3 | + ------------------------------------------- + aulWriteData ->| D0 | D1 | + ------------------------------------------- + | D2 | xx | + ------------------------------------------- + + Dy is the write data for ulAddress + 2 * y. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulAddress First address at which to write. +IN ulBurstLength The number of consecutive addresses to be write. +IN aulWriteData The write data words. The dwords of the structure + starting at this address are arranged as indicated in + the example packet above. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_WRITE_BURST_ +{ + UINT32 IN ulAddress; + UINT32 IN ulBurstLength; + UINT32 IN ulParity; + UINT32 IN aulWriteData[ 1 ]; + +} tOCT6100_RPC_WRITE_BURST, *tPOCT6100_RPC_WRITE_BURST; + + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_SET_HOT_CHANNEL + +Description: Command structure to set the hot channel. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulDebugChannel Index of the channel to debug. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_SET_HOT_CHANNEL_ +{ + UINT32 IN ulHotChannel; + UINT32 IN ulPcmLaw; + +} tOCT6100_RPC_SET_HOT_CHANNEL, *tPOCT6100_RPC_SET_HOT_CHANNEL; + + + +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +Structure: OCT6100_RPC_GET_DEBUG_CHAN_INDEX + +Description: Command structure to get the debug channel index used by the API. + +------------------------------------------------------------------------------- +| Member | Description +------------------------------------------------------------------------------- +IN ulDebugChannel Index of the channel to debug. + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ +typedef struct _OCT6100_RPC_GET_DEBUG_CHAN_INDEX_ +{ + UINT32 OUT ulDebugChanIndex; + +} tOCT6100_RPC_GET_DEBUG_CHAN_INDEX, *tPOCT6100_RPC_GET_DEBUG_CHAN_INDEX; + + +/************************** FUNCTION PROTOTYPES *****************************/ + + +#endif /* __OCT6100_RPC_PROTOCOL_H__ */ diff --git a/include/octrpc/rpc_protocol.h b/include/octrpc/rpc_protocol.h new file mode 100644 index 0000000..4cbefd0 --- /dev/null +++ b/include/octrpc/rpc_protocol.h @@ -0,0 +1,107 @@ +/*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*\ + +File: rpc_protocol.h + +Copyright (c) 2001 Octasic Inc. All rights reserved. + +Description: + +This section defines the intent of the file. + +This source code is Octasic Confidential. Use of and access to this code +is covered by the Octasic Device Enabling Software License Agreement. +Acknowledgement of the Octasic Device Enabling Software License was +required for access to this code. A copy was also provided with the release. + + +$Octasic_Release: OCT610xAPI-01.00-PR37 $ + +$Octasic_Revision: 22 $ + +\*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*/ + +#ifndef __RPC_PROTOCOL_H__ +#define __RPC_PROTOCOL_H__ + +/***************************** INCLUDE FILES *******************************/ + + +/***************************** DEFINES *************************************/ +#define cOCTRPC_ENDIAN_DETECT 0x27182819 +#define cOCTRPC_ENDIAN_DETECT_BYTE_W 0x19 +#define cOCTRPC_ENDIAN_DETECT_BYTE_X 0x28 +#define cOCTRPC_ENDIAN_DETECT_BYTE_Y 0x18 +#define cOCTRPC_ENDIAN_DETECT_BYTE_Z 0x27 +#define cOCTRPC_ECHO_PROTOCOL 0x00000000 + +#define cOCTRPC_MIN_PACKET_BYTE_LENGTH (sizeof( tOCTRPC_OGRDTP_HEADER )) +#define cOCTRPC_FIRST_COMMAND_BYTE_OFFSET (sizeof( tOCTRPC_OGRDTP_HEADER ) + sizeof( tOCTRPC_INTERFACE_HEADER )) +#define cOCTRPC_GENERIC_HEADERS_BYTE_SIZE (sizeof( tOCTRPC_OGRDTP_HEADER ) + sizeof( tOCTRPC_INTERFACE_HEADER ) + sizeof( tOCTRPC_COMMAND_HEADER )) +#define cOCTRPC_MAX_PACKET_BYTE_LENGTH 32768 + +/* Protocol versions */ +#define cOCTRPC_PROTOCOL_V1_0 0x00010000 +#define cOCTRPC_PROTOCOL_V1_1 0x00010001 +#define cOCTRPC_PROTOCOL_V1_2 0x00010002 +#define cOCTRPC_PROTOCOL_V1_3 0x00010003 +#define cOCTRPC_OCTASIC_PROTOCOL_V1_0 0xFF010000 +#define cOCTRPC_OCTASIC_PROTOCOL_V1_1 0xFF010001 +#define cOCTRPC_OCTASIC_PROTOCOL_V1_2 0xFF010002 +#define cOCTRPC_OCTASIC_PROTOCOL_V1_3 0xFF010003 + +/* Chips */ +#define cOCTRPC_OCT8304_INTERFACE 0x00000000 +#define cOCTRPC_OCT6100_INTERFACE 0x00000001 + +/* Timeout values. */ +#define cOCTRPC_SESSION_TIMEOUT 30 + +/* Generic errors */ +#define cOCTRPC_RDBGERR_OK 0x00000000 +#define cOCTRPC_RDBGERR_NO_ANSWER 0xFFFF0000 +#define cOCTRPC_RDBGERR_ALL_SESSIONS_OPEN 0xFFFF0001 +#define cOCTRPC_RDBGERR_PROTOCOL_NUMBER 0xFFFF0002 +#define cOCTRPC_RDBGERR_NO_COMMAND_HEADER 0xFFFF0003 +#define cOCTRPC_RDBGERR_INTERFACE_TYPE 0xFFFF0004 +#define cOCTRPC_RDBGERR_INTERFACE_VERSION 0xFFFF0005 +#define cOCTRPC_RDBGERR_INVALID_PACKET_LENGTH 0xFFFF0006 +#define cOCTRPC_RDBGERR_INVALID_COMMAND_LENGTH 0xFFFF0007 +#define cOCTRPC_RDBGERR_INVALID_COMMAND_NUMBER 0xFFFF0008 +#define cOCTRPC_RDBGERR_PACKET_TOO_LARGE 0xFFFF0009 +#define cOCTRPC_RDBGERR_LIST_EMPTY 0xFFFF000A + +#define cOCTRPC_RDBGERR_FATAL 0xFFFFFFFF + + +/***************************** TYPES ***************************************/ +typedef struct _OCTRPC_OGRDTP_HEADER_ +{ + UINT32 IN ulEndianDetect; + UINT32 IN ulDebugSessionNum; + UINT32 IN ulTransactionNum; + UINT32 IN ulPktRetryNum; + UINT32 IN ulPktByteSize; + UINT32 IN ulChecksum; + UINT32 OUT ulParsingError; + UINT32 IN ulRpcProtocolNum; + +} tOCTRPC_OGRDTP_HEADER, *tPOCTRPC_OGRDTP_HEADER; + +typedef struct _OCTRPC_INTERFACE_HEADER_ +{ + UINT32 IN ulInterfaceType; + UINT32 IN ulInterfaceVersion; + +} tOCTRPC_INTERFACE_HEADER, *tPOCTRPC_INTERFACE_HEADER; + +typedef struct _OCTRPC_COMMAND_HEADER_ +{ + UINT32 IN ulCommandByteSize; + UINT32 IN OUT ulRpcCommandNum; + UINT32 OUT ulFunctionResult; + +} tOCTRPC_COMMAND_HEADER, *tPOCTRPC_COMMAND_HEADER; + + + +#endif /* __RPC_PROTOCOL_H__ */ |