mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2024-11-10 07:29:40 +00:00
rtl8188eu: Convert typedef for _sema and _pwrlock to struct semaphore
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
73f9c27ffd
commit
5f133c3764
10 changed files with 23 additions and 30 deletions
|
@ -204,7 +204,7 @@ struct dvobj_priv
|
||||||
u8 RtNumOutPipes;
|
u8 RtNumOutPipes;
|
||||||
int ep_num[5]; //endpoint number
|
int ep_num[5]; //endpoint number
|
||||||
int RegUsbSS;
|
int RegUsbSS;
|
||||||
_sema usb_suspend_sema;
|
struct semaphore usb_suspend_sema;
|
||||||
struct mutex usb_vendor_req_mutex;
|
struct mutex usb_vendor_req_mutex;
|
||||||
|
|
||||||
u8 * usb_alloc_vendor_req_buf;
|
u8 * usb_alloc_vendor_req_buf;
|
||||||
|
|
|
@ -52,7 +52,7 @@ The protection mechanism is through the pending queue.
|
||||||
struct urb * piorw_urb;
|
struct urb * piorw_urb;
|
||||||
u8 io_irp_cnt;
|
u8 io_irp_cnt;
|
||||||
u8 bio_irp_pending;
|
u8 bio_irp_pending;
|
||||||
_sema io_retevt;
|
struct semaphore io_retevt;
|
||||||
_timer io_timer;
|
_timer io_timer;
|
||||||
u8 bio_irp_timeout;
|
u8 bio_irp_timeout;
|
||||||
u8 bio_timer_cancel;
|
u8 bio_timer_cancel;
|
||||||
|
|
|
@ -69,7 +69,6 @@
|
||||||
#include <linux/usb/ch9.h>
|
#include <linux/usb/ch9.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct semaphore _sema;
|
|
||||||
typedef spinlock_t _lock;
|
typedef spinlock_t _lock;
|
||||||
typedef struct timer_list _timer;
|
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_insert_tail(_list *plist, _list *phead);
|
||||||
extern void rtw_list_delete(_list *plist);
|
extern void rtw_list_delete(_list *plist);
|
||||||
|
|
||||||
extern void _rtw_init_sema(_sema *sema, int init_val);
|
extern void _rtw_init_sema(struct semaphore *sema, int init_val);
|
||||||
extern void _rtw_free_sema(_sema *sema);
|
extern void _rtw_free_sema(struct semaphore *sema);
|
||||||
extern void _rtw_up_sema(_sema *sema);
|
extern void _rtw_up_sema(struct semaphore *sema);
|
||||||
extern u32 _rtw_down_sema(_sema *sema);
|
extern u32 _rtw_down_sema(struct semaphore *sema);
|
||||||
extern void _rtw_mutex_init(struct mutex *pmutex);
|
extern void _rtw_mutex_init(struct mutex *pmutex);
|
||||||
extern void _rtw_mutex_free(struct mutex *pmutex);
|
extern void _rtw_mutex_free(struct mutex *pmutex);
|
||||||
extern void _rtw_spinlock_init(_lock *plock);
|
extern void _rtw_spinlock_init(_lock *plock);
|
||||||
|
|
|
@ -46,14 +46,12 @@ struct cmd_obj {
|
||||||
u32 cmdsz;
|
u32 cmdsz;
|
||||||
u8 *rsp;
|
u8 *rsp;
|
||||||
u32 rspsz;
|
u32 rspsz;
|
||||||
//_sema cmd_sem;
|
|
||||||
_list list;
|
_list list;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cmd_priv {
|
struct cmd_priv {
|
||||||
_sema cmd_queue_sema;
|
struct semaphore cmd_queue_sema;
|
||||||
//_sema cmd_done_sema;
|
struct semaphore terminate_cmdthread_sema;
|
||||||
_sema terminate_cmdthread_sema;
|
|
||||||
_queue cmd_queue;
|
_queue cmd_queue;
|
||||||
u8 cmd_seq;
|
u8 cmd_seq;
|
||||||
u8 *cmd_buf; //shall be non-paged, and 4 bytes aligned
|
u8 *cmd_buf; //shall be non-paged, and 4 bytes aligned
|
||||||
|
|
|
@ -155,7 +155,7 @@ struct io_req {
|
||||||
u32 command;
|
u32 command;
|
||||||
u32 status;
|
u32 status;
|
||||||
u8 *pbuf;
|
u8 *pbuf;
|
||||||
_sema sema;
|
struct semaphore sema;
|
||||||
|
|
||||||
void (*_async_io_callback)(_adapter *padater, struct io_req *pio_req, u8 *cnxt);
|
void (*_async_io_callback)(_adapter *padater, struct io_req *pio_req, u8 *cnxt);
|
||||||
u8 *cnxt;
|
u8 *cnxt;
|
||||||
|
|
|
@ -199,7 +199,7 @@ typedef struct _MPT_CONTEXT
|
||||||
// Indicate if the driver is unloading or unloaded.
|
// Indicate if the driver is unloading or unloaded.
|
||||||
bool bMptDrvUnload;
|
bool bMptDrvUnload;
|
||||||
|
|
||||||
_sema MPh2c_Sema;
|
struct semaphore MPh2c_Sema;
|
||||||
_timer MPh2c_timeout_timer;
|
_timer MPh2c_timeout_timer;
|
||||||
// Event used to sync H2c for BT control
|
// Event used to sync H2c for BT control
|
||||||
|
|
||||||
|
|
|
@ -104,28 +104,24 @@ struct reportpwrstate_parm {
|
||||||
unsigned short rsvd;
|
unsigned short rsvd;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
__inline static void _init_pwrlock(struct semaphore *plock)
|
||||||
typedef _sema _pwrlock;
|
|
||||||
|
|
||||||
|
|
||||||
__inline static void _init_pwrlock(_pwrlock *plock)
|
|
||||||
{
|
{
|
||||||
_rtw_init_sema(plock, 1);
|
_rtw_init_sema(plock, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
__inline static void _free_pwrlock(_pwrlock *plock)
|
__inline static void _free_pwrlock(struct semaphore *plock)
|
||||||
{
|
{
|
||||||
_rtw_free_sema(plock);
|
_rtw_free_sema(plock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__inline static void _enter_pwrlock(_pwrlock *plock)
|
__inline static void _enter_pwrlock(struct semaphore *plock)
|
||||||
{
|
{
|
||||||
_rtw_down_sema(plock);
|
_rtw_down_sema(plock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
__inline static void _exit_pwrlock(_pwrlock *plock)
|
__inline static void _exit_pwrlock(struct semaphore *plock)
|
||||||
{
|
{
|
||||||
_rtw_up_sema(plock);
|
_rtw_up_sema(plock);
|
||||||
}
|
}
|
||||||
|
@ -178,7 +174,7 @@ enum { // for ips_mode
|
||||||
|
|
||||||
struct pwrctrl_priv
|
struct pwrctrl_priv
|
||||||
{
|
{
|
||||||
_pwrlock lock;
|
struct semaphore lock;
|
||||||
volatile u8 rpwm; // requested power state for fw
|
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 cpwm; // fw current power state. updated when 1. read from HCPWM 2. driver lowers power level
|
||||||
volatile u8 tog; // toggling
|
volatile u8 tog; // toggling
|
||||||
|
|
|
@ -210,7 +210,7 @@ struct recv_priv
|
||||||
uint rx_largepacket_crcerr;
|
uint rx_largepacket_crcerr;
|
||||||
uint rx_smallpacket_crcerr;
|
uint rx_smallpacket_crcerr;
|
||||||
uint rx_middlepacket_crcerr;
|
uint rx_middlepacket_crcerr;
|
||||||
_sema allrxreturnevt;
|
struct semaphore allrxreturnevt;
|
||||||
uint ff_hwaddr;
|
uint ff_hwaddr;
|
||||||
u8 rx_pending_cnt;
|
u8 rx_pending_cnt;
|
||||||
|
|
||||||
|
|
|
@ -296,8 +296,8 @@ struct xmit_priv {
|
||||||
|
|
||||||
_lock lock;
|
_lock lock;
|
||||||
|
|
||||||
_sema xmit_sema;
|
struct semaphore xmit_sema;
|
||||||
_sema terminate_xmitthread_sema;
|
struct semaphore terminate_xmitthread_sema;
|
||||||
|
|
||||||
//_queue blk_strms[MAX_NUMBLKS];
|
//_queue blk_strms[MAX_NUMBLKS];
|
||||||
_queue be_pending;
|
_queue be_pending;
|
||||||
|
@ -343,7 +343,7 @@ struct xmit_priv {
|
||||||
u8 hwxmit_entry;
|
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.
|
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;//
|
u8 txirp_cnt;//
|
||||||
struct tasklet_struct xmit_tasklet;
|
struct tasklet_struct xmit_tasklet;
|
||||||
//per AC pending irp
|
//per AC pending irp
|
||||||
|
|
|
@ -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
|
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);
|
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);
|
up(sema);
|
||||||
}
|
}
|
||||||
|
|
||||||
u32 _rtw_down_sema(_sema *sema)
|
u32 _rtw_down_sema(struct semaphore *sema)
|
||||||
{
|
{
|
||||||
if (down_interruptible(sema))
|
if (down_interruptible(sema))
|
||||||
return _FAIL;
|
return _FAIL;
|
||||||
|
|
Loading…
Reference in a new issue