struct hif_device_mbox_info MailBoxInfo;
HIF_PENDING_EVENTS_FUNC GetPendingEventsFunc;
void *HTCContext;
- HTC_PACKET_QUEUE RegisterIOList;
+ struct htc_packet_queue RegisterIOList;
struct ar6k_async_reg_io_buffer RegIOBuffers[AR6K_MAX_REG_IO_BUFFERS];
void (*TargetFailureCallback)(void *Context);
int (*MessagePendingCallback)(void *Context,
u32 RecvStateFlags;
u32 SendStateFlags;
HCI_TRANSPORT_PACKET_TYPE WaitBufferType;
- HTC_PACKET_QUEUE SendQueue; /* write queue holding HCI Command and ACL packets */
- HTC_PACKET_QUEUE HCIACLRecvBuffers; /* recv queue holding buffers for incomming ACL packets */
- HTC_PACKET_QUEUE HCIEventBuffers; /* recv queue holding buffers for incomming event packets */
+ struct htc_packet_queue SendQueue; /* write queue holding HCI Command and ACL packets */
+ struct htc_packet_queue HCIACLRecvBuffers; /* recv queue holding buffers for incomming ACL packets */
+ struct htc_packet_queue HCIEventBuffers; /* recv queue holding buffers for incomming event packets */
struct ar6k_device *pDev;
A_MUTEX_T HCIRxLock;
A_MUTEX_T HCITxLock;
LOCK_HCI_RX(pProt);
} else {
- HTC_PACKET_QUEUE *pQueue;
+ struct htc_packet_queue *pQueue;
/* user is using a refill handler that can refill multiple HTC buffers */
/* select buffer queue */
/* check if we need to refill recv buffers */
if ((pProt->HCIConfig.pHCIPktRecvRefill != NULL) && !recvRefillCalled) {
- HTC_PACKET_QUEUE *pQueue;
+ struct htc_packet_queue *pQueue;
int watermark;
if (pktType == HCI_ACL_TYPE) {
/* see if we need to recycle the recv buffer */
if (status && (pPacket != NULL)) {
- HTC_PACKET_QUEUE queue;
+ struct htc_packet_queue queue;
if (A_EPROTO == status) {
DebugDumpBytes(pPacket->pBuffer, totalRecvLength, "Bad HCI-UART Recv packet");
static void FlushSendQueue(struct gmbox_proto_hci_uart *pProt)
{
struct htc_packet *pPacket;
- HTC_PACKET_QUEUE discardQueue;
+ struct htc_packet_queue discardQueue;
INIT_HTC_PACKET_QUEUE(&discardQueue);
static void FlushRecvBuffers(struct gmbox_proto_hci_uart *pProt)
{
- HTC_PACKET_QUEUE discardQueue;
+ struct htc_packet_queue discardQueue;
struct htc_packet *pPacket;
INIT_HTC_PACKET_QUEUE(&discardQueue);
AR_DEBUG_PRINTF(ATH_DEBUG_TRC,("-HCI_TransportAttach \n"));
}
-int HCI_TransportAddReceivePkts(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue)
+int HCI_TransportAddReceivePkts(HCI_TRANSPORT_HANDLE HciTrans, struct htc_packet_queue *pQueue)
{
struct gmbox_proto_hci_uart *pProt = (struct gmbox_proto_hci_uart *)HciTrans;
int status = 0;
static void HTCReportFailure(void *Context);
static void ResetEndpointStates(HTC_TARGET *target);
-void HTCFreeControlBuffer(HTC_TARGET *target, struct htc_packet *pPacket, HTC_PACKET_QUEUE *pList)
+void HTCFreeControlBuffer(HTC_TARGET *target, struct htc_packet *pPacket, struct htc_packet_queue *pList)
{
LOCK_HTC(target);
HTC_PACKET_ENQUEUE(pList,pPacket);
UNLOCK_HTC(target);
}
-struct htc_packet *HTCAllocControlBuffer(HTC_TARGET *target, HTC_PACKET_QUEUE *pList)
+struct htc_packet *HTCAllocControlBuffer(HTC_TARGET *target, struct htc_packet_queue *pList)
{
struct htc_packet *pPacket;
HTC_ENDPOINT_ID Id;
HTC_SERVICE_ID ServiceID; /* service ID this endpoint is bound to
non-zero value means this endpoint is in use */
- HTC_PACKET_QUEUE TxQueue; /* HTC frame buffer TX queue */
- HTC_PACKET_QUEUE RxBuffers; /* HTC frame buffer RX list */
+ struct htc_packet_queue TxQueue; /* HTC frame buffer TX queue */
+ struct htc_packet_queue RxBuffers; /* HTC frame buffer RX list */
struct htc_endpoint_credit_dist CreditDist; /* credit distribution structure (exposed to driver layer) */
struct htc_ep_callbacks EpCallBacks; /* callbacks associated with this endpoint */
int MaxTxQueueDepth; /* max depth of the TX queue before we need to
call driver's full handler */
int MaxMsgLength; /* max length of endpoint message */
int TxProcessCount; /* reference count to continue tx processing */
- HTC_PACKET_QUEUE RecvIndicationQueue; /* recv packets ready to be indicated */
+ struct htc_packet_queue RecvIndicationQueue; /* recv packets ready to be indicated */
int RxProcessCount; /* reference count to allow single processing context */
struct _HTC_TARGET *target; /* back pointer to target */
u8 SeqNo; /* TX seq no (helpful) for debugging */
struct htc_endpoint EndPoint[ENDPOINT_MAX];
struct htc_control_buffer HTCControlBuffers[NUM_CONTROL_BUFFERS];
struct htc_endpoint_credit_dist *EpCreditDistributionListHead;
- HTC_PACKET_QUEUE ControlBufferTXFreeList;
- HTC_PACKET_QUEUE ControlBufferRXFreeList;
+ struct htc_packet_queue ControlBufferTXFreeList;
+ struct htc_packet_queue ControlBufferRXFreeList;
HTC_CREDIT_DIST_CALLBACK DistributeCredits;
HTC_CREDIT_INIT_CALLBACK InitCredits;
void *pCredDistContext;
void HTCControlTxComplete(void *Context, struct htc_packet *pPacket);
void HTCControlRecv(void *Context, struct htc_packet *pPacket);
int HTCWaitforControlMessage(HTC_TARGET *target, struct htc_packet **ppControlPacket);
-struct htc_packet *HTCAllocControlBuffer(HTC_TARGET *target, HTC_PACKET_QUEUE *pList);
-void HTCFreeControlBuffer(HTC_TARGET *target, struct htc_packet *pPacket, HTC_PACKET_QUEUE *pList);
+struct htc_packet *HTCAllocControlBuffer(HTC_TARGET *target, struct htc_packet_queue *pList);
+void HTCFreeControlBuffer(HTC_TARGET *target, struct htc_packet *pPacket, struct htc_packet_queue *pList);
int HTCIssueSend(HTC_TARGET *target, struct htc_packet *pPacket);
void HTCRecvCompleteHandler(void *Context, struct htc_packet *pPacket);
int HTCRecvMessagePendingHandler(void *Context, u32 MsgLookAheads[], int NumLookAheads, bool *pAsyncProc, int *pNumPktsFetched);
#endif
static void DoRecvCompletion(struct htc_endpoint *pEndpoint,
- HTC_PACKET_QUEUE *pQueueToIndicate)
+ struct htc_packet_queue *pQueueToIndicate)
{
do {
/* unload the recv completion queue */
static INLINE void DrainRecvIndicationQueue(HTC_TARGET *target, struct htc_endpoint *pEndpoint)
{
- HTC_PACKET_QUEUE recvCompletions;
+ struct htc_packet_queue recvCompletions;
AR_DEBUG_PRINTF(ATH_DEBUG_RECV, ("+DrainRecvIndicationQueue \n"));
u32 LookAheads[],
int Messages,
struct htc_endpoint *pEndpoint,
- HTC_PACKET_QUEUE *pQueue)
+ struct htc_packet_queue *pQueue)
{
int status = 0;
struct htc_packet *pPacket;
HTC_TARGET *target = (HTC_TARGET *)pScatterReq->Context;
int status;
bool partialBundle = false;
- HTC_PACKET_QUEUE localRecvQueue;
+ struct htc_packet_queue localRecvQueue;
bool procError = false;
AR_DEBUG_PRINTF(ATH_DEBUG_RECV,("+HTCAsyncRecvScatterCompletion TotLen: %d Entries: %d\n",
}
static int HTCIssueRecvPacketBundle(HTC_TARGET *target,
- HTC_PACKET_QUEUE *pRecvPktQueue,
- HTC_PACKET_QUEUE *pSyncCompletionQueue,
+ struct htc_packet_queue *pRecvPktQueue,
+ struct htc_packet_queue *pSyncCompletionQueue,
int *pNumPacketsFetched,
bool PartialBundle)
{
bool asyncProc = false;
u32 lookAheads[HTC_HOST_MAX_MSG_PER_BUNDLE];
int pktsFetched;
- HTC_PACKET_QUEUE recvPktQueue, syncCompletedPktsQueue;
+ struct htc_packet_queue recvPktQueue, syncCompletedPktsQueue;
bool partialBundle;
HTC_ENDPOINT_ID id;
int totalFetched = 0;
/* unload sync completion queue */
while (!HTC_QUEUE_EMPTY(&syncCompletedPktsQueue)) {
- HTC_PACKET_QUEUE container;
+ struct htc_packet_queue container;
pPacket = HTC_PACKET_DEQUEUE(&syncCompletedPktsQueue);
A_ASSERT(pPacket != NULL);
return status;
}
-int HTCAddReceivePktMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue)
+int HTCAddReceivePktMultiple(HTC_HANDLE HTCHandle, struct htc_packet_queue *pPktQueue)
{
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
struct htc_endpoint *pEndpoint;
/* Makes a buffer available to the HTC module */
int HTCAddReceivePkt(HTC_HANDLE HTCHandle, struct htc_packet *pPacket)
{
- HTC_PACKET_QUEUE queue;
+ struct htc_packet_queue queue;
INIT_HTC_PACKET_QUEUE_AND_ADD(&queue,pPacket);
return HTCAddReceivePktMultiple(HTCHandle, &queue);
}
}
}
-static void HTCFlushRxQueue(HTC_TARGET *target, struct htc_endpoint *pEndpoint, HTC_PACKET_QUEUE *pQueue)
+static void HTCFlushRxQueue(HTC_TARGET *target, struct htc_endpoint *pEndpoint, struct htc_packet_queue *pQueue)
{
struct htc_packet *pPacket;
- HTC_PACKET_QUEUE container;
+ struct htc_packet_queue container;
LOCK_HTC_RX(target);
}
static void DoSendCompletion(struct htc_endpoint *pEndpoint,
- HTC_PACKET_QUEUE *pQueueToIndicate)
+ struct htc_packet_queue *pQueueToIndicate)
{
do {
{
HTC_TARGET *target = (HTC_TARGET *)Context;
struct htc_endpoint *pEndpoint = &target->EndPoint[pPacket->Endpoint];
- HTC_PACKET_QUEUE container;
+ struct htc_packet_queue container;
CompleteSentPacket(target,pEndpoint,pPacket);
INIT_HTC_PACKET_QUEUE_AND_ADD(&container,pPacket);
/* get HTC send packets from the TX queue on an endpoint */
static INLINE void GetHTCSendPackets(HTC_TARGET *target,
struct htc_endpoint *pEndpoint,
- HTC_PACKET_QUEUE *pQueue)
+ struct htc_packet_queue *pQueue)
{
int creditsRequired;
int remainder;
struct htc_endpoint *pEndpoint = (struct htc_endpoint *)pScatterReq->Context;
HTC_TARGET *target = (HTC_TARGET *)pEndpoint->target;
int status = 0;
- HTC_PACKET_QUEUE sendCompletes;
+ struct htc_packet_queue sendCompletes;
INIT_HTC_PACKET_QUEUE(&sendCompletes);
* - we drop below the minimum number of messages for a bundle
* */
static void HTCIssueSendBundle(struct htc_endpoint *pEndpoint,
- HTC_PACKET_QUEUE *pQueue,
+ struct htc_packet_queue *pQueue,
int *pBundlesSent,
int *pTotalBundlesPkts)
{
* this function returns the result of the attempt to send a queue of HTC packets */
static HTC_SEND_QUEUE_RESULT HTCTrySend(HTC_TARGET *target,
struct htc_endpoint *pEndpoint,
- HTC_PACKET_QUEUE *pCallersSendQueue)
+ struct htc_packet_queue *pCallersSendQueue)
{
- HTC_PACKET_QUEUE sendQueue; /* temp queue to hold packets at various stages */
+ struct htc_packet_queue sendQueue; /* temp queue to hold packets at various stages */
struct htc_packet *pPacket;
int bundlesSent;
int pktsInBundles;
return HTC_SEND_QUEUE_OK;
}
-int HTCSendPktsMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue)
+int HTCSendPktsMultiple(HTC_HANDLE HTCHandle, struct htc_packet_queue *pPktQueue)
{
HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
struct htc_endpoint *pEndpoint;
/* HTC API - HTCSendPkt */
int HTCSendPkt(HTC_HANDLE HTCHandle, struct htc_packet *pPacket)
{
- HTC_PACKET_QUEUE queue;
+ struct htc_packet_queue queue;
AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
("+-HTCSendPkt: Enter endPointId: %d, buffer: 0x%lX, length: %d \n",
static void HTCFlushEndpointTX(HTC_TARGET *target, struct htc_endpoint *pEndpoint, HTC_TX_TAG Tag)
{
struct htc_packet *pPacket;
- HTC_PACKET_QUEUE discardQueue;
- HTC_PACKET_QUEUE container;
+ struct htc_packet_queue discardQueue;
+ struct htc_packet_queue container;
/* initialize the discard queue */
INIT_HTC_PACKET_QUEUE(&discardQueue);
@example:
@see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-int HCI_TransportAddReceivePkts(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue);
+int HCI_TransportAddReceivePkts(HCI_TRANSPORT_HANDLE HciTrans, struct htc_packet_queue *pQueue);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Send an HCI packet packet
/* per service connection send completion */
typedef void (*HTC_EP_SEND_PKT_COMPLETE)(void *,struct htc_packet *);
/* per service connection callback when a plurality of packets have been sent
- * The HTC_PACKET_QUEUE is a temporary queue object (e.g. freed on return from the callback)
+ * The struct htc_packet_queue is a temporary queue object (e.g. freed on return from the callback)
* to hold a list of completed send packets.
* If the handler cannot fully traverse the packet queue before returning, it should
* transfer the items of the queue into the caller's private queue using:
* HTC_PACKET_ENQUEUE() */
-typedef void (*HTC_EP_SEND_PKT_COMP_MULTIPLE)(void *,HTC_PACKET_QUEUE *);
+typedef void (*HTC_EP_SEND_PKT_COMP_MULTIPLE)(void *,struct htc_packet_queue *);
/* per service connection pkt received */
typedef void (*HTC_EP_RECV_PKT)(void *,struct htc_packet *);
/* per service connection callback when a plurality of packets are received
- * The HTC_PACKET_QUEUE is a temporary queue object (e.g. freed on return from the callback)
+ * The struct htc_packet_queue is a temporary queue object (e.g. freed on return from the callback)
* to hold a list of recv packets.
* If the handler cannot fully traverse the packet queue before returning, it should
* transfer the items of the queue into the caller's private queue using:
* HTC_PACKET_ENQUEUE() */
-typedef void (*HTC_EP_RECV_PKT_MULTIPLE)(void *,HTC_PACKET_QUEUE *);
+typedef void (*HTC_EP_RECV_PKT_MULTIPLE)(void *,struct htc_packet_queue *);
/* Optional per service connection receive buffer re-fill callback,
* On some OSes (like Linux) packets are allocated from a global pool and indicated up
@return: 0
@notes: Caller must initialize each packet using SET_HTC_PACKET_INFO_TX() macro.
The queue must only contain packets directed at the same endpoint.
- Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the TX packets in FIFO order.
+ Caller supplies a pointer to an struct htc_packet_queue structure holding the TX packets in FIFO order.
This API will remove the packets from the pkt queue and place them into the HTC Tx Queue
and bundle messages where possible.
The caller may allocate the pkt queue on the stack to hold the packets.
@example:
@see also: HTCFlushEndpoint
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-int HTCSendPktsMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue);
+int HTCSendPktsMultiple(HTC_HANDLE HTCHandle, struct htc_packet_queue *pPktQueue);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Add multiple receive packets to HTC
@notes: user must supply HTC packets for capturing incomming HTC frames. The caller
must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL()
macro. The queue must only contain recv packets for the same endpoint.
- Caller supplies a pointer to an HTC_PACKET_QUEUE structure holding the recv packet.
+ Caller supplies a pointer to an struct htc_packet_queue structure holding the recv packet.
This API will remove the packets from the pkt queue and place them into internal
recv packet list.
The caller may allocate the pkt queue on the stack to hold the packets.
@example:
@see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-int HTCAddReceivePktMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueue);
+int HTCAddReceivePktMultiple(HTC_HANDLE HTCHandle, struct htc_packet_queue *pPktQueue);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Check if an endpoint is marked active
}
/* HTC Packet Queueing Macros */
-typedef struct _HTC_PACKET_QUEUE {
+struct htc_packet_queue {
struct dl_list QueueHead;
int Depth;
-} HTC_PACKET_QUEUE;
+};
/* initialize queue */
#define INIT_HTC_PACKET_QUEUE(pQ) \
/* test if a queue is empty */
#define HTC_QUEUE_EMPTY(pQ) ((pQ)->Depth == 0)
/* get packet at head without removing it */
-static INLINE struct htc_packet *HTC_GET_PKT_AT_HEAD(HTC_PACKET_QUEUE *queue) {
+static INLINE struct htc_packet *HTC_GET_PKT_AT_HEAD(struct htc_packet_queue *queue) {
if (queue->Depth == 0) {
return NULL;
}
}
/* dequeue an HTC packet from the head of the queue */
-static INLINE struct htc_packet *HTC_PACKET_DEQUEUE(HTC_PACKET_QUEUE *queue) {
+static INLINE struct htc_packet *HTC_PACKET_DEQUEUE(struct htc_packet_queue *queue) {
struct dl_list *pItem = DL_ListRemoveItemFromHead(&queue->QueueHead);
if (pItem != NULL) {
queue->Depth--;
}
/* dequeue an HTC packet from the tail of the queue */
-static INLINE struct htc_packet *HTC_PACKET_DEQUEUE_TAIL(HTC_PACKET_QUEUE *queue) {
+static INLINE struct htc_packet *HTC_PACKET_DEQUEUE_TAIL(struct htc_packet_queue *queue) {
struct dl_list *pItem = DL_ListRemoveItemFromTail(&queue->QueueHead);
if (pItem != NULL) {
queue->Depth--;
static void ar6000_rx_refill(void *Context,HTC_ENDPOINT_ID Endpoint);
-static void ar6000_tx_complete(void *Context, HTC_PACKET_QUEUE *pPackets);
+static void ar6000_tx_complete(void *Context, struct htc_packet_queue *pPackets);
static HTC_SEND_FULL_ACTION ar6000_tx_queue_full(void *Context, struct htc_packet *pPacket);
static void
-ar6000_tx_complete(void *Context, HTC_PACKET_QUEUE *pPacketQueue)
+ar6000_tx_complete(void *Context, struct htc_packet_queue *pPacketQueue)
{
AR_SOFTC_T *ar = (AR_SOFTC_T *)Context;
u32 mapNo = 0;
int RxBuffers;
int buffersToRefill;
struct htc_packet *pPacket;
- HTC_PACKET_QUEUE queue;
+ struct htc_packet_queue queue;
buffersToRefill = (int)AR6000_MAX_RX_BUFFERS -
HTCGetNumRecvBuffers(ar->arHtcTarget, Endpoint);
struct sk_buff *new_skb;
int i;
int pkts = 0;
- HTC_PACKET_QUEUE pktQueue;
+ struct htc_packet_queue pktQueue;
EPPING_HEADER *eppingHdr;
eppingHdr = A_NETBUF_DATA(dupskb);
HCI_TRANSPORT_HANDLE (*_HCI_TransportAttach)(void *HTCHandle, struct hci_transport_config_info *pInfo);
void (*_HCI_TransportDetach)(HCI_TRANSPORT_HANDLE HciTrans);
-int (*_HCI_TransportAddReceivePkts)(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue);
+int (*_HCI_TransportAddReceivePkts)(HCI_TRANSPORT_HANDLE HciTrans, struct htc_packet_queue *pQueue);
int (*_HCI_TransportSendPkt)(HCI_TRANSPORT_HANDLE HciTrans, struct htc_packet *pPacket, bool Synchronous);
void (*_HCI_TransportStop)(HCI_TRANSPORT_HANDLE HciTrans);
int (*_HCI_TransportStart)(HCI_TRANSPORT_HANDLE HciTrans);
struct hci_dev *pBtStackHCIDev; /* BT Stack HCI dev */
bool HciNormalMode; /* Actual HCI mode enabled (non-TEST)*/
bool HciRegistered; /* HCI device registered with stack */
- HTC_PACKET_QUEUE HTCPacketStructHead;
+ struct htc_packet_queue HTCPacketStructHead;
u8 *pHTCStructAlloc;
spinlock_t BridgeLock;
#ifdef EXPORT_HCI_BRIDGE_INTERFACE
{
int length, i;
void *osBuf = NULL;
- HTC_PACKET_QUEUE queue;
+ struct htc_packet_queue queue;
struct htc_packet *pPacket;
INIT_HTC_PACKET_QUEUE(&queue);
u16 ap_beacon_interval;
u16 arRTS;
u16 arACS; /* AP mode - Auto Channel Selection */
- HTC_PACKET_QUEUE amsdu_rx_buffer_queue;
+ struct htc_packet_queue amsdu_rx_buffer_queue;
bool bIsDestroyProgress; /* flag to indicate ar6k destroy is in progress */
A_TIMER disconnect_timer;
u8 rxMetaVersion;
extern HCI_TRANSPORT_HANDLE (*_HCI_TransportAttach)(void *HTCHandle, struct hci_transport_config_info *pInfo);
extern void (*_HCI_TransportDetach)(HCI_TRANSPORT_HANDLE HciTrans);
-extern int (*_HCI_TransportAddReceivePkts)(HCI_TRANSPORT_HANDLE HciTrans, HTC_PACKET_QUEUE *pQueue);
+extern int (*_HCI_TransportAddReceivePkts)(HCI_TRANSPORT_HANDLE HciTrans, struct htc_packet_queue *pQueue);
extern int (*_HCI_TransportSendPkt)(HCI_TRANSPORT_HANDLE HciTrans, struct htc_packet *pPacket, bool Synchronous);
extern void (*_HCI_TransportStop)(HCI_TRANSPORT_HANDLE HciTrans);
extern int (*_HCI_TransportStart)(HCI_TRANSPORT_HANDLE HciTrans);