rtl8188eu: Convert typedef for _sema and _pwrlock to struct semaphore

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-07-24 14:17:51 -05:00
parent 73f9c27ffd
commit 5f133c3764
10 changed files with 23 additions and 30 deletions

View file

@ -204,7 +204,7 @@ struct dvobj_priv
u8 RtNumOutPipes;
int ep_num[5]; //endpoint number
int RegUsbSS;
_sema usb_suspend_sema;
struct semaphore usb_suspend_sema;
struct mutex usb_vendor_req_mutex;
u8 * usb_alloc_vendor_req_buf;

View file

@ -52,7 +52,7 @@ The protection mechanism is through the pending queue.
struct urb * piorw_urb;
u8 io_irp_cnt;
u8 bio_irp_pending;
_sema io_retevt;
struct semaphore io_retevt;
_timer io_timer;
u8 bio_irp_timeout;
u8 bio_timer_cancel;

View file

@ -69,7 +69,6 @@
#include <linux/usb/ch9.h>
#endif
typedef struct semaphore _sema;
typedef spinlock_t _lock;
typedef struct timer_list _timer;
@ -379,10 +378,10 @@ extern void rtw_list_insert_head(_list *plist, _list *phead);
extern void rtw_list_insert_tail(_list *plist, _list *phead);
extern void rtw_list_delete(_list *plist);
extern void _rtw_init_sema(_sema *sema, int init_val);
extern void _rtw_free_sema(_sema *sema);
extern void _rtw_up_sema(_sema *sema);
extern u32 _rtw_down_sema(_sema *sema);
extern void _rtw_init_sema(struct semaphore *sema, int init_val);
extern void _rtw_free_sema(struct semaphore *sema);
extern void _rtw_up_sema(struct semaphore *sema);
extern u32 _rtw_down_sema(struct semaphore *sema);
extern void _rtw_mutex_init(struct mutex *pmutex);
extern void _rtw_mutex_free(struct mutex *pmutex);
extern void _rtw_spinlock_init(_lock *plock);

View file

@ -46,14 +46,12 @@ struct cmd_obj {
u32 cmdsz;
u8 *rsp;
u32 rspsz;
//_sema cmd_sem;
_list list;
};
struct cmd_priv {
_sema cmd_queue_sema;
//_sema cmd_done_sema;
_sema terminate_cmdthread_sema;
struct semaphore cmd_queue_sema;
struct semaphore terminate_cmdthread_sema;
_queue cmd_queue;
u8 cmd_seq;
u8 *cmd_buf; //shall be non-paged, and 4 bytes aligned

View file

@ -155,7 +155,7 @@ struct io_req {
u32 command;
u32 status;
u8 *pbuf;
_sema sema;
struct semaphore sema;
void (*_async_io_callback)(_adapter *padater, struct io_req *pio_req, u8 *cnxt);
u8 *cnxt;

View file

@ -199,7 +199,7 @@ typedef struct _MPT_CONTEXT
// Indicate if the driver is unloading or unloaded.
bool bMptDrvUnload;
_sema MPh2c_Sema;
struct semaphore MPh2c_Sema;
_timer MPh2c_timeout_timer;
// Event used to sync H2c for BT control

View file

@ -104,28 +104,24 @@ struct reportpwrstate_parm {
unsigned short rsvd;
};
typedef _sema _pwrlock;
__inline static void _init_pwrlock(_pwrlock *plock)
__inline static void _init_pwrlock(struct semaphore *plock)
{
_rtw_init_sema(plock, 1);
}
__inline static void _free_pwrlock(_pwrlock *plock)
__inline static void _free_pwrlock(struct semaphore *plock)
{
_rtw_free_sema(plock);
}
__inline static void _enter_pwrlock(_pwrlock *plock)
__inline static void _enter_pwrlock(struct semaphore *plock)
{
_rtw_down_sema(plock);
}
__inline static void _exit_pwrlock(_pwrlock *plock)
__inline static void _exit_pwrlock(struct semaphore *plock)
{
_rtw_up_sema(plock);
}
@ -178,7 +174,7 @@ enum { // for ips_mode
struct pwrctrl_priv
{
_pwrlock lock;
struct semaphore lock;
volatile u8 rpwm; // requested power state for fw
volatile u8 cpwm; // fw current power state. updated when 1. read from HCPWM 2. driver lowers power level
volatile u8 tog; // toggling

View file

@ -210,7 +210,7 @@ struct recv_priv
uint rx_largepacket_crcerr;
uint rx_smallpacket_crcerr;
uint rx_middlepacket_crcerr;
_sema allrxreturnevt;
struct semaphore allrxreturnevt;
uint ff_hwaddr;
u8 rx_pending_cnt;

View file

@ -296,8 +296,8 @@ struct xmit_priv {
_lock lock;
_sema xmit_sema;
_sema terminate_xmitthread_sema;
struct semaphore xmit_sema;
struct semaphore terminate_xmitthread_sema;
//_queue blk_strms[MAX_NUMBLKS];
_queue be_pending;
@ -343,7 +343,7 @@ struct xmit_priv {
u8 hwxmit_entry;
u8 wmm_para_seq[4];//sequence for wmm ac parameter strength from large to small. it's value is 0->vo, 1->vi, 2->be, 3->bk.
_sema tx_retevt;//all tx return event;
struct semaphore tx_retevt;//all tx return event;
u8 txirp_cnt;//
struct tasklet_struct xmit_tasklet;
//per AC pending irp

View file

@ -177,21 +177,21 @@ void rtw_list_insert_tail(_list *plist, _list *phead)
Caller must check if the list is empty before calling rtw_list_delete
*/
void _rtw_init_sema(_sema *sema, int init_val)
void _rtw_init_sema(struct semaphore *sema, int init_val)
{
sema_init(sema, init_val);
}
void _rtw_free_sema(_sema *sema)
void _rtw_free_sema(struct semaphore *sema)
{
}
void _rtw_up_sema(_sema *sema)
void _rtw_up_sema(struct semaphore *sema)
{
up(sema);
}
u32 _rtw_down_sema(_sema *sema)
u32 _rtw_down_sema(struct semaphore *sema)
{
if (down_interruptible(sema))
return _FAIL;