Commit deee7c81 authored by Pekka Enberg's avatar Pekka Enberg Committed by Greg Kroah-Hartman

Staging: w35und: remove timer wrappers

This patch removes the OS_TIMER and related wrappers from driver code. The
patch also changes the code to use msecs_to_jiffies() for setting up
timer->expires.
Acked-by: default avatarPavel Machek <pavel@suse.cz>
Signed-off-by: default avatarPekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent a36e0894
......@@ -79,7 +79,7 @@ typedef struct BSSDescriptionElement
u16 wIndex; // THIS BSS element entry index
void* psadapter; // pointer to THIS adapter
OS_TIMER nTimer; // MLME timer
struct timer_list timer; // MLME timer
// Authentication
u16 wAuthAlgo; // peer MAC MLME use Auth algorithm, default OPEN_AUTH
......
......@@ -84,24 +84,5 @@
#define OS_MEMORY_CLEAR( _A, _S ) memset( (u8 *)_A,0,_S)
#define OS_MEMORY_COMPARE( _A, _B, _S ) (memcmp(_A,_B,_S)? 0 : 1) // Definition is reverse with Ndis 1: the same 0: different
#define OS_TIMER struct timer_list
#define OS_TIMER_INITIAL( _T, _F, _P ) \
{ \
init_timer( _T ); \
(_T)->function = (void *)_F##_1a; \
(_T)->data = (unsigned long)_P; \
}
// _S : Millisecond
// 20060420 At least 1 large than jiffies
#define OS_TIMER_SET( _T, _S ) \
{ \
(_T)->expires = jiffies + ((_S*HZ+999)/1000);\
add_timer( _T ); \
}
#define OS_TIMER_CANCEL( _T, _B ) del_timer_sync( _T )
#define OS_TIMER_GET_SYS_TIME( _T ) (*_T=jiffies)
#endif // COMMON_DEF
......@@ -12,13 +12,7 @@ extern void DataDmp(u8 *pdata, u32 len, u32 offset);
void vRxTimerInit(struct wb35_adapter *adapter);
void vRxTimerStart(struct wb35_adapter *adapter, int timeout_value);
void RxTimerHandler_1a( struct wb35_adapter *adapter);
void vRxTimerStop(struct wb35_adapter *adapter);
void RxTimerHandler( void* SystemSpecific1,
struct wb35_adapter * adapter,
void* SystemSpecific2,
void* SystemSpecific3);
// For Asynchronous indicating. The routine collocates with USB.
void Mds_MsduProcess( struct wb35_adapter *adapter, PRXLAYER1 pRxLayer1, u8 SlotIndex);
......
......@@ -133,8 +133,7 @@ typedef struct _MDS
u8 boCounterMeasureBlock;
u8 reserved_4[2];
//NDIS_MINIPORT_TIMER nTimer;
OS_TIMER nTimer;
struct timer_list timer;
u32 TxTsc; // 20060214
u32 TxTsc_2; // 20060214
......
#include "os_common.h"
void vRxTimerInit(struct wb35_adapter * adapter)
static void RxTimerHandler(unsigned long data)
{
OS_TIMER_INITIAL(&(adapter->Mds.nTimer), (void*) RxTimerHandler, (void*) adapter);
WARN_ON(1);
}
void vRxTimerStart(struct wb35_adapter * adapter, int timeout_value)
void vRxTimerInit(struct wb35_adapter *adapter)
{
if (timeout_value<MIN_TIMEOUT_VAL)
timeout_value=MIN_TIMEOUT_VAL;
OS_TIMER_SET( &(adapter->Mds.nTimer), timeout_value );
init_timer(&adapter->Mds.timer);
adapter->Mds.timer.function = RxTimerHandler;
adapter->Mds.timer.data = (unsigned long) adapter;
}
void vRxTimerStop(struct wb35_adapter * adapter)
void vRxTimerStart(struct wb35_adapter *adapter, int timeout_value)
{
OS_TIMER_CANCEL( &(adapter->Mds.nTimer), 0 );
}
if (timeout_value < MIN_TIMEOUT_VAL)
timeout_value = MIN_TIMEOUT_VAL;
void RxTimerHandler_1a( struct wb35_adapter * adapter)
{
RxTimerHandler(NULL, adapter, NULL, NULL);
adapter->Mds.timer.expires = jiffies + msecs_to_jiffies(timeout_value);
add_timer(&adapter->Mds.timer);
}
void RxTimerHandler(void* SystemSpecific1, struct wb35_adapter * adapter,
void* SystemSpecific2, void* SystemSpecific3)
void vRxTimerStop(struct wb35_adapter *adapter)
{
WARN_ON(1);
del_timer_sync(&adapter->Mds.timer);
}
......@@ -62,8 +62,7 @@ typedef struct _SCAN_PARAMETERS
u8 boCCAbusy; // Wb: HWMAC CCA busy status
u8 reserved_2;
//NDIS_MINIPORT_TIMER nTimer;
OS_TIMER nTimer;
struct timer_list timer;
u32 ScanTimeStamp; //Increase 1 per background scan(1 minute)
u32 BssTimeStamp; //Increase 1 per connect status check
......
......@@ -106,8 +106,7 @@ typedef struct _SME_PARAMETERS
u8 bDesiredPowerSave;
// SME timer and timeout value
//NDIS_MINIPORT_TIMER nTimer;
OS_TIMER nTimer;
struct timer_list timer;
u8 boInTimerHandler;
u8 boAuthRetryActive;
......
This diff is collapsed.
......@@ -68,8 +68,6 @@ s32 hal_get_rssi( phw_data_t pHwData, u32 *HalRssiArry, u8 Count );
s32 hal_get_rssi_bss( phw_data_t pHwData, u16 idx, u8 Count );
void hal_set_connect_info( phw_data_t pHwData, unsigned char boConnect );
u8 hal_get_est_sq3( phw_data_t pHwData, u8 Count );
void hal_led_control_1a( phw_data_t pHwData );
void hal_led_control( void* S1, phw_data_t pHwData, void* S3, void* S4 );
void hal_set_rf_power( phw_data_t pHwData, u8 PowerIndex ); // 20060621 Modify
void hal_reset_counter( phw_data_t pHwData );
void hal_set_radio_mode( phw_data_t pHwData, unsigned char boValue);
......
......@@ -510,7 +510,7 @@ typedef struct _HW_DATA_T
WB35TX Wb35Tx; // Need Wb35Tx.h
WB35RX Wb35Rx; // Need Wb35Rx.h
OS_TIMER LEDTimer;// For LED
struct timer_list LEDTimer;// For LED
u32 LEDpoint;// For LED
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment