txinfoAddress

Zero-fills the provided CPI (Communications Processor Interface) packet and then sets addressing information and overall message size in the CPI packet.

Prototype

U32 txinfoAddress ( CPIPKT *pkt, U32 req_size, U16 board, U16 host_chan)

Argument

Description

pkt

Pointer to the address of the CPI packet that is to be initialized. The memory area for the packet must be at least req_size bytes in length.

req_size

Total byte length of the CPI packet (including CPI header size).

board

Destination board number.

host_chan

Source CPI channel number.


Return values

Return value

Description

SUCCESS

 

SCCIP_NULL_POINTER

Invalid NULL pointer detected.


Details

txinfoAddress initializes a memory area as a CPI packet that can then be used on a subsequent call to a TX INFO message-specific function (such as txinfoSystemInfo). req_size indicates the total size of the CPI packet memory area. The size of a TX INFO message is provided by calling the appropriate TX INFO message function with a CPI packet address of NULL. The value returned is the total size of the CPI request message.

After calling txinfoAddress, the given CPI packet’s source indicates the host channel with which the packet is associated. The CPI packet’s destination is the TX INFO channel on the target TX board.

See also

txinfoReply

Example

req_size = txinfoSystemInfo( NULL, 0 );
if (req_size == 0)
{
    printf( "Error sizing SYSTEM INFO.\n" );
    exit( 1 );
}

/* ----- create the request msg */
pkt = (CPIPKT *)malloc( req_size );
txinfoAddress
( pkt, req_size, board, PT_MGR );
status = txinfoSystemInfo( pkt, 0 );
if (status != 0)
{
    printf( "Error [0x%08X] building SYSTEM INFO.\n", status );
    free( pkt );
    exit( 1 );
}

/* ----- send the request msg */
cpistatus = cpia_send( handle, pkt, NULL );