summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ath6kl/include/htc_api.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/ath6kl/include/htc_api.h')
-rw-r--r--drivers/staging/ath6kl/include/htc_api.h170
1 files changed, 85 insertions, 85 deletions
diff --git a/drivers/staging/ath6kl/include/htc_api.h b/drivers/staging/ath6kl/include/htc_api.h
index b007051..1bc2488 100644
--- a/drivers/staging/ath6kl/include/htc_api.h
+++ b/drivers/staging/ath6kl/include/htc_api.h
@@ -41,31 +41,31 @@ extern "C" {
typedef void *HTC_HANDLE;
-typedef A_UINT16 HTC_SERVICE_ID;
+typedef u16 HTC_SERVICE_ID;
-typedef struct _HTC_INIT_INFO {
+struct htc_init_info {
void *pContext; /* context for target failure notification */
- void (*TargetFailure)(void *Instance, A_STATUS Status);
-} HTC_INIT_INFO;
+ void (*TargetFailure)(void *Instance, int Status);
+};
/* per service connection send completion */
-typedef void (*HTC_EP_SEND_PKT_COMPLETE)(void *,HTC_PACKET *);
+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 *,HTC_PACKET *);
+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
@@ -94,7 +94,7 @@ typedef void (*HTC_EP_RECV_REFILL)(void *, HTC_ENDPOINT_ID Endpoint);
* amount of "committed" memory used to receive packets.
*
* */
-typedef HTC_PACKET *(*HTC_EP_RECV_ALLOC)(void *, HTC_ENDPOINT_ID Endpoint, int Length);
+typedef struct htc_packet *(*HTC_EP_RECV_ALLOC)(void *, HTC_ENDPOINT_ID Endpoint, int Length);
typedef enum _HTC_SEND_FULL_ACTION {
HTC_SEND_FULL_KEEP = 0, /* packet that overflowed should be kept in the queue */
@@ -114,9 +114,9 @@ typedef enum _HTC_SEND_FULL_ACTION {
* closed loop mechanism will prevent the network stack from overunning the NIC
* The packet to keep or drop is passed for inspection to the registered handler the handler
* must ONLY inspect the packet, it may not free or reclaim the packet. */
-typedef HTC_SEND_FULL_ACTION (*HTC_EP_SEND_QUEUE_FULL)(void *, HTC_PACKET *pPacket);
+typedef HTC_SEND_FULL_ACTION (*HTC_EP_SEND_QUEUE_FULL)(void *, struct htc_packet *pPacket);
-typedef struct _HTC_EP_CALLBACKS {
+struct htc_ep_callbacks {
void *pContext; /* context for each callback */
HTC_EP_SEND_PKT_COMPLETE EpTxComplete; /* tx completion callback for connected endpoint */
HTC_EP_RECV_PKT EpRecv; /* receive callback for connected endpoint */
@@ -136,39 +136,39 @@ typedef struct _HTC_EP_CALLBACKS {
when the recv queue drops below this value
if set to 0, the refill is only called when packets
are empty */
-} HTC_EP_CALLBACKS;
+};
/* service connection information */
-typedef struct _HTC_SERVICE_CONNECT_REQ {
+struct htc_service_connect_req {
HTC_SERVICE_ID ServiceID; /* service ID to connect to */
- A_UINT16 ConnectionFlags; /* connection flags, see htc protocol definition */
- A_UINT8 *pMetaData; /* ptr to optional service-specific meta-data */
- A_UINT8 MetaDataLength; /* optional meta data length */
- HTC_EP_CALLBACKS EpCallbacks; /* endpoint callbacks */
+ u16 ConnectionFlags; /* connection flags, see htc protocol definition */
+ u8 *pMetaData; /* ptr to optional service-specific meta-data */
+ u8 MetaDataLength; /* optional meta data length */
+ struct htc_ep_callbacks EpCallbacks; /* endpoint callbacks */
int MaxSendQueueDepth; /* maximum depth of any send queue */
- A_UINT32 LocalConnectionFlags; /* HTC flags for the host-side (local) connection */
+ u32 LocalConnectionFlags; /* HTC flags for the host-side (local) connection */
unsigned int MaxSendMsgSize; /* override max message size in send direction */
-} HTC_SERVICE_CONNECT_REQ;
+};
#define HTC_LOCAL_CONN_FLAGS_ENABLE_SEND_BUNDLE_PADDING (1 << 0) /* enable send bundle padding for this endpoint */
/* service connection response information */
-typedef struct _HTC_SERVICE_CONNECT_RESP {
- A_UINT8 *pMetaData; /* caller supplied buffer to optional meta-data */
- A_UINT8 BufferLength; /* length of caller supplied buffer */
- A_UINT8 ActualLength; /* actual length of meta data */
+struct htc_service_connect_resp {
+ u8 *pMetaData; /* caller supplied buffer to optional meta-data */
+ u8 BufferLength; /* length of caller supplied buffer */
+ u8 ActualLength; /* actual length of meta data */
HTC_ENDPOINT_ID Endpoint; /* endpoint to communicate over */
unsigned int MaxMsgLength; /* max length of all messages over this endpoint */
- A_UINT8 ConnectRespCode; /* connect response code from target */
-} HTC_SERVICE_CONNECT_RESP;
+ u8 ConnectRespCode; /* connect response code from target */
+};
/* endpoint distribution structure */
-typedef struct _HTC_ENDPOINT_CREDIT_DIST {
- struct _HTC_ENDPOINT_CREDIT_DIST *pNext;
- struct _HTC_ENDPOINT_CREDIT_DIST *pPrev;
+struct htc_endpoint_credit_dist {
+ struct htc_endpoint_credit_dist *pNext;
+ struct htc_endpoint_credit_dist *pPrev;
HTC_SERVICE_ID ServiceID; /* Service ID (set by HTC) */
HTC_ENDPOINT_ID Endpoint; /* endpoint for this distribution struct (set by HTC) */
- A_UINT32 DistFlags; /* distribution flags, distribution function can
+ u32 DistFlags; /* distribution flags, distribution function can
set default activity using SET_EP_ACTIVE() macro */
int TxCreditsNorm; /* credits for normal operation, anything above this
indicates the endpoint is over-subscribed, this field
@@ -195,9 +195,9 @@ typedef struct _HTC_ENDPOINT_CREDIT_DIST {
or HTC_CREDIT_DIST_SEND_COMPLETE is indicated on an endpoint
that has non-zero credits to recover
*/
-} HTC_ENDPOINT_CREDIT_DIST;
+};
-#define HTC_EP_ACTIVE ((A_UINT32) (1u << 31))
+#define HTC_EP_ACTIVE ((u32) (1u << 31))
/* macro to check if an endpoint has gone active, useful for credit
* distributions */
@@ -216,11 +216,11 @@ typedef enum _HTC_CREDIT_DIST_REASON {
} HTC_CREDIT_DIST_REASON;
typedef void (*HTC_CREDIT_DIST_CALLBACK)(void *Context,
- HTC_ENDPOINT_CREDIT_DIST *pEPList,
+ struct htc_endpoint_credit_dist *pEPList,
HTC_CREDIT_DIST_REASON Reason);
typedef void (*HTC_CREDIT_INIT_CALLBACK)(void *Context,
- HTC_ENDPOINT_CREDIT_DIST *pEPList,
+ struct htc_endpoint_credit_dist *pEPList,
int TotalCredits);
/* endpoint statistics action */
@@ -231,31 +231,31 @@ typedef enum _HTC_ENDPOINT_STAT_ACTION {
} HTC_ENDPOINT_STAT_ACTION;
/* endpoint statistics */
-typedef struct _HTC_ENDPOINT_STATS {
- A_UINT32 TxCreditLowIndications; /* number of times the host set the credit-low flag in a send message on
+struct htc_endpoint_stats {
+ u32 TxCreditLowIndications; /* number of times the host set the credit-low flag in a send message on
this endpoint */
- A_UINT32 TxIssued; /* running count of total TX packets issued */
- A_UINT32 TxPacketsBundled; /* running count of TX packets that were issued in bundles */
- A_UINT32 TxBundles; /* running count of TX bundles that were issued */
- A_UINT32 TxDropped; /* tx packets that were dropped */
- A_UINT32 TxCreditRpts; /* running count of total credit reports received for this endpoint */
- A_UINT32 TxCreditRptsFromRx; /* credit reports received from this endpoint's RX packets */
- A_UINT32 TxCreditRptsFromOther; /* credit reports received from RX packets of other endpoints */
- A_UINT32 TxCreditRptsFromEp0; /* credit reports received from endpoint 0 RX packets */
- A_UINT32 TxCreditsFromRx; /* count of credits received via Rx packets on this endpoint */
- A_UINT32 TxCreditsFromOther; /* count of credits received via another endpoint */
- A_UINT32 TxCreditsFromEp0; /* count of credits received via another endpoint */
- A_UINT32 TxCreditsConsummed; /* count of consummed credits */
- A_UINT32 TxCreditsReturned; /* count of credits returned */
- A_UINT32 RxReceived; /* count of RX packets received */
- A_UINT32 RxLookAheads; /* count of lookahead records
+ u32 TxIssued; /* running count of total TX packets issued */
+ u32 TxPacketsBundled; /* running count of TX packets that were issued in bundles */
+ u32 TxBundles; /* running count of TX bundles that were issued */
+ u32 TxDropped; /* tx packets that were dropped */
+ u32 TxCreditRpts; /* running count of total credit reports received for this endpoint */
+ u32 TxCreditRptsFromRx; /* credit reports received from this endpoint's RX packets */
+ u32 TxCreditRptsFromOther; /* credit reports received from RX packets of other endpoints */
+ u32 TxCreditRptsFromEp0; /* credit reports received from endpoint 0 RX packets */
+ u32 TxCreditsFromRx; /* count of credits received via Rx packets on this endpoint */
+ u32 TxCreditsFromOther; /* count of credits received via another endpoint */
+ u32 TxCreditsFromEp0; /* count of credits received via another endpoint */
+ u32 TxCreditsConsummed; /* count of consummed credits */
+ u32 TxCreditsReturned; /* count of credits returned */
+ u32 RxReceived; /* count of RX packets received */
+ u32 RxLookAheads; /* count of lookahead records
found in messages received on this endpoint */
- A_UINT32 RxPacketsBundled; /* count of recv packets received in a bundle */
- A_UINT32 RxBundleLookAheads; /* count of number of bundled lookaheads */
- A_UINT32 RxBundleIndFromHdr; /* count of the number of bundle indications from the HTC header */
- A_UINT32 RxAllocThreshHit; /* count of the number of times the recv allocation threshhold was hit */
- A_UINT32 RxAllocThreshBytes; /* total number of bytes */
-} HTC_ENDPOINT_STATS;
+ u32 RxPacketsBundled; /* count of recv packets received in a bundle */
+ u32 RxBundleLookAheads; /* count of number of bundled lookaheads */
+ u32 RxBundleIndFromHdr; /* count of the number of bundle indications from the HTC header */
+ u32 RxAllocThreshHit; /* count of the number of times the recv allocation threshhold was hit */
+ u32 RxAllocThreshBytes; /* total number of bytes */
+};
/* ------ Function Prototypes ------ */
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -269,7 +269,7 @@ typedef struct _HTC_ENDPOINT_STATS {
@example:
@see also: HTCDestroy
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-HTC_HANDLE HTCCreate(void *HifDevice, HTC_INIT_INFO *pInfo);
+HTC_HANDLE HTCCreate(void *HifDevice, struct htc_init_info *pInfo);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Get the underlying HIF device handle
@function name: HTCGetHifDevice
@@ -319,7 +319,7 @@ void HTCSetCreditDistribution(HTC_HANDLE HTCHandle,
@example:
@see also: HTCConnectService
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle);
+int HTCWaitTarget(HTC_HANDLE HTCHandle);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Start target service communications
@function name: HTCStart
@@ -334,21 +334,21 @@ A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle);
@example:
@see also: HTCConnectService
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_STATUS HTCStart(HTC_HANDLE HTCHandle);
+int HTCStart(HTC_HANDLE HTCHandle);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Add receive packet to HTC
@function name: HTCAddReceivePkt
@input: HTCHandle - HTC handle
pPacket - HTC receive packet to add
@output:
- @return: A_OK on success
+ @return: 0 on success
@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.
@example:
@see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_STATUS HTCAddReceivePkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
+int HTCAddReceivePkt(HTC_HANDLE HTCHandle, struct htc_packet *pPacket);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Connect to an HTC service
@function name: HTCConnectService
@@ -361,23 +361,23 @@ A_STATUS HTCAddReceivePkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
@example:
@see also: HTCStart
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_STATUS HTCConnectService(HTC_HANDLE HTCHandle,
- HTC_SERVICE_CONNECT_REQ *pReq,
- HTC_SERVICE_CONNECT_RESP *pResp);
+int HTCConnectService(HTC_HANDLE HTCHandle,
+ struct htc_service_connect_req *pReq,
+ struct htc_service_connect_resp *pResp);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Send an HTC packet
@function name: HTCSendPkt
@input: HTCHandle - HTC handle
pPacket - packet to send
@output:
- @return: A_OK
+ @return: 0
@notes: Caller must initialize packet using SET_HTC_PACKET_INFO_TX() macro.
This interface is fully asynchronous. On error, HTC SendPkt will
call the registered Endpoint callback to cleanup the packet.
@example:
@see also: HTCFlushEndpoint
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_STATUS HTCSendPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
+int HTCSendPkt(HTC_HANDLE HTCHandle, struct htc_packet *pPacket);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Stop HTC service communications
@function name: HTCStop
@@ -431,7 +431,7 @@ void HTCDumpCreditStates(HTC_HANDLE HTCHandle);
@function name: HTCIndicateActivityChange
@input: HTCHandle - HTC handle
Endpoint - endpoint in which activity has changed
- Active - TRUE if active, FALSE if it has become inactive
+ Active - true if active, false if it has become inactive
@output:
@return:
@notes: This triggers the registered credit distribution function to
@@ -441,7 +441,7 @@ void HTCDumpCreditStates(HTC_HANDLE HTCHandle);
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
void HTCIndicateActivityChange(HTC_HANDLE HTCHandle,
HTC_ENDPOINT_ID Endpoint,
- A_BOOL Active);
+ bool Active);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Get endpoint statistics
@@ -452,9 +452,9 @@ void HTCIndicateActivityChange(HTC_HANDLE HTCHandle,
@output:
pStats - statistics that were sampled (can be NULL if Action is HTC_EP_STAT_CLEAR)
- @return: TRUE if statistics profiling is enabled, otherwise FALSE.
+ @return: true if statistics profiling is enabled, otherwise false.
- @notes: Statistics is a compile-time option and this function may return FALSE
+ @notes: Statistics is a compile-time option and this function may return false
if HTC is not compiled with profiling.
The caller can specify the statistic "action" to take when sampling
@@ -469,10 +469,10 @@ void HTCIndicateActivityChange(HTC_HANDLE HTCHandle,
@example:
@see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_BOOL HTCGetEndpointStatistics(HTC_HANDLE HTCHandle,
+bool HTCGetEndpointStatistics(HTC_HANDLE HTCHandle,
HTC_ENDPOINT_ID Endpoint,
HTC_ENDPOINT_STAT_ACTION Action,
- HTC_ENDPOINT_STATS *pStats);
+ struct htc_endpoint_stats *pStats);
/*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@desc: Unblock HTC message reception
@@ -499,10 +499,10 @@ void HTCUnblockRecv(HTC_HANDLE HTCHandle);
@input: HTCHandle - HTC handle
pPktQueue - local queue holding packets to send
@output:
- @return: A_OK
+ @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.
@@ -511,7 +511,7 @@ void HTCUnblockRecv(HTC_HANDLE HTCHandle);
@example:
@see also: HTCFlushEndpoint
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_STATUS 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
@@ -519,18 +519,18 @@ A_STATUS HTCSendPktsMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueu
@input: HTCHandle - HTC handle
pPktQueue - HTC receive packet queue holding packets to add
@output:
- @return: A_OK on success
+ @return: 0 on success
@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:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_STATUS 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
@@ -538,12 +538,12 @@ A_STATUS HTCAddReceivePktMultiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPk
@input: HTCHandle - HTC handle
Endpoint - endpoint to check for active state
@output:
- @return: returns TRUE if Endpoint is Active
+ @return: returns true if Endpoint is Active
@notes:
@example:
@see also:
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_BOOL HTCIsEndpointActive(HTC_HANDLE HTCHandle,
+bool HTCIsEndpointActive(HTC_HANDLE HTCHandle,
HTC_ENDPOINT_ID Endpoint);
@@ -564,9 +564,9 @@ int HTCGetNumRecvBuffers(HTC_HANDLE HTCHandle,
/* internally used functions for testing... */
void HTCEnableRecv(HTC_HANDLE HTCHandle);
void HTCDisableRecv(HTC_HANDLE HTCHandle);
-A_STATUS HTCWaitForPendingRecv(HTC_HANDLE HTCHandle,
- A_UINT32 TimeoutInMs,
- A_BOOL *pbIsRecvPending);
+int HTCWaitForPendingRecv(HTC_HANDLE HTCHandle,
+ u32 TimeoutInMs,
+ bool *pbIsRecvPending);
#ifdef __cplusplus
}
OpenPOWER on IntegriCloud