Generic Packet Router (GPR) APIs

Public APIs

This file contains GPR APIs.

Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. SPDX-License-Identifier: BSD-3-Clause

Defines

GPR_HEAP_INDEX_DEFAULT
GPR_HEAP_INDEX_1

Typedefs

typedef uint8_t gpr_heap_index_t
typedef uint32_t (*gpr_callback_fn_t)(gpr_packet_t *packet, void *callback_data)

Prototype of a packet callback function.

Associated data types

#gpr_packet_t

Otherwise, an error (see ) — The packet ownership is returned to the caller.

Param packet:

[in] Pointer to the incoming packet. The packet is guaranteed to have a non-NULL value.

Param callback_data:

[in] Client-supplied data pointer that the service provided at registration time.

Return:

AR_EOK — When successful, indicates that the callee has taken ownership of the packet.

typedef struct gpr_packet_pool_info_v2_t gpr_packet_pool_info_v2_t
typedef struct gpr_cmd_gpr_packet_pool_info_t gpr_cmd_gpr_packet_pool_info_t
typedef struct gpr_cmd_alloc_ext_v2_t gpr_cmd_alloc_ext_v2_t
struct gpr_packet_pool_info_v2_t
#include <gpr_api.h>

Public Members

gpr_heap_index_t heap_index
uint8_t is_dynamic
uint16_t reserved
uint32_t num_packets
uint32_t packet_size
struct gpr_cmd_gpr_packet_pool_info_t
#include <gpr_api.h>

Contains the packet pool information for __gpr_cmd_get_gpr_packet_info().

Public Members

uint32_t bytes_per_min_size_packet

Minimum size (in bytes) of a GPR packet.

uint32_t num_min_size_packets

Number of packets of the minimum size allocated at initialization.

uint32_t bytes_per_max_size_packet

Maximum size (in bytes) of a GPR packet.

uint32_t num_max_size_packets

Number of packets of the maximum size allocated at initialization.

struct gpr_cmd_alloc_ext_t
#include <gpr_api.h>

Contains the allocated packet information for __gpr_cmd_alloc_ext().

Public Members

uint8_t src_domain_id

Domain ID of the sender service.

uint32_t src_port

Registered unique ID of the sender service.

uint8_t dst_domain_id

Domain ID of the receiver service.

uint32_t dst_port

Registered unique ID of the receiver service.

uint8_t client_data

Reserved for use by client.

uint32_t token

Value attached by the sender to determine when command messages are processed by the receiver after they receive response messages.

uint32_t opcode

Defines both the action and the payload structure to the receiver.

uint32_t payload_size

Actual number of bytes required for the payload.

gpr_packet_t **ret_packet

Double pointer to the formatted packet returned by the function.

struct gpr_cmd_alloc_ext_v2_t
#include <gpr_api.h>

Contains the allocated packet information for __gpr_cmd_alloc_ext_v2().

Public Members

uint8_t src_domain_id

Domain ID of the sender service.

uint32_t src_port

Registered unique ID of the sender service.

uint8_t dst_domain_id

Domain ID of the receiver service.

uint32_t dst_port

Registered unique ID of the receiver service.

uint8_t client_data

Reserved for use by client.

uint32_t token

Value attached by the sender to determine when command messages are processed by the receiver after they receive response messages.

gpr_heap_index_t heap_index

heap index of the packet pool. ‘0’ is default value. Must be set to 0 if not applicable.

uint32_t opcode

Defines both the action and the payload structure to the receiver.

uint32_t payload_size

Actual number of bytes required for the payload.

gpr_packet_t **ret_packet

Double pointer to the formatted packet returned by the function.

struct gpr_cmd_alloc_send_t
#include <gpr_api.h>

Contains the allocated packet information for __gpr_cmd_alloc_send().

Public Members

uint8_t src_domain_id

Domain ID of the sender service.

uint32_t src_port

Registered unique ID of the sender service.

uint8_t dst_domain_id

Domain ID of the receiver service.

uint32_t dst_port

Registered unique ID of the receiver service.

uint8_t client_data

Reserved for use by the client.

uint32_t token

Value attached by the sender to determine when command messages have been processed by the receiver after having received response messages.

uint32_t opcode

Operation code defines both the action and the payload structure to the receiver.

uint32_t payload_size

Actual number of bytes needed for the payload.

void *payload

Pointer to the payload to send.