Browse Source

qcacmn: Clean up header files for HTC

Remove the header files which are not in common project so that HTC
layer can be converged.

Change-Id: Iaf5869e1d739cc80dcc5b89a446f499527350e38
CRs-fixed: 982024
Yue Ma 9 years ago
parent
commit
b16cf3028e
7 changed files with 154 additions and 151 deletions
  1. 22 21
      htc/htc.c
  2. 41 42
      htc/htc_api.h
  3. 23 23
      htc/htc_internal.h
  4. 11 11
      htc/htc_packet.h
  5. 23 22
      htc/htc_recv.c
  6. 22 21
      htc/htc_send.c
  7. 12 11
      htc/htc_services.c

+ 22 - 21
htc/htc.c

@@ -27,9 +27,9 @@
 
 #include "htc_debug.h"
 #include "htc_internal.h"
+#include <hif.h>
 #include <qdf_nbuf.h>           /* qdf_nbuf_t */
 #include <qdf_types.h>          /* qdf_print */
-#include <hif.h>
 
 #ifdef DEBUG
 static ATH_DEBUG_MASK_DESCRIPTION g_htc_debug_description[] = {
@@ -77,9 +77,9 @@ static HTC_PACKET *build_htc_tx_ctrl_packet(qdf_device_t osdev)
 		if (NULL == pPacket) {
 			break;
 		}
-		A_MEMZERO(pPacket, sizeof(HTC_PACKET));
-		netbuf = qdf_nbuf_alloc(osdev,
-				HTC_CONTROL_BUFFER_SIZE, 20, 4, true);
+		qdf_mem_zero(pPacket, sizeof(HTC_PACKET));
+		netbuf = qdf_nbuf_alloc(osdev, HTC_CONTROL_BUFFER_SIZE,
+					20, 4, true);
 		if (NULL == netbuf) {
 			qdf_mem_free(pPacket);
 			pPacket = NULL;
@@ -258,7 +258,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev,
 		return NULL;
 	}
 
-	A_MEMZERO(target, sizeof(HTC_TARGET));
+	qdf_mem_zero(target, sizeof(HTC_TARGET));
 
 	htc_runtime_pm_init(target);
 	qdf_spinlock_create(&target->HTCLock);
@@ -267,7 +267,8 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev,
 	qdf_spinlock_create(&target->HTCCreditLock);
 
 	do {
-		A_MEMCPY(&target->HTCInitInfo, pInfo, sizeof(HTC_INIT_INFO));
+		qdf_mem_copy(&target->HTCInitInfo, pInfo,
+			     sizeof(HTC_INIT_INFO));
 		target->host_handle = pInfo->pContext;
 		target->osdev = osdev;
 		target->con_mode = con_mode;
@@ -280,7 +281,7 @@ HTC_HANDLE htc_create(void *ol_sc, HTC_INIT_INFO *pInfo, qdf_device_t osdev,
 			HTC_PACKET *pPacket =
 				(HTC_PACKET *) qdf_mem_malloc(sizeof(HTC_PACKET));
 			if (pPacket != NULL) {
-				A_MEMZERO(pPacket, sizeof(HTC_PACKET));
+				qdf_mem_zero(pPacket, sizeof(HTC_PACKET));
 				free_htc_packet_container(target, pPacket);
 			}
 		}
@@ -434,9 +435,9 @@ A_STATUS htc_setup_target_buffer_assignments(HTC_TARGET *target)
 	return status;
 }
 
-A_UINT8 htc_get_credit_allocation(HTC_TARGET *target, A_UINT16 service_id)
+uint8_t htc_get_credit_allocation(HTC_TARGET *target, uint16_t service_id)
 {
-	A_UINT8 allocation = 0;
+	uint8_t allocation = 0;
 	int i;
 
 	for (i = 0; i < HTC_MAX_SERVICE_ALLOC_ENTRIES; i++) {
@@ -463,7 +464,7 @@ A_STATUS htc_wait_target(HTC_HANDLE HTCHandle)
 	HTC_SERVICE_CONNECT_REQ connect;
 	HTC_SERVICE_CONNECT_RESP resp;
 	HTC_READY_MSG *rdy_msg;
-	A_UINT16 htc_rdy_msg_id;
+	uint16_t htc_rdy_msg_id;
 
 	AR_DEBUG_PRINTF(ATH_DEBUG_TRC,
 			("htc_wait_target - Enter (target:0x%p) \n", HTCHandle));
@@ -509,7 +510,7 @@ A_STATUS htc_wait_target(HTC_HANDLE HTCHandle)
 		target->TargetCreditSize =
 			(int)HTC_GET_FIELD(rdy_msg, HTC_READY_MSG, CREDITSIZE);
 		target->MaxMsgsPerHTCBundle =
-			(A_UINT8) pReadyMsg->MaxMsgsPerHTCBundle;
+			(uint8_t) pReadyMsg->MaxMsgsPerHTCBundle;
 		/* for old fw this value is set to 0. But the minimum value should be 1,
 		 * i.e., no bundling */
 		if (target->MaxMsgsPerHTCBundle < 1)
@@ -532,8 +533,8 @@ A_STATUS htc_wait_target(HTC_HANDLE HTCHandle)
 		htc_setup_target_buffer_assignments(target);
 
 		/* setup our pseudo HTC control endpoint connection */
-		A_MEMZERO(&connect, sizeof(connect));
-		A_MEMZERO(&resp, sizeof(resp));
+		qdf_mem_zero(&connect, sizeof(connect));
+		qdf_mem_zero(&resp, sizeof(resp));
 		connect.EpCallbacks.pContext = target;
 		connect.EpCallbacks.EpTxComplete = htc_control_tx_complete;
 		connect.EpCallbacks.EpRecv = htc_control_rx_complete;
@@ -573,7 +574,7 @@ static void reset_endpoint_states(HTC_TARGET *target)
 		INIT_HTC_PACKET_QUEUE(&pEndpoint->TxLookupQueue);
 		INIT_HTC_PACKET_QUEUE(&pEndpoint->RxBufferHoldQueue);
 		pEndpoint->target = target;
-		pEndpoint->TxCreditFlowEnabled = (A_BOOL)htc_credit_flow;
+		pEndpoint->TxCreditFlowEnabled = (bool)htc_credit_flow;
 		qdf_atomic_init(&pEndpoint->TxProcessCount);
 	}
 }
@@ -608,7 +609,7 @@ A_STATUS htc_start(HTC_HANDLE HTCHandle)
 		qdf_nbuf_put_tail(netbuf, sizeof(HTC_SETUP_COMPLETE_EX_MSG));
 		pSetupComp =
 			(HTC_SETUP_COMPLETE_EX_MSG *) qdf_nbuf_data(netbuf);
-		A_MEMZERO(pSetupComp, sizeof(HTC_SETUP_COMPLETE_EX_MSG));
+		qdf_mem_zero(pSetupComp, sizeof(HTC_SETUP_COMPLETE_EX_MSG));
 
 		HTC_SET_FIELD(pSetupComp, HTC_SETUP_COMPLETE_EX_MSG,
 			      MESSAGEID, HTC_MSG_SETUP_COMPLETE_EX_ID);
@@ -633,7 +634,7 @@ A_STATUS htc_start(HTC_HANDLE HTCHandle)
 
 		SET_HTC_PACKET_INFO_TX(pSendPacket,
 				       NULL,
-				       (A_UINT8 *) pSetupComp,
+				       (uint8_t *) pSetupComp,
 				       sizeof(HTC_SETUP_COMPLETE_EX_MSG),
 				       ENDPOINT_0, HTC_SERVICE_TX_PACKET_TAG);
 
@@ -760,15 +761,15 @@ void htc_dump_credit_states(HTC_HANDLE HTCHandle)
 	}
 }
 
-A_BOOL htc_get_endpoint_statistics(HTC_HANDLE HTCHandle,
+bool htc_get_endpoint_statistics(HTC_HANDLE HTCHandle,
 				   HTC_ENDPOINT_ID Endpoint,
 				   HTC_ENDPOINT_STAT_ACTION Action,
 				   HTC_ENDPOINT_STATS *pStats)
 {
 #ifdef HTC_EP_STAT_PROFILING
 	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
-	A_BOOL clearStats = false;
-	A_BOOL sample = false;
+	bool clearStats = false;
+	bool sample = false;
 
 	switch (Action) {
 	case HTC_EP_STAT_SAMPLE:
@@ -794,13 +795,13 @@ A_BOOL htc_get_endpoint_statistics(HTC_HANDLE HTCHandle,
 	if (sample) {
 		A_ASSERT(pStats != NULL);
 		/* return the stats to the caller */
-		A_MEMCPY(pStats, &target->endpoint[Endpoint].endpoint_stats,
+		qdf_mem_copy(pStats, &target->endpoint[Endpoint].endpoint_stats,
 			 sizeof(HTC_ENDPOINT_STATS));
 	}
 
 	if (clearStats) {
 		/* reset stats */
-		A_MEMZERO(&target->endpoint[Endpoint].endpoint_stats,
+		qdf_mem_zero(&target->endpoint[Endpoint].endpoint_stats,
 			  sizeof(HTC_ENDPOINT_STATS));
 	}
 

+ 41 - 42
htc/htc_api.h

@@ -28,11 +28,10 @@
 #ifndef _HTC_API_H_
 #define _HTC_API_H_
 
-#include "osapi_linux.h"
-#include "htc_packet.h"
 #include <htc.h>
 #include <htc_services.h>
 #include <qdf_types.h>          /* qdf_device_t */
+#include "htc_packet.h"
 
 #ifdef __cplusplus
 extern "C" {
@@ -48,7 +47,7 @@ extern "C" {
 
 typedef void *HTC_HANDLE;
 
-typedef A_UINT16 HTC_SERVICE_ID;
+typedef uint16_t HTC_SERVICE_ID;
 
 typedef void (*HTC_TARGET_FAILURE)(void *Instance, QDF_STATUS Status);
 
@@ -167,12 +166,12 @@ typedef struct _HTC_EP_CALLBACKS {
 /* service connection information */
 typedef struct _HTC_SERVICE_CONNECT_REQ {
 	HTC_SERVICE_ID service_id;               /* 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 */
+	uint16_t ConnectionFlags;               /* connection flags, see htc protocol definition */
+	uint8_t *pMetaData;             /* ptr to optional service-specific meta-data */
+	uint8_t MetaDataLength;         /* optional meta data length */
 	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 */
+	uint32_t LocalConnectionFlags;          /* HTC flags for the host-side (local) connection */
 	unsigned int MaxSendMsgSize;            /* override max message size in send direction */
 } HTC_SERVICE_CONNECT_REQ;
 
@@ -180,12 +179,12 @@ typedef struct _HTC_SERVICE_CONNECT_REQ {
 
 /* 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 */
+	uint8_t *pMetaData;             /* caller supplied buffer to optional meta-data */
+	uint8_t BufferLength;           /* length of caller supplied buffer */
+	uint8_t 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 */
+	uint8_t ConnectRespCode;                /* connect response code from target */
 } HTC_SERVICE_CONNECT_RESP;
 
 /* endpoint distribution structure */
@@ -194,7 +193,7 @@ typedef struct _HTC_ENDPOINT_CREDIT_DIST {
 	struct _HTC_ENDPOINT_CREDIT_DIST *pPrev;
 	HTC_SERVICE_ID service_id;               /* 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
+	uint32_t 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
@@ -223,7 +222,7 @@ typedef struct _HTC_ENDPOINT_CREDIT_DIST {
 					*/
 } HTC_ENDPOINT_CREDIT_DIST;
 
-#define HTC_EP_ACTIVE                            ((A_UINT32) (1u << 31))
+#define HTC_EP_ACTIVE                            ((uint32_t) (1u << 31))
 
 /* macro to check if an endpoint has gone active, useful for credit
  * distributions */
@@ -260,30 +259,30 @@ typedef enum _HTC_ENDPOINT_STAT_ACTION {
 
 /* endpoint statistics */
 typedef struct _HTC_ENDPOINT_STATS {
-	A_UINT32 TxPosted;              /* number of TX packets posted to the endpoint */
-	A_UINT32 TxCreditLowIndications;                /* number of times the host set the credit-low flag in a send message on
+	uint32_t TxPosted;              /* number of TX packets posted to the endpoint */
+	uint32_t 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
+	uint32_t TxIssued;              /* running count of total TX packets issued */
+	uint32_t TxPacketsBundled;              /* running count of TX packets that were issued in bundles */
+	uint32_t TxBundles;             /* running count of TX bundles that were issued */
+	uint32_t TxDropped;             /* tx packets that were dropped */
+	uint32_t TxCreditRpts;          /* running count of total credit reports received for this endpoint */
+	uint32_t TxCreditRptsFromRx;            /* credit reports received from this endpoint's RX packets */
+	uint32_t TxCreditRptsFromOther;         /* credit reports received from RX packets of other endpoints */
+	uint32_t TxCreditRptsFromEp0;           /* credit reports received from endpoint 0 RX packets */
+	uint32_t TxCreditsFromRx;               /* count of credits received via Rx packets on this endpoint */
+	uint32_t TxCreditsFromOther;            /* count of credits received via another endpoint */
+	uint32_t TxCreditsFromEp0;              /* count of credits received via another endpoint */
+	uint32_t TxCreditsConsummed;            /* count of consummed credits */
+	uint32_t TxCreditsReturned;             /* count of credits returned */
+	uint32_t RxReceived;            /* count of RX packets received */
+	uint32_t 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 */
+	uint32_t RxPacketsBundled;              /* count of recv packets received in a bundle */
+	uint32_t RxBundleLookAheads;            /* count of number of bundled lookaheads */
+	uint32_t RxBundleIndFromHdr;            /* count of the number of bundle indications from the HTC header */
+	uint32_t RxAllocThreshHit;              /* count of the number of times the recv allocation threshhold was hit */
+	uint32_t RxAllocThreshBytes;            /* total number of bytes */
 } HTC_ENDPOINT_STATS;
 
 /* ------ Function Prototypes ------ */
@@ -448,7 +447,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf,
 			   int Epid, int ActualLength);
 #else                           /*ATH_11AC_TXCOMPACT */
 A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
-			   A_UINT8 more_data);
+			   uint8_t more_data);
 #endif /*ATH_11AC_TXCOMPACT */
 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    @desc: Flush HTC when target is removed surprisely service communications
@@ -525,7 +524,7 @@ void htc_dump_credit_states(HTC_HANDLE HTCHandle);
    @see also:
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
 void htc_indicate_activity_change(HTC_HANDLE HTCHandle,
-				  HTC_ENDPOINT_ID Endpoint, A_BOOL Active);
+				  HTC_ENDPOINT_ID Endpoint, bool Active);
 
 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    @desc: Get endpoint statistics
@@ -555,7 +554,7 @@ void htc_indicate_activity_change(HTC_HANDLE HTCHandle,
    @example:
    @see also:
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_BOOL htc_get_endpoint_statistics(HTC_HANDLE HTCHandle,
+bool htc_get_endpoint_statistics(HTC_HANDLE HTCHandle,
 				   HTC_ENDPOINT_ID Endpoint,
 				   HTC_ENDPOINT_STAT_ACTION Action,
 				   HTC_ENDPOINT_STATS *pStats);
@@ -632,7 +631,7 @@ A_STATUS htc_add_receive_pkt_multiple(HTC_HANDLE HTCHandle,
    @example:
    @see also:
  +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
-A_BOOL htc_is_endpoint_active(HTC_HANDLE HTCHandle,
+bool htc_is_endpoint_active(HTC_HANDLE HTCHandle,
 			      HTC_ENDPOINT_ID Endpoint);
 
 /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -667,8 +666,8 @@ void htc_set_target_failure_callback(HTC_HANDLE HTCHandle,
 void htc_enable_recv(HTC_HANDLE HTCHandle);
 void htc_disable_recv(HTC_HANDLE HTCHandle);
 A_STATUS HTCWaitForPendingRecv(HTC_HANDLE HTCHandle,
-			       A_UINT32 TimeoutInMs,
-			       A_BOOL *pbIsRecvPending);
+			       uint32_t TimeoutInMs,
+			       bool *pbIsRecvPending);
 
 /* function to fetch stats from htc layer*/
 struct ol_ath_htc_stats *ieee80211_ioctl_get_htc_stats(HTC_HANDLE
@@ -693,7 +692,7 @@ do {									\
 			SM((_download_len), HTC_FRAME_HDR_PAYLOADLEN) |	\
 			SM((_ep_id), HTC_FRAME_HDR_ENDPOINTID));	\
 									\
-		HTC_WRITE32((A_UINT32 *)(_htc_tx_desc) + 1,		\
+		HTC_WRITE32((uint32_t *)(_htc_tx_desc) + 1,		\
 				SM((_seq_no), HTC_FRAME_HDR_CONTROLBYTES1));\
 } while (0)
 #endif /* WLAN_FEATURE_FASTPATH */

+ 23 - 23
htc/htc_internal.h

@@ -32,16 +32,16 @@
 extern "C" {
 #endif /* __cplusplus */
 
-#include <qdf_nbuf.h>
-#include <qdf_types.h>
-#include <qdf_lock.h>
-#include <qdf_timer.h>
-#include <qdf_atomic.h>
-#include <qdf_event.h>
-#include "hif.h"
-#include <htc.h>
 #include "htc_api.h"
 #include "htc_packet.h"
+#include <hif.h>
+#include <htc.h>
+#include <qdf_atomic.h>
+#include <qdf_event.h>
+#include <qdf_lock.h>
+#include <qdf_nbuf.h>
+#include <qdf_timer.h>
+#include <qdf_types.h>
 
 /* HTC operational parameters */
 #define HTC_TARGET_RESPONSE_TIMEOUT         2000        /* in ms */
@@ -120,7 +120,7 @@ typedef struct _HTC_ENDPOINT {
 
 	HTC_PACKET_QUEUE TxLookupQueue;         /* lookup queue to match netbufs to htc packets */
 	HTC_PACKET_QUEUE RxBufferHoldQueue;             /* temporary hold queue for back compatibility */
-	A_UINT8 SeqNo;          /* TX seq no (helpful) for debugging */
+	uint8_t SeqNo;          /* TX seq no (helpful) for debugging */
 	qdf_atomic_t TxProcessCount;            /* serialization */
 	struct _HTC_TARGET *target;
 	int TxCredits;          /* TX credits available on this endpoint */
@@ -129,7 +129,7 @@ typedef struct _HTC_ENDPOINT {
 #ifdef HTC_EP_STAT_PROFILING
 	HTC_ENDPOINT_STATS endpoint_stats;     /* endpoint statistics */
 #endif
-	A_BOOL TxCreditFlowEnabled;
+	bool TxCreditFlowEnabled;
 } HTC_ENDPOINT;
 
 #ifdef HTC_EP_STAT_PROFILING
@@ -139,8 +139,8 @@ typedef struct _HTC_ENDPOINT {
 #endif
 
 typedef struct {
-	A_UINT16 service_id;
-	A_UINT8 CreditAllocation;
+	uint16_t service_id;
+	uint8_t CreditAllocation;
 } HTC_SERVICE_TX_CREDIT_ALLOCATION;
 
 #define HTC_MAX_SERVICE_ALLOC_ENTRIES 8
@@ -159,31 +159,31 @@ typedef struct _HTC_TARGET {
 	qdf_spinlock_t HTCRxLock;
 	qdf_spinlock_t HTCTxLock;
 	qdf_spinlock_t HTCCreditLock;
-	A_UINT32 HTCStateFlags;
+	uint32_t HTCStateFlags;
 	void *host_handle;
 	HTC_INIT_INFO HTCInitInfo;
 	HTC_PACKET *pHTCPacketStructPool;               /* pool of HTC packets */
 	HTC_PACKET_QUEUE ControlBufferTXFreeList;
-	A_UINT8 CtrlResponseBuffer[HTC_MAX_CONTROL_MESSAGE_LENGTH];
+	uint8_t CtrlResponseBuffer[HTC_MAX_CONTROL_MESSAGE_LENGTH];
 	int CtrlResponseLength;
 	qdf_event_t ctrl_response_valid;
-	A_BOOL CtrlResponseProcessing;
+	bool CtrlResponseProcessing;
 	int TotalTransmitCredits;
 	HTC_SERVICE_TX_CREDIT_ALLOCATION
 		ServiceTxAllocTable[HTC_MAX_SERVICE_ALLOC_ENTRIES];
 	int TargetCreditSize;
 #ifdef RX_SG_SUPPORT
 	qdf_nbuf_queue_t RxSgQueue;
-	A_BOOL IsRxSgInprogress;
-	A_UINT32 CurRxSgTotalLen;               /* current total length */
-	A_UINT32 ExpRxSgTotalLen;               /* expected total length */
+	bool IsRxSgInprogress;
+	uint32_t CurRxSgTotalLen;               /* current total length */
+	uint32_t ExpRxSgTotalLen;               /* expected total length */
 #endif
 	qdf_device_t osdev;
 	struct ol_ath_htc_stats htc_pkt_stats;
 	HTC_PACKET *pBundleFreeList;
-	A_UINT32 ce_send_cnt;
-	A_UINT32 TX_comp_cnt;
-	A_UINT8 MaxMsgsPerHTCBundle;
+	uint32_t ce_send_cnt;
+	uint32_t TX_comp_cnt;
+	uint8_t MaxMsgsPerHTCBundle;
 	qdf_work_t queue_kicker;
 	uint32_t con_mode;
 } HTC_TARGET;
@@ -245,8 +245,8 @@ void htc_recv_init(HTC_TARGET *target);
 A_STATUS htc_wait_recv_ctrl_message(HTC_TARGET *target);
 void htc_free_control_tx_packet(HTC_TARGET *target, HTC_PACKET *pPacket);
 HTC_PACKET *htc_alloc_control_tx_packet(HTC_TARGET *target);
-A_UINT8 htc_get_credit_allocation(HTC_TARGET *target, A_UINT16 service_id);
-void htc_tx_resource_avail_handler(void *context, A_UINT8 pipeID);
+uint8_t htc_get_credit_allocation(HTC_TARGET *target, uint16_t service_id);
+void htc_tx_resource_avail_handler(void *context, uint8_t pipeID);
 void htc_control_rx_complete(void *Context, HTC_PACKET *pPacket);
 void htc_process_credit_rpt(HTC_TARGET *target,
 			    HTC_CREDIT_REPORT *pRpt,

+ 11 - 11
htc/htc_packet.h

@@ -50,14 +50,14 @@ struct _HTC_PACKET;
 
 typedef void (*HTC_PACKET_COMPLETION)(void *, struct _HTC_PACKET *);
 
-typedef A_UINT16 HTC_TX_TAG;
+typedef uint16_t HTC_TX_TAG;
 
 typedef struct _HTC_TX_PACKET_INFO {
 	HTC_TX_TAG Tag;         /* tag used to selective flush packets */
 	int CreditsUsed;        /* number of credits used for this TX packet (HTC internal) */
-	A_UINT8 SendFlags;      /* send flags (HTC internal) */
+	uint8_t SendFlags;      /* send flags (HTC internal) */
 	int SeqNo;              /* internal seq no for debugging (HTC internal) */
-	A_UINT32 Flags;         /* internal use */
+	uint32_t Flags;         /* internal use */
 } HTC_TX_PACKET_INFO;
 
 /**
@@ -81,9 +81,9 @@ typedef struct _HTC_TX_PACKET_INFO {
 #define HTC_TX_PACKET_FLAG_FIXUP_NETBUF (1 << 0)
 
 typedef struct _HTC_RX_PACKET_INFO {
-	A_UINT32 ExpectedHdr;   /* HTC internal use */
-	A_UINT32 HTCRxFlags;    /* HTC internal use */
-	A_UINT32 IndicationFlags;       /* indication flags set on each RX packet indication */
+	uint32_t ExpectedHdr;   /* HTC internal use */
+	uint32_t HTCRxFlags;    /* HTC internal use */
+	uint32_t IndicationFlags;       /* indication flags set on each RX packet indication */
 } HTC_RX_PACKET_INFO;
 
 #define HTC_RX_FLAGS_INDICATE_MORE_PKTS  (1 << 0)       /* more packets on this endpoint are being fetched */
@@ -93,7 +93,7 @@ typedef struct _HTC_PACKET {
 	DL_LIST ListLink;       /* double link */
 	void *pPktContext;      /* caller's per packet specific context */
 
-	A_UINT8 *pBufferStart;  /* the true buffer start , the caller can
+	uint8_t *pBufferStart;  /* the true buffer start , the caller can
 				store the real buffer start here.  In
 				receive callbacks, the HTC layer sets pBuffer
 				to the start of the payload past the header. This
@@ -106,9 +106,9 @@ typedef struct _HTC_PACKET {
 	 * points to the start of the HTC header but when returned
 	 * to the caller points to the start of the payload
 	 */
-	A_UINT8 *pBuffer;       /* payload start (RX/TX) */
-	A_UINT32 BufferLength;  /* length of buffer */
-	A_UINT32 ActualLength;  /* actual length of payload */
+	uint8_t *pBuffer;       /* payload start (RX/TX) */
+	uint32_t BufferLength;  /* length of buffer */
+	uint32_t ActualLength;  /* actual length of payload */
 	HTC_ENDPOINT_ID Endpoint;       /* endpoint that this packet was sent/recv'd from */
 	A_STATUS Status;        /* completion status */
 	union {
@@ -117,7 +117,7 @@ typedef struct _HTC_PACKET {
 	} PktInfo;
 
 	/* the following fields are for internal HTC use */
-	A_UINT32 netbufOrigHeadRoom;
+	uint32_t netbufOrigHeadRoom;
 	HTC_PACKET_COMPLETION Completion;       /* completion */
 	void *pContext;         /* HTC private completion context */
 	void *pNetBufContext;   /* optimization for network-oriented data, the HTC packet

+ 23 - 22
htc/htc_recv.c

@@ -33,12 +33,12 @@
 #define HTC_CONTROL_RX_TIMEOUT     3000
 
 #ifdef DEBUG
-void debug_dump_bytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription)
+void debug_dump_bytes(uint8_t *buffer, uint16_t length, char *pDescription)
 {
-	A_CHAR stream[60];
-	A_CHAR byteOffsetStr[10];
-	A_UINT32 i;
-	A_UINT16 offset, count, byteOffset;
+	int8_t stream[60];
+	int8_t byteOffsetStr[10];
+	uint32_t i;
+	uint16_t offset, count, byteOffset;
 
 	A_PRINTF("<---------Dumping %d Bytes : %s ------>\n", length,
 		 pDescription);
@@ -58,7 +58,7 @@ void debug_dump_bytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription)
 			A_SNPRINTF(byteOffsetStr, sizeof(byteOffset), "%4.4X",
 				   byteOffset);
 			A_PRINTF("[%s]: %s\n", byteOffsetStr, stream);
-			A_MEMZERO(stream, 60);
+			qdf_mem_zero(stream, 60);
 			byteOffset += 16;
 		}
 	}
@@ -72,13 +72,13 @@ void debug_dump_bytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription)
 	A_PRINTF("<------------------------------------------------->\n");
 }
 #else
-void debug_dump_bytes(A_UCHAR *buffer, A_UINT16 length, char *pDescription)
+void debug_dump_bytes(uint8_t *buffer, uint16_t length, char *pDescription)
 {
 }
 #endif
 
 static A_STATUS htc_process_trailer(HTC_TARGET *target,
-				    A_UINT8 *pBuffer,
+				    uint8_t *pBuffer,
 				    int Length, HTC_ENDPOINT_ID FromEndpoint);
 
 static void do_recv_completion(HTC_ENDPOINT *pEndpoint,
@@ -268,9 +268,9 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 	uint32_t netlen;
 	HTC_ENDPOINT *pEndpoint;
 	HTC_PACKET *pPacket;
-	A_UINT16 payloadLen;
+	uint16_t payloadLen;
 	uint32_t trailerlen = 0;
-	A_UINT8 htc_ep_id;
+	uint8_t htc_ep_id;
 
 #ifdef RX_SG_SUPPORT
 	LOCK_HTC_RX(target);
@@ -305,7 +305,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 			AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
 					("HTC Rx: invalid EndpointID=%d\n",
 					 htc_ep_id));
-			debug_dump_bytes((A_UINT8 *) HtcHdr,
+			debug_dump_bytes((uint8_t *) HtcHdr,
 					 sizeof(HTC_FRAME_HDR), "BAD HTC Header");
 			status = QDF_STATUS_E_FAILURE;
 			QDF_BUG(0);
@@ -341,7 +341,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 			AR_DEBUG_PRINTF(ATH_DEBUG_ERR,
 					("HTC Rx: insufficient length, got:%d expected =%zu\n",
 					 netlen, payloadLen + HTC_HDR_LENGTH));
-			debug_dump_bytes((A_UINT8 *) HtcHdr,
+			debug_dump_bytes((uint8_t *) HtcHdr,
 					 sizeof(HTC_FRAME_HDR),
 					 "BAD RX packet length");
 			status = QDF_STATUS_E_FAILURE;
@@ -357,7 +357,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 
 		/* if (IS_TX_CREDIT_FLOW_ENABLED(pEndpoint)) { */
 		{
-			A_UINT8 temp;
+			uint8_t temp;
 			A_STATUS temp_status;
 			/* get flags to check for trailer */
 			temp = HTC_GET_FIELD(HtcHdr, HTC_FRAME_HDR, FLAGS);
@@ -378,7 +378,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 				trailerlen = temp;
 				/* process trailer data that follows HDR + application payload */
 				temp_status = htc_process_trailer(target,
-							     ((A_UINT8 *) HtcHdr +
+							     ((uint8_t *) HtcHdr +
 							      HTC_HDR_LENGTH +
 							      payloadLen - temp),
 							     temp, htc_ep_id);
@@ -396,7 +396,7 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 		}
 
 		if (htc_ep_id == ENDPOINT_0) {
-			A_UINT16 message_id;
+			uint16_t message_id;
 			HTC_UNKNOWN_MSG *htc_msg;
 			int wow_nack = 0;
 
@@ -426,8 +426,9 @@ QDF_STATUS htc_rx_completion_handler(void *Context, qdf_nbuf_t netbuf,
 				target->CtrlResponseLength =
 					min((int)netlen,
 					    HTC_MAX_CONTROL_MESSAGE_LENGTH);
-				A_MEMCPY(target->CtrlResponseBuffer, netdata,
-					 target->CtrlResponseLength);
+				qdf_mem_copy(target->CtrlResponseBuffer,
+					     netdata,
+					     target->CtrlResponseLength);
 
 				/* Requester will clear this flag */
 				target->CtrlResponseProcessing = true;
@@ -652,14 +653,14 @@ A_STATUS htc_wait_recv_ctrl_message(HTC_TARGET *target)
 }
 
 static A_STATUS htc_process_trailer(HTC_TARGET *target,
-				    A_UINT8 *pBuffer,
+				    uint8_t *pBuffer,
 				    int Length, HTC_ENDPOINT_ID FromEndpoint)
 {
 	HTC_RECORD_HDR *pRecord;
-	A_UINT8 htc_rec_id;
-	A_UINT8 htc_rec_len;
-	A_UINT8 *pRecordBuf;
-	A_UINT8 *pOrigBuffer;
+	uint8_t htc_rec_id;
+	uint8_t htc_rec_len;
+	uint8_t *pRecordBuf;
+	uint8_t *pOrigBuffer;
 	int origLength;
 	A_STATUS status;
 

+ 22 - 21
htc/htc_send.c

@@ -27,8 +27,9 @@
 
 #include "htc_debug.h"
 #include "htc_internal.h"
+#include <qdf_mem.h>            /* qdf_mem_malloc */
 #include <qdf_nbuf.h>           /* qdf_nbuf_t */
-#include <qdf_mem.h>         /* qdf_mem_malloc */
+
 
 /* #define USB_HIF_SINGLE_PIPE_DATA_SCHED */
 /* #ifdef USB_HIF_SINGLE_PIPE_DATA_SCHED */
@@ -53,7 +54,7 @@ static unsigned ep_debug_mask =
 #endif
 
 /* HTC Control Path Credit History */
-A_UINT32 g_htc_credit_history_idx = 0;
+uint32_t g_htc_credit_history_idx = 0;
 HTC_CREDIT_HISTORY htc_credit_history_buffer[HTC_CREDIT_HISTORY_MAX];
 
 /**
@@ -255,7 +256,7 @@ HTC_PACKET *allocate_htc_bundle_packet(HTC_TARGET *target)
 
 void free_htc_bundle_packet(HTC_TARGET *target, HTC_PACKET *pPacket)
 {
-	A_UINT32 curentHeadRoom;
+	uint32_t curentHeadRoom;
 	qdf_nbuf_t netbuf;
 	HTC_PACKET_QUEUE *pQueueSave;
 
@@ -415,7 +416,7 @@ static void htc_issue_packets_bundle(HTC_TARGET *target,
 							      HTC_FLAGS_SEND_BUNDLE,
 							      HTC_FRAME_HDR_FLAGS)
 			    | SM(pPacket->Endpoint, HTC_FRAME_HDR_ENDPOINTID));
-		HTC_WRITE32((A_UINT32 *) pHtcHdr + 1,
+		HTC_WRITE32((uint32_t *) pHtcHdr + 1,
 			    SM(pPacket->PktInfo.AsTx.SeqNo,
 			       HTC_FRAME_HDR_CONTROLBYTES1) | SM(creditPad,
 								 HTC_FRAME_HDR_RESERVED));
@@ -429,7 +430,7 @@ static void htc_issue_packets_bundle(HTC_TARGET *target,
 			if (frag_len > nbytes) {
 				frag_len = nbytes;
 			}
-			A_MEMCPY(pBundleBuffer, frag_addr, frag_len);
+			qdf_mem_copy(pBundleBuffer, frag_addr, frag_len);
 			nbytes -= frag_len;
 			pBundleBuffer += frag_len;
 		}
@@ -504,7 +505,7 @@ static A_STATUS htc_issue_packets(HTC_TARGET *target,
 								      HTC_FRAME_HDR_FLAGS)
 				    | SM(pPacket->Endpoint,
 					 HTC_FRAME_HDR_ENDPOINTID));
-			HTC_WRITE32(((A_UINT32 *) pHtcHdr) + 1,
+			HTC_WRITE32(((uint32_t *) pHtcHdr) + 1,
 				    SM(pPacket->PktInfo.AsTx.SeqNo,
 				       HTC_FRAME_HDR_CONTROLBYTES1));
 
@@ -663,7 +664,7 @@ void get_htc_send_packets_credit_based(HTC_TARGET *target,
 {
 	int creditsRequired;
 	int remainder;
-	A_UINT8 sendFlags;
+	uint8_t sendFlags;
 	HTC_PACKET *pPacket;
 	unsigned int transferLength;
 	HTC_PACKET_QUEUE *tx_queue;
@@ -1131,14 +1132,14 @@ static HTC_SEND_QUEUE_RESULT htc_try_send(HTC_TARGET *target,
 }
 
 #ifdef USB_HIF_SINGLE_PIPE_DATA_SCHED
-static A_UINT16 htc_send_pkts_sched_check(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID id)
+static uint16_t htc_send_pkts_sched_check(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID id)
 {
 	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
 	HTC_ENDPOINT *pEndpoint;
 	HTC_ENDPOINT_ID eid;
 	HTC_PACKET_QUEUE *pTxQueue;
-	A_UINT16 resources;
-	A_UINT16 acQueueStatus[DATA_EP_SIZE] = { 0, 0, 0, 0 };
+	uint16_t resources;
+	uint16_t acQueueStatus[DATA_EP_SIZE] = { 0, 0, 0, 0 };
 
 	if (id < ENDPOINT_2 || id > ENDPOINT_5) {
 		return 1;
@@ -1277,7 +1278,7 @@ A_STATUS htc_send_pkts_multiple(HTC_HANDLE HTCHandle, HTC_PACKET_QUEUE *pPktQueu
 		pPacket->PktInfo.AsTx.SeqNo = pEndpoint->SeqNo;
 		pEndpoint->SeqNo++;
 
-		HTC_WRITE32(((A_UINT32 *) pHtcHdr) + 1,
+		HTC_WRITE32(((uint32_t *) pHtcHdr) + 1,
 			    SM(pPacket->PktInfo.AsTx.SeqNo,
 			       HTC_FRAME_HDR_CONTROLBYTES1));
 
@@ -1402,7 +1403,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf, int Epid,
 
 	LOCK_HTC_TX(target);
 
-	HTC_WRITE32(((A_UINT32 *) pHtcHdr) + 1,
+	HTC_WRITE32(((uint32_t *) pHtcHdr) + 1,
 		    SM(pEndpoint->SeqNo, HTC_FRAME_HDR_CONTROLBYTES1));
 
 	pEndpoint->SeqNo++;
@@ -1421,7 +1422,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, qdf_nbuf_t netbuf, int Epid,
 #else                           /*ATH_11AC_TXCOMPACT */
 
 A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
-			   A_UINT8 more_data)
+			   uint8_t more_data)
 {
 	HTC_TARGET *target = GET_HTC_TARGET_FROM_HANDLE(HTCHandle);
 	HTC_ENDPOINT *pEndpoint;
@@ -1472,7 +1473,7 @@ A_STATUS htc_send_data_pkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket,
 		pPacket->PktInfo.AsTx.SeqNo = pEndpoint->SeqNo;
 		pEndpoint->SeqNo++;
 
-		HTC_WRITE32(((A_UINT32 *) pHtcHdr) + 1,
+		HTC_WRITE32(((uint32_t *) pHtcHdr) + 1,
 			    SM(pPacket->PktInfo.AsTx.SeqNo,
 			       HTC_FRAME_HDR_CONTROLBYTES1));
 
@@ -1707,9 +1708,9 @@ QDF_STATUS htc_tx_completion_handler(void *Context,
 	HTC_ENDPOINT_ID eid[DATA_EP_SIZE] = { ENDPOINT_5, ENDPOINT_4,
 		ENDPOINT_2, ENDPOINT_3 };
 	int epidIdx;
-	A_UINT16 resourcesThresh[DATA_EP_SIZE]; /* urb resources */
-	A_UINT16 resources;
-	A_UINT16 resourcesMax;
+	uint16_t resourcesThresh[DATA_EP_SIZE]; /* urb resources */
+	uint16_t resources;
+	uint16_t resourcesMax;
 #endif
 
 	pEndpoint = &target->endpoint[EpID];
@@ -1758,7 +1759,7 @@ QDF_STATUS htc_tx_completion_handler(void *Context,
 }
 
 /* callback when TX resources become available */
-void htc_tx_resource_avail_handler(void *context, A_UINT8 pipeID)
+void htc_tx_resource_avail_handler(void *context, uint8_t pipeID)
 {
 	int i;
 	HTC_TARGET *target = (HTC_TARGET *) context;
@@ -1855,12 +1856,12 @@ void htc_flush_endpoint(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint,
 
 /* HTC API to indicate activity to the credit distribution function */
 void htc_indicate_activity_change(HTC_HANDLE HTCHandle,
-				  HTC_ENDPOINT_ID Endpoint, A_BOOL Active)
+				  HTC_ENDPOINT_ID Endpoint, bool Active)
 {
 	/*  TODO */
 }
 
-A_BOOL htc_is_endpoint_active(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint)
+bool htc_is_endpoint_active(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint)
 {
 	return true;
 }
@@ -1872,7 +1873,7 @@ void htc_process_credit_rpt(HTC_TARGET *target, HTC_CREDIT_REPORT *pRpt,
 	int i;
 	HTC_ENDPOINT *pEndpoint;
 	int totalCredits = 0;
-	A_UINT8 rpt_credits, rpt_ep_id;
+	uint8_t rpt_credits, rpt_ep_id;
 
 	AR_DEBUG_PRINTF(ATH_DEBUG_SEND,
 			("+htc_process_credit_rpt, Credit Report Entries:%d \n",

+ 12 - 11
htc/htc_services.c

@@ -27,8 +27,8 @@
 
 #include "htc_debug.h"
 #include "htc_internal.h"
+#include <hif.h>
 #include <qdf_nbuf.h>           /* qdf_nbuf_t */
-#include "hif.h"
 
 /* use credit flow control over HTC */
 unsigned int htc_credit_flow = 1;
@@ -49,12 +49,12 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
 	HTC_ENDPOINT *pEndpoint;
 	unsigned int maxMsgSize = 0;
 	qdf_nbuf_t netbuf;
-	A_UINT8 txAlloc;
+	uint8_t txAlloc;
 	int length;
-	A_BOOL disableCreditFlowCtrl = false;
-	A_UINT16 conn_flags;
-	A_UINT16 rsp_msg_id, rsp_msg_serv_id, rsp_msg_max_msg_size;
-	A_UINT8 rsp_msg_status, rsp_msg_end_id, rsp_msg_serv_meta_len;
+	bool disableCreditFlowCtrl = false;
+	uint16_t conn_flags;
+	uint16_t rsp_msg_id, rsp_msg_serv_id, rsp_msg_max_msg_size;
+	uint8_t rsp_msg_status, rsp_msg_end_id, rsp_msg_serv_meta_len;
 
 	AR_DEBUG_PRINTF(ATH_DEBUG_TRC,
 			("+htc_connect_service, target:%p SvcID:0x%X\n", target,
@@ -108,7 +108,8 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
 				break;
 			}
 
-			A_MEMZERO(pConnectMsg, sizeof(HTC_CONNECT_SERVICE_MSG));
+			qdf_mem_zero(pConnectMsg,
+				     sizeof(HTC_CONNECT_SERVICE_MSG));
 
 			conn_flags =
 				(pConnectReq->
@@ -136,7 +137,7 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
 			    (pConnectReq->MetaDataLength <=
 			     HTC_SERVICE_META_DATA_MAX_LENGTH)) {
 				/* copy meta data into message buffer (after header ) */
-				A_MEMCPY((A_UINT8 *) pConnectMsg +
+				qdf_mem_copy((uint8_t *) pConnectMsg +
 					 sizeof(HTC_CONNECT_SERVICE_MSG),
 					 pConnectReq->pMetaData,
 					 pConnectReq->MetaDataLength);
@@ -149,7 +150,7 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
 
 			SET_HTC_PACKET_INFO_TX(pSendPacket,
 					       NULL,
-					       (A_UINT8 *) pConnectMsg,
+					       (uint8_t *) pConnectMsg,
 					       length,
 					       ENDPOINT_0,
 					       HTC_SERVICE_TX_PACKET_TAG);
@@ -237,8 +238,8 @@ A_STATUS htc_connect_service(HTC_HANDLE HTCHandle,
 					min((int)pConnectResp->BufferLength,
 					    (int)rsp_msg_serv_meta_len);
 				/* copy the meta data */
-				A_MEMCPY(pConnectResp->pMetaData,
-					 ((A_UINT8 *) pResponseMsg) +
+				qdf_mem_copy(pConnectResp->pMetaData,
+					 ((uint8_t *) pResponseMsg) +
 					 sizeof
 					 (HTC_CONNECT_SERVICE_RESPONSE_MSG),
 					 copyLength);