From 1401b54fd04fb46a36d9e3e7b3f7dff0194cc00d Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 29 Jul 2021 12:09:25 -0500 Subject: [PATCH 01/16] Remove empty header file File include/drv_types_linux.h is empty. Remove it. Adaptation of: https://lore.kernel.org/r/20210729170930.23171-2-Larry.Finger@lwfinger.net --- include/drv_types.h | 4 ---- include/drv_types_linux.h | 19 ------------------- 2 files changed, 23 deletions(-) delete mode 100644 include/drv_types_linux.h diff --git a/include/drv_types.h b/include/drv_types.h index dd68cdb..a41f581 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -42,10 +42,6 @@ #include #endif -#ifdef PLATFORM_LINUX - #include -#endif - enum _NIC_VERSION { RTL8711_NIC, diff --git a/include/drv_types_linux.h b/include/drv_types_linux.h deleted file mode 100644 index 91ca68b..0000000 --- a/include/drv_types_linux.h +++ /dev/null @@ -1,19 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ -#ifndef __DRV_TYPES_LINUX_H__ -#define __DRV_TYPES_LINUX_H__ - - -#endif From ac1790da7c44b7964324ea813de29553f0c198e3 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jul 2021 11:24:12 +0200 Subject: [PATCH 02/16] remove rtw_mfree2d() function It is just a wrapper around kfree(), so remove it and just call kfree() instead. Adaptation of: https://lore.kernel.org/r/20210730092417.1014392-7-gregkh@linuxfoundation.org --- hal/rtl8192e/rtl8192e_hal_init.c | 5 ++--- include/osdep_service.h | 1 - os_dep/osdep_service.c | 5 ----- 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index 8705aec..d8e756d 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -1178,7 +1178,7 @@ Hal_EfusePowerSwitch8192E( if (bWrite == _TRUE) { /* Enable LDO 2.5V before read/write action */ tempval = rtw_read8(pAdapter, EFUSE_TEST + 3); - tempval &= 0x07; /* 0x34[30:27] = 4¡¦1110 => LDOE25 voltage select to 2.25V Suggested by SD1 Jackie & DD -Tm_lin */ + tempval &= 0x07; /* 0x34[30:27] = 4��1110 => LDOE25 voltage select to 2.25V Suggested by SD1 Jackie & DD -Tm_lin */ /* tempval |= (VOLTAGE_V25 << 4); */ tempval |= 0x70; rtw_write8(pAdapter, EFUSE_TEST + 3, (tempval | 0x80)); @@ -1429,8 +1429,7 @@ exit: if (efuseTbl) rtw_mfree(efuseTbl, EFUSE_MAP_LEN_8192E); - if (eFuseWord) - rtw_mfree2d((void *)eFuseWord, EFUSE_MAX_SECTION_8192E, EFUSE_MAX_WORD_UNIT, sizeof(u16)); + kfree(eFuseWord); } static VOID diff --git a/include/osdep_service.h b/include/osdep_service.h index 7d13e01..16a7e75 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -288,7 +288,6 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a #endif /* DBG_MEM_ALLOC */ extern void *rtw_malloc2d(int h, int w, size_t size); -extern void rtw_mfree2d(void *pbuf, int h, int w, int size); void rtw_os_pkt_free(_pkt *pkt); _pkt *rtw_os_pkt_copy(_pkt *pkt); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index df1697c..7794059 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -873,11 +873,6 @@ void *rtw_malloc2d(int h, int w, size_t size) return a; } -void rtw_mfree2d(void *pbuf, int h, int w, int size) -{ - rtw_mfree((u8 *)pbuf, h * sizeof(void *) + w * h * size); -} - inline void rtw_os_pkt_free(_pkt *pkt) { #if defined(PLATFORM_LINUX) From 361918ceb1771d57675ead55375273699cf976f0 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jul 2021 11:24:14 +0200 Subject: [PATCH 03/16] remove unused enum _NIC_VERSION None of these enumerated values were used anywhere in the driver, so just remove them all. Link: https://lore.kernel.org/r/20210730092417.1014392-9-gregkh@linuxfoundation.org --- include/drv_types.h | 9 --------- 1 file changed, 9 deletions(-) diff --git a/include/drv_types.h b/include/drv_types.h index a41f581..3262a8f 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -42,15 +42,6 @@ #include #endif -enum _NIC_VERSION { - - RTL8711_NIC, - RTL8712_NIC, - RTL8713_NIC, - RTL8716_NIC - -}; - typedef struct _ADAPTER _adapter, ADAPTER, *PADAPTER; #include From ca6e4a43f736d46830f75d18d233ebe4f35ad5e5 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jul 2021 11:24:15 +0200 Subject: [PATCH 04/16] remove include/nic_spec.h No one was including this file, so just remove it. Link: https://lore.kernel.org/r/20210730092417.1014392-10-gregkh@linuxfoundation.org --- include/nic_spec.h | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 include/nic_spec.h diff --git a/include/nic_spec.h b/include/nic_spec.h deleted file mode 100644 index 913ef9b..0000000 --- a/include/nic_spec.h +++ /dev/null @@ -1,41 +0,0 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ - - -#ifndef __NIC_SPEC_H__ -#define __NIC_SPEC_H__ - -#include - -#define RTL8711_MCTRL_ (0x20000) -#define RTL8711_UART_ (0x30000) -#define RTL8711_TIMER_ (0x40000) -#define RTL8711_FINT_ (0x50000) -#define RTL8711_HINT_ (0x50000) -#define RTL8711_GPIO_ (0x60000) -#define RTL8711_WLANCTRL_ (0x200000) -#define RTL8711_WLANFF_ (0xe00000) -#define RTL8711_HCICTRL_ (0x600000) -#define RTL8711_SYSCFG_ (0x620000) -#define RTL8711_SYSCTRL_ (0x620000) -#define RTL8711_MCCTRL_ (0x020000) - - -#include - -#include - - -#endif /* __RTL8711_SPEC_H__ */ From 904e95f373bfd9cc0ecc67b12c8cd160bea3f834 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jul 2021 11:24:16 +0200 Subject: [PATCH 05/16] remove rtw_usb_bulk_msg() macro No one is using this wrapper macro, so just remove it as it is pointless. Link: https://lore.kernel.org/r/20210730092417.1014392-11-gregkh@linuxfoundation.org --- include/osdep_service_bsd.h | 106 ++++++++++++++++++------------------ include/usb_ops_linux.h | 5 -- 2 files changed, 52 insertions(+), 59 deletions(-) diff --git a/include/osdep_service_bsd.h b/include/osdep_service_bsd.h index 4773f05..576d82a 100644 --- a/include/osdep_service_bsd.h +++ b/include/osdep_service_bsd.h @@ -1,17 +1,17 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ +/****************************************************************************** + * + * Copyright(c) 2007 - 2017 Realtek Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + *****************************************************************************/ #ifndef __OSDEP_BSD_SERVICE_H_ #define __OSDEP_BSD_SERVICE_H_ @@ -129,10 +129,10 @@ * */ struct rtw_timer_list { - struct callout callout; - void (*function)(void *); - void *arg; -}; + struct callout callout; + void (*function)(void *); + void *arg; +}; struct workqueue_struct; struct work_struct; @@ -545,8 +545,6 @@ void rtw_usb_set_intfdata(struct usb_interface *intf, void *data); void rtw_usb_fill_bulk_urb(struct urb *urb, struct usb_device *udev, struct usb_host_endpoint *uhe, void *buf, int length, usb_complete_t callback, void *arg); -int rtw_usb_bulk_msg(struct usb_device *udev, struct usb_host_endpoint *uhe, - void *data, int len, uint16_t *pactlen, usb_timeout_t timeout); void *usb_get_intfdata(struct usb_interface *intf); int usb_linux_init_endpoints(struct usb_device *udev); @@ -659,42 +657,42 @@ __inline static void rtw_list_delete(_list *plist) INIT_LIST_HEAD(plist); } -static inline void timer_hdl(void *ctx) -{ - _timer *timer = (_timer *)ctx; - - rtw_mtx_lock(NULL); - if (callout_pending(&timer->callout)) { - /* callout was reset */ - rtw_mtx_unlock(NULL); - return; - } - - if (!callout_active(&timer->callout)) { - /* callout was stopped */ - rtw_mtx_unlock(NULL); - return; - } - - callout_deactivate(&timer->callout); - - timer->function(timer->arg); - - rtw_mtx_unlock(NULL); -} - -static inline void _init_timer(_timer *ptimer, _nic_hdl padapter, void *pfunc, void *cntx) -{ - ptimer->function = pfunc; - ptimer->arg = cntx; - callout_init(&ptimer->callout, CALLOUT_MPSAFE); -} - +static inline void timer_hdl(void *ctx) +{ + _timer *timer = (_timer *)ctx; + + rtw_mtx_lock(NULL); + if (callout_pending(&timer->callout)) { + /* callout was reset */ + rtw_mtx_unlock(NULL); + return; + } + + if (!callout_active(&timer->callout)) { + /* callout was stopped */ + rtw_mtx_unlock(NULL); + return; + } + + callout_deactivate(&timer->callout); + + timer->function(timer->arg); + + rtw_mtx_unlock(NULL); +} + +static inline void _init_timer(_timer *ptimer, _nic_hdl padapter, void *pfunc, void *cntx) +{ + ptimer->function = pfunc; + ptimer->arg = cntx; + callout_init(&ptimer->callout, CALLOUT_MPSAFE); +} + __inline static void _set_timer(_timer *ptimer,u32 delay_time) { - if (ptimer->function && ptimer->arg) { + if (ptimer->function && ptimer->arg) { rtw_mtx_lock(NULL); - callout_reset(&ptimer->callout, delay_time, timer_hdl, ptimer); + callout_reset(&ptimer->callout, delay_time, timer_hdl, ptimer); rtw_mtx_unlock(NULL); } } @@ -704,7 +702,7 @@ __inline static void _cancel_timer(_timer *ptimer,u8 *bcancelled) rtw_mtx_lock(NULL); callout_drain(&ptimer->callout); rtw_mtx_unlock(NULL); - *bcancelled = 1; /* assume an pending timer to be canceled */ + *bcancelled = 1; /* assume an pending timer to be canceled */ } __inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx) diff --git a/include/usb_ops_linux.h b/include/usb_ops_linux.h index bf59ca0..137031b 100644 --- a/include/usb_ops_linux.h +++ b/include/usb_ops_linux.h @@ -47,15 +47,10 @@ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)) #define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \ usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), (timeout_ms)) -#define rtw_usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout_ms) \ - usb_bulk_msg((usb_dev), (pipe), (data), (len), (actual_length), (timeout_ms)) #else #define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \ usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), \ ((timeout_ms) == 0) || ((timeout_ms) * HZ / 1000 > 0) ? ((timeout_ms) * HZ / 1000) : 1) -#define rtw_usb_bulk_msg(usb_dev, pipe, data, len, actual_length, timeout_ms) \ - usb_bulk_msg((usb_dev), (pipe), (data), (len), (actual_length), \ - ((timeout_ms) == 0) || ((timeout_ms) * HZ / 1000 > 0) ? ((timeout_ms) * HZ / 1000) : 1) #endif From 6b5e7665c9fa1def8e69596221d6851e713105c6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 30 Jul 2021 11:24:17 +0200 Subject: [PATCH 06/16] remove rtw_usb_control_msg() macro It is a wrapper around usb_control_msg() that does nothing, so remove the macro and just call the correct USB function instead in the one place it is used. Link: https://lore.kernel.org/r/20210730092417.1014392-12-gregkh@linuxfoundation.org --- include/usb_ops_linux.h | 10 ---------- os_dep/linux/usb_ops_linux.c | 4 ++-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/include/usb_ops_linux.h b/include/usb_ops_linux.h index 137031b..3ec6ac4 100644 --- a/include/usb_ops_linux.h +++ b/include/usb_ops_linux.h @@ -44,16 +44,6 @@ #define usb_read_interrupt_complete(purb, regs) usb_read_interrupt_complete(purb) #endif -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 12)) -#define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \ - usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), (timeout_ms)) -#else -#define rtw_usb_control_msg(dev, pipe, request, requesttype, value, index, data, size, timeout_ms) \ - usb_control_msg((dev), (pipe), (request), (requesttype), (value), (index), (data), (size), \ - ((timeout_ms) == 0) || ((timeout_ms) * HZ / 1000 > 0) ? ((timeout_ms) * HZ / 1000) : 1) -#endif - - #ifdef CONFIG_USB_SUPPORT_ASYNC_VDN_REQ int usb_async_write8(struct intf_hdl *pintfhdl, u32 addr, u8 val); int usb_async_write16(struct intf_hdl *pintfhdl, u32 addr, u16 val); diff --git a/os_dep/linux/usb_ops_linux.c b/os_dep/linux/usb_ops_linux.c index a05446e..709023a 100644 --- a/os_dep/linux/usb_ops_linux.c +++ b/os_dep/linux/usb_ops_linux.c @@ -106,7 +106,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde _rtw_memcpy(pIo_buf, pdata, len); } - status = rtw_usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT); + status = usb_control_msg(udev, pipe, request, reqtype, value, index, pIo_buf, len, RTW_USB_CONTROL_MSG_TIMEOUT); if (status == len) { /* Success this control transfer. */ rtw_reset_continual_io_error(pdvobjpriv); @@ -173,7 +173,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde t_reg = 0x4e0; - status = rtw_usb_control_msg(udev, t_pipe, t_req, t_reqtype, t_reg, t_index, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT); + status = usb_control_msg(udev, t_pipe, t_req, t_reqtype, t_reg, t_index, pIo_buf, t_len, RTW_USB_CONTROL_MSG_TIMEOUT); if (status == t_len) rtw_reset_continual_io_error(pdvobjpriv); From e8b235e056ae0fdf82414d8c1347eb80fbd1ccf0 Mon Sep 17 00:00:00 2001 From: Phillip Potter Date: Sat, 31 Jul 2021 14:38:04 +0100 Subject: [PATCH 07/16] correct set/defined but unused warnings from debug cleanup This patch fixes an existing warning related to an array within include/rtw_security.h not being used. Link: https://lore.kernel.org/r/20210731133804.196631-1-phil@philpotter.co.uk --- include/rtw_security.h | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/include/rtw_security.h b/include/rtw_security.h index 4a530be..c8a60a5 100644 --- a/include/rtw_security.h +++ b/include/rtw_security.h @@ -413,24 +413,6 @@ static inline u32 rotr(u32 val, int bits) (a)[7] = (u8) (((u64) (val)) & 0xff); \ } while (0) -/* the K array */ -static const unsigned long K[64] = { - 0x428a2f98UL, 0x71374491UL, 0xb5c0fbcfUL, 0xe9b5dba5UL, 0x3956c25bUL, - 0x59f111f1UL, 0x923f82a4UL, 0xab1c5ed5UL, 0xd807aa98UL, 0x12835b01UL, - 0x243185beUL, 0x550c7dc3UL, 0x72be5d74UL, 0x80deb1feUL, 0x9bdc06a7UL, - 0xc19bf174UL, 0xe49b69c1UL, 0xefbe4786UL, 0x0fc19dc6UL, 0x240ca1ccUL, - 0x2de92c6fUL, 0x4a7484aaUL, 0x5cb0a9dcUL, 0x76f988daUL, 0x983e5152UL, - 0xa831c66dUL, 0xb00327c8UL, 0xbf597fc7UL, 0xc6e00bf3UL, 0xd5a79147UL, - 0x06ca6351UL, 0x14292967UL, 0x27b70a85UL, 0x2e1b2138UL, 0x4d2c6dfcUL, - 0x53380d13UL, 0x650a7354UL, 0x766a0abbUL, 0x81c2c92eUL, 0x92722c85UL, - 0xa2bfe8a1UL, 0xa81a664bUL, 0xc24b8b70UL, 0xc76c51a3UL, 0xd192e819UL, - 0xd6990624UL, 0xf40e3585UL, 0x106aa070UL, 0x19a4c116UL, 0x1e376c08UL, - 0x2748774cUL, 0x34b0bcb5UL, 0x391c0cb3UL, 0x4ed8aa4aUL, 0x5b9cca4fUL, - 0x682e6ff3UL, 0x748f82eeUL, 0x78a5636fUL, 0x84c87814UL, 0x8cc70208UL, - 0x90befffaUL, 0xa4506cebUL, 0xbef9a3f7UL, 0xc67178f2UL -}; - - /* Various logical functions */ #define RORc(x, y) \ (((((unsigned long) (x) & 0xFFFFFFFFUL) >> (unsigned long) ((y) & 31)) | \ From d7c3737cd5b17fe8dfe81b34f35d122e901b2ca4 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Mon, 2 Aug 2021 14:27:18 -0500 Subject: [PATCH 08/16] Remove wrappers for atomic operations These wrappers were useful when this driver had the hooks for Windows, but are no longer needed. Link: https://lore.kernel.org/r/20210802192721.23110-4-Larry.Finger@lwfinger.net --- core/mesh/rtw_mesh.c | 2 +- core/mesh/rtw_mesh.h | 2 +- core/mesh/rtw_mesh_pathtbl.c | 8 +- core/mesh/rtw_mesh_pathtbl.h | 2 +- core/rtw_ap.c | 26 ++-- core/rtw_cmd.c | 22 ++-- core/rtw_debug.c | 4 +- core/rtw_io.c | 4 +- core/rtw_mlme.c | 6 +- core/rtw_mlme_ext.c | 42 +++---- core/rtw_p2p.c | 8 +- core/rtw_recv.c | 8 +- core/rtw_rm.c | 2 +- core/rtw_rm_fsm.c | 14 +-- core/rtw_sdio.c | 8 +- core/rtw_tdls.c | 14 +-- hal/hal_com.c | 16 +-- hal/hal_dm_acs.h | 12 +- hal/rtl8192e/rtl8192e_phycfg.c | 2 +- hal/rtl8192e/usb/usb_ops_linux.c | 2 +- include/drv_types.h | 39 +++--- include/osdep_service.h | 12 -- include/osdep_service_bsd.h | 3 - include/osdep_service_ce.h | 96 +++++++------- include/osdep_service_linux.h | 2 +- include/osdep_service_xp.h | 94 +++++++------- include/rtw_cmd.h | 4 +- include/rtw_mlme.h | 16 +-- include/rtw_mlme_ext.h | 2 +- include/rtw_pwrctrl.h | 6 +- include/rtw_recv.h | 2 +- include/rtw_rm.h | 2 +- include/sta_info.h | 2 +- os_dep/linux/ioctl_cfg80211.c | 10 +- os_dep/linux/ioctl_cfg80211.h | 2 +- os_dep/linux/ioctl_linux.c | 4 +- os_dep/linux/os_intfs.c | 4 +- os_dep/linux/usb_intf.c | 4 +- os_dep/linux/usb_ops_linux.c | 8 +- os_dep/osdep_service.c | 207 +++++-------------------------- 40 files changed, 284 insertions(+), 439 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 95d0f15..c0099d8 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -3087,7 +3087,7 @@ void rtw_mesh_init_mesh_info(_adapter *adapter) /* minfo->last_sn_update = rtw_get_current_time(); */ minfo->next_perr = rtw_get_current_time(); - ATOMIC_SET(&minfo->mpaths, 0); + atomic_set(&minfo->mpaths, 0); rtw_mesh_pathtbl_init(adapter); _rtw_init_queue(&minfo->mpath_tx_queue); diff --git a/core/mesh/rtw_mesh.h b/core/mesh/rtw_mesh.h index 73694f8..63d66d8 100644 --- a/core/mesh/rtw_mesh.h +++ b/core/mesh/rtw_mesh.h @@ -377,7 +377,7 @@ struct rtw_mesh_info { /* Last used Path Discovery ID */ u32 preq_id; - ATOMIC_T mpaths; + atomic_t mpaths; struct rtw_mesh_table *mesh_paths; struct rtw_mesh_table *mpp_paths; int mesh_paths_generation; diff --git a/core/mesh/rtw_mesh_pathtbl.c b/core/mesh/rtw_mesh_pathtbl.c index 5e778f6..49c3af4 100644 --- a/core/mesh/rtw_mesh_pathtbl.c +++ b/core/mesh/rtw_mesh_pathtbl.c @@ -82,7 +82,7 @@ static struct rtw_mesh_table *rtw_mesh_table_alloc(void) return NULL; rtw_hlist_head_init(&newtbl->known_gates); - ATOMIC_SET(&newtbl->entries, 0); + atomic_set(&newtbl->entries, 0); _rtw_spinlock_init(&newtbl->gates_lock); return newtbl; @@ -584,7 +584,7 @@ struct rtw_mesh_path *rtw_mesh_path_add(_adapter *adapter, if (is_multicast_mac_addr(dst)) return ERR_PTR(-ENOTSUPP); - if (ATOMIC_INC_UNLESS(&adapter->mesh_info.mpaths, RTW_MESH_MAX_MPATHS) == 0) + if (atomic_inc_unless(&adapter->mesh_info.mpaths, RTW_MESH_MAX_MPATHS) == 0) return ERR_PTR(-ENOSPC); new_mpath = rtw_mesh_path_new(adapter, dst); @@ -739,8 +739,8 @@ static void rtw_mesh_path_free_rcu(struct rtw_mesh_table *tbl, rtw_mesh_gate_del(tbl, mpath); exit_critical_bh(&mpath->state_lock); _cancel_timer_ex(&mpath->timer); - ATOMIC_DEC(&adapter->mesh_info.mpaths); - ATOMIC_DEC(&tbl->entries); + atomic_dec(&adapter->mesh_info.mpaths); + atomic_dec(&tbl->entries); _rtw_spinlock_free(&mpath->state_lock); rtw_mesh_path_flush_pending(mpath); diff --git a/core/mesh/rtw_mesh_pathtbl.h b/core/mesh/rtw_mesh_pathtbl.h index 7f5a26b..1893170 100644 --- a/core/mesh/rtw_mesh_pathtbl.h +++ b/core/mesh/rtw_mesh_pathtbl.h @@ -140,7 +140,7 @@ struct rtw_mesh_table { rtw_hlist_head known_gates; _lock gates_lock; rtw_rhashtable rhead; - ATOMIC_T entries; + atomic_t entries; }; #define RTW_MESH_PATH_EXPIRE (600 * HZ) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index c041a44..34a86fd 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -1510,11 +1510,11 @@ static void rtw_ap_check_scan(_adapter *padapter) if (pbuf == NULL) { /* HT CAP INFO IE don't exist, it is b/g mode bss.*/ - if (_FALSE == ATOMIC_READ(&pmlmepriv->olbc)) - ATOMIC_SET(&pmlmepriv->olbc, _TRUE); + if (_FALSE == atomic_read(&pmlmepriv->olbc)) + atomic_set(&pmlmepriv->olbc, _TRUE); - if (_FALSE == ATOMIC_READ(&pmlmepriv->olbc_ht)) - ATOMIC_SET(&pmlmepriv->olbc_ht, _TRUE); + if (_FALSE == atomic_read(&pmlmepriv->olbc_ht)) + atomic_set(&pmlmepriv->olbc_ht, _TRUE); if (padapter->registrypriv.wifi_spec) RTW_INFO("%s: %s is a/b/g ap\n", __func__, pnetwork->network.Ssid.Ssid); @@ -1811,7 +1811,7 @@ update_beacon: mlme = &(pdvobj->padapters[i]->mlmepriv); #ifdef CONFIG_80211N_HT - if ((ATOMIC_READ(&mlme->olbc) == _TRUE) || (ATOMIC_READ(&mlme->olbc_ht) == _TRUE)) { + if ((atomic_read(&mlme->olbc) == _TRUE) || (atomic_read(&mlme->olbc_ht) == _TRUE)) { /* AP is not starting a 40 MHz BSS in presence of an 802.11g BSS. */ mlme->ht_op_mode &= (~HT_INFO_OPERATION_MODE_OP_MODE_MASK); mlme->ht_op_mode |= OP_MODE_MAY_BE_LEGACY_STAS; @@ -3086,7 +3086,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter) __FUNCTION__, pmlmepriv->ht_op_mode); RTW_INFO("num_sta_40mhz_intolerant(%d), 20mhz_width_req(%d), intolerant_ch_rpt(%d), olbc(%d)\n", - pmlmepriv->num_sta_40mhz_intolerant, pmlmepriv->ht_20mhz_width_req, pmlmepriv->ht_intolerant_ch_reported, ATOMIC_READ(&pmlmepriv->olbc)); + pmlmepriv->num_sta_40mhz_intolerant, pmlmepriv->ht_20mhz_width_req, pmlmepriv->ht_intolerant_ch_reported, atomic_read(&pmlmepriv->olbc)); /*parsing HT_INFO_IE, currently only update ht_op_mode - pht_info->infos[1] & pht_info->infos[2] for wifi logo test*/ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _HT_ADD_INFO_IE_, &len, (pnetwork->IELength - _BEACON_IE_OFFSET_)); @@ -3098,7 +3098,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter) /* for STA Channel Width/Secondary Channel Offset*/ if ((pmlmepriv->sw_to_20mhz == 0) && (pmlmeext->cur_channel <= 14)) { if ((pmlmepriv->num_sta_40mhz_intolerant > 0) || (pmlmepriv->ht_20mhz_width_req == _TRUE) - || (pmlmepriv->ht_intolerant_ch_reported == _TRUE) || (ATOMIC_READ(&pmlmepriv->olbc) == _TRUE)) { + || (pmlmepriv->ht_intolerant_ch_reported == _TRUE) || (atomic_read(&pmlmepriv->olbc) == _TRUE)) { SET_HT_OP_ELE_2ND_CHL_OFFSET(pht_info, 0); SET_HT_OP_ELE_STA_CHL_WIDTH(pht_info, 0); @@ -3115,7 +3115,7 @@ static void update_bcn_htinfo_ie(_adapter *padapter) } else { if ((pmlmepriv->num_sta_40mhz_intolerant == 0) && (pmlmepriv->ht_20mhz_width_req == _FALSE) - && (pmlmepriv->ht_intolerant_ch_reported == _FALSE) && (ATOMIC_READ(&pmlmepriv->olbc) == _FALSE)) { + && (pmlmepriv->ht_intolerant_ch_reported == _FALSE) && (atomic_read(&pmlmepriv->olbc) == _FALSE)) { if (pmlmeext->cur_bwmode >= CHANNEL_WIDTH_40) { @@ -3467,12 +3467,12 @@ int rtw_ht_operation_update(_adapter *padapter) } if (!(pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) && - (pmlmepriv->num_sta_no_ht || ATOMIC_READ(&pmlmepriv->olbc_ht))) { + (pmlmepriv->num_sta_no_ht || atomic_read(&pmlmepriv->olbc_ht))) { pmlmepriv->ht_op_mode |= HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT; op_mode_changes++; } else if ((pmlmepriv->ht_op_mode & HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT) && - (pmlmepriv->num_sta_no_ht == 0 && !ATOMIC_READ(&pmlmepriv->olbc_ht))) { + (pmlmepriv->num_sta_no_ht == 0 && !atomic_read(&pmlmepriv->olbc_ht))) { pmlmepriv->ht_op_mode &= ~HT_INFO_OPERATION_MODE_NON_HT_STA_PRESENT; op_mode_changes++; @@ -3489,7 +3489,7 @@ int rtw_ht_operation_update(_adapter *padapter) else if ((phtpriv_ap->ht_cap.cap_info & IEEE80211_HT_CAP_SUP_WIDTH) && pmlmepriv->num_sta_ht_20mhz) new_op_mode = OP_MODE_20MHZ_HT_STA_ASSOCED; - else if (ATOMIC_READ(&pmlmepriv->olbc_ht)) + else if (atomic_read(&pmlmepriv->olbc_ht)) new_op_mode = OP_MODE_MAY_BE_LEGACY_STAS; else new_op_mode = OP_MODE_PURE; @@ -4148,8 +4148,8 @@ void start_ap_mode(_adapter *padapter) pmlmepriv->num_sta_ht_20mhz = 0; pmlmepriv->num_sta_40mhz_intolerant = 0; - ATOMIC_SET(&pmlmepriv->olbc, _FALSE); - ATOMIC_SET(&pmlmepriv->olbc_ht, _FALSE); + atomic_set(&pmlmepriv->olbc, _FALSE); + atomic_set(&pmlmepriv->olbc_ht, _FALSE); #ifdef CONFIG_80211N_HT pmlmepriv->ht_20mhz_width_req = _FALSE; diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 6497716..03bcedb 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -139,7 +139,7 @@ sint _rtw_init_evt_priv(struct evt_priv *pevtpriv) #endif /* 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; #ifdef CONFIG_EVENT_THREAD_MODE @@ -424,11 +424,11 @@ int rtw_cmd_filter(struct cmd_priv *pcmdpriv, struct cmd_obj *cmd_obj) bAllow = _TRUE; if ((!rtw_is_hw_init_completed(pcmdpriv->padapter) && (bAllow == _FALSE)) - || ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _FALSE /* com_thread not running */ + || atomic_read(&(pcmdpriv->cmdthd_running)) == _FALSE /* com_thread not running */ ) { if (DBG_CMD_EXECUTE) RTW_INFO(ADPT_FMT" drop "CMD_FMT" hw_init_completed:%u, cmdthd_running:%u\n", ADPT_ARG(cmd_obj->padapter) - , CMD_ARG(cmd_obj), rtw_get_hw_init_completed(cmd_obj->padapter), ATOMIC_READ(&pcmdpriv->cmdthd_running)); + , CMD_ARG(cmd_obj), rtw_get_hw_init_completed(cmd_obj->padapter), atomic_read(&pcmdpriv->cmdthd_running)); if (0) rtw_warn_on(1); @@ -545,7 +545,7 @@ thread_return rtw_cmd_thread(thread_context context) pcmdbuf = pcmdpriv->cmd_buf; prspbuf = pcmdpriv->rsp_buf; - ATOMIC_SET(&(pcmdpriv->cmdthd_running), _TRUE); + atomic_set(&(pcmdpriv->cmdthd_running), _TRUE); _rtw_up_sema(&pcmdpriv->start_cmdthread_sema); @@ -702,7 +702,7 @@ post_process: #endif /* to avoid enqueue cmd after free all cmd_obj */ - ATOMIC_SET(&(pcmdpriv->cmdthd_running), _FALSE); + atomic_set(&(pcmdpriv->cmdthd_running), _FALSE); /* free all cmd_obj resources */ do { @@ -3243,8 +3243,8 @@ static void dynamic_update_bcn_check(_adapter *padapter) if (count % 10 == 0) { count = 1; #ifdef CONFIG_80211N_HT - if (_FALSE == ATOMIC_READ(&pmlmepriv->olbc) - && _FALSE == ATOMIC_READ(&pmlmepriv->olbc_ht)) { + if (_FALSE == atomic_read(&pmlmepriv->olbc) + && _FALSE == atomic_read(&pmlmepriv->olbc_ht)) { if (rtw_ht_operation_update(padapter) > 0) { update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); @@ -3257,16 +3257,16 @@ static void dynamic_update_bcn_check(_adapter *padapter) #ifdef CONFIG_80211N_HT /* In 2s, there are any legacy AP, update HT info, and then reset count */ - if (_FALSE != ATOMIC_READ(&pmlmepriv->olbc) - && _FALSE != ATOMIC_READ(&pmlmepriv->olbc_ht)) { + if (_FALSE != atomic_read(&pmlmepriv->olbc) + && _FALSE != atomic_read(&pmlmepriv->olbc_ht)) { if (rtw_ht_operation_update(padapter) > 0) { update_beacon(padapter, _HT_CAPABILITY_IE_, NULL, _FALSE); update_beacon(padapter, _HT_ADD_INFO_IE_, NULL, _TRUE); } - ATOMIC_SET(&pmlmepriv->olbc, _FALSE); - ATOMIC_SET(&pmlmepriv->olbc_ht, _FALSE); + atomic_set(&pmlmepriv->olbc, _FALSE); + atomic_set(&pmlmepriv->olbc_ht, _FALSE); count = 0; } #endif /* CONFIG_80211N_HT */ diff --git a/core/rtw_debug.c b/core/rtw_debug.c index 6ad11a9..31e5de9 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -1718,7 +1718,7 @@ int proc_get_trx_info(struct seq_file *m, void *v) rtw_hal_get_hwreg(padapter, HW_VAR_DUMP_MAC_TXFIFO, (u8 *)m); #ifdef CONFIG_USB_HCI - RTW_PRINT_SEL(m, "rx_urb_pending_cn=%d\n", ATOMIC_READ(&(precvpriv->rx_pending_cnt))); + RTW_PRINT_SEL(m, "rx_urb_pending_cn=%d\n", atomic_read(&(precvpriv->rx_pending_cnt))); #endif dump_rx_bh_tk(m, &GET_PRIMARY_ADAPTER(padapter)->recvpriv); @@ -5132,7 +5132,7 @@ static int proc_tdls_display_tdls_function_info(struct seq_file *m) } } - RTW_PRINT_SEL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS CH SW On", (ATOMIC_READ(&ptdlsinfo->chsw_info.chsw_on) == _TRUE) ? "_TRUE" : "_FALSE"); + RTW_PRINT_SEL(m, "%-*s = %s\n", SpaceBtwnItemAndValue, "TDLS CH SW On", (atomic_read(&ptdlsinfo->chsw_info.chsw_on) == _TRUE) ? "_TRUE" : "_FALSE"); RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Off-Channel Num", ptdlsinfo->chsw_info.off_ch_num); RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Channel Offset", ptdlsinfo->chsw_info.ch_offset); RTW_PRINT_SEL(m, "%-*s = %d\n", SpaceBtwnItemAndValue, "TDLS CH SW Current Time", ptdlsinfo->chsw_info.cur_time); diff --git a/core/rtw_io.c b/core/rtw_io.c index 159894a..dc033a2 100644 --- a/core/rtw_io.c +++ b/core/rtw_io.c @@ -469,7 +469,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj) int ret = _FALSE; int value; - value = ATOMIC_INC_RETURN(&dvobj->continual_io_error); + value = atomic_inc_return(&dvobj->continual_io_error); if (value > MAX_CONTINUAL_IO_ERR) { RTW_INFO("[dvobj:%p][ERROR] continual_io_error:%d > %d\n", dvobj, value, MAX_CONTINUAL_IO_ERR); ret = _TRUE; @@ -484,7 +484,7 @@ int rtw_inc_and_chk_continual_io_error(struct dvobj_priv *dvobj) */ void rtw_reset_continual_io_error(struct dvobj_priv *dvobj) { - ATOMIC_SET(&dvobj->continual_io_error, 0); + atomic_set(&dvobj->continual_io_error, 0); } #ifdef DBG_IO diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 9bf66f2..3922ff5 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -3527,13 +3527,13 @@ exit: inline bool rtw_is_scan_deny(_adapter *adapter) { struct mlme_priv *mlmepriv = &adapter->mlmepriv; - return (ATOMIC_READ(&mlmepriv->set_scan_deny) != 0) ? _TRUE : _FALSE; + return (atomic_read(&mlmepriv->set_scan_deny) != 0) ? _TRUE : _FALSE; } inline void rtw_clear_scan_deny(_adapter *adapter) { struct mlme_priv *mlmepriv = &adapter->mlmepriv; - ATOMIC_SET(&mlmepriv->set_scan_deny, 0); + atomic_set(&mlmepriv->set_scan_deny, 0); if (0) RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); } @@ -3549,7 +3549,7 @@ void rtw_set_scan_deny(_adapter *adapter, u32 ms) struct mlme_priv *mlmepriv = &adapter->mlmepriv; if (0) RTW_INFO(FUNC_ADPT_FMT"\n", FUNC_ADPT_ARG(adapter)); - ATOMIC_SET(&mlmepriv->set_scan_deny, 1); + atomic_set(&mlmepriv->set_scan_deny, 1); _set_timer(&mlmepriv->set_scan_deny_timer, ms); } #endif diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 1846ee5..33c2f43 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -935,25 +935,25 @@ bool rtw_mlme_band_check(_adapter *adapter, const u32 ch) } inline void RTW_SET_SCAN_BAND_SKIP(_adapter *padapter, int skip_band) { - int bs = ATOMIC_READ(&padapter->bandskip); + int bs = atomic_read(&padapter->bandskip); bs |= skip_band; - ATOMIC_SET(&padapter->bandskip, bs); + atomic_set(&padapter->bandskip, bs); } inline void RTW_CLR_SCAN_BAND_SKIP(_adapter *padapter, int skip_band) { - int bs = ATOMIC_READ(&padapter->bandskip); + int bs = atomic_read(&padapter->bandskip); bs &= ~(skip_band); - ATOMIC_SET(&padapter->bandskip, bs); + atomic_set(&padapter->bandskip, bs); } inline int RTW_GET_SCAN_BAND_SKIP(_adapter *padapter) { - return ATOMIC_READ(&padapter->bandskip); + return atomic_read(&padapter->bandskip); } -#define RTW_IS_SCAN_BAND_SKIP(padapter, skip_band) (ATOMIC_READ(&padapter->bandskip) & (skip_band)) +#define RTW_IS_SCAN_BAND_SKIP(padapter, skip_band) (atomic_read(&padapter->bandskip) & (skip_band)) bool rtw_mlme_ignore_chan(_adapter *adapter, const u32 ch) { @@ -1037,7 +1037,7 @@ static void init_mlme_ext_priv_value(_adapter *padapter) struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv; struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); - ATOMIC_SET(&pmlmeext->event_seq, 0); + atomic_set(&pmlmeext->event_seq, 0); pmlmeext->mgnt_seq = 0;/* reset to zero when disconnect at client mode */ #ifdef CONFIG_IEEE80211W pmlmeext->sa_query_seq = 0; @@ -1805,8 +1805,8 @@ static void rtw_check_legacy_ap(_adapter *padapter, u8 *pframe, u32 len) if (0) RTW_INFO("%s: "MAC_FMT" is legacy ap\n", __func__, MAC_ARG(GetAddr3Ptr(pframe))); - ATOMIC_SET(&pmlmepriv->olbc, _TRUE); - ATOMIC_SET(&pmlmepriv->olbc_ht, _TRUE); + atomic_set(&pmlmepriv->olbc, _TRUE); + atomic_set(&pmlmepriv->olbc_ht, _TRUE); } } @@ -1949,7 +1949,7 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) #ifdef CONFIG_TDLS_CH_SW if (rtw_tdls_is_chsw_allowed(padapter) == _TRUE) { /* Send TDLS Channel Switch Request when receiving Beacon */ - if ((padapter->tdlsinfo.chsw_info.ch_sw_state & TDLS_CH_SW_INITIATOR_STATE) && (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) + if ((padapter->tdlsinfo.chsw_info.ch_sw_state & TDLS_CH_SW_INITIATOR_STATE) && (atomic_read(&pchsw_info->chsw_on) == _TRUE) && (pmlmeext->cur_channel == rtw_get_oper_ch(padapter))) { ptdls_sta = rtw_get_stainfo(&padapter->stapriv, padapter->tdlsinfo.chsw_info.addr); if (ptdls_sta != NULL) { @@ -11765,7 +11765,7 @@ void report_survey_event(_adapter *padapter, union recv_frame *precv_frame) 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)); @@ -11836,7 +11836,7 @@ void report_surveydone_event(_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; @@ -11884,7 +11884,7 @@ u32 report_join_res(_adapter *padapter, int aid_res, u16 status) 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)); _rtw_memcpy((unsigned char *)(&(pjoinbss_evt->network.network)), &(pmlmeinfo->network), sizeof(WLAN_BSSID_EX)); @@ -11935,7 +11935,7 @@ void report_wmm_edca_update(_adapter *padapter) pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct wmm_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_WMM); - pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq); pwmm_event = (struct wmm_event *)(pevtcmd + sizeof(struct C2HEvent_Header)); pwmm_event->wmm = 0; @@ -11970,7 +11970,7 @@ u32 report_del_sta_event(_adapter *padapter, unsigned char *MacAddr, unsigned sh 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)); _rtw_memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN); @@ -12047,7 +12047,7 @@ void report_add_sta_event(_adapter *padapter, unsigned char *MacAddr) 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)); _rtw_memcpy((unsigned char *)(&(padd_sta_evt->macaddr)), MacAddr, ETH_ALEN); @@ -12842,7 +12842,7 @@ void linked_status_chk(_adapter *padapter, u8 from_timer) #ifdef CONFIG_TDLS #ifdef CONFIG_TDLS_CH_SW - if (ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on) == _TRUE) + if (atomic_read(&padapter->tdlsinfo.chsw_info.chsw_on) == _TRUE) return; #endif /* CONFIG_TDLS_CH_SW */ @@ -13202,7 +13202,7 @@ void report_sta_timeout_event(_adapter *padapter, u8 *MacAddr, unsigned short re pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct stadel_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_TimeoutSTA); - 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)); _rtw_memcpy((unsigned char *)(&(pdel_sta_evt->macaddr)), MacAddr, ETH_ALEN); @@ -13602,7 +13602,7 @@ void rtw_ft_report_reassoc_evt(_adapter *padapter, u8 *pMacAddr) pc2h_evt_hdr = (struct C2HEvent_Header *)(pevtcmd); pc2h_evt_hdr->len = sizeof(struct stassoc_event); pc2h_evt_hdr->ID = GEN_EVT_CODE(_FT_REASSOC); - pc2h_evt_hdr->seq = ATOMIC_INC_RETURN(&pmlmeext->event_seq); + pc2h_evt_hdr->seq = atomic_inc_return(&pmlmeext->event_seq); passoc_sta_evt = (struct stassoc_event *)(pevtcmd + sizeof(struct C2HEvent_Header)); _rtw_memcpy((unsigned char *)(&(passoc_sta_evt->macaddr)), pMacAddr, ETH_ALEN); @@ -15815,7 +15815,7 @@ u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf) #ifdef CHECK_EVENT_SEQ /* checking event sequence... */ - if (evt_seq != (ATOMIC_READ(&pevt_priv->event_seq) & 0x7f)) { + if (evt_seq != (atomic_read(&pevt_priv->event_seq) & 0x7f)) { pevt_priv->event_seq = (evt_seq + 1) & 0x7f; @@ -15836,7 +15836,7 @@ u8 mlme_evt_hdl(_adapter *padapter, unsigned char *pbuf) } - ATOMIC_INC(&pevt_priv->event_seq); + atomic_inc(&pevt_priv->event_seq); peventbuf += 2; diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index f66fa71..4f8bf5c 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -3363,14 +3363,14 @@ static int ro_ch_handler(_adapter *adapter, u8 *buf) if ((remain_ch != rtw_mi_get_union_chan(adapter)) && !check_fwstate(&adapter->mlmepriv, _FW_LINKED)) { if (remain_ch != pmlmeext->cur_channel #ifdef RTW_ROCH_BACK_OP - || ATOMIC_READ(&pwdev_priv->switch_ch_to) == 1 + || atomic_read(&pwdev_priv->switch_ch_to) == 1 #endif ) { rtw_leave_opch(adapter); #ifdef RTW_ROCH_BACK_OP RTW_INFO("%s, set switch ch timer, duration=%d\n", __func__, duration - pwdinfo->ext_listen_interval); - ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); + atomic_set(&pwdev_priv->switch_ch_to, 0); _set_timer(&pwdinfo->ap_p2p_switch_timer, duration - pwdinfo->ext_listen_interval); #endif } @@ -3442,7 +3442,7 @@ static int cancel_ro_ch_handler(_adapter *padapter, u8 *buf) #if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_CONCURRENT_MODE) _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); - ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); + atomic_set(&pwdev_priv->switch_ch_to, 1); #endif if (rtw_mi_get_ch_setting_union(padapter, &ch, &bw, &offset) != 0) { @@ -4779,7 +4779,7 @@ void ap_p2p_switch_timer_process(void *FunctionContext) return; #ifdef CONFIG_IOCTL_CFG80211 - ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); + atomic_set(&pwdev_priv->switch_ch_to, 1); #endif p2p_protocol_wk_cmd(adapter, P2P_AP_P2P_CH_SWITCH_PROCESS_WK); diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 4b6f152..24d6b5d 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -141,7 +141,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter) #ifdef CONFIG_USB_HCI - ATOMIC_SET(&(precvpriv->rx_pending_cnt), 1); + atomic_set(&(precvpriv->rx_pending_cnt), 1); _rtw_init_sema(&precvpriv->allrxreturnevt, 0); @@ -1254,7 +1254,7 @@ sint sta2sta_data_frame( } #ifdef CONFIG_TDLS_CH_SW - if (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) { + if (atomic_read(&pchsw_info->chsw_on) == _TRUE) { if (adapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(adapter)) { pchsw_info->ch_sw_state |= TDLS_PEER_AT_OFF_STATE; if (!(pchsw_info->ch_sw_state & TDLS_CH_SW_INITIATOR_STATE)) @@ -4905,7 +4905,7 @@ int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index) { int ret = _FALSE; - int value = ATOMIC_INC_RETURN(&sta->continual_no_rx_packet[tid_index]); + int value = atomic_inc_return(&sta->continual_no_rx_packet[tid_index]); if (value >= MAX_CONTINUAL_NORXPACKET_COUNT) ret = _TRUE; @@ -4918,7 +4918,7 @@ int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index) */ void rtw_reset_continual_no_rx_packet(struct sta_info *sta, int tid_index) { - ATOMIC_SET(&sta->continual_no_rx_packet[tid_index], 0); + atomic_set(&sta->continual_no_rx_packet[tid_index], 0); } u8 adapter_allow_bmc_data_rx(_adapter *adapter) diff --git a/core/rtw_rm.c b/core/rtw_rm.c index 6576597..d4c8019 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -2374,7 +2374,7 @@ static void rm_dbg_show_meas(struct rm_obj *prm, char *s) psta->cmn.aid, MAC_ARG(psta->cmn.mac_addr)); sprintf(pstr(s), "clock=%d, state=%s, rpt=%u/%u\n", - (int)ATOMIC_READ(&prm->pclock->counter), + (int)atomic_read(&prm->pclock->counter), rm_state_name(prm->state), prm->p.rpt, prm->q.rpt); } diff --git a/core/rtw_rm_fsm.c b/core/rtw_rm_fsm.c index 21fb323..44c08b9 100644 --- a/core/rtw_rm_fsm.c +++ b/core/rtw_rm_fsm.c @@ -42,12 +42,12 @@ void rm_timer_callback(void *data) for (i=0;iclock[i]; if (pclock->prm == NULL - ||(ATOMIC_READ(&(pclock->counter)) == 0)) + ||(atomic_read(&(pclock->counter)) == 0)) continue; - ATOMIC_DEC(&(pclock->counter)); + atomic_dec(&(pclock->counter)); - if (ATOMIC_READ(&(pclock->counter)) == 0) + if (atomic_read(&(pclock->counter)) == 0) rm_post_event(pclock->prm->psta->padapter, pclock->prm->rmid, prmpriv->clock[i].evid); } @@ -176,7 +176,7 @@ static int rm_enqueue_ev(_queue *queue, struct rm_event *obj, bool to_head) static void rm_set_clock(struct rm_obj *prm, u32 ms, enum RM_EV_ID evid) { - ATOMIC_SET(&(prm->pclock->counter), (ms/CLOCK_UNIT)); + atomic_set(&(prm->pclock->counter), (ms/CLOCK_UNIT)); prm->pclock->evid = evid; } @@ -192,7 +192,7 @@ static struct rm_clock *rm_alloc_clock(_adapter *padapter, struct rm_obj *prm) if (pclock->prm == NULL) { pclock->prm = prm; - ATOMIC_SET(&(pclock->counter), 0); + atomic_set(&(pclock->counter), 0); pclock->evid = RM_EV_max; break; } @@ -202,14 +202,14 @@ static struct rm_clock *rm_alloc_clock(_adapter *padapter, struct rm_obj *prm) static void rm_cancel_clock(struct rm_obj *prm) { - ATOMIC_SET(&(prm->pclock->counter), 0); + atomic_set(&(prm->pclock->counter), 0); prm->pclock->evid = RM_EV_max; } static void rm_free_clock(struct rm_clock *pclock) { pclock->prm = NULL; - ATOMIC_SET(&(pclock->counter), 0); + atomic_set(&(pclock->counter), 0); pclock->evid = RM_EV_max; } diff --git a/core/rtw_sdio.c b/core/rtw_sdio.c index e8f49bf..588f7c9 100644 --- a/core/rtw_sdio.c +++ b/core/rtw_sdio.c @@ -60,7 +60,7 @@ static u8 sdio_io(struct dvobj_priv *d, u32 addr, void *buf, size_t len, u8 writ if (retry) { RTW_INFO("%s: Retry %s OK! addr=0x%05x %zu bytes, retry=%u,%u\n", __FUNCTION__, write?"write":"read", - addr, len, retry, ATOMIC_READ(&d->continual_io_error)); + addr, len, retry, atomic_read(&d->continual_io_error)); RTW_INFO_DUMP("Data: ", buf, len); } rtw_reset_continual_io_error(d); @@ -68,14 +68,14 @@ static u8 sdio_io(struct dvobj_priv *d, u32 addr, void *buf, size_t len, u8 writ } RTW_ERR("%s: %s FAIL! error(%d) addr=0x%05x %zu bytes, retry=%u,%u\n", __FUNCTION__, write?"write":"read", err, addr, len, - retry, ATOMIC_READ(&d->continual_io_error)); + retry, atomic_read(&d->continual_io_error)); retry++; stop_retry = rtw_inc_and_chk_continual_io_error(d); if ((err == -1) || (stop_retry == _TRUE) || (retry > SD_IO_TRY_CNT)) { /* critical error, unrecoverable */ RTW_ERR("%s: Fatal error! Set surprise remove flag ON! (retry=%u,%u)\n", - __FUNCTION__, retry, ATOMIC_READ(&d->continual_io_error)); + __FUNCTION__, retry, atomic_read(&d->continual_io_error)); rtw_set_surprise_removed(dvobj_get_primary_adapter(d)); return _FAIL; } @@ -84,7 +84,7 @@ static u8 sdio_io(struct dvobj_priv *d, u32 addr, void *buf, size_t len, u8 writ if ((addr & 0x10000) || !(addr & 0xE000)) { RTW_WARN("%s: Retry %s addr=0x%05x %zu bytes, retry=%u,%u\n", __FUNCTION__, write?"write":"read", addr, len, - retry, ATOMIC_READ(&d->continual_io_error)); + retry, atomic_read(&d->continual_io_error)); continue; } return _FAIL; diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 002ab4b..a06f616 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -47,7 +47,7 @@ void rtw_reset_tdls_info(_adapter *padapter) #ifdef CONFIG_TDLS_CH_SW ptdlsinfo->chsw_info.ch_sw_state = TDLS_STATE_NONE; - ATOMIC_SET(&ptdlsinfo->chsw_info.chsw_on, _FALSE); + atomic_set(&ptdlsinfo->chsw_info.chsw_on, _FALSE); ptdlsinfo->chsw_info.off_ch_num = 0; ptdlsinfo->chsw_info.ch_offset = HAL_PRIME_CHNL_OFFSET_DONT_CARE; ptdlsinfo->chsw_info.cur_time = 0; @@ -945,8 +945,8 @@ void rtw_tdls_set_ch_sw_oper_control(_adapter *padapter, u8 enable) else pHalData->ch_switch_offload = _FALSE; - if (ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on) != enable) - ATOMIC_SET(&padapter->tdlsinfo.chsw_info.chsw_on, enable); + if (atomic_read(&padapter->tdlsinfo.chsw_info.chsw_on) != enable) + atomic_set(&padapter->tdlsinfo.chsw_info.chsw_on, enable); rtw_hal_set_hwreg(padapter, HW_VAR_TDLS_BCN_EARLY_C2H_RPT, &enable); RTW_INFO("[TDLS] %s Bcn Early C2H Report\n", (enable == _TRUE) ? "Start" : "Stop"); @@ -959,7 +959,7 @@ void rtw_tdls_ch_sw_back_to_base_chnl(_adapter *padapter) pmlmepriv = &padapter->mlmepriv; - if ((ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) && + if ((atomic_read(&pchsw_info->chsw_on) == _TRUE) && (padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter))) rtw_tdls_cmd(padapter, pchsw_info->addr, TDLS_CH_SW_TO_BASE_CHNL_UNSOLICITED); } @@ -2614,7 +2614,7 @@ sint On_TDLS_Ch_Switch_Req(_adapter *padapter, union recv_frame *precv_frame, st if (_rtw_memcmp(pchsw_info->addr, zaddr, ETH_ALEN) == _TRUE) _rtw_memcpy(pchsw_info->addr, ptdls_sta->cmn.mac_addr, ETH_ALEN); - if (ATOMIC_READ(&pchsw_info->chsw_on) == _FALSE) + if (atomic_read(&pchsw_info->chsw_on) == _FALSE) rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_START); rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_RESP); @@ -2642,7 +2642,7 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame, st /* If we receive Unsolicited TDLS Channel Switch Response when channel switch is running, */ /* we will go back to base channel and terminate this channel switch procedure */ - if (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) { + if (atomic_read(&pchsw_info->chsw_on) == _TRUE) { if (pmlmeext->cur_channel != rtw_get_oper_ch(padapter)) { RTW_INFO("[TDLS] Rx unsolicited channel switch response\n"); rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_TO_BASE_CHNL); @@ -2694,7 +2694,7 @@ sint On_TDLS_Ch_Switch_Rsp(_adapter *padapter, union recv_frame *precv_frame, st if ((pmlmeext->cur_channel == rtw_get_oper_ch(padapter)) && (pchsw_info->ch_sw_state & TDLS_WAIT_CH_RSP_STATE)) { - if (ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) + if (atomic_read(&pchsw_info->chsw_on) == _TRUE) rtw_tdls_cmd(padapter, ptdls_sta->cmn.mac_addr, TDLS_CH_SW_TO_OFF_CHNL); } diff --git a/hal/hal_com.c b/hal/hal_com.c index b763866..f0c7e43 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -2489,7 +2489,7 @@ void rtw_mbid_cam_init(struct dvobj_priv *dvobj) _rtw_spinlock_init(&mbid_cam_ctl->lock); mbid_cam_ctl->bitmap = 0; - ATOMIC_SET(&mbid_cam_ctl->mbid_entry_num, 0); + atomic_set(&mbid_cam_ctl->mbid_entry_num, 0); _rtw_memset(&dvobj->mbid_cam_cache, 0, sizeof(dvobj->mbid_cam_cache)); } @@ -2511,7 +2511,7 @@ void rtw_mbid_cam_reset(_adapter *adapter) _rtw_memset(&dvobj->mbid_cam_cache, 0, sizeof(dvobj->mbid_cam_cache)); _exit_critical_bh(&mbid_cam_ctl->lock, &irqL); - ATOMIC_SET(&mbid_cam_ctl->mbid_entry_num, 0); + atomic_set(&mbid_cam_ctl->mbid_entry_num, 0); } static u8 _rtw_mbid_cam_search_by_macaddr(_adapter *adapter, u8 *mac_addr) { @@ -2601,7 +2601,7 @@ inline u8 rtw_get_mbid_cam_entry_num(_adapter *adapter) struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct mbid_cam_ctl_t *mbid_cam_ctl = &dvobj->mbid_cam_ctl; - return ATOMIC_READ(&mbid_cam_ctl->mbid_entry_num); + return atomic_read(&mbid_cam_ctl->mbid_entry_num); } static inline void mbid_cam_cache_init(_adapter *adapter, struct mbid_cam_cache *pmbid_cam, u8 *mac_addr) @@ -2625,7 +2625,7 @@ u8 rtw_mbid_camid_alloc(_adapter *adapter, u8 *mac_addr) u8 cam_id = INVALID_CAM_ID, i; struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct mbid_cam_ctl_t *mbid_cam_ctl = &dvobj->mbid_cam_ctl; - u8 entry_num = ATOMIC_READ(&mbid_cam_ctl->mbid_entry_num); + u8 entry_num = atomic_read(&mbid_cam_ctl->mbid_entry_num); if (INVALID_CAM_ID != rtw_mbid_cam_search_by_macaddr(adapter, mac_addr)) goto exit; @@ -2648,7 +2648,7 @@ u8 rtw_mbid_camid_alloc(_adapter *adapter, u8 *mac_addr) _exit_critical_bh(&mbid_cam_ctl->lock, &irqL); if (cam_id != INVALID_CAM_ID) { - ATOMIC_INC(&mbid_cam_ctl->mbid_entry_num); + atomic_inc(&mbid_cam_ctl->mbid_entry_num); RTW_INFO("%s mac:"MAC_FMT" - cam_id:%d\n", __func__, MAC_ARG(mac_addr), cam_id); #ifdef DBG_MBID_CAM_DUMP rtw_mbid_cam_cache_dump(RTW_DBGDUMP, __func__, adapter); @@ -2701,7 +2701,7 @@ u8 rtw_mbid_cam_assign(_adapter *adapter, u8 *mac_addr, u8 camid) _exit_critical_bh(&mbid_cam_ctl->lock, &irqL); if (ret == _TRUE) { - ATOMIC_INC(&mbid_cam_ctl->mbid_entry_num); + atomic_inc(&mbid_cam_ctl->mbid_entry_num); RTW_INFO("%s mac:"MAC_FMT" - cam_id:%d\n", __func__, MAC_ARG(mac_addr), camid); #ifdef DBG_MBID_CAM_DUMP rtw_mbid_cam_cache_dump(RTW_DBGDUMP, __func__, adapter); @@ -2727,7 +2727,7 @@ void rtw_mbid_camid_clean(_adapter *adapter, u8 mbss_canid) mbid_cam_cache_clr(&dvobj->mbid_cam_cache[mbss_canid]); mbid_cam_ctl->bitmap &= (~BIT(mbss_canid)); _exit_critical_bh(&mbid_cam_ctl->lock, &irqL); - ATOMIC_DEC(&mbid_cam_ctl->mbid_entry_num); + atomic_dec(&mbid_cam_ctl->mbid_entry_num); RTW_INFO("%s - cam_id:%d\n", __func__, mbss_canid); } int rtw_mbid_cam_cache_dump(void *sel, const char *fun_name, _adapter *adapter) @@ -2738,7 +2738,7 @@ int rtw_mbid_cam_cache_dump(void *sel, const char *fun_name, _adapter *adapter) u8 iface_id; struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct mbid_cam_ctl_t *mbid_cam_ctl = &dvobj->mbid_cam_ctl; - u8 entry_num = ATOMIC_READ(&mbid_cam_ctl->mbid_entry_num); + u8 entry_num = atomic_read(&mbid_cam_ctl->mbid_entry_num); u8 max_cam_id = rtw_get_max_mbid_cam_id(adapter); RTW_PRINT_SEL(sel, "== MBSSID CAM DUMP (%s)==\n", fun_name); diff --git a/hal/hal_dm_acs.h b/hal/hal_dm_acs.h index 871c144..a42d0de 100644 --- a/hal/hal_dm_acs.h +++ b/hal/hal_dm_acs.h @@ -60,8 +60,8 @@ void rtw_acs_version_dump(void *sel, _adapter *adapter); extern void phydm_ccx_monitor_trigger(void *p_dm_void, u16 monitor_time); extern void phydm_ccx_monitor_result(void *p_dm_void); -#define GET_ACS_STATE(padapter) (ATOMIC_READ(&GET_HAL_DATA(padapter)->acs.state)) -#define SET_ACS_STATE(padapter, set_state) (ATOMIC_SET(&GET_HAL_DATA(padapter)->acs.state, set_state)) +#define GET_ACS_STATE(padapter) (atomic_read(&GET_HAL_DATA(padapter)->acs.state)) +#define SET_ACS_STATE(padapter, set_state) (atomic_set(&GET_HAL_DATA(padapter)->acs.state, set_state)) #define IS_ACS_ENABLE(padapter) ((GET_ACS_STATE(padapter) == ACS_ENABLE) ? _TRUE : _FALSE) enum ACS_STATE { @@ -75,7 +75,7 @@ enum ACS_STATE { #define ACS_BW_160M BIT(3) struct auto_chan_sel { - ATOMIC_T state; + atomic_t state; u8 trigger_ch; bool triggered; u8 clm_ratio[MAX_CHANNEL_NUM]; @@ -142,8 +142,8 @@ void rtw_acs_stop(_adapter *adapter); #ifdef CONFIG_BACKGROUND_NOISE_MONITOR #define RTK_NOISE_MONITOR_VERSION 3 -#define GET_NM_STATE(padapter) (ATOMIC_READ(&GET_HAL_DATA(padapter)->nm.state)) -#define SET_NM_STATE(padapter, set_state) (ATOMIC_SET(&GET_HAL_DATA(padapter)->nm.state, set_state)) +#define GET_NM_STATE(padapter) (atomic_read(&GET_HAL_DATA(padapter)->nm.state)) +#define SET_NM_STATE(padapter, set_state) (atomic_set(&GET_HAL_DATA(padapter)->nm.state, set_state)) #define IS_NM_ENABLE(padapter) ((GET_NM_STATE(padapter) == NM_ENABLE) ? _TRUE : _FALSE) enum NM_STATE { @@ -152,7 +152,7 @@ enum NM_STATE { }; struct noise_monitor { - ATOMIC_T state; + atomic_t state; s16 noise[MAX_CHANNEL_NUM]; u8 bss_nums[MAX_CHANNEL_NUM]; }; diff --git a/hal/rtl8192e/rtl8192e_phycfg.c b/hal/rtl8192e/rtl8192e_phycfg.c index 619427a..2ac1a21 100644 --- a/hal/rtl8192e/rtl8192e_phycfg.c +++ b/hal/rtl8192e/rtl8192e_phycfg.c @@ -1114,7 +1114,7 @@ phy_SwChnlAndSetBwMode8192E( #ifdef CONFIG_TDLS #ifdef CONFIG_TDLS_CH_SW /* It takes too much time of setting tx power, influence channel switch */ - if ((ATOMIC_READ(&Adapter->tdlsinfo.chsw_info.chsw_on) == _FALSE)) + if ((atomic_read(&Adapter->tdlsinfo.chsw_info.chsw_on) == _FALSE)) #endif #endif /* CONFIG_TDLS */ PHY_SetTxPowerLevel8192E(Adapter, pHalData->current_channel); diff --git a/hal/rtl8192e/usb/usb_ops_linux.c b/hal/rtl8192e/usb/usb_ops_linux.c index d909f13..69efc36 100644 --- a/hal/rtl8192e/usb/usb_ops_linux.c +++ b/hal/rtl8192e/usb/usb_ops_linux.c @@ -52,7 +52,7 @@ void interrupt_handler_8192eu(_adapter *padapter, u16 pkt_len, u8 *pbuf) struct tdls_ch_switch *pchsw_info = &padapter->tdlsinfo.chsw_info; u32 last_time = pchsw_info->cur_time; pchsw_info->cur_time = rtw_systime_to_ms(rtw_get_current_time()); - if ((ATOMIC_READ(&pchsw_info->chsw_on) == _TRUE) && + if ((atomic_read(&pchsw_info->chsw_on) == _TRUE) && /* Sometimes we receive multiple interrupts in very little time period, use the follow condition test to filter */ (pchsw_info->cur_time - last_time > padapter->mlmeextpriv.mlmext_info.bcn_interval - 5) && (padapter->mlmeextpriv.cur_channel != rtw_get_oper_ch(padapter))) { diff --git a/include/drv_types.h b/include/drv_types.h index 3262a8f..dbb4208 100644 --- a/include/drv_types.h +++ b/include/drv_types.h @@ -942,7 +942,7 @@ struct rf_ctl_t { struct mbid_cam_ctl_t { _lock lock; u8 bitmap; - ATOMIC_T mbid_entry_num; + atomic_t mbid_entry_num; }; struct mbid_cam_cache { u8 iface_id; @@ -995,8 +995,8 @@ struct dvobj_priv { u8 HardwareType; u8 interface_type;/*USB,SDIO,SPI,PCI*/ - ATOMIC_T bSurpriseRemoved; - ATOMIC_T bDriverStopped; + atomic_t bSurpriseRemoved; + atomic_t bDriverStopped; s32 processing_dev_remove; @@ -1076,9 +1076,9 @@ struct dvobj_priv { u8 Queue2Pipe[HW_QUEUE_ENTRY];/* for out pipe mapping */ u8 irq_alloc; - ATOMIC_T continual_io_error; + atomic_t continual_io_error; - ATOMIC_T disable_func; + atomic_t disable_func; u8 xmit_block; _lock xmit_block_lock; @@ -1248,7 +1248,6 @@ struct dvobj_priv { #endif /* also for RTK T/P Testing Mode */ u8 scan_deny; - }; #define DEV_STA_NUM(_dvobj) MSTATE_STA_NUM(&((_dvobj)->iface_state)) @@ -1286,22 +1285,22 @@ struct dvobj_priv { static inline void dev_set_surprise_removed(struct dvobj_priv *dvobj) { - ATOMIC_SET(&dvobj->bSurpriseRemoved, _TRUE); + atomic_set(&dvobj->bSurpriseRemoved, _TRUE); } static inline void dev_clr_surprise_removed(struct dvobj_priv *dvobj) { - ATOMIC_SET(&dvobj->bSurpriseRemoved, _FALSE); + atomic_set(&dvobj->bSurpriseRemoved, _FALSE); } static inline void dev_set_drv_stopped(struct dvobj_priv *dvobj) { - ATOMIC_SET(&dvobj->bDriverStopped, _TRUE); + atomic_set(&dvobj->bDriverStopped, _TRUE); } static inline void dev_clr_drv_stopped(struct dvobj_priv *dvobj) { - ATOMIC_SET(&dvobj->bDriverStopped, _FALSE); + atomic_set(&dvobj->bDriverStopped, _FALSE); } -#define dev_is_surprise_removed(dvobj) (ATOMIC_READ(&dvobj->bSurpriseRemoved) == _TRUE) -#define dev_is_drv_stopped(dvobj) (ATOMIC_READ(&dvobj->bDriverStopped) == _TRUE) +#define dev_is_surprise_removed(dvobj) (atomic_read(&dvobj->bSurpriseRemoved) == _TRUE) +#define dev_is_drv_stopped(dvobj) (atomic_read(&dvobj->bDriverStopped) == _TRUE) #ifdef PLATFORM_LINUX static inline struct device *dvobj_to_dev(struct dvobj_priv *dvobj) @@ -1448,7 +1447,7 @@ struct _ADAPTER { #endif /* CONFIG_P2P */ #endif /* CONFIG_IOCTL_CFG80211 */ u32 setband; - ATOMIC_T bandskip; + atomic_t bandskip; #ifdef CONFIG_P2P struct wifidirect_info wdinfo; @@ -1741,27 +1740,27 @@ static inline void rtw_clr_drv_stopped(_adapter *padapter) #define DF_RX_BIT BIT1 /*read_port_cancel*/ #define DF_IO_BIT BIT2 -/* #define RTW_DISABLE_FUNC(padapter, func) (ATOMIC_ADD(&adapter_to_dvobj(padapter)->disable_func, (func))) */ -/* #define RTW_ENABLE_FUNC(padapter, func) (ATOMIC_SUB(&adapter_to_dvobj(padapter)->disable_func, (func))) */ +/* #define RTW_DISABLE_FUNC(padapter, func) (atomic_add(&adapter_to_dvobj(padapter)->disable_func, (func))) */ +/* #define RTW_ENABLE_FUNC(padapter, func) (atomic_sub(&adapter_to_dvobj(padapter)->disable_func, (func))) */ __inline static void RTW_DISABLE_FUNC(_adapter *padapter, int func_bit) { - int df = ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func); + int df = atomic_read(&adapter_to_dvobj(padapter)->disable_func); df |= func_bit; - ATOMIC_SET(&adapter_to_dvobj(padapter)->disable_func, df); + atomic_set(&adapter_to_dvobj(padapter)->disable_func, df); } __inline static void RTW_ENABLE_FUNC(_adapter *padapter, int func_bit) { - int df = ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func); + int df = atomic_read(&adapter_to_dvobj(padapter)->disable_func); df &= ~(func_bit); - ATOMIC_SET(&adapter_to_dvobj(padapter)->disable_func, df); + atomic_set(&adapter_to_dvobj(padapter)->disable_func, df); } #define RTW_CANNOT_RUN(padapter) \ (rtw_is_surprise_removed(padapter) || \ rtw_is_drv_stopped(padapter)) -#define RTW_IS_FUNC_DISABLED(padapter, func_bit) (ATOMIC_READ(&adapter_to_dvobj(padapter)->disable_func) & (func_bit)) +#define RTW_IS_FUNC_DISABLED(padapter, func_bit) (atomic_read(&adapter_to_dvobj(padapter)->disable_func) & (func_bit)) #define RTW_CANNOT_IO(padapter) \ (rtw_is_surprise_removed(padapter) || \ diff --git a/include/osdep_service.h b/include/osdep_service.h index 16a7e75..93f68c4 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -610,18 +610,6 @@ extern void rtw_set_bit(int nr, unsigned long *addr); extern void rtw_clear_bit(int nr, unsigned long *addr); extern int rtw_test_and_clear_bit(int nr, unsigned long *addr); -extern void ATOMIC_SET(ATOMIC_T *v, int i); -extern int ATOMIC_READ(ATOMIC_T *v); -extern void ATOMIC_ADD(ATOMIC_T *v, int i); -extern void ATOMIC_SUB(ATOMIC_T *v, int i); -extern void ATOMIC_INC(ATOMIC_T *v); -extern void ATOMIC_DEC(ATOMIC_T *v); -extern int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i); -extern int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i); -extern int ATOMIC_INC_RETURN(ATOMIC_T *v); -extern int ATOMIC_DEC_RETURN(ATOMIC_T *v); -extern bool ATOMIC_INC_UNLESS(ATOMIC_T *v, int u); - /* File operation APIs, just for linux now */ extern int rtw_is_file_readable(const char *path); extern int rtw_is_file_readable_with_size(const char *path, u32 *sz); diff --git a/include/osdep_service_bsd.h b/include/osdep_service_bsd.h index 576d82a..f7399bf 100644 --- a/include/osdep_service_bsd.h +++ b/include/osdep_service_bsd.h @@ -732,9 +732,6 @@ __inline static void _set_workitem(_workitem *pwork) static __inline void thread_enter(char *name); -//Atomic integer operations -typedef uint32_t ATOMIC_T ; - #define rtw_netdev_priv(netdev) (((struct ifnet *)netdev)->if_softc) #define rtw_free_netdev(netdev) if_free((netdev)) diff --git a/include/osdep_service_ce.h b/include/osdep_service_ce.h index a406d62..f45cb60 100644 --- a/include/osdep_service_ce.h +++ b/include/osdep_service_ce.h @@ -1,17 +1,17 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ +/****************************************************************************** + * + * Copyright(c) 2007 - 2017 Realtek Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + *****************************************************************************/ #ifndef __OSDEP_CE_SERVICE_H_ #define __OSDEP_CE_SERVICE_H_ @@ -40,11 +40,11 @@ typedef u32 _irqL; typedef NDIS_HANDLE _nic_hdl; -struct rtw_timer_list { - NDIS_MINIPORT_TIMER ndis_timer; - void (*function)(void *); - void *arg; -}; +struct rtw_timer_list { + NDIS_MINIPORT_TIMER ndis_timer; + void (*function)(void *); + void *arg; +}; struct __queue { LIST_ENTRY queue; @@ -60,7 +60,7 @@ typedef DWORD thread_return; typedef void* thread_context; typedef NDIS_WORK_ITEM _workitem; - + #define SEMA_UPBND (0x7FFFFFFF) //8192 @@ -119,33 +119,33 @@ __inline static void rtw_list_delete(_list *plist) InitializeListHead(plist); } -static inline void timer_hdl( - IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3) -{ - _timer *timer = (_timer *)FunctionContext; - - timer->function(timer->arg); -} - -static inline void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc, void *cntx) -{ - ptimer->function = pfunc; - ptimer->arg = cntx; - NdisMInitializeTimer(&ptimer->ndis_timer, nic_hdl, timer_hdl, ptimer); -} - -static inline void _set_timer(_timer *ptimer, u32 delay_time) -{ - NdisMSetTimer(ptimer, delay_time); -} - -static inline void _cancel_timer(_timer *ptimer, u8 *bcancelled) -{ - NdisMCancelTimer(ptimer, bcancelled); -} +static inline void timer_hdl( + IN PVOID SystemSpecific1, + IN PVOID FunctionContext, + IN PVOID SystemSpecific2, + IN PVOID SystemSpecific3) +{ + _timer *timer = (_timer *)FunctionContext; + + timer->function(timer->arg); +} + +static inline void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc, void *cntx) +{ + ptimer->function = pfunc; + ptimer->arg = cntx; + NdisMInitializeTimer(&ptimer->ndis_timer, nic_hdl, timer_hdl, ptimer); +} + +static inline void _set_timer(_timer *ptimer, u32 delay_time) +{ + NdisMSetTimer(ptimer, delay_time); +} + +static inline void _cancel_timer(_timer *ptimer, u8 *bcancelled) +{ + NdisMCancelTimer(ptimer, bcancelled); +} __inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx) { @@ -182,7 +182,7 @@ __inline static void _set_workitem(_workitem *pwork) #define PATH_LENGTH_MAX MAX_PATH //Atomic integer operations -#define ATOMIC_T LONG +#define atomic_t LONG #define NDEV_FMT "%s" #define NDEV_ARG(ndev) "" diff --git a/include/osdep_service_linux.h b/include/osdep_service_linux.h index 2f84f97..2339af4 100644 --- a/include/osdep_service_linux.h +++ b/include/osdep_service_linux.h @@ -513,7 +513,7 @@ static inline int rtw_merge_string(char *dst, int dst_len, const char *src1, con #define PATH_LENGTH_MAX PATH_MAX /* Atomic integer operations */ -#define ATOMIC_T atomic_t +#define atomic_t atomic_t #define rtw_netdev_priv(netdev) (((struct rtw_netdev_priv_indicator *)netdev_priv(netdev))->priv) diff --git a/include/osdep_service_xp.h b/include/osdep_service_xp.h index 71dc1cd..95c3552 100644 --- a/include/osdep_service_xp.h +++ b/include/osdep_service_xp.h @@ -1,17 +1,17 @@ -/****************************************************************************** - * - * Copyright(c) 2007 - 2017 Realtek Corporation. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of version 2 of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - *****************************************************************************/ +/****************************************************************************** + * + * Copyright(c) 2007 - 2017 Realtek Corporation. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + *****************************************************************************/ #ifndef __OSDEP_LINUX_SERVICE_H_ #define __OSDEP_LINUX_SERVICE_H_ @@ -40,11 +40,11 @@ // USB_PIPE for WINCE , but handle can be use just integer under windows typedef NDIS_HANDLE _nic_hdl; - struct rtw_timer_list { - NDIS_MINIPORT_TIMER ndis_timer; - void (*function)(void *); - void *arg; - }; + struct rtw_timer_list { + NDIS_MINIPORT_TIMER ndis_timer; + void (*function)(void *); + void *arg; + }; struct __queue { LIST_ENTRY queue; @@ -128,33 +128,33 @@ __inline static void rtw_list_delete(_list *plist) InitializeListHead(plist); } -static inline void timer_hdl( - IN PVOID SystemSpecific1, - IN PVOID FunctionContext, - IN PVOID SystemSpecific2, - IN PVOID SystemSpecific3) -{ - _timer *timer = (_timer *)FunctionContext; - - timer->function(timer->arg); -} - -static inline void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc, void *cntx) -{ - ptimer->function = pfunc; - ptimer->arg = cntx; - NdisMInitializeTimer(&ptimer->ndis_timer, nic_hdl, timer_hdl, ptimer); -} - -static inline void _set_timer(_timer *ptimer, u32 delay_time) -{ - NdisMSetTimer(ptimer, delay_time); -} - -static inline void _cancel_timer(_timer *ptimer, u8 *bcancelled) -{ - NdisMCancelTimer(ptimer, bcancelled); -} +static inline void timer_hdl( + IN PVOID SystemSpecific1, + IN PVOID FunctionContext, + IN PVOID SystemSpecific2, + IN PVOID SystemSpecific3) +{ + _timer *timer = (_timer *)FunctionContext; + + timer->function(timer->arg); +} + +static inline void _init_timer(_timer *ptimer, _nic_hdl nic_hdl, void *pfunc, void *cntx) +{ + ptimer->function = pfunc; + ptimer->arg = cntx; + NdisMInitializeTimer(&ptimer->ndis_timer, nic_hdl, timer_hdl, ptimer); +} + +static inline void _set_timer(_timer *ptimer, u32 delay_time) +{ + NdisMSetTimer(ptimer, delay_time); +} + +static inline void _cancel_timer(_timer *ptimer, u8 *bcancelled) +{ + NdisMCancelTimer(ptimer, bcancelled); +} __inline static void _init_workitem(_workitem *pwork, void *pfunc, PVOID cntx) { @@ -192,7 +192,7 @@ __inline static void _set_workitem(_workitem *pwork) #define PATH_LENGTH_MAX MAX_PATH //Atomic integer operations -#define ATOMIC_T LONG +#define atomic_t LONG #define NDEV_FMT "%s" diff --git a/include/rtw_cmd.h b/include/rtw_cmd.h index 1f0dea6..bf1f00c 100644 --- a/include/rtw_cmd.h +++ b/include/rtw_cmd.h @@ -66,7 +66,7 @@ struct cmd_priv { u32 cmd_issued_cnt; u32 cmd_done_cnt; u32 rsp_cnt; - ATOMIC_T cmdthd_running; + atomic_t cmdthd_running; /* u8 cmdthd_running; */ _adapter *padapter; @@ -107,7 +107,7 @@ struct evt_priv { u8 lbkevt_num; u8 *cmdevt_parm; #endif - 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; diff --git a/include/rtw_mlme.h b/include/rtw_mlme.h index 706a25e..1fae61a 100644 --- a/include/rtw_mlme.h +++ b/include/rtw_mlme.h @@ -359,7 +359,7 @@ struct cfg80211_wifidirect_info { u8 restore_channel; struct ieee80211_channel remain_on_ch_channel; enum nl80211_channel_type remain_on_ch_type; - ATOMIC_T ro_ch_cookie_gen; + atomic_t ro_ch_cookie_gen; u64 remain_on_ch_cookie; bool is_ro_ch; struct wireless_dev *ro_ch_wdev; @@ -504,7 +504,7 @@ struct tdls_temp_mgmt { #ifdef CONFIG_TDLS_CH_SW struct tdls_ch_switch { u32 ch_sw_state; - ATOMIC_T chsw_on; + atomic_t chsw_on; u8 addr[ETH_ALEN]; u8 off_ch_num; u8 ch_offset; @@ -731,7 +731,7 @@ struct nb_rpt_hdr { u8 phy_type; }; -/*IEEE Std 80211v, Figure 7-95e2¡XBSS Termination Duration subelement field format */ +/*IEEE Std 80211v, Figure 7-95e2�XBSS Termination Duration subelement field format */ struct btm_term_duration { u8 id; u8 len; @@ -739,7 +739,7 @@ struct btm_term_duration { u16 duration; }; -/*IEEE Std 80211v, Figure 7-101n8¡XBSS Transition Management Request frame body format */ +/*IEEE Std 80211v, Figure 7-101n8�XBSS Transition Management Request frame body format */ struct btm_req_hdr { u8 req_mode; u16 disassoc_timer; @@ -843,7 +843,7 @@ struct mlme_priv { #ifdef CONFIG_SET_SCAN_DENY_TIMER _timer set_scan_deny_timer; - ATOMIC_T set_scan_deny; /* 0: allowed, 1: deny */ + atomic_t set_scan_deny; /* 0: allowed, 1: deny */ #endif u8 wpa_phase;/*wpa_phase after wps finished*/ @@ -914,7 +914,7 @@ struct mlme_priv { /* Number of associated stations that do not support Short Preamble */ int num_sta_no_short_preamble; - ATOMIC_T olbc; /* Overlapping Legacy BSS Condition (Legacy b/g)*/ + atomic_t olbc; /* Overlapping Legacy BSS Condition (Legacy b/g)*/ /* Number of HT associated stations that do not support greenfield */ int num_sta_ht_no_gf; @@ -929,7 +929,7 @@ struct mlme_priv { int num_sta_40mhz_intolerant; /* Overlapping BSS information */ - ATOMIC_T olbc_ht; + atomic_t olbc_ht; #ifdef CONFIG_80211N_HT int ht_20mhz_width_req; @@ -1019,7 +1019,7 @@ struct mlme_priv { int widi_state; int listen_state; _timer listen_timer; - ATOMIC_T rx_probe_rsp; /* 1:receive probe respone from RDS source. */ + atomic_t rx_probe_rsp; /* 1:receive probe respone from RDS source. */ u8 *l2sdTaBuffer; u8 channel_idx; u8 group_cnt; /* In WiDi 3.5, they specified another scan algo. for WFD/RDS co-existed */ diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index 3dc4e58..285da31 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -482,7 +482,7 @@ struct p2p_oper_class_map { struct mlme_ext_priv { _adapter *padapter; u8 mlmeext_init; - ATOMIC_T event_seq; + atomic_t event_seq; u16 mgnt_seq; #ifdef CONFIG_IEEE80211W u16 sa_query_seq; diff --git a/include/rtw_pwrctrl.h b/include/rtw_pwrctrl.h index 7bc5534..6afd25c 100644 --- a/include/rtw_pwrctrl.h +++ b/include/rtw_pwrctrl.h @@ -291,9 +291,9 @@ typedef struct lps_poff_info { u32 tx_bndy_dynamic; u16 ConfLenForPTK; u16 ConfLenForGTK; - ATOMIC_T bEnterPOFF; - ATOMIC_T bTxBoundInProgress; - ATOMIC_T bSetPOFFParm; + atomic_t bEnterPOFF; + atomic_t bTxBoundInProgress; + atomic_t bSetPOFFParm; } lps_poff_info_t; #endif /*CONFIG_LPS_POFF*/ diff --git a/include/rtw_recv.h b/include/rtw_recv.h index ca0ebc3..3f65e0b 100644 --- a/include/rtw_recv.h +++ b/include/rtw_recv.h @@ -387,7 +387,7 @@ struct recv_priv { /* u8 *pallocated_urb_buf; */ _sema allrxreturnevt; uint ff_hwaddr; - ATOMIC_T rx_pending_cnt; + atomic_t rx_pending_cnt; #ifdef CONFIG_USB_INTERRUPT_IN_PIPE #ifdef PLATFORM_LINUX diff --git a/include/rtw_rm.h b/include/rtw_rm.h index 9efcf13..5dffa17 100644 --- a/include/rtw_rm.h +++ b/include/rtw_rm.h @@ -53,7 +53,7 @@ struct rm_event { struct rm_clock { struct rm_obj *prm; - ATOMIC_T counter; + atomic_t counter; enum RM_EV_ID evid; }; diff --git a/include/sta_info.h b/include/sta_info.h index 762933a..f64f470 100644 --- a/include/sta_info.h +++ b/include/sta_info.h @@ -357,7 +357,7 @@ struct sta_info { /* for A-MPDU Rx reordering buffer control */ struct recv_reorder_ctrl recvreorder_ctrl[TID_NUM]; - ATOMIC_T continual_no_rx_packet[TID_NUM]; + atomic_t continual_no_rx_packet[TID_NUM]; /* for A-MPDU Tx */ /* unsigned char ampdu_txen_bitmap; */ u16 BA_starting_seqctrl[16]; diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 7c404be..ccf9c64 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -6687,7 +6687,7 @@ static s32 cfg80211_rtw_remain_on_channel(struct wiphy *wiphy, is_p2p_find = (duration < (pwdinfo->ext_listen_interval)) ? _TRUE : _FALSE; #endif - *cookie = ATOMIC_INC_RETURN(&pcfg80211_wdinfo->ro_ch_cookie_gen); + *cookie = atomic_inc_return(&pcfg80211_wdinfo->ro_ch_cookie_gen); RTW_INFO(FUNC_ADPT_FMT"%s ch:%u duration:%d, cookie:0x%llx\n" , FUNC_ADPT_ARG(padapter), wdev == wiphy_to_pd_wdev(wiphy) ? " PD" : "" @@ -7079,7 +7079,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const #if defined(RTW_ROCH_BACK_OP) && defined(CONFIG_P2P) && defined(CONFIG_CONCURRENT_MODE) if (rtw_cfg80211_get_is_roch(padapter) - && ATOMIC_READ(&pwdev_priv->switch_ch_to) == 1 + && atomic_read(&pwdev_priv->switch_ch_to) == 1 ) { u16 ext_listen_period; @@ -7087,7 +7087,7 @@ static int _cfg80211_rtw_mgmt_tx(_adapter *padapter, u8 tx_ch, u8 no_cck, const ext_listen_period = 500; else ext_listen_period = pwdinfo->ext_listen_period; - ATOMIC_SET(&pwdev_priv->switch_ch_to, 0); + atomic_set(&pwdev_priv->switch_ch_to, 0); _set_timer(&pwdinfo->ap_p2p_switch_timer, ext_listen_period); RTW_INFO("%s, set switch ch timer, period=%d\n", __func__, ext_listen_period); } @@ -9362,7 +9362,7 @@ void rtw_cfg80211_init_wdev_data(_adapter *padapter) #ifdef CONFIG_CONCURRENT_MODE struct rtw_wdev_priv *pwdev_priv = adapter_wdev_data(padapter); - ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); + atomic_set(&pwdev_priv->switch_ch_to, 1); #endif } @@ -10103,7 +10103,7 @@ int rtw_wdev_alloc(_adapter *padapter, struct wiphy *wiphy) _rtw_mutex_init(&pwdev_priv->roch_mutex); #ifdef CONFIG_CONCURRENT_MODE - ATOMIC_SET(&pwdev_priv->switch_ch_to, 1); + atomic_set(&pwdev_priv->switch_ch_to, 1); #endif #ifdef CONFIG_RTW_CFGVEDNOR_RSSIMONITOR diff --git a/os_dep/linux/ioctl_cfg80211.h b/os_dep/linux/ioctl_cfg80211.h index 6775480..146f537 100644 --- a/os_dep/linux/ioctl_cfg80211.h +++ b/os_dep/linux/ioctl_cfg80211.h @@ -177,7 +177,7 @@ struct rtw_wdev_priv { _mutex roch_mutex; #ifdef CONFIG_CONCURRENT_MODE - ATOMIC_T switch_ch_to; + atomic_t switch_ch_to; #endif #ifdef CONFIG_RTW_CFGVENDOR_RANDOM_MAC_OUI diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 04e40a2..372deef 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -6225,7 +6225,7 @@ static int rtw_dbg_port(struct net_device *dev, pxmitpriv->free_xmit_extbuf_cnt, pxmitpriv->free_xframe_ext_cnt, precvpriv->free_recvframe_cnt); #ifdef CONFIG_USB_HCI - RTW_INFO("rx_urb_pending_cn=%d\n", ATOMIC_READ(&(precvpriv->rx_pending_cnt))); + RTW_INFO("rx_urb_pending_cn=%d\n", atomic_read(&(precvpriv->rx_pending_cnt))); #endif } break; @@ -11042,7 +11042,7 @@ static int rtw_wfd_tdls_status(struct net_device *dev, #ifdef CONFIG_TDLS_CH_SW , ptdlsinfo->chsw_info.ch_sw_state, - ATOMIC_READ(&padapter->tdlsinfo.chsw_info.chsw_on), + atomic_read(&padapter->tdlsinfo.chsw_info.chsw_on), ptdlsinfo->chsw_info.off_ch_num, ptdlsinfo->chsw_info.cur_time, ptdlsinfo->chsw_info.ch_offset, diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 03a9c7b..9356a7c 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -2134,7 +2134,7 @@ struct dvobj_priv *devobj_init(void) pdvobj->processing_dev_remove = _FALSE; - ATOMIC_SET(&pdvobj->disable_func, 0); + atomic_set(&pdvobj->disable_func, 0); rtw_macid_ctl_init(&pdvobj->macid_ctl); #ifdef CONFIG_CLIENT_PORT_CFG @@ -4273,7 +4273,7 @@ void rtw_dev_unload(PADAPTER padapter) { rtw_stop_drv_threads(padapter); - if (ATOMIC_READ(&(pcmdpriv->cmdthd_running)) == _TRUE) { + if (atomic_read(&(pcmdpriv->cmdthd_running)) == _TRUE) { RTW_ERR("cmd_thread not stop !!\n"); rtw_warn_on(1); } diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index fd542bb..bbcfde1 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -79,7 +79,7 @@ static void rtw_dev_shutdown(struct device *dev) } } } - ATOMIC_SET(&dvobj->continual_io_error, MAX_CONTINUAL_IO_ERR + 1); + atomic_set(&dvobj->continual_io_error, MAX_CONTINUAL_IO_ERR + 1); } } } @@ -686,7 +686,7 @@ static void usb_dvobj_deinit(struct usb_interface *usb_intf) devobj_deinit(dvobj); } - /* RTW_INFO("%s %d\n", __func__, ATOMIC_READ(&usb_intf->dev.kobj.kref.refcount)); */ + /* RTW_INFO("%s %d\n", __func__, atomic_read(&usb_intf->dev.kobj.kref.refcount)); */ usb_put_dev(interface_to_usbdev(usb_intf)); } diff --git a/os_dep/linux/usb_ops_linux.c b/os_dep/linux/usb_ops_linux.c index 709023a..1d20cbf 100644 --- a/os_dep/linux/usb_ops_linux.c +++ b/os_dep/linux/usb_ops_linux.c @@ -753,7 +753,7 @@ void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) _adapter *padapter = (_adapter *)precvbuf->adapter; struct recv_priv *precvpriv = &padapter->recvpriv; - ATOMIC_DEC(&(precvpriv->rx_pending_cnt)); + atomic_dec(&(precvpriv->rx_pending_cnt)); if (RTW_CANNOT_RX(padapter)) { RTW_INFO("%s() RX Warning! bDriverStopped(%s) OR bSurpriseRemoved(%s)\n" @@ -837,7 +837,7 @@ u32 usb_read_port(struct intf_hdl *pintfhdl, u32 addr, u32 cnt, u8 *rmem) usb_init_recvbuf(adapter, precvbuf); if (precvbuf->pbuf) { - ATOMIC_INC(&(precvpriv->rx_pending_cnt)); + atomic_inc(&(precvpriv->rx_pending_cnt)); purb = precvbuf->purb; /* translate DMA FIFO addr to pipehandle */ @@ -906,7 +906,7 @@ void usb_read_port_complete(struct urb *purb, struct pt_regs *regs) _adapter *padapter = (_adapter *)precvbuf->adapter; struct recv_priv *precvpriv = &padapter->recvpriv; - ATOMIC_DEC(&(precvpriv->rx_pending_cnt)); + atomic_dec(&(precvpriv->rx_pending_cnt)); if (RTW_CANNOT_RX(padapter)) { RTW_INFO("%s() RX Warning! bDriverStopped(%s) OR bSurpriseRemoved(%s)\n" @@ -1046,7 +1046,7 @@ recv_buf_hook: goto exit; } - ATOMIC_INC(&(precvpriv->rx_pending_cnt)); + atomic_inc(&(precvpriv->rx_pending_cnt)); ret = _SUCCESS; exit: diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 7794059..f805308 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -20,14 +20,6 @@ #define RT_TAG '1178' -#ifdef DBG_MEMORY_LEAK -#ifdef PLATFORM_LINUX -atomic_t _malloc_cnt = ATOMIC_INIT(0); -atomic_t _malloc_size = ATOMIC_INIT(0); -#endif -#endif /* DBG_MEMORY_LEAK */ - - #if defined(PLATFORM_LINUX) /* * Translate the OS dependent @param error_code to OS independent RTW_STATUS_CODE @@ -407,10 +399,10 @@ inline void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr #if defined(DBG_MEM_ALLOC) struct rtw_mem_stat { - ATOMIC_T alloc; /* the memory bytes we allocate currently */ - ATOMIC_T peak; /* the peak memory bytes we allocate */ - ATOMIC_T alloc_cnt; /* the alloc count for alloc currently */ - ATOMIC_T alloc_err_cnt; /* the error times we fail to allocate memory */ + atomic_t alloc; /* the memory bytes we allocate currently */ + atomic_t peak; /* the peak memory bytes we allocate */ + atomic_t alloc_cnt; /* the alloc count for alloc currently */ + atomic_t alloc_err_cnt; /* the error times we fail to allocate memory */ }; struct rtw_mem_stat rtw_mem_type_stat[mstat_tf_idx(MSTAT_TYPE_MAX)]; @@ -448,18 +440,18 @@ void rtw_mstat_dump(void *sel) int tx_alloc, tx_peak, tx_alloc_err, rx_alloc, rx_peak, rx_alloc_err; for (i = 0; i < mstat_tf_idx(MSTAT_TYPE_MAX); i++) { - value_t[0][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].alloc)); - value_t[1][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].peak)); - value_t[2][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].alloc_cnt)); - value_t[3][i] = ATOMIC_READ(&(rtw_mem_type_stat[i].alloc_err_cnt)); + value_t[0][i] = atomic_read(&(rtw_mem_type_stat[i].alloc)); + value_t[1][i] = atomic_read(&(rtw_mem_type_stat[i].peak)); + value_t[2][i] = atomic_read(&(rtw_mem_type_stat[i].alloc_cnt)); + value_t[3][i] = atomic_read(&(rtw_mem_type_stat[i].alloc_err_cnt)); } #ifdef RTW_MEM_FUNC_STAT for (i = 0; i < mstat_ff_idx(MSTAT_FUNC_MAX); i++) { - value_f[0][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].alloc)); - value_f[1][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].peak)); - value_f[2][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].alloc_cnt)); - value_f[3][i] = ATOMIC_READ(&(rtw_mem_func_stat[i].alloc_err_cnt)); + value_f[0][i] = atomic_read(&(rtw_mem_func_stat[i].alloc)); + value_f[1][i] = atomic_read(&(rtw_mem_func_stat[i].peak)); + value_f[2][i] = atomic_read(&(rtw_mem_func_stat[i].alloc_cnt)); + value_f[3][i] = atomic_read(&(rtw_mem_func_stat[i].alloc_err_cnt)); } #endif @@ -484,51 +476,51 @@ void rtw_mstat_update(const enum mstat_f flags, const MSTAT_STATUS status, u32 s /* initialization */ if (!update_time) { for (i = 0; i < mstat_tf_idx(MSTAT_TYPE_MAX); i++) { - ATOMIC_SET(&(rtw_mem_type_stat[i].alloc), 0); - ATOMIC_SET(&(rtw_mem_type_stat[i].peak), 0); - ATOMIC_SET(&(rtw_mem_type_stat[i].alloc_cnt), 0); - ATOMIC_SET(&(rtw_mem_type_stat[i].alloc_err_cnt), 0); + atomic_set(&(rtw_mem_type_stat[i].alloc), 0); + atomic_set(&(rtw_mem_type_stat[i].peak), 0); + atomic_set(&(rtw_mem_type_stat[i].alloc_cnt), 0); + atomic_set(&(rtw_mem_type_stat[i].alloc_err_cnt), 0); } #ifdef RTW_MEM_FUNC_STAT for (i = 0; i < mstat_ff_idx(MSTAT_FUNC_MAX); i++) { - ATOMIC_SET(&(rtw_mem_func_stat[i].alloc), 0); - ATOMIC_SET(&(rtw_mem_func_stat[i].peak), 0); - ATOMIC_SET(&(rtw_mem_func_stat[i].alloc_cnt), 0); - ATOMIC_SET(&(rtw_mem_func_stat[i].alloc_err_cnt), 0); + atomic_set(&(rtw_mem_func_stat[i].alloc), 0); + atomic_set(&(rtw_mem_func_stat[i].peak), 0); + atomic_set(&(rtw_mem_func_stat[i].alloc_cnt), 0); + atomic_set(&(rtw_mem_func_stat[i].alloc_err_cnt), 0); } #endif } switch (status) { case MSTAT_ALLOC_SUCCESS: - ATOMIC_INC(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt)); - alloc = ATOMIC_ADD_RETURN(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz); - peak = ATOMIC_READ(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak)); + atomic_inc(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt)); + alloc = atomic_add_RETURN(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz); + peak = atomic_read(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak)); if (peak < alloc) - ATOMIC_SET(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak), alloc); + atomic_set(&(rtw_mem_type_stat[mstat_tf_idx(flags)].peak), alloc); #ifdef RTW_MEM_FUNC_STAT - ATOMIC_INC(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt)); - alloc = ATOMIC_ADD_RETURN(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz); - peak = ATOMIC_READ(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak)); + atomic_inc(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt)); + alloc = atomic_add_RETURN(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz); + peak = atomic_read(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak)); if (peak < alloc) - ATOMIC_SET(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak), alloc); + atomic_set(&(rtw_mem_func_stat[mstat_ff_idx(flags)].peak), alloc); #endif break; case MSTAT_ALLOC_FAIL: - ATOMIC_INC(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_err_cnt)); + atomic_inc(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_err_cnt)); #ifdef RTW_MEM_FUNC_STAT - ATOMIC_INC(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_err_cnt)); + atomic_inc(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_err_cnt)); #endif break; case MSTAT_FREE: - ATOMIC_DEC(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt)); - ATOMIC_SUB(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz); + atomic_dec(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc_cnt)); + atomic_sub(&(rtw_mem_type_stat[mstat_tf_idx(flags)].alloc), sz); #ifdef RTW_MEM_FUNC_STAT - ATOMIC_DEC(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt)); - ATOMIC_SUB(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz); + atomic_dec(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc_cnt)); + atomic_sub(&(rtw_mem_func_stat[mstat_ff_idx(flags)].alloc), sz); #endif break; }; @@ -1961,137 +1953,6 @@ inline int rtw_test_and_clear_bit(int nr, unsigned long *addr) #endif } -inline void ATOMIC_SET(ATOMIC_T *v, int i) -{ -#ifdef PLATFORM_LINUX - atomic_set(v, i); -#elif defined(PLATFORM_WINDOWS) - *v = i; /* other choice???? */ -#elif defined(PLATFORM_FREEBSD) - atomic_set_int(v, i); -#endif -} - -inline int ATOMIC_READ(ATOMIC_T *v) -{ -#ifdef PLATFORM_LINUX - return atomic_read(v); -#elif defined(PLATFORM_WINDOWS) - return *v; /* other choice???? */ -#elif defined(PLATFORM_FREEBSD) - return atomic_load_acq_32(v); -#endif -} - -inline void ATOMIC_ADD(ATOMIC_T *v, int i) -{ -#ifdef PLATFORM_LINUX - atomic_add(i, v); -#elif defined(PLATFORM_WINDOWS) - InterlockedAdd(v, i); -#elif defined(PLATFORM_FREEBSD) - atomic_add_int(v, i); -#endif -} -inline void ATOMIC_SUB(ATOMIC_T *v, int i) -{ -#ifdef PLATFORM_LINUX - atomic_sub(i, v); -#elif defined(PLATFORM_WINDOWS) - InterlockedAdd(v, -i); -#elif defined(PLATFORM_FREEBSD) - atomic_subtract_int(v, i); -#endif -} - -inline void ATOMIC_INC(ATOMIC_T *v) -{ -#ifdef PLATFORM_LINUX - atomic_inc(v); -#elif defined(PLATFORM_WINDOWS) - InterlockedIncrement(v); -#elif defined(PLATFORM_FREEBSD) - atomic_add_int(v, 1); -#endif -} - -inline void ATOMIC_DEC(ATOMIC_T *v) -{ -#ifdef PLATFORM_LINUX - atomic_dec(v); -#elif defined(PLATFORM_WINDOWS) - InterlockedDecrement(v); -#elif defined(PLATFORM_FREEBSD) - atomic_subtract_int(v, 1); -#endif -} - -inline int ATOMIC_ADD_RETURN(ATOMIC_T *v, int i) -{ -#ifdef PLATFORM_LINUX - return atomic_add_return(i, v); -#elif defined(PLATFORM_WINDOWS) - return InterlockedAdd(v, i); -#elif defined(PLATFORM_FREEBSD) - atomic_add_int(v, i); - return atomic_load_acq_32(v); -#endif -} - -inline int ATOMIC_SUB_RETURN(ATOMIC_T *v, int i) -{ -#ifdef PLATFORM_LINUX - return atomic_sub_return(i, v); -#elif defined(PLATFORM_WINDOWS) - return InterlockedAdd(v, -i); -#elif defined(PLATFORM_FREEBSD) - atomic_subtract_int(v, i); - return atomic_load_acq_32(v); -#endif -} - -inline int ATOMIC_INC_RETURN(ATOMIC_T *v) -{ -#ifdef PLATFORM_LINUX - return atomic_inc_return(v); -#elif defined(PLATFORM_WINDOWS) - return InterlockedIncrement(v); -#elif defined(PLATFORM_FREEBSD) - atomic_add_int(v, 1); - return atomic_load_acq_32(v); -#endif -} - -inline int ATOMIC_DEC_RETURN(ATOMIC_T *v) -{ -#ifdef PLATFORM_LINUX - return atomic_dec_return(v); -#elif defined(PLATFORM_WINDOWS) - return InterlockedDecrement(v); -#elif defined(PLATFORM_FREEBSD) - atomic_subtract_int(v, 1); - return atomic_load_acq_32(v); -#endif -} - -inline bool ATOMIC_INC_UNLESS(ATOMIC_T *v, int u) -{ -#ifdef PLATFORM_LINUX -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 15)) - return atomic_add_unless(v, 1, u); -#else - /* only make sure not exceed after this function */ - if (ATOMIC_INC_RETURN(v) > u) { - ATOMIC_DEC(v); - return 0; - } - return 1; -#endif -#else - #error "TBD\n" -#endif -} - #ifdef PLATFORM_LINUX /* * Open a file with the specific @param path, @param flag, @param mode From 4d3d23dd24ec9cff370fce24703956fdb6a24afc Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Tue, 3 Aug 2021 08:52:21 -0500 Subject: [PATCH 09/16] Remove wrapper around do_div Wrapper routine rtw_modular64() contains only a call to do_div() and is used once in the code. Remove the wrapper. Link: https://lore.kernel.org/r/20210803135223.12543-9-Larry.Finger@lwfinger.net --- core/rtw_wlan_util.c | 2 +- hal/hal_com.c | 2 +- hal/hal_mcc.c | 4 ++-- include/osdep_service.h | 1 - os_dep/osdep_service.c | 19 ------------------- 5 files changed, 4 insertions(+), 24 deletions(-) diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index a1b5063..97300c1 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -2428,7 +2428,7 @@ void rtw_debug_rx_bcn(_adapter *adapter, u8 *pframe, u32 packet_len) update_TSF(pmlmeext, pframe, packet_len); tsf = pmlmeext->TSFValue; - tsf_offset = rtw_modular64(pmlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024)); + tsf_offset = do_div(pmlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024)); /*get TIM IE*/ /*DTIM Count*/ diff --git a/hal/hal_com.c b/hal/hal_com.c index f0c7e43..ea558a0 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -11328,7 +11328,7 @@ static void hw_var_set_correct_tsf(_adapter *adapter, u8 mlme_state) struct mlme_ext_priv *mlmeext = &adapter->mlmeextpriv; struct mlme_ext_info *mlmeinfo = &(mlmeext->mlmext_info); - tsf = mlmeext->TSFValue - rtw_modular64(mlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024)) - 1024; /*us*/ + tsf = mlmeext->TSFValue - do_div(mlmeext->TSFValue, (mlmeinfo->bcn_interval * 1024)) - 1024; /*us*/ if ((mlmeinfo->state & 0x03) == WIFI_FW_ADHOC_STATE || (mlmeinfo->state & 0x03) == WIFI_FW_AP_STATE) diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index 179d4d5..ac251cb 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -753,11 +753,11 @@ static u8 rtw_hal_mcc_update_timing_parameters(PADAPTER padapter, u8 force_updat /* selecet policy table according TSF diff */ tsf0 = tsf[0]; beaconperiod_0 = pmccobjpriv->iface[0]->mlmepriv.cur_network.network.Configuration.BeaconPeriod; - tsf0 = rtw_modular64(tsf0, (beaconperiod_0 * TU)); + tsf0 = do_div(tsf0, (beaconperiod_0 * TU)); tsf1 = tsf[1]; beaconperiod_1 = pmccobjpriv->iface[1]->mlmepriv.cur_network.network.Configuration.BeaconPeriod; - tsf1 = rtw_modular64(tsf1, (beaconperiod_1 * TU)); + tsf1 = do_div(tsf1, (beaconperiod_1 * TU)); if (tsf0 > tsf1) tsfdiff = tsf0- tsf1; diff --git a/include/osdep_service.h b/include/osdep_service.h index 93f68c4..d26cd9f 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -622,7 +622,6 @@ extern void rtw_free_netdev(struct net_device *netdev); #endif /* PLATFORM_FREEBSD */ -extern u64 rtw_modular64(u64 x, u64 y); extern u64 rtw_division64(u64 x, u64 y); extern u32 rtw_random32(void); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index f805308..3dc89ca 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -2433,25 +2433,6 @@ void module_init_exit_wrapper(void *arg) } #endif /* PLATFORM_FREEBSD */ - -#ifdef CONFIG_PLATFORM_SPRD - #ifdef do_div - #undef do_div - #endif - #include -#endif - -u64 rtw_modular64(u64 x, u64 y) -{ -#ifdef PLATFORM_LINUX - return do_div(x, y); -#elif defined(PLATFORM_WINDOWS) - return x % y; -#elif defined(PLATFORM_FREEBSD) - return x % y; -#endif -} - u64 rtw_division64(u64 x, u64 y) { #ifdef PLATFORM_LINUX From 34ec2383872e3eabb32a94dd75d05477c4357c36 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 5 Aug 2021 13:37:14 -0500 Subject: [PATCH 10/16] Remove wrapper around vfree This call is so simple that there is no need, or use, for a wrapper. Link: https://lore.kernel.org/r/20210805183717.23007-3-Larry.Finger@lwfinger.net --- core/efuse/rtw_efuse.c | 4 ++-- core/rtw_mlme.c | 3 +-- core/rtw_mp.c | 3 +-- core/rtw_recv.c | 3 +-- core/rtw_rf.c | 2 +- core/rtw_sta_mgt.c | 4 ++-- core/rtw_xmit.c | 13 +++++-------- hal/hal_com.c | 6 +++--- hal/hal_com_phycfg.c | 18 +++++++++--------- hal/hal_halmac.c | 2 +- hal/hal_intf.c | 2 +- hal/phydm/phydm_interface.c | 4 ++-- include/osdep_service.h | 5 ----- os_dep/linux/ioctl_linux.c | 8 ++++---- os_dep/linux/os_intfs.c | 4 ++-- os_dep/linux/usb_intf.c | 4 ++-- os_dep/osdep_service.c | 22 +--------------------- 17 files changed, 38 insertions(+), 69 deletions(-) diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c index cca0261..309ecb3 100644 --- a/core/efuse/rtw_efuse.c +++ b/core/efuse/rtw_efuse.c @@ -3213,9 +3213,9 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size) exit: if (file_data) - rtw_vmfree(file_data, file_size); + vfree(file_data); if (map) - rtw_vmfree(map, map_size); + vfree(map); return ret; } diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 3922ff5..1588e49 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -307,8 +307,7 @@ void _rtw_free_mlme_priv(struct mlme_priv *pmlmepriv) if (pmlmepriv) { rtw_mfree_mlme_priv_lock(pmlmepriv); - if (pmlmepriv->free_bss_buf) - rtw_vmfree(pmlmepriv->free_bss_buf, pmlmepriv->max_bss_cnt * sizeof(struct wlan_network)); + vfree(pmlmepriv->free_bss_buf); } exit: return; diff --git a/core/rtw_mp.c b/core/rtw_mp.c index cb0c057..7a95e64 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -2492,8 +2492,7 @@ void _rtw_mp_xmit_priv(struct xmit_priv *pxmitpriv) pxmitbuf++; } - if (pxmitpriv->pallocated_xmit_extbuf) - rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, num_xmit_extbuf * sizeof(struct xmit_buf) + 4); + vfree(pxmitpriv->pallocated_xmit_extbuf); if (padapter->registrypriv.mp_mode == 0) { max_xmit_extbuf_size = 6000; diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 24d6b5d..7443e0a 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -194,8 +194,7 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv) rtw_os_recv_resource_free(precvpriv); - if (precvpriv->pallocated_frame_buf) - rtw_vmfree(precvpriv->pallocated_frame_buf, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); + vfree(precvpriv->pallocated_frame_buf); rtw_hal_free_recv_priv(padapter); diff --git a/core/rtw_rf.c b/core/rtw_rf.c index fa851e4..b74e2e5 100644 --- a/core/rtw_rf.c +++ b/core/rtw_rf.c @@ -1178,7 +1178,7 @@ void rtw_txpwr_lmt_list_free(struct rf_ctl_t *rfctl) if (ent->regd_name == rfctl->regd_name) rfctl->regd_name = regd_str(TXPWR_LMT_NONE); rtw_list_delete(&ent->list); - rtw_vmfree((u8 *)ent, sizeof(struct txpwr_lmt_ent) + strlen(ent->regd_name) + 1); + vfree(ent); } rfctl->txpwr_regd_num = 0; diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index f4fbdb4..5d05dc1 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -320,7 +320,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) exit: if (ret != _SUCCESS) { if (pstapriv->pallocated_stainfo_buf) - rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info) * NUM_STA + 4); + vfree(pstapriv->pallocated_stainfo_buf); #ifdef CONFIG_AP_MODE if (pstapriv->sta_aid) rtw_mfree(pstapriv->sta_aid, pstapriv->max_aid * sizeof(struct sta_info *)); @@ -471,7 +471,7 @@ u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) #endif if (pstapriv->pallocated_stainfo_buf) - rtw_vmfree(pstapriv->pallocated_stainfo_buf, sizeof(struct sta_info) * NUM_STA + 4); + vfree(pstapriv->pallocated_stainfo_buf); #ifdef CONFIG_AP_MODE if (pstapriv->sta_aid) rtw_mfree(pstapriv->sta_aid, pstapriv->max_aid * sizeof(struct sta_info *)); diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 1b86e13..f88345d 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -405,12 +405,10 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) pxmitbuf++; } - if (pxmitpriv->pallocated_frame_buf) - rtw_vmfree(pxmitpriv->pallocated_frame_buf, NR_XMITFRAME * sizeof(struct xmit_frame) + 4); + vfree(pxmitpriv->pallocated_frame_buf); - if (pxmitpriv->pallocated_xmitbuf) - rtw_vmfree(pxmitpriv->pallocated_xmitbuf, NR_XMITBUFF * sizeof(struct xmit_buf) + 4); + vfree(pxmitpriv->pallocated_xmitbuf); /* free xframe_ext queue, the same count as extbuf */ if ((pxmitframe = (struct xmit_frame *)pxmitpriv->xframe_ext)) { @@ -419,8 +417,8 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) pxmitframe++; } } - if (pxmitpriv->xframe_ext_alloc_addr) - rtw_vmfree(pxmitpriv->xframe_ext_alloc_addr, NR_XMIT_EXTBUFF * sizeof(struct xmit_frame) + 4); + + vfree(pxmitpriv->xframe_ext_alloc_addr); _rtw_spinlock_free(&pxmitpriv->free_xframe_ext_queue.lock); /* free xmit extension buff */ @@ -433,8 +431,7 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) pxmitbuf++; } - if (pxmitpriv->pallocated_xmit_extbuf) - rtw_vmfree(pxmitpriv->pallocated_xmit_extbuf, NR_XMIT_EXTBUFF * sizeof(struct xmit_buf) + 4); + vfree(pxmitpriv->pallocated_xmit_extbuf); for (i = 0; i < CMDBUF_MAX; i++) { pxmitbuf = &pxmitpriv->pcmd_xmitbuf[i]; diff --git a/hal/hal_com.c b/hal/hal_com.c index ea558a0..786d957 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -4702,7 +4702,7 @@ void rtw_dump_rsvd_page(void *sel, _adapter *adapter, u8 page_offset, u8 page_nu if (buffer) { rtw_hal_get_rsvd_page(adapter, page_offset, page_num, buffer, buf_size); RTW_DUMP_SEL(sel, buffer, buf_size); - rtw_vmfree(buffer, buf_size); + vfree(buffer); } else RTW_PRINT_SEL(sel, "ERROR - rsvd_buf mem allocate failed\n"); } else @@ -4739,7 +4739,7 @@ void rtw_dump_fifo(void *sel, _adapter *adapter, u8 fifo_sel, u32 fifo_addr, u32 if (buffer) { RTW_DUMP_SEL(sel, buffer, fifo_size); - rtw_vmfree(buffer, buff_size); + vfree(buffer); } RTW_PRINT_SEL(sel, "==========================\n"); @@ -5224,7 +5224,7 @@ static void rtw_hal_get_aoac_rpt(_adapter *adapter) _exit: if (buffer) - rtw_vmfree(buffer, buf_size); + vfree(buffer); } static void rtw_hal_update_tx_iv(_adapter *adapter) diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c index ada38b2..7e68568 100644 --- a/hal/hal_com_phycfg.c +++ b/hal/hal_com_phycfg.c @@ -5359,43 +5359,43 @@ void phy_free_filebuf_mask(_adapter *padapter, u8 mask) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); if (pHalData->mac_reg && (mask & LOAD_MAC_PARA_FILE)) { - rtw_vmfree(pHalData->mac_reg, pHalData->mac_reg_len); + vfree(pHalData->mac_reg); pHalData->mac_reg = NULL; } if (mask & LOAD_BB_PARA_FILE) { if (pHalData->bb_phy_reg) { - rtw_vmfree(pHalData->bb_phy_reg, pHalData->bb_phy_reg_len); + vfree(pHalData->bb_phy_reg); pHalData->bb_phy_reg = NULL; } if (pHalData->bb_agc_tab) { - rtw_vmfree(pHalData->bb_agc_tab, pHalData->bb_agc_tab_len); + vfree(pHalData->bb_agc_tab); pHalData->bb_agc_tab = NULL; } } if (pHalData->bb_phy_reg_pg && (mask & LOAD_BB_PG_PARA_FILE)) { - rtw_vmfree(pHalData->bb_phy_reg_pg, pHalData->bb_phy_reg_pg_len); + vfree(pHalData->bb_phy_reg_pg); pHalData->bb_phy_reg_pg = NULL; } if (pHalData->bb_phy_reg_mp && (mask & LOAD_BB_MP_PARA_FILE)) { - rtw_vmfree(pHalData->bb_phy_reg_mp, pHalData->bb_phy_reg_mp_len); + vfree(pHalData->bb_phy_reg_mp); pHalData->bb_phy_reg_mp = NULL; } if (mask & LOAD_RF_PARA_FILE) { if (pHalData->rf_radio_a) { - rtw_vmfree(pHalData->rf_radio_a, pHalData->rf_radio_a_len); + vfree(pHalData->rf_radio_a); pHalData->rf_radio_a = NULL; } if (pHalData->rf_radio_b) { - rtw_vmfree(pHalData->rf_radio_b, pHalData->rf_radio_b_len); + vfree(pHalData->rf_radio_b); pHalData->rf_radio_b = NULL; } } if (pHalData->rf_tx_pwr_track && (mask & LOAD_RF_TXPWR_TRACK_PARA_FILE)) { - rtw_vmfree(pHalData->rf_tx_pwr_track, pHalData->rf_tx_pwr_track_len); + vfree(pHalData->rf_tx_pwr_track); pHalData->rf_tx_pwr_track = NULL; } if (pHalData->rf_tx_pwr_lmt && (mask & LOAD_RF_TXPWR_LMT_PARA_FILE)) { - rtw_vmfree(pHalData->rf_tx_pwr_lmt, pHalData->rf_tx_pwr_lmt_len); + vfree(pHalData->rf_tx_pwr_lmt); pHalData->rf_tx_pwr_lmt = NULL; } } diff --git a/hal/hal_halmac.c b/hal/hal_halmac.c index 0b74ecb..a12abab 100644 --- a/hal/hal_halmac.c +++ b/hal/hal_halmac.c @@ -4414,7 +4414,7 @@ int rtw_halmac_dump_fifo(struct dvobj_priv *d, u8 fifo_sel, u32 addr, u32 size, _exit: if ((mem_created == _TRUE) && pfifo_map) - rtw_vmfree(pfifo_map, fifo_size); + vfree(pfifo_map); return ret; } diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 25edef6..665d8e8 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -164,7 +164,7 @@ void rtw_hal_data_deinit(_adapter *padapter) #ifdef CONFIG_LOAD_PHY_PARA_FROM_FILE phy_free_filebuf(padapter); #endif - rtw_vmfree(padapter->HalData, padapter->hal_data_sz); + vfree(padapter->HalData); padapter->HalData = NULL; padapter->hal_data_sz = 0; } diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index fe0f5c2..7fb1a25 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -389,12 +389,12 @@ void odm_free_memory(struct dm_struct *dm, void *ptr, u32 length) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) kfree(ptr); #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) - rtw_vmfree(ptr, length); + vfree(ptr); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) /* struct void* adapter = dm->adapter; */ PlatformFreeMemory(ptr, length); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) - rtw_vmfree(ptr, length); + vfree(ptr); #endif } diff --git a/include/osdep_service.h b/include/osdep_service.h index d26cd9f..749189b 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -170,14 +170,12 @@ void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dm #ifdef CONFIG_USE_VMALLOC #define rtw_vmalloc(sz) dbg_rtw_vmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_zvmalloc(sz) dbg_rtw_zvmalloc((sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) -#define rtw_vmfree(pbuf, sz) dbg_rtw_vmfree((pbuf), (sz), MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_vmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zvmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_vmfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_VIR, __FUNCTION__, __LINE__) #else /* CONFIG_USE_VMALLOC */ #define rtw_vmalloc(sz) dbg_rtw_malloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_zvmalloc(sz) dbg_rtw_zmalloc((sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) -#define rtw_vmfree(pbuf, sz) dbg_rtw_mfree((pbuf), (sz), MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_vmalloc_f(sz, mstat_f) dbg_rtw_malloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_zvmalloc_f(sz, mstat_f) dbg_rtw_zmalloc((sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) #define rtw_vmfree_f(pbuf, sz, mstat_f) dbg_rtw_mfree((pbuf), (sz), ((mstat_f) & 0xff00) | MSTAT_TYPE_PHY, __FUNCTION__, __LINE__) @@ -218,7 +216,6 @@ void dbg_rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dm #define match_mstat_sniff_rules(flags, size) _FALSE void *_rtw_vmalloc(u32 sz); void *_rtw_zvmalloc(u32 sz); -void _rtw_vmfree(void *pbuf, u32 sz); void *_rtw_zmalloc(u32 sz); void *_rtw_malloc(u32 sz); void _rtw_mfree(void *pbuf, u32 sz); @@ -244,14 +241,12 @@ void _rtw_usb_buffer_free(struct usb_device *dev, size_t size, void *addr, dma_a #ifdef CONFIG_USE_VMALLOC #define rtw_vmalloc(sz) _rtw_vmalloc((sz)) #define rtw_zvmalloc(sz) _rtw_zvmalloc((sz)) -#define rtw_vmfree(pbuf, sz) _rtw_vmfree((pbuf), (sz)) #define rtw_vmalloc_f(sz, mstat_f) _rtw_vmalloc((sz)) #define rtw_zvmalloc_f(sz, mstat_f) _rtw_zvmalloc((sz)) #define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_vmfree((pbuf), (sz)) #else /* CONFIG_USE_VMALLOC */ #define rtw_vmalloc(sz) _rtw_malloc((sz)) #define rtw_zvmalloc(sz) _rtw_zmalloc((sz)) -#define rtw_vmfree(pbuf, sz) _rtw_mfree((pbuf), (sz)) #define rtw_vmalloc_f(sz, mstat_f) _rtw_malloc((sz)) #define rtw_zvmalloc_f(sz, mstat_f) _rtw_zmalloc((sz)) #define rtw_vmfree_f(pbuf, sz, mstat_f) _rtw_mfree((pbuf), (sz)) diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 372deef..3aca931 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -7875,7 +7875,7 @@ static int rtw_wx_set_priv(struct net_device *dev, return -ENOMEM; if (copy_from_user(ext, dwrq->pointer, len)) { - rtw_vmfree(ext, len); + vfree(ext); return -EFAULT; } @@ -7884,7 +7884,7 @@ static int rtw_wx_set_priv(struct net_device *dev, #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV ext_dbg = rtw_vmalloc(len); if (!ext_dbg) { - rtw_vmfree(ext, len); + vfree(ext); return -ENOMEM; } @@ -8004,9 +8004,9 @@ static int rtw_wx_set_priv(struct net_device *dev, FREE_EXT: - rtw_vmfree(ext, len); + vfree(ext); #ifdef CONFIG_DEBUG_RTW_WX_SET_PRIV - rtw_vmfree(ext_dbg, len); + vfree(ext_dbg); #endif /* RTW_INFO("rtw_wx_set_priv: (SIOCSIWPRIV) %s ret=%d\n", */ diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 9356a7c..ec2e00a 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -2898,7 +2898,7 @@ free_drv_sw: rtw_free_drv_sw(padapter); free_adapter: if (res != _SUCCESS && padapter) { - rtw_vmfree((u8 *)padapter, sizeof(*padapter)); + vfree((u8 *)padapter); padapter = NULL; } exit: @@ -2958,7 +2958,7 @@ void rtw_drv_free_vir_if(_adapter *padapter) /* TODO: use rtw_os_ndevs_deinit instead at the first stage of driver's dev deinit function */ rtw_os_ndev_free(padapter); - rtw_vmfree((u8 *)padapter, sizeof(_adapter)); + vfree(padapter); } diff --git a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c index bbcfde1..0e9c628 100644 --- a/os_dep/linux/usb_intf.c +++ b/os_dep/linux/usb_intf.c @@ -1399,7 +1399,7 @@ free_adapter: #ifdef RTW_HALMAC rtw_halmac_deinit_adapter(dvobj); #endif - rtw_vmfree((u8 *)padapter, sizeof(*padapter)); + vfree((u8 *)padapter); padapter = NULL; } exit: @@ -1459,7 +1459,7 @@ static void rtw_usb_primary_adapter_deinit(_adapter *padapter) rtw_halmac_deinit_adapter(adapter_to_dvobj(padapter)); #endif /* RTW_HALMAC */ - rtw_vmfree((u8 *)padapter, sizeof(_adapter)); + vfree(padapter); #ifdef CONFIG_PLATFORM_RTD2880B RTW_INFO("wlan link down\n"); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 3dc89ca..73703ba 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -111,26 +111,6 @@ inline void *_rtw_zvmalloc(u32 sz) return pbuf; } -inline void _rtw_vmfree(void *pbuf, u32 sz) -{ -#ifdef PLATFORM_LINUX - vfree(pbuf); -#endif -#ifdef PLATFORM_FREEBSD - free(pbuf, M_DEVBUF); -#endif -#ifdef PLATFORM_WINDOWS - NdisFreeMemory(pbuf, sz, 0); -#endif - -#ifdef DBG_MEMORY_LEAK -#ifdef PLATFORM_LINUX - atomic_dec(&_malloc_cnt); - atomic_sub(sz, &_malloc_size); -#endif -#endif /* DBG_MEMORY_LEAK */ -} - void *_rtw_malloc(u32 sz) { void *pbuf = NULL; @@ -602,7 +582,7 @@ inline void dbg_rtw_vmfree(void *pbuf, u32 sz, const enum mstat_f flags, const c if (match_mstat_sniff_rules(flags, sz)) RTW_INFO("DBG_MEM_ALLOC %s:%d %s(%d)\n", func, line, __FUNCTION__, (sz)); - _rtw_vmfree((pbuf), (sz)); + vfree((pbuf)); rtw_mstat_update( flags From 51e1f13a918e4c4acc3e2550947f05ade5332949 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 5 Aug 2021 13:37:15 -0500 Subject: [PATCH 11/16] Remove all calls to _rtw_spinlock_free() This routine is empty, thus all calls to it can be removed. Link: https://lore.kernel.org/r/20210805183717.23007-4-Larry.Finger@lwfinger.net --- core/mesh/rtw_mesh.c | 4 +--- core/mesh/rtw_mesh_pathtbl.c | 1 - core/rtw_ap.c | 5 ----- core/rtw_cmd.c | 1 - core/rtw_mlme.c | 3 --- core/rtw_recv.c | 10 --------- core/rtw_sta_mgt.c | 39 ----------------------------------- core/rtw_tdls.c | 2 -- core/rtw_wlan_util.c | 5 ----- core/rtw_xmit.c | 25 ---------------------- hal/hal_com.c | 6 +----- hal/hal_intf.c | 1 - hal/rtl8192e/rtl8192e_dm.c | 1 - include/osdep_service.h | 1 - include/rtw_mlme_ext.h | 1 - os_dep/linux/ioctl_cfg80211.c | 3 --- os_dep/linux/os_intfs.c | 18 ---------------- os_dep/osdep_service.c | 14 ------------- 18 files changed, 2 insertions(+), 138 deletions(-) diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index c0099d8..8fe498c 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -1165,7 +1165,7 @@ void dump_mesh_networks(void *sel, _adapter *adapter) ); } - rtw_vmfree(mesh_networks, mlme->max_bss_cnt * sizeof(struct wlan_network *)); + vfree(mesh_networks); } void rtw_mesh_adjust_chbw(u8 req_ch, u8 *req_bw, u8 *req_offset) @@ -2284,8 +2284,6 @@ void rtw_mesh_plink_ctl_deinit(_adapter *adapter) } _exit_critical_bh(&(plink_ctl->lock), &irqL); - _rtw_spinlock_free(&plink_ctl->lock); - #if CONFIG_RTW_MESH_PEER_BLACKLIST rtw_mesh_peer_blacklist_flush(adapter); _rtw_deinit_queue(&plink_ctl->peer_blacklist); diff --git a/core/mesh/rtw_mesh_pathtbl.c b/core/mesh/rtw_mesh_pathtbl.c index 49c3af4..4f09940 100644 --- a/core/mesh/rtw_mesh_pathtbl.c +++ b/core/mesh/rtw_mesh_pathtbl.c @@ -741,7 +741,6 @@ static void rtw_mesh_path_free_rcu(struct rtw_mesh_table *tbl, _cancel_timer_ex(&mpath->timer); atomic_dec(&adapter->mesh_info.mpaths); atomic_dec(&tbl->entries); - _rtw_spinlock_free(&mpath->state_lock); rtw_mesh_path_flush_pending(mpath); diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 34a86fd..01fecc8 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -38,7 +38,6 @@ void free_mlme_ap_info(_adapter *padapter) struct mlme_priv *pmlmepriv = &(padapter->mlmepriv); stop_ap_mode(padapter); - _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); } @@ -2560,9 +2559,6 @@ static void _rtw_macaddr_acl_deinit(_adapter *adapter, u8 period, bool clear_onl } _exit_critical_bh(&(acl_node_q->lock), &irqL); - if (!clear_only) - _rtw_spinlock_free(&(acl_node_q->lock)); - rtw_warn_on(acl->num); acl->mode = RTW_ACL_MODE_DISABLED; } @@ -4223,7 +4219,6 @@ void stop_ap_mode(_adapter *padapter) pmlmepriv->update_bcn = _FALSE; /*pmlmeext->bstart_bss = _FALSE;*/ padapter->netif_up = _FALSE; - /* _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); */ /* reset and init security priv , this can refine with rtw_reset_securitypriv */ _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 03bcedb..aa96e87 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -224,7 +224,6 @@ void _rtw_free_cmd_priv(struct cmd_priv *pcmdpriv) { if (pcmdpriv) { - _rtw_spinlock_free(&(pcmdpriv->cmd_queue.lock)); _rtw_free_sema(&(pcmdpriv->cmd_queue_sema)); /* _rtw_free_sema(&(pcmdpriv->cmd_done_sema)); */ _rtw_free_sema(&(pcmdpriv->start_cmdthread_sema)); diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 1588e49..5262391 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -152,9 +152,6 @@ exit: void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv); void rtw_mfree_mlme_priv_lock(struct mlme_priv *pmlmepriv) { - _rtw_spinlock_free(&pmlmepriv->lock); - _rtw_spinlock_free(&(pmlmepriv->free_bss_pool.lock)); - _rtw_spinlock_free(&(pmlmepriv->scanned_queue.lock)); } static void rtw_free_mlme_ie_data(u8 **ppie, u32 *plen) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 7443e0a..1b8577d 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -168,19 +168,9 @@ exit: void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv); void rtw_mfree_recv_priv_lock(struct recv_priv *precvpriv) { - _rtw_spinlock_free(&precvpriv->lock); #ifdef CONFIG_RECV_THREAD_MODE _rtw_free_sema(&precvpriv->recv_sema); #endif - - _rtw_spinlock_free(&precvpriv->free_recv_queue.lock); - _rtw_spinlock_free(&precvpriv->recv_pending_queue.lock); - - _rtw_spinlock_free(&precvpriv->free_recv_buf_queue.lock); - -#ifdef CONFIG_USE_USB_BUFFER_ALLOC_RX - _rtw_spinlock_free(&precvpriv->recv_buf_pending_queue.lock); -#endif /* CONFIG_USE_USB_BUFFER_ALLOC_RX */ } void _rtw_free_recv_priv(struct recv_priv *precvpriv) diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 5d05dc1..96caae5 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -350,36 +350,10 @@ inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info)); } -void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv); -void _rtw_free_sta_xmit_priv_lock(struct sta_xmit_priv *psta_xmitpriv) -{ - - _rtw_spinlock_free(&psta_xmitpriv->lock); - - _rtw_spinlock_free(&(psta_xmitpriv->be_q.sta_pending.lock)); - _rtw_spinlock_free(&(psta_xmitpriv->bk_q.sta_pending.lock)); - _rtw_spinlock_free(&(psta_xmitpriv->vi_q.sta_pending.lock)); - _rtw_spinlock_free(&(psta_xmitpriv->vo_q.sta_pending.lock)); -} - -static void _rtw_free_sta_recv_priv_lock(struct sta_recv_priv *psta_recvpriv) -{ - - _rtw_spinlock_free(&psta_recvpriv->lock); - - _rtw_spinlock_free(&(psta_recvpriv->defrag_q.lock)); - - -} - void rtw_mfree_stainfo(struct sta_info *psta); void rtw_mfree_stainfo(struct sta_info *psta) { - if (&psta->lock != NULL) - _rtw_spinlock_free(&psta->lock); - - _rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv); _rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv); } @@ -416,17 +390,6 @@ void rtw_mfree_sta_priv_lock(struct sta_priv *pstapriv) { rtw_mfree_all_stainfo(pstapriv); /* be done before free sta_hash_lock */ - _rtw_spinlock_free(&pstapriv->free_sta_queue.lock); - - _rtw_spinlock_free(&pstapriv->sta_hash_lock); - _rtw_spinlock_free(&pstapriv->wakeup_q.lock); - _rtw_spinlock_free(&pstapriv->sleep_q.lock); - -#ifdef CONFIG_AP_MODE - _rtw_spinlock_free(&pstapriv->asoc_list_lock); - _rtw_spinlock_free(&pstapriv->auth_list_lock); -#endif - } u32 _rtw_free_sta_priv(struct sta_priv *pstapriv) @@ -822,7 +785,6 @@ u32 rtw_free_stainfo(_adapter *padapter , struct sta_info *psta) rtw_st_ctl_deinit(&psta->st_ctl); if (is_pre_link_sta == _FALSE) { - _rtw_spinlock_free(&psta->lock); /* _enter_critical_bh(&(pfree_sta_queue->lock), &irqL0); */ _enter_critical_bh(&(pstapriv->sta_hash_lock), &irqL0); @@ -1310,7 +1272,6 @@ void rtw_pre_link_sta_ctl_deinit(struct sta_priv *stapriv) rtw_pre_link_sta_ctl_reset(stapriv); - _rtw_spinlock_free(&pre_link_sta_ctl->lock); } void dump_pre_link_sta_ctl(void *sel, struct sta_priv *stapriv) diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index a06f616..caa8697 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -88,8 +88,6 @@ int rtw_init_tdls_info(_adapter *padapter) void rtw_free_tdls_info(struct tdls_info *ptdlsinfo) { - _rtw_spinlock_free(&ptdlsinfo->cmd_lock); - _rtw_spinlock_free(&ptdlsinfo->hdl_lock); _rtw_memset(ptdlsinfo, 0, sizeof(struct tdls_info)); diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 97300c1..43f2b9a 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -4091,11 +4091,6 @@ inline void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl) _rtw_spinlock_init(&macid_ctl->lock); } -inline void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl) -{ - _rtw_spinlock_free(&macid_ctl->lock); -} - inline bool rtw_bmp_is_set(const u8 *bmp, u8 bmp_len, u8 id) { if (id / 8 >= bmp_len) diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index f88345d..4ab7066 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -62,12 +62,6 @@ void rtw_init_xmit_block(_adapter *padapter) dvobj->xmit_block = XMIT_BLOCK_NONE; } -void rtw_free_xmit_block(_adapter *padapter) -{ - struct dvobj_priv *dvobj = adapter_to_dvobj(padapter); - - _rtw_spinlock_free(&dvobj->xmit_block_lock); -} s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) { @@ -360,21 +354,7 @@ exit: void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv); void rtw_mfree_xmit_priv_lock(struct xmit_priv *pxmitpriv) { - _rtw_spinlock_free(&pxmitpriv->lock); _rtw_free_sema(&pxmitpriv->xmit_sema); - - _rtw_spinlock_free(&pxmitpriv->be_pending.lock); - _rtw_spinlock_free(&pxmitpriv->bk_pending.lock); - _rtw_spinlock_free(&pxmitpriv->vi_pending.lock); - _rtw_spinlock_free(&pxmitpriv->vo_pending.lock); - _rtw_spinlock_free(&pxmitpriv->bm_pending.lock); - - /* _rtw_spinlock_free(&pxmitpriv->legacy_dz_queue.lock); */ - /* _rtw_spinlock_free(&pxmitpriv->apsd_queue.lock); */ - - _rtw_spinlock_free(&pxmitpriv->free_xmit_queue.lock); - _rtw_spinlock_free(&pxmitpriv->free_xmitbuf_queue.lock); - _rtw_spinlock_free(&pxmitpriv->pending_xmitbuf_queue.lock); } @@ -419,10 +399,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) } vfree(pxmitpriv->xframe_ext_alloc_addr); - _rtw_spinlock_free(&pxmitpriv->free_xframe_ext_queue.lock); - - /* free xmit extension buff */ - _rtw_spinlock_free(&pxmitpriv->free_xmit_extbuf_queue.lock); pxmitbuf = (struct xmit_buf *)pxmitpriv->pxmit_extbuf; for (i = 0; i < NR_XMIT_EXTBUFF; i++) { @@ -444,7 +420,6 @@ void _rtw_free_xmit_priv(struct xmit_priv *pxmitpriv) #ifdef CONFIG_XMIT_ACK _rtw_mutex_free(&pxmitpriv->ack_tx_mutex); #endif - rtw_free_xmit_block(padapter); out: return; } diff --git a/hal/hal_com.c b/hal/hal_com.c index 786d957..a0eecd5 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -2497,7 +2497,6 @@ void rtw_mbid_cam_deinit(struct dvobj_priv *dvobj) { struct mbid_cam_ctl_t *mbid_cam_ctl = &dvobj->mbid_cam_ctl; - _rtw_spinlock_free(&mbid_cam_ctl->lock); } void rtw_mbid_cam_reset(_adapter *adapter) @@ -14180,10 +14179,7 @@ void rtw_clt_port_init(struct clt_port_t *cltp) cltp->num = 0; _rtw_spinlock_init(&cltp->lock); } -void rtw_clt_port_deinit(struct clt_port_t *cltp) -{ - _rtw_spinlock_free(&cltp->lock); -} + static void _hw_client_port_alloc(_adapter *adapter) { struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 665d8e8..8b3a57b 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -195,7 +195,6 @@ void rtw_hal_dm_deinit(_adapter *padapter) padapter->hal_func.dm_deinit(padapter); - _rtw_spinlock_free(&pHalData->IQKSpinLock); } } diff --git a/hal/rtl8192e/rtl8192e_dm.c b/hal/rtl8192e/rtl8192e_dm.c index bda7ac2..4c0af26 100644 --- a/hal/rtl8192e/rtl8192e_dm.c +++ b/hal/rtl8192e/rtl8192e_dm.c @@ -326,6 +326,5 @@ void rtl8192e_deinit_dm_priv(IN PADAPTER Adapter) { PHAL_DATA_TYPE pHalData = GET_HAL_DATA(Adapter); struct dm_struct *podmpriv = &pHalData->odmpriv; - /* _rtw_spinlock_free(&pHalData->odm_stainfo_lock); */ odm_cancel_all_timers(podmpriv); } diff --git a/include/osdep_service.h b/include/osdep_service.h index 749189b..7693791 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -321,7 +321,6 @@ extern void _rtw_mutex_free(_mutex *pmutex); #ifndef PLATFORM_FREEBSD extern void _rtw_spinlock_init(_lock *plock); #endif /* PLATFORM_FREEBSD */ -extern void _rtw_spinlock_free(_lock *plock); extern void _rtw_spinlock(_lock *plock); extern void _rtw_spinunlock(_lock *plock); extern void _rtw_spinlock_ex(_lock *plock); diff --git a/include/rtw_mlme_ext.h b/include/rtw_mlme_ext.h index 285da31..4324816 100644 --- a/include/rtw_mlme_ext.h +++ b/include/rtw_mlme_ext.h @@ -838,7 +838,6 @@ void rtw_macid_ctl_set_rate_bmp0(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp); void rtw_macid_ctl_set_rate_bmp1(struct macid_ctl_t *macid_ctl, u8 id, u32 bmp); void rtw_macid_ctl_init_sleep_reg(struct macid_ctl_t *macid_ctl, u16 m0, u16 m1, u16 m2, u16 m3); void rtw_macid_ctl_init(struct macid_ctl_t *macid_ctl); -void rtw_macid_ctl_deinit(struct macid_ctl_t *macid_ctl); u8 rtw_iface_bcmc_id_get(_adapter *padapter); void rtw_iface_bcmc_id_set(_adapter *padapter, u8 mac_id); #if defined(DBG_CONFIG_ERROR_RESET) && defined(CONFIG_CONCURRENT_MODE) diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index ccf9c64..7846aef 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -10129,12 +10129,9 @@ void rtw_wdev_free(struct wireless_dev *wdev) struct rtw_wdev_priv *wdev_priv = adapter_wdev_data(adapter); _irqL irqL; - _rtw_spinlock_free(&wdev_priv->scan_req_lock); - _enter_critical_bh(&wdev_priv->connect_req_lock, &irqL); rtw_wdev_free_connect_req(wdev_priv); _exit_critical_bh(&wdev_priv->connect_req_lock, &irqL); - _rtw_spinlock_free(&wdev_priv->connect_req_lock); _rtw_mutex_free(&wdev_priv->roch_mutex); } diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index ec2e00a..93ebe21 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -2199,7 +2199,6 @@ void devobj_deinit(struct dvobj_priv *pdvobj) #ifdef CONFIG_MCC_MODE _rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_mutex)); _rtw_mutex_free(&(pdvobj->mcc_objpriv.mcc_tsf_req_mutex)); - _rtw_spinlock_free(&pdvobj->mcc_objpriv.mcc_lock); #endif /* CONFIG_MCC_MODE */ _rtw_mutex_free(&pdvobj->hw_init_mutex); @@ -2219,22 +2218,10 @@ void devobj_deinit(struct dvobj_priv *pdvobj) _rtw_mutex_free(&pdvobj->syson_indirect_access_mutex); #endif - rtw_macid_ctl_deinit(&pdvobj->macid_ctl); -#ifdef CONFIG_CLIENT_PORT_CFG - rtw_clt_port_deinit(&pdvobj->clt_port); -#endif - - _rtw_spinlock_free(&pdvobj->cam_ctl.lock); _rtw_mutex_free(&pdvobj->cam_ctl.sec_cam_access_mutex); -#if defined(RTK_129X_PLATFORM) && defined(CONFIG_PCI_HCI) - _rtw_spinlock_free(&pdvobj->io_reg_lock); -#endif #ifdef CONFIG_MBSSID_CAM rtw_mbid_cam_deinit(pdvobj); -#endif -#ifdef CONFIG_SUPPORT_MULTI_BCN - _rtw_spinlock_free(&(pdvobj->ap_if_q.lock)); #endif rtw_mfree((u8 *)pdvobj, sizeof(*pdvobj)); } @@ -2580,11 +2567,6 @@ u8 rtw_free_drv_sw(_adapter *padapter) } #endif /* add for CONFIG_IEEE80211W, none 11w also can use */ - _rtw_spinlock_free(&padapter->security_key_mutex); - -#ifdef CONFIG_BR_EXT - _rtw_spinlock_free(&padapter->br_ext_lock); -#endif /* CONFIG_BR_EXT */ #ifdef CONFIG_INTEL_WIDI rtw_free_intel_widi(padapter); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 73703ba..e049115 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1365,19 +1365,6 @@ void _rtw_spinlock_init(_lock *plock) } -void _rtw_spinlock_free(_lock *plock) -{ -#ifdef PLATFORM_FREEBSD - mtx_destroy(plock); -#endif - -#ifdef PLATFORM_WINDOWS - - NdisFreeSpinLock(plock); - -#endif - -} #ifdef PLATFORM_FREEBSD extern PADAPTER prtw_lock; @@ -1484,7 +1471,6 @@ void _rtw_init_queue(_queue *pqueue) void _rtw_deinit_queue(_queue *pqueue) { - _rtw_spinlock_free(&(pqueue->lock)); } u32 _rtw_queue_empty(_queue *pqueue) From f1aa80a838be90d3815819491f41ebfb8e81af04 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 5 Aug 2021 13:37:16 -0500 Subject: [PATCH 12/16] Remove more empty routines After removing some empty routines in os_dep/osdep_service.c, new routines become empty. These include rtw_mfree_stainfo(), _rtw_free_sta_xmit_priv_lock(), and rtw_mfree_recv_priv_lock. Link: https://lore.kernel.org/r/20210805183717.23007-5-Larry.Finger@lwfinger.net --- core/rtw_recv.c | 2 -- core/rtw_sta_mgt.c | 10 ---------- 2 files changed, 12 deletions(-) diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 1b8577d..2355adf 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -180,8 +180,6 @@ void _rtw_free_recv_priv(struct recv_priv *precvpriv) rtw_free_uc_swdec_pending_queue(padapter); - rtw_mfree_recv_priv_lock(precvpriv); - rtw_os_recv_resource_free(precvpriv); vfree(precvpriv->pallocated_frame_buf); diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index 96caae5..b166d9b 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -350,14 +350,6 @@ inline struct sta_info *rtw_get_stainfo_by_offset(struct sta_priv *stapriv, int return (struct sta_info *)(stapriv->pstainfo_buf + offset * sizeof(struct sta_info)); } -void rtw_mfree_stainfo(struct sta_info *psta); -void rtw_mfree_stainfo(struct sta_info *psta) -{ - - _rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv); - -} - /* this function is used to free the memory of lock || sema for all stainfos */ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv); @@ -376,8 +368,6 @@ void rtw_mfree_all_stainfo(struct sta_priv *pstapriv) while ((rtw_end_of_queue_search(phead, plist)) == _FALSE) { psta = LIST_CONTAINOR(plist, struct sta_info , list); plist = get_next(plist); - - rtw_mfree_stainfo(psta); } _exit_critical_bh(&pstapriv->sta_hash_lock, &irqL); From 1fcfef2e077ed0eafac07643073ba96f2b9c6a39 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 5 Aug 2021 14:26:39 -0500 Subject: [PATCH 13/16] Remove rtw_yield_os() This wrapper is just a call to yield(). Link: https://lore.kernel.org/r/20210805192644.15978-1-Larry.Finger@lwfinger.net --- core/rtw_mlme_ext.c | 2 +- core/rtw_pwrctrl.c | 2 +- hal/rtl8192e/rtl8192e_cmd.c | 2 +- hal/rtl8192e/rtl8192e_hal_init.c | 4 ++-- include/osdep_service.h | 3 --- os_dep/osdep_service.c | 13 ------------- 6 files changed, 5 insertions(+), 21 deletions(-) diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 33c2f43..98f94dd 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -10838,7 +10838,7 @@ unsigned int send_beacon(_adapter *padapter) #if defined(CONFIG_PCI_BCN_POLLING) rtw_msleep_os(1); #else - rtw_yield_os(); + yield(); #endif rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bxmitok)); poll++; diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 9b0eddf..24fe550 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -1435,7 +1435,7 @@ void LPS_Leave_check( bReady = _FALSE; start_time = rtw_get_current_time(); - rtw_yield_os(); + yield(); while (1) { _enter_pwrlock(&pwrpriv->lock); diff --git a/hal/rtl8192e/rtl8192e_cmd.c b/hal/rtl8192e/rtl8192e_cmd.c index 4d866a9..69da857 100644 --- a/hal/rtl8192e/rtl8192e_cmd.c +++ b/hal/rtl8192e/rtl8192e_cmd.c @@ -353,7 +353,7 @@ void rtl8192e_download_rsvd_page(PADAPTER padapter, u8 mstatus) rtw_hal_set_fw_rsvd_page(padapter, _FALSE); DLBcnCount++; do { - rtw_yield_os(); + yield(); /* rtw_mdelay_os(10); */ /* check rsvd page download OK. */ rtw_hal_get_hwreg(padapter, HW_VAR_BCN_VALID, (u8 *)(&bcn_valid)); diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index d8e756d..202b073 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -395,7 +395,7 @@ static s32 polling_fwdl_chksum(_adapter *adapter, u32 min_cnt, u32 timeout_ms) value32 = rtw_read32(adapter, REG_MCUFWDL); if (value32 & FWDL_ChkSum_rpt || RTW_CANNOT_IO(adapter)) break; - rtw_yield_os(); + yield(); } while (rtw_get_passing_time_ms(start) < timeout_ms || cnt < min_cnt); if (!(value32 & FWDL_ChkSum_rpt)) @@ -433,7 +433,7 @@ static s32 _FWFreeToGo8192E(_adapter *adapter, u32 min_cnt, u32 timeout_ms) value32 = rtw_read32(adapter, REG_MCUFWDL); if (value32 & WINTINI_RDY || RTW_CANNOT_IO(adapter)) break; - rtw_yield_os(); + yield(); } while (rtw_get_passing_time_ms(start) < timeout_ms || cnt < min_cnt); if (!(value32 & WINTINI_RDY)) diff --git a/include/osdep_service.h b/include/osdep_service.h index 7693791..d17467f 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -379,9 +379,6 @@ extern void rtw_mdelay_os(int ms); extern void rtw_udelay_os(int us); #endif -extern void rtw_yield_os(void); - - extern void rtw_init_timer(_timer *ptimer, void *padapter, void *pfunc, void *ctx); diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index e049115..a66ce42 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1748,19 +1748,6 @@ void rtw_udelay_os(int us) } #endif -void rtw_yield_os(void) -{ -#ifdef PLATFORM_LINUX - yield(); -#endif -#ifdef PLATFORM_FREEBSD - yield(); -#endif -#ifdef PLATFORM_WINDOWS - SwitchToThread(); -#endif -} - bool rtw_macaddr_is_larger(const u8 *a, const u8 *b) { u32 va, vb; From fdbea81f0816ffa0a2ace5f7f02b625ab447ca94 Mon Sep 17 00:00:00 2001 From: Larry Finger Date: Thu, 5 Aug 2021 14:26:40 -0500 Subject: [PATCH 14/16] Remove wrapper routine rtw_msleep_os() The effect of this macro is to call msleep(). Remove the wrapper. Link: https://lore.kernel.org/r/20210805192644.15978-2-Larry.Finger@lwfinger.net --- core/rtw_ap.c | 2 +- core/rtw_cmd.c | 4 ++-- core/rtw_mlme.c | 4 ++-- core/rtw_mlme_ext.c | 24 ++++++++++++------------ core/rtw_mp.c | 2 +- core/rtw_mp_ioctl.c | 6 +++--- core/rtw_pwrctrl.c | 10 +++++----- core/rtw_recv.c | 2 +- core/rtw_tdls.c | 4 ++-- core/rtw_xmit.c | 6 +++--- hal/hal_btcoex.c | 2 +- hal/hal_com.c | 26 +++++++++++++------------- hal/hal_com_phycfg.c | 6 +++--- hal/hal_halmac.c | 12 ++++++------ hal/hal_mp.c | 6 +++--- hal/phydm/phydm_interface.c | 4 ++-- hal/rtl8192e/rtl8192e_cmd.c | 2 +- hal/rtl8192e/rtl8192e_hal_init.c | 6 +++--- hal/rtl8192e/rtl8192e_phycfg.c | 4 ++-- include/osdep_service.h | 3 +-- os_dep/linux/ioctl_cfg80211.c | 10 +++++----- os_dep/linux/ioctl_linux.c | 32 ++++++++++++++++---------------- os_dep/linux/ioctl_mp.c | 28 ++++++++++++++-------------- os_dep/linux/os_intfs.c | 4 ++-- os_dep/osdep_service.c | 28 +--------------------------- 25 files changed, 105 insertions(+), 132 deletions(-) diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 01fecc8..3d6dbfd 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -2939,7 +2939,7 @@ u8 rtw_ap_bmc_frames_hdl(_adapter *padapter) rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); while (_FALSE == empty && rtw_get_passing_time_ms(start) < 3000) { - rtw_msleep_os(100); + msleep(100); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); } diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index aa96e87..3073725 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -205,7 +205,7 @@ void _rtw_free_evt_priv(struct evt_priv *pevtpriv) #ifdef CONFIG_C2H_WK _cancel_workitem_sync(&pevtpriv->c2h_wk); while (pevtpriv->c2h_wk_alive) - rtw_msleep_os(10); + msleep(10); while (!rtw_cbuf_empty(pevtpriv->c2h_queue)) { void *c2h; @@ -4147,7 +4147,7 @@ static void rtw_chk_hi_queue_hdl(_adapter *padapter) rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); while (_FALSE == empty && rtw_get_passing_time_ms(start) < rtw_get_wait_hiq_empty_ms()) { - rtw_msleep_os(100); + msleep(100); rtw_hal_get_hwreg(padapter, HW_VAR_CHK_HI_QUEUE_EMPTY, &empty); } diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index 5262391..f3c9b48 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -1888,7 +1888,7 @@ static u32 _rtw_wait_scan_done(_adapter *adapter, u8 abort, u32 timeout_ms) break; RTW_INFO(FUNC_NDEV_FMT"fw_state=_FW_UNDER_SURVEY!\n", FUNC_NDEV_ARG(adapter->pnetdev)); - rtw_msleep_os(20); + msleep(20); } if (_TRUE == abort) { @@ -1962,7 +1962,7 @@ static u32 _rtw_wait_join_done(_adapter *adapter, u8 abort, u32 timeout_ms) break; RTW_INFO(FUNC_ADPT_FMT" linking...\n", FUNC_ADPT_ARG(adapter)); - rtw_msleep_os(20); + msleep(20); } if (abort) { diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index 98f94dd..abd9796 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -616,7 +616,7 @@ u32 rtw_force_stop_cac(struct rf_ctl_t *rfctl, u32 timeout_ms) ) { if (dev_is_surprise_removed(dvobj) || dev_is_drv_stopped(dvobj)) break; - rtw_msleep_os(20); + msleep(20); } if (IS_UNDER_CAC(rfctl)) { @@ -6125,7 +6125,7 @@ int issue_probereq_p2p_ex(_adapter *adapter, u8 *da, int try_cnt, int wait_ms) break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -7729,7 +7729,7 @@ s32 dump_mgntframe_and_wait_ack_timeout(_adapter *padapter, struct xmit_frame *p return ret; #else /* !CONFIG_XMIT_ACK */ dump_mgntframe(padapter, pmgntframe); - rtw_msleep_os(50); + msleep(50); return _SUCCESS; #endif /* !CONFIG_XMIT_ACK */ } @@ -8547,7 +8547,7 @@ int issue_probereq_ex(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -9557,7 +9557,7 @@ int issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int power_mod break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -9711,7 +9711,7 @@ int issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u8 ps, in break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -9846,7 +9846,7 @@ int issue_deauth_ex(_adapter *padapter, u8 *da, unsigned short reason, int try_c break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -10268,7 +10268,7 @@ inline u8 issue_addba_rsp_wait_ack(_adapter *adapter, unsigned char *ra, u8 tid, break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -10346,7 +10346,7 @@ int issue_del_ba_ex(_adapter *adapter, unsigned char *ra, u8 tid, u16 reason, u8 break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -10621,7 +10621,7 @@ int issue_action_SM_PS_wait_ack(_adapter *padapter, unsigned char *raddr, u8 New break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && ((ret == _FAIL) || (wait_ms == 0))); @@ -10836,7 +10836,7 @@ unsigned int send_beacon(_adapter *padapter) issue++; do { #if defined(CONFIG_PCI_BCN_POLLING) - rtw_msleep_os(1); + msleep(1); #else yield(); #endif @@ -15880,7 +15880,7 @@ u8 chk_bmc_sleepq_hdl(_adapter *padapter, unsigned char *pbuf) if ((rtw_tim_map_is_set(padapter, pstapriv->tim_bitmap, 0)) && (psta_bmc->sleepq_len > 0)) { #ifndef CONFIG_PCI_HCI - rtw_msleep_os(10);/* 10ms, ATIM(HIQ) Windows */ + msleep(10);/* 10ms, ATIM(HIQ) Windows */ #endif /* _enter_critical_bh(&psta_bmc->sleep_q.lock, &irqL); */ _enter_critical_bh(&pxmitpriv->lock, &irqL); diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 7a95e64..240508a 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -2455,7 +2455,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *data) } #ifdef CONFIG_LONG_DELAY_ISSUE - rtw_msleep_os(100); + msleep(100); #else rtw_mdelay_os(100); #endif diff --git a/core/rtw_mp_ioctl.c b/core/rtw_mp_ioctl.c index 035d281..b956dba 100644 --- a/core/rtw_mp_ioctl.c +++ b/core/rtw_mp_ioctl.c @@ -628,7 +628,7 @@ NDIS_STATUS oid_rt_pro_set_continuous_tx_hdl(struct oid_par_priv *poid_par_priv) if (pmp_priv->tx.stop == 0) { pmp_priv->tx.stop = 1; RTW_INFO("%s: pkt tx is running...\n", __func__); - rtw_msleep_os(5); + msleep(5); } pmp_priv->tx.stop = 0; pmp_priv->tx.count = 1; @@ -663,7 +663,7 @@ NDIS_STATUS oid_rt_pro_set_single_carrier_tx_hdl(struct oid_par_priv *poid_par_p if (pmp_priv->tx.stop == 0) { pmp_priv->tx.stop = 1; RTW_INFO("%s: pkt tx is running...\n", __func__); - rtw_msleep_os(5); + msleep(5); } pmp_priv->tx.stop = 0; pmp_priv->tx.count = 1; @@ -698,7 +698,7 @@ NDIS_STATUS oid_rt_pro_set_carrier_suppression_tx_hdl(struct oid_par_priv *poid_ if (pmp_priv->tx.stop == 0) { pmp_priv->tx.stop = 1; RTW_INFO("%s: pkt tx is running...\n", __func__); - rtw_msleep_os(5); + msleep(5); } pmp_priv->tx.stop = 0; pmp_priv->tx.count = 1; diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 24fe550..431b8fb 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -540,7 +540,7 @@ u8 rtw_cpwm_polling(_adapter *adapter, u8 rpwm, u8 cpwm_orig) do { start_time = rtw_get_current_time(); do { - rtw_msleep_os(1); + msleep(1); rtw_hal_get_hwreg(adapter, HW_VAR_CPWM, &cpwm_now); if ((cpwm_orig ^ cpwm_now) & 0x80) { @@ -1458,7 +1458,7 @@ void LPS_Leave_check( RTW_ERR("Wait for cpwm event than 100 ms!!!\n"); break; } - rtw_msleep_os(1); + msleep(1); } } @@ -2512,7 +2512,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) if (pwrpriv->ps_processing) { RTW_INFO("%s wait ps_processing...\n", __func__); while (pwrpriv->ps_processing && rtw_get_passing_time_ms(start) <= 3000) - rtw_msleep_os(10); + msleep(10); if (pwrpriv->ps_processing) RTW_INFO("%s wait ps_processing timeout\n", __func__); else @@ -2523,7 +2523,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) if (rtw_hal_sreset_inprogress(padapter)) { RTW_INFO("%s wait sreset_inprogress...\n", __func__); while (rtw_hal_sreset_inprogress(padapter) && rtw_get_passing_time_ms(start) <= 4000) - rtw_msleep_os(10); + msleep(10); if (rtw_hal_sreset_inprogress(padapter)) RTW_INFO("%s wait sreset_inprogress timeout\n", __func__); else @@ -2541,7 +2541,7 @@ int _rtw_pwr_wakeup(_adapter *padapter, u32 ips_deffer_ms, const char *caller) && ((rtw_get_passing_time_ms(start) <= 3000 && !rtw_is_do_late_resume(pwrpriv)) || (rtw_get_passing_time_ms(start) <= 500 && rtw_is_do_late_resume(pwrpriv))) ) - rtw_msleep_os(10); + msleep(10); if (pwrpriv->bInSuspend) RTW_INFO("%s wait bInSuspend timeout\n", __func__); else diff --git a/core/rtw_recv.c b/core/rtw_recv.c index 2355adf..ab9aa66 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -5007,7 +5007,7 @@ thread_return rtw_recv_thread(thread_context context) if (err == RTW_RFRAME_UNAVAIL || err == RTW_RFRAME_PKT_UNAVAIL ) { - rtw_msleep_os(1); + msleep(1); _rtw_up_sema(&recvpriv->recv_sema); } diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index caa8697..08881dc 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -382,7 +382,7 @@ int issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsig break; if (i < try_cnt && wait_ms > 0 && ret == _FAIL) - rtw_msleep_os(wait_ms); + msleep(wait_ms); } while ((i < try_cnt) && (ret == _FAIL || wait_ms == 0)); @@ -1051,7 +1051,7 @@ s32 rtw_tdls_do_ch_sw(_adapter *padapter, struct sta_info *ptdls_sta, u8 chnl_ty wait_time = 0; if (wait_time > 0) - rtw_msleep_os(wait_time); + msleep(wait_time); } } diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index 4ab7066..fc86341 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -165,7 +165,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) /* Tx buf allocation may fail sometimes, so sleep and retry. */ res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), _TRUE); if (res == _FAIL) { - rtw_msleep_os(10); + msleep(10); res = rtw_os_xmit_resource_alloc(padapter, pxmitbuf, (MAX_XMITBUF_SZ + XMITBUF_ALIGN_SZ), _TRUE); if (res == _FAIL) goto exit; @@ -1622,7 +1622,7 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe) if (bmcst) { if (_rtw_memcmp(psecuritypriv->dot118021XGrptxmickey[psecuritypriv->dot118021XGrpKeyid].skey, null_key, 16) == _TRUE) { /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ - /* rtw_msleep_os(10); */ + /* msleep(10); */ return _FAIL; } /* start to calculate the mic code */ @@ -1630,7 +1630,7 @@ static s32 xmitframe_addmic(_adapter *padapter, struct xmit_frame *pxmitframe) } else { if (_rtw_memcmp(&pattrib->dot11tkiptxmickey.skey[0], null_key, 16) == _TRUE) { /* DbgPrint("\nxmitframe_addmic:stainfo->dot11tkiptxmickey==0\n"); */ - /* rtw_msleep_os(10); */ + /* msleep(10); */ return _FAIL; } /* start to calculate the mic code */ diff --git a/hal/hal_btcoex.c b/hal/hal_btcoex.c index ea5b400..fe82b81 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -413,7 +413,7 @@ void halbtcoutsrc_LeaveLowPower(PBTC_COEXIST pBtCoexist) if (utime > timeout) break; - rtw_msleep_os(1); + msleep(1); } while (1); GLBtcBtCoexAliveRegistered = _TRUE; diff --git a/hal/hal_com.c b/hal/hal_com.c index a0eecd5..cb0bf22 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -1609,7 +1609,7 @@ int hal_read_mac_hidden_rpt(_adapter *adapter) id = rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL); if (id == C2H_MAC_HIDDEN_RPT || RTW_CANNOT_IO(adapter)) break; - rtw_msleep_os(10); + msleep(10); } while (rtw_get_passing_time_ms(start) < timeout_ms || cnt < min_cnt); if (id == C2H_MAC_HIDDEN_RPT) { @@ -4906,7 +4906,7 @@ static u8 rtw_hal_check_wow_ctrl(_adapter *adapter, u8 chk_type) RTW_PRINT("Loop index: %d :0x%02x\n", trycnt, reason); trycnt--; - rtw_msleep_os(20); + msleep(20); } if (!reason) res = _TRUE; @@ -4919,7 +4919,7 @@ static u8 rtw_hal_check_wow_ctrl(_adapter *adapter, u8 chk_type) RTW_PRINT("%s REG_FE1IMR (reg120): 0x%x, REG_RXPKT_NUM(reg284): 0x%x\n", __func__, fe1_imr, rxpkt_num); while (((fe1_imr & BIT_FS_RXDONE_INT_EN) || (rxpkt_num & BIT_RW_RELEASE_EN)) && trycnt > 1) { - rtw_msleep_os(20); + msleep(20); fe1_imr = rtw_read32(adapter, REG_FE1IMR); rxpkt_num = rtw_read32(adapter, REG_RXPKT_NUM); RTW_PRINT("Loop index: %d :0x%x, 0x%x\n", @@ -4943,7 +4943,7 @@ static u8 rtw_hal_check_wow_ctrl(_adapter *adapter, u8 chk_type) RTW_PRINT("Loop index: %d :0x%02x\n", trycnt, mstatus); trycnt--; - rtw_msleep_os(20); + msleep(20); } if (mstatus & BIT1) res = _TRUE; @@ -4955,7 +4955,7 @@ static u8 rtw_hal_check_wow_ctrl(_adapter *adapter, u8 chk_type) RTW_PRINT("Loop index: %d :0x%02x\n", trycnt, mstatus); trycnt--; - rtw_msleep_os(20); + msleep(20); } if (mstatus & BIT1) @@ -4984,7 +4984,7 @@ static u8 rtw_hal_check_pno_enabled(_adapter *adapter) count, res); res = rtw_read8(adapter, REG_PNO_STATUS); count++; - rtw_msleep_os(2); + msleep(2); } if (res & BIT(7)) ret = _TRUE; @@ -5799,7 +5799,7 @@ static void rtw_hal_set_ap_rsvdpage_loc_cmd(PADAPTER padapter, if (ret == _FAIL) RTW_INFO("%s: H2C_BCN_RSVDPAGE cmd fail\n", __func__); - rtw_msleep_os(10); + msleep(10); _rtw_memset(&rsvdparm, 0, sizeof(rsvdparm)); @@ -5812,7 +5812,7 @@ static void rtw_hal_set_ap_rsvdpage_loc_cmd(PADAPTER padapter, if (ret == _FAIL) RTW_INFO("%s: H2C_PROBERSP_RSVDPAGE cmd fail\n", __func__); - rtw_msleep_os(10); + msleep(10); } static void rtw_hal_set_fw_ap_wow_related_cmd(_adapter *padapter, u8 enable) @@ -5854,7 +5854,7 @@ static void rtw_hal_ap_wow_enable(_adapter *padapter) issue_beacon(padapter, 0); - rtw_msleep_os(2); + msleep(2); #if defined(CONFIG_RTL8188E) if (IS_HARDWARE_TYPE_8188E(padapter)) rtw_hal_disable_tx_report(padapter); @@ -5911,7 +5911,7 @@ static void rtw_hal_ap_wow_disable(_adapter *padapter) rtw_hal_set_fw_ap_wow_related_cmd(padapter, 0); - rtw_msleep_os(2); + msleep(2); #ifdef DBG_CHECK_FW_PS_STATE if (rtw_fw_ps_state(padapter) == _FAIL) { pdbgpriv->dbg_diswow_dload_fw_fail_cnt++; @@ -11032,7 +11032,7 @@ int rtw_hal_reset_tsf(_adapter *adapter, u8 reset_port) return ret; while ((reset_cnt_after == reset_cnt_before) && (loop_cnt < 10)) { - rtw_msleep_os(100); + msleep(100); loop_cnt++; reset_cnt_after = rtw_read8(adapter, reg_reset_tsf_cnt); } @@ -11512,7 +11512,7 @@ void rtw_lps_state_chk(_adapter *adapter, u8 ps_mode) ps_ready = _TRUE; break; } - rtw_msleep_os(1); + msleep(1); } while (leave_wait_count--); if (ps_ready == _FALSE) { @@ -13612,7 +13612,7 @@ void rtw_reset_phy_rx_counters(_adapter *padapter) phy_set_bb_reg(padapter, 0xA2C, BIT15, 0x1); } else { phy_set_bb_reg(padapter, 0xF14, BIT16, 0x1); - rtw_msleep_os(10); + msleep(10); phy_set_bb_reg(padapter, 0xF14, BIT16, 0x0); phy_set_bb_reg(padapter, 0xD00, BIT27, 0x1);/* reset OFDA FA counter */ diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c index 7e68568..99c48c4 100644 --- a/hal/hal_com_phycfg.c +++ b/hal/hal_com_phycfg.c @@ -4207,7 +4207,7 @@ phy_ConfigBBWithParaFile( break; } else if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) { #ifdef CONFIG_LONG_DELAY_ISSUE - rtw_msleep_os(50); + msleep(50); #else rtw_mdelay_os(50); #endif @@ -4555,7 +4555,7 @@ phy_ConfigBBWithMpParaFile( break; } else if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) { #ifdef CONFIG_LONG_DELAY_ISSUE - rtw_msleep_os(50); + msleep(50); #else rtw_mdelay_os(50); #endif @@ -4669,7 +4669,7 @@ PHY_ConfigRFWithParaFile( if (u4bRegOffset == 0xfe || u4bRegOffset == 0xffe) { /* Deay specific ms. Only RF configuration require delay. */ #ifdef CONFIG_LONG_DELAY_ISSUE - rtw_msleep_os(50); + msleep(50); #else rtw_mdelay_os(50); #endif diff --git a/hal/hal_halmac.c b/hal/hal_halmac.c index a12abab..5de1b3f 100644 --- a/hal/hal_halmac.c +++ b/hal/hal_halmac.c @@ -414,7 +414,7 @@ static void _halmac_udelay(void *p, u32 us) else if (us <= 1000) rtw_usleep_os(us); else - rtw_msleep_os(RTW_DIV_ROUND_UP(us, 1000)); + msleep(RTW_DIV_ROUND_UP(us, 1000)); } static u8 _halmac_mutex_init(void *p, HALMAC_MUTEX *pMutex) @@ -3088,7 +3088,7 @@ static void _debug_dlfw_fail(struct dvobj_priv *d) } /* read 0x80 after 10 secs */ - rtw_msleep_os(10000); + msleep(10000); addr = 0x80; v32 = rtw_read16(a, addr); RTW_PRINT("%s: 0x%X = 0x%04x (after 10 secs)\n", @@ -3178,7 +3178,7 @@ static int _cpu_sleep(struct dvobj_priv *d, u32 timeout) break; } - rtw_msleep_os(1); + msleep(1); } while (1); exit: @@ -3668,7 +3668,7 @@ int rtw_halmac_txfifo_wait_empty(struct dvobj_priv *d, u32 timeout) break; } - rtw_msleep_os(2); + msleep(2); } while (1); if (empty == _FALSE) { @@ -3919,7 +3919,7 @@ static u8 _is_fw_read_cmd_down(PADAPTER adapter, u8 msgbox_num) if (0 == valid) read_down = _TRUE; else - rtw_msleep_os(1); + msleep(1); } while ((!read_down) && (retry_cnts--)); if (_FALSE == read_down) @@ -4631,7 +4631,7 @@ int rtw_halmac_iqk(struct dvobj_priv *d, u8 clear, u8 segment) if (!retry) break; retry--; - rtw_msleep_os(delay); + msleep(delay); } while (1); if (status != HALMAC_RET_SUCCESS) { free_halmac_event(d, id); diff --git a/hal/hal_mp.c b/hal/hal_mp.c index 1af9de3..a6811a2 100644 --- a/hal/hal_mp.c +++ b/hal/hal_mp.c @@ -1631,12 +1631,12 @@ void hal_mpt_GetThermalMeter(PADAPTER pAdapter, u8 *value) { #if 0 fw_cmd(pAdapter, IOCMD_GET_THERMAL_METER); - rtw_msleep_os(1000); + msleep(1000); fw_cmd_data(pAdapter, value, 1); *value &= 0xFF; #else hal_mpt_TriggerRFThermalMeter(pAdapter); - rtw_msleep_os(1000); + msleep(1000); *value = hal_mpt_ReadRFThermalMeter(pAdapter); #endif @@ -1680,7 +1680,7 @@ void hal_mpt_SetSingleCarrierTx(PADAPTER pAdapter, u8 bStart) #endif /* CONFIG_RTL8812A || CONFIG_RTL8821A || CONFIG_RTL8814A || CONFIG_RTL8822B || CONFIG_RTL8821C */ phy_set_bb_reg(pAdapter, rOFDM1_LSTF, BIT30 | BIT29 | BIT28, OFDM_ALL_OFF); - rtw_msleep_os(10); + msleep(10); /*/BB Reset*/ phy_set_bb_reg(pAdapter, rPMAC_Reset, bBBResetB, 0x0); phy_set_bb_reg(pAdapter, rPMAC_Reset, bBBResetB, 0x1); diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index 7fb1a25..cec3be4 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -632,11 +632,11 @@ void ODM_sleep_ms(u32 ms) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) msleep(ms); #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) - rtw_msleep_os(ms); + msleep(ms); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) delay_ms(ms); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) - rtw_msleep_os(ms); + msleep(ms); #endif } diff --git a/hal/rtl8192e/rtl8192e_cmd.c b/hal/rtl8192e/rtl8192e_cmd.c index 69da857..6723d7e 100644 --- a/hal/rtl8192e/rtl8192e_cmd.c +++ b/hal/rtl8192e/rtl8192e_cmd.c @@ -40,7 +40,7 @@ static u8 _is_fw_read_cmd_down(_adapter *padapter, u8 msgbox_num) if (0 == valid) read_down = _TRUE; else - rtw_msleep_os(1); + msleep(1); } while ((!read_down) && (retry_cnts--)); return read_down; diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index 202b073..7808ae4 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -4047,7 +4047,7 @@ u8 SetHwReg8192E(PADAPTER Adapter, u8 variable, u8 *val) i++; /* wait MAC to flush out reserve pages */ - rtw_msleep_os(10); + msleep(10); } pass_ms = rtw_get_passing_time_ms(start); @@ -4423,7 +4423,7 @@ void hal_ra_info_dump(_adapter *padapter , void *sel) _RTW_PRINT_SEL(sel , "============ RA status check Mac_id:%d ===================\n", mac_id); cmd = 0x40000100 | mac_id; rtw_write32(padapter, REG_HMEBOX_E2_E3_8192E, cmd); - rtw_msleep_os(10); + msleep(10); ra_info1 = rtw_read32(padapter, REG_RSVD5_8192E); curr_tx_sgi = rtw_get_current_tx_sgi(padapter, macid_ctl->sta[mac_id]); curr_tx_rate = rtw_get_current_tx_rate(padapter, macid_ctl->sta[mac_id]); @@ -4433,7 +4433,7 @@ void hal_ra_info_dump(_adapter *padapter , void *sel) cmd = 0x40000400 | mac_id; rtw_write32(padapter, REG_HMEBOX_E2_E3_8192E, cmd); - rtw_msleep_os(10); + msleep(10); ra_info1 = rtw_read32(padapter, REG_RSVD5_8192E); ra_info2 = rtw_read32(padapter, REG_RSVD6_8192E); rate_mask1 = rtw_read32(padapter, REG_RSVD7_8192E); diff --git a/hal/rtl8192e/rtl8192e_phycfg.c b/hal/rtl8192e/rtl8192e_phycfg.c index 2ac1a21..6842de4 100644 --- a/hal/rtl8192e/rtl8192e_phycfg.c +++ b/hal/rtl8192e/rtl8192e_phycfg.c @@ -930,7 +930,7 @@ phy_SpurCalibration_8192E( phy_set_bb_reg(Adapter, rFPGA0_TxInfo, bMaskByte0, 0x3); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd); - /* rtw_msleep_os(30); */ + /* msleep(30); */ rtw_mdelay_os(30); PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord); /* RTW_INFO(" Path A== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */ @@ -945,7 +945,7 @@ phy_SpurCalibration_8192E( phy_set_bb_reg(Adapter, rFPGA0_TxInfo, bMaskByte0, 0x13); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0xfccd); phy_set_bb_reg(Adapter, rFPGA0_PSDFunction, bMaskDWord, 0x40fccd); - /* rtw_msleep_os(30); */ + /* msleep(30); */ rtw_mdelay_os(30); PSDReport = phy_query_bb_reg(Adapter, rFPGA0_PSDReport, bMaskDWord); /* RTW_INFO(" Path B== PSDReport = 0x%x (%d)\n",PSDReport,PSDReport); */ diff --git a/include/osdep_service.h b/include/osdep_service.h index d17467f..093e405 100644 --- a/include/osdep_service.h +++ b/include/osdep_service.h @@ -364,7 +364,6 @@ extern bool _rtw_time_after(systime a, systime b); extern void rtw_sleep_schedulable(int ms); -extern void rtw_msleep_os(int ms); extern void rtw_usleep_os(int us); extern u32 rtw_atoi(u8 *s); @@ -416,7 +415,7 @@ static inline void rtw_thread_wait_stop(void) #ifdef PLATFORM_LINUX #if 0 while (!kthread_should_stop()) - rtw_msleep_os(10); + msleep(10); #else set_current_state(TASK_INTERRUPTIBLE); while (!kthread_should_stop()) { diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 7846aef..4db2808 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -2539,7 +2539,7 @@ u32 rtw_cfg80211_wait_scan_req_empty(_adapter *adapter, u32 timeout_ms) break; } - rtw_msleep_os(10); + msleep(10); } pass_ms = rtw_get_passing_time_ms(start); @@ -6511,7 +6511,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, #if 0 if(wps_devicepassword_id == WPS_DPID_REGISTRAR_SPEC) { RTW_INFO("waiting for p2p peer key-in PIN CODE\n"); - rtw_msleep_os(15000); /* 15 sec for key in PIN CODE, workaround for GS2 before issuing Nego Req. */ + msleep(15000); /* 15 sec for key in PIN CODE, workaround for GS2 before issuing Nego Req. */ } #endif @@ -7149,7 +7149,7 @@ issue_mgmt_frame: #ifdef CONFIG_XMIT_ACK if (!MLME_IS_MESH(padapter)) /* TODO: remove this sleep for all mode */ - rtw_msleep_os(50); + msleep(50); #endif #ifdef CONFIG_DEBUG_CFG80211 RTW_INFO("%s, ack=%d, ok!\n", __func__, ack); @@ -7426,7 +7426,7 @@ dump: break; if (sleep_ms > 0) - rtw_msleep_os(sleep_ms); + msleep(sleep_ms); } if (tx_ret != _SUCCESS || dump_cnt > 1) { @@ -8855,7 +8855,7 @@ int cfg80211_rtw_resume(struct wiphy *wiphy) { for (PNOWakeupScanWaitCnt = 0; PNOWakeupScanWaitCnt < 10; PNOWakeupScanWaitCnt++) { if(check_fwstate(pmlmepriv, _FW_UNDER_SURVEY) == _FALSE) break; - rtw_msleep_os(1000); + msleep(1000); } _enter_critical_bh(&pmlmepriv->lock, &irqL); diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index 3aca931..ddfb168 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -2230,7 +2230,7 @@ static int rtw_wx_get_scan(struct net_device *dev, struct iw_request_info *a, ; while (check_fwstate(pmlmepriv, wait_status) == _TRUE) { - rtw_msleep_os(30); + msleep(30); cnt++; if (cnt > wait_for_surveydone) break; @@ -3726,7 +3726,7 @@ static int rtw_get_ap_info(struct net_device *dev, } while ((check_fwstate(pmlmepriv, (_FW_UNDER_SURVEY | _FW_UNDER_LINKING))) == _TRUE) { - rtw_msleep_os(30); + msleep(30); cnt++; if (cnt > 100) break; @@ -6524,7 +6524,7 @@ static int rtw_dbg_port(struct net_device *dev, d_data = rtw_read32(padapter, 0x04); imr = rtw_read32(padapter, 0x10250014); rtw_write32(padapter, 0x10250014, 0); - rtw_msleep_os(50); + msleep(50); i_data = rtw_sd_iread32(padapter, 0x04); @@ -6541,13 +6541,13 @@ static int rtw_dbg_port(struct net_device *dev, RTW_ERR("test_code :0x%02x, i_data : 0x%08x\n", test_code, i_data); } if ((j++) == 100) { - rtw_msleep_os(2000); + msleep(2000); RTW_INFO(" Indirect access testing..........%d/%d\n", i, test_cnts); j = 0; } test_code = ~test_code; - rtw_msleep_os(50); + msleep(50); } RTW_INFO("========Indirect access test=========\n"); RTW_INFO(" test_cnts = %d\n", test_cnts); @@ -9221,11 +9221,11 @@ static int rtw_mp_efuse_set(struct net_device *dev, /* unknown bug workaround, need to fix later */ addr = 0x1ff; rtw_write8(padapter, EFUSE_CTRL + 1, (addr & 0xff)); - rtw_msleep_os(10); + msleep(10); rtw_write8(padapter, EFUSE_CTRL + 2, ((addr >> 8) & 0x03)); - rtw_msleep_os(10); + msleep(10); rtw_write8(padapter, EFUSE_CTRL + 3, 0x72); - rtw_msleep_os(10); + msleep(10); rtw_read8(padapter, EFUSE_CTRL); #endif /* RTW_HALMAC */ @@ -9510,11 +9510,11 @@ static int rtw_mp_efuse_set(struct net_device *dev, BTEfuse_PowerSwitch(padapter, 1, _TRUE); addr = 0x1ff; rtw_write8(padapter, EFUSE_CTRL + 1, (addr & 0xff)); - rtw_msleep_os(10); + msleep(10); rtw_write8(padapter, EFUSE_CTRL + 2, ((addr >> 8) & 0x03)); - rtw_msleep_os(10); + msleep(10); rtw_write8(padapter, EFUSE_CTRL + 3, 0x72); - rtw_msleep_os(10); + msleep(10); rtw_read8(padapter, EFUSE_CTRL); BTEfuse_PowerSwitch(padapter, 1, _FALSE); #endif /* RTW_HALMAC */ @@ -9612,11 +9612,11 @@ static int rtw_mp_efuse_set(struct net_device *dev, BTEfuse_PowerSwitch(padapter, 1, _TRUE); addr = 0x1ff; rtw_write8(padapter, EFUSE_CTRL + 1, (addr & 0xff)); - rtw_msleep_os(10); + msleep(10); rtw_write8(padapter, EFUSE_CTRL + 2, ((addr >> 8) & 0x03)); - rtw_msleep_os(10); + msleep(10); rtw_write8(padapter, EFUSE_CTRL + 3, 0x72); - rtw_msleep_os(10); + msleep(10); rtw_read8(padapter, EFUSE_CTRL); BTEfuse_PowerSwitch(padapter, 1, _FALSE); #endif /* RTW_HALMAC */ @@ -10438,7 +10438,7 @@ static int rtw_priv_get(struct net_device *dev, return -EIO; } - rtw_msleep_os(10); /* delay 5ms for sending pkt before exit adb shell operation */ + msleep(10); /* delay 5ms for sending pkt before exit adb shell operation */ return 0; } @@ -11850,7 +11850,7 @@ static void loopbackTest(PADAPTER padapter, u32 cnt, u32 size, u8 *pmsg) len = strlen(ploopback->msg); if (len) break; - rtw_msleep_os(1); + msleep(1); } while (1); _rtw_memcpy(pmsg, ploopback->msg, len + 1); freeLoopback(padapter); diff --git a/os_dep/linux/ioctl_mp.c b/os_dep/linux/ioctl_mp.c index c4ef5a6..71de17c 100644 --- a/os_dep/linux/ioctl_mp.c +++ b/os_dep/linux/ioctl_mp.c @@ -1667,7 +1667,7 @@ int rtw_mp_pretx_proc(PADAPTER padapter, u8 bStartTest, char *extra) if (pmp_priv->tx.stop == 0) { pmp_priv->tx.stop = 1; - rtw_msleep_os(5); + msleep(5); } #ifdef CONFIG_80211N_HT if(padapter->registrypriv.ht_enable && @@ -2460,10 +2460,10 @@ int rtw_mp_SetBT(struct net_device *dev, MPT_PwrCtlDM(padapter, 0); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF)); - rtw_msleep_os(600); + msleep(600); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB)); - rtw_msleep_os(1200); + msleep(1200); pBTFirmware = (PRT_MP_FIRMWARE)rtw_zmalloc(sizeof(RT_MP_FIRMWARE)); if (pBTFirmware == NULL) goto exit; @@ -2473,13 +2473,13 @@ int rtw_mp_SetBT(struct net_device *dev, rtw_mfree((u8 *)pBTFirmware, sizeof(RT_MP_FIRMWARE)); RTW_INFO("Wait for FirmwareDownloadBT fw boot!\n"); - rtw_msleep_os(2000); + msleep(2000); _rtw_memset(extra, '\0', wrqu->data.length); BtReq.opCodeVer = 1; BtReq.OpCode = 0; BtReq.paraLength = 0; mptbt_BtControlProcess(padapter, &BtReq); - rtw_msleep_os(100); + msleep(100); RTW_INFO("FirmwareDownloadBT ready = 0x%x 0x%x", pMptCtx->mptOutBuf[4], pMptCtx->mptOutBuf[5]); if ((pMptCtx->mptOutBuf[4] == 0x00) && (pMptCtx->mptOutBuf[5] == 0x00)) { @@ -2522,10 +2522,10 @@ int rtw_mp_SetBT(struct net_device *dev, MPT_PwrCtlDM(padapter, 0); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF)); - rtw_msleep_os(600); + msleep(600); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB)); - rtw_msleep_os(1200); + msleep(1200); #if defined(CONFIG_PLATFORM_SPRD) && (MP_DRIVER == 1) /* Pull up BT reset pin.*/ @@ -2538,7 +2538,7 @@ int rtw_mp_SetBT(struct net_device *dev, status = rtl8723b_FirmwareDownload(padapter, _FALSE); #endif RTW_INFO("Wait for FirmwareDownloadBT fw boot!\n"); - rtw_msleep_os(1000); + msleep(1000); #ifdef CONFIG_BT_COEXIST rtw_btcoex_HaltNotify(padapter); RTW_INFO("SetBT btcoex HaltNotify !\n"); @@ -2550,7 +2550,7 @@ int rtw_mp_SetBT(struct net_device *dev, BtReq.OpCode = 0; BtReq.paraLength = 0; mptbt_BtControlProcess(padapter, &BtReq); - rtw_msleep_os(200); + msleep(200); RTW_INFO("FirmwareDownloadBT ready = 0x%x 0x%x", pMptCtx->mptOutBuf[4], pMptCtx->mptOutBuf[5]); if ((pMptCtx->mptOutBuf[4] == 0x00) && (pMptCtx->mptOutBuf[5] == 0x00)) { @@ -2562,7 +2562,7 @@ int rtw_mp_SetBT(struct net_device *dev, #ifdef CONFIG_BT_COEXIST rtw_btcoex_SwitchBtTRxMask(padapter); #endif - rtw_msleep_os(200); + msleep(200); sprintf(extra, "download FW OK.\n"); goto exit; } @@ -2583,23 +2583,23 @@ int rtw_mp_SetBT(struct net_device *dev, MPT_PwrCtlDM(padapter, 0); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) | 0x00000004)); rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) & 0xFFFFFFEF)); - rtw_msleep_os(600); + msleep(600); /*rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a)& 0xFFFFFFFE));*/ rtw_write32(padapter, 0x6b, (rtw_read32(padapter, 0x6b) | 0x00000010)); rtw_write32(padapter, 0xcc, (rtw_read32(padapter, 0xcc) & 0xFFFFFFFB)); - rtw_msleep_os(1200); + msleep(1200); goto exit; } if (strncmp(extra, "disable", 7) == 0) { RTW_INFO("SetBT disable !\n"); rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a) & 0xFFFFFFFB)); - rtw_msleep_os(500); + msleep(500); goto exit; } if (strncmp(extra, "enable", 6) == 0) { RTW_INFO("SetBT enable !\n"); rtw_write32(padapter, 0x6a, (rtw_read32(padapter, 0x6a) | 0x00000004)); - rtw_msleep_os(500); + msleep(500); goto exit; } if (strncmp(extra, "h2c", 3) == 0) { diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 93ebe21..cf37f0a 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -3882,7 +3882,7 @@ static int netdev_close(struct net_device *pnetdev) RTW_INFO("netdev_close, bips_processing=%d\n", pwrctl->bips_processing); while (pwrctl->bips_processing == _TRUE) /* waiting for ips_processing done before call rtw_dev_unload() */ - rtw_msleep_os(1); + msleep(1); rtw_dev_unload(padapter); rtw_sdio_set_power(0); @@ -4646,7 +4646,7 @@ int rtw_suspend_common(_adapter *padapter) pwrpriv->bInSuspend = _TRUE; while (pwrpriv->bips_processing == _TRUE) - rtw_msleep_os(1); + msleep(1); #ifdef CONFIG_IOL_READ_EFUSE_MAP if (!padapter->bup) { diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index a66ce42..2d8b36b 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1597,32 +1597,6 @@ void rtw_sleep_schedulable(int ms) } -void rtw_msleep_os(int ms) -{ - -#ifdef PLATFORM_LINUX -#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 36)) - if (ms < 20) { - unsigned long us = ms * 1000UL; - usleep_range(us, us + 1000UL); - } else -#endif - msleep((unsigned int)ms); - -#endif -#ifdef PLATFORM_FREEBSD - /* Delay for delay microseconds */ - DELAY(ms * 1000); - return ; -#endif -#ifdef PLATFORM_WINDOWS - - NdisMSleep(ms * 1000); /* (us)*1000=(ms) */ - -#endif - - -} void rtw_usleep_os(int us) { #ifdef PLATFORM_LINUX @@ -1660,7 +1634,7 @@ void _rtw_mdelay_os(int ms, const char *func, const int line) #if 0 if (ms > 10) RTW_INFO("%s:%d %s(%d)\n", func, line, __FUNCTION__, ms); - rtw_msleep_os(ms); + msleep(ms); return; #endif From 76f68bbfcf1e71fa96f2cda775e286c318867305 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Mon, 11 Oct 2021 11:25:22 +0200 Subject: [PATCH 15/16] Remove hidden warnings from makefile --- Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile b/Makefile index 9657535..51620ee 100644 --- a/Makefile +++ b/Makefile @@ -8,7 +8,6 @@ EXTRA_CFLAGS += -Wno-unused-value EXTRA_CFLAGS += -Wno-unused-label EXTRA_CFLAGS += -Wno-unused-parameter EXTRA_CFLAGS += -Wno-unused-function -EXTRA_CFLAGS += -Wno-unused #EXTRA_CFLAGS += -Wno-vla EXTRA_CFLAGS += -Wno-date-time From cf246719f17447b60494023b9ef769d7e479ff18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garc=C3=A9s?= Date: Mon, 11 Oct 2021 12:07:17 +0200 Subject: [PATCH 16/16] Remove wrapper for memset() Link: https://github.com/lwfinger/rtl8188eu/commit/545d963a9ed5b6a216e8405c1319bf1ad9e858ce#diff-16d649c4743131c1aae5f812af5596dae6423bb63eaaf2990b8c89c9a681a913 --- core/efuse/rtw_efuse.c | 24 +++--- core/mesh/rtw_mesh.c | 14 +-- core/mesh/rtw_mesh_hwmp.c | 4 +- core/mesh/rtw_mesh_pathtbl.c | 2 +- core/rtw_ap.c | 26 +++--- core/rtw_beamforming.c | 38 ++++----- core/rtw_bt_mp.c | 2 +- core/rtw_btcoex.c | 10 +-- core/rtw_chplan.c | 2 +- core/rtw_cmd.c | 4 +- core/rtw_debug.c | 24 +++--- core/rtw_ieee80211.c | 18 ++-- core/rtw_ioctl_query.c | 2 +- core/rtw_ioctl_set.c | 6 +- core/rtw_mi.c | 10 +-- core/rtw_mlme.c | 46 +++++----- core/rtw_mlme_ext.c | 136 +++++++++++++++--------------- core/rtw_mp.c | 38 ++++----- core/rtw_p2p.c | 78 ++++++++--------- core/rtw_pwrctrl.c | 2 +- core/rtw_recv.c | 6 +- core/rtw_rm.c | 8 +- core/rtw_rm_fsm.c | 2 +- core/rtw_rson.c | 8 +- core/rtw_security.c | 48 +++++------ core/rtw_sta_mgt.c | 12 +-- core/rtw_tdls.c | 40 ++++----- core/rtw_vht.c | 4 +- core/rtw_wapi.c | 10 +-- core/rtw_wlan_util.c | 34 ++++---- core/rtw_xmit.c | 24 +++--- hal/hal_btcoex.c | 10 +-- hal/hal_btcoex_wifionly.c | 2 +- hal/hal_com.c | 96 ++++++++++----------- hal/hal_com_phycfg.c | 32 +++---- hal/hal_dm_acs.c | 4 +- hal/hal_halmac.c | 42 ++++----- hal/hal_hci/hal_usb.c | 2 +- hal/hal_intf.c | 2 +- hal/hal_mcc.c | 4 +- hal/phydm/phydm_interface.c | 2 +- hal/phydm/txbf/haltxbfinterface.c | 8 +- hal/rtl8192e/rtl8192e_cmd.c | 2 +- hal/rtl8192e/rtl8192e_hal_init.c | 22 ++--- hal/rtl8192e/rtl8192e_rxdesc.c | 2 +- hal/rtl8192e/rtl8192e_xmit.c | 8 +- hal/rtl8192e/usb/rtl8192eu_xmit.c | 4 +- os_dep/linux/ioctl_cfg80211.c | 48 +++++------ os_dep/linux/ioctl_cfg80211.h | 10 +-- os_dep/linux/ioctl_linux.c | 126 +++++++++++++-------------- os_dep/linux/ioctl_mp.c | 100 +++++++++++----------- os_dep/linux/mlme_linux.c | 6 +- os_dep/linux/os_intfs.c | 12 +-- os_dep/linux/recv_linux.c | 6 +- os_dep/linux/rtw_cfgvendor.c | 2 +- os_dep/linux/rtw_proc.c | 4 +- os_dep/linux/usb_ops_linux.c | 2 +- os_dep/osdep_service.c | 23 +---- 58 files changed, 621 insertions(+), 642 deletions(-) diff --git a/core/efuse/rtw_efuse.c b/core/efuse/rtw_efuse.c index 309ecb3..570414b 100644 --- a/core/efuse/rtw_efuse.c +++ b/core/efuse/rtw_efuse.c @@ -635,8 +635,8 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake) EFUSE_GetEfuseDefinition(padapter, efuseType, TYPE_EFUSE_CONTENT_LEN_BANK, (PVOID)&efuse_max, bPseudoTest); EFUSE_GetEfuseDefinition(padapter, EFUSE_WIFI, TYPE_EFUSE_REAL_CONTENT_LEN, (PVOID)&maprawlen, _FALSE); - _rtw_memset(eFuseWord, 0xff, EFUSE_MAX_SECTION_NUM * (EFUSE_MAX_WORD_UNIT * 2)); - _rtw_memset(pEfuseHal->fakeEfuseInitMap, 0xff, EFUSE_MAX_MAP_LEN); + memset(eFuseWord, 0xff, EFUSE_MAX_SECTION_NUM * (EFUSE_MAX_WORD_UNIT * 2)); + memset(pEfuseHal->fakeEfuseInitMap, 0xff, EFUSE_MAX_MAP_LEN); if (IS_HARDWARE_TYPE_8821(padapter)) endBank = 3 - 1;/*EFUSE_MAX_BANK_8821A - 1;*/ @@ -688,7 +688,7 @@ void rtw_efuse_analyze(PADAPTER padapter, u8 Type, u8 Fake) wden = (efuseHeader & 0x0f); } - _rtw_memset(efuseData, '\0', EFUSE_MAX_WORD_UNIT * 2); + memset(efuseData, '\0', EFUSE_MAX_WORD_UNIT * 2); dataCnt = 0; if (offset < max_section) { @@ -1161,7 +1161,7 @@ u8 rtw_efuse_map_write(PADAPTER adapter, u16 addr, u16 cnts, u8 *data) } else err = rtw_halmac_write_logical_efuse_map(d, efuse, size, NULL, 0); } else { - _rtw_memset(mask_buf, 0xFF, sizeof(mask_buf)); + memset(mask_buf, 0xFF, sizeof(mask_buf)); RTW_INFO("Efuse mask off\n"); err = rtw_halmac_write_logical_efuse_map(d, efuse, size, mask_buf, size/16); } @@ -1305,8 +1305,8 @@ VOID hal_ReadEFuse_BT_logic_map( } /* 0xff will be efuse default value instead of 0x00. */ - _rtw_memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN); - _rtw_memset(phyefuse, 0xFF, EFUSE_BT_REAL_CONTENT_LEN); + memset(efuseTbl, 0xFF, EFUSE_BT_MAP_LEN); + memset(phyefuse, 0xFF, EFUSE_BT_REAL_CONTENT_LEN); if (rtw_efuse_bt_access(padapter, _FALSE, 0, EFUSE_BT_REAL_CONTENT_LEN, phyefuse)) dump_buf(phyefuse, EFUSE_BT_REAL_BANK_CONTENT_LEN); @@ -1588,7 +1588,7 @@ Hal_EfuseWordEnableDataWrite( /* RTW_INFO("%s: efuse_addr=%#x word_en=%#x\n", __FUNCTION__, efuse_addr, word_en); */ - _rtw_memset(tmpdata, 0xFF, PGPKT_DATA_SIZE); + memset(tmpdata, 0xFF, PGPKT_DATA_SIZE); if (!(word_en & BIT(0))) { tmpaddr = start_addr; @@ -1638,7 +1638,7 @@ hal_EfuseConstructPGPkt( u8 *pData, PPGPKT_STRUCT pTargetPkt) { - _rtw_memset(pTargetPkt->data, 0xFF, PGPKT_DATA_SIZE); + memset(pTargetPkt->data, 0xFF, PGPKT_DATA_SIZE); pTargetPkt->offset = offset; pTargetPkt->word_en = word_en; efuse_WordEnableDataRead(word_en, pData, pTargetPkt->data); @@ -2414,7 +2414,7 @@ u8 rtw_efuse_map_write(PADAPTER padapter, u16 addr, u16 cnts, u8 *data) return _FAIL; } - _rtw_memset(map, 0xFF, mapLen); + memset(map, 0xFF, mapLen); ret = rtw_efuse_map_read(padapter, 0, mapLen, map); if (ret == _FAIL) @@ -2934,7 +2934,7 @@ void EFUSE_ShadowMapUpdate( mapLen = EEPROM_MAX_SIZE; efuse_map = pHalData->efuse_eeprom_data; /* efuse default content is 0xFF */ - _rtw_memset(efuse_map, 0xFF, EEPROM_MAX_SIZE); + memset(efuse_map, 0xFF, EEPROM_MAX_SIZE); EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, bPseudoTest); if (!mapLen) { @@ -2956,7 +2956,7 @@ void EFUSE_ShadowMapUpdate( EFUSE_GetEfuseDefinition(pAdapter, efuseType, TYPE_EFUSE_MAP_LEN, (PVOID)&mapLen, bPseudoTest); if (pHalData->bautoload_fail_flag == _TRUE) - _rtw_memset(pHalData->efuse_eeprom_data, 0xFF, mapLen); + memset(pHalData->efuse_eeprom_data, 0xFF, mapLen); else { #ifdef CONFIG_ADAPTOR_INFO_CACHING_FILE if (_SUCCESS != retriveAdaptorInfoFile(pAdapter->registrypriv.adaptor_info_caching_file_path, pHalData->efuse_eeprom_data)) { @@ -3161,7 +3161,7 @@ u32 rtw_read_efuse_from_file(const char *path, u8 *buf, int map_size) RTW_ERR("%s rtw_vmalloc(%d) fail\n", __func__, map_size); goto exit; } - _rtw_memset(map, 0xff, map_size); + memset(map, 0xff, map_size); temp[2] = 0; /* end of string '\0' */ diff --git a/core/mesh/rtw_mesh.c b/core/mesh/rtw_mesh.c index 8fe498c..1d51b54 100644 --- a/core/mesh/rtw_mesh.c +++ b/core/mesh/rtw_mesh.c @@ -1512,7 +1512,7 @@ static int rtw_mpm_check_frames(_adapter *adapter, u8 action, const u8 **buf, si goto exit; } - _rtw_memset(&mpm_info, 0, sizeof(struct mpm_frame_info)); + memset(&mpm_info, 0, sizeof(struct mpm_frame_info)); if (action == RTW_ACT_SELF_PROTECTED_MESH_CONF) { mpm_info.aid = (u8 *)frame_body + 4; @@ -2101,11 +2101,11 @@ int _rtw_mesh_plink_add(_adapter *adapter, const u8 *hwaddr) #endif ent->llid = 0; ent->plid = 0; - _rtw_memset(ent->chosen_pmk, 0, 16); + memset(ent->chosen_pmk, 0, 16); #ifdef CONFIG_RTW_MESH_AEK - _rtw_memset(ent->sel_pcs, 0, 4); - _rtw_memset(ent->l_nonce, 0, 32); - _rtw_memset(ent->p_nonce, 0, 32); + memset(ent->sel_pcs, 0, 4); + memset(ent->l_nonce, 0, 32); + memset(ent->p_nonce, 0, 32); #endif ent->plink_state = RTW_MESH_PLINK_LISTEN; #ifndef CONFIG_RTW_MESH_DRIVER_AID @@ -3077,7 +3077,7 @@ void rtw_mesh_init_mesh_info(_adapter *adapter) { struct rtw_mesh_info *minfo = &adapter->mesh_info; - _rtw_memset(minfo, 0, sizeof(struct rtw_mesh_info)); + memset(minfo, 0, sizeof(struct rtw_mesh_info)); rtw_mesh_plink_ctl_init(adapter); @@ -3459,7 +3459,7 @@ void rtw_mesh_tx_build_mctrl(_adapter *adapter, struct pkt_attrib *attrib, u8 *b { struct rtw_ieee80211s_hdr *mctrl = (struct rtw_ieee80211s_hdr *)buf; - _rtw_memset(mctrl, 0, XATTRIB_GET_MCTRL_LEN(attrib)); + memset(mctrl, 0, XATTRIB_GET_MCTRL_LEN(attrib)); if (attrib->mfwd_ttl #if CONFIG_RTW_MESH_DATA_BMC_TO_UC diff --git a/core/mesh/rtw_mesh_hwmp.c b/core/mesh/rtw_mesh_hwmp.c index f64aa3d..c8bee30 100644 --- a/core/mesh/rtw_mesh_hwmp.c +++ b/core/mesh/rtw_mesh_hwmp.c @@ -230,7 +230,7 @@ static int rtw_mesh_path_sel_frame_tx(enum rtw_mpath_frame_type mpath_action, u8 pattrib = &pmgntframe->attrib; update_mgntframe_attrib(adapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pos; @@ -344,7 +344,7 @@ int rtw_mesh_path_error_tx(_adapter *adapter, pattrib = &pmgntframe->attrib; update_mgntframe_attrib(adapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pos = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pos; diff --git a/core/mesh/rtw_mesh_pathtbl.c b/core/mesh/rtw_mesh_pathtbl.c index 4f09940..80fd36f 100644 --- a/core/mesh/rtw_mesh_pathtbl.c +++ b/core/mesh/rtw_mesh_pathtbl.c @@ -544,7 +544,7 @@ struct rtw_mesh_path *rtw_mesh_path_new(_adapter *adapter, return NULL; _rtw_memcpy(new_mpath->dst, dst, ETH_ALEN); - _rtw_memset(new_mpath->rann_snd_addr, 0xFF, ETH_ALEN); + memset(new_mpath->rann_snd_addr, 0xFF, ETH_ALEN); new_mpath->is_root = false; new_mpath->adapter = adapter; new_mpath->flags = 0; diff --git a/core/rtw_ap.c b/core/rtw_ap.c index 3d6dbfd..ccad5fa 100644 --- a/core/rtw_ap.c +++ b/core/rtw_ap.c @@ -639,7 +639,7 @@ void expire_timeout_chk(_adapter *padapter) #endif char del_asoc_list[NUM_STA]; - _rtw_memset(del_asoc_list, NUM_STA, NUM_STA); + memset(del_asoc_list, NUM_STA, NUM_STA); #ifdef CONFIG_ACTIVE_KEEP_ALIVE_CHECK if (pmlmeext->active_keep_alive_check) { @@ -990,7 +990,7 @@ void update_bmc_sta(_adapter *padapter) psta->ieee8021x_blocked = 0; - _rtw_memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); + memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); /* psta->dot118021XPrivacy = _NO_PRIVACY_; */ /* !!! remove it, because it has been set before this. */ @@ -1170,7 +1170,7 @@ void update_sta_info_apmode(_adapter *padapter, struct sta_info *psta) /* todo: init other variables */ - _rtw_memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); + memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); /* add ratid */ @@ -1933,7 +1933,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) pbss_network->IELength = len; - _rtw_memset(ie, 0, MAX_IE_SZ); + memset(ie, 0, MAX_IE_SZ); _rtw_memcpy(ie, pbuf, pbss_network->IELength); @@ -1966,7 +1966,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) /* SSID */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SSID_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { - _rtw_memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&pbss_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(pbss_network->Ssid.Ssid, (p + 2), ie_len); pbss_network->Ssid.SsidLength = ie_len; #ifdef CONFIG_P2P @@ -1980,7 +1980,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) if (MLME_IS_MESH(padapter)) { p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, WLAN_EID_MESH_ID, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p && ie_len > 0) { - _rtw_memset(&pbss_network->mesh_id, 0, sizeof(NDIS_802_11_SSID)); + memset(&pbss_network->mesh_id, 0, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(pbss_network->mesh_id.Ssid, (p + 2), ie_len); pbss_network->mesh_id.SsidLength = ie_len; } @@ -1997,7 +1997,7 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len) pbss_network->Configuration.DSConfig = channel; - _rtw_memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); + memset(supportRate, 0, NDIS_802_11_LENGTH_RATES_EX); /* get supported rates */ p = rtw_get_ie(ie + _BEACON_IE_OFFSET_, _SUPPORTEDRATES_IE_, &ie_len, (pbss_network->IELength - _BEACON_IE_OFFSET_)); if (p != NULL) { @@ -2782,7 +2782,7 @@ static int rtw_ap_set_key(_adapter *padapter, u8 *key, u8 alg, int keyid, u8 set goto exit; } - _rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm)); + memset(psetkeyparm, 0, sizeof(struct setkey_parm)); psetkeyparm->keyid = (u8)keyid; if (is_wep_enc(alg)) @@ -4154,7 +4154,7 @@ void start_ap_mode(_adapter *padapter) pmlmepriv->sw_to_20mhz = 0; #endif - _rtw_memset(pmlmepriv->ext_capab_ie_data, 0, sizeof(pmlmepriv->ext_capab_ie_data)); + memset(pmlmepriv->ext_capab_ie_data, 0, sizeof(pmlmepriv->ext_capab_ie_data)); pmlmepriv->ext_capab_ie_len = 0; #ifdef CONFIG_CONCURRENT_MODE @@ -4221,7 +4221,7 @@ void stop_ap_mode(_adapter *padapter) padapter->netif_up = _FALSE; /* reset and init security priv , this can refine with rtw_reset_securitypriv */ - _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); + memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); padapter->securitypriv.ndisauthtype = Ndis802_11AuthModeOpen; padapter->securitypriv.ndisencryptstatus = Ndis802_11WEPDisabled; @@ -5197,7 +5197,7 @@ u16 rtw_ap_parse_sta_security_ie(_adapter *adapter, struct sta_info *sta, struct sta->wpa2_group_cipher = 0; sta->wpa_pairwise_cipher = 0; sta->wpa2_pairwise_cipher = 0; - _rtw_memset(sta->wpa_ie, 0, sizeof(sta->wpa_ie)); + memset(sta->wpa_ie, 0, sizeof(sta->wpa_ie)); if ((sec->wpa_psk & BIT(1)) && elems->rsn_ie) { wpa_ie = elems->rsn_ie; @@ -5422,7 +5422,7 @@ void rtw_ap_parse_sta_ht_ie(_adapter *adapter, struct sta_info *sta, struct rtw_ goto exit; /* save HT capabilities in the sta object */ - _rtw_memset(&sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); + memset(&sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); if (elems->ht_capabilities && elems->ht_capabilities_len >= sizeof(struct rtw_ieee80211_ht_cap)) { sta->flags |= WLAN_STA_HT; sta->flags |= WLAN_STA_WME; @@ -5449,7 +5449,7 @@ void rtw_ap_parse_sta_vht_ie(_adapter *adapter, struct sta_info *sta, struct rtw if (mlme->vhtpriv.vht_option == _FALSE) goto exit; - _rtw_memset(&sta->vhtpriv, 0, sizeof(struct vht_priv)); + memset(&sta->vhtpriv, 0, sizeof(struct vht_priv)); if (elems->vht_capabilities && elems->vht_capabilities_len == VHT_CAP_IE_LEN) { sta->flags |= WLAN_STA_VHT; _rtw_memcpy(sta->vhtpriv.vht_cap, elems->vht_capabilities, VHT_CAP_IE_LEN); diff --git a/core/rtw_beamforming.c b/core/rtw_beamforming.c index 7e5fd7b..35543ef 100644 --- a/core/rtw_beamforming.c +++ b/core/rtw_beamforming.c @@ -213,7 +213,7 @@ static u8 _send_ht_ndpa_packet(PADAPTER adapter, u8 *ra, enum channel_width bw) attrib->rate = (u8)txrate; attrib->bf_pkt_type = 0; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -308,7 +308,7 @@ static u8 _send_vht_ndpa_packet(PADAPTER adapter, u8 *ra, u16 aid, enum channel_ attrib->rate = (u8)txrate; attrib->bf_pkt_type = 0; - _rtw_memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); + memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); pframe = pmgntframe->buf_addr + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -425,7 +425,7 @@ static u8 _send_vht_mu_ndpa_packet(PADAPTER adapter, enum channel_width bw) else attrib->bf_pkt_type = 0; - _rtw_memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); + memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); pframe = pmgntframe->buf_addr + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -517,7 +517,7 @@ static u8 _send_bf_report_poll(PADAPTER adapter, u8 *ra, u8 bFinalPoll) else attrib->bf_pkt_type = 2; - _rtw_memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); + memset(pmgntframe->buf_addr, 0, TXDESC_OFFSET + WLANHDR_OFFSET); pframe = pmgntframe->buf_addr + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -581,8 +581,8 @@ static void _sounding_update_min_period(PADAPTER adapter, u16 period, u8 leave) static void _sounding_init(struct sounding_info *sounding) { - _rtw_memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU); - _rtw_memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU); + memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU); + memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU); sounding->state = SOUNDING_STATE_NONE; sounding->su_bfee_curidx = 0xFF; sounding->candidate_mu_bfee_cnt = 0; @@ -600,8 +600,8 @@ static void _sounding_reset_vars(PADAPTER adapter) info = GET_BEAMFORM_INFO(adapter); sounding = &info->sounding_info; - _rtw_memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU); - _rtw_memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU); + memset(sounding->su_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_SU); + memset(sounding->mu_sounding_list, 0xFF, MAX_NUM_BEAMFORMEE_MU); sounding->su_bfee_curidx = 0xFF; sounding->candidate_mu_bfee_cnt = 0; @@ -1054,8 +1054,8 @@ static void _bfer_remove_entry(PADAPTER adapter, struct beamformer_entry *entry) if (TEST_FLAG(entry->cap, BEAMFORMER_CAP_VHT_MU)) { info->beamformer_mu_cnt -= 1; - _rtw_memset(entry->gid_valid, 0, 8); - _rtw_memset(entry->user_position, 0, 16); + memset(entry->gid_valid, 0, 8); + memset(entry->user_position, 0, 16); } else if (TEST_FLAG(entry->cap, BEAMFORMER_CAP_VHT_SU|BEAMFORMER_CAP_HT_EXPLICIT)) { info->beamformer_su_cnt -= 1; } @@ -1245,7 +1245,7 @@ static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter, RTW_ERR("%s: UNEXPECTED!! info->TargetSUBFee is NULL!", __FUNCTION__); } info->TargetSUBFee = NULL; - _rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); + memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); rtw_bf_cmd(adapter, BEAMFORMING_CTRL_SET_CSI_REPORT, (u8*)&info->TargetCSIInfo, sizeof(struct _RT_CSI_INFO), 0); } } @@ -1268,7 +1268,7 @@ static struct beamformee_entry *_bfee_add_entry(PADAPTER adapter, /* Record the first SU BFee index. We only allow the first SU BFee to be sound */ if ((info->beamformee_su_cnt == 1) && (info->beamformee_mu_cnt == 0)) { info->TargetSUBFee = bfee; - _rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); + memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); bfee->bSuspendSUCap = _FALSE; } else { bfee->bSuspendSUCap = _TRUE; @@ -1308,7 +1308,7 @@ static void _bfee_remove_entry(PADAPTER adapter, struct beamformee_entry *entry) if ((info->beamformee_mu_cnt == 0) && (info->beamformee_su_cnt > 0)) { idx = _bfee_get_first_su_entry_idx(adapter, NULL); info->TargetSUBFee = &info->bfee_entry[idx]; - _rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); + memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); info->TargetSUBFee->bSuspendSUCap = _FALSE; } } @@ -1320,7 +1320,7 @@ static void _bfee_remove_entry(PADAPTER adapter, struct beamformee_entry *entry) && (entry == info->TargetSUBFee)) { entry->bSuspendSUCap = _TRUE; info->TargetSUBFee = NULL; - _rtw_memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); + memset(&info->TargetCSIInfo, 0, sizeof(struct _RT_CSI_INFO)); rtw_bf_cmd(adapter, BEAMFORMING_CTRL_SET_CSI_REPORT, (u8*)&info->TargetCSIInfo, sizeof(struct _RT_CSI_INFO), 0); } } @@ -1711,7 +1711,7 @@ u8 rtw_bf_send_vht_gid_mgnt_packet(PADAPTER adapter, u8 *ra, u8 *gid, u8 *positi attrib->bwmode = CHANNEL_WIDTH_20; attrib->subtype = WIFI_ACTION; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)pmgntframe->buf_addr + TXDESC_OFFSET; wlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -2205,7 +2205,7 @@ BOOLEAN issue_ht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, pattrib->order = 1; pattrib->subtype = WIFI_ACTION_NOACK; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -2281,7 +2281,7 @@ BOOLEAN issue_ht_ndpa_packet(PADAPTER Adapter, u8 *ra, enum channel_width bw, u8 pattrib->order = 1; pattrib->subtype = WIFI_ACTION_NOACK; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -2368,7 +2368,7 @@ BOOLEAN issue_vht_sw_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel pattrib->bwmode = bw; pattrib->subtype = WIFI_NDPA; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -2454,7 +2454,7 @@ BOOLEAN issue_vht_ndpa_packet(PADAPTER Adapter, u8 *ra, u16 aid, enum channel_wi pattrib->bwmode = bw; pattrib->subtype = WIFI_NDPA; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; diff --git a/core/rtw_bt_mp.c b/core/rtw_bt_mp.c index 9b4fc24..2a2c14d 100644 --- a/core/rtw_bt_mp.c +++ b/core/rtw_bt_mp.c @@ -1522,7 +1522,7 @@ mptbt_BtControlProcess( /* RTW_INFO("[MPT], parameters(hex):0x%x %d\n",&pBtReq->pParamStart[0], pBtReq->paraLength); */ } - _rtw_memset((void *)pMptCtx->mptOutBuf, 0, 100); + memset((void *)pMptCtx->mptOutBuf, 0, 100); pMptCtx->mptOutLen = 4; /* length of (BT_RSP_CMD.status+BT_RSP_CMD.paraLength) */ pBtRsp = (PBT_RSP_CMD)pMptCtx->mptOutBuf; diff --git a/core/rtw_btcoex.c b/core/rtw_btcoex.c index 101226d..105a7d6 100644 --- a/core/rtw_btcoex.c +++ b/core/rtw_btcoex.c @@ -624,7 +624,7 @@ u8 rtw_btcoex_parse_BT_info_notify_cmd(_adapter *padapter, u8 *pcmd, u16 cmdlen) RTW_INFO("%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x\n" ,pcmd[4],pcmd[5],pcmd[6],pcmd[7],pcmd[8],pcmd[9],pcmd[10],pcmd[11]);*/ - _rtw_memset(btinfo, 0, BT_INFO_LENGTH); + memset(btinfo, 0, BT_INFO_LENGTH); #if 1 if (BT_INFO_LENGTH != btInfoLen) { @@ -1322,7 +1322,7 @@ void rtw_btcoex_recvmsgbysocket(void *data) /*important: cut the udp header from skb->data! header length is 8 byte*/ recv_length = skb->len - 8; - _rtw_memset(recv_data, 0, sizeof(recv_data)); + memset(recv_data, 0, sizeof(recv_data)); _rtw_memcpy(recv_data, skb->data + 8, recv_length); parse_res = rtw_btcoex_parse_recv_data(recv_data, recv_length); @@ -1516,12 +1516,12 @@ u8 rtw_btcoex_create_kernel_socket(_adapter *padapter) RTW_INFO("Error during creation of socket error:%d\n", kernel_socket_err); status = _FAIL; } else { - _rtw_memset(&(pcoex_info->wifi_sockaddr), 0, sizeof(pcoex_info->wifi_sockaddr)); + memset(&(pcoex_info->wifi_sockaddr), 0, sizeof(pcoex_info->wifi_sockaddr)); pcoex_info->wifi_sockaddr.sin_family = AF_INET; pcoex_info->wifi_sockaddr.sin_port = htons(CONNECT_PORT); pcoex_info->wifi_sockaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); - _rtw_memset(&(pcoex_info->bt_sockaddr), 0, sizeof(pcoex_info->bt_sockaddr)); + memset(&(pcoex_info->bt_sockaddr), 0, sizeof(pcoex_info->bt_sockaddr)); pcoex_info->bt_sockaddr.sin_family = AF_INET; pcoex_info->bt_sockaddr.sin_port = htons(CONNECT_PORT_BT); pcoex_info->bt_sockaddr.sin_addr.s_addr = htonl(INADDR_LOOPBACK); @@ -1570,7 +1570,7 @@ void rtw_btcoex_init_socket(_adapter *padapter) struct bt_coex_info *pcoex_info = &padapter->coex_info; RTW_INFO("%s\n", __func__); if (_FALSE == pcoex_info->is_exist) { - _rtw_memset(pcoex_info, 0, sizeof(struct bt_coex_info)); + memset(pcoex_info, 0, sizeof(struct bt_coex_info)); pcoex_info->btcoex_wq = create_workqueue("BTCOEX"); INIT_DELAYED_WORK(&pcoex_info->recvmsg_work, (void *)rtw_btcoex_recvmsgbysocket); diff --git a/core/rtw_chplan.c b/core/rtw_chplan.c index 8eaa0fd..a77d4d8 100644 --- a/core/rtw_chplan.c +++ b/core/rtw_chplan.c @@ -476,7 +476,7 @@ u8 init_channel_set(_adapter *padapter, u8 ChannelPlan, RT_CHANNEL_INFO *channel return chanset_size; } - _rtw_memset(channel_set, 0, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM); + memset(channel_set, 0, sizeof(RT_CHANNEL_INFO) * MAX_CHANNEL_NUM); if (IsSupported24G(regsty->wireless_mode) && hal_chk_band_cap(padapter, BAND_CAP_2G)) b2_4GBand = _TRUE; diff --git a/core/rtw_cmd.c b/core/rtw_cmd.c index 3073725..8887653 100644 --- a/core/rtw_cmd.c +++ b/core/rtw_cmd.c @@ -851,7 +851,7 @@ void rtw_init_sitesurvey_parm(_adapter *padapter, struct sitesurvey_parm *pparm) struct mlme_priv *pmlmepriv = &padapter->mlmepriv; - _rtw_memset(pparm, 0, sizeof(struct sitesurvey_parm)); + memset(pparm, 0, sizeof(struct sitesurvey_parm)); pparm->scan_mode = pmlmepriv->scan_mode; } @@ -1438,7 +1438,7 @@ u8 rtw_joinbss_cmd(_adapter *padapter, struct wlan_network *pnetwork) goto exit; } - _rtw_memset(psecnetwork, 0, t_len); + memset(psecnetwork, 0, t_len); _rtw_memcpy(psecnetwork, &pnetwork->network, get_WLAN_BSSID_EX_sz(&pnetwork->network)); diff --git a/core/rtw_debug.c b/core/rtw_debug.c index 31e5de9..3c79e79 100644 --- a/core/rtw_debug.c +++ b/core/rtw_debug.c @@ -530,7 +530,7 @@ void dump_adapters_status(void *sel, struct dvobj_priv *dvobj) iface = dvobj->padapters[i]; if (iface) { #if (defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN)) || defined(CONFIG_CLIENT_PORT_CFG) - _rtw_memset(&str_val, '\0', sizeof(str_val)); + memset(&str_val, '\0', sizeof(str_val)); #endif #if defined(CONFIG_SUPPORT_MULTI_BCN) && defined(CONFIG_FW_HANDLE_TXBCN) if (MLME_IS_AP(iface) || MLME_IS_MESH(iface)) { @@ -541,7 +541,7 @@ void dump_adapters_status(void *sel, struct dvobj_priv *dvobj) len = snprintf(tmp_str, sizeof(tmp_str), "%s", "ap_id:"); strncpy(p, tmp_str, len); p += len; - _rtw_memset(&tmp_str, '\0', sizeof(tmp_str)); + memset(&tmp_str, '\0', sizeof(tmp_str)); #ifdef DBG_HW_PORT len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->vap_id, iface->hw_port, iface->client_port); #else @@ -559,7 +559,7 @@ void dump_adapters_status(void *sel, struct dvobj_priv *dvobj) len = snprintf(tmp_str, sizeof(tmp_str), "%s", "c_pid:"); strncpy(p, tmp_str, len); p += len; - _rtw_memset(&tmp_str, '\0', sizeof(tmp_str)); + memset(&tmp_str, '\0', sizeof(tmp_str)); #ifdef DBG_HW_PORT len = snprintf(tmp_str, sizeof(tmp_str), "%d (%d,%d)", iface->client_port, iface->hw_port, iface->client_port); #else @@ -932,13 +932,13 @@ int proc_get_tx_stat(struct seq_file *m, void *v) } else { //to avoid c2h modify counters pstapriv_primary->gotc2h = NULL; - _rtw_memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN); + memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN); pstapriv_primary->c2h_adapter_id = CONFIG_IFACE_NUMBER; RTW_PRINT_SEL(m, "Warming : Query timeout, operation abort!!\n"); break; } pstapriv_primary->gotc2h = NULL; - _rtw_memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN); + memset(pstapriv_primary->c2h_sta_mac, 0, ETH_ALEN); pstapriv_primary->c2h_adapter_id = CONFIG_IFACE_NUMBER; } return 0; @@ -2273,7 +2273,7 @@ ssize_t proc_set_ps_dbg_info(struct file *file, const char __user *buffer, size_ int num = sscanf(tmp, "%hhx", &ps_dbg_cmd_id); if (num == 1 && ps_dbg_cmd_id == 1) /*Clean all*/ - _rtw_memset(pdbgpriv, 0, sizeof(struct debug_priv)); + memset(pdbgpriv, 0, sizeof(struct debug_priv)); } @@ -3924,9 +3924,9 @@ ssize_t proc_set_btcoex_dbg(struct file *file, const char __user *buffer, size_t num = sscanf(tmp, "%x %x", module, module + 1); if (1 == num) { if (0 == module[0]) - _rtw_memset(module, 0, sizeof(module)); + memset(module, 0, sizeof(module)); else - _rtw_memset(module, 0xFF, sizeof(module)); + memset(module, 0xFF, sizeof(module)); } else if (2 != num) { RTW_INFO(FUNC_ADPT_FMT ": input(\"%s\") format incorrect!\n", FUNC_ADPT_ARG(padapter), tmp); @@ -4552,7 +4552,7 @@ int proc_get_pattern_info(struct seq_file *m, void *v) p_str = str_1; max_len = sizeof(str_1); for (i = 0 ; i < MAX_WKFM_PATTERN_SIZE / 8 ; i++) { - _rtw_memset(p_str, 0, max_len); + memset(p_str, 0, max_len); len = 0; for (j = 0 ; j < 8 ; j++) { val8 = pwrpriv->patterns[k].content[i * 8 + j]; @@ -4563,7 +4563,7 @@ int proc_get_pattern_info(struct seq_file *m, void *v) } RTW_PRINT_SEL(m, "\npattern mask:\n"); for (i = 0 ; i < MAX_WKFM_SIZE / 8 ; i++) { - _rtw_memset(p_str, 0, max_len); + memset(p_str, 0, max_len); len = 0; for (j = 0 ; j < 8 ; j++) { val8 = pwrpriv->patterns[k].mask[i * 8 + j]; @@ -6980,7 +6980,7 @@ inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, } if (p != &str_out[0]) { _RTW_STR_DUMP_SEL(sel, str_out); - _rtw_memset(&str_out, '\0', sizeof(str_out)); + memset(&str_out, '\0', sizeof(str_out)); } /*dump buffer*/ @@ -7005,7 +7005,7 @@ inline void RTW_BUF_DUMP_SEL(uint _loglevel, void *sel, u8 *_titlestring, p += len; } _RTW_STR_DUMP_SEL(sel, str_out); - _rtw_memset(&str_out, '\0', sizeof(str_out)); + memset(&str_out, '\0', sizeof(str_out)); } p = &str_out[0]; diff --git a/core/rtw_ieee80211.c b/core/rtw_ieee80211.c index 33b05c4..f8003bb 100644 --- a/core/rtw_ieee80211.c +++ b/core/rtw_ieee80211.c @@ -457,7 +457,7 @@ exit: void rtw_set_supported_rate(u8 *SupportedRates, uint mode) { - _rtw_memset(SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); + memset(SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); switch (mode) { case WIRELESS_11B: @@ -789,7 +789,7 @@ int rtw_rsne_info_parse(const u8 *ie, uint ie_len, struct rsne_info *info) const u8 *pos = ie; u16 cnt; - _rtw_memset(info, 0, sizeof(struct rsne_info)); + memset(info, 0, sizeof(struct rsne_info)); if (ie + ie_len < pos + 4) goto err; @@ -1304,7 +1304,7 @@ ParseRes rtw_ieee802_11_parse_elems(u8 *start, uint len, u8 *pos = start; int unknown = 0; - _rtw_memset(elems, 0, sizeof(*elems)); + memset(elems, 0, sizeof(*elems)); while (left >= 2) { u8 id, elen; @@ -2206,7 +2206,7 @@ uint rtw_del_p2p_ie(u8 *ies, uint ies_len_ori, const char *msg) } _rtw_memmove(target_ie, next_ie, remain_len); - _rtw_memset(target_ie + remain_len, 0, target_ie_len); + memset(target_ie + remain_len, 0, target_ie_len); ies_len -= target_ie_len; if (DBG_DEL_P2P_IE && msg) { @@ -2247,7 +2247,7 @@ uint rtw_del_p2p_attr(u8 *ie, uint ielen_ori, u8 attr_id) } _rtw_memmove(target_attr, next_attr, remain_len); - _rtw_memset(target_attr + remain_len, 0, target_attr_len); + memset(target_attr + remain_len, 0, target_attr_len); *(ie + 1) -= target_attr_len; ielen -= target_attr_len; @@ -2317,7 +2317,7 @@ void rtw_bss_ex_del_p2p_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) u8 *next_ie = ie + ie_len; _rtw_memmove(next_ie, next_ie_ori, remain_len); - _rtw_memset(next_ie + remain_len, 0, ie_len_ori - ie_len); + memset(next_ie + remain_len, 0, ie_len_ori - ie_len); bss_ex->IELength -= ie_len_ori - ie_len; ies = next_ie; @@ -2533,7 +2533,7 @@ uint rtw_del_wfd_ie(u8 *ies, uint ies_len_ori, const char *msg) } _rtw_memmove(target_ie, next_ie, remain_len); - _rtw_memset(target_ie + remain_len, 0, target_ie_len); + memset(target_ie + remain_len, 0, target_ie_len); ies_len -= target_ie_len; if (DBG_DEL_WFD_IE && msg) { @@ -2574,7 +2574,7 @@ uint rtw_del_wfd_attr(u8 *ie, uint ielen_ori, u8 attr_id) } _rtw_memmove(target_attr, next_attr, remain_len); - _rtw_memset(target_attr + remain_len, 0, target_attr_len); + memset(target_attr + remain_len, 0, target_attr_len); *(ie + 1) -= target_attr_len; ielen -= target_attr_len; @@ -2643,7 +2643,7 @@ void rtw_bss_ex_del_wfd_attr(WLAN_BSSID_EX *bss_ex, u8 attr_id) u8 *next_ie = ie + ie_len; _rtw_memmove(next_ie, next_ie_ori, remain_len); - _rtw_memset(next_ie + remain_len, 0, ie_len_ori - ie_len); + memset(next_ie + remain_len, 0, ie_len_ori - ie_len); bss_ex->IELength -= ie_len_ori - ie_len; ies = next_ie; diff --git a/core/rtw_ioctl_query.c b/core/rtw_ioctl_query.c index 6f7613e..dacb006 100644 --- a/core/rtw_ioctl_query.c +++ b/core/rtw_ioctl_query.c @@ -77,7 +77,7 @@ u8 query_802_11_association_information(_adapter *padapter, PNDIS_802_11_ASSOCIA unsigned char i, *auth_ie, *supp_ie; /* NdisZeroMemory(pAssocInfo, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); */ - _rtw_memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); + memset(pAssocInfo, 0, sizeof(NDIS_802_11_ASSOCIATION_INFORMATION)); /* pAssocInfo->Length = sizeof(NDIS_802_11_ASSOCIATION_INFORMATION); */ /* ------------------------------------------------------ */ diff --git a/core/rtw_ioctl_set.c b/core/rtw_ioctl_set.c index 0cda79f..9ac1e18 100644 --- a/core/rtw_ioctl_set.c +++ b/core/rtw_ioctl_set.c @@ -145,7 +145,7 @@ u8 rtw_do_join(_adapter *padapter) pibss = padapter->registrypriv.dev_network.MacAddress; - _rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID)); rtw_update_registrypriv_dev_network(padapter); @@ -327,7 +327,7 @@ handle_tkip_countermeasure: goto release_mlme_lock; } - _rtw_memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN); pmlmepriv->assoc_by_bssid = _TRUE; @@ -488,7 +488,7 @@ handle_tkip_countermeasure: if (ssid && ssid_valid) _rtw_memcpy(&pmlmepriv->assoc_ssid, ssid, sizeof(NDIS_802_11_SSID)); else - _rtw_memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); if (bssid && bssid_valid) { _rtw_memcpy(&pmlmepriv->assoc_bssid, bssid, ETH_ALEN); diff --git a/core/rtw_mi.c b/core/rtw_mi.c index 2a9adde..3e22054 100644 --- a/core/rtw_mi.c +++ b/core/rtw_mi.c @@ -189,7 +189,7 @@ void rtw_mi_status_by_ifbmp(struct dvobj_priv *dvobj, u8 ifbmp, struct mi_state _adapter *iface; int i; - _rtw_memset(mstate, 0, sizeof(struct mi_state)); + memset(mstate, 0, sizeof(struct mi_state)); for (i = 0; i < dvobj->iface_nums; i++) { iface = dvobj->padapters[i]; @@ -949,25 +949,25 @@ static void rtw_dbg_dump_fwstate(_adapter *padapter, sint state) u8 buf[32] = {0}; if (state & WIFI_FW_NULL_STATE) { - _rtw_memset(buf, 0, 32); + memset(buf, 0, 32); sprintf(buf, "WIFI_FW_NULL_STATE"); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); } if (state & _FW_LINKED) { - _rtw_memset(buf, 0, 32); + memset(buf, 0, 32); sprintf(buf, "_FW_LINKED"); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); } if (state & _FW_UNDER_LINKING) { - _rtw_memset(buf, 0, 32); + memset(buf, 0, 32); sprintf(buf, "_FW_UNDER_LINKING"); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); } if (state & _FW_UNDER_SURVEY) { - _rtw_memset(buf, 0, 32); + memset(buf, 0, 32); sprintf(buf, "_FW_UNDER_SURVEY"); RTW_INFO(FUNC_ADPT_FMT"fwstate-%s\n", FUNC_ADPT_ARG(padapter), buf); } diff --git a/core/rtw_mlme.c b/core/rtw_mlme.c index f3c9b48..d0be290 100644 --- a/core/rtw_mlme.c +++ b/core/rtw_mlme.c @@ -48,7 +48,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter) /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ - /* _rtw_memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */ + /* memset((u8 *)pmlmepriv, 0, sizeof(struct mlme_priv)); */ /*qos_priv*/ @@ -72,7 +72,7 @@ sint _rtw_init_mlme_priv(_adapter *padapter) set_scanned_network_val(pmlmepriv, 0); - _rtw_memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&pmlmepriv->assoc_ssid, 0, sizeof(NDIS_802_11_SSID)); if (padapter->registrypriv.max_bss_cnt != 0) pmlmepriv->max_bss_cnt = padapter->registrypriv.max_bss_cnt; @@ -1346,7 +1346,7 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf) _clr_fwstate_(pmlmepriv, _FW_UNDER_SURVEY); - _rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID)); rtw_update_registrypriv_dev_network(adapter); @@ -1388,7 +1388,7 @@ void rtw_surveydone_event_callback(_adapter *adapter, u8 *pbuf) rtw_set_to_roam(adapter, 0); #ifdef CONFIG_INTEL_WIDI if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { - _rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); + memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0); RTW_INFO("change to widi listen\n"); } @@ -1754,7 +1754,7 @@ void rtw_indicate_connect(_adapter *padapter) rtw_set_to_roam(padapter, 0); #ifdef CONFIG_INTEL_WIDI if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { - _rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); + memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0); RTW_INFO("change to widi listen\n"); } @@ -2048,9 +2048,9 @@ static struct sta_info *rtw_joinbss_update_stainfo(_adapter *padapter, struct wl psta->ieee8021x_blocked = _TRUE; psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; - _rtw_memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype)); - _rtw_memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype)); - _rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype)); + memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype)); + memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype)); + memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype)); } /* Commented by Albert 2012/07/21 */ @@ -2625,7 +2625,7 @@ void rtw_sta_timeout_event_callback(_adapter *adapter, u8 *pbuf) #ifdef CONFIG_RTW_80211R void rtw_ft_info_init(struct ft_roam_info *pft) { - _rtw_memset(pft, 0, sizeof(struct ft_roam_info)); + memset(pft, 0, sizeof(struct ft_roam_info)); pft->ft_flags = 0 | RTW_FT_EN | RTW_FT_OTD_EN @@ -2680,9 +2680,9 @@ void rtw_ft_update_stainfo(_adapter *padapter, WLAN_BSSID_EX *pnetwork) psta->ieee8021x_blocked = _TRUE; psta->dot118021XPrivacy = padapter->securitypriv.dot11PrivacyAlgrthm; - _rtw_memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype)); - _rtw_memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype)); - _rtw_memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype)); + memset((u8 *)&psta->dot118021x_UncstKey, 0, sizeof(union Keytype)); + memset((u8 *)&psta->dot11tkiprxmickey, 0, sizeof(union Keytype)); + memset((u8 *)&psta->dot11tkiptxmickey, 0, sizeof(union Keytype)); } } @@ -2698,7 +2698,7 @@ void rtw_ft_reassoc_event_callback(_adapter *padapter, u8 *pbuf) struct cfg80211_ft_event_params ft_evt_parms; _irqL irqL; - _rtw_memset(&ft_evt_parms, 0, sizeof(ft_evt_parms)); + memset(&ft_evt_parms, 0, sizeof(ft_evt_parms)); rtw_ft_update_stainfo(padapter, pnetwork); ft_evt_parms.ies_len = pft_roam->ft_event.ies_len; ft_evt_parms.ies = rtw_zmalloc(ft_evt_parms.ies_len); @@ -2733,9 +2733,9 @@ void rtw_roam_nb_info_init(_adapter *padapter) { struct roam_nb_info *pnb = &(padapter->mlmepriv.nb_info); - _rtw_memset(&pnb->nb_rpt, 0, sizeof(pnb->nb_rpt)); - _rtw_memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list)); - _rtw_memset(&pnb->roam_target_addr, 0, ETH_ALEN); + memset(&pnb->nb_rpt, 0, sizeof(pnb->nb_rpt)); + memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list)); + memset(&pnb->roam_target_addr, 0, ETH_ALEN); pnb->nb_rpt_valid = _FALSE; pnb->nb_rpt_ch_list_num = 0; pnb->preference_en = _FALSE; @@ -2968,7 +2968,7 @@ void rtw_stadel_event_callback(_adapter *adapter, u8 *pbuf) _rtw_memcpy(pdev_network, &tgt_network->network, get_WLAN_BSSID_EX_sz(&tgt_network->network)); - _rtw_memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&pdev_network->Ssid, 0, sizeof(NDIS_802_11_SSID)); _rtw_memcpy(&pdev_network->Ssid, &pmlmepriv->assoc_ssid, sizeof(NDIS_802_11_SSID)); rtw_update_registrypriv_dev_network(adapter); @@ -3063,7 +3063,7 @@ void rtw_join_timeout_handler(void *ctx) } else { #ifdef CONFIG_INTEL_WIDI if (adapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { - _rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); + memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); intel_widi_wk_cmd(adapter, INTEL_WIDI_LISTEN_WK, NULL, 0); RTW_INFO("change to widi listen\n"); } @@ -3443,7 +3443,7 @@ static void collect_traffic_statistics(_adapter *padapter) { struct dvobj_priv *pdvobjpriv = adapter_to_dvobj(padapter); - /*_rtw_memset(&pdvobjpriv->traffic_stat, 0, sizeof(struct rtw_traffic_statistics));*/ + /*memset(&pdvobjpriv->traffic_stat, 0, sizeof(struct rtw_traffic_statistics));*/ /* Tx bytes reset*/ pdvobjpriv->traffic_stat.tx_bytes = 0; @@ -3717,7 +3717,7 @@ int rtw_select_roaming_candidate(struct mlme_priv *mlme) mlme->roam_network = candidate; if (_rtw_memcmp(candidate->network.MacAddress, mlme->roam_tgt_addr, ETH_ALEN) == _TRUE) - _rtw_memset(mlme->roam_tgt_addr, 0, ETH_ALEN); + memset(mlme->roam_tgt_addr, 0, ETH_ALEN); } ret = _SUCCESS; @@ -3955,7 +3955,7 @@ sint rtw_set_auth(_adapter *adapter, struct security_priv *psecuritypriv) goto exit; } - _rtw_memset(psetauthparm, 0, sizeof(struct setauth_parm)); + memset(psetauthparm, 0, sizeof(struct setauth_parm)); psetauthparm->mode = (unsigned char)psecuritypriv->dot11AuthAlgrthm; pcmd->cmdcode = _SetAuth_CMD_; @@ -3992,7 +3992,7 @@ sint rtw_set_key(_adapter *adapter, struct security_priv *psecuritypriv, sint ke res = _FAIL; goto exit; } - _rtw_memset(psetkeyparm, 0, sizeof(struct setkey_parm)); + memset(psetkeyparm, 0, sizeof(struct setkey_parm)); if (psecuritypriv->dot11AuthAlgrthm == dot11AuthAlgrthm_8021X) { psetkeyparm->algorithm = (unsigned char)psecuritypriv->dot118021XGrpPrivacy; @@ -4637,7 +4637,7 @@ unsigned int rtw_restructure_ht_ie(_adapter *padapter, u8 *in_ie, u8 *out_ie, ui out_len = *pout_len; - _rtw_memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); + memset(&ht_capie, 0, sizeof(struct rtw_ieee80211_ht_cap)); ht_capie.cap_info = IEEE80211_HT_CAP_DSSSCCK40; diff --git a/core/rtw_mlme_ext.c b/core/rtw_mlme_ext.c index abd9796..ed31e1f 100644 --- a/core/rtw_mlme_ext.c +++ b/core/rtw_mlme_ext.c @@ -1091,7 +1091,7 @@ static void init_mlme_ext_priv_value(_adapter *padapter) pmlmeinfo->enc_algo = _NO_PRIVACY_; pmlmeinfo->authModeToggle = 0; - _rtw_memset(pmlmeinfo->chg_txt, 0, 128); + memset(pmlmeinfo->chg_txt, 0, 128); pmlmeinfo->slotTime = SHORT_SLOT_TIME; pmlmeinfo->preamble_mode = PREAMBLE_AUTO; @@ -1102,7 +1102,7 @@ static void init_mlme_ext_priv_value(_adapter *padapter) pmlmeext->action_public_dialog_token = 0xff; #ifdef ROKU_PRIVATE /*infra mode, used to store AP's info*/ - _rtw_memset(pmlmeinfo->SupportedRates_infra_ap, 0, NDIS_802_11_LENGTH_RATES_EX); + memset(pmlmeinfo->SupportedRates_infra_ap, 0, NDIS_802_11_LENGTH_RATES_EX); pmlmeinfo->ht_vht_received = 0; #endif /* ROKU_PRIVATE */ } @@ -1131,7 +1131,7 @@ int init_mlme_ext_priv(_adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ - /* _rtw_memset((u8 *)pmlmeext, 0, sizeof(struct mlme_ext_priv)); */ + /* memset((u8 *)pmlmeext, 0, sizeof(struct mlme_ext_priv)); */ pmlmeext->padapter = padapter; @@ -1625,7 +1625,7 @@ _continue: rtw_hal_set_odm_var(padapter, HAL_ODM_STA_INFO, psta, _TRUE); - _rtw_memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); + memset((void *)&psta->sta_stats, 0, sizeof(struct stainfo_stats)); _enter_critical_bh(&psta->lock, &irqL); psta->state |= _FW_LINKED; @@ -1871,7 +1871,7 @@ unsigned int OnBeacon(_adapter *padapter, union recv_frame *precv_frame) &recv_beacon, sizeof(recv_beacon)); } else { RTW_ERR("%s: get beacon keys failed\n", __func__); - _rtw_memset(&pmlmepriv->cur_beacon_keys, 0, sizeof(recv_beacon)); + memset(&pmlmepriv->cur_beacon_keys, 0, sizeof(recv_beacon)); } #ifdef CONFIG_BCN_CNT_CONFIRM_HDL pmlmepriv->new_beacon_cnts = 0; @@ -2218,7 +2218,7 @@ unsigned int OnAuth(_adapter *padapter, union recv_frame *precv_frame) /* prepare for the challenging txt... */ /* get_random_bytes((void *)pstat->chg_txt, 128); */ /* TODO: */ - _rtw_memset((void *)pstat->chg_txt, 78, 128); + memset((void *)pstat->chg_txt, 78, 128); #ifdef CONFIG_IEEE80211W if (pstat->bpairwise_key_installed != _TRUE && !(pstat->state & WIFI_FW_ASSOC_SUCCESS)) #endif /* CONFIG_IEEE80211W */ @@ -2284,7 +2284,7 @@ auth_fail: rtw_free_stainfo(padapter , pstat); pstat = &stat; - _rtw_memset((char *)pstat, '\0', sizeof(stat)); + memset((char *)pstat, '\0', sizeof(stat)); pstat->auth_seq = 2; _rtw_memcpy(pstat->cmn.mac_addr, sa, ETH_ALEN); @@ -3765,7 +3765,7 @@ void issue_p2p_GO_request(_adapter *padapter, u8 *raddr) pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -4164,7 +4164,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -4197,7 +4197,7 @@ void issue_p2p_GO_response(_adapter *padapter, u8 *raddr, u8 *frame_body, uint l rtw_get_wps_attr_content(wpsie, wpsielen, WPS_ATTR_DEVICE_PWID, (u8 *) &wps_devicepassword_id, &wps_devicepassword_id_len); wps_devicepassword_id = be16_to_cpu(wps_devicepassword_id); - _rtw_memset(wpsie, 0x00, 255); + memset(wpsie, 0x00, 255); wpsielen = 0; /* WPS Section */ @@ -4576,7 +4576,7 @@ void issue_p2p_GO_confirm(_adapter *padapter, u8 *raddr, u8 result) pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -4812,7 +4812,7 @@ void issue_p2p_invitation_request(_adapter *padapter, u8 *raddr) pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -5109,7 +5109,7 @@ void issue_p2p_invitation_response(_adapter *padapter, u8 *raddr, u8 dialogToken pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -5345,7 +5345,7 @@ void issue_p2p_provision_request(_adapter *padapter, u8 *pssid, u8 ussidlen, u8 pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -5483,7 +5483,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) pattrib->raid = rtw_get_mgntframe_raid(padapter, WIRELESS_11G); } - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -5641,7 +5641,7 @@ void issue_probersp_p2p(_adapter *padapter, unsigned char *da) /* Value: */ if (pwdinfo->external_uuid == 0) { - _rtw_memset(wpsie + wpsielen, 0x0, 16); + memset(wpsie + wpsielen, 0x0, 16); _rtw_memcpy(wpsie + wpsielen, mac, ETH_ALEN); } else _rtw_memcpy(wpsie + wpsielen, pwdinfo->uuid, 0x10); @@ -5811,7 +5811,7 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) pattrib->raid = rtw_get_mgntframe_raid(padapter, WIRELESS_11G); } - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -5901,7 +5901,7 @@ int _issue_probereq_p2p(_adapter *padapter, u8 *da, int wait_ack) /* Value: */ if (pwdinfo->external_uuid == 0) { - _rtw_memset(wpsie + wpsielen, 0x0, 16); + memset(wpsie + wpsielen, 0x0, 16); _rtw_memcpy(wpsie + wpsielen, mac, ETH_ALEN); } else _rtw_memcpy(wpsie + wpsielen, pwdinfo->uuid, 0x10); @@ -6212,7 +6212,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) switch (frame_body[6]) { /* OUI Subtype */ case P2P_GO_NEGO_REQ: { RTW_INFO("[%s] Got GO Nego Req Frame\n", __FUNCTION__); - _rtw_memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); + memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); if (rtw_p2p_chk_state(pwdinfo, P2P_STATE_RX_PROVISION_DIS_REQ)) rtw_p2p_set_state(pwdinfo, rtw_p2p_pre_state(pwdinfo)); @@ -6331,7 +6331,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) RTW_INFO("[%s] Malloc p2p ie fail\n", __FUNCTION__); goto exit; } - _rtw_memset(merged_p2pie, 0x00, merged_p2p_ielen); + memset(merged_p2pie, 0x00, merged_p2p_ielen); merged_p2p_ielen = rtw_p2p_merge_ies(frame_body + _PUBLIC_ACTION_IE_OFFSET_, len - _PUBLIC_ACTION_IE_OFFSET_, merged_p2pie); @@ -6355,7 +6355,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) if (invitation_flag & P2P_INVITATION_FLAGS_PERSISTENT) { /* Re-invoke the persistent group. */ - _rtw_memset(&group_id, 0x00, sizeof(struct group_id_info)); + memset(&group_id, 0x00, sizeof(struct group_id_info)); rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen); if (attr_contentlen) { if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) { @@ -6414,7 +6414,7 @@ unsigned int on_action_public_p2p(union recv_frame *precv_frame) } else { /* Received the invitation to join a P2P group. */ - _rtw_memset(&group_id, 0x00, sizeof(struct group_id_info)); + memset(&group_id, 0x00, sizeof(struct group_id_info)); rtw_get_p2p_attr_content(merged_p2pie, merged_p2p_ielen, P2P_ATTR_GROUP_ID, (u8 *) &group_id, &attr_contentlen); if (attr_contentlen) { if (_rtw_memcmp(group_id.go_device_addr, adapter_mac_addr(padapter), ETH_ALEN)) { @@ -6821,7 +6821,7 @@ static void rtw_wnm_btm_candidate_select(_adapter *padapter) , pnetwork->network.Configuration.DSConfig , (int)pnetwork->network.Rssi); } else - _rtw_memset(pnb->roam_target_addr,0, ETH_ALEN); + memset(pnb->roam_target_addr,0, ETH_ALEN); } u32 rtw_wnm_btm_candidates_survey( @@ -6841,7 +6841,7 @@ u32 rtw_wnm_btm_candidates_survey( } /*clean the status set last time*/ - _rtw_memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list)); + memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list)); pnb->nb_rpt_valid = _FALSE; if (!rtw_wnm_nb_elem_parsing( pframe, elem_len, from_btm, @@ -7047,7 +7047,7 @@ static void rtw_wnm_btm_req_hdr_parsing(u8* pframe, struct btm_req_hdr *phdr) if (!pframe || !phdr) return; - _rtw_memset(phdr, 0, sizeof(struct btm_req_hdr)); + memset(phdr, 0, sizeof(struct btm_req_hdr)); phdr->req_mode = wnm_btm_req_mode(pframe); phdr->disassoc_timer = wnm_btm_disassoc_timer(pframe); phdr->validity_interval = wnm_btm_valid_interval(pframe); @@ -7113,7 +7113,7 @@ void rtw_wnm_process_btm_req(_adapter *padapter, u8* pframe, u32 frame_len) void rtw_wnm_reset_btm_candidate(struct roam_nb_info *pnb) { pnb->preference_en = _FALSE; - _rtw_memset(pnb->roam_target_addr, 0, ETH_ALEN); + memset(pnb->roam_target_addr, 0, ETH_ALEN); } void rtw_wnm_reset_btm_state(_adapter *padapter) @@ -7125,8 +7125,8 @@ void rtw_wnm_reset_btm_state(_adapter *padapter) pnb->nb_rpt_valid = _FALSE; pnb->nb_rpt_ch_list_num = 0; rtw_wnm_reset_btm_candidate(pnb); - _rtw_memset(&pnb->nb_rpt, 0, sizeof(pnb->nb_rpt)); - _rtw_memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list)); + memset(&pnb->nb_rpt, 0, sizeof(pnb->nb_rpt)); + memset(&pnb->nb_rpt_ch_list, 0, sizeof(pnb->nb_rpt_ch_list)); } void rtw_wnm_issue_action(_adapter *padapter, u8 action, u8 reason) @@ -7146,7 +7146,7 @@ void rtw_wnm_issue_action(_adapter *padapter, u8 action, u8 reason) pattrib = &(pmgntframe->attrib); update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, (WLANHDR_OFFSET + TXDESC_OFFSET)); + memset(pmgntframe->buf_addr, 0, (WLANHDR_OFFSET + TXDESC_OFFSET)); pframe = (u8 *)(pmgntframe->buf_addr + TXDESC_OFFSET); pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -7571,7 +7571,7 @@ void update_mgntframe_attrib(_adapter *padapter, struct pkt_attrib *pattrib) struct wifidirect_info *pwdinfo = &(padapter->wdinfo); #endif /* CONFIG_P2P_PS_NOA_USE_MACID_SLEEP */ - /* _rtw_memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib)); */ + /* memset((u8 *)(pattrib), 0, sizeof(struct pkt_attrib)); */ pattrib->hdrlen = 24; pattrib->nr_frags = 1; @@ -7766,7 +7766,7 @@ int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) break; } case 2: - _rtw_memset(&ssid_ie[2], 0, ssid_len_ori); + memset(&ssid_ie[2], 0, ssid_len_ori); break; default: break; @@ -7829,7 +7829,7 @@ void issue_beacon(_adapter *padapter, int timeout_ms) pattrib->mbssid = padapter->vap_id; #endif - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -8139,7 +8139,7 @@ void issue_probersp(_adapter *padapter, unsigned char *da, u8 is_valid_p2p_probe pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -8409,7 +8409,7 @@ int _issue_probereq(_adapter *padapter, const NDIS_802_11_SSID *pssid, const u8 update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -8598,7 +8598,7 @@ void issue_auth(_adapter *padapter, struct sta_info *psta, unsigned short status pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -8763,7 +8763,7 @@ void issue_asocrsp(_adapter *padapter, unsigned short status, struct sta_info *p update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -9000,7 +9000,7 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -9472,7 +9472,7 @@ static int _issue_nulldata(_adapter *padapter, unsigned char *da, unsigned int p update_mgntframe_attrib(padapter, pattrib); pattrib->retry_ctrl = _FALSE; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -9615,7 +9615,7 @@ static int _issue_qos_nulldata(_adapter *padapter, unsigned char *da, u16 tid, u pattrib->ack_policy = 0; pattrib->mdata = 0; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -9772,7 +9772,7 @@ static int _issue_deauth(_adapter *padapter, unsigned char *da, unsigned short r update_mgntframe_attrib(padapter, pattrib); pattrib->retry_ctrl = _FALSE; pattrib->key_type = key_type; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -9895,7 +9895,7 @@ void issue_action_spct_ch_switch(_adapter *padapter, u8 *ra, u8 new_ch, u8 ch_of pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -9967,7 +9967,7 @@ void issue_action_SA_Query(_adapter *padapter, unsigned char *raddr, unsigned ch pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); pattrib->key_type = key_type; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -10070,7 +10070,7 @@ static int issue_action_ba(_adapter *padapter, unsigned char *raddr, unsigned ch pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -10408,7 +10408,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -10443,7 +10443,7 @@ void issue_action_BSSCoexistPacket(_adapter *padapter) /* */ - _rtw_memset(ICS, 0, sizeof(ICS)); + memset(ICS, 0, sizeof(ICS)); if (pmlmepriv->num_sta_no_ht > 0) { int i; @@ -10558,7 +10558,7 @@ int _issue_action_SM_PS(_adapter *padapter , unsigned char *raddr , u8 NewMimoP pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -10927,7 +10927,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI return _FAIL; } - _rtw_memset(bssid, 0, sizeof(WLAN_BSSID_EX)); + memset(bssid, 0, sizeof(WLAN_BSSID_EX)); subtype = get_frame_sub_type(pframe); @@ -10990,7 +10990,7 @@ u8 collect_bss_info(_adapter *padapter, union recv_frame *precv_frame, WLAN_BSSI } else bssid->Ssid.SsidLength = 0; - _rtw_memset(bssid->SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); + memset(bssid->SupportedRates, 0, NDIS_802_11_LENGTH_RATES_EX); /* checking rate info... */ i = 0; @@ -11499,7 +11499,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) p = ie; ie += len; - _rtw_memset(country, 0, 4); + memset(country, 0, 4); _rtw_memcpy(country, p, 3); p += 3; RTW_INFO("%s: 802.11d country=%s\n", __FUNCTION__, country); @@ -11546,7 +11546,7 @@ static void process_80211d(PADAPTER padapter, WLAN_BSSID_EX *bssid) _RTW_INFO("}\n"); #endif - _rtw_memset(rfctl->channel_set, 0, sizeof(rfctl->channel_set)); + memset(rfctl->channel_set, 0, sizeof(rfctl->channel_set)); chplan_new = rfctl->channel_set; i = j = k = 0; @@ -12687,9 +12687,9 @@ void linked_status_chk_tdls(_adapter *padapter) #define ALIVE_MIN 2 #define ALIVE_MAX 5 - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); - _rtw_memset(checkalive, 0x00, sizeof(checkalive)); - _rtw_memset(teardown, 0x00, sizeof(teardown)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(checkalive, 0x00, sizeof(checkalive)); + memset(teardown, 0x00, sizeof(teardown)); if ((padapter->tdlsinfo.link_established == _TRUE)) { _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); @@ -12820,8 +12820,8 @@ void linked_status_chk(_adapter *padapter, u8 from_timer) if (rtw_gw_addr_query(padapter) == 0) pmlmepriv->bGetGateway = 0; else { - _rtw_memset(pmlmepriv->gw_ip, 0, 4); - _rtw_memset(pmlmepriv->gw_mac_addr, 0, ETH_ALEN); + memset(pmlmepriv->gw_ip, 0, 4); + memset(pmlmepriv->gw_mac_addr, 0, ETH_ALEN); } } #endif @@ -13276,7 +13276,7 @@ void rtw_ft_update_bcn(_adapter *padapter, union recv_frame *precv_frame) &recv_beacon, sizeof(recv_beacon)); } else { RTW_ERR("%s: get beacon keys failed\n", __func__); - _rtw_memset(&pmlmepriv->cur_beacon_keys, 0, sizeof(recv_beacon)); + memset(&pmlmepriv->cur_beacon_keys, 0, sizeof(recv_beacon)); } #ifdef CONFIG_BCN_CNT_CONFIRM_HDL pmlmepriv->new_beacon_cnts = 0; @@ -13493,7 +13493,7 @@ void rtw_ft_issue_action_req(_adapter *padapter, u8 *pTargetAddr) pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -13539,7 +13539,7 @@ void rtw_ft_report_evt(_adapter *padapter) struct cfg80211_ft_event_params ft_evt_parms; _irqL irqL; - _rtw_memset(&ft_evt_parms, 0, sizeof(ft_evt_parms)); + memset(&ft_evt_parms, 0, sizeof(ft_evt_parms)); rtw_ft_update_stainfo(padapter, pnetwork); if (!pnetwork) @@ -13985,7 +13985,7 @@ u8 join_cmd_hdl(_adapter *padapter, u8 *pbuf) pmlmeinfo->VHT_enable = 0; #ifdef ROKU_PRIVATE pmlmeinfo->ht_vht_received = 0; - _rtw_memset(pmlmeinfo->SupportedRates_infra_ap, 0, NDIS_802_11_LENGTH_RATES_EX); + memset(pmlmeinfo->SupportedRates_infra_ap, 0, NDIS_802_11_LENGTH_RATES_EX); #endif /* ROKU_PRIVATE */ _rtw_memcpy(pnetwork, pbuf, FIELD_OFFSET(WLAN_BSSID_EX, IELength)); pnetwork->IELength = ((WLAN_BSSID_EX *)pbuf)->IELength; @@ -14303,7 +14303,7 @@ u8 rtw_scan_sparse(_adapter *adapter, struct rtw_ieee80211_channel *ch, u8 ch_nu } } - _rtw_memset(&ch[k], 0, sizeof(struct rtw_ieee80211_channel)); + memset(&ch[k], 0, sizeof(struct rtw_ieee80211_channel)); ret_num = k; mlmeext->last_scan_time = rtw_get_current_time(); @@ -14388,7 +14388,7 @@ static int rtw_scan_ch_decision(_adapter *padapter, struct rtw_ieee80211_channel struct rf_ctl_t *rfctl = adapter_to_rfctl(padapter); /* clear first */ - _rtw_memset(out, 0, sizeof(struct rtw_ieee80211_channel) * out_num); + memset(out, 0, sizeof(struct rtw_ieee80211_channel) * out_num); /* acquire channels from in */ j = 0; @@ -15538,7 +15538,7 @@ u8 setkey_hdl(_adapter *padapter, u8 *pbuf) _rtw_camctl_chk_cap(padapter, SEC_CAP_CHK_BMC)) { struct set_stakey_parm sta_pparm; - _rtw_memset(&sta_pparm, 0, sizeof(struct set_stakey_parm)); + memset(&sta_pparm, 0, sizeof(struct set_stakey_parm)); sta_pparm.algorithm = pparm->algorithm; sta_pparm.keyid = pparm->keyid; _rtw_memcpy(sta_pparm.key, pparm->key, 16); @@ -16520,7 +16520,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) break; #ifdef CONFIG_TDLS_CH_SW case TDLS_CH_SW_RESP: - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.status_code = 0; _rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN); @@ -16597,8 +16597,8 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) _cancel_timer_ex(&ptdls_sta->stay_on_base_chnl_timer); _cancel_timer_ex(&ptdls_sta->ch_sw_monitor_timer); #if 0 - _rtw_memset(pHalData->tdls_ch_sw_iqk_info_base_chnl, 0x00, sizeof(pHalData->tdls_ch_sw_iqk_info_base_chnl)); - _rtw_memset(pHalData->tdls_ch_sw_iqk_info_off_chnl, 0x00, sizeof(pHalData->tdls_ch_sw_iqk_info_off_chnl)); + memset(pHalData->tdls_ch_sw_iqk_info_base_chnl, 0x00, sizeof(pHalData->tdls_ch_sw_iqk_info_base_chnl)); + memset(pHalData->tdls_ch_sw_iqk_info_off_chnl, 0x00, sizeof(pHalData->tdls_ch_sw_iqk_info_off_chnl)); #endif if (option == TDLS_CH_SW_END_TO_BASE_CHNL) @@ -16612,7 +16612,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) if (option == TDLS_CH_SW_TO_BASE_CHNL_UNSOLICITED) { if (ptdls_sta != NULL) { /* Send unsolicited channel switch rsp. to peer */ - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.status_code = 0; _rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN); issue_tdls_ch_switch_rsp(padapter, &txmgmt, _FALSE); @@ -16636,7 +16636,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) break; case TDLS_TEARDOWN_STA: case TDLS_TEARDOWN_STA_NO_WAIT: - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; _rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN); @@ -16651,7 +16651,7 @@ u8 tdls_hdl(_adapter *padapter, unsigned char *pbuf) TDLS_CH_SWITCH_ON_STATE | TDLS_PEER_AT_OFF_STATE); rtw_tdls_set_ch_sw_oper_control(padapter, _FALSE); - _rtw_memset(pchsw_info->addr, 0x00, ETH_ALEN); + memset(pchsw_info->addr, 0x00, ETH_ALEN); } #endif diff --git a/core/rtw_mp.c b/core/rtw_mp.c index 240508a..f7d221a 100644 --- a/core/rtw_mp.c +++ b/core/rtw_mp.c @@ -114,7 +114,7 @@ static void _init_mp_priv_(struct mp_priv *pmp_priv) { WLAN_BSSID_EX *pnetwork; - _rtw_memset(pmp_priv, 0, sizeof(struct mp_priv)); + memset(pmp_priv, 0, sizeof(struct mp_priv)); pmp_priv->mode = MP_OFF; @@ -275,15 +275,15 @@ static void mp_init_xmit_attrib(struct mp_tx *pmptx, PADAPTER padapter) /* init xmitframe attribute */ pattrib = &pmptx->attrib; - _rtw_memset(pattrib, 0, sizeof(struct pkt_attrib)); - _rtw_memset(pmptx->desc, 0, TXDESC_SIZE); + memset(pattrib, 0, sizeof(struct pkt_attrib)); + memset(pmptx->desc, 0, TXDESC_SIZE); pattrib->ether_type = 0x8712; #if 0 _rtw_memcpy(pattrib->src, adapter_mac_addr(padapter), ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); #endif - _rtw_memset(pattrib->dst, 0xFF, ETH_ALEN); + memset(pattrib->dst, 0xFF, ETH_ALEN); /* pattrib->dhcp_pkt = 0; * pattrib->pktlen = 0; */ @@ -831,7 +831,7 @@ void MPT_PwrCtlDM(PADAPTER padapter, u32 bstart) { struct txpwrtrack_cfg c; u1Byte chnl = 0 ; - _rtw_memset(&c, 0, sizeof(struct txpwrtrack_cfg)); + memset(&c, 0, sizeof(struct txpwrtrack_cfg)); configure_txpower_track(pDM_Odm, &c); odm_clear_txpowertracking_state(pDM_Odm); if (*c.odm_tx_pwr_track_set_pwr) { @@ -870,7 +870,7 @@ u32 mp_join(PADAPTER padapter, u8 mode) WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)(&(pmlmeinfo->network)); /* 1. initialize a new WLAN_BSSID_EX */ - _rtw_memset(&bssid, 0, sizeof(WLAN_BSSID_EX)); + memset(&bssid, 0, sizeof(WLAN_BSSID_EX)); RTW_INFO("%s ,pmppriv->network_macaddr=%x %x %x %x %x %x\n", __func__, pmppriv->network_macaddr[0], pmppriv->network_macaddr[1], pmppriv->network_macaddr[2], pmppriv->network_macaddr[3], pmppriv->network_macaddr[4], pmppriv->network_macaddr[5]); @@ -1084,7 +1084,7 @@ void mp_stop_test(PADAPTER padapter) init_fwstate(pmlmepriv, pmppriv->prev_fw_state); /* flush the cur_network */ - _rtw_memset(tgt_network, 0, sizeof(struct wlan_network)); + memset(tgt_network, 0, sizeof(struct wlan_network)); _clr_fwstate_(pmlmepriv, WIFI_MP_STATE); @@ -1975,7 +1975,7 @@ void SetPacketTx(PADAPTER padapter) pmp_priv->tx.buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(pmp_priv->tx.pallocated_buf), XMITBUF_ALIGN_SZ); ptr = pmp_priv->tx.buf; - _rtw_memset(pmp_priv->tx.desc, 0, TXDESC_SIZE); + memset(pmp_priv->tx.desc, 0, TXDESC_SIZE); pkt_start = ptr; pkt_end = pkt_start + pkt_size; @@ -2082,7 +2082,7 @@ void SetPacketTx(PADAPTER padapter) /* startPlace = (u32)(rtw_random32() % 3450); */ _rtw_memcpy(ptr, pmp_priv->TXradomBuffer, pkt_end - ptr); - /* _rtw_memset(ptr, payload, pkt_end - ptr); */ + /* memset(ptr, payload, pkt_end - ptr); */ rtw_mfree(pmp_priv->TXradomBuffer, 4096); /* 3 6. start thread */ @@ -3220,7 +3220,7 @@ void CCK_generator( CRC16_generator(crc16_out, crc16_in, 32); - _rtw_memset(pPMacTxInfo->CRC16, 0, 2); + memset(pPMacTxInfo->CRC16, 0, 2); ByteToBit(pPMacTxInfo->CRC16, crc16_out, 2); } @@ -3640,7 +3640,7 @@ void L_SIG_generator( sig_bi[i] = 0; /* dump_buf(sig_bi,24);*/ - _rtw_memset(pPMacTxInfo->LSIG, 0, 3); + memset(pPMacTxInfo->LSIG, 0, 3); ByteToBit(pPMacTxInfo->LSIG, (bool *)sig_bi, 3); } @@ -3730,7 +3730,7 @@ void HT_SIG_generator( for (i = 42; i < 48; i++) sig_bi[i] = 0; - _rtw_memset(pPMacTxInfo->HT_SIG, 0, 6); + memset(pPMacTxInfo->HT_SIG, 0, 6); ByteToBit(pPMacTxInfo->HT_SIG, sig_bi, 6); } @@ -3750,8 +3750,8 @@ void VHT_SIG_A_generator( UINT i; bool sig_bi[48], crc8[8]; - _rtw_memset(sig_bi, 0, 48); - _rtw_memset(crc8, 0, 8); + memset(sig_bi, 0, 48); + memset(crc8, 0, 8); /* BW Setting*/ for (i = 0; i < 2; i++) @@ -3798,7 +3798,7 @@ void VHT_SIG_A_generator( for (i = 42; i < 48; i++) sig_bi[i] = 0; - _rtw_memset(pPMacTxInfo->VHT_SIG_A, 0, 6); + memset(pPMacTxInfo->VHT_SIG_A, 0, 6); ByteToBit(pPMacTxInfo->VHT_SIG_A, sig_bi, 6); } @@ -3814,8 +3814,8 @@ void VHT_SIG_B_generator( UINT i, len, res, tail = 6, total_len, crc8_in_len; UINT sigb_len; - _rtw_memset(sig_bi, 0, 32); - _rtw_memset(crc8_bi, 0, 8); + memset(sig_bi, 0, 32); + memset(crc8_bi, 0, 8); /*Sounding Packet*/ if (pPMacTxInfo->NDP_sound == 1) { @@ -3867,7 +3867,7 @@ void VHT_SIG_B_generator( sig_bi[len + res + i] = 0; } - _rtw_memset(pPMacTxInfo->VHT_SIG_B, 0, 4); + memset(pPMacTxInfo->VHT_SIG_B, 0, 4); ByteToBit(pPMacTxInfo->VHT_SIG_B, sig_bi, 4); pPMacTxInfo->VHT_SIG_B_CRC = 0; @@ -3902,7 +3902,7 @@ void VHT_Delimiter_generator( for (j = 24; j < 32; j++) /* Delimiter[31:24]: Signature ('4E' in Hex, 78 in Dec)*/ sig_bi[j] = (78 >> (j - 24)) % 2; - _rtw_memset(pPMacTxInfo->VHT_Delimiter, 0, 4); + memset(pPMacTxInfo->VHT_Delimiter, 0, 4); ByteToBit(pPMacTxInfo->VHT_Delimiter, sig_bi, 4); } diff --git a/core/rtw_p2p.c b/core/rtw_p2p.c index 4f8bf5c..680590b 100644 --- a/core/rtw_p2p.c +++ b/core/rtw_p2p.c @@ -163,7 +163,7 @@ static void issue_group_disc_req(struct wifidirect_info *pwdinfo, u8 *da) pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -223,7 +223,7 @@ static void issue_p2p_devdisc_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 s pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -300,7 +300,7 @@ static void issue_p2p_provision_resp(struct wifidirect_info *pwdinfo, u8 *raddr, pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -404,7 +404,7 @@ static void issue_p2p_presence_resp(struct wifidirect_info *pwdinfo, u8 *da, u8 pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -601,7 +601,7 @@ u32 build_beacon_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -713,7 +713,7 @@ u32 build_probe_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -856,7 +856,7 @@ u32 build_probe_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf, u8 tunnel if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1010,7 +1010,7 @@ u32 build_assoc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1109,7 +1109,7 @@ u32 build_assoc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1208,7 +1208,7 @@ u32 build_nego_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1307,7 +1307,7 @@ u32 build_nego_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1407,7 +1407,7 @@ u32 build_nego_confirm_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1507,7 +1507,7 @@ u32 build_invitation_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1620,7 +1620,7 @@ u32 build_invitation_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1733,7 +1733,7 @@ u32 build_provdisc_req_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -1833,7 +1833,7 @@ u32 build_provdisc_resp_wfd_ie(struct wifidirect_info *pwdinfo, u8 *pbuf) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); wfdielen += ETH_ALEN; @@ -2701,7 +2701,7 @@ u8 process_p2p_group_negotation_req(struct wifidirect_info *pwdinfo, u8 *pframe, attr_contentlen = 0; if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) { if (attr_contentlen != ETH_ALEN) - _rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); + memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); } if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_CH_LIST, ch_content, &ch_cnt)) { @@ -2844,7 +2844,7 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe attr_contentlen = 0; if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_INTENDED_IF_ADDR, pwdinfo->p2p_peer_interface_addr, &attr_contentlen)) { if (attr_contentlen != ETH_ALEN) - _rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); + memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); } /* Try to get the peer's intent and tie breaker value. */ @@ -2949,7 +2949,7 @@ u8 process_p2p_group_negotation_resp(struct wifidirect_info *pwdinfo, u8 *pframe /* Try to get the group id information if peer is GO */ attr_contentlen = 0; - _rtw_memset(groupid, 0x00, 38); + memset(groupid, 0x00, 38); if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { _rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN); _rtw_memcpy(pwdinfo->groupid_info.ssid, &groupid[6], attr_contentlen - ETH_ALEN); @@ -3030,7 +3030,7 @@ u8 process_p2p_group_negotation_confirm(struct wifidirect_info *pwdinfo, u8 *pfr /* Try to get the group id information */ attr_contentlen = 0; - _rtw_memset(groupid, 0x00, 38); + memset(groupid, 0x00, 38); if (rtw_get_p2p_attr_content(p2p_ie, p2p_ielen, P2P_ATTR_GROUP_ID, groupid, &attr_contentlen)) { RTW_INFO("[%s] Ssid = %s, ssidlen = %zu\n", __FUNCTION__, &groupid[ETH_ALEN], strlen(&groupid[ETH_ALEN])); _rtw_memcpy(pwdinfo->groupid_info.go_device_addr, &groupid[0], ETH_ALEN); @@ -3903,7 +3903,7 @@ u8 *dump_p2p_attr_ch_list(u8 *p2p_ie, uint p2p_ielen, u8 *buf, u32 buf_len) attr_contentlen -= 3; - _rtw_memset(ch_list, 0, 40); + memset(ch_list, 0, 40); while (attr_contentlen > 0) { num_of_ch = *(pattr_temp + 1); @@ -4343,7 +4343,7 @@ void rtw_init_cfg80211_wifidirect_info(_adapter *padapter) { struct cfg80211_wifidirect_info *pcfg80211_wdinfo = &padapter->cfg80211_wdinfo; - _rtw_memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info)); + memset(pcfg80211_wdinfo, 0x00, sizeof(struct cfg80211_wifidirect_info)); rtw_init_timer(&pcfg80211_wdinfo->remain_on_ch_timer, padapter, ro_ch_timer_process, padapter); } @@ -4821,8 +4821,8 @@ int rtw_init_wifi_display_info(_adapter *padapter) pwfd_info->wfd_pc = _FALSE; /* Used in TDLS */ - _rtw_memset(pwfd_info->ip_address, 0x00, 4); - _rtw_memset(pwfd_info->peer_ip_address, 0x00, 4); + memset(pwfd_info->ip_address, 0x00, 4); + memset(pwfd_info->peer_ip_address, 0x00, 4); return res; } @@ -5109,32 +5109,32 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role) _rtw_memcpy((void *) pwdinfo->p2p_wildcard_ssid, "DIRECT-", 7); - _rtw_memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN); + memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN); pwdinfo->device_name_len = 0; - _rtw_memset(&pwdinfo->invitereq_info, 0x00, sizeof(struct tx_invite_req_info)); + memset(&pwdinfo->invitereq_info, 0x00, sizeof(struct tx_invite_req_info)); pwdinfo->invitereq_info.token = 3; /* Token used for P2P invitation request frame. */ - _rtw_memset(&pwdinfo->inviteresp_info, 0x00, sizeof(struct tx_invite_resp_info)); + memset(&pwdinfo->inviteresp_info, 0x00, sizeof(struct tx_invite_resp_info)); pwdinfo->inviteresp_info.token = 0; pwdinfo->profileindex = 0; - _rtw_memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM); + memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM); rtw_p2p_findphase_ex_set(pwdinfo, P2P_FINDPHASE_EX_NONE); pwdinfo->listen_dwell = (u8)((rtw_get_current_time() % 3) + 1); /* RTW_INFO( "[%s] listen_dwell time is %d00ms\n", __FUNCTION__, pwdinfo->listen_dwell ); */ - _rtw_memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info)); + memset(&pwdinfo->tx_prov_disc_info, 0x00, sizeof(struct tx_provdisc_req_info)); pwdinfo->tx_prov_disc_info.wps_config_method_request = WPS_CM_NONE; - _rtw_memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info)); + memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info)); pwdinfo->device_password_id_for_nego = WPS_DPID_PBC; pwdinfo->negotiation_dialog_token = 1; - _rtw_memset(pwdinfo->nego_ssid, 0x00, WLAN_SSID_MAXLEN); + memset(pwdinfo->nego_ssid, 0x00, WLAN_SSID_MAXLEN); pwdinfo->nego_ssidlen = 0; pwdinfo->ui_got_wps_info = P2P_NO_WPSINFO; @@ -5145,11 +5145,11 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role) pwdinfo->supported_wps_cm = WPS_CONFIG_METHOD_DISPLAY | WPS_CONFIG_METHOD_PBC | WPS_CONFIG_METHOD_KEYPAD; #endif /* CONFIG_WFD */ pwdinfo->channel_list_attr_len = 0; - _rtw_memset(pwdinfo->channel_list_attr, 0x00, 100); + memset(pwdinfo->channel_list_attr, 0x00, 100); - _rtw_memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, 0x00, 4); - _rtw_memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, '0', 3); - _rtw_memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); + memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, 0x00, 4); + memset(pwdinfo->rx_prov_disc_info.strconfig_method_desc_of_prov_disc_req, '0', 3); + memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); #ifdef CONFIG_CONCURRENT_MODE #ifdef CONFIG_IOCTL_CFG80211 pwdinfo->ext_listen_interval = 1000; /* The interval to be available with legacy AP during p2p0-find/scan */ @@ -5171,8 +5171,8 @@ void init_wifidirect_info(_adapter *padapter, enum P2P_ROLE role) #endif /* CONFIG_IOCTL_CFG80211 */ pwdinfo->wfd_tdls_enable = 0; - _rtw_memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); - _rtw_memset(pwdinfo->p2p_peer_device_addr, 0x00, ETH_ALEN); + memset(pwdinfo->p2p_peer_interface_addr, 0x00, ETH_ALEN); + memset(pwdinfo->p2p_peer_device_addr, 0x00, ETH_ALEN); pwdinfo->rx_invitereq_info.operation_ch[0] = 0; pwdinfo->rx_invitereq_info.operation_ch[1] = 0; /* Used to indicate the scan end in site survey function */ @@ -5415,10 +5415,10 @@ int rtw_p2p_enable(_adapter *padapter, enum P2P_ROLE role) rtw_p2p_set_state(pwdinfo, P2P_STATE_NONE); rtw_p2p_set_pre_state(pwdinfo, P2P_STATE_NONE); rtw_p2p_set_role(pwdinfo, P2P_ROLE_DISABLE); - _rtw_memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info)); + memset(&pwdinfo->rx_prov_disc_info, 0x00, sizeof(struct rx_provdisc_req_info)); /* Remove profiles in wifidirect_info structure. */ - _rtw_memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM); + memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM); pwdinfo->profileindex = 0; } diff --git a/core/rtw_pwrctrl.c b/core/rtw_pwrctrl.c index 431b8fb..e3445fd 100644 --- a/core/rtw_pwrctrl.c +++ b/core/rtw_pwrctrl.c @@ -2268,7 +2268,7 @@ void rtw_free_pwrctrl_priv(PADAPTER adapter) #endif - /* _rtw_memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */ + /* memset((unsigned char *)pwrctrlpriv, 0, sizeof(struct pwrctrl_priv)); */ #ifdef CONFIG_RESUME_IN_WORKQUEUE diff --git a/core/rtw_recv.c b/core/rtw_recv.c index ab9aa66..1c290b4 100644 --- a/core/rtw_recv.c +++ b/core/rtw_recv.c @@ -60,7 +60,7 @@ void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv) - _rtw_memset((u8 *)psta_recvpriv, 0, sizeof(struct sta_recv_priv)); + memset((u8 *)psta_recvpriv, 0, sizeof(struct sta_recv_priv)); _rtw_spinlock_init(&psta_recvpriv->lock); @@ -81,7 +81,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter) /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ - /* _rtw_memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */ + /* memset((unsigned char *)precvpriv, 0, sizeof (struct recv_priv)); */ _rtw_spinlock_init(&precvpriv->lock); @@ -116,7 +116,7 @@ sint _rtw_init_recv_priv(struct recv_priv *precvpriv, _adapter *padapter) res = _FAIL; goto exit; } - /* _rtw_memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); */ + /* memset(precvpriv->pallocated_frame_buf, 0, NR_RECVFRAME * sizeof(union recv_frame) + RXFRAME_ALIGN_SZ); */ precvpriv->precv_frame_buf = (u8 *)N_BYTE_ALIGMENT((SIZE_PTR)(precvpriv->pallocated_frame_buf), RXFRAME_ALIGN_SZ); /* precvpriv->precv_frame_buf = precvpriv->pallocated_frame_buf + RXFRAME_ALIGN_SZ - */ diff --git a/core/rtw_rm.c b/core/rtw_rm.c index d4c8019..8b44f6d 100644 --- a/core/rtw_rm.c +++ b/core/rtw_rm.c @@ -328,7 +328,7 @@ static u8 *build_wlan_hdr(_adapter *padapter, struct xmit_frame *pmgntframe, pattr = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattr); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -455,7 +455,7 @@ int rm_sitesurvey(struct rm_obj *prm) pch_set = &prm->q.ch_set[0]; - _rtw_memset(pch_set, 0, + memset(pch_set, 0, sizeof(struct rtw_ieee80211_channel) * MAX_OP_CHANNEL_SET_NUM); if (prm->q.ch_num == 0) { @@ -474,7 +474,7 @@ int rm_sitesurvey(struct rm_obj *prm) meas_ch_num = rm_get_ch_set(pch_set, op_class, ch_num); prm->q.ch_set_ch_amount = meas_ch_num; - _rtw_memset(&parm, 0, sizeof(struct sitesurvey_parm)); + memset(&parm, 0, sizeof(struct sitesurvey_parm)); _rtw_memcpy(parm.ch, pch_set, sizeof(struct rtw_ieee80211_channel) * MAX_OP_CHANNEL_SET_NUM); @@ -1488,7 +1488,7 @@ static int retrieve_scan_result(struct rm_obj *prm) MAC_ARG(pbss->MacAddress)); len = 0; - _rtw_memset(tmp_buf, 0, MAX_XMIT_EXTBUF_SZ); + memset(tmp_buf, 0, MAX_XMIT_EXTBUF_SZ); rm_gen_bcn_rep_ie(prm, tmp_buf, pnetwork, &len); new_packet: if (my_len == 0) { diff --git a/core/rtw_rm_fsm.c b/core/rtw_rm_fsm.c index 44c08b9..1378175 100644 --- a/core/rtw_rm_fsm.c +++ b/core/rtw_rm_fsm.c @@ -245,7 +245,7 @@ struct rm_obj *rm_alloc_rmobj(_adapter *padapter) if (prm == NULL) return NULL; - _rtw_memset(prm, 0, sizeof(struct rm_obj)); + memset(prm, 0, sizeof(struct rm_obj)); /* alloc timer */ if ((prm->pclock = rm_alloc_clock(padapter, prm)) == NULL) { diff --git a/core/rtw_rson.c b/core/rtw_rson.c index 4fbdbb5..0bb7cc2 100644 --- a/core/rtw_rson.c +++ b/core/rtw_rson.c @@ -77,7 +77,7 @@ void init_rtw_rson_data(struct dvobj_priv *dvobj) dvobj->rson_data.connectible = RTW_RSON_DENYCONNECT; #endif dvobj->rson_data.loading = 0; - _rtw_memset(dvobj->rson_data.res, 0xAA, sizeof(dvobj->rson_data.res)); + memset(dvobj->rson_data.res, 0xAA, sizeof(dvobj->rson_data.res)); } void rtw_rson_get_property_str(_adapter *padapter, char *rson_data_str) @@ -396,7 +396,7 @@ void rtw_rson_show_survey_info(struct seq_file *m, _list *plist, _list *phead) if (!pnetwork) break; - _rtw_memset(&rson_data, 0, sizeof(rson_data)); + memset(&rson_data, 0, sizeof(rson_data)); rson_score = 0; if (rtw_get_rson_struct(&(pnetwork->network), &rson_data) == _TRUE) rson_score = rtw_cal_rson_score(&rson_data, pnetwork->network.Rssi); @@ -432,7 +432,7 @@ u8 rtw_rson_ap_check_sta(_adapter *padapter, u8 *pframe, uint pkt_len, unsigned u8 *p; #ifndef CONFIG_RTW_REPEATER_SON_ROOT - _rtw_memset(&rson_target, 0, sizeof(rson_target)); + memset(&rson_target, 0, sizeof(rson_target)); for (p = pframe + WLAN_HDR_A3_LEN + ie_offset; ; p += (len + 2)) { p = rtw_get_ie(p, _VENDOR_SPECIFIC_IE_, &len, pkt_len - WLAN_HDR_A3_LEN - ie_offset); @@ -550,7 +550,7 @@ void rtw_rson_scan_cmd_hdl(_adapter *padapter, int op) rtw_set_to_roam(padapter, 0); #ifdef CONFIG_INTEL_WIDI if (padapter->mlmepriv.widi_state == INTEL_WIDI_STATE_ROAMING) { - _rtw_memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); + memset(pmlmepriv->sa_ext, 0x00, L2SDTA_SERVICE_VE_LEN); intel_widi_wk_cmd(padapter, INTEL_WIDI_LISTEN_WK, NULL, 0); RTW_INFO("change to widi listen\n"); } diff --git a/core/rtw_security.c b/core/rtw_security.c index af98bef..77fc297 100644 --- a/core/rtw_security.c +++ b/core/rtw_security.c @@ -1369,13 +1369,13 @@ static sint aes_cipher(u8 *key, uint hdrlen, frsubtype = frsubtype >> 4; - _rtw_memset((void *)mic_iv, 0, 16); - _rtw_memset((void *)mic_header1, 0, 16); - _rtw_memset((void *)mic_header2, 0, 16); - _rtw_memset((void *)ctr_preload, 0, 16); - _rtw_memset((void *)chain_buffer, 0, 16); - _rtw_memset((void *)aes_out, 0, 16); - _rtw_memset((void *)padded_buffer, 0, 16); + memset((void *)mic_iv, 0, 16); + memset((void *)mic_header1, 0, 16); + memset((void *)mic_header2, 0, 16); + memset((void *)ctr_preload, 0, 16); + memset((void *)chain_buffer, 0, 16); + memset((void *)aes_out, 0, 16); + memset((void *)padded_buffer, 0, 16); if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen == WLAN_HDR_A3_QOS_LEN)) a4_exists = 0; @@ -1675,13 +1675,13 @@ static sint aes_decipher(u8 *key, uint hdrlen, frsubtype = frsubtype >> 4; - _rtw_memset((void *)mic_iv, 0, 16); - _rtw_memset((void *)mic_header1, 0, 16); - _rtw_memset((void *)mic_header2, 0, 16); - _rtw_memset((void *)ctr_preload, 0, 16); - _rtw_memset((void *)chain_buffer, 0, 16); - _rtw_memset((void *)aes_out, 0, 16); - _rtw_memset((void *)padded_buffer, 0, 16); + memset((void *)mic_iv, 0, 16); + memset((void *)mic_header1, 0, 16); + memset((void *)mic_header2, 0, 16); + memset((void *)ctr_preload, 0, 16); + memset((void *)chain_buffer, 0, 16); + memset((void *)aes_out, 0, 16); + memset((void *)padded_buffer, 0, 16); /* start to decrypt the payload */ @@ -2082,7 +2082,7 @@ u32 rtw_BIP_verify(_adapter *padapter, u8 *whdr_pos, sint flen mme = BIP_AAD + ori_len - 18; /* clear the MIC field of MME to zero */ - _rtw_memset(mme + 10, 0, 8); + memset(mme + 10, 0, 8); /* conscruct AAD, copy frame control field */ _rtw_memcpy(BIP_AAD, &pwlanhdr->frame_ctl, 2); @@ -2377,7 +2377,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, * and text is the data being protected */ /* start out by storing key in ipad */ - _rtw_memset(k_pad, 0, sizeof(k_pad)); + memset(k_pad, 0, sizeof(k_pad)); _rtw_memcpy(k_pad, key, key_len); /* XOR key with ipad values */ for (i = 0; i < 64; i++) @@ -2392,7 +2392,7 @@ static void hmac_sha256_vector(u8 *key, size_t key_len, size_t num_elem, } sha256_vector(1 + num_elem, _addr, _len, mac); - _rtw_memset(k_pad, 0, sizeof(k_pad)); + memset(k_pad, 0, sizeof(k_pad)); _rtw_memcpy(k_pad, key, key_len); /* XOR key with opad values */ for (i = 0; i < 64; i++) @@ -2760,7 +2760,7 @@ static void gf_mulx(u8 *pad) static void aes_encrypt_deinit(void *ctx) { - _rtw_memset(ctx, 0, AES_PRIV_SIZE); + memset(ctx, 0, AES_PRIV_SIZE); rtw_mfree(ctx, AES_PRIV_SIZE); } @@ -2789,7 +2789,7 @@ static int omac1_aes_128_vector(const u8 *key, size_t num_elem, ctx = aes_encrypt_init(key, 16); if (ctx == NULL) return -1; - _rtw_memset(cbc, 0, AES_BLOCK_SIZE); + memset(cbc, 0, AES_BLOCK_SIZE); total_len = 0; for (e = 0; e < num_elem; e++) @@ -2814,7 +2814,7 @@ static int omac1_aes_128_vector(const u8 *key, size_t num_elem, left -= AES_BLOCK_SIZE; } - _rtw_memset(pad, 0, AES_BLOCK_SIZE); + memset(pad, 0, AES_BLOCK_SIZE); aes_128_encrypt(ctx, pad, pad); gf_mulx(pad); @@ -2859,7 +2859,7 @@ int omac1_aes_128(const u8 *key, const u8 *data, size_t data_len, u8 *mac) #ifdef CONFIG_RTW_MESH_AEK /* for AES-SIV */ -#define os_memset _rtw_memset +#define os_memset memset #define os_memcpy _rtw_memcpy #define os_malloc rtw_malloc #define bin_clear_free(bin, len) \ @@ -3181,7 +3181,7 @@ int wpa_tdls_ftie_mic(u8 *kck, u8 trans_seq, /* 7) FTIE, with the MIC field of the FTIE set to 0 */ _rtw_memcpy(pos, ftie, 2 + ftie[1]); _ftie = (struct wpa_tdls_ftie *) pos; - _rtw_memset(_ftie->mic, 0, TDLS_MIC_LEN); + memset(_ftie->mic, 0, TDLS_MIC_LEN); pos += 2 + ftie[1]; ret = omac1_aes_128(kck, buf, pos - buf, mic); @@ -3230,7 +3230,7 @@ int wpa_tdls_teardown_ftie_mic(u8 *kck, u8 *lnkid, u16 reason, /* 5) FTIE, with the MIC field of the FTIE set to 0 */ _rtw_memcpy(pos, ftie, 2 + ftie[1]); _ftie = (struct wpa_tdls_ftie *) pos; - _rtw_memset(_ftie->mic, 0, TDLS_MIC_LEN); + memset(_ftie->mic, 0, TDLS_MIC_LEN); pos += 2 + ftie[1]; ret = omac1_aes_128(kck, buf, pos - buf, mic); @@ -3280,7 +3280,7 @@ int tdls_verify_mic(u8 *kck, u8 trans_seq, _rtw_memcpy(pos, ftie, 2 + *(ftie + 1)); pos += 2; tmp_ftie = (u8 *)(pos + 2); - _rtw_memset(tmp_ftie, 0, 16); + memset(tmp_ftie, 0, 16); pos += *(ftie + 1); ret = omac1_aes_128(kck, buf, pos - buf, mic); diff --git a/core/rtw_sta_mgt.c b/core/rtw_sta_mgt.c index b166d9b..36972cb 100644 --- a/core/rtw_sta_mgt.c +++ b/core/rtw_sta_mgt.c @@ -37,7 +37,7 @@ struct st_register test_st_reg = { inline void rtw_st_ctl_init(struct st_ctl_t *st_ctl) { - _rtw_memset(st_ctl->reg, 0 , sizeof(struct st_register) * SESSION_TRACKER_REG_ID_NUM); + memset(st_ctl->reg, 0 , sizeof(struct st_register) * SESSION_TRACKER_REG_ID_NUM); _rtw_init_queue(&st_ctl->tracker_q); } @@ -200,7 +200,7 @@ void dump_st_ctl(void *sel, struct st_ctl_t *st_ctl) void _rtw_init_stainfo(struct sta_info *psta); void _rtw_init_stainfo(struct sta_info *psta) { - _rtw_memset((u8 *)psta, 0, sizeof(struct sta_info)); + memset((u8 *)psta, 0, sizeof(struct sta_info)); _rtw_spinlock_init(&psta->lock); _rtw_init_listhead(&psta->list); @@ -300,7 +300,7 @@ u32 _rtw_init_sta_priv(struct sta_priv *pstapriv) pstapriv->expire_to = 60;/* 60*2 = 120 sec = 2 min, expire after no any traffic. */ #endif #ifdef CONFIG_ATMEL_RC_PATCH - _rtw_memset(pstapriv->atmel_rc_pattern, 0, ETH_ALEN); + memset(pstapriv->atmel_rc_pattern, 0, ETH_ALEN); #endif pstapriv->max_num_sta = NUM_STA; @@ -506,7 +506,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr) for (i = 0; i < 16; i++) { _rtw_memcpy(&psta->sta_recvpriv.rxcache.tid_rxseq[i], &wRxSeqInitialValue, 2); _rtw_memcpy(&psta->sta_recvpriv.bmc_tid_rxseq[i], &wRxSeqInitialValue, 2); - _rtw_memset(&psta->sta_recvpriv.rxcache.iv[i], 0, sizeof(psta->sta_recvpriv.rxcache.iv[i])); + memset(&psta->sta_recvpriv.rxcache.iv[i], 0, sizeof(psta->sta_recvpriv.rxcache.iv[i])); } rtw_init_timer(&psta->addba_retry_timer, psta->padapter, addba_timer_hdl, psta); @@ -548,7 +548,7 @@ struct sta_info *rtw_alloc_stainfo(struct sta_priv *pstapriv, const u8 *hwaddr) #endif /* init for the sequence number of received management frame */ psta->RxMgmtFrameSeqNum = 0xffff; - _rtw_memset(&psta->sta_stats, 0, sizeof(struct stainfo_stats)); + memset(&psta->sta_stats, 0, sizeof(struct stainfo_stats)); rtw_alloc_macid(pstapriv->padapter, psta); @@ -1221,7 +1221,7 @@ void rtw_pre_link_sta_ctl_reset(struct sta_priv *stapriv) u8 addrs[RTW_PRE_LINK_STA_NUM][ETH_ALEN]; - _rtw_memset(addrs, 0, RTW_PRE_LINK_STA_NUM * ETH_ALEN); + memset(addrs, 0, RTW_PRE_LINK_STA_NUM * ETH_ALEN); _enter_critical_bh(&(pre_link_sta_ctl->lock), &irqL); for (i = 0; i < RTW_PRE_LINK_STA_NUM; i++) { diff --git a/core/rtw_tdls.c b/core/rtw_tdls.c index 08881dc..604cd35 100644 --- a/core/rtw_tdls.c +++ b/core/rtw_tdls.c @@ -89,7 +89,7 @@ int rtw_init_tdls_info(_adapter *padapter) void rtw_free_tdls_info(struct tdls_info *ptdlsinfo) { - _rtw_memset(ptdlsinfo, 0, sizeof(struct tdls_info)); + memset(ptdlsinfo, 0, sizeof(struct tdls_info)); } @@ -104,7 +104,7 @@ void rtw_free_all_tdls_sta(_adapter *padapter, u8 enqueue_cmd) struct sta_info *ptdls_sta[NUM_STA]; u8 empty_hwaddr[ETH_ALEN] = { 0x00 }; - _rtw_memset(ptdls_sta, 0x00, sizeof(ptdls_sta)); + memset(ptdls_sta, 0x00, sizeof(ptdls_sta)); _enter_critical_bh(&pstapriv->sta_hash_lock, &irqL); for (index = 0; index < NUM_STA; index++) { @@ -302,7 +302,7 @@ int _issue_nulldata_to_TDLS_peer_STA(_adapter *padapter, unsigned char *da, unsi pattrib->mdata = 0; pattrib->retry_ctrl = _FALSE; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -425,7 +425,7 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8 u8 cur_ldpc_cap = 0, cur_stbc_cap = 0, cur_beamform_cap = 0; /* Save HT capabilities in the sta object */ - _rtw_memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); + memset(&ptdls_sta->htpriv.ht_cap, 0, sizeof(struct rtw_ieee80211_ht_cap)); if (data && Length >= sizeof(struct rtw_ieee80211_ht_cap)) { ptdls_sta->flags |= WLAN_STA_HT; ptdls_sta->flags |= WLAN_STA_WME; @@ -537,7 +537,7 @@ void rtw_tdls_process_vht_cap(_adapter *padapter, struct sta_info *ptdls_sta, u8 u16 cur_beamform_cap = 0; u8 *pcap_mcs; - _rtw_memset(&ptdls_sta->vhtpriv, 0, sizeof(struct vht_priv)); + memset(&ptdls_sta->vhtpriv, 0, sizeof(struct vht_priv)); if (data && Length == 12) { ptdls_sta->flags |= WLAN_STA_VHT; @@ -1128,7 +1128,7 @@ int issue_tunneled_probe_req(_adapter *padapter) RTW_INFO("[%s]\n", __FUNCTION__); - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.action_code = TUNNELED_PROBE_REQ; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -1170,7 +1170,7 @@ int issue_tunneled_probe_rsp(_adapter *padapter, union recv_frame *precv_frame) RTW_INFO("[%s]\n", __FUNCTION__); - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.action_code = TUNNELED_PROBE_RSP; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -1520,7 +1520,7 @@ int issue_tdls_dis_rsp(_adapter *padapter, struct tdls_txmgmt *ptxmgmt, u8 priva pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -1609,7 +1609,7 @@ int issue_tdls_peer_traffic_indication(_adapter *padapter, struct sta_info *ptdl RTW_INFO("[TDLS] %s\n", __FUNCTION__); - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.action_code = TDLS_PEER_TRAFFIC_INDICATION; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -1662,7 +1662,7 @@ int issue_tdls_ch_switch_req(_adapter *padapter, struct sta_info *ptdls_sta) goto exit; } - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.action_code = TDLS_CHANNEL_SWITCH_REQUEST; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -1767,7 +1767,7 @@ int On_TDLS_Dis_Rsp(_adapter *padapter, union recv_frame *precv_frame) if (psta) rssi = psta->cmn.rssi_stat.rssi; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); /* WFDTDLS: for sigma test, not to setup direct link automatically */ ptdlsinfo->dev_discovered = _TRUE; @@ -1847,7 +1847,7 @@ sint On_TDLS_Setup_Req(_adapter *padapter, union recv_frame *precv_frame, struct if (rtw_tdls_is_setup_allowed(padapter) == _FALSE) goto exit; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); psa = get_sa(ptr); if (ptdlsinfo->sta_maximum == _TRUE) { @@ -2063,7 +2063,7 @@ int On_TDLS_Setup_Rsp(_adapter *padapter, union recv_frame *precv_frame, struct int ret = _SUCCESS; u32 timeout_interval = TDLS_TPK_RESEND_COUNT; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); psa = get_sa(ptr); ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; @@ -2352,7 +2352,7 @@ int On_TDLS_Dis_Req(_adapter *padapter, union recv_frame *precv_frame) if (rtw_tdls_is_driver_setup(padapter) == _FALSE) goto exit; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); ptr += prx_pkt_attrib->hdrlen + prx_pkt_attrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; txmgmt.dialog_token = *(ptr + 2); _rtw_memcpy(&txmgmt.peer, precv_frame->u.hdr.attrib.src, ETH_ALEN); @@ -2437,7 +2437,7 @@ int On_TDLS_Peer_Traffic_Indication(_adapter *padapter, union recv_frame *precv_ struct tdls_txmgmt txmgmt; ptr += pattrib->hdrlen + pattrib->iv_len + LLC_HEADER_SIZE + ETH_TYPE_LEN + PAYLOAD_TYPE_LEN; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); txmgmt.dialog_token = *(ptr + 2); issue_tdls_peer_traffic_rsp(padapter, ptdls_sta, &txmgmt); @@ -2771,7 +2771,7 @@ void wfd_ie_tdls(_adapter *padapter, u8 *pframe, u32 *pktlen) if (check_fwstate(pmlmepriv, _FW_LINKED) == _TRUE) _rtw_memcpy(wfdie + wfdielen, &pmlmepriv->assoc_bssid[0], ETH_ALEN); else - _rtw_memset(wfdie + wfdielen, 0x00, ETH_ALEN); + memset(wfdie + wfdielen, 0x00, ETH_ALEN); /* Local IP Address ATTR */ wfdie[wfdielen++] = WFD_ATTR_LOCAL_IP_ADDR; @@ -3289,7 +3289,7 @@ void _tdls_tpk_timer_hdl(void *FunctionContext) struct sta_info *ptdls_sta = (struct sta_info *)FunctionContext; struct tdls_txmgmt txmgmt; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); ptdls_sta->TPK_count++; /* TPK_timer expired in a second */ /* Retry timer should set at least 301 sec. */ @@ -3355,7 +3355,7 @@ void _tdls_handshake_timer_hdl(void *FunctionContext) _adapter *padapter = NULL; struct tdls_txmgmt txmgmt; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); _rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN); txmgmt.status_code = _RSON_TDLS_TEAR_UN_RSN_; @@ -3376,7 +3376,7 @@ void _tdls_pti_timer_hdl(void *FunctionContext) _adapter *padapter = NULL; struct tdls_txmgmt txmgmt; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); _rtw_memcpy(txmgmt.peer, ptdls_sta->cmn.mac_addr, ETH_ALEN); txmgmt.status_code = _RSON_TDLS_TEAR_TOOFAR_; @@ -3433,7 +3433,7 @@ void rtw_tdls_teardown_pre_hdl(_adapter *padapter, struct sta_info *psta) if (ptdlsinfo->sta_cnt < MAX_ALLOWED_TDLS_STA_NUM) { ptdlsinfo->sta_maximum = _FALSE; - _rtw_memset(&ptdlsinfo->ss_record, 0x00, sizeof(struct tdls_ss_record)); + memset(&ptdlsinfo->ss_record, 0x00, sizeof(struct tdls_ss_record)); } if (ptdlsinfo->sta_cnt == 0) diff --git a/core/rtw_vht.c b/core/rtw_vht.c index 9a7608c..66a40ec 100644 --- a/core/rtw_vht.c +++ b/core/rtw_vht.c @@ -741,7 +741,7 @@ u32 rtw_build_vht_operation_ie(_adapter *padapter, u8 *pbuf, u8 channel) u32 len = 0; u8 operation[5]; - _rtw_memset(operation, 0, 5); + memset(operation, 0, 5); bw_mode = REGSTY_BW_5G(pregistrypriv); /* TODO: control op bw with other info */ @@ -805,7 +805,7 @@ u32 rtw_build_vht_cap_ie(_adapter *padapter, u8 *pbuf) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); pcap = pvhtpriv->vht_cap; - _rtw_memset(pcap, 0, 32); + memset(pcap, 0, 32); /* B0 B1 Maximum MPDU Length */ rtw_hal_get_def_var(padapter, HAL_DEF_RX_PACKET_OFFSET, &rx_packet_offset); diff --git a/core/rtw_wapi.c b/core/rtw_wapi.c index 1c4279f..31f0f2b 100644 --- a/core/rtw_wapi.c +++ b/core/rtw_wapi.c @@ -201,7 +201,7 @@ u8 WapiGetEntryForCamClear(_adapter *padapter, u8 *pPeerMac, u8 keyid, u8 IsMsk) && pWapiInfo->wapiCamEntry[i].type == IsMsk) { pWapiInfo->wapiCamEntry[i].IsUsed = 0; pWapiInfo->wapiCamEntry[i].keyidx = 2; - _rtw_memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN); + memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN); WAPI_TRACE(WAPI_API, "<========== %s\n", __FUNCTION__); return pWapiInfo->wapiCamEntry[i].entry_idx; @@ -244,7 +244,7 @@ WapiResetAllCamEntry(_adapter *padapter) pWapiInfo = &padapter->wapiInfo; for (i = 0; i < WAPI_CAM_ENTRY_NUM; i++) { - _rtw_memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN); + memset(pWapiInfo->wapiCamEntry[i].PeerMacAddr, 0, ETH_ALEN); pWapiInfo->wapiCamEntry[i].IsUsed = 0; pWapiInfo->wapiCamEntry[i].keyidx = 2; /* invalid */ pWapiInfo->wapiCamEntry[i].entry_idx = 4 + i * 2; @@ -687,7 +687,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr) while (!list_empty(&(pWapiInfo->wapiBKIDStoreList))) { pWapiBkid = (PRT_WAPI_BKID)list_entry(pWapiInfo->wapiBKIDStoreList.next, RT_WAPI_BKID, list); list_del_init(&pWapiBkid->list); - _rtw_memset(pWapiBkid->bkid, 0, 16); + memset(pWapiBkid->bkid, 0, 16); list_add_tail(&pWapiBkid->list, &pWapiInfo->wapiBKIDIdleList); } } @@ -732,7 +732,7 @@ void rtw_wapi_return_one_sta_info(_adapter *padapter, u8 *MacAddr) if (_rtw_memcmp(pWapiStaInfo->PeerMacAddr, MacAddr, ETH_ALEN) == _TRUE) { pWapiStaInfo->bAuthenticateInProgress = false; pWapiStaInfo->bSetkeyOk = false; - _rtw_memset(pWapiStaInfo->PeerMacAddr, 0, ETH_ALEN); + memset(pWapiStaInfo->PeerMacAddr, 0, ETH_ALEN); list_del_init(&pWapiStaInfo->list); list_add_tail(&pWapiStaInfo->list, &pWapiInfo->wapiSTAIdleList); break; @@ -1163,7 +1163,7 @@ void rtw_wapi_get_iv(_adapter *padapter, u8 *pRA, u8 *IV) } else { if (list_empty(&pWapiInfo->wapiSTAUsedList)) { WAPI_TRACE(WAPI_RX, "rtw_wapi_get_iv: list is empty\n"); - _rtw_memset(IV, 10, 18); + memset(IV, 10, 18); return; } else { list_for_each_entry(pWapiSta, &pWapiInfo->wapiSTAUsedList, list) { diff --git a/core/rtw_wlan_util.c b/core/rtw_wlan_util.c index 43f2b9a..0582116 100644 --- a/core/rtw_wlan_util.c +++ b/core/rtw_wlan_util.c @@ -336,7 +336,7 @@ void get_rate_set(_adapter *padapter, unsigned char *pbssrate, int *bssrate_len) { unsigned char supportedrates[NumRates]; - _rtw_memset(supportedrates, 0, NumRates); + memset(supportedrates, 0, NumRates); *bssrate_len = ratetbl2rateset(padapter, supportedrates); _rtw_memcpy(pbssrate, supportedrates, *bssrate_len); } @@ -757,7 +757,7 @@ void invalidate_cam_all(_adapter *padapter) _enter_critical_bh(&cam_ctl->lock, &irqL); rtw_sec_cam_map_clr_all(&cam_ctl->used); - _rtw_memset(dvobj->cam_cache, 0, sizeof(struct sec_cam_ent) * SEC_CAM_ENT_NUM_SW_LIMIT); + memset(dvobj->cam_cache, 0, sizeof(struct sec_cam_ent) * SEC_CAM_ENT_NUM_SW_LIMIT); _exit_critical_bh(&cam_ctl->lock, &irqL); } @@ -821,7 +821,7 @@ void clear_cam_cache(_adapter *adapter, u8 id) _enter_critical_bh(&cam_ctl->lock, &irqL); - _rtw_memset(&(dvobj->cam_cache[id]), 0, sizeof(struct sec_cam_ent)); + memset(&(dvobj->cam_cache[id]), 0, sizeof(struct sec_cam_ent)); _exit_critical_bh(&cam_ctl->lock, &irqL); } @@ -2462,7 +2462,7 @@ int rtw_get_bcn_keys(ADAPTER *Adapter, u8 *pframe, u32 packet_len, unsigned char *pos; struct rtw_ieee802_11_elems elems; - _rtw_memset(recv_beacon, 0, sizeof(*recv_beacon)); + memset(recv_beacon, 0, sizeof(*recv_beacon)); /* checking capabilities */ capability = le16_to_cpu(*(unsigned short *)(pframe + WLAN_HDR_A3_LEN + 10)); @@ -3068,7 +3068,7 @@ void update_tx_basic_rate(_adapter *padapter, u8 wirelessmode) return; #endif /* CONFIG_INTEL_WIDI */ - _rtw_memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX); + memset(supported_rates, 0, NDIS_802_11_LENGTH_RATES_EX); /* clear B mod if current channel is in 5G band, avoid tx cck rate in 5G band. */ if (pmlmeext->cur_channel > 14) @@ -4187,7 +4187,7 @@ unsigned int setup_beacon_frame(_adapter *padapter, unsigned char *beacon_frame) WLAN_BSSID_EX *cur_network = &(pmlmeinfo->network); u8 bc_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff}; - _rtw_memset(beacon_frame, 0, 256); + memset(beacon_frame, 0, 256); pframe = beacon_frame + TXDESC_SIZE; @@ -4408,8 +4408,8 @@ void rtw_wow_pattern_sw_reset(_adapter *adapter) pwrctrlpriv->wowlan_pattern_idx = 0; for (i = 0 ; i < MAX_WKFM_CAM_NUM; i++) { - _rtw_memset(pwrctrlpriv->patterns[i].content, '\0', sizeof(pwrctrlpriv->patterns[i].content)); - _rtw_memset(pwrctrlpriv->patterns[i].mask, '\0', sizeof(pwrctrlpriv->patterns[i].mask)); + memset(pwrctrlpriv->patterns[i].content, '\0', sizeof(pwrctrlpriv->patterns[i].content)); + memset(pwrctrlpriv->patterns[i].mask, '\0', sizeof(pwrctrlpriv->patterns[i].mask)); pwrctrlpriv->patterns[i].len = 0; } } @@ -4436,9 +4436,9 @@ u8 rtw_set_default_pattern(_adapter *adapter) return 0; for (index = 0 ; index < DEFAULT_PATTERN_NUM ; index++) { - _rtw_memset(pwrpriv->patterns[index].content, 0, + memset(pwrpriv->patterns[index].content, 0, sizeof(pwrpriv->patterns[index].content)); - _rtw_memset(pwrpriv->patterns[index].mask, 0, + memset(pwrpriv->patterns[index].mask, 0, sizeof(pwrpriv->patterns[index].mask)); pwrpriv->patterns[index].len = 0; } @@ -4457,7 +4457,7 @@ u8 rtw_set_default_pattern(_adapter *adapter) /* TCP */ target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET); - _rtw_memset(target, 0x06, 1); + memset(target, 0x06, 1); target += (IP_OFFSET - PROTOCOL_OFFSET); @@ -4480,7 +4480,7 @@ u8 rtw_set_default_pattern(_adapter *adapter) /* ICMP */ target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET); - _rtw_memset(target, 0x01, 1); + memset(target, 0x01, 1); target += (IP_OFFSET - PROTOCOL_OFFSET); _rtw_memcpy(target, pmlmeinfo->ip_addr, @@ -4504,7 +4504,7 @@ u8 rtw_set_default_pattern(_adapter *adapter) /* ICMPv6 */ target += (IPv6_PROTOCOL_OFFSET - ETH_TYPE_OFFSET); - _rtw_memset(target, 0x3a, 1); + memset(target, 0x3a, 1); target += (IPv6_OFFSET - IPv6_PROTOCOL_OFFSET); _rtw_memcpy(target, pmlmeinfo->ip6_addr, @@ -4527,7 +4527,7 @@ u8 rtw_set_default_pattern(_adapter *adapter) /* UDP */ target += (PROTOCOL_OFFSET - ETH_TYPE_OFFSET); - _rtw_memset(target, 0x11, 1); + memset(target, 0x11, 1); target += (IP_OFFSET - PROTOCOL_OFFSET); _rtw_memcpy(target, &multicast_ip, @@ -4560,7 +4560,7 @@ void rtw_dump_priv_pattern(_adapter *adapter, u8 idx) p_str = str_1; max_len = sizeof(str_1); for (i = 0 ; i < MAX_WKFM_PATTERN_SIZE / 8 ; i++) { - _rtw_memset(p_str, 0, max_len); + memset(p_str, 0, max_len); len = 0; for (j = 0 ; j < 8 ; j++) { val8 = pwrctl->patterns[idx].content[i * 8 + j]; @@ -4572,7 +4572,7 @@ void rtw_dump_priv_pattern(_adapter *adapter, u8 idx) RTW_INFO(">>>priv_pattern_mask:\n"); for (i = 0 ; i < MAX_WKFM_SIZE / 8 ; i++) { - _rtw_memset(p_str, 0, max_len); + memset(p_str, 0, max_len); len = 0; for (j = 0 ; j < 8 ; j++) { val8 = pwrctl->patterns[idx].mask[i * 8 + j]; @@ -4600,7 +4600,7 @@ void rtw_get_sec_iv(PADAPTER padapter, u8 *pcur_dot11txpn, u8 *StaAddr) struct sta_info *psta; struct security_priv *psecpriv = &padapter->securitypriv; - _rtw_memset(pcur_dot11txpn, 0, 8); + memset(pcur_dot11txpn, 0, 8); if (NULL == StaAddr) return; psta = rtw_get_stainfo(&padapter->stapriv, StaAddr); diff --git a/core/rtw_xmit.c b/core/rtw_xmit.c index fc86341..fb99327 100644 --- a/core/rtw_xmit.c +++ b/core/rtw_xmit.c @@ -37,7 +37,7 @@ void _rtw_init_sta_xmit_priv(struct sta_xmit_priv *psta_xmitpriv) { - _rtw_memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv)); + memset((unsigned char *)psta_xmitpriv, 0, sizeof(struct sta_xmit_priv)); _rtw_spinlock_init(&psta_xmitpriv->lock); @@ -72,7 +72,7 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, _adapter *padapter) /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ - /* _rtw_memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */ + /* memset((unsigned char *)pxmitpriv, 0, sizeof(struct xmit_priv)); */ _rtw_spinlock_init(&pxmitpriv->lock); _rtw_spinlock_init(&pxmitpriv->lock_sctx); @@ -969,8 +969,8 @@ static s32 update_attrib_sec_info(_adapter *padapter, struct pkt_attrib *pattrib struct security_priv *psecuritypriv = &padapter->securitypriv; sint bmcast = IS_MCAST(pattrib->ra); - _rtw_memset(pattrib->dot118021x_UncstKey.skey, 0, 16); - _rtw_memset(pattrib->dot11tkiptxmickey.skey, 0, 16); + memset(pattrib->dot118021x_UncstKey.skey, 0, 16); + memset(pattrib->dot11tkiptxmickey.skey, 0, 16); pattrib->mac_id = psta->cmn.mac_id; if (psta->ieee8021x_blocked == _TRUE) { @@ -1766,7 +1766,7 @@ s32 rtw_make_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattrib) } */ - _rtw_memset(hdr, 0, WLANHDR_OFFSET); + memset(hdr, 0, WLANHDR_OFFSET); set_frame_sub_type(fctrl, pattrib->subtype); @@ -2081,7 +2081,7 @@ s32 rtw_make_tdls_wlanhdr(_adapter *padapter , u8 *hdr, struct pkt_attrib *pattr u16 *fctrl = &pwlanhdr->frame_ctl; - _rtw_memset(hdr, 0, WLANHDR_OFFSET); + memset(hdr, 0, WLANHDR_OFFSET); set_frame_sub_type(fctrl, pattrib->subtype); @@ -2474,7 +2474,7 @@ s32 rtw_xmitframe_coalesce_amsdu(_adapter *padapter, struct xmit_frame *pxmitfra if(padding == 4) padding = 0; - //_rtw_memset(pframe,0xaa, padding); + //memset(pframe,0xaa, padding); pframe += padding; pattrib->last_txcmdsz += ETH_HLEN + XATTRIB_GET_MCTRL_LEN(pattrib_queue) + llc_sz + mem_sz + padding ; @@ -2889,7 +2889,7 @@ s32 rtw_mgmt_xmitframe_coalesce(_adapter *padapter, _pkt *pkt, struct xmit_frame } #endif - _rtw_memset(MME, 0, _MME_IE_LENGTH_); + memset(MME, 0, _MME_IE_LENGTH_); MGMT_body = pframe + sizeof(struct rtw_ieee80211_hdr_3addr); pframe += pattrib->pktlen; @@ -3257,7 +3257,7 @@ struct xmit_frame *__rtw_alloc_cmdxmitframe(struct xmit_priv *pxmitpriv, pcmdframe->buf_addr = pxmitbuf->pbuf; /* initial memory to zero */ - _rtw_memset(pcmdframe->buf_addr, 0, MAX_CMDBUF_SZ); + memset(pcmdframe->buf_addr, 0, MAX_CMDBUF_SZ); pxmitbuf->priv_data = pcmdframe; @@ -3458,7 +3458,7 @@ void rtw_init_xmitframe(struct xmit_frame *pxframe) pxframe->buf_addr = NULL; pxframe->pxmitbuf = NULL; - _rtw_memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib)); + memset(&pxframe->attrib, 0, sizeof(struct pkt_attrib)); /* pxframe->attrib.psta = NULL; */ pxframe->frame_tag = DATA_FRAMETAG; @@ -4422,7 +4422,7 @@ s32 rtw_monitor_xmit_entry(struct sk_buff *skb, struct net_device *ndev) goto fail; } - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; // _rtw_memcpy(pframe, (void *)checking, len); _rtw_pktfile_read(&pktfile, pframe, len); @@ -5749,7 +5749,7 @@ void rtw_tx_desc_backup_reset(void) for (i = 0; i < HW_QUEUE_ENTRY; i++) { for (j = 0; j < TX_BAK_FRMAE_CNT; j++) - _rtw_memset(&tx_backup[i][j], 0, sizeof(struct rtw_tx_desc_backup)); + memset(&tx_backup[i][j], 0, sizeof(struct rtw_tx_desc_backup)); backup_idx[i] = 0; } diff --git a/hal/hal_btcoex.c b/hal/hal_btcoex.c index fe82b81..3001755 100644 --- a/hal/hal_btcoex.c +++ b/hal/hal_btcoex.c @@ -220,7 +220,7 @@ static void DBG_BT_INFO_INIT(PBTCDBGINFO pinfo, u8 *pbuf, u32 size) if (NULL == pinfo) return; - _rtw_memset(pinfo, 0, sizeof(BTCDBGINFO)); + memset(pinfo, 0, sizeof(BTCDBGINFO)); if (pbuf && size) { pinfo->info = pbuf; @@ -2842,7 +2842,7 @@ u8 EXhalbtcoutsrc_InitlizeVariables(void *padapter) _rtw_init_sema(&GLBtcBtMpRptSema, 0); GLBtcBtMpRptSeq = 0; GLBtcBtMpRptStatus = 0; - _rtw_memset(GLBtcBtMpRptRsp, 0, C2H_MAX_SIZE); + memset(GLBtcBtMpRptRsp, 0, C2H_MAX_SIZE); GLBtcBtMpRptRspSize = 0; GLBtcBtMpRptWait = _FALSE; GLBtcBtMpRptWiFiOK = _FALSE; @@ -4985,7 +4985,7 @@ u8 hal_btcoex_Initialize(PADAPTER padapter) HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); u8 ret; - _rtw_memset(&GLBtCoexist, 0, sizeof(GLBtCoexist)); + memset(&GLBtCoexist, 0, sizeof(GLBtCoexist)); ret = EXhalbtcoutsrc_InitlizeVariables((void *)padapter); @@ -5566,7 +5566,7 @@ hal_btcoex_ParseAntIsolationConfigFile( RTW_INFO("Fail to parse parameters , format error!\n"); break; } - _rtw_memset((PVOID)param_value_string , 0 , 10); + memset((PVOID)param_value_string , 0 , 10); if (!ParseQualifiedString(szLine , &i , param_value_string , '"' , '"')) { RTW_INFO("Fail to parse parameters\n"); return _FAIL; @@ -5616,7 +5616,7 @@ hal_btcoex_AntIsolationConfig_ParaFile( HAL_DATA_TYPE *pHalData = GET_HAL_DATA(Adapter); int rlen = 0 , rtStatus = _FAIL; - _rtw_memset(pHalData->para_file_buf , 0 , MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf , 0 , MAX_PARA_FILE_BUF_LEN); rtw_get_phy_file_path(Adapter, pFileName); if (rtw_is_file_readable(rtw_phy_para_file_path) == _TRUE) { diff --git a/hal/hal_btcoex_wifionly.c b/hal/hal_btcoex_wifionly.c index 0f82bbb..1d18e6a 100644 --- a/hal/hal_btcoex_wifionly.c +++ b/hal/hal_btcoex_wifionly.c @@ -191,7 +191,7 @@ void hal_btcoex_wifionly_initlizevariables(PADAPTER padapter) struct wifi_only_haldata *pwifionly_haldata = &pwifionlycfg->haldata_info; HAL_DATA_TYPE *pHalData = GET_HAL_DATA(padapter); - _rtw_memset(&GLBtCoexistWifiOnly, 0, sizeof(GLBtCoexistWifiOnly)); + memset(&GLBtCoexistWifiOnly, 0, sizeof(GLBtCoexistWifiOnly)); pwifionlycfg->Adapter = padapter; diff --git a/hal/hal_com.c b/hal/hal_com.c index cb0bf22..62454a1 100644 --- a/hal/hal_com.c +++ b/hal/hal_com.c @@ -80,7 +80,7 @@ void rtw_hal_read_sta_dk_key(_adapter *adapter, u8 key_id) _irqL irqL; u8 get_key[16]; - _rtw_memset(get_key, 0, sizeof(get_key)); + memset(get_key, 0, sizeof(get_key)); if (key_id > 4) { RTW_INFO("%s [ERROR] gtk_keyindex:%d invalid\n", __func__, key_id); @@ -1189,7 +1189,7 @@ void rtw_hal_hw_port_enable(_adapter *adapter) struct dvobj_priv *dvobj = adapter_to_dvobj(adapter); struct rtw_halmac_bcn_ctrl bcn_ctrl; - _rtw_memset(&bcn_ctrl, 0, sizeof(struct rtw_halmac_bcn_ctrl)); + memset(&bcn_ctrl, 0, sizeof(struct rtw_halmac_bcn_ctrl)); bcn_ctrl.enable_bcn = 1; bcn_ctrl.rx_bssid_fit = 1; bcn_ctrl.rxbcn_rpt = 1; @@ -1284,7 +1284,7 @@ s32 c2h_evt_read_88xx(_adapter *adapter, u8 *buf) goto clear_evt; /* Not a valid value */ } - _rtw_memset(buf, 0, C2H_REG_LEN); + memset(buf, 0, C2H_REG_LEN); /* Read ID, LEN, SEQ */ SET_C2H_ID_88XX(buf, rtw_read8(adapter, REG_C2HEVT_MSG_NORMAL)); @@ -2490,7 +2490,7 @@ void rtw_mbid_cam_init(struct dvobj_priv *dvobj) _rtw_spinlock_init(&mbid_cam_ctl->lock); mbid_cam_ctl->bitmap = 0; atomic_set(&mbid_cam_ctl->mbid_entry_num, 0); - _rtw_memset(&dvobj->mbid_cam_cache, 0, sizeof(dvobj->mbid_cam_cache)); + memset(&dvobj->mbid_cam_cache, 0, sizeof(dvobj->mbid_cam_cache)); } void rtw_mbid_cam_deinit(struct dvobj_priv *dvobj) @@ -2507,7 +2507,7 @@ void rtw_mbid_cam_reset(_adapter *adapter) _enter_critical_bh(&mbid_cam_ctl->lock, &irqL); mbid_cam_ctl->bitmap = 0; - _rtw_memset(&dvobj->mbid_cam_cache, 0, sizeof(dvobj->mbid_cam_cache)); + memset(&dvobj->mbid_cam_cache, 0, sizeof(dvobj->mbid_cam_cache)); _exit_critical_bh(&mbid_cam_ctl->lock, &irqL); atomic_set(&mbid_cam_ctl->mbid_entry_num, 0); @@ -2613,7 +2613,7 @@ static inline void mbid_cam_cache_init(_adapter *adapter, struct mbid_cam_cache static inline void mbid_cam_cache_clr(struct mbid_cam_cache *pmbid_cam) { if (pmbid_cam) { - _rtw_memset(pmbid_cam->mac_addr, 0, ETH_ALEN); + memset(pmbid_cam->mac_addr, 0, ETH_ALEN); pmbid_cam->iface_id = CONFIG_IFACE_NUMBER; } } @@ -2818,7 +2818,7 @@ int rtw_mbid_cam_dump(void *sel, const char *fun_name, _adapter *adapter) /*_enter_critical_bh(&mbid_cam_ctl->lock, &irqL);*/ for (i = 0; i < TOTAL_MBID_CAM_NUM; i++) { RTW_PRINT_SEL(sel, "CAM_ID = %d\t", i); - _rtw_memset(mac_addr, 0, ETH_ALEN); + memset(mac_addr, 0, ETH_ALEN); read_mbssid_cam(adapter, i, mac_addr); _RTW_PRINT_SEL(sel, "MAC Addr:"MAC_FMT"\n", MAC_ARG(mac_addr)); } @@ -3242,7 +3242,7 @@ static void rtw_hal_get_macaddr_port(_adapter *adapter, u8 *mac_addr) if (mac_addr == NULL) return; - _rtw_memset(mac_addr, 0, ETH_ALEN); + memset(mac_addr, 0, ETH_ALEN); #ifdef RTW_HALMAC rtw_halmac_get_mac_address(adapter_to_dvobj(adapter), adapter->hw_port, mac_addr); #else /* !RTW_HALMAC */ @@ -4174,7 +4174,7 @@ void rtw_set_p2p_ps_offload_cmd(_adapter *adapter, u8 p2p_ps_state) u8 i; u8 hw_port = rtw_hal_get_port(adapter); - _rtw_memset(&p2p_ps_para, 0, sizeof(HAL_P2P_PS_PARA)); + memset(&p2p_ps_para, 0, sizeof(HAL_P2P_PS_PARA)); _rtw_memcpy((&p2p_ps_para) , &hal->p2p_ps_offload , sizeof(hal->p2p_ps_offload)); (&p2p_ps_para)->p2p_port_id = hw_port; @@ -4193,7 +4193,7 @@ void rtw_set_p2p_ps_offload_cmd(_adapter *adapter, u8 p2p_ps_state) switch (p2p_ps_state) { case P2P_PS_DISABLE: RTW_INFO("P2P_PS_DISABLE\n"); - _rtw_memset(&p2p_ps_para , 0, sizeof(HAL_P2P_PS_PARA)); + memset(&p2p_ps_para , 0, sizeof(HAL_P2P_PS_PARA)); break; case P2P_PS_ENABLE: @@ -4570,7 +4570,7 @@ void rtw_hal_set_FwAoacRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpageloc u1H2CAoacRsvdPageParm); RTW_INFO("AOAC Report=%d\n", rsvdpageloc->LocAOACReport); - _rtw_memset(&u1H2CAoacRsvdPageParm, 0, sizeof(u1H2CAoacRsvdPageParm)); + memset(&u1H2CAoacRsvdPageParm, 0, sizeof(u1H2CAoacRsvdPageParm)); SET_H2CCMD_AOAC_RSVDPAGE_LOC_AOAC_REPORT(u1H2CAoacRsvdPageParm, rsvdpageloc->LocAOACReport); ret = rtw_hal_fill_h2c_cmd(padapter, @@ -4584,7 +4584,7 @@ void rtw_hal_set_FwAoacRsvdPage_cmd(PADAPTER padapter, PRSVDPAGE_LOC rsvdpageloc if (!pwrpriv->wowlan_in_resume) { RTW_INFO("NLO_INFO=%d\n", rsvdpageloc->LocPNOInfo); - _rtw_memset(&u1H2CAoacRsvdPageParm, 0, + memset(&u1H2CAoacRsvdPageParm, 0, sizeof(u1H2CAoacRsvdPageParm)); SET_H2CCMD_AOAC_RSVDPAGE_LOC_NLO_INFO(u1H2CAoacRsvdPageParm, rsvdpageloc->LocPNOInfo); @@ -5055,7 +5055,7 @@ static void rtw_hal_update_gtk_offload_info(_adapter *adapter) if (!MLME_IS_STA(adapter)) return; - _rtw_memset(get_key, 0, sizeof(get_key)); + memset(get_key, 0, sizeof(get_key)); _rtw_memcpy(&replay_count, paoac_rpt->replay_counter_eapol_key, 8); @@ -5209,7 +5209,7 @@ static void rtw_hal_get_aoac_rpt(_adapter *adapter) goto _exit; } - _rtw_memset(paoac_rpt, 0, sizeof(struct aoac_report)); + memset(paoac_rpt, 0, sizeof(struct aoac_report)); _rtw_memcpy(paoac_rpt, buffer, sizeof(struct aoac_report)); for (i = 0 ; i < 4 ; i++) { @@ -5280,7 +5280,7 @@ static void rtw_hal_update_sw_security_info(_adapter *adapter) psecpriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) rtw_hal_update_gtk_offload_info(adapter); #else - _rtw_memset(psecpriv->iv_seq, 0, sz); + memset(psecpriv->iv_seq, 0, sz); #endif } @@ -5801,7 +5801,7 @@ static void rtw_hal_set_ap_rsvdpage_loc_cmd(PADAPTER padapter, msleep(10); - _rtw_memset(&rsvdparm, 0, sizeof(rsvdparm)); + memset(&rsvdparm, 0, sizeof(rsvdparm)); SET_H2CCMD_AP_WOWLAN_RSVDPAGE_LOC_ProbeRsp(rsvdparm, rsvdpageloc->LocProbeRsp + header); @@ -5981,7 +5981,7 @@ static int update_hidden_ssid(u8 *ies, u32 ies_len, u8 hidden_ssid_mode) break; } case 2: - _rtw_memset(&ssid_ie[2], 0, ssid_len_ori); + memset(&ssid_ie[2], 0, ssid_len_ori); break; default: break; @@ -6307,7 +6307,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p *(fctrl) = 0; /* DA filled by FW */ - _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + memset(pwlanhdr->addr1, 0, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, mac, ETH_ALEN); /* Use the device address for BSSID field. */ @@ -6455,7 +6455,7 @@ static void rtw_hal_construct_P2PProbeRsp(_adapter *padapter, u8 *pframe, u32 *p /* Value: */ if (pwdinfo->external_uuid == 0) { - _rtw_memset(wpsie + wpsielen, 0x0, 16); + memset(wpsie + wpsielen, 0x0, 16); _rtw_memcpy(wpsie + wpsielen, mac, ETH_ALEN); } else _rtw_memcpy(wpsie + wpsielen, pwdinfo->uuid, 0x10); @@ -6632,7 +6632,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL *(fctrl) = 0; /* RA, filled by FW */ - _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + memset(pwlanhdr->addr1, 0, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, adapter_mac_addr(padapter), ETH_ALEN); @@ -6650,7 +6650,7 @@ static void rtw_hal_construct_P2PNegoRsp(_adapter *padapter, u8 *pframe, u32 *pL /* dialog token, filled by FW */ pframe = rtw_set_fixed_ie(pframe, 1, &(dialogToken), &(pktlen)); - _rtw_memset(wpsie, 0x00, 255); + memset(wpsie, 0x00, 255); wpsielen = 0; /* WPS Section */ @@ -7031,11 +7031,11 @@ static void rtw_hal_construct_P2PInviteRsp(_adapter *padapter, u8 *pframe, u32 * *(fctrl) = 0; /* RA fill by FW */ - _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + memset(pwlanhdr->addr1, 0, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); /* BSSID fill by FW */ - _rtw_memset(pwlanhdr->addr3, 0, ETH_ALEN); + memset(pwlanhdr->addr3, 0, ETH_ALEN); SetSeqNum(pwlanhdr, 0); set_frame_sub_type(pframe, WIFI_ACTION); @@ -7276,7 +7276,7 @@ static void rtw_hal_construct_P2PProvisionDisRsp(_adapter *padapter, u8 *pframe, *(fctrl) = 0; /* RA filled by FW */ - _rtw_memset(pwlanhdr->addr1, 0, ETH_ALEN); + memset(pwlanhdr->addr1, 0, ETH_ALEN); _rtw_memcpy(pwlanhdr->addr2, adapter_mac_addr(padapter), ETH_ALEN); _rtw_memcpy(pwlanhdr->addr3, adapter_mac_addr(padapter), ETH_ALEN); @@ -7387,7 +7387,7 @@ u8 rtw_hal_set_p2p_wowlan_offload_cmd(_adapter *adapter) struct hal_ops *pHalFunc = &adapter->hal_func; u8 ret = _FAIL; - _rtw_memset(p2p_wowlan_offload, 0 , sizeof(struct P2P_WoWlan_Offload_t)); + memset(p2p_wowlan_offload, 0 , sizeof(struct P2P_WoWlan_Offload_t)); RTW_INFO("%s\n", __func__); switch (pwdinfo->role) { case P2P_ROLE_DEVICE: @@ -7834,7 +7834,7 @@ static void rtw_hal_construct_ARPRsp( } if (EncryptionHeadOverhead > 0) { - _rtw_memset(&(pframe[*pLength]), 0, EncryptionHeadOverhead); + memset(&(pframe[*pLength]), 0, EncryptionHeadOverhead); *pLength += EncryptionHeadOverhead; /* SET_80211_HDR_WEP(pARPRspPkt, 1); */ /* Suggested by CCW. */ SetPrivacy(fctrl); @@ -7962,7 +7962,7 @@ static void rtw_hal_construct_na_message(_adapter *padapter, } if (EncryptionHeadOverhead > 0) { - _rtw_memset(&(pframe[*pLength]), 0, EncryptionHeadOverhead); + memset(&(pframe[*pLength]), 0, EncryptionHeadOverhead); *pLength += EncryptionHeadOverhead; /* SET_80211_HDR_WEP(pARPRspPkt, 1); */ /* Suggested by CCW. */ SetPrivacy(fctrl); @@ -7995,7 +7995,7 @@ static void rtw_hal_construct_na_message(_adapter *padapter, p_na_msg += val8; /* 3 . SA : 16 bytes , DA : 16 bytes ( Fw will filled ) */ - _rtw_memset(&(p_na_msg[*pLength]), 0, 32); + memset(&(p_na_msg[*pLength]), 0, 32); *pLength += 32; p_na_msg += 32; @@ -8011,7 +8011,7 @@ static void rtw_hal_construct_na_message(_adapter *padapter, p_na_msg += val8; /* TA: 16 bytes*/ - _rtw_memset(&(p_na_msg[*pLength]), 0, 16); + memset(&(p_na_msg[*pLength]), 0, 16); *pLength += 16; p_na_msg += 16; @@ -8021,7 +8021,7 @@ static void rtw_hal_construct_na_message(_adapter *padapter, *pLength += 2; p_na_msg += 2; - _rtw_memset(&(p_na_msg[*pLength]), 0, 6); + memset(&(p_na_msg[*pLength]), 0, 6); *pLength += 6; p_na_msg += 6; @@ -8051,8 +8051,8 @@ static void rtw_hal_construct_ndp_info(_adapter *padapter, pmlmeext = &padapter->mlmeextpriv; pmlmeinfo = &pmlmeext->mlmext_info; - _rtw_memset(pframe, 0, len); - _rtw_memset(&ndp_info, 0, len); + memset(pframe, 0, len); + memset(&ndp_info, 0, len); ndp_info.enable = 1; ndp_info.check_remote_ip = 0; @@ -8319,7 +8319,7 @@ static void rtw_hal_construct_GTKRsp( } if (EncryptionHeadOverhead > 0) { - _rtw_memset(&(pframe[*pLength]), 0, EncryptionHeadOverhead); + memset(&(pframe[*pLength]), 0, EncryptionHeadOverhead); *pLength += EncryptionHeadOverhead; /* SET_80211_HDR_WEP(pGTKRspPkt, 1); */ /* Suggested by CCW. */ /* GTK's privacy bit is done by FW */ @@ -8346,7 +8346,7 @@ static void rtw_hal_construct_GTKRsp( *pLength += 11; pGTKRspPkt += 11; /* GTK frame body after LLC, part 2 */ - _rtw_memset(&(pframe[*pLength]), 0, 88); + memset(&(pframe[*pLength]), 0, 88); *pLength += 88; pGTKRspPkt += 88; @@ -8391,7 +8391,7 @@ static void rtw_hal_construct_remote_control_info(_adapter *adapter, *pLength += sz; pframe += sz; - _rtw_memset(&cur_dot11rxiv, 0, sz); + memset(&cur_dot11rxiv, 0, sz); if (psecuritypriv->ndisauthtype == Ndis802_11AuthModeWPA2PSK) { id = psecuritypriv->dot118021XGrpKeyid; @@ -8414,7 +8414,7 @@ static void rtw_hal_construct_remote_control_info(_adapter *adapter, for (i = 0 ; i < total ; i ++) { ccmp_hdr = le64_to_cpu(*(u64*)psecuritypriv->iv_seq[i]); - _rtw_memset(&cur_dot11rxiv, 0, sz); + memset(&cur_dot11rxiv, 0, sz); if (ccmp_hdr != 0) { tmp_key = i; ccmp_hdr = PN_2_CCMPH(ccmp_hdr, tmp_key); @@ -8538,8 +8538,8 @@ void rtw_hal_set_wow_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 index, /* if the ap staion info. exists, get the kek, kck from staion info. */ psta = rtw_get_stainfo(pstapriv, get_bssid(pmlmepriv)); if (psta == NULL) { - _rtw_memset(kek, 0, RTW_KEK_LEN); - _rtw_memset(kck, 0, RTW_KCK_LEN); + memset(kek, 0, RTW_KEK_LEN); + memset(kck, 0, RTW_KCK_LEN); RTW_INFO("%s, KEK, KCK download rsvd page all zero\n", __func__); } else { @@ -8841,7 +8841,7 @@ static u8 rtw_hal_wow_pattern_generate(_adapter *adapter, u8 idx, struct rtl_wow mask = pwrctl->patterns[idx].mask; _rtw_memcpy(mac_addr, adapter_mac_addr(adapter), ETH_ALEN); - _rtw_memset(pwow_pattern, 0, sizeof(struct rtl_wow_pattern)); + memset(pwow_pattern, 0, sizeof(struct rtl_wow_pattern)); mask_len = DIV_ROUND_UP(len, 8); @@ -9149,7 +9149,7 @@ void rtw_clean_pattern(_adapter *adapter) struct rtl_wow_pattern zero_pattern; int i = 0; - _rtw_memset(&zero_pattern, 0, sizeof(struct rtl_wow_pattern)); + memset(&zero_pattern, 0, sizeof(struct rtl_wow_pattern)); zero_pattern.type = PATTERN_INVALID; @@ -9184,7 +9184,7 @@ static int rtw_hal_set_pattern(_adapter *adapter, u8 *pattern, pmlmeext = &adapter->mlmeextpriv; pmlmeinfo = &pmlmeext->mlmext_info; _rtw_memcpy(mac_addr, adapter_mac_addr(adapter), ETH_ALEN); - _rtw_memset(&wow_pattern, 0, sizeof(struct rtl_wow_pattern)); + memset(&wow_pattern, 0, sizeof(struct rtl_wow_pattern)); mask_len = DIV_ROUND_UP(len, 8); @@ -9353,7 +9353,7 @@ void rtw_wow_pattern_read_cam_ent(_adapter *adapter, u8 id, struct rtl_wow_patt int i; u32 rdata; - _rtw_memset(context, 0, sizeof(struct rtl_wow_pattern)); + memset(context, 0, sizeof(struct rtl_wow_pattern)); for (i = 4; i >= 0; i--) { rdata = _rtw_wow_pattern_read_cam(adapter, (id << 3) | i); @@ -10376,7 +10376,7 @@ static void _rtw_hal_set_fw_rsvd_page(_adapter *adapter, bool finished, u8 *page ReservedPagePacket = pcmdframe->buf_addr; } - _rtw_memset(&RsvdPageLoc, 0, sizeof(RSVDPAGE_LOC)); + memset(&RsvdPageLoc, 0, sizeof(RSVDPAGE_LOC)); BufIndex = TxDescOffset; @@ -12873,7 +12873,7 @@ bypass_hw_pg: } #endif - _rtw_memset(hal_data->EEPROMMACAddr, 0, ETH_ALEN); + memset(hal_data->EEPROMMACAddr, 0, ETH_ALEN); ret = _FAIL; exit: @@ -13669,7 +13669,7 @@ void rtw_dump_rx_counters(_adapter *padapter) struct dbg_rx_counter rx_counter; if (padapter->dump_rx_cnt_mode & DUMP_DRV_RX_COUNTER) { - _rtw_memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); + memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); rtw_dump_drv_rx_counters(padapter, &rx_counter); RTW_INFO("Drv Received packet OK:%d CRC error:%d Drop Packets: %d\n", rx_counter.rx_pkt_ok, rx_counter.rx_pkt_crc_error, rx_counter.rx_pkt_drop); @@ -13677,7 +13677,7 @@ void rtw_dump_rx_counters(_adapter *padapter) } if (padapter->dump_rx_cnt_mode & DUMP_MAC_RX_COUNTER) { - _rtw_memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); + memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); rtw_dump_mac_rx_counters(padapter, &rx_counter); RTW_INFO("Mac Received packet OK:%d CRC error:%d FA Counter: %d Drop Packets: %d\n", rx_counter.rx_pkt_ok, rx_counter.rx_pkt_crc_error, @@ -13687,7 +13687,7 @@ void rtw_dump_rx_counters(_adapter *padapter) } if (padapter->dump_rx_cnt_mode & DUMP_PHY_RX_COUNTER) { - _rtw_memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); + memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); rtw_dump_phy_rx_counters(padapter, &rx_counter); /* RTW_INFO("%s: OFDM_FA =%d\n", __FUNCTION__, rx_counter.rx_ofdm_fa); */ /* RTW_INFO("%s: CCK_FA =%d\n", __FUNCTION__, rx_counter.rx_cck_fa); */ @@ -14619,7 +14619,7 @@ u8 * rtw_hal_set_8812a_vendor_ie(_adapter *padapter , u8 *pframe ,uint *frlen ) if( !IS_HARDWARE_TYPE_8812(padapter) ) return pframe; - _rtw_memset(vendor_info,0,vender_len); + memset(vendor_info,0,vender_len); _rtw_memcpy(vendor_info, REALTEK_OUI, 3); vendor_info[4] =2; if(pHalData->version_id.CUTVersion > B_CUT_VERSION ) diff --git a/hal/hal_com_phycfg.c b/hal/hal_com_phycfg.c index 99c48c4..d186310 100644 --- a/hal/hal_com_phycfg.c +++ b/hal/hal_com_phycfg.c @@ -542,7 +542,7 @@ static inline void hal_init_pg_txpwr_info_2g(_adapter *adapter, TxPowerInfo24G * if (pwr_info == NULL) return; - _rtw_memset(pwr_info, 0, sizeof(TxPowerInfo24G)); + memset(pwr_info, 0, sizeof(TxPowerInfo24G)); /* init with invalid value */ for (path = 0; path < MAX_RF_PATH; path++) { @@ -580,7 +580,7 @@ static inline void hal_init_pg_txpwr_info_5g(_adapter *adapter, TxPowerInfo5G *p if (pwr_info == NULL) return; - _rtw_memset(pwr_info, 0, sizeof(TxPowerInfo5G)); + memset(pwr_info, 0, sizeof(TxPowerInfo5G)); /* init with invalid value */ for (path = 0; path < MAX_RF_PATH; path++) { @@ -3417,7 +3417,7 @@ void phy_txpwr_limit_bandwidth_chk(_adapter *adapter) break; } - _rtw_memset(cch_by_bw, 0, 3); + memset(cch_by_bw, 0, 3); cch_by_bw[bw] = cch; offset_by_bw = 0x01; @@ -4084,7 +4084,7 @@ phy_ConfigMACWithParaFile( if (!(Adapter->registrypriv.load_phy_file & LOAD_MAC_PARA_FILE)) return rtStatus; - _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); if ((pHalData->mac_reg_len == 0) && (pHalData->mac_reg == NULL)) { rtw_get_phy_file_path(Adapter, pFileName); @@ -4163,7 +4163,7 @@ phy_ConfigBBWithParaFile( break; } - _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { rtw_get_phy_file_path(Adapter, pFileName); @@ -4469,7 +4469,7 @@ phy_ConfigBBWithPgParaFile( if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_PG_PARA_FILE)) return rtStatus; - _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); if (pHalData->bb_phy_reg_pg == NULL) { rtw_get_phy_file_path(Adapter, pFileName); @@ -4518,7 +4518,7 @@ phy_ConfigBBWithMpParaFile( if (!(Adapter->registrypriv.load_phy_file & LOAD_BB_MP_PARA_FILE)) return rtStatus; - _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); if ((pHalData->bb_phy_reg_mp_len == 0) && (pHalData->bb_phy_reg_mp == NULL)) { rtw_get_phy_file_path(Adapter, pFileName); @@ -4622,7 +4622,7 @@ PHY_ConfigRFWithParaFile( break; } - _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); if ((pBufLen != NULL) && (*pBufLen == 0) && (pBuf == NULL)) { rtw_get_phy_file_path(Adapter, pFileName); @@ -4821,7 +4821,7 @@ PHY_ConfigRFWithTxPwrTrackParaFile( if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_TRACK_PARA_FILE)) return rtStatus; - _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); if ((pHalData->rf_tx_pwr_track_len == 0) && (pHalData->rf_tx_pwr_track == NULL)) { rtw_get_phy_file_path(Adapter, pFileName); @@ -5076,10 +5076,10 @@ phy_ParsePowerLimitTableFile( szLine[--i] = ' '; /* return the space in front of the regulation info */ /* Parse the label of the table */ - _rtw_memset((PVOID) band, 0, 10); - _rtw_memset((PVOID) bandwidth, 0, 10); - _rtw_memset((PVOID) ntx, 0, 10); - _rtw_memset((PVOID) rateSection, 0, 10); + memset((PVOID) band, 0, 10); + memset((PVOID) bandwidth, 0, 10); + memset((PVOID) ntx, 0, 10); + memset((PVOID) rateSection, 0, 10); if (!ParseQualifiedString(szLine, &i, band, ' ', ',')) { RTW_ERR("Fail to parse band!\n"); goto exit; @@ -5124,7 +5124,7 @@ phy_ParsePowerLimitTableFile( while (szLine[i] == ' ' || szLine[i] == '\t') ++i; - _rtw_memset((PVOID) colNumBuf, 0, 10); + memset((PVOID) colNumBuf, 0, 10); if (!ParseQualifiedString(szLine, &i, colNumBuf, '#', '#')) { RTW_ERR("Fail to parse column number!\n"); goto exit; @@ -5229,7 +5229,7 @@ phy_ParsePowerLimitTableFile( ++i; /* load the power limit value */ - _rtw_memset((PVOID) powerLimit, 0, 10); + memset((PVOID) powerLimit, 0, 10); if (szLine[i] == 'W' && szLine[i + 1] == 'W') { /* @@ -5320,7 +5320,7 @@ PHY_ConfigRFWithPowerLimitTableParaFile( if (!(Adapter->registrypriv.load_phy_file & LOAD_RF_TXPWR_LMT_PARA_FILE)) return rtStatus; - _rtw_memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); + memset(pHalData->para_file_buf, 0, MAX_PARA_FILE_BUF_LEN); if (pHalData->rf_tx_pwr_lmt == NULL) { rtw_get_phy_file_path(Adapter, pFileName); diff --git a/hal/hal_dm_acs.c b/hal/hal_dm_acs.c index 5c19d99..f7ce749 100644 --- a/hal/hal_dm_acs.c +++ b/hal/hal_dm_acs.c @@ -32,7 +32,7 @@ static void _rtw_bss_nums_count(_adapter *adapter, u8 *pbss_nums) RTW_ERR("%s pbss_nums is null pointer\n", __func__); return; } - _rtw_memset(pbss_nums, 0, MAX_CHANNEL_NUM); + memset(pbss_nums, 0, MAX_CHANNEL_NUM); _enter_critical_bh(&(pmlmepriv->scanned_queue.lock), &irqL); phead = get_list_head(queue); @@ -94,7 +94,7 @@ void rtw_acs_reset(_adapter *adapter) HAL_DATA_TYPE *hal_data = GET_HAL_DATA(adapter); struct auto_chan_sel *pacs = &hal_data->acs; - _rtw_memset(pacs, 0, sizeof(struct auto_chan_sel)); + memset(pacs, 0, sizeof(struct auto_chan_sel)); #ifdef CONFIG_RTW_ACS_DBG rtw_acs_adv_reset(adapter); #endif /*CONFIG_RTW_ACS_DBG*/ diff --git a/hal/hal_halmac.c b/hal/hal_halmac.c index 5de1b3f..320219b 100644 --- a/hal/hal_halmac.c +++ b/hal/hal_halmac.c @@ -402,7 +402,7 @@ static u8 _halmac_memcpy(void *p, void *dest, void *src, u32 size) static u8 _halmac_memset(void *p, void *addr, u8 value, u32 size) { - _rtw_memset(addr, value, size); + memset(addr, value, size); return RTW_HALMAC_SUCCESS; } @@ -1064,7 +1064,7 @@ static int init_write_rsvd_page_size(struct dvobj_priv *d) mac = dvobj_to_halmac(d); api = HALMAC_GET_API(mac); - _rtw_memset(&ofld_info, 0, sizeof(ofld_info)); + memset(&ofld_info, 0, sizeof(ofld_info)); ofld_info.halmac_malloc_max_sz = 0xFFFFFFFF; ofld_info.rsvd_pg_drv_buf_max_sz = size; status = api->halmac_ofld_func_cfg(mac, &ofld_info); @@ -1218,7 +1218,7 @@ int rtw_halmac_init_adapter(struct dvobj_priv *d, struct halmac_platform_api *pf init_write_rsvd_page_size(d); #ifdef CONFIG_SDIO_HCI - _rtw_memset(&info, 0, sizeof(info)); + memset(&info, 0, sizeof(info)); info.spec_ver = _sdio_ver_drv2halmac(d); /* Convert clock speed unit to MHz from Hz */ info.clock_speed = RTW_DIV_ROUND_UP(rtw_sdio_get_clock(d), 1000000); @@ -1794,7 +1794,7 @@ int rtw_halmac_get_mac_address(struct dvobj_priv *d, enum _hw_port hwport, u8 *a halmac = dvobj_to_halmac(d); api = HALMAC_GET_API(halmac); port = _hw_port_drv2halmac(hwport); - _rtw_memset(&hwa, 0, sizeof(hwa)); + memset(&hwa, 0, sizeof(hwa)); status = api->halmac_get_mac_addr(halmac, port, &hwa); if (status != HALMAC_RET_SUCCESS) @@ -1916,7 +1916,7 @@ int rtw_halmac_get_bcn_ctrl(struct dvobj_priv *d, enum _hw_port hwport, halmac = dvobj_to_halmac(d); api = HALMAC_GET_API(halmac); port = _hw_port_drv2halmac(hwport); - _rtw_memset(&ctrl, 0, sizeof(ctrl)); + memset(&ctrl, 0, sizeof(ctrl)); status = api->halmac_rw_bcn_ctrl(halmac, port, 0, &ctrl); if (status != HALMAC_RET_SUCCESS) @@ -2019,7 +2019,7 @@ int rtw_halmac_set_mac_address(struct dvobj_priv *d, enum _hw_port hwport, u8 *a api = HALMAC_GET_API(halmac); port = _hw_port_drv2halmac(hwport); - _rtw_memset(&hwa, 0, sizeof(hwa)); + memset(&hwa, 0, sizeof(hwa)); _rtw_memcpy(hwa.addr, addr, 6); status = api->halmac_cfg_mac_addr(halmac, port, &hwa); @@ -2055,7 +2055,7 @@ int rtw_halmac_set_bssid(struct dvobj_priv *d, enum _hw_port hwport, u8 *addr) api = HALMAC_GET_API(halmac); port = _hw_port_drv2halmac(hwport); - _rtw_memset(&hwa, 0, sizeof(hwa)); + memset(&hwa, 0, sizeof(hwa)); _rtw_memcpy(hwa.addr, addr, 6); status = api->halmac_cfg_bssid(halmac, port, &hwa); if (status != HALMAC_RET_SUCCESS) @@ -2089,7 +2089,7 @@ int rtw_halmac_set_tx_address(struct dvobj_priv *d, enum _hw_port hwport, u8 *ad halmac = dvobj_to_halmac(d); api = HALMAC_GET_API(halmac); port = _hw_port_drv2halmac(hwport); - _rtw_memset(&hwa, 0, sizeof(hwa)); + memset(&hwa, 0, sizeof(hwa)); _rtw_memcpy(hwa.addr, addr, 6); status = api->halmac_cfg_transmitter_addr(halmac, port, &hwa); @@ -2224,7 +2224,7 @@ int rtw_halmac_set_bcn_ctrl(struct dvobj_priv *d, enum _hw_port hwport, halmac = dvobj_to_halmac(d); api = HALMAC_GET_API(halmac); port = _hw_port_drv2halmac(hwport); - _rtw_memset(&ctrl, 0, sizeof(ctrl)); + memset(&ctrl, 0, sizeof(ctrl)); _beacon_ctrl_drv2halmac(bcn_ctrl, &ctrl); status = api->halmac_rw_bcn_ctrl(halmac, port, 1, &ctrl); @@ -2947,7 +2947,7 @@ static int _send_general_info(struct dvobj_priv *d) return -1; api = HALMAC_GET_API(halmac); - _rtw_memset(&info, 0, sizeof(info)); + memset(&info, 0, sizeof(info)); info.rfe_type = (u8)hal->rfe_type; rtw_hal_get_rf_path(d, &rf, &txpath, &rxpath); info.rf_type = _rf_type_drv2halmac(rf); @@ -4455,7 +4455,7 @@ int rtw_halmac_rx_agg_switch(struct dvobj_priv *d, u8 enable) hal = GET_HAL_DATA(adapter); halmac = dvobj_to_halmac(d); api = HALMAC_GET_API(halmac); - _rtw_memset((void *)&rxaggcfg, 0, sizeof(rxaggcfg)); + memset((void *)&rxaggcfg, 0, sizeof(rxaggcfg)); rxaggcfg.mode = HALMAC_RX_AGG_MODE_NONE; /* * Always enable size limit to avoid rx size exceed @@ -4658,7 +4658,7 @@ static int _phy_parameter_drv2halmac(struct rtw_phy_parameter *para, struct halm if (!para || !info) return -1; - _rtw_memset(info, 0, sizeof(*info)); + memset(info, 0, sizeof(*info)); switch (para->cmd) { case 0: @@ -5012,9 +5012,9 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo, nlo?"PNO/NLO":"Normal"); if (enable) { - _rtw_memset(probereq, 0, sizeof(probereq)); + memset(probereq, 0, sizeof(probereq)); - _rtw_memset(&pnossid, 0, sizeof(pnossid)); + memset(&pnossid, 0, sizeof(pnossid)); if (ssid) { if (ssid_len > sizeof(pnossid.SSID)) { RTW_ERR("%s: SSID length(%d) is too long(>%d)!!\n", @@ -5054,7 +5054,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo, api->halmac_clear_ch_info(mac); for (i = 0; i < rfctl->max_chan_nums && ch_set[i].ChannelNum != 0; i++) { - _rtw_memset(&ch_info, 0, sizeof(ch_info)); + memset(&ch_info, 0, sizeof(ch_info)); ch_info.extra_info = 0; ch_info.channel = ch_set[i].ChannelNum; ch_info.bw = HALMAC_BW_20; @@ -5070,7 +5070,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo, } /* set channel switch option */ - _rtw_memset(&cs_option, 0, sizeof(cs_option)); + memset(&cs_option, 0, sizeof(cs_option)); cs_option.dest_bw = HALMAC_BW_20; cs_option.periodic_option = HALMAC_CS_PERIODIC_2_PHASE; cs_option.dest_pri_ch_idx = HALMAC_CH_IDX_UNDEFINE; @@ -5114,7 +5114,7 @@ static int _halmac_scanoffload(struct dvobj_priv *d, u32 enable, u8 nlo, } else { api->halmac_clear_ch_info(mac); - _rtw_memset(&cs_option, 0, sizeof(cs_option)); + memset(&cs_option, 0, sizeof(cs_option)); cs_option.switch_en = 0; if (!nlo) { @@ -5189,8 +5189,8 @@ int rtw_halmac_query_tx_page_num(struct dvobj_priv *d) hmpriv = &d->hmpriv; halmac = dvobj_to_halmac(d); api = HALMAC_GET_API(halmac); - _rtw_memset((void *)&rqpn, 0, sizeof(rqpn)); - _rtw_memset((void *)&fifosize, 0, sizeof(fifosize)); + memset((void *)&rqpn, 0, sizeof(rqpn)); + memset((void *)&fifosize, 0, sizeof(fifosize)); status = api->halmac_get_hw_value(halmac, HALMAC_HW_RQPN_MAPPING, &rqpn); if (status != HALMAC_RET_SUCCESS) @@ -5428,7 +5428,7 @@ int rtw_halmac_bf_add_mu_bfer(struct dvobj_priv *d, u16 paid, u16 csi_para, mac = dvobj_to_halmac(d); api = HALMAC_GET_API(mac); - _rtw_memset(¶m, 0, sizeof(param)); + memset(¶m, 0, sizeof(param)); param.paid = paid; param.csi_para = csi_para; param.my_aid = my_aid; @@ -5529,7 +5529,7 @@ int rtw_halmac_bf_cfg_mu_mimo(struct dvobj_priv *d, enum halmac_snd_role role, mac = dvobj_to_halmac(d); api = HALMAC_GET_API(mac); - _rtw_memset(¶m, 0, sizeof(param)); + memset(¶m, 0, sizeof(param)); param.role = role; param.grouping_bitmap = grouping_bitmap; diff --git a/hal/hal_hci/hal_usb.c b/hal/hal_hci/hal_usb.c index 20dc07b..f802a3f 100644 --- a/hal/hal_hci/hal_usb.c +++ b/hal/hal_hci/hal_usb.c @@ -533,7 +533,7 @@ int usb_writeN(struct intf_hdl *pintfhdl, u32 addr, u32 length, u8 *pdata) void usb_set_intf_ops(_adapter *padapter, struct _io_ops *pops) { - _rtw_memset((u8 *)pops, 0, sizeof(struct _io_ops)); + memset((u8 *)pops, 0, sizeof(struct _io_ops)); pops->_read8 = &usb_read8; pops->_read16 = &usb_read16; diff --git a/hal/hal_intf.c b/hal/hal_intf.c index 8b3a57b..c3aab45 100644 --- a/hal/hal_intf.c +++ b/hal/hal_intf.c @@ -249,7 +249,7 @@ void rtw_hal_power_off(_adapter *padapter) { struct macid_ctl_t *macid_ctl = &padapter->dvobj->macid_ctl; - _rtw_memset(macid_ctl->h2c_msr, 0, MACID_NUM_SW_LIMIT); + memset(macid_ctl->h2c_msr, 0, MACID_NUM_SW_LIMIT); #ifdef CONFIG_BT_COEXIST rtw_btcoex_PowerOffSetting(padapter); diff --git a/hal/hal_mcc.c b/hal/hal_mcc.c index ac251cb..65a13a8 100644 --- a/hal/hal_mcc.c +++ b/hal/hal_mcc.c @@ -1174,7 +1174,7 @@ u8 rtw_hal_dl_mcc_fw_rsvd_page(_adapter *adapter, u8 *pframe, u16 *index, rtw_hal_mcc_upadate_chnl_bw(iface, ch, bw_offset, bw, _TRUE); start = &pframe[*index - tx_desc]; - _rtw_memset(start, 0, page_size); + memset(start, 0, page_size); pmccobjpriv->mcc_pwr_idx_rsvd_page[i] = *total_page_num; RTW_INFO(ADPT_FMT" order:%d, pwr_idx_rsvd_page location[%d]: %d\n", ADPT_ARG(iface), mccadapriv->order, @@ -1609,7 +1609,7 @@ static void rtw_hal_set_mcc_IQK_offload_cmd(PADAPTER padapter) for (rf_path_idx = 0; rf_path_idx < total_rf_path; rf_path_idx ++) { - _rtw_memset(cmd, 0, H2C_MCC_IQK_PARAM_LEN); + memset(cmd, 0, H2C_MCC_IQK_PARAM_LEN); TX_X = pmccadapriv->mcc_iqk_arr[rf_path_idx].TX_X & 0x7ff;/* [10:0] */ TX_Y = pmccadapriv->mcc_iqk_arr[rf_path_idx].TX_Y & 0x7ff;/* [10:0] */ RX_X = pmccadapriv->mcc_iqk_arr[rf_path_idx].RX_X & 0x3ff;/* [9:0] */ diff --git a/hal/phydm/phydm_interface.c b/hal/phydm/phydm_interface.c index cec3be4..c5f9799 100644 --- a/hal/phydm/phydm_interface.c +++ b/hal/phydm/phydm_interface.c @@ -424,7 +424,7 @@ void odm_memory_set(struct dm_struct *dm, void *pbuf, s8 value, u32 length) #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) && defined(DM_ODM_CE_MAC80211_V2) memset(pbuf, value, length); #elif (DM_ODM_SUPPORT_TYPE & ODM_CE) - _rtw_memset(pbuf, value, length); + memset(pbuf, value, length); #elif (DM_ODM_SUPPORT_TYPE & ODM_WIN) PlatformFillMemory(pbuf, length, value); #elif (DM_ODM_SUPPORT_TYPE & ODM_IOT) diff --git a/hal/phydm/txbf/haltxbfinterface.c b/hal/phydm/txbf/haltxbfinterface.c index c125fec..d4aa797 100644 --- a/hal/phydm/txbf/haltxbfinterface.c +++ b/hal/phydm/txbf/haltxbfinterface.c @@ -1044,7 +1044,7 @@ send_fw_ht_ndpa_packet( pattrib->order = 1; pattrib->subtype = WIFI_ACTION_NOACK; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -1130,7 +1130,7 @@ send_sw_ht_ndpa_packet( pattrib->order = 1; pattrib->subtype = WIFI_ACTION_NOACK; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -1220,7 +1220,7 @@ send_fw_vht_ndpa_packet( pattrib->bwmode = BW; pattrib->subtype = WIFI_NDPA; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -1321,7 +1321,7 @@ send_sw_vht_ndpa_packet( pattrib->bwmode = BW; pattrib->subtype = WIFI_NDPA; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; diff --git a/hal/rtl8192e/rtl8192e_cmd.c b/hal/rtl8192e/rtl8192e_cmd.c index 6723d7e..6dbeaac 100644 --- a/hal/rtl8192e/rtl8192e_cmd.c +++ b/hal/rtl8192e/rtl8192e_cmd.c @@ -441,7 +441,7 @@ void rtl8192e_set_p2p_ps_offload_cmd(_adapter *padapter, u8 p2p_ps_state) switch (p2p_ps_state) { case P2P_PS_DISABLE: RTW_INFO("P2P_PS_DISABLE\n"); - _rtw_memset(p2p_ps_offload, 0, 1); + memset(p2p_ps_offload, 0, 1); break; case P2P_PS_ENABLE: RTW_INFO("P2P_PS_ENABLE\n"); diff --git a/hal/rtl8192e/rtl8192e_hal_init.c b/hal/rtl8192e/rtl8192e_hal_init.c index 7808ae4..c31564e 100644 --- a/hal/rtl8192e/rtl8192e_hal_init.c +++ b/hal/rtl8192e/rtl8192e_hal_init.c @@ -1219,7 +1219,7 @@ static bool efuse_read_phymap( /* */ /* Refresh efuse init map as all 0xFF. */ /* */ - _rtw_memset(pbuf, 0xFF, limit); + memset(pbuf, 0xFF, limit); /* */ @@ -1638,7 +1638,7 @@ Hal_EfuseWordEnableDataWrite8192E(IN PADAPTER pAdapter, u8 badworden = 0x0F; u8 tmpdata[8]; - _rtw_memset((PVOID)tmpdata, 0xff, PGPKT_DATA_SIZE); + memset((PVOID)tmpdata, 0xff, PGPKT_DATA_SIZE); if (!(word_en & BIT0)) { tmpaddr = start_addr; @@ -1801,8 +1801,8 @@ hal_EfusePgPacketRead_8192E( if (offset > EFUSE_MAX_SECTION_8192E) return _FALSE; - _rtw_memset((PVOID)data, 0xff, sizeof(u8) * PGPKT_DATA_SIZE); - _rtw_memset((PVOID)tmpdata, 0xff, sizeof(u8) * PGPKT_DATA_SIZE); + memset((PVOID)data, 0xff, sizeof(u8) * PGPKT_DATA_SIZE); + memset((PVOID)tmpdata, 0xff, sizeof(u8) * PGPKT_DATA_SIZE); /* */ @@ -1936,7 +1936,7 @@ hal_EfusePgPacketWrite_8192E(IN PADAPTER pAdapter, /* RTW_INFO("hal_EfusePgPacketWrite_8812A target offset 0x%x word_en 0x%x\n", target_pkt.offset, target_pkt.word_en); */ - _rtw_memset((PVOID)target_pkt.data, 0xFF, sizeof(u8) * 8); + memset((PVOID)target_pkt.data, 0xFF, sizeof(u8) * 8); efuse_WordEnableDataRead(word_en, data, target_pkt.data); target_word_cnts = Efuse_CalculateWordCnts(target_pkt.word_en); @@ -2179,7 +2179,7 @@ hal_EfusePgPacketWrite_8192E(IN PADAPTER pAdapter, } /* ************ s1-2-A :cover the exist data ******************* */ - _rtw_memset(originaldata, 0xff, sizeof(u8) * 8); + memset(originaldata, 0xff, sizeof(u8) * 8); if (Efuse_PgPacketRead(pAdapter, tmp_pkt.offset, originaldata, bPseudoTest)) { /* check if data exist */ @@ -2281,7 +2281,7 @@ efuse_PgPacketConstruct( IN OUT PPGPKT_STRUCT pTargetPkt ) { - _rtw_memset((PVOID)pTargetPkt->data, 0xFF, sizeof(u8) * 8); + memset((PVOID)pTargetPkt->data, 0xFF, sizeof(u8) * 8); pTargetPkt->offset = offset; pTargetPkt->word_en = word_en; efuse_WordEnableDataRead(word_en, pData, pTargetPkt->data); @@ -2585,7 +2585,7 @@ hal_EfuseFixHeaderProcess( u16 efuse_addr = *pAddr; u32 PgWriteSuccess = 0; - _rtw_memset((PVOID)originaldata, 0xff, 8); + memset((PVOID)originaldata, 0xff, 8); if (Efuse_PgPacketRead(pAdapter, pFixPkt->offset, originaldata, bPseudoTest)) { /* check if data exist */ @@ -4761,9 +4761,9 @@ void rtl8192e_init_default_value(_adapter *padapter) #endif pHalData->EfuseHal.fakeEfuseBank = 0; pHalData->EfuseHal.fakeEfuseUsedBytes = 0; - _rtw_memset(pHalData->EfuseHal.fakeEfuseContent, 0xFF, EFUSE_MAX_HW_SIZE); - _rtw_memset(pHalData->EfuseHal.fakeEfuseInitMap, 0xFF, EFUSE_MAX_MAP_LEN); - _rtw_memset(pHalData->EfuseHal.fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN); + memset(pHalData->EfuseHal.fakeEfuseContent, 0xFF, EFUSE_MAX_HW_SIZE); + memset(pHalData->EfuseHal.fakeEfuseInitMap, 0xFF, EFUSE_MAX_MAP_LEN); + memset(pHalData->EfuseHal.fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN); } #ifdef CONFIG_BT_COEXIST diff --git a/hal/rtl8192e/rtl8192e_rxdesc.c b/hal/rtl8192e/rtl8192e_rxdesc.c index 401979d..0a435a8 100644 --- a/hal/rtl8192e/rtl8192e_rxdesc.c +++ b/hal/rtl8192e/rtl8192e_rxdesc.c @@ -21,7 +21,7 @@ void rtl8192e_query_rx_desc_status(union recv_frame *precvframe, u8 *pdesc) { struct rx_pkt_attrib *pattrib = &precvframe->u.hdr.attrib; - _rtw_memset(pattrib, 0, sizeof(struct rx_pkt_attrib)); + memset(pattrib, 0, sizeof(struct rx_pkt_attrib)); /* Offset 0 */ pattrib->pkt_len = (u16)GET_RX_STATUS_DESC_PKT_LEN_92E(pdesc);/* (le32_to_cpu(pdesc->rxdw0)&0x00003fff) */ diff --git a/hal/rtl8192e/rtl8192e_xmit.c b/hal/rtl8192e/rtl8192e_xmit.c index 7c7a024..caae085 100644 --- a/hal/rtl8192e/rtl8192e_xmit.c +++ b/hal/rtl8192e/rtl8192e_xmit.c @@ -104,7 +104,7 @@ InsertEMContent_8192E( u4Byte dwtmp = 0; #endif - _rtw_memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE); + memset(VirtualAddress, 0, EARLY_MODE_INFO_SIZE); if (pEMInfo->EMPktNum == 0) return; @@ -210,7 +210,7 @@ void UpdateEarlyModeInfo8192E(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmi offset = pxmitpriv->agg_pkt[index].offset; pktlen = pxmitpriv->agg_pkt[index].pkt_len; - _rtw_memset(&eminfo, 0, sizeof(struct EMInfo)); + memset(&eminfo, 0, sizeof(struct EMInfo)); if (pframe->agg_num > EARLY_MODE_MAX_PKT_NUM) { if (node_num_0 > EARLY_MODE_MAX_PKT_NUM) { eminfo.EMPktNum = EARLY_MODE_MAX_PKT_NUM; @@ -243,7 +243,7 @@ void UpdateEarlyModeInfo8192E(struct xmit_priv *pxmitpriv, struct xmit_buf *pxmi } - _rtw_memset(pxmitpriv->agg_pkt, 0, sizeof(struct agg_pkt_info) * MAX_AGG_PKT_NUM); + memset(pxmitpriv->agg_pkt, 0, sizeof(struct agg_pkt_info) * MAX_AGG_PKT_NUM); } #endif @@ -476,7 +476,7 @@ void rtl8192e_fill_fake_txdesc( struct xmit_priv *pxmitpriv = &padapter->xmitpriv; /* Clear all status */ - _rtw_memset(pDesc, 0, TXDESC_SIZE); + memset(pDesc, 0, TXDESC_SIZE); SET_TX_DESC_OFFSET_92E(pDesc, (TXDESC_SIZE + OFFSET_SZ)); diff --git a/hal/rtl8192e/usb/rtl8192eu_xmit.c b/hal/rtl8192e/usb/rtl8192eu_xmit.c index ea0a95b..ae49132 100644 --- a/hal/rtl8192e/usb/rtl8192eu_xmit.c +++ b/hal/rtl8192e/usb/rtl8192eu_xmit.c @@ -71,7 +71,7 @@ static s32 update_txdesc(struct xmit_frame *pxmitframe, u8 *pmem, s32 sz , u8 ba } #endif /* CONFIG_USE_USB_BUFFER_ALLOC_TX */ - _rtw_memset(ptxdesc, 0, TXDESC_SIZE); + memset(ptxdesc, 0, TXDESC_SIZE); /* 4 offset 0 */ @@ -955,7 +955,7 @@ s32 rtl8192eu_hostap_mgnt_xmit_entry(_adapter *padapter, _pkt *pkt) /* ----- fill tx desc ----- */ ptxdesc = (struct tx_desc *)pxmitbuf; - _rtw_memset(ptxdesc, 0, sizeof(*ptxdesc)); + memset(ptxdesc, 0, sizeof(*ptxdesc)); /* offset 0 */ ptxdesc->txdw0 |= cpu_to_le32(len & 0x0000ffff); diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index 4db2808..6f595c2 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -1721,10 +1721,10 @@ static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev if (param == NULL) return -1; - _rtw_memset(param, 0, param_len); + memset(param, 0, param_len); param->cmd = IEEE_CMD_SET_ENCRYPTION; - _rtw_memset(param->sta_addr, 0xff, ETH_ALEN); + memset(param->sta_addr, 0xff, ETH_ALEN); switch (params->cipher) { case IW_AUTH_CIPHER_NONE: @@ -1978,7 +1978,7 @@ exit: RTW_INFO(FUNC_NDEV_FMT " seq:0x%llx\n", FUNC_NDEV_ARG(ndev), *pn); if (ret == 0) { - _rtw_memset(¶ms, 0, sizeof(params)); + memset(¶ms, 0, sizeof(params)); params.cipher = cipher; params.key = key->skey; @@ -3697,7 +3697,7 @@ static int cfg80211_rtw_join_ibss(struct wiphy *wiphy, struct net_device *ndev, #endif /*CONFIG_CONCURRENT_MODE*/ - _rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); ndis_ssid.SsidLength = params->ssid_len; _rtw_memcpy(ndis_ssid.Ssid, (u8 *)params->ssid, params->ssid_len); @@ -3928,7 +3928,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, } #endif - _rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); ndis_ssid.SsidLength = sme->ssid_len; _rtw_memcpy(ndis_ssid.Ssid, (u8 *)sme->ssid, sme->ssid_len); @@ -4010,7 +4010,7 @@ static int cfg80211_rtw_connect(struct wiphy *wiphy, struct net_device *ndev, goto cancel_ps_deny; } - _rtw_memset(pwep, 0, wep_total_len); + memset(pwep, 0, wep_total_len); pwep->KeyLength = wep_key_len; pwep->Length = wep_total_len; @@ -4295,8 +4295,8 @@ static int cfg80211_rtw_del_pmksa(struct wiphy *wiphy, for (index = 0 ; index < NUM_PMKID_CACHE; index++) { if (_rtw_memcmp(psecuritypriv->PMKIDList[index].Bssid, (u8 *)pmksa->bssid, ETH_ALEN) == _TRUE) { /* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ - _rtw_memset(psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN); - _rtw_memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN); + memset(psecuritypriv->PMKIDList[index].Bssid, 0x00, ETH_ALEN); + memset(psecuritypriv->PMKIDList[index].PMKID, 0x00, WLAN_PMKID_LEN); psecuritypriv->PMKIDList[index].bUsed = _FALSE; bMatched = _TRUE; RTW_INFO(FUNC_NDEV_FMT" clear id:%hhu\n", FUNC_NDEV_ARG(ndev), index); @@ -4321,7 +4321,7 @@ static int cfg80211_rtw_flush_pmksa(struct wiphy *wiphy, RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev)); - _rtw_memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); + memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); psecuritypriv->PMKIDIndex = 0; return 0; @@ -4578,7 +4578,7 @@ dump: update_mgntframe_attrib(padapter, pattrib); pattrib->retry_ctrl = _FALSE; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -5453,7 +5453,7 @@ release_plink_ctl: #endif /* indicate new sta */ - _rtw_memset(&sinfo, 0, sizeof(sinfo)); + memset(&sinfo, 0, sizeof(sinfo)); cfg80211_new_sta(ndev, mac, &sinfo, GFP_ATOMIC); } goto exit; @@ -6373,8 +6373,8 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, /* start to build provision_request frame */ - _rtw_memset(wpsie, 0, sizeof(wpsie)); - _rtw_memset(p2p_ie, 0, sizeof(p2p_ie)); + memset(wpsie, 0, sizeof(wpsie)); + memset(p2p_ie, 0, sizeof(p2p_ie)); p2p_ielen = 0; pmgntframe = alloc_mgtxmitframe(pxmitpriv); @@ -6386,7 +6386,7 @@ void rtw_cfg80211_issue_p2p_provision_request(_adapter *padapter, const u8 *buf, pattrib = &pmgntframe->attrib; update_mgntframe_attrib(padapter, pattrib); - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; pwlanhdr = (struct rtw_ieee80211_hdr *)pframe; @@ -7118,7 +7118,7 @@ issue_mgmt_frame: pattrib->retry_ctrl = _FALSE; - _rtw_memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); + memset(pmgntframe->buf_addr, 0, WLANHDR_OFFSET + TXDESC_OFFSET); pframe = (u8 *)(pmgntframe->buf_addr) + TXDESC_OFFSET; @@ -7611,7 +7611,7 @@ static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy, goto discard; } - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); _rtw_memcpy(txmgmt.peer, peer, ETH_ALEN); txmgmt.action_code = action_code; txmgmt.dialog_token = dialog_token; @@ -7697,7 +7697,7 @@ static int cfg80211_rtw_tdls_oper(struct wiphy *wiphy, rtw_lps_ctrl_wk_cmd(padapter, LPS_CTRL_LEAVE, 0); #endif /* CONFIG_LPS */ - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); if (peer) _rtw_memcpy(txmgmt.peer, peer, ETH_ALEN); @@ -8224,8 +8224,8 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte u8 ht_cap[HT_CAP_IE_LEN]; u8 ht_op[HT_OP_IE_LEN]; - _rtw_memset(ht_cap, 0, HT_CAP_IE_LEN); - _rtw_memset(ht_op, 0, HT_OP_IE_LEN); + memset(ht_cap, 0, HT_CAP_IE_LEN); + memset(ht_op, 0, HT_OP_IE_LEN); /* WLAN_EID_HT_CAP */ RTW_PUT_LE16(HT_CAP_ELE_CAP_INFO(ht_cap), sta_ht_cap->cap); @@ -8263,7 +8263,7 @@ u8 *rtw_cfg80211_construct_mesh_beacon_ies(struct wiphy *wiphy, _adapter *adapte u8 vht_op[VHT_OP_IE_LEN]; u8 cch = rtw_get_center_ch(ch, bw, offset); - _rtw_memset(vht_op, 0, VHT_OP_IE_LEN); + memset(vht_op, 0, VHT_OP_IE_LEN); /* WLAN_EID_VHT_CAPABILITY */ _rtw_memcpy(vht_cap, &sta_vht_cap->cap, 4); @@ -8599,9 +8599,9 @@ static void rtw_cfg80211_mpath_set_pinfo(struct rtw_mesh_path *mpath, u8 *next_h if (next_hop_sta) _rtw_memcpy(next_hop, next_hop_sta->cmn.mac_addr, ETH_ALEN); else - _rtw_memset(next_hop, 0, ETH_ALEN); + memset(next_hop, 0, ETH_ALEN); - _rtw_memset(pinfo, 0, sizeof(*pinfo)); + memset(pinfo, 0, sizeof(*pinfo)); pinfo->generation = mpath->adapter->mesh_info.mesh_paths_generation; @@ -8684,7 +8684,7 @@ static void rtw_cfg80211_mpp_set_pinfo(struct rtw_mesh_path *mpath, u8 *mpp, str { _rtw_memcpy(mpp, mpath->mpp, ETH_ALEN); - _rtw_memset(pinfo, 0, sizeof(*pinfo)); + memset(pinfo, 0, sizeof(*pinfo)); pinfo->generation = mpath->adapter->mesh_info.mpp_paths_generation; } @@ -9734,7 +9734,7 @@ int rtw_hostapd_acs_dump_survey(struct wiphy *wiphy, struct net_device *netdev, return -EINVAL; } - _rtw_memset(info, 0, sizeof(struct survey_info)); + memset(info, 0, sizeof(struct survey_info)); if (padapter->bup == _FALSE) { RTW_INFO("%s: net device is down.\n", __func__); return -EIO; diff --git a/os_dep/linux/ioctl_cfg80211.h b/os_dep/linux/ioctl_cfg80211.h index 146f537..19e5e1e 100644 --- a/os_dep/linux/ioctl_cfg80211.h +++ b/os_dep/linux/ioctl_cfg80211.h @@ -94,8 +94,8 @@ struct rtw_wdev_invit_info { #define rtw_wdev_invit_info_init(invit_info) \ do { \ (invit_info)->state = 0xff; \ - _rtw_memset((invit_info)->peer_mac, 0, ETH_ALEN); \ - _rtw_memset((invit_info)->group_bssid, 0, ETH_ALEN); \ + memset((invit_info)->peer_mac, 0, ETH_ALEN); \ + memset((invit_info)->group_bssid, 0, ETH_ALEN); \ (invit_info)->active = 0xff; \ (invit_info)->token = 0; \ (invit_info)->flags = 0x00; \ @@ -123,9 +123,9 @@ struct rtw_wdev_nego_info { #define rtw_wdev_nego_info_init(nego_info) \ do { \ (nego_info)->state = 0xff; \ - _rtw_memset((nego_info)->iface_addr, 0, ETH_ALEN); \ - _rtw_memset((nego_info)->peer_mac, 0, ETH_ALEN); \ - _rtw_memset((nego_info)->peer_iface_addr, 0, ETH_ALEN); \ + memset((nego_info)->iface_addr, 0, ETH_ALEN); \ + memset((nego_info)->peer_mac, 0, ETH_ALEN); \ + memset((nego_info)->peer_iface_addr, 0, ETH_ALEN); \ (nego_info)->active = 0xff; \ (nego_info)->token = 0; \ (nego_info)->status = 0xff; \ diff --git a/os_dep/linux/ioctl_linux.c b/os_dep/linux/ioctl_linux.c index ddfb168..35e8a64 100644 --- a/os_dep/linux/ioctl_linux.c +++ b/os_dep/linux/ioctl_linux.c @@ -112,7 +112,7 @@ static void indicate_wx_custom_event(_adapter *padapter, char *msg) _rtw_memcpy(buff, msg, strlen(msg)); - _rtw_memset(&wrqu, 0, sizeof(wrqu)); + memset(&wrqu, 0, sizeof(wrqu)); wrqu.data.length = strlen(msg); RTW_INFO("%s %s\n", __FUNCTION__, buff); @@ -135,13 +135,13 @@ static void request_wps_pbc_event(_adapter *padapter) if (!buff) return; - _rtw_memset(buff, 0, IW_CUSTOM_MAX); + memset(buff, 0, IW_CUSTOM_MAX); p = buff; p += sprintf(p, "WPS_PBC_START.request=TRUE"); - _rtw_memset(&wrqu, 0, sizeof(wrqu)); + memset(&wrqu, 0, sizeof(wrqu)); wrqu.data.length = p - buff; @@ -186,7 +186,7 @@ void indicate_wx_scan_complete_event(_adapter *padapter) { union iwreq_data wrqu; - _rtw_memset(&wrqu, 0, sizeof(union iwreq_data)); + memset(&wrqu, 0, sizeof(union iwreq_data)); /* RTW_INFO("+rtw_indicate_wx_scan_complete_event\n"); */ #ifndef CONFIG_IOCTL_CFG80211 @@ -203,7 +203,7 @@ void rtw_indicate_wx_assoc_event(_adapter *padapter) struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info); WLAN_BSSID_EX *pnetwork = (WLAN_BSSID_EX *)(&(pmlmeinfo->network)); - _rtw_memset(&wrqu, 0, sizeof(union iwreq_data)); + memset(&wrqu, 0, sizeof(union iwreq_data)); wrqu.ap_addr.sa_family = ARPHRD_ETHER; @@ -222,10 +222,10 @@ void rtw_indicate_wx_disassoc_event(_adapter *padapter) { union iwreq_data wrqu; - _rtw_memset(&wrqu, 0, sizeof(union iwreq_data)); + memset(&wrqu, 0, sizeof(union iwreq_data)); wrqu.ap_addr.sa_family = ARPHRD_ETHER; - _rtw_memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); + memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN); #ifndef CONFIG_IOCTL_CFG80211 RTW_PRINT("indicate disassoc\n"); @@ -580,7 +580,7 @@ static inline char *iwe_stream_wpa_wpa2_process(_adapter *padapter, if (wpa_len > 0) { - _rtw_memset(pbuf, 0, buf_size); + memset(pbuf, 0, buf_size); p += sprintf(p, "wpa_ie="); for (i = 0; i < wpa_len; i++) p += sprintf(p, "%02x", wpa_ie[i]); @@ -593,28 +593,28 @@ static inline char *iwe_stream_wpa_wpa2_process(_adapter *padapter, printk("-----------------Len %d----------------\n", wpa_len); } - _rtw_memset(iwe, 0, sizeof(*iwe)); + memset(iwe, 0, sizeof(*iwe)); iwe->cmd = IWEVCUSTOM; iwe->u.data.length = strlen(pbuf); start = iwe_stream_add_point(info, start, stop, iwe, pbuf); - _rtw_memset(iwe, 0, sizeof(*iwe)); + memset(iwe, 0, sizeof(*iwe)); iwe->cmd = IWEVGENIE; iwe->u.data.length = wpa_len; start = iwe_stream_add_point(info, start, stop, iwe, wpa_ie); } if (rsn_len > 0) { - _rtw_memset(pbuf, 0, buf_size); + memset(pbuf, 0, buf_size); p += sprintf(p, "rsn_ie="); for (i = 0; i < rsn_len; i++) p += sprintf(p, "%02x", rsn_ie[i]); - _rtw_memset(iwe, 0, sizeof(*iwe)); + memset(iwe, 0, sizeof(*iwe)); iwe->cmd = IWEVCUSTOM; iwe->u.data.length = strlen(pbuf); start = iwe_stream_add_point(info, start, stop, iwe, pbuf); - _rtw_memset(iwe, 0, sizeof(*iwe)); + memset(iwe, 0, sizeof(*iwe)); iwe->cmd = IWEVGENIE; iwe->u.data.length = rsn_len; start = iwe_stream_add_point(info, start, stop, iwe, rsn_ie); @@ -681,17 +681,17 @@ static inline char *iwe_stream_wapi_process(_adapter *padapter, if (wapi_len > 0) { p = buf_wapi; - /* _rtw_memset(buf_wapi, 0, MAX_WAPI_IE_LEN*2); */ + /* memset(buf_wapi, 0, MAX_WAPI_IE_LEN*2); */ p += sprintf(p, "wapi_ie="); for (i = 0; i < wapi_len; i++) p += sprintf(p, "%02x", wapi_ie[i]); - _rtw_memset(iwe, 0, sizeof(*iwe)); + memset(iwe, 0, sizeof(*iwe)); iwe->cmd = IWEVCUSTOM; iwe->u.data.length = strlen(buf_wapi); start = iwe_stream_add_point(info, start, stop, iwe, buf_wapi); - _rtw_memset(iwe, 0, sizeof(*iwe)); + memset(iwe, 0, sizeof(*iwe)); iwe->cmd = IWEVGENIE; iwe->u.data.length = wapi_len; start = iwe_stream_add_point(info, start, stop, iwe, wapi_ie); @@ -774,7 +774,7 @@ static inline char *iwe_stream_net_rsv_process(_adapter *padapter, pos = pnetwork->network.Reserved; p += sprintf(p, "fm=%02X%02X", pos[1], pos[0]); - _rtw_memset(iwe, 0, sizeof(*iwe)); + memset(iwe, 0, sizeof(*iwe)); iwe->cmd = IWEVCUSTOM; iwe->u.data.length = strlen(buf); start = iwe_stream_add_point(info, start, stop, iwe, buf); @@ -787,7 +787,7 @@ static char *translate_scan(_adapter *padapter, { struct iw_event iwe; u16 cap = 0; - _rtw_memset(&iwe, 0, sizeof(iwe)); + memset(&iwe, 0, sizeof(iwe)); if (_FALSE == search_p2p_wfd_ie(padapter, info, pnetwork, start, stop)) return start; @@ -1530,14 +1530,14 @@ static int rtw_wx_set_pmkid(struct net_device *dev, for (j = 0 ; j < NUM_PMKID_CACHE; j++) { if (_rtw_memcmp(psecuritypriv->PMKIDList[j].Bssid, strIssueBssid, ETH_ALEN) == _TRUE) { /* BSSID is matched, the same AP => Remove this PMKID information and reset it. */ - _rtw_memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN); + memset(psecuritypriv->PMKIDList[j].Bssid, 0x00, ETH_ALEN); psecuritypriv->PMKIDList[j].bUsed = _FALSE; break; } } } else if (pPMK->cmd == IW_PMKSA_FLUSH) { RTW_INFO("[rtw_wx_set_pmkid] IW_PMKSA_FLUSH!\n"); - _rtw_memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); + memset(&psecuritypriv->PMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); psecuritypriv->PMKIDIndex = 0; intReturn = _TRUE; } @@ -1584,7 +1584,7 @@ static int rtw_wx_get_range(struct net_device *dev, wrqu->data.length = sizeof(*range); - _rtw_memset(range, 0, sizeof(*range)); + memset(range, 0, sizeof(*range)); /* Let's try to keep this struct in the same order as in * linux/include/wireless.h @@ -1853,7 +1853,7 @@ static int rtw_wx_get_wap(struct net_device *dev, wrqu->ap_addr.sa_family = ARPHRD_ETHER; - _rtw_memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); + memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); @@ -1863,7 +1863,7 @@ static int rtw_wx_get_wap(struct net_device *dev, _rtw_memcpy(wrqu->ap_addr.sa_data, pcur_bss->MacAddress, ETH_ALEN); else - _rtw_memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); + memset(wrqu->ap_addr.sa_data, 0, ETH_ALEN); return 0; @@ -2372,7 +2372,7 @@ static int rtw_wx_set_essid(struct net_device *dev, if (wrqu->essid.length != 33) RTW_INFO("ssid=%s, len=%d\n", extra, wrqu->essid.length); - _rtw_memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(&ndis_ssid, 0, sizeof(NDIS_802_11_SSID)); ndis_ssid.SsidLength = len; _rtw_memcpy(ndis_ssid.Ssid, extra, len); src_ssid = ndis_ssid.Ssid; @@ -2709,7 +2709,7 @@ static int rtw_wx_set_enc(struct net_device *dev, struct pwrctrl_priv *pwrpriv = adapter_to_pwrctl(padapter); RTW_INFO("+rtw_wx_set_enc, flags=0x%x\n", erq->flags); - _rtw_memset(&wep, 0, sizeof(NDIS_802_11_WEP)); + memset(&wep, 0, sizeof(NDIS_802_11_WEP)); key = erq->flags & IW_ENCODE_INDEX; @@ -3102,10 +3102,10 @@ static int rtw_wx_set_enc_ext(struct net_device *dev, if (param == NULL) return -1; - _rtw_memset(param, 0, param_len); + memset(param, 0, param_len); param->cmd = IEEE_CMD_SET_ENCRYPTION; - _rtw_memset(param->sta_addr, 0xff, ETH_ALEN); + memset(param->sta_addr, 0xff, ETH_ALEN); switch (pext->alg) { @@ -4057,7 +4057,7 @@ static int rtw_p2p_profilefound(struct net_device *dev, if (!rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) { if (extra[0] == '0') { /* Remove all the profile information of wifidirect_info structure. */ - _rtw_memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM); + memset(&pwdinfo->profileinfo[0], 0x00, sizeof(struct profile_info) * P2P_MAX_PERSISTENT_GROUP_NUM); pwdinfo->profileindex = 0; } else { if (pwdinfo->profileindex >= P2P_MAX_PERSISTENT_GROUP_NUM) @@ -4092,7 +4092,7 @@ static int rtw_p2p_setDN(struct net_device *dev, RTW_INFO("[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length - 1); - _rtw_memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN); + memset(pwdinfo->device_name, 0x00, WPS_MAX_DEVICE_NAME_LEN); _rtw_memcpy(pwdinfo->device_name, extra, wrqu->data.length - 1); pwdinfo->device_name_len = wrqu->data.length - 1; @@ -4451,7 +4451,7 @@ static int rtw_p2p_get_go_device_address(struct net_device *dev, /* The P2P Device ID attribute is included in the Beacon frame. */ /* The P2P Device Info attribute is included in the probe response frame. */ - _rtw_memset(attr_content, 0x00, 100); + memset(attr_content, 0x00, 100); if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_DEVICE_ID, attr_content, &attr_contentlen)) { /* Handle the P2P Device ID attribute of Beacon first */ blnMatch = 1; @@ -4678,7 +4678,7 @@ static int rtw_p2p_get_invitation_procedure(struct net_device *dev, p2pie = rtw_bss_ex_get_p2p_ie(&pnetwork->network, NULL, &p2pielen); if (p2pie) { while (p2pie) { - /* _rtw_memset( attr_content, 0x00, 2); */ + /* memset( attr_content, 0x00, 2); */ if (rtw_get_p2p_attr_content(p2pie, p2pielen, P2P_ATTR_CAPABILITY, attr_content, &attr_contentlen)) { /* Handle the P2P capability attribute */ blnMatch = 1; @@ -4793,8 +4793,8 @@ static int rtw_p2p_connect(struct net_device *dev, _cancel_timer_ex(&pwdinfo->ap_p2p_switch_timer); #endif /* CONFIG_CONCURRENT_MODE */ - _rtw_memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info)); - _rtw_memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); + memset(&pwdinfo->nego_req_info, 0x00, sizeof(struct tx_nego_req_info)); + memset(&pwdinfo->groupid_info, 0x00, sizeof(struct group_id_info)); pwdinfo->nego_req_info.peer_channel_num[0] = uintPeerChannel; _rtw_memcpy(pwdinfo->nego_req_info.peerDevAddr, pnetwork->network.MacAddress, ETH_ALEN); @@ -4892,11 +4892,11 @@ static int rtw_p2p_invite_req(struct net_device *dev, } else { /* Reset the content of struct tx_invite_req_info */ pinvite_req_info->benable = _FALSE; - _rtw_memset(pinvite_req_info->go_bssid, 0x00, ETH_ALEN); - _rtw_memset(pinvite_req_info->go_ssid, 0x00, WLAN_SSID_MAXLEN); + memset(pinvite_req_info->go_bssid, 0x00, ETH_ALEN); + memset(pinvite_req_info->go_ssid, 0x00, WLAN_SSID_MAXLEN); pinvite_req_info->ssidlen = 0x00; pinvite_req_info->operating_ch = pwdinfo->operating_channel; - _rtw_memset(pinvite_req_info->peer_macaddr, 0x00, ETH_ALEN); + memset(pinvite_req_info->peer_macaddr, 0x00, ETH_ALEN); pinvite_req_info->token = 3; } @@ -5384,9 +5384,9 @@ static int rtw_p2p_prov_disc(struct net_device *dev, #endif /* CONFIG_INTEL_WIDI */ /* Reset the content of struct tx_provdisc_req_info excluded the wps_config_method_request. */ - _rtw_memset(pwdinfo->tx_prov_disc_info.peerDevAddr, 0x00, ETH_ALEN); - _rtw_memset(pwdinfo->tx_prov_disc_info.peerIFAddr, 0x00, ETH_ALEN); - _rtw_memset(&pwdinfo->tx_prov_disc_info.ssid, 0x00, sizeof(NDIS_802_11_SSID)); + memset(pwdinfo->tx_prov_disc_info.peerDevAddr, 0x00, ETH_ALEN); + memset(pwdinfo->tx_prov_disc_info.peerIFAddr, 0x00, ETH_ALEN); + memset(&pwdinfo->tx_prov_disc_info.ssid, 0x00, sizeof(NDIS_802_11_SSID)); pwdinfo->tx_prov_disc_info.peer_channel_num[0] = 0; pwdinfo->tx_prov_disc_info.peer_channel_num[1] = 0; pwdinfo->tx_prov_disc_info.benable = _FALSE; @@ -6998,7 +6998,7 @@ static int rtw_set_encryption(struct net_device *dev, struct ieee_param *param, goto exit; } - _rtw_memset(pwep, 0, wep_total_len); + memset(pwep, 0, wep_total_len); pwep->KeyLength = wep_key_len; pwep->Length = wep_total_len; @@ -8257,7 +8257,7 @@ int rtw_vendor_ie_get_raw_data(struct net_device *dev, u32 vendor_ie_num, } vendor_ie_mask = pmlmepriv->vendor_ie_mask[vendor_ie_num]; - _rtw_memset(extra, 0, length); + memset(extra, 0, length); pstring = extra; pstring += sprintf(pstring, "%d,%x,", vendor_ie_num, vendor_ie_mask); @@ -8432,7 +8432,7 @@ int rtw_vendor_ie_set(struct net_device *dev, struct iw_request_info *info, unio return ret; _clear_path: - _rtw_memset(pmlmepriv->vendor_ie[vendor_ie_num] , 0 , sizeof(u32) * WLAN_MAX_VENDOR_IE_LEN); + memset(pmlmepriv->vendor_ie[vendor_ie_num] , 0 , sizeof(u32) * WLAN_MAX_VENDOR_IE_LEN); pmlmepriv->vendor_ielen[vendor_ie_num] = 0; pmlmepriv->vendor_ie_mask[vendor_ie_num] = 0; return -EFAULT; @@ -8657,7 +8657,7 @@ static int rtw_mp_efuse_get(struct net_device *dev, goto exit; } - _rtw_memset(extra, '\0', strlen(extra)); + memset(extra, '\0', strlen(extra)); shift = blksz * raw_order; rawdata += shift; @@ -8705,7 +8705,7 @@ static int rtw_mp_efuse_get(struct net_device *dev, goto exit; } #endif - _rtw_memset(extra, '\0', strlen(extra)); + memset(extra, '\0', strlen(extra)); shift = blksz * bt_raw_order; rawdata += shift; @@ -9758,7 +9758,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, for (jj = 0, kk = 0; jj < cnts; jj++, kk += 2) pEfuseHal->fakeEfuseModifiedMap[addr + jj] = key_2char2num(tmp[2][kk], tmp[2][kk + 1]); - _rtw_memset(extra, '\0', strlen(extra)); + memset(extra, '\0', strlen(extra)); sprintf(extra, "wlwfake OK\n"); } @@ -9797,7 +9797,7 @@ static int rtw_mp_efuse_set(struct net_device *dev, for (jj = 0, kk = 0; jj < cnts; jj++, kk += 2) pEfuseHal->fakeEfuseModifiedMap[addr + jj] = key_2char2num(tmp[1][kk], tmp[1][kk + 1]); - _rtw_memset(extra, '\0', strlen(extra)); + memset(extra, '\0', strlen(extra)); sprintf(extra, "write mac addr to fake map OK\n"); } else if(strcmp(tmp[0], "update") == 0) { RTW_INFO("To Use new eFuse map\n"); @@ -9820,12 +9820,12 @@ static int rtw_mp_efuse_set(struct net_device *dev, err = -EINVAL; goto exit; } - _rtw_memset(extra, '\0', strlen(extra)); + memset(extra, '\0', strlen(extra)); sprintf(extra, "eFuse Update OK\n"); } else if (strcmp(tmp[0], "analyze") == 0) { rtw_efuse_analyze(padapter, EFUSE_WIFI, 0); - _rtw_memset(extra, '\0', strlen(extra)); + memset(extra, '\0', strlen(extra)); sprintf(extra, "eFuse Analyze OK,please to check kernel log\n"); } exit: @@ -9898,7 +9898,7 @@ static int rtw_mp_customer_str( return -EFAULT; } - _rtw_memset(param, 0xFF, RTW_CUSTOMER_STR_LEN); + memset(param, 0xFF, RTW_CUSTOMER_STR_LEN); if (strcmp(pch, "read") == 0) { read = 1; @@ -10205,7 +10205,7 @@ static int rtw_mp_sd_iread(struct net_device *dev goto exit; } - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); if (sscanf(input, "%hhu,%lx", &width, &addr) != 2) { RTW_INFO(FUNC_ADPT_FMT" sscanf fail\n", FUNC_ADPT_ARG(padapter)); @@ -10268,7 +10268,7 @@ static int rtw_mp_sd_iwrite(struct net_device *dev goto exit; } - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); if (sscanf(input, "%hhu,%lx,%lx", &width, &addr, &data) != 3) { RTW_INFO(FUNC_ADPT_FMT" sscanf fail\n", FUNC_ADPT_ARG(padapter)); @@ -10532,7 +10532,7 @@ static int rtw_tdls_setup(struct net_device *dev, return ret; } - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); for (i = 0, j = 0 ; i < ETH_ALEN; i++, j += 3) txmgmt.peer[i] = key_2char2num(*(extra + j), *(extra + j + 1)); @@ -10576,7 +10576,7 @@ static int rtw_tdls_teardown(struct net_device *dev, return ret; } - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); for (i = 0, j = 0; i < ETH_ALEN; i++, j += 3) txmgmt.peer[i] = key_2char2num(*(extra + j), *(extra + j + 1)); @@ -10609,7 +10609,7 @@ static int rtw_tdls_discovery(struct net_device *dev, RTW_INFO("[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length - 1); - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); for (i = 0, j = 0 ; i < ETH_ALEN; i++, j += 3) txmgmt.peer[i] = key_2char2num(*(extra + j), *(extra + j + 1)); @@ -10696,7 +10696,7 @@ static int rtw_tdls_ch_switch_off(struct net_device *dev, struct sta_info *ptdls_sta = NULL; struct tdls_txmgmt txmgmt; - _rtw_memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); + memset(&txmgmt, 0x00, sizeof(struct tdls_txmgmt)); RTW_INFO("[%s] %s %d\n", __FUNCTION__, extra, wrqu->data.length - 1); @@ -10719,7 +10719,7 @@ static int rtw_tdls_ch_switch_off(struct net_device *dev, pchsw_info->ch_sw_state &= ~(TDLS_CH_SW_INITIATOR_STATE | TDLS_CH_SWITCH_ON_STATE | TDLS_PEER_AT_OFF_STATE); - _rtw_memset(pchsw_info->addr, 0x00, ETH_ALEN); + memset(pchsw_info->addr, 0x00, ETH_ALEN); ptdls_sta->ch_switch_time = 0; ptdls_sta->ch_switch_timeout = 0; @@ -11394,7 +11394,7 @@ static s32 initLoopback(PADAPTER padapter) ploopback->bstop = _TRUE; ploopback->cnt = 0; ploopback->size = 300; - _rtw_memset(ploopback->msg, 0, sizeof(ploopback->msg)); + memset(ploopback->msg, 0, sizeof(ploopback->msg)); padapter->ploopback = ploopback; } @@ -11451,7 +11451,7 @@ static s32 createpseudoadhoc(PADAPTER padapter) return _FAIL; passoc_ssid = &pmlmepriv->assoc_ssid; - _rtw_memset(passoc_ssid, 0, sizeof(NDIS_802_11_SSID)); + memset(passoc_ssid, 0, sizeof(NDIS_802_11_SSID)); passoc_ssid->SsidLength = sizeof(ssid) - 1; _rtw_memcpy(passoc_ssid->Ssid, ssid, passoc_ssid->SsidLength); @@ -11546,12 +11546,12 @@ static struct xmit_frame *createloopbackpkt(PADAPTER padapter, u32 size) pattrib = &pframe->attrib; /* init xmitframe attribute */ - _rtw_memset(pattrib, 0, sizeof(struct pkt_attrib)); + memset(pattrib, 0, sizeof(struct pkt_attrib)); pattrib->ether_type = 0x8723; _rtw_memcpy(pattrib->src, adapter_mac_addr(padapter), ETH_ALEN); _rtw_memcpy(pattrib->ta, pattrib->src, ETH_ALEN); - _rtw_memset(pattrib->dst, 0xFF, ETH_ALEN); + memset(pattrib->dst, 0xFF, ETH_ALEN); _rtw_memcpy(pattrib->ra, pattrib->dst, ETH_ALEN); /* pattrib->dhcp_pkt = 0; @@ -11580,7 +11580,7 @@ static struct xmit_frame *createloopbackpkt(PADAPTER padapter, u32 size) /* 2 4. fill TX descriptor */ desc = (struct tx_desc *)pframe->buf_addr; - _rtw_memset(desc, 0, TXDESC_SIZE); + memset(desc, 0, TXDESC_SIZE); fill_default_txdesc(pframe, (u8 *)desc); @@ -11803,9 +11803,9 @@ thread_return lbk_thread(thread_context context) fail++; ploopback->txsize = 0; - _rtw_memset(ploopback->txbuf, 0, 0x8000); + memset(ploopback->txbuf, 0, 0x8000); ploopback->rxsize = 0; - _rtw_memset(ploopback->rxbuf, 0, 0x8000); + memset(ploopback->rxbuf, 0, 0x8000); freeloopbackpkt(padapter, pxmitframe); pxmitframe = NULL; diff --git a/os_dep/linux/ioctl_mp.c b/os_dep/linux/ioctl_mp.c index 71de17c..4463795 100644 --- a/os_dep/linux/ioctl_mp.c +++ b/os_dep/linux/ioctl_mp.c @@ -60,14 +60,14 @@ int rtw_mp_write_reg(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; input[wrqu->length] = '\0'; - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); pch = input; @@ -83,7 +83,7 @@ int rtw_mp_write_reg(struct net_device *dev, return -EINVAL; *pnext = 0; /*addr = simple_strtoul(pch, &ptmp, 16); - _rtw_memset(buf, '\0', sizeof(buf)); + memset(buf, '\0', sizeof(buf)); _rtw_memcpy(buf, pch, pnext-pch); ret = kstrtoul(buf, 16, &addr);*/ ret = sscanf(pch, "%x", &addr); @@ -160,14 +160,14 @@ int rtw_mp_read_reg(struct net_device *dev, if (wrqu->length > 128) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; input[wrqu->length] = '\0'; - _rtw_memset(extra, 0, wrqu->length); - _rtw_memset(data, '\0', sizeof(data)); - _rtw_memset(tmp, '\0', sizeof(tmp)); + memset(extra, 0, wrqu->length); + memset(data, '\0', sizeof(data)); + memset(tmp, '\0', sizeof(tmp)); pch = input; pnext = strpbrk(pch, " ,.-"); if (pnext == NULL) @@ -286,7 +286,7 @@ int rtw_mp_write_rf(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, wrqu->length)) return -EFAULT; - _rtw_memset(input, 0, wrqu->length); + memset(input, 0, wrqu->length); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -302,7 +302,7 @@ int rtw_mp_write_rf(struct net_device *dev, if (data > 0xFFFFF) return -EINVAL; - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); write_rfreg(padapter, path, addr, data); @@ -338,7 +338,7 @@ int rtw_mp_read_rf(struct net_device *dev, if (wrqu->length > 128) return -EFAULT; - _rtw_memset(input, 0, wrqu->length); + memset(input, 0, wrqu->length); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -351,7 +351,7 @@ int rtw_mp_read_rf(struct net_device *dev, if (addr > 0xFF) return -EINVAL; - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(data, "%08x", read_rfreg(padapter, path, addr)); /*add read data format blank*/ @@ -401,7 +401,7 @@ int rtw_mp_start(struct net_device *dev, if (rtw_mp_cmd(padapter, MP_START, RTW_CMDF_WAIT_ACK) != _SUCCESS) ret = -EPERM; - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "mp_start %s\n", ret == 0 ? "ok" : "fail"); wrqu->length = strlen(extra); @@ -420,7 +420,7 @@ int rtw_mp_stop(struct net_device *dev, if (rtw_mp_cmd(padapter, MP_STOP, RTW_CMDF_WAIT_ACK) != _SUCCESS) ret = -EPERM; - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "mp_stop %s\n", ret == 0 ? "ok" : "fail"); wrqu->length = strlen(extra); @@ -440,7 +440,7 @@ int rtw_mp_rate(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -463,7 +463,7 @@ int rtw_mp_rate(struct net_device *dev, rate =(rate - MPT_RATE_VHT1SS_MCS0); */ } - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "Set data rate to %s index %d" , input, padapter->mppriv.rateidx); RTW_INFO("%s: %s rate index=%d\n", __func__, input, padapter->mppriv.rateidx); @@ -492,14 +492,14 @@ int rtw_mp_channel(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; input[wrqu->length] = '\0'; channel = rtw_atoi(input); /*RTW_INFO("%s: channel=%d\n", __func__, channel);*/ - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "Change channel %d to channel %d", padapter->mppriv.channel , channel); padapter->mppriv.channel = channel; SetChannel(padapter); @@ -522,14 +522,14 @@ int rtw_mp_ch_offset(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; input[wrqu->length] = '\0'; ch_offset = rtw_atoi(input); /*RTW_INFO("%s: channel=%d\n", __func__, channel);*/ - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "Change prime channel offset %d to %d", padapter->mppriv.prime_channel_offset , ch_offset); padapter->mppriv.prime_channel_offset = ch_offset; SetChannel(padapter); @@ -564,7 +564,7 @@ int rtw_mp_bandwidth(struct net_device *dev, padapter->mppriv.bandwidth = (u8)bandwidth; padapter->mppriv.preamble = sg; - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "Change BW %d to BW %d\n", pHalData->current_channel_bw , bandwidth); SetBandwidth(padapter); @@ -592,7 +592,7 @@ int rtw_mp_txpower_index(struct net_device *dev, if (wrqu->length > 128) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -681,7 +681,7 @@ int rtw_mp_ant_tx(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -731,13 +731,13 @@ int rtw_mp_ant_rx(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; input[wrqu->length] = '\0'; /*RTW_INFO("%s: input=%s\n", __func__, input);*/ - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "switch Rx antenna to %s", input); @@ -848,7 +848,7 @@ int rtw_mp_ctx(struct net_device *dev, } /*RTW_INFO("%s: count=%d countPkTx=%d cotuTx=%d CarrSprTx=%d scTx=%d sgleTx=%d pkTx=%d stop=%d\n", __func__, count, countPkTx, cotuTx, CarrSprTx, pkTx, sgleTx, scTx, stop);*/ - _rtw_memset(extra, '\0', strlen(extra)); + memset(extra, '\0', strlen(extra)); if (pktinterval != 0) { sprintf(extra, "Pkt Interval = %d", pktinterval); @@ -913,7 +913,7 @@ int rtw_mp_disable_bt_coexist(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->data.length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) return -EFAULT; @@ -1044,7 +1044,7 @@ int rtw_mp_arx(struct net_device *dev, pmppriv->bSetRxBssid = _FALSE; sprintf(extra, "Received packet OK:%d CRC error:%d ,Filter out:%d", padapter->mppriv.rx_pktcount, padapter->mppriv.rx_crcerrpktcount, padapter->mppriv.rx_pktcount_filter_out); } else if (bQueryPhy) { - _rtw_memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); + memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); rtw_dump_phy_rx_counters(padapter, &rx_counter); RTW_INFO("%s: OFDM_FA =%d\n", __func__, rx_counter.rx_ofdm_fa); @@ -1053,7 +1053,7 @@ int rtw_mp_arx(struct net_device *dev, } else if (bQueryMac) { - _rtw_memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); + memset(&rx_counter, 0, sizeof(struct dbg_rx_counter)); rtw_dump_mac_rx_counters(padapter, &rx_counter); sprintf(extra, "Mac Received packet OK: %d , CRC error: %d , Drop Packets: %d\n", rx_counter.rx_pkt_ok, rx_counter.rx_pkt_crc_error, rx_counter.rx_pkt_drop); @@ -1118,7 +1118,7 @@ int rtw_mp_trx_query(struct net_device *dev, rxfail = padapter->mppriv.rx_crcerrpktcount; rxfilterout = padapter->mppriv.rx_pktcount_filter_out; - _rtw_memset(extra, '\0', 128); + memset(extra, '\0', 128); sprintf(extra, "Tx OK:%d, Tx Fail:%d, Rx OK:%d, CRC error:%d ,Rx Filter out:%d\n", txok, txfail, rxok, rxfail, rxfilterout); @@ -1144,7 +1144,7 @@ int rtw_mp_pwrtrk(struct net_device *dev, if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); enable = 1; if (wrqu->length > 1) { @@ -1182,7 +1182,7 @@ int rtw_mp_psd(struct net_device *dev, if (rtw_do_mp_iwdata_len_chk(__func__, (wrqu->length + 1))) return -EFAULT; - _rtw_memset(input, 0, sizeof(input)); + memset(input, 0, sizeof(input)); if (copy_from_user(input, wrqu->pointer, wrqu->length)) return -EFAULT; @@ -1288,7 +1288,7 @@ int rtw_mp_reset_stats(struct net_device *dev, rtw_reset_phy_rx_counters(padapter); rtw_reset_mac_rx_counters(padapter); - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); sprintf(extra, "mp_reset_stats ok\n"); wrqu->length = strlen(extra); @@ -1375,7 +1375,7 @@ int rtw_mp_SetRFPath(struct net_device *dev, bMain = strncmp(input, "1", 2); /* strncmp TRUE is 0*/ bTurnoff = strncmp(input, "0", 3); /* strncmp TRUE is 0*/ - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); #ifdef CONFIG_ANTENNA_DIVERSITY if (bMain == 0) ret = rtw_mp_set_antdiv(padapter, _TRUE); @@ -1431,7 +1431,7 @@ int rtw_mp_switch_rf_path(struct net_device *dev, btg = strncmp(input, "BTG", 3); /* strncmp TRUE is 0*/ bbt = strncmp(input, "BT", 3); /* strncmp TRUE is 0*/ - _rtw_memset(extra, 0, wrqu->length); + memset(extra, 0, wrqu->length); #ifdef CONFIG_RTL8821C /* only support for 8821c wlg/wla/btg/bt RF switch path */ if (bwlg == 0) { pmp_priv->rf_path_cfg = SWITCH_TO_WLG; @@ -1734,7 +1734,7 @@ int rtw_mp_tx(struct net_device *dev, pmp_priv->tx.count = count; return 0; } else if (strncmp(extra, "setting", 7) == 0) { - _rtw_memset(extra, 0, wrqu->data.length); + memset(extra, 0, wrqu->data.length); pextra += sprintf(pextra, "Current Setting :\n Channel:%d", pmp_priv->channel); pextra += sprintf(pextra, "\n Bandwidth:%d", pmp_priv->bandwidth); pextra += sprintf(pextra, "\n Rate index:%d", pmp_priv->rateidx); @@ -1747,7 +1747,7 @@ int rtw_mp_tx(struct net_device *dev, #ifdef CONFIG_MP_VHT_HW_TX_MODE } else if (strncmp(extra, "pmact", 5) == 0) { if (strncmp(extra, "pmact=", 6) == 0) { - _rtw_memset(&pMptCtx->PMacTxInfo, 0, sizeof(pMptCtx->PMacTxInfo)); + memset(&pMptCtx->PMacTxInfo, 0, sizeof(pMptCtx->PMacTxInfo)); if (strncmp(extra, "pmact=start", 11) == 0) { pMptCtx->PMacTxInfo.bEnPMacTx = _TRUE; sprintf(extra, "Set PMac Tx Mode start\n"); @@ -1792,7 +1792,7 @@ int rtw_mp_tx(struct net_device *dev, pMptCtx->PMacTxInfo.Ntx++; } - _rtw_memset(pMptCtx->PMacTxInfo.MacAddress, 0xFF, ETH_ALEN); + memset(pMptCtx->PMacTxInfo.MacAddress, 0xFF, ETH_ALEN); PMAC_Get_Pkt_Param(&pMptCtx->PMacTxInfo, &pMptCtx->PMacPktInfo); @@ -1878,7 +1878,7 @@ int rtw_mp_tx(struct net_device *dev, if (sscanf(extra, "ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d", &channel, &bandwidth, &rate, &txpower, &ant, &txmode) < 6) { RTW_INFO("Invalid format [ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d]\n", channel, bandwidth, rate, txpower, ant, txmode); - _rtw_memset(extra, 0, wrqu->data.length); + memset(extra, 0, wrqu->data.length); pextra += sprintf(pextra, "\n Please input correct format as bleow:\n"); pextra += sprintf(pextra, "\t ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d\n", channel, bandwidth, rate, txpower, ant, txmode); pextra += sprintf(pextra, "\n [ ch : BGN = <1~14> , A or AC = <36~165> ]"); @@ -1897,7 +1897,7 @@ int rtw_mp_tx(struct net_device *dev, } else { char *pextra = extra; RTW_INFO("Got format [ch=%d,bw=%d,rate=%d,pwr=%d,ant=%d,tx=%d]\n", channel, bandwidth, rate, txpower, ant, txmode); - _rtw_memset(extra, 0, wrqu->data.length); + memset(extra, 0, wrqu->data.length); sprintf(extra, "Change Current channel %d to channel %d", padapter->mppriv.channel , channel); padapter->mppriv.channel = channel; SetChannel(padapter); @@ -2041,7 +2041,7 @@ int rtw_mp_rx(struct net_device *dev, #endif if (strncmp(extra, "stop", 4) == 0) { - _rtw_memset(extra, 0, wrqu->data.length); + memset(extra, 0, wrqu->data.length); SetPacketRx(padapter, bStartRx, _FALSE); pmp_priv->bmac_filter = _FALSE; sprintf(extra, "Received packet OK:%d CRC error:%d ,Filter out:%d", padapter->mppriv.rx_pktcount, padapter->mppriv.rx_crcerrpktcount, padapter->mppriv.rx_pktcount_filter_out); @@ -2050,7 +2050,7 @@ int rtw_mp_rx(struct net_device *dev, } else if (sscanf(extra, "ch=%d,bw=%d,ant=%d", &channel, &bandwidth, &ant) < 3) { RTW_INFO("Invalid format [ch=%d,bw=%d,ant=%d]\n", channel, bandwidth, ant); - _rtw_memset(extra, 0, wrqu->data.length); + memset(extra, 0, wrqu->data.length); pextra += sprintf(pextra, "\n Please input correct format as bleow:\n"); pextra += sprintf(pextra, "\t ch=%d,bw=%d,ant=%d\n", channel, bandwidth, ant); pextra += sprintf(pextra, "\n [ ch : BGN = <1~14> , A or AC = <36~165> ]"); @@ -2063,7 +2063,7 @@ int rtw_mp_rx(struct net_device *dev, char *pextra = extra; bStartRx = 1; RTW_INFO("Got format [ch=%d,bw=%d,ant=%d]\n", channel, bandwidth, ant); - _rtw_memset(extra, 0, wrqu->data.length); + memset(extra, 0, wrqu->data.length); sprintf(extra, "Change Current channel %d to channel %d", padapter->mppriv.channel , channel); padapter->mppriv.channel = channel; SetChannel(padapter); @@ -2153,9 +2153,9 @@ int rtw_mp_hwtx(struct net_device *dev, if (copy_from_user(input, wrqu->data.pointer, wrqu->data.length)) return -EFAULT; - _rtw_memset(&pMptCtx->PMacTxInfo, 0, sizeof(RT_PMAC_TX_INFO)); + memset(&pMptCtx->PMacTxInfo, 0, sizeof(RT_PMAC_TX_INFO)); _rtw_memcpy((void *)&pMptCtx->PMacTxInfo, (void *)input, sizeof(RT_PMAC_TX_INFO)); - _rtw_memset(wrqu->data.pointer, 0, wrqu->data.length); + memset(wrqu->data.pointer, 0, wrqu->data.length); if (pMptCtx->PMacTxInfo.bEnPMacTx == 1 && pmp_priv->mode != MP_ON) { sprintf(extra, "MP Tx Running, Please Set PMac Tx Mode Stop\n"); @@ -2236,7 +2236,7 @@ int rtw_efuse_mask_file(struct net_device *dev, u8 Status; PADAPTER padapter = rtw_netdev_priv(dev); - _rtw_memset(maskfileBuffer, 0x00, sizeof(maskfileBuffer)); + memset(maskfileBuffer, 0x00, sizeof(maskfileBuffer)); if (copy_from_user(extra, wrqu->data.pointer, wrqu->data.length)) return -EFAULT; @@ -2334,7 +2334,7 @@ int rtw_efuse_file_map(struct net_device *dev, rtw_efuse_file_map_path = extra; - _rtw_memset(pEfuseHal->fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN); + memset(pEfuseHal->fakeEfuseModifiedMap, 0xFF, EFUSE_MAX_MAP_LEN); if (rtw_is_file_readable(rtw_efuse_file_map_path) == _TRUE) { RTW_INFO("%s do rtw_efuse_mask_file_read = %s!\n", __func__, rtw_efuse_file_map_path); @@ -2371,7 +2371,7 @@ int rtw_bt_efuse_file_map(struct net_device *dev, rtw_efuse_file_map_path = extra; - _rtw_memset(pEfuseHal->fakeBTEfuseModifiedMap, 0xFF, EFUSE_BT_MAX_MAP_LEN); + memset(pEfuseHal->fakeBTEfuseModifiedMap, 0xFF, EFUSE_BT_MAX_MAP_LEN); if (rtw_is_file_readable(rtw_efuse_file_map_path) == _TRUE) { RTW_INFO("%s do rtw_efuse_mask_file_read = %s!\n", __func__, rtw_efuse_file_map_path); @@ -2474,7 +2474,7 @@ int rtw_mp_SetBT(struct net_device *dev, RTW_INFO("Wait for FirmwareDownloadBT fw boot!\n"); msleep(2000); - _rtw_memset(extra, '\0', wrqu->data.length); + memset(extra, '\0', wrqu->data.length); BtReq.opCodeVer = 1; BtReq.OpCode = 0; BtReq.paraLength = 0; @@ -2545,7 +2545,7 @@ int rtw_mp_SetBT(struct net_device *dev, /*hal_btcoex1ant_SetAntPath(padapter);*/ rtw_btcoex_SetManualControl(padapter, _TRUE); #endif - _rtw_memset(extra, '\0', wrqu->data.length); + memset(extra, '\0', wrqu->data.length); BtReq.opCodeVer = 1; BtReq.OpCode = 0; BtReq.paraLength = 0; @@ -2703,7 +2703,7 @@ int rtw_mp_SetBT(struct net_device *dev, } todo: - _rtw_memset(extra, '\0', wrqu->data.length); + memset(extra, '\0', wrqu->data.length); if (pHalData->bBTFWReady == _FALSE) { sprintf(extra, "BTFWReady = FALSE.\n"); diff --git a/os_dep/linux/mlme_linux.c b/os_dep/linux/mlme_linux.c index 247e45e..27d4a0a 100644 --- a/os_dep/linux/mlme_linux.c +++ b/os_dep/linux/mlme_linux.c @@ -112,13 +112,13 @@ void rtw_reset_securitypriv(_adapter *adapter) /* Backup the btkip_countermeasure information. */ /* When the countermeasure is trigger, the driver have to disconnect with AP for 60 seconds. */ - _rtw_memset(&backupPMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); + memset(&backupPMKIDList[0], 0x00, sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); _rtw_memcpy(&backupPMKIDList[0], &adapter->securitypriv.PMKIDList[0], sizeof(RT_PMKID_LIST) * NUM_PMKID_CACHE); backupPMKIDIndex = adapter->securitypriv.PMKIDIndex; backupTKIPCountermeasure = adapter->securitypriv.btkip_countermeasure; backupTKIPcountermeasure_time = adapter->securitypriv.btkip_countermeasure_time; - _rtw_memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv)); + memset((unsigned char *)&adapter->securitypriv, 0, sizeof(struct security_priv)); /* Added by Albert 2009/02/18 */ /* Restore the PMK information to securitypriv structure for the following connection. */ @@ -207,7 +207,7 @@ void rtw_report_sec_ie(_adapter *adapter, u8 authmode, u8 *sec_ie) p += sprintf(p, ")"); - _rtw_memset(&wrqu, 0, sizeof(wrqu)); + memset(&wrqu, 0, sizeof(wrqu)); wrqu.data.length = p - buff; diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index cf37f0a..3632c4d 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1009,7 +1009,7 @@ uint loadparam(_adapter *padapter) ) { if (rtw_country_code != rtw_country_unspecified) RTW_ERR("%s discard rtw_country_code not in alpha2\n", __func__); - _rtw_memset(registry_par->alpha2, 0xFF, 2); + memset(registry_par->alpha2, 0xFF, 2); } else _rtw_memcpy(registry_par->alpha2, rtw_country_code, 2); @@ -2129,7 +2129,7 @@ struct dvobj_priv *devobj_init(void) #endif #ifdef CONFIG_RTW_CUSTOMER_STR _rtw_mutex_init(&pdvobj->customer_str_mutex); - _rtw_memset(pdvobj->customer_str, 0xFF, RTW_CUSTOMER_STR_LEN); + memset(pdvobj->customer_str, 0xFF, RTW_CUSTOMER_STR_LEN); #endif pdvobj->processing_dev_remove = _FALSE; @@ -2397,7 +2397,7 @@ u8 rtw_init_drv_sw(_adapter *padapter) _rtw_spinlock_init(&padapter->security_key_mutex); /* We don't need to memset padapter->XXX to zero, because adapter is allocated by rtw_zvmalloc(). */ - /* _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv)); */ + /* memset((unsigned char *)&padapter->securitypriv, 0, sizeof (struct security_priv)); */ if (_rtw_init_sta_priv(&padapter->stapriv) == _FAIL) { RTW_INFO("Can't _rtw_init_sta_priv\n"); @@ -2424,7 +2424,7 @@ u8 rtw_init_drv_sw(_adapter *padapter) rtw_init_pwrctrl_priv(padapter); - /* _rtw_memset((u8 *)&padapter->qospriv, 0, sizeof (struct qos_priv)); */ /* move to mlme_priv */ + /* memset((u8 *)&padapter->qospriv, 0, sizeof (struct qos_priv)); */ /* move to mlme_priv */ #ifdef CONFIG_MP_INCLUDED if (init_mp_priv(padapter) == _FAIL) @@ -2997,7 +2997,7 @@ static int rtw_inetaddr_notifier_call(struct notifier_block *nb, ifa->ifa_label, pmlmeinfo->ip_addr); break; case NETDEV_DOWN: - _rtw_memset(pmlmeinfo->ip_addr, 0, RTW_IP_ADDR_LEN); + memset(pmlmeinfo->ip_addr, 0, RTW_IP_ADDR_LEN); RTW_DBG("%s[%s]: down IP: %pI4\n", __func__, ifa->ifa_label, pmlmeinfo->ip_addr); break; @@ -3053,7 +3053,7 @@ static int rtw_inet6addr_notifier_call(struct notifier_block *nb, #ifdef CONFIG_WOWLAN pwrctl->wowlan_ns_offload_en = _FALSE; #endif - _rtw_memset(pmlmeinfo->ip6_addr, 0, RTW_IPv6_ADDR_LEN); + memset(pmlmeinfo->ip6_addr, 0, RTW_IPv6_ADDR_LEN); RTW_DBG("%s: down IPv6 addrs: %pI6\n", __func__, pmlmeinfo->ip6_addr); break; diff --git a/os_dep/linux/recv_linux.c b/os_dep/linux/recv_linux.c index 35cae1d..63a3cfe 100644 --- a/os_dep/linux/recv_linux.c +++ b/os_dep/linux/recv_linux.c @@ -583,7 +583,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup cfg80211_michael_mic_failure(padapter->pnetdev, sta->cmn.mac_addr, key_type, -1, NULL, GFP_ATOMIC); #endif - _rtw_memset(&ev, 0x00, sizeof(ev)); + memset(&ev, 0x00, sizeof(ev)); if (bgroup) ev.flags |= IW_MICFAILURE_GROUP; else @@ -592,7 +592,7 @@ void rtw_handle_tkip_mic_err(_adapter *padapter, struct sta_info *sta, u8 bgroup ev.src_addr.sa_family = ARPHRD_ETHER; _rtw_memcpy(ev.src_addr.sa_data, sta->cmn.mac_addr, ETH_ALEN); - _rtw_memset(&wrqu, 0x00, sizeof(wrqu)); + memset(&wrqu, 0x00, sizeof(wrqu)); wrqu.data.length = sizeof(ev); #ifndef CONFIG_IOCTL_CFG80211 @@ -632,7 +632,7 @@ void rtw_hostapd_mlme_rx(_adapter *padapter, union recv_frame *precv_frame) skb_reset_mac_header(skb); /* skb_pull(skb, 24); */ - _rtw_memset(skb->cb, 0, sizeof(skb->cb)); + memset(skb->cb, 0, sizeof(skb->cb)); rtw_netif_rx(pmgnt_netdev, skb); diff --git a/os_dep/linux/rtw_cfgvendor.c b/os_dep/linux/rtw_cfgvendor.c index 3ba07f2..08e768d 100644 --- a/os_dep/linux/rtw_cfgvendor.c +++ b/os_dep/linux/rtw_cfgvendor.c @@ -1354,7 +1354,7 @@ void rtw_cfgvendor_rssi_monitor_evt(_adapter *padapter) { goto exit; } - _rtw_memset(&data, 0, sizeof(data)); + memset(&data, 0, sizeof(data)); data.version = RSSI_MONITOR_EVT_VERSION; data.cur_rssi = rssi; diff --git a/os_dep/linux/rtw_proc.c b/os_dep/linux/rtw_proc.c index 1aa1430..fa3b650 100644 --- a/os_dep/linux/rtw_proc.c +++ b/os_dep/linux/rtw_proc.c @@ -2477,7 +2477,7 @@ ssize_t proc_set_btinfo_evt(struct file *file, const char __user *buffer, size_t if (buffer && !copy_from_user(tmp, buffer, count)) { int num = 0; - _rtw_memset(btinfo, 0, 8); + memset(btinfo, 0, 8); num = sscanf(tmp, "%hhx %hhx %hhx %hhx %hhx %hhx %hhx %hhx" , &btinfo[0], &btinfo[1], &btinfo[2], &btinfo[3] @@ -4298,7 +4298,7 @@ ssize_t proc_set_phydm_cmd(struct file *file, const char __user *buffer, size_t if (NULL == phydm_msg) return -ENOMEM; } else - _rtw_memset(phydm_msg, 0, PHYDM_MSG_LEN); + memset(phydm_msg, 0, PHYDM_MSG_LEN); phydm_cmd(phydm, tmp, count, 1, phydm_msg, PHYDM_MSG_LEN); diff --git a/os_dep/linux/usb_ops_linux.c b/os_dep/linux/usb_ops_linux.c index 1d20cbf..62b6f22 100644 --- a/os_dep/linux/usb_ops_linux.c +++ b/os_dep/linux/usb_ops_linux.c @@ -95,7 +95,7 @@ int usbctrl_vendorreq(struct intf_hdl *pintfhdl, u8 request, u16 value, u16 inde } while (++vendorreq_times <= MAX_USBCTRL_VENDORREQ_TIMES) { - _rtw_memset(pIo_buf, 0, len); + memset(pIo_buf, 0, len); if (requesttype == 0x01) { pipe = usb_rcvctrlpipe(udev, 0);/* read_in */ diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index 2d8b36b..3d35bf3 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -940,27 +940,6 @@ int _rtw_memcmp(const void *dst, const void *src, u32 sz) -} - -void _rtw_memset(void *pbuf, int c, u32 sz) -{ - -#if defined(PLATFORM_LINUX) || defined (PLATFORM_FREEBSD) - - memset(pbuf, c, sz); - -#endif - -#ifdef PLATFORM_WINDOWS -#if 0 - NdisZeroMemory(pbuf, sz); - if (c != 0) - memset(pbuf, c, sz); -#else - NdisFillMemory(pbuf, sz, c); -#endif -#endif - } #ifdef PLATFORM_FREEBSD @@ -2560,7 +2539,7 @@ int map_readN(const struct map_t *map, u16 offset, u16 len, u8 *buf) goto exit; } - _rtw_memset(buf, map->init_value, len); + memset(buf, map->init_value, len); for (i = 0; i < map->seg_num; i++) { u8 *c_dst, *c_src;