/* Copyright (C) 2006 Ikanos Communications * See IKANOS_PROP_LICENSE.txt for license information. */ //====================================================================== // File Name : $RCSfile: apipc.h,v $ // Description : Define queue based interface for AP -> host packets //====================================================================== #ifndef _APIPC_H_ #define _APIPC_H_ /* AP ingress and egress ports may need to forward packets (chains of * clusters) to the system host CPU. * * This interface performs those tasks. It has the following features * - supports multiple queues (data prioritization) * - queue indexes seperate from queues (allows indexes to be in * fast memory for lower overheads) * * When the AP writes to the queue it will update the apNextRead index for the * queue, and set the interrupt bit that matches the queue. * * The host CPU will then clear the interrupt bit and read the entry at * hostNextRead, and do a circular increment. This process will continue until * apNextWrite == hostNextRead * * Note that the maximum capacity of the queue is maxEntries - 1. */ /* This structure represents the configuration information for a queue. This * will typically be supplied by the host CPU */ typedef struct { void *pQueue; // Physical address of the queue unsigned short maxEntries; /* Size of the queue, in entries. * The size of an entry depends on the * type of queue. */ } apQueueSpec_t; /* The following structure represents the head and tail indexes for the queue. * They are constrained to be in the range 0 .. maxEntries - 1 of the queue * * Typically there will be an array of these to represent all the queues */ typedef struct { unsigned short nextWrite; // Next index to write unsigned short nextRead; // Next index to read } apQueueState_t; #endif /* _APIPC_H_ */