Skip to content

Commit

Permalink
staging: csr: remove CsrUint32 typedef
Browse files Browse the repository at this point in the history
Use the in-kernel u32 type instead.

Cc: Mikko Virkkilä <mikko.virkkila@bluegiga.com>
Cc: Lauri Hintsala <Lauri.Hintsala@bluegiga.com>
Cc: Riku Mettälä <riku.mettala@bluegiga.com>
Cc: Veli-Pekka Peltola <veli-pekka.peltola@bluegiga.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Greg Kroah-Hartman committed Jul 20, 2012
1 parent ab2b8c7 commit 26a6b2e
Show file tree
Hide file tree
Showing 66 changed files with 865 additions and 868 deletions.
2 changes: 1 addition & 1 deletion drivers/staging/csr/bh.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ bh_thread_function(void *arg)
unifi_priv_t *priv = (unifi_priv_t*)arg;
CsrResult csrResult;
long ret;
CsrUint32 timeout, t;
u32 timeout, t;
struct uf_thread *this_thread;

unifi_trace(priv, UDBG2, "bh_thread_function starting\n");
Expand Down
12 changes: 6 additions & 6 deletions drivers/staging/csr/csr_framework_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ CsrResult CsrEventCreate(CsrEventHandle *eventHandle);
* CSR_FE_RESULT_INVALID_POINTER in case the eventBits pointer is invalid
*
*----------------------------------------------------------------------------*/
CsrResult CsrEventWait(CsrEventHandle *eventHandle, u16 timeoutInMs, CsrUint32 *eventBits);
CsrResult CsrEventWait(CsrEventHandle *eventHandle, u16 timeoutInMs, u32 *eventBits);

/*----------------------------------------------------------------------------*
* NAME
Expand All @@ -81,7 +81,7 @@ CsrResult CsrEventWait(CsrEventHandle *eventHandle, u16 timeoutInMs, CsrUint32 *
* CSR_FE_RESULT_INVALID_HANDLE in case the eventHandle is invalid
*
*----------------------------------------------------------------------------*/
CsrResult CsrEventSet(CsrEventHandle *eventHandle, CsrUint32 eventBits);
CsrResult CsrEventSet(CsrEventHandle *eventHandle, u32 eventBits);

/*----------------------------------------------------------------------------*
* NAME
Expand Down Expand Up @@ -195,7 +195,7 @@ void CsrGlobalMutexUnlock(void);
*
*----------------------------------------------------------------------------*/
CsrResult CsrThreadCreate(void (*threadFunction)(void *pointer), void *pointer,
CsrUint32 stackSize, u16 priority,
u32 stackSize, u16 priority,
const CsrCharString *threadName, CsrThreadHandle *threadHandle);

/*----------------------------------------------------------------------------*
Expand Down Expand Up @@ -257,7 +257,7 @@ void CsrThreadSleep(u16 sleepTimeInMs);
*----------------------------------------------------------------------------*/
#ifdef CSR_MEM_DEBUG
void *CsrMemAllocDebug(CsrSize size,
const CsrCharString *file, CsrUint32 line);
const CsrCharString *file, u32 line);
#define CsrMemAlloc(sz) CsrMemAllocDebug((sz), __FILE__, __LINE__)
#else
void *CsrMemAlloc(CsrSize size);
Expand All @@ -278,7 +278,7 @@ void *CsrMemAlloc(CsrSize size);
*----------------------------------------------------------------------------*/
#ifdef CSR_MEM_DEBUG
void *CsrMemCallocDebug(CsrSize numberOfElements, CsrSize elementSize,
const CsrCharString *file, CsrUint32 line);
const CsrCharString *file, u32 line);
#define CsrMemCalloc(cnt, sz) CsrMemAllocDebug((cnt), (sz), __FILE__, __LINE__)
#else
void *CsrMemCalloc(CsrSize numberOfElements, CsrSize elementSize);
Expand Down Expand Up @@ -311,7 +311,7 @@ void CsrMemFree(void *pointer);
*----------------------------------------------------------------------------*/
#ifdef CSR_MEM_DEBUG
void *CsrMemAllocDmaDebug(CsrSize size,
const CsrCharString *file, CsrUint32 line);
const CsrCharString *file, u32 line);
#define CsrMemAllocDma(sz) CsrMemAllocDmaDebug((sz), __FILE__, __LINE__)
#else
void *CsrMemAllocDma(CsrSize size);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/csr/csr_framework_ext_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ struct CsrEvent
{
pthread_cond_t event;
pthread_mutex_t mutex;
CsrUint32 eventBits;
u32 eventBits;
};

typedef struct CsrEvent CsrEventHandle;
Expand Down
16 changes: 8 additions & 8 deletions drivers/staging/csr/csr_lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ typedef struct
{
CsrPrim type;
u16 value1;
CsrUint32 value2;
u32 value2;
} CsrEventCsrUint16CsrUint32;

/*----------------------------------------------------------------------------*
Expand All @@ -113,7 +113,7 @@ typedef struct
* Allocates and fills in a message with the signature CsrEventCsrUint16
*
*----------------------------------------------------------------------------*/
CsrEventCsrUint16CsrUint32 *CsrEventCsrUint16CsrUint32_struct(u16 primtype, u16 msgtype, u16 value1, CsrUint32 value2);
CsrEventCsrUint16CsrUint32 *CsrEventCsrUint16CsrUint32_struct(u16 primtype, u16 msgtype, u16 value1, u32 value2);

typedef struct
{
Expand All @@ -135,7 +135,7 @@ CsrEventCsrUint16CsrCharString *CsrEventCsrUint16CsrCharString_struct(u16 primty
typedef struct
{
CsrPrim type;
CsrUint32 value;
u32 value;
} CsrEventCsrUint32;

/*----------------------------------------------------------------------------*
Expand All @@ -146,12 +146,12 @@ typedef struct
* Allocates and fills in a message with the signature CsrEventCsrUint32
*
*----------------------------------------------------------------------------*/
CsrEventCsrUint32 *CsrEventCsrUint32_struct(u16 primtype, u16 msgtype, CsrUint32 value);
CsrEventCsrUint32 *CsrEventCsrUint32_struct(u16 primtype, u16 msgtype, u32 value);

typedef struct
{
CsrPrim type;
CsrUint32 value1;
u32 value1;
u16 value2;
} CsrEventCsrUint32CsrUint16;

Expand All @@ -163,12 +163,12 @@ typedef struct
* Allocates and fills in a message with the signature CsrEventCsrUint32CsrUint16
*
*----------------------------------------------------------------------------*/
CsrEventCsrUint32CsrUint16 *CsrEventCsrUint32CsrUint16_struct(u16 primtype, u16 msgtype, CsrUint32 value1, CsrUint32 value2);
CsrEventCsrUint32CsrUint16 *CsrEventCsrUint32CsrUint16_struct(u16 primtype, u16 msgtype, u32 value1, u32 value2);

typedef struct
{
CsrPrim type;
CsrUint32 value1;
u32 value1;
CsrCharString *value2;
} CsrEventCsrUint32CsrCharString;

Expand All @@ -180,7 +180,7 @@ typedef struct
* Allocates and fills in a message with the signature CsrEventCsrUint32CsrCharString
*
*----------------------------------------------------------------------------*/
CsrEventCsrUint32CsrCharString *CsrEventCsrUint32CsrCharString_struct(u16 primtype, u16 msgtype, CsrUint32 value1, CsrCharString *value2);
CsrEventCsrUint32CsrCharString *CsrEventCsrUint32CsrCharString_struct(u16 primtype, u16 msgtype, u32 value1, CsrCharString *value2);

#ifdef __cplusplus
}
Expand Down
32 changes: 16 additions & 16 deletions drivers/staging/csr/csr_log.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extern "C" {
/*----------------------------------------------------*/
/* Filtering on environment specific log levels */
/*----------------------------------------------------*/
typedef CsrUint32 CsrLogLevelEnvironment;
typedef u32 CsrLogLevelEnvironment;
#define CSR_LOG_LEVEL_ENVIRONMENT_OFF ((CsrLogLevelEnvironment) 0x00000000) /* No environment data/events are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BCI_ACL ((CsrLogLevelEnvironment) 0x00000001) /* BlueCore Channel Interface HCI Acl data are logged */
#define CSR_LOG_LEVEL_ENVIRONMENT_BCI_HCI ((CsrLogLevelEnvironment) 0x00000002) /* BlueCore Channel Interface HCI Cmd/Evt data are logged */
Expand All @@ -47,7 +47,7 @@ typedef CsrUint32 CsrLogLevelEnvironment;
/*----------------------------------------------------*/
/* Filtering on task specific log levels */
/*----------------------------------------------------*/
typedef CsrUint32 CsrLogLevelTask;
typedef u32 CsrLogLevelTask;
#define CSR_LOG_LEVEL_TASK_OFF ((CsrLogLevelTask) 0x00000000) /* No events are logged for this task */
#define CSR_LOG_LEVEL_TASK_TEXT ((CsrLogLevelTask) 0x00000001) /* Text strings printed by a task are logged NB: This bit does not affect the CSR_LOG_TEXT_LEVEL interface. This has to be configured separately */
#define CSR_LOG_LEVEL_TASK_TEXT_LOC ((CsrLogLevelTask) 0x00000002) /* The locaction where the text string call occured are logged. NB: This is a supplement to CSR_LOG_LEVEL_TASK_TEXT, it has no effect without it */
Expand Down Expand Up @@ -104,7 +104,7 @@ typedef struct
typedef struct
{
const CsrCharString *techVer;
CsrUint32 primitiveInfoCount;
u32 primitiveInfoCount;
CsrLogPrimitiveInformation *primitiveInfo;
} CsrLogTechInformation;

Expand All @@ -113,7 +113,7 @@ typedef struct
/*---------------------------------*/
typedef u8 bitmask8_t;
typedef u16 bitmask16_t;
typedef CsrUint32 bitmask32_t;
typedef u32 bitmask32_t;

#ifdef CSR_LOG_ENABLE
#ifdef CSR_LOG_INCLUDE_FILE_NAME_AND_LINE_NUMBER
Expand Down Expand Up @@ -141,7 +141,7 @@ typedef CsrUint32 bitmask32_t;

/* DEPRECATED - replaced by csr_log_text.h */
void CsrLogTaskText(const CsrCharString *text,
CsrUint32 line,
u32 line,
const CsrCharString *file);

#define CSR_LOG_STATE_TRANSITION_MASK_FSM_NAME (0x001)
Expand All @@ -154,15 +154,15 @@ void CsrLogTaskText(const CsrCharString *text,

/* DEPRECATED - replaced by csr_log_text.h */
void CsrLogStateTransition(bitmask16_t mask,
CsrUint32 identifier,
u32 identifier,
const CsrCharString *fsm_name,
CsrUint32 prev_state,
u32 prev_state,
const CsrCharString *prev_state_str,
CsrUint32 in_event,
u32 in_event,
const CsrCharString *in_event_str,
CsrUint32 next_state,
u32 next_state,
const CsrCharString *next_state_str,
CsrUint32 line,
u32 line,
const CsrCharString *file);

/*---------------------------------*/
Expand All @@ -183,7 +183,7 @@ void CsrLogDeactivate(CsrSchedQid tskid);
#define SYNERGY_SERIALIZER_TYPE_DUMP (0x000)
#define SYNERGY_SERIALIZER_TYPE_SER (0x001)

void CsrLogMessagePut(CsrUint32 line,
void CsrLogMessagePut(u32 line,
const CsrCharString *file,
CsrSchedQid src_task_id,
CsrSchedQid dst_taskid,
Expand All @@ -198,7 +198,7 @@ void CsrLogMessageGet(CsrSchedQid src_task_id,
u16 prim_type,
const void *msg);

void CsrLogTimedEventIn(CsrUint32 line,
void CsrLogTimedEventIn(u32 line,
const CsrCharString *file,
CsrSchedQid task_id,
CsrSchedTid tid,
Expand All @@ -212,7 +212,7 @@ void CsrLogTimedEventFire(CsrSchedQid task_id,
void CsrLogTimedEventDone(CsrSchedQid task_id,
CsrSchedTid tid);

void CsrLogTimedEventCancel(CsrUint32 line,
void CsrLogTimedEventCancel(u32 line,
const CsrCharString *file,
CsrSchedQid task_id,
CsrSchedTid tid,
Expand All @@ -230,17 +230,17 @@ void CsrLogBgintServiceDone(CsrSchedBgint irq);
void CsrLogExceptionStateEvent(u16 prim_type,
CsrPrim msg_type,
u16 state,
CsrUint32 line,
u32 line,
const CsrCharString *file);
void CsrLogExceptionGeneral(u16 prim_type,
u16 state,
const CsrCharString *text,
CsrUint32 line,
u32 line,
const CsrCharString *file);
void CsrLogExceptionWarning(u16 prim_type,
u16 state,
const CsrCharString *text,
CsrUint32 line,
u32 line,
const CsrCharString *file);

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/csr/csr_log_configure.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void CsrLogLevelTaskSetSpecific(CsrSchedQid taskId, CsrLogLevelTask taskLogLevel
/*--------------------------------------------*/
/* Filtering on log text warning levels */
/*--------------------------------------------*/
typedef CsrUint32 CsrLogLevelText;
typedef u32 CsrLogLevelText;
#define CSR_LOG_LEVEL_TEXT_OFF ((CsrLogLevelText) 0x0000)

#define CSR_LOG_LEVEL_TEXT_CRITICAL ((CsrLogLevelText) 0x0001)
Expand All @@ -64,7 +64,7 @@ typedef CsrUint32 CsrLogLevelText;
* clashes the technologies are only allowed to assign values within the same restrictive range as allies to
* primitive identifiers. eg. for the framework components outside the scheduler is only allowed to assign
* taskId's in the range 0x0600xxxx to 0x06FFxxxx. And so on for other technologies. */
typedef CsrUint32 CsrLogTextTaskId;
typedef u32 CsrLogTextTaskId;

/* Set the text logging level for all Tasks */
/* This function call takes precedence over all previous calls to CsrLogLevelTextSetTask() and CsrLogLevelTextSetTaskSubOrigin() */
Expand Down
18 changes: 9 additions & 9 deletions drivers/staging/csr/csr_macro.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ extern "C" {
#endif

/*------------------------------------------------------------------*/
/* Bits - intended to operate on CsrUint32 values */
/* Bits - intended to operate on u32 values */
/*------------------------------------------------------------------*/
#define CSR_MASK_IS_SET(val, mask) (((val) & (mask)) == (mask))
#define CSR_MASK_IS_UNSET(val, mask) ((((val) & (mask)) ^ mask) == (mask))
Expand All @@ -32,8 +32,8 @@ extern "C" {
/* Endian conversion */
/*------------------------------------------------------------------*/
#define CSR_GET_UINT16_FROM_LITTLE_ENDIAN(ptr) (((u16) ((u8 *) (ptr))[0]) | ((u16) ((u8 *) (ptr))[1]) << 8)
#define CSR_GET_UINT32_FROM_LITTLE_ENDIAN(ptr) (((CsrUint32) ((u8 *) (ptr))[0]) | ((CsrUint32) ((u8 *) (ptr))[1]) << 8 | \
((CsrUint32) ((u8 *) (ptr))[2]) << 16 | ((CsrUint32) ((u8 *) (ptr))[3]) << 24)
#define CSR_GET_UINT32_FROM_LITTLE_ENDIAN(ptr) (((u32) ((u8 *) (ptr))[0]) | ((u32) ((u8 *) (ptr))[1]) << 8 | \
((u32) ((u8 *) (ptr))[2]) << 16 | ((u32) ((u8 *) (ptr))[3]) << 24)
#define CSR_COPY_UINT16_TO_LITTLE_ENDIAN(uint, ptr) ((u8 *) (ptr))[0] = ((u8) ((uint) & 0x00FF)); \
((u8 *) (ptr))[1] = ((u8) ((uint) >> 8))
#define CSR_COPY_UINT32_TO_LITTLE_ENDIAN(uint, ptr) ((u8 *) (ptr))[0] = ((u8) ((uint) & 0x000000FF)); \
Expand All @@ -43,8 +43,8 @@ extern "C" {
#define CSR_GET_UINT16_FROM_BIG_ENDIAN(ptr) (((u16) ((u8 *) (ptr))[1]) | ((u16) ((u8 *) (ptr))[0]) << 8)
#define CSR_GET_UINT24_FROM_BIG_ENDIAN(ptr) (((CsrUint24) ((u8 *) (ptr))[2]) | \
((CsrUint24) ((u8 *) (ptr))[1]) << 8 | ((CsrUint24) ((u8 *) (ptr))[0]) << 16)
#define CSR_GET_UINT32_FROM_BIG_ENDIAN(ptr) (((CsrUint32) ((u8 *) (ptr))[3]) | ((CsrUint32) ((u8 *) (ptr))[2]) << 8 | \
((CsrUint32) ((u8 *) (ptr))[1]) << 16 | ((CsrUint32) ((u8 *) (ptr))[0]) << 24)
#define CSR_GET_UINT32_FROM_BIG_ENDIAN(ptr) (((u32) ((u8 *) (ptr))[3]) | ((u32) ((u8 *) (ptr))[2]) << 8 | \
((u32) ((u8 *) (ptr))[1]) << 16 | ((u32) ((u8 *) (ptr))[0]) << 24)
#define CSR_COPY_UINT16_TO_BIG_ENDIAN(uint, ptr) ((u8 *) (ptr))[1] = ((u8) ((uint) & 0x00FF)); \
((u8 *) (ptr))[0] = ((u8) ((uint) >> 8))
#define CSR_COPY_UINT24_TO_BIG_ENDIAN(uint, ptr) ((u8 *) (ptr))[2] = ((u8) ((uint) & 0x000000FF)); \
Expand All @@ -70,10 +70,10 @@ extern "C" {
((u16) (input)[0]));(input) += 2

#define CSR_CONVERT_32_FROM_XAP(output, input) \
(output) = (((CsrUint32) (input)[1]) << 24) | \
(((CsrUint32) (input)[0]) << 16) | \
(((CsrUint32) (input)[3]) << 8) | \
((CsrUint32) (input)[2]);input += 4
(output) = (((u32) (input)[1]) << 24) | \
(((u32) (input)[0]) << 16) | \
(((u32) (input)[3]) << 8) | \
((u32) (input)[2]);input += 4

#define CSR_ADD_UINT8_TO_XAP(output, input) \
(output)[0] = (input); \
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/csr/csr_msgconv.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,14 @@ void CsrMsgConvDeinit(void);

/* SHOULD BE INTERNAL TO FRAMEWORK AKA DEPRECATED */

CsrUint32 CsrCharStringSerLen(const CsrCharString *str);
CsrUint32 CsrUtf8StringSerLen(const CsrUtf8String *str);
CsrUint32 CsrUtf16StringSerLen(const CsrUtf16String *str);
u32 CsrCharStringSerLen(const CsrCharString *str);
u32 CsrUtf8StringSerLen(const CsrUtf8String *str);
u32 CsrUtf16StringSerLen(const CsrUtf16String *str);

/* Prototypes for primitive type serializers */
void CsrUint8Ser(u8 *buffer, CsrSize *offset, u8 value);
void CsrUint16Ser(u8 *buffer, CsrSize *offset, u16 value);
void CsrUint32Ser(u8 *buffer, CsrSize *offset, CsrUint32 value);
void CsrUint32Ser(u8 *buffer, CsrSize *offset, u32 value);
void CsrMemCpySer(u8 *buffer, CsrSize *offset, const void *value, CsrSize length);
void CsrCharStringSer(u8 *buffer, CsrSize *offset, const CsrCharString *value);
void CsrUtf8StringSer(u8 *buffer, CsrSize *offset, const CsrUtf8String *value);
Expand All @@ -90,7 +90,7 @@ void CsrSizeSer(u8 *buffer, CsrSize *offset, CsrSize value);

void CsrUint8Des(u8 *value, u8 *buffer, CsrSize *offset);
void CsrUint16Des(u16 *value, u8 *buffer, CsrSize *offset);
void CsrUint32Des(CsrUint32 *value, u8 *buffer, CsrSize *offset);
void CsrUint32Des(u32 *value, u8 *buffer, CsrSize *offset);
void CsrMemCpyDes(void *value, u8 *buffer, CsrSize *offset, CsrSize length);
void CsrCharStringDes(CsrCharString **value, u8 *buffer, CsrSize *offset);
void CsrUtf8StringDes(CsrUtf8String **value, u8 *buffer, CsrSize *offset);
Expand Down
10 changes: 5 additions & 5 deletions drivers/staging/csr/csr_pmem.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ extern "C" {
*****************************************************************************/
#ifdef CSR_PMEM_DEBUG
void *CsrPmemAllocDebug(CsrSize size,
const CsrCharString *file, CsrUint32 line);
const CsrCharString *file, u32 line);
#define CsrPmemAlloc(sz) CsrPmemAllocDebug((sz), __FILE__, __LINE__)
#else
void *CsrPmemAlloc(CsrSize size);
Expand Down Expand Up @@ -108,8 +108,8 @@ typedef u8 CsrPmemDebugAllocType;
#define CSR_PMEM_DEBUG_TYPE_MEM_CALLOC 3
#define CSR_PMEM_DEBUG_TYPE_MEM_ALLOC_DMA 4

typedef void (CsrPmemDebugOnAlloc)(void *ptr, void *userptr, CsrSize size, CsrPmemDebugAllocType type, const CsrCharString* file, CsrUint32 line);
typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocType type, const CsrCharString* file, CsrUint32 line);
typedef void (CsrPmemDebugOnAlloc)(void *ptr, void *userptr, CsrSize size, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);
typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);

/*----------------------------------------------------------------------------*
* NAME
Expand All @@ -127,10 +127,10 @@ typedef void (CsrPmemDebugOnFree)(void *ptr, void *userptr, CsrPmemDebugAllocTyp
*----------------------------------------------------------------------------*/
void CsrPmemDebugInstallHooks(u8 headSize, u8 endSize, CsrPmemDebugOnAlloc *onAllocCallback, CsrPmemDebugOnFree *onFreeCallback);

void *CsrPmemDebugAlloc(CsrSize size, CsrPmemDebugAllocType type, const CsrCharString* file, CsrUint32 line);
void *CsrPmemDebugAlloc(CsrSize size, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);
#define CsrPmemAlloc(size) CsrPmemDebugAlloc(size, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)

void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const CsrCharString* file, CsrUint32 line);
void CsrPmemDebugFree(void *ptr, CsrPmemDebugAllocType type, const CsrCharString* file, u32 line);
#define CsrPmemFree(ptr) CsrPmemDebugFree(ptr, CSR_PMEM_DEBUG_TYPE_PMEM_ALLOC, __FILE__, __LINE__)

#endif
Expand Down
Loading

0 comments on commit 26a6b2e

Please sign in to comment.