staging: r8188eu: Remove wrappers for atomic operations
These wrappers were useful when this driver had the hooks for Windows, but are no longer needed. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Link: https://lore.kernel.org/r/20210802192721.23110-4-Larry.Finger@lwfinger.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
85143bdc73
commit
8cc35e0d4d
drivers/staging/r8188eu
@ -64,7 +64,7 @@ int _rtw_init_evt_priv(struct evt_priv *pevtpriv)
|
||||
int res = _SUCCESS;
|
||||
|
||||
/* allocate DMA-able/Non-Page memory for cmd_buf and rsp_buf */
|
||||
ATOMIC_SET(&pevtpriv->event_seq, 0);
|
||||
atomic_set(&pevtpriv->event_seq, 0);
|
||||
pevtpriv->evt_done_cnt = 0;
|
||||
|
||||
_init_workitem(&pevtpriv->c2h_wk, c2h_wk_callback, NULL);
|
||||
|
@ -204,7 +204,7 @@ static void init_mlme_ext_priv_value(struct adapter *padapter)
|
||||
_12M_RATE_, _24M_RATE_, 0xff,
|
||||
};
|
||||
|
||||
ATOMIC_SET(&pmlmeext->event_seq, 0);
|
||||
atomic_set(&pmlmeext->event_seq, 0);
|
||||
pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */
|
||||
|
||||
pmlmeext->cur_channel = padapter->registrypriv.channel;
|
||||
@ -6989,7 +6989,7 @@ void report_survey_event(struct adapter *padapter, struct recv_frame *precv_fram
|
||||
pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd);
|
||||
pc2h_evt_hdr->len = sizeof(struct survey_event);
|
||||
pc2h_evt_hdr->ID = GEN_EVT_CODE(_Survey);
|
||||
pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq);
|
||||
pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq);
|
||||
|
||||
psurvey_evt = (struct survey_event *)(pevtcmd + sizeof(struct C2HEvent_Header));
|
||||
|
||||
@ -7039,7 +7039,7 @@ void report_surveydone_event(struct adapter *padapter)
|
||||
pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd);
|
||||
pc2h_evt_hdr->len = sizeof(struct surveydone_event);
|
||||
pc2h_evt_hdr->ID = GEN_EVT_CODE(_SurveyDone);
|
||||
pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq);
|
||||
pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq);
|
||||
|
||||
psurveydone_evt = (struct surveydone_event *)(pevtcmd + sizeof(struct C2HEvent_Header));
|
||||
psurveydone_evt->bss_cnt = pmlmeext->sitesurvey_res.bss_cnt;
|
||||
@ -7083,7 +7083,7 @@ void report_join_res(struct adapter *padapter, int res)
|
||||
pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd);
|
||||
pc2h_evt_hdr->len = sizeof(struct joinbss_event);
|
||||
pc2h_evt_hdr->ID = GEN_EVT_CODE(_JoinBss);
|
||||
pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq);
|
||||
pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq);
|
||||
|
||||
pjoinbss_evt = (struct joinbss_event *)(pevtcmd + sizeof(struct C2HEvent_Header));
|
||||
memcpy((unsigned char *)(&(pjoinbss_evt->network.network)), &(pmlmeinfo->network), sizeof(struct wlan_bssid_ex));
|
||||
@ -7132,7 +7132,7 @@ void report_del_sta_event(struct adapter *padapter, unsigned char *MacAddr, unsi
|
||||
pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd);
|
||||
pc2h_evt_hdr->len = sizeof(struct stadel_event);
|
||||
pc2h_evt_hdr->ID = GEN_EVT_CODE(_DelSTA);
|
||||
pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq);
|
||||
pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq);
|
||||
|
||||
pdel_sta_evt = (struct stadel_event *)(pevtcmd + sizeof(struct C2HEvent_Header));
|
||||
memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN);
|
||||
@ -7184,7 +7184,7 @@ void report_add_sta_event(struct adapter *padapter, unsigned char *MacAddr, int
|
||||
pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd);
|
||||
pc2h_evt_hdr->len = sizeof(struct stassoc_event);
|
||||
pc2h_evt_hdr->ID = GEN_EVT_CODE(_AddSTA);
|
||||
pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq);
|
||||
pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq);
|
||||
|
||||
padd_sta_evt = (struct stassoc_event *)(pevtcmd + sizeof(struct C2HEvent_Header));
|
||||
memcpy((unsigned char *)(&(padd_sta_evt->macaddr)), MacAddr, ETH_ALEN);
|
||||
@ -8214,7 +8214,7 @@ u8 mlme_evt_hdl(struct adapter *padapter, unsigned char *pbuf)
|
||||
goto _abort_event_;
|
||||
}
|
||||
|
||||
ATOMIC_INC(&pevt_priv->event_seq);
|
||||
atomic_inc(&pevt_priv->event_seq);
|
||||
|
||||
peventbuf += 2;
|
||||
|
||||
|
@ -178,7 +178,7 @@ struct dvobj_priv {
|
||||
struct usb_interface *pusbintf;
|
||||
struct usb_device *pusbdev;
|
||||
|
||||
ATOMIC_T continual_urb_error;
|
||||
atomic_t continual_urb_error;
|
||||
u8 signal_strength;
|
||||
};
|
||||
|
||||
|
@ -335,20 +335,6 @@ void rtw_suspend_lock_uninit(void);
|
||||
void rtw_lock_suspend(void);
|
||||
void rtw_unlock_suspend(void);
|
||||
|
||||
/* Atomic integer operations */
|
||||
#define ATOMIC_T atomic_t
|
||||
|
||||
void ATOMIC_SET(ATOMIC_T *v, int i);
|
||||
int ATOMIC_READ(ATOMIC_T *v);
|
||||
void ATOMIC_ADD(ATOMIC_T *v, int i);
|
||||
void ATOMIC_SUB(ATOMIC_T *v, int i);
|
||||
void ATOMIC_INC(ATOMIC_T *v);
|
||||
void ATOMIC_DEC(ATOMIC_T *v);
|
||||
int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i);
|
||||
int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i);
|
||||
int ATOMIC_INC_RETURN(ATOMIC_T *v);
|
||||
int ATOMIC_DEC_RETURN(ATOMIC_T *v);
|
||||
|
||||
struct rtw_netdev_priv_indicator {
|
||||
void *priv;
|
||||
u32 sizeof_priv;
|
||||
|
@ -53,7 +53,7 @@ struct evt_priv {
|
||||
bool c2h_wk_alive;
|
||||
struct rtw_cbuf *c2h_queue;
|
||||
#define C2H_QUEUE_MAX_LEN 10
|
||||
ATOMIC_T event_seq;
|
||||
atomic_t event_seq;
|
||||
u8 *evt_buf; /* shall be non-paged, and 4 bytes aligned */
|
||||
u8 *evt_allocated_buf;
|
||||
u32 evt_done_cnt;
|
||||
|
@ -382,7 +382,7 @@ struct p2p_oper_class_map {
|
||||
struct mlme_ext_priv {
|
||||
struct adapter *padapter;
|
||||
u8 mlmeext_init;
|
||||
ATOMIC_T event_seq;
|
||||
atomic_t event_seq;
|
||||
u16 mgnt_seq;
|
||||
|
||||
unsigned char cur_channel;
|
||||
|
@ -38,7 +38,7 @@ static inline int rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
int ret = false;
|
||||
int value;
|
||||
value = ATOMIC_INC_RETURN(&dvobj->continual_urb_error);
|
||||
value = atomic_inc_return(&dvobj->continual_urb_error);
|
||||
if (value > MAX_CONTINUAL_URB_ERR) {
|
||||
DBG_88E("[dvobj:%p][ERROR] continual_urb_error:%d > %d\n",
|
||||
dvobj, value, MAX_CONTINUAL_URB_ERR);
|
||||
@ -52,7 +52,7 @@ static inline int rtw_inc_and_chk_continual_urb_error(struct dvobj_priv *dvobj)
|
||||
*/
|
||||
static inline void rtw_reset_continual_urb_error(struct dvobj_priv *dvobj)
|
||||
{
|
||||
ATOMIC_SET(&dvobj->continual_urb_error, 0);
|
||||
atomic_set(&dvobj->continual_urb_error, 0);
|
||||
}
|
||||
|
||||
#define USB_HIGH_SPEED_BULK_SIZE 512
|
||||
|
@ -207,56 +207,6 @@ inline void rtw_unlock_suspend(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline void ATOMIC_SET(ATOMIC_T *v, int i)
|
||||
{
|
||||
atomic_set(v, i);
|
||||
}
|
||||
|
||||
inline int ATOMIC_READ(ATOMIC_T *v)
|
||||
{
|
||||
return atomic_read(v);
|
||||
}
|
||||
|
||||
inline void ATOMIC_ADD(ATOMIC_T *v, int i)
|
||||
{
|
||||
atomic_add(i, v);
|
||||
}
|
||||
|
||||
inline void ATOMIC_SUB(ATOMIC_T *v, int i)
|
||||
{
|
||||
atomic_sub(i, v);
|
||||
}
|
||||
|
||||
inline void ATOMIC_INC(ATOMIC_T *v)
|
||||
{
|
||||
atomic_inc(v);
|
||||
}
|
||||
|
||||
inline void ATOMIC_DEC(ATOMIC_T *v)
|
||||
{
|
||||
atomic_dec(v);
|
||||
}
|
||||
|
||||
inline int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i)
|
||||
{
|
||||
return atomic_add_return(i, v);
|
||||
}
|
||||
|
||||
inline int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i)
|
||||
{
|
||||
return atomic_sub_return(i, v);
|
||||
}
|
||||
|
||||
inline int ATOMIC_INC_RETURN(ATOMIC_T *v)
|
||||
{
|
||||
return atomic_inc_return(v);
|
||||
}
|
||||
|
||||
inline int ATOMIC_DEC_RETURN(ATOMIC_T *v)
|
||||
{
|
||||
return atomic_dec_return(v);
|
||||
}
|
||||
|
||||
static const struct device_type wlan_type = {
|
||||
.name = "wlan",
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user