提交 aad3d31f 编写于 作者: D Devendra Naga 提交者: Greg Kroah-Hartman

staging: csr: remove the CsrTime typedef altogether

remove CsrTime typedef and replace all the users with the u32
Signed-off-by: NDevendra Naga <devendra.aaru@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 cf7d9b42
...@@ -201,7 +201,7 @@ void CsrLogTimedEventIn(u32 line, ...@@ -201,7 +201,7 @@ void CsrLogTimedEventIn(u32 line,
const char *file, const char *file,
CsrSchedQid task_id, CsrSchedQid task_id,
CsrSchedTid tid, CsrSchedTid tid,
CsrTime requested_delay, u32 requested_delay,
u16 fniarg, u16 fniarg,
const void *fnvarg); const void *fnvarg);
......
...@@ -37,10 +37,10 @@ typedef CsrSchedIdentifier CsrSchedTid; ...@@ -37,10 +37,10 @@ typedef CsrSchedIdentifier CsrSchedTid;
typedef void (*schedEntryFunction_t)(void **inst); typedef void (*schedEntryFunction_t)(void **inst);
/* Time constants. */ /* Time constants. */
#define CSR_SCHED_TIME_MAX ((CsrTime) 0xFFFFFFFF) #define CSR_SCHED_TIME_MAX (0xFFFFFFFF)
#define CSR_SCHED_MILLISECOND ((CsrTime) (1000)) #define CSR_SCHED_MILLISECOND (1000)
#define CSR_SCHED_SECOND ((CsrTime) (1000 * CSR_SCHED_MILLISECOND)) #define CSR_SCHED_SECOND (1000 * CSR_SCHED_MILLISECOND)
#define CSR_SCHED_MINUTE ((CsrTime) (60 * CSR_SCHED_SECOND)) #define CSR_SCHED_MINUTE (60 * CSR_SCHED_SECOND)
/* Queue and primitive that identifies the environment */ /* Queue and primitive that identifies the environment */
#define CSR_SCHED_TASK_ID 0xFFFF #define CSR_SCHED_TASK_ID 0xFFFF
...@@ -218,7 +218,7 @@ u8 CsrSchedMessageGet(u16 *pmi, void **pmv); ...@@ -218,7 +218,7 @@ u8 CsrSchedMessageGet(u16 *pmi, void **pmv);
* *
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
#if defined(CSR_LOG_ENABLE) && defined(CSR_LOG_INCLUDE_FILE_NAME_AND_LINE_NUMBER) #if defined(CSR_LOG_ENABLE) && defined(CSR_LOG_INCLUDE_FILE_NAME_AND_LINE_NUMBER)
CsrSchedTid CsrSchedTimerSetStringLog(CsrTime delay, CsrSchedTid CsrSchedTimerSetStringLog(u32 delay,
void (*fn)(u16 mi, void *mv), void (*fn)(u16 mi, void *mv),
u16 fniarg, u16 fniarg,
void *fnvarg, void *fnvarg,
...@@ -226,7 +226,7 @@ CsrSchedTid CsrSchedTimerSetStringLog(CsrTime delay, ...@@ -226,7 +226,7 @@ CsrSchedTid CsrSchedTimerSetStringLog(CsrTime delay,
const char *file); const char *file);
#define CsrSchedTimerSet(d, fn, fni, fnv) CsrSchedTimerSetStringLog((d), (fn), (fni), (fnv), __LINE__, __FILE__) #define CsrSchedTimerSet(d, fn, fni, fnv) CsrSchedTimerSetStringLog((d), (fn), (fni), (fnv), __LINE__, __FILE__)
#else #else
CsrSchedTid CsrSchedTimerSet(CsrTime delay, CsrSchedTid CsrSchedTimerSet(u32 delay,
void (*fn)(u16 mi, void *mv), void (*fn)(u16 mi, void *mv),
u16 fniarg, u16 fniarg,
void *fnvarg); void *fnvarg);
......
...@@ -14,19 +14,19 @@ ...@@ -14,19 +14,19 @@
#include "csr_time.h" #include "csr_time.h"
CsrTime CsrTimeGet(CsrTime *high) u32 CsrTimeGet(u32 *high)
{ {
struct timespec ts; struct timespec ts;
u64 time; u64 time;
CsrTime low; u32 low;
ts = current_kernel_time(); ts = current_kernel_time();
time = (u64) ts.tv_sec * 1000000 + ts.tv_nsec / 1000; time = (u64) ts.tv_sec * 1000000 + ts.tv_nsec / 1000;
if (high != NULL) if (high != NULL)
*high = (CsrTime) ((time >> 32) & 0xFFFFFFFF); *high = (u32) ((time >> 32) & 0xFFFFFFFF);
low = (CsrTime) (time & 0xFFFFFFFF); low = (u32) (time & 0xFFFFFFFF);
return low; return low;
} }
......
...@@ -18,19 +18,6 @@ extern "C" { ...@@ -18,19 +18,6 @@ extern "C" {
/******************************************************************************* /*******************************************************************************
NAME
CsrTime
DESCRIPTION
Type to hold a value describing the current system time, which is a
measure of time elapsed since some arbitrarily defined fixed time
reference, usually associated with system startup.
*******************************************************************************/
typedef u32 CsrTime;
/*******************************************************************************
NAME NAME
CsrTimeGet CsrTimeGet
...@@ -55,7 +42,7 @@ RETURNS ...@@ -55,7 +42,7 @@ RETURNS
Low part of current system time in microseconds. Low part of current system time in microseconds.
*******************************************************************************/ *******************************************************************************/
CsrTime CsrTimeGet(CsrTime *high); u32 CsrTimeGet(u32 *high);
/*------------------------------------------------------------------*/ /*------------------------------------------------------------------*/
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
typedef struct coredump_buf typedef struct coredump_buf
{ {
u16 count; /* serial number of dump */ u16 count; /* serial number of dump */
CsrTime timestamp; /* host's system time at capture */ u32 timestamp; /* host's system time at capture */
s16 requestor; /* request: 0=auto dump, 1=manual */ s16 requestor; /* request: 0=auto dump, 1=manual */
u16 chip_ver; u16 chip_ver;
u32 fw_ver; u32 fw_ver;
...@@ -192,7 +192,7 @@ CsrResult unifi_coredump_capture(card_t *card, struct unifi_coredump_req *req) ...@@ -192,7 +192,7 @@ CsrResult unifi_coredump_capture(card_t *card, struct unifi_coredump_req *req)
{ {
CsrResult r = CSR_RESULT_SUCCESS; CsrResult r = CSR_RESULT_SUCCESS;
static u16 dump_seq_no = 1; static u16 dump_seq_no = 1;
CsrTime time_of_capture; u32 time_of_capture;
func_enter(); func_enter();
......
...@@ -228,7 +228,7 @@ typedef struct unifi_coredump_req ...@@ -228,7 +228,7 @@ typedef struct unifi_coredump_req
u32 chip_ver; /* Chip version */ u32 chip_ver; /* Chip version */
u32 fw_ver; /* Firmware version */ u32 fw_ver; /* Firmware version */
s32 requestor; /* Requestor: 0=auto dump, 1=manual */ s32 requestor; /* Requestor: 0=auto dump, 1=manual */
CsrTime timestamp; /* time of capture by driver */ u32 timestamp; /* time of capture by driver */
u32 serial; /* capture serial number */ u32 serial; /* capture serial number */
s32 value; /* register value */ s32 value; /* register value */
} unifi_coredump_req_t; /* mini-coredumped reg value request */ } unifi_coredump_req_t; /* mini-coredumped reg value request */
......
...@@ -3246,8 +3246,8 @@ static void check_ba_frame_age_timeout( unifi_priv_t *priv, ...@@ -3246,8 +3246,8 @@ static void check_ba_frame_age_timeout( unifi_priv_t *priv,
netInterface_priv_t *interfacePriv, netInterface_priv_t *interfacePriv,
ba_session_rx_struct *ba_session) ba_session_rx_struct *ba_session)
{ {
CsrTime now; u32 now;
CsrTime age; u32 age;
u8 i, j; u8 i, j;
u16 sn_temp; u16 sn_temp;
...@@ -3282,11 +3282,11 @@ static void check_ba_frame_age_timeout( unifi_priv_t *priv, ...@@ -3282,11 +3282,11 @@ static void check_ba_frame_age_timeout( unifi_priv_t *priv,
if (ba_session->buffer[i].recv_time > now) if (ba_session->buffer[i].recv_time > now)
{ {
/* timer wrap */ /* timer wrap */
age = CsrTimeAdd((CsrTime)CsrTimeSub(CSR_SCHED_TIME_MAX, ba_session->buffer[i].recv_time), now); age = CsrTimeAdd((u32)CsrTimeSub(CSR_SCHED_TIME_MAX, ba_session->buffer[i].recv_time), now);
} }
else else
{ {
age = (CsrTime)CsrTimeSub(now, ba_session->buffer[i].recv_time); age = (u32)CsrTimeSub(now, ba_session->buffer[i].recv_time);
} }
if (age >= CSR_WIFI_BA_MPDU_FRAME_AGE_TIMEOUT) if (age >= CSR_WIFI_BA_MPDU_FRAME_AGE_TIMEOUT)
......
...@@ -2101,7 +2101,7 @@ static int peer_add_new_record(unifi_priv_t *priv,CsrWifiRouterCtrlPeerAddReq *r ...@@ -2101,7 +2101,7 @@ static int peer_add_new_record(unifi_priv_t *priv,CsrWifiRouterCtrlPeerAddReq *r
u8 freeSlotFound = FALSE; u8 freeSlotFound = FALSE;
CsrWifiRouterCtrlStaInfo_t *newRecord = NULL; CsrWifiRouterCtrlStaInfo_t *newRecord = NULL;
netInterface_priv_t *interfacePriv = priv->interfacePriv[req->interfaceTag]; netInterface_priv_t *interfacePriv = priv->interfacePriv[req->interfaceTag];
CsrTime currentTime, currentTimeHi; u32 currentTime, currentTimeHi;
unsigned long lock_flags; unsigned long lock_flags;
if (req->interfaceTag >= CSR_WIFI_NUM_INTERFACES) { if (req->interfaceTag >= CSR_WIFI_NUM_INTERFACES) {
...@@ -2295,8 +2295,8 @@ static void check_inactivity_timer_expire_func(unsigned long data) ...@@ -2295,8 +2295,8 @@ static void check_inactivity_timer_expire_func(unsigned long data)
struct unifi_priv *priv; struct unifi_priv *priv;
CsrWifiRouterCtrlStaInfo_t *sta_record = NULL; CsrWifiRouterCtrlStaInfo_t *sta_record = NULL;
u8 i = 0; u8 i = 0;
CsrTime now; u32 now;
CsrTime inactive_time; u32 inactive_time;
netInterface_priv_t *interfacePriv = (netInterface_priv_t *) data; netInterface_priv_t *interfacePriv = (netInterface_priv_t *) data;
if (!interfacePriv) if (!interfacePriv)
...@@ -2328,11 +2328,11 @@ static void check_inactivity_timer_expire_func(unsigned long data) ...@@ -2328,11 +2328,11 @@ static void check_inactivity_timer_expire_func(unsigned long data)
if (sta_record->lastActivity > now) if (sta_record->lastActivity > now)
{ {
/* simple timer wrap (for 1 wrap) */ /* simple timer wrap (for 1 wrap) */
inactive_time = CsrTimeAdd((CsrTime)CsrTimeSub(CSR_SCHED_TIME_MAX, sta_record->lastActivity), now); inactive_time = CsrTimeAdd((u32)CsrTimeSub(CSR_SCHED_TIME_MAX, sta_record->lastActivity), now);
} }
else else
{ {
inactive_time = (CsrTime)CsrTimeSub(now, sta_record->lastActivity); inactive_time = (u32)CsrTimeSub(now, sta_record->lastActivity);
} }
if (inactive_time >= STA_INACTIVE_TIMEOUT_VAL) if (inactive_time >= STA_INACTIVE_TIMEOUT_VAL)
......
...@@ -1116,8 +1116,8 @@ void uf_process_ma_pkt_cfm_for_ap(unifi_priv_t *priv,u16 interfaceTag, const CSR ...@@ -1116,8 +1116,8 @@ void uf_process_ma_pkt_cfm_for_ap(unifi_priv_t *priv,u16 interfaceTag, const CSR
staRecord->nullDataHostTag = INVALID_HOST_TAG; staRecord->nullDataHostTag = INVALID_HOST_TAG;
if(pkt_cfm->TransmissionStatus == CSR_TX_RETRY_LIMIT){ if(pkt_cfm->TransmissionStatus == CSR_TX_RETRY_LIMIT){
CsrTime now; u32 now;
CsrTime inactive_time; u32 inactive_time;
unifi_trace(priv, UDBG1, "Nulldata to probe STA ALIVE Failed with retry limit\n"); unifi_trace(priv, UDBG1, "Nulldata to probe STA ALIVE Failed with retry limit\n");
/* Recheck if there is some activity after null data is sent. /* Recheck if there is some activity after null data is sent.
...@@ -1133,12 +1133,12 @@ void uf_process_ma_pkt_cfm_for_ap(unifi_priv_t *priv,u16 interfaceTag, const CSR ...@@ -1133,12 +1133,12 @@ void uf_process_ma_pkt_cfm_for_ap(unifi_priv_t *priv,u16 interfaceTag, const CSR
if (staRecord->lastActivity > now) if (staRecord->lastActivity > now)
{ {
/* simple timer wrap (for 1 wrap) */ /* simple timer wrap (for 1 wrap) */
inactive_time = CsrTimeAdd((CsrTime)CsrTimeSub(CSR_SCHED_TIME_MAX, staRecord->lastActivity), inactive_time = CsrTimeAdd((u32)CsrTimeSub(CSR_SCHED_TIME_MAX, staRecord->lastActivity),
now); now);
} }
else else
{ {
inactive_time = (CsrTime)CsrTimeSub(now, staRecord->lastActivity); inactive_time = (u32)CsrTimeSub(now, staRecord->lastActivity);
} }
if (inactive_time >= STA_INACTIVE_TIMEOUT_VAL) if (inactive_time >= STA_INACTIVE_TIMEOUT_VAL)
...@@ -3491,11 +3491,11 @@ CsrWifiRouterCtrlStaInfo_t * CsrWifiRouterCtrlGetStationRecordFromHandle(unifi_p ...@@ -3491,11 +3491,11 @@ CsrWifiRouterCtrlStaInfo_t * CsrWifiRouterCtrlGetStationRecordFromHandle(unifi_p
} }
/* Function to do inactivity */ /* Function to do inactivity */
void uf_check_inactivity(unifi_priv_t *priv, u16 interfaceTag, CsrTime currentTime) void uf_check_inactivity(unifi_priv_t *priv, u16 interfaceTag, u32 currentTime)
{ {
u32 i; u32 i;
CsrWifiRouterCtrlStaInfo_t *staInfo; CsrWifiRouterCtrlStaInfo_t *staInfo;
CsrTime elapsedTime; /* Time in microseconds */ u32 elapsedTime; /* Time in microseconds */
netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag]; netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag];
CsrWifiMacAddress peerMacAddress; CsrWifiMacAddress peerMacAddress;
unsigned long lock_flags; unsigned long lock_flags;
...@@ -3542,8 +3542,8 @@ void uf_check_inactivity(unifi_priv_t *priv, u16 interfaceTag, CsrTime currentTi ...@@ -3542,8 +3542,8 @@ void uf_check_inactivity(unifi_priv_t *priv, u16 interfaceTag, CsrTime currentTi
/* Function to update activity of a station */ /* Function to update activity of a station */
void uf_update_sta_activity(unifi_priv_t *priv, u16 interfaceTag, const u8 *peerMacAddress) void uf_update_sta_activity(unifi_priv_t *priv, u16 interfaceTag, const u8 *peerMacAddress)
{ {
CsrTime elapsedTime, currentTime; /* Time in microseconds */ u32 elapsedTime, currentTime; /* Time in microseconds */
CsrTime timeHi; /* Not used - Time in microseconds */ u32 timeHi; /* Not used - Time in microseconds */
CsrWifiRouterCtrlStaInfo_t *staInfo; CsrWifiRouterCtrlStaInfo_t *staInfo;
netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag]; netInterface_priv_t *interfacePriv = priv->interfacePriv[interfaceTag];
unsigned long lock_flags; unsigned long lock_flags;
......
...@@ -312,7 +312,7 @@ typedef struct CsrWifiRouterCtrlStaInfo_t { ...@@ -312,7 +312,7 @@ typedef struct CsrWifiRouterCtrlStaInfo_t {
CSR_CLIENT_TAG nullDataHostTag; CSR_CLIENT_TAG nullDataHostTag;
/* Activity timestamps for the station */ /* Activity timestamps for the station */
CsrTime lastActivity; u32 lastActivity;
/* during m/c transmission sp suspended */ /* during m/c transmission sp suspended */
u8 uspSuspend; u8 uspSuspend;
...@@ -652,7 +652,7 @@ typedef struct { ...@@ -652,7 +652,7 @@ typedef struct {
bulk_data_param_t bulkdata; bulk_data_param_t bulkdata;
CSR_SIGNAL signal; CSR_SIGNAL signal;
u16 sn; u16 sn;
CsrTime recv_time; u32 recv_time;
} frame_desc_struct; } frame_desc_struct;
typedef struct { typedef struct {
...@@ -735,7 +735,7 @@ typedef struct netInterface_priv ...@@ -735,7 +735,7 @@ typedef struct netInterface_priv
u8 sta_activity_check_enabled; u8 sta_activity_check_enabled;
/* Timestamp when the last inactivity check was done */ /* Timestamp when the last inactivity check was done */
CsrTime last_inactivity_check; u32 last_inactivity_check;
/*number of multicast or borad cast packets queued*/ /*number of multicast or borad cast packets queued*/
u16 noOfbroadcastPktQueued; u16 noOfbroadcastPktQueued;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册