diff options
Diffstat (limited to 'drivers/staging/ath6kl/include/common/htc.h')
-rw-r--r-- | drivers/staging/ath6kl/include/common/htc.h | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/drivers/staging/ath6kl/include/common/htc.h b/drivers/staging/ath6kl/include/common/htc.h index f96cf7db7e06..b9d4495d4324 100644 --- a/drivers/staging/ath6kl/include/common/htc.h +++ b/drivers/staging/ath6kl/include/common/htc.h @@ -31,7 +31,7 @@ #define A_OFFSETOF(type,field) (unsigned long)(&(((type *)NULL)->field)) #define ASSEMBLE_UNALIGNED_UINT16(p,highbyte,lowbyte) \ - (((A_UINT16)(((A_UINT8 *)(p))[(highbyte)])) << 8 | (A_UINT16)(((A_UINT8 *)(p))[(lowbyte)])) + (((u16)(((u8 *)(p))[(highbyte)])) << 8 | (u16)(((u8 *)(p))[(lowbyte)])) /* alignment independent macros (little-endian) to fetch UINT16s or UINT8s from a * structure using only the type and field name. @@ -43,15 +43,15 @@ #define A_SET_UINT16_FIELD(p,type,field,value) \ { \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (A_UINT8)(value); \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field) + 1] = (A_UINT8)((value) >> 8); \ + ((u8 *)(p))[A_OFFSETOF(type,field)] = (u8)(value); \ + ((u8 *)(p))[A_OFFSETOF(type,field) + 1] = (u8)((value) >> 8); \ } #define A_GET_UINT8_FIELD(p,type,field) \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] + ((u8 *)(p))[A_OFFSETOF(type,field)] #define A_SET_UINT8_FIELD(p,type,field,value) \ - ((A_UINT8 *)(p))[A_OFFSETOF(type,field)] = (value) + ((u8 *)(p))[A_OFFSETOF(type,field)] = (value) /****** DANGER DANGER *************** * @@ -66,20 +66,20 @@ */ /* HTC frame header */ -typedef PREPACK struct _HTC_FRAME_HDR{ +PREPACK struct htc_frame_hdr { /* do not remove or re-arrange these fields, these are minimally required * to take advantage of 4-byte lookaheads in some hardware implementations */ - A_UINT8 EndpointID; - A_UINT8 Flags; - A_UINT16 PayloadLen; /* length of data (including trailer) that follows the header */ + u8 EndpointID; + u8 Flags; + u16 PayloadLen; /* length of data (including trailer) that follows the header */ /***** end of 4-byte lookahead ****/ - A_UINT8 ControlBytes[2]; + u8 ControlBytes[2]; /* message payload starts after the header */ -} POSTPACK HTC_FRAME_HDR; +} POSTPACK; /* frame header flags */ @@ -94,9 +94,9 @@ typedef PREPACK struct _HTC_FRAME_HDR{ #define HTC_FLAGS_RECV_BUNDLE_CNT_MASK (0xF0) /* bits 7..4 */ #define HTC_FLAGS_RECV_BUNDLE_CNT_SHIFT 4 -#define HTC_HDR_LENGTH (sizeof(HTC_FRAME_HDR)) +#define HTC_HDR_LENGTH (sizeof(struct htc_frame_hdr)) #define HTC_MAX_TRAILER_LENGTH 255 -#define HTC_MAX_PAYLOAD_LENGTH (4096 - sizeof(HTC_FRAME_HDR)) +#define HTC_MAX_PAYLOAD_LENGTH (4096 - sizeof(struct htc_frame_hdr)) /* HTC control message IDs */ @@ -110,25 +110,25 @@ typedef PREPACK struct _HTC_FRAME_HDR{ /* base message ID header */ typedef PREPACK struct { - A_UINT16 MessageID; + u16 MessageID; } POSTPACK HTC_UNKNOWN_MSG; /* HTC ready message * direction : target-to-host */ typedef PREPACK struct { - A_UINT16 MessageID; /* ID */ - A_UINT16 CreditCount; /* number of credits the target can offer */ - A_UINT16 CreditSize; /* size of each credit */ - A_UINT8 MaxEndpoints; /* maximum number of endpoints the target has resources for */ - A_UINT8 _Pad1; + u16 MessageID; /* ID */ + u16 CreditCount; /* number of credits the target can offer */ + u16 CreditSize; /* size of each credit */ + u8 MaxEndpoints; /* maximum number of endpoints the target has resources for */ + u8 _Pad1; } POSTPACK HTC_READY_MSG; /* extended HTC ready message */ typedef PREPACK struct { HTC_READY_MSG Version2_0_Info; /* legacy version 2.0 information at the front... */ /* extended information */ - A_UINT8 HTCVersion; - A_UINT8 MaxMsgsPerHTCBundle; + u8 HTCVersion; + u8 MaxMsgsPerHTCBundle; } POSTPACK HTC_READY_EX_MSG; #define HTC_VERSION_2P0 0x00 @@ -139,9 +139,9 @@ typedef PREPACK struct { /* connect service * direction : host-to-target */ typedef PREPACK struct { - A_UINT16 MessageID; - A_UINT16 ServiceID; /* service ID of the service to connect to */ - A_UINT16 ConnectionFlags; /* connection flags */ + u16 MessageID; + u16 ServiceID; /* service ID of the service to connect to */ + u16 ConnectionFlags; /* connection flags */ #define HTC_CONNECT_FLAGS_REDUCE_CREDIT_DRIBBLE (1 << 2) /* reduce credit dribbling when the host needs credits */ @@ -151,8 +151,8 @@ typedef PREPACK struct { #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_THREE_FOURTHS 0x2 #define HTC_CONNECT_FLAGS_THRESHOLD_LEVEL_UNITY 0x3 - A_UINT8 ServiceMetaLength; /* length of meta data that follows */ - A_UINT8 _Pad1; + u8 ServiceMetaLength; /* length of meta data that follows */ + u8 _Pad1; /* service-specific meta data starts after the header */ @@ -161,29 +161,29 @@ typedef PREPACK struct { /* connect response * direction : target-to-host */ typedef PREPACK struct { - A_UINT16 MessageID; - A_UINT16 ServiceID; /* service ID that the connection request was made */ - A_UINT8 Status; /* service connection status */ - A_UINT8 EndpointID; /* assigned endpoint ID */ - A_UINT16 MaxMsgSize; /* maximum expected message size on this endpoint */ - A_UINT8 ServiceMetaLength; /* length of meta data that follows */ - A_UINT8 _Pad1; + u16 MessageID; + u16 ServiceID; /* service ID that the connection request was made */ + u8 Status; /* service connection status */ + u8 EndpointID; /* assigned endpoint ID */ + u16 MaxMsgSize; /* maximum expected message size on this endpoint */ + u8 ServiceMetaLength; /* length of meta data that follows */ + u8 _Pad1; /* service-specific meta data starts after the header */ } POSTPACK HTC_CONNECT_SERVICE_RESPONSE_MSG; typedef PREPACK struct { - A_UINT16 MessageID; + u16 MessageID; /* currently, no other fields */ } POSTPACK HTC_SETUP_COMPLETE_MSG; /* extended setup completion message */ typedef PREPACK struct { - A_UINT16 MessageID; - A_UINT32 SetupFlags; - A_UINT8 MaxMsgsPerBundledRecv; - A_UINT8 Rsvd[3]; + u16 MessageID; + u32 SetupFlags; + u8 MaxMsgsPerBundledRecv; + u8 Rsvd[3]; } POSTPACK HTC_SETUP_COMPLETE_EX_MSG; #define HTC_SETUP_COMPLETE_FLAGS_ENABLE_BUNDLE_RECV (1 << 0) @@ -204,19 +204,19 @@ typedef PREPACK struct { #define HTC_RECORD_LOOKAHEAD_BUNDLE 3 typedef PREPACK struct { - A_UINT8 RecordID; /* Record ID */ - A_UINT8 Length; /* Length of record */ + u8 RecordID; /* Record ID */ + u8 Length; /* Length of record */ } POSTPACK HTC_RECORD_HDR; typedef PREPACK struct { - A_UINT8 EndpointID; /* Endpoint that owns these credits */ - A_UINT8 Credits; /* credits to report since last report */ + u8 EndpointID; /* Endpoint that owns these credits */ + u8 Credits; /* credits to report since last report */ } POSTPACK HTC_CREDIT_REPORT; typedef PREPACK struct { - A_UINT8 PreValid; /* pre valid guard */ - A_UINT8 LookAhead[4]; /* 4 byte lookahead */ - A_UINT8 PostValid; /* post valid guard */ + u8 PreValid; /* pre valid guard */ + u8 LookAhead[4]; /* 4 byte lookahead */ + u8 PostValid; /* post valid guard */ /* NOTE: the LookAhead array is guarded by a PreValid and Post Valid guard bytes. * The PreValid bytes must equal the inverse of the PostValid byte */ @@ -224,7 +224,7 @@ typedef PREPACK struct { } POSTPACK HTC_LOOKAHEAD_REPORT; typedef PREPACK struct { - A_UINT8 LookAhead[4]; /* 4 byte lookahead */ + u8 LookAhead[4]; /* 4 byte lookahead */ } POSTPACK HTC_BUNDLED_LOOKAHEAD_REPORT; #ifndef ATH_TARGET |