[PATCH] staging:wlan-ng: use memdup_user instead of kmalloc/copy_from_user

2021-02-13 Thread Ivan Safonov
memdup_user() is shorter and safer equivalent of kmalloc/copy_from_user pair. Signed-off-by: Ivan Safonov --- drivers/staging/wlan-ng/p80211netdev.c | 28 -- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/drivers/staging/wlan-ng/p80211netdev.c b/drivers

[PATCH] staging:r8188eu: use IEEE80211_FCTL_* kernel definitions

2021-02-13 Thread Ivan Safonov
_TO_DS_, _FROM_DS_, _MORE_FRAG_, _RETRY_, _PWRMGT_, _MORE_DATA_, _PRIVACY_, _ORDER_ definitions are duplicate IEEE80211_FCTL_* kernel definitions. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/wifi.h | 51 ++-- 1 file changed, 21 insertions(+), 30

Re: [PATCH] staging: wlan-ng: Fixed incorrect type warning in p80211netdev.c

2021-02-18 Thread Ivan Safonov
ctl(struct net_device *dev, goto bail; } - msgbuf = memdup_user(req->data, req->len); + msgbuf = memdup_user((void __user *)req->data, req->len); if (IS_ERR(msgbuf)) { result = PTR_ERR(msgbuf); goto bail; Rev

[PATCH 0/4] staging:rtl8712: avoid unnecessary definitions in wifi.h

2021-02-27 Thread Ivan Safonov
wifi.h contains unnecessary definitions. Some of them are not used at all, some can be replaced with native definitions. Ivan Safonov (4): staging:rtl8712: replace get_(d|s)a with ieee80211_get_(D|S)A staging:rtl8712: remove unused definitions from wifi.h staging:rtl8712: use

[PATCH 1/4] staging:rtl8712: replace get_(d|s)a with ieee80211_get_(D|S)A

2021-02-27 Thread Ivan Safonov
get_da()/get_sa() duplicate native ieee80211_get_(D|S)A functions. Remove get_(d|s)a, use ieee80211_get_(D|S)A instead. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8712/rtl871x_recv.c | 4 +-- drivers/staging/rtl8712/wifi.h | 45 -- 2 files changed, 2

[PATCH 4/4] staging:rtl8712: replace cap_* definitions with native kernel WLAN_CAPABILITY_*

2021-02-27 Thread Ivan Safonov
cap_* definitions duplicate WLAN_CAPABILITY_*. Remove cap_* definitions, improve code consistency. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8712/ieee80211.c | 6 +++--- drivers/staging/rtl8712/wifi.h | 7 --- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a

[PATCH 3/4] staging:rtl8712: use IEEE80211_FCTL_* kernel definitions

2021-02-27 Thread Ivan Safonov
_TO_DS_, _FROM_DS_, _MORE_FRAG_, _RETRY_, _PWRMGT_, _MORE_DATA_, _PRIVACY_, _ORDER_ definitions are duplicate IEEE80211_FCTL_* kernel definitions. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8712/wifi.h | 52 ++ 1 file changed, 22 insertions(+), 30

[PATCH 2/4] staging:rtl8712: remove unused definitions from wifi.h

2021-02-27 Thread Ivan Safonov
These definitions are not used and will not be useful in the future. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8712/wifi.h | 74 -- 1 file changed, 74 deletions(-) diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h index

[PATCH 2/4] staging:r8188eu: remove unused definitions from wifi.h

2021-03-14 Thread Ivan Safonov
These definitions are not used and will not be useful in the future. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/wifi.h | 92 1 file changed, 92 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/staging/rtl8188eu

[PATCH 0/4] staging:r8188eu: remove unnecessary definitions from wifi.h

2021-03-14 Thread Ivan Safonov
wifi.h contains unnecessary definitions. Some of them are not used at all, some can be replaced with native definitions. Ivan Safonov (4): staging:r8188eu: replace get_(d|s)a with ieee80211_get_(D|S)A staging:r8188eu: remove unused definitions from wifi.h staging:r8188eu: replace cap_

[PATCH 4/4] staging:r8188eu: use ieee80211_is_ctl instead IsFrameTypeCtrl

2021-03-14 Thread Ivan Safonov
IsFrameTypeCtrl() duplicate ieee80211_is_ctl(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/rtl8188e_rxdesc.c | 8 +--- drivers/staging/rtl8188eu/include/wifi.h| 8 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/staging/rtl8188eu

[PATCH 3/4] staging:r8188eu: replace cap_* definitions with native kernel WLAN_CAPABILITY_*

2021-03-14 Thread Ivan Safonov
cap_* definitions duplicate WLAN_CAPABILITY_*. Remove cap_* definitions, improve code consistency. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 6 +++--- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 6 +++--- drivers/staging/rtl8188eu/include/wifi.h

[PATCH 1/4] staging:r8188eu: replace get_(d|s)a with ieee80211_get_(D|S)A

2021-03-14 Thread Ivan Safonov
get_da()/get_sa() duplicate native ieee80211_get_(D|S)A functions. Remove get_(d|s)a, use ieee80211_get_(D|S)A instead. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 6 +-- drivers/staging/rtl8188eu/core/rtw_recv.c | 4 +- .../staging/rtl8188eu/hal

[PATCH] staging: r8188eu: replace enum rtw_ieee80211_spectrum_mgmt_actioncode with ieee80211_spectrum_mgmt_actioncode

2020-09-06 Thread Ivan Safonov
Enum rtw_ieee80211_spectrum_mgmt_actioncode is a duplication of ieee80211_spectrum_mgmt_actioncode from include/linux/ieee80211.h. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 10 +- drivers/staging/rtl8188eu/include/ieee80211.h | 10 -- 2

[PATCH] staging:r8188eu: replace WIFI_REASON_CODE enum with native ieee80211_reasoncode

2020-09-19 Thread Ivan Safonov
WIFI_REASON_CODE is duplication of enum ieee80211_reasoncode. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 4 +-- drivers/staging/rtl8188eu/include/wifi.h | 31 --- 2 files changed, 2 insertions(+), 33 deletions(-) diff --git a/drivers

[PATCH] staging: r8188eu: remove unnecessary type casts (struct wlan_bssid_ex *)

2020-10-03 Thread Ivan Safonov
Reduce line length, simplify refactoring. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ap.c | 10 +- drivers/staging/rtl8188eu/core/rtw_cmd.c | 4 ++-- drivers/staging/rtl8188eu/core/rtw_mlme.c | 2 +- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c

[PATCH] staging: r8188eu: use native wireless IE codes from linux/ieee80211.h

2020-10-11 Thread Ivan Safonov
IE code definitions have been replaced with native ones to avoid code duplication. The unobvious substitutions are: _SSN_IE_1_ -> WLAN_EID_VENDOR_SPECIFIC; _WPA_IE_ID_ -> WLAN_EID_VENDOR_SPECIFIC; _WPA2_IE_ID_ -> WLAN_EID_RSN. Signed-off-by: Ivan Safonov --- drivers/staging/rtl81

[PATCH] staging: rtl8723bs: remove unnecessary type cast of rtw_netdev_priv() result

2020-10-11 Thread Ivan Safonov
The type cast padapter = (struct adapter *)rtw_netdev_priv(dev); do nothing because type of rtw_netdev_priv() result is (struct adapter *). Signed-off-by: Ivan Safonov --- .../staging/rtl8723bs/core/rtw_wlan_util.c| 6 +- .../staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 50

[PATCH] staging: r8188eu: inline rtw_init_netdev_name()

2020-10-18 Thread Ivan Safonov
The rtw_init_netdev_name() is a small function that is used once and does not encapsulate any logic. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/osdep_intf.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c| 9 - drivers/staging/rtl8188eu/os_dep/usb_intf.c

[PATCH] staging:rtl8712: remove unused enum WIFI_STATUS_CODE

2021-01-31 Thread Ivan Safonov
Improve readability. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8712/wifi.h | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/staging/rtl8712/wifi.h b/drivers/staging/rtl8712/wifi.h index 601d4ff607bc..1b32b3510093 100644 --- a/drivers/staging/rtl8712/wifi.h

[PATCH] staging:r8188eu: replace enum WIFI_STATUS_CODE with native kernel definitions

2021-01-31 Thread Ivan Safonov
Driver and kernel definitions are equal. Avoid code duplication, improve readability. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 44 +-- drivers/staging/rtl8188eu/include/wifi.h | 14 -- 2 files changed, 22 insertions(+), 36

Re: [PATCH] Revert "staging:r8188eu: use lib80211 CCMP decrypt"

2019-01-01 Thread Ivan Safonov
I suggested a patch for loading modules from interruptible mode, but this patch remained unclaimed ( http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-August/124851.html ). For some reason I thought that this patch had been removed and did not track the fate of this code

Re: [PATCH] Revert "staging:r8188eu: use lib80211 CCMP decrypt"

2019-01-02 Thread Ivan Safonov
On 1/2/19 12:38 AM, Larry Finger wrote: On 1/1/19 3:02 AM, Ivan Safonov wrote: I suggested a patch for loading modules from interruptible mode, but this patch remained unclaimed ( http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2018-August/124851.html ). For some reason I

Re: [PATCH] Revert "staging:r8188eu: use lib80211 CCMP decrypt"

2019-01-02 Thread Ivan Safonov
On 1/2/19 4:06 AM, Larry Finger wrote: On 1/1/19 1:31 PM, Michael Straube wrote: I've tested your patch and it solved the issue. No freezes and dmesg looks good. I noticed that try_then_request_module() is also used in rtw_wep_encrypt() and rtw_wep_decrypt(). I guess that also could cause

[PATCH] staging: netlogic: replace skb_put/pull pair with skb_reserve

2019-03-20 Thread Ivan Safonov
The sequence skb_put(skb); skb_pull(skb); leads to the same result as skb_reserve(skb); but second is a little shorter and clearer. Signed-off-by: Ivan Safonov --- drivers/staging/netlogic/xlr_net.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers

[PATCH] staging: r8188eu: refactor recvframe_defrag()

2019-03-20 Thread Ivan Safonov
Local variables pfhdr and prframe always have a same value, so one of them is unnecessary. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 13 ++--- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b

[PATCH] r8188eu: use skb_put_data instead of skb_put/memcpy pair

2019-08-25 Thread Ivan Safonov
skb_put_data is shorter and clear. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c| 6 +- drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 3 +-- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c b

Re: [PATCH] r8188eu: use skb_put_data instead of skb_put/memcpy pair

2019-08-31 Thread Ivan Safonov
On 8/27/19 1:31 PM, Dan Carpenter wrote: On Sun, Aug 25, 2019 at 11:48:58PM +0300, Ivan Safonov wrote: skb_put_data is shorter and clear. Please don't start the commit message in the middle of a sentence. It often gets split from the start of the sentence. See how it looks here.

[PATCH v2] staging: r8188eu: use skb_put_data instead of skb_put/memcpy pair

2019-09-01 Thread Ivan Safonov
skb_put_data is shorter and clear. Signed-off-by: Ivan Safonov --- Changes in v2: - add "staging: " in message subject; - all code lines now have no breaks in the middle of a sentence. drivers/staging/rtl8188eu/core/rtw_recv.c| 6 +- drivers/staging/rtl818

[PATCH] staging: r8188eu: replace rtw_malloc() with it's definition

2019-09-08 Thread Ivan Safonov
rtw_malloc prevents the use of kmemdup/kzalloc and others. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ap.c| 4 ++-- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +- .../staging/rtl8188eu/include/osdep_service.h | 3 --- drivers/staging/rtl8188eu/os_dep

Re: [PATCH] staging: r8188eu: replace rtw_malloc() with it's definition

2019-09-14 Thread Ivan Safonov
On 9/10/19 2:59 PM, Dan Carpenter wrote: On Sun, Sep 08, 2019 at 12:00:26PM +0300, Ivan Safonov wrote >> rtw_malloc prevents the use of kmemdup/kzalloc and others. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ap.c| 4 ++-- drivers/staging/rtl8188e

[PATCH] staging:r8192u: replace request_module with try_then_request_module

2017-09-10 Thread Ivan Safonov
Return value of request_module() does not handled, so it is possible to use shorter try_then_request_module(). Signed-off-by: Ivan Safonov --- .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 27 +++--- drivers/staging/rtl8192u/ieee80211/ieee80211_wx.c | 15 2

[PATCH v2] staging:r8188eu: Use lib80211 to encrypt (WEP) tx frames

2018-06-30 Thread Ivan Safonov
Put data to skb, decrypt with lib80211_crypt_wep, and place back to tx buffer. --- v2: - refactor error handling. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_security.c | 82 +++ 1 file changed, 47 insertions(+), 35 deletions(-) diff --git a

[PATCH v3] staging:r8188eu: Use lib80211 to encrypt (WEP) tx frames

2018-06-30 Thread Ivan Safonov
Put data to skb, decrypt with lib80211_crypt_wep, and place back to tx buffer. Signed-off-by: Ivan Safonov --- v2: - refactor error handling, v3: - fix commit message. drivers/staging/rtl8188eu/core/rtw_security.c | 82 +++ 1 file changed, 47 insertions(+), 35

[PATCH 2/2] staging:r8188eu: Use lib80211 to encrypt (CCMP) tx frames

2018-07-14 Thread Ivan Safonov
Put data to skb, decrypt with lib80211_crypt_ccmp, and place back to tx buffer. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_security.c | 778 +++--- 1 file changed, 72 insertions(+), 706 deletions(-) diff --git a/drivers/staging/rtl8188eu/core

[PATCH 1/2] staging:r8188eu: Use lib80211 to encrypt (TKIP) tx frames

2018-07-14 Thread Ivan Safonov
Put data to skb, decrypt with lib80211_crypt_tkip, and place back to tx buffer. MIC calculation will be replaced later. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_security.c | 419 +- 1 file changed, 77 insertions(+), 342 deletions(-) diff --git

Re: [PATCH 4.17 REGRESSION fix] Revert "staging:r8188eu: Use lib80211 to support TKIP"

2018-07-15 Thread Ivan Safonov
a few seconds later. Subsequent reboots also all lead to scenario 2. Until I reverted the commit again. Revert the commit fixes both issues making the laptop usable again. It is really bad idea to load module in tasklet. Acked-by: Ivan Safonov Cc: sta...@vger.kernel.org Cc: Ivan Safon

[PATCH] staging:r8188eu: load lib80211 crypto ops from interruptible context

2018-08-11 Thread Ivan Safonov
Preloading lib80211_crypt_* modules from an ioctl handlers prevents the module loading from a tasklet. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ap.c | 4 +- drivers/staging/rtl8188eu/core/rtw_cmd.c | 8 +- drivers/staging/rtl8188eu/core

[PATCH 1/9] staging:r8188eu: use DIV_ROUND_UP() in rtw_signal_stat_timer_hdl()

2017-02-14 Thread Ivan Safonov
DIV_ROUND_UP macro is shorter and look better than if-else construction. DIV_ROUND_UP used in rtw_signal_stat_timer_hdl(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/staging

[PATCH 7/9] staging:r8188eu: refactor HT_caps_handler() - remove rtw_hal_get_hwreg() call

2017-02-14 Thread Ivan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor HT_caps_handler(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions

[PATCH 9/9] staging:r8188eu: remove unused MCS_rate_2R array

2017-02-14 Thread Ivan Safonov
MCS_rate_2R[] does not used. Remove it. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 1 - drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 1 - drivers/staging/rtl8188eu/include/rtw_mlme.h | 1 - 3 files changed, 3 deletions(-) diff --git a/drivers/staging

[PATCH 4/9] staging:r8188eu: refactor rtw_get_cur_max_rate() - remove rtw_hal_get_hwreg() call

2017-02-14 Thread Ivan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor rtw_get_cur_max_rate(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff

[PATCH 8/9] staging:r8188eu: remove unused HW_VAR_RF_TYPE parameter of HT_caps_handler

2017-02-14 Thread Ivan Safonov
rtw_hal_get_hwreg() does not used with HW_VAR_RF_TYPE parameter. Remove HW_VAR_RF_TYPE switch case in rtw_hal_get_hwreg and definition. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 3 --- drivers/staging/rtl8188eu/include/hal_intf.h | 1 - 2 files changed, 4

[PATCH 3/9] staging:r8188eu: refactor rtw_check_beacon_data() - remove rtw_hal_get_hwreg() call

2017-02-14 Thread Ivan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor rtw_check_beacon_data(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ap.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff

[PATCH 5/9] staging:r8188eu: refactor issue_assocreq() - remove rtw_hal_get_hwreg() call

2017-02-14 Thread Ivan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor issue_assocreq(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 24 1 file changed, 4 insertions(+), 20

[PATCH 6/9] staging:r8188eu: refactor rtw_update_ht_cap() - remove rtw_hal_get_hwreg() call

2017-02-14 Thread Ivan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor rtw_update_ht_cap(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 11 ++- 1 file changed, 2 insertions(+), 9 deletions

[PATCH 2/9] staging:r8188eu: refactor add_RATid() - remove rtw_hal_get_hwreg() call

2017-02-14 Thread Ivan Safonov
rtw_hal_get_hwreg(..., HW_VAR_RF_TYPE,...) always return RF_1T1R value. Replace the function call with RF_1T1R value and refactor add_RATid(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ap.c | 13 ++--- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git

[PATCH] staging:r8188eu: add iv length to frame data offset

2017-03-20 Thread Ivan Safonov
If this frame contains IV/ICV fields, ether_type field located a little farther. This bug already fixed here: https://github.com/lwfinger/rtl8188eu/blob/master/core/rtw_recv.c#L569 . Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +- 1 file changed, 1 insertion

Re: [PATCH 1/1] staging: rtl8188eu: Macros with complex values should be enclosed in parentheses

2017-03-28 Thread Ivan Safonov
ine__, str));\ - } + }) enum oid_type { QUERY_OID, Probably, DEBUG_OID macro does not used, so you can remove it. Ivan Safonov. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo

[PATCH 4/6] staging:r8188eu: replace rtw_software_encrypt with its default value

2017-04-02 Thread Ivan Safonov
rtw_software_encrypt used only once and does not changed. Replace it with 0. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/os_intfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging

[PATCH 1/6] staging:r8188eu: replace rtw_software_decrypt with its value

2017-04-02 Thread Ivan Safonov
rtw_software_decrypt used only once and does not changed. Replace it with 0. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu

[PATCH 2/6] staging:r8188eu: remove software_decrypt member of registry_priv struct

2017-04-02 Thread Ivan Safonov
Value of this variable has no changes, and used once. Replace software_decrypt with its value. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git

[PATCH 5/6] staging:r8188eu: remove software_encrypt member of registry_priv struct

2017-04-02 Thread Ivan Safonov
Value of this variable does not changed after initialization. Replace software_encrypt with its default value. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions

[PATCH 6/6] staging:r8188eu: remove sw_encrypt member of security_priv struct

2017-04-02 Thread Ivan Safonov
sw_encrypt always is 0. Replace sw_encrypt with 0. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_xmit.c| 10 -- drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 3 +-- drivers/staging/rtl8188eu/include/rtw_security.h | 1 - drivers/staging/rtl8188eu

[PATCH 3/6] staging:r8188eu: remove sw_decrypt member of security_priv struct

2017-04-02 Thread Ivan Safonov
sw_decrypt always is 0, so replace it with 0. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c| 4 ++-- drivers/staging/rtl8188eu/include/rtw_security.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 1 - 3 files changed, 2 insertions(+), 4 deletions

[PATCH] staging:r8188eu: Remove rx_handler_data unnecessary read

2018-05-09 Thread Ivan Safonov
Rx handler (assigned with netdev_rx_handler_register, called from __netif_receive_skb()) uses value of dev->rx_handler_data. The driver has no rx handler and does not need it, so remove rx_handler_data read. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/TODO

[PATCH] staging:r8188eu: Use lib80211 to encrypt (WEP) tx frames

2018-05-27 Thread Ivan Safonov
Put data to skb, decrypt with lib80211_crypt_wep, and place back to tx buffer. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_security.c | 72 --- 1 file changed, 43 insertions(+), 29 deletions(-) diff --git a/drivers/staging/rtl8188eu/core

Re: [PATCH] staging:r8188eu: Use lib80211 to encrypt (WEP) tx frames

2018-06-03 Thread Ivan Safonov
On 05/28/2018 04:53 PM, Dan Carpenter wrote: On Mon, May 28, 2018 at 09:18:21AM +0300, Ivan Safonov wrote: Put data to skb, decrypt with lib80211_crypt_wep, and place back to tx buffer. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_security.c | 72

Re: [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64()

2020-04-12 Thread Ivan Safonov
g: rtl8723bs: Remove function rtw_modular64()' have same bug. Ivan Safonov. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

[PATCH] staging: r8188eu: replace rtw_malloc/copy_from_user sequence with memdup_user

2020-04-12 Thread Ivan Safonov
memdup_user is shorter and expressively. Signed-off-by: Ivan Safonov --- .../staging/rtl8188eu/os_dep/ioctl_linux.c| 22 +-- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep

Re: [PATCH 5/8] staging: rtl8188eu: Remove function rtw_modular64()

2020-04-14 Thread Ivan Safonov
On 4/14/20 2:56 PM, Dan Carpenter wrote: On Sun, Apr 12, 2020 at 04:34:08PM +0300, Ivan Safonov wrote: Remove function rtw_modular64 as all it does is call do_div. This is wrong. Macro do_div(x, y) change first argument x, but rtw_modular64(x, y) preserve it. + tsf

[PATCH] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion

2020-04-18 Thread Ivan Safonov
skb clones use same data buffer, so tail of one skb is corrupted by beginning of next skb. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 19 ++- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/core

Re: [PATCH] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion

2020-04-23 Thread Ivan Safonov
On 4/23/20 2:29 PM, Greg Kroah-Hartman wrote: On Sat, Apr 18, 2020 at 11:41:12AM +0300, Ivan Safonov wrote: skb clones use same data buffer, so tail of one skb is corrupted by beginning of next skb. Please properly wrap your changelog text at the correct column (72). Also, your subject

[PATCH v2] staging:r8188eu: avoid skb_clone for amsdu to msdu conversion

2020-04-23 Thread Ivan Safonov
skb clones use same data buffer, so tail of one skb is corrupted by beginning of next skb. Signed-off-by: Ivan Safonov --- Changes in v2: - long line in the commit message is divided into two parts. drivers/staging/rtl8188eu/core/rtw_recv.c | 19 ++- 1 file changed, 6

[PATCH] staging:rtl8723bs: eliminate usage of skb_clone after skb allocation fail

2020-05-02 Thread Ivan Safonov
The skb allocated when out of memory is likely to be discarded during subsequent processing. Signed-off-by: Ivan Safonov --- .../staging/rtl8723bs/hal/rtl8723bs_recv.c| 44 ++- drivers/staging/rtl8723bs/os_dep/recv_linux.c | 19 +++- 2 files changed, 19 insertions(+), 44

[PATCH 2/7] staging:r8188eu: use different mon_recv_decrypted() inside rtl88eu_mon_recv_hook() and rtl88eu_mon_xmit_hook().

2017-05-01 Thread Ivan Safonov
Create mon_recv_decrypted_recv() to change rtl88eu_mon_recv_hook() without affect to rtl88eu_mon_xmit_hook(). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/mon.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/drivers/staging

[PATCH 4/7] staging:r8188eu: trim IV/ICV fields in validate_recv_data_frame()

2017-05-01 Thread Ivan Safonov
Length of IV/ICV fields calculated here, so trim these field here too. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_recv.c | 17 ++--- drivers/staging/rtl8188eu/os_dep/mon.c| 19 --- 2 files changed, 14 insertions(+), 22 deletions(-) diff

[PATCH 3/7] staging:r8188eu: inline unprotect_frame() in mon_recv_decrypted_recv()

2017-05-01 Thread Ivan Safonov
It is useful to remove IV/ICV from rtl88eu_mon_recv_hook(). Also unprotect_frame() will be very short without skb_(pull|trim). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/mon.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers

[PATCH 1/7] staging:r8188eu: move IV/ICV trimming into decrypt() and also place it after rtl88eu_mon_recv_hook()

2017-05-01 Thread Ivan Safonov
IV/ICV should be trimmed immediately after decoding (this is a decryptor job). Trim IV/ICV inside decrypt() for SW decrypted frames, for HW decrypted - before rtl88eu_mon_recv_hook(). Adopt frames receive process to work without IV/ICV fields. Signed-off-by: Ivan Safonov --- drivers/staging

[PATCH 7/7] staging:r8188eu: remove unused definitions from include/ieee80211.h

2017-05-01 Thread Ivan Safonov
Remove unused RTW_IEEE80211_FCTL_*, RTW_IEEE80211_FTYPE_*, RTW_IEEE80211_STYPE_*, IEEE80211_STATMASK_*, IEEE80211_DEFAULT_*, BEACON_PROBE_SSID_ID_POSITION, MFIE_TYPE_*, IEEE80211_DTIM_* and IEEE80211_PS_*. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/ieee80211.h | 91

[PATCH 5/7] staging:r8188eu: remove ieee80211_get_hdrlen()

2017-05-01 Thread Ivan Safonov
ieee80211_get_hdrlen is unused, remove it and all corresponding code. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 27 -- drivers/staging/rtl8188eu/include/ieee80211.h | 13 - 2 files changed, 40 deletions(-) diff --git a

[PATCH 6/7] staging:r8188eu: remove ieee80211_is_empty_essid()

2017-05-01 Thread Ivan Safonov
ieee80211_is_empty_essid() is unused, remove it. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 17 - drivers/staging/rtl8188eu/include/ieee80211.h | 3 --- 2 files changed, 20 deletions(-) diff --git a/drivers/staging/rtl8188eu/core

[PATCH 01/12] staging: rtl8188eu: if/else replaced by min_t

2015-11-07 Thread Ivan Safonov
Duplicated code removed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 433b926..69f8744d9 100644 --- a

[PATCH 08/12] staging: rtl8188eu: if (a) ; else {...} replaced by if (!a) {...}

2015-11-07 Thread Ivan Safonov
It is looks bit better. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 7c79774

[PATCH 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function

2015-11-07 Thread Ivan Safonov
Ideally the function should not change the variables outside of its body. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index

[PATCH 06/12] staging: rtl8188eu: use memset instead of for loop

2015-11-07 Thread Ivan Safonov
memset clearer than the for loop. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 7f1df4d..298e3e8 100644 --- a/drivers

[PATCH 10/12] staging: rtl8188eu: reg_macid variable removed in hw_var_set_macaddr

2015-11-07 Thread Ivan Safonov
The reg_macid variable used only once. Also idx renamed to i and Adapter to adapter. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b

[PATCH 04/12] staging: rtl8188eu: remove unused hal_data_8188e members

2015-11-07 Thread Ivan Safonov
u8 *pfirmware and u32 fwsize of hal_data_8188e structure not used. The pfwdata variable used to store a pointer to the buffer in rtl88eu_download_fw and the pfwbody variable points to the body of the firmware (without header). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c

[PATCH 12/12] staging: rtl8188eu: remove unused RTW_STATUS_CODE function

2015-11-07 Thread Ivan Safonov
This driver is only for the Linux kernel. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/osdep_service.h | 2 -- drivers/staging/rtl8188eu/os_dep/osdep_service.c | 11 --- 2 files changed, 13 deletions(-) diff --git a/drivers/staging/rtl8188eu/include

[PATCH 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc

2015-11-07 Thread Ivan Safonov
_rtl88e_fill_dummy fills the array elemets with zeros if necessary. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 1d8930a

[PATCH 02/13] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function

2015-11-07 Thread Ivan Safonov
Ideally the function should not change the variables outside of its body. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index

[PATCH 03/12] staging: rtl8188eu: change error code from -1 to -EFBIG

2015-11-07 Thread Ivan Safonov
-EFBIG more sutiable then -1 Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 5b569ef..3e354eb 100644 --- a/drivers/staging

[PATCH 03/13] staging: rtl8188eu: change error code from -1 to -EFBIG

2015-11-07 Thread Ivan Safonov
-EFBIG more sutiable then -1 Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 5b569ef..3e354eb 100644 --- a/drivers/staging

[PATCH 11/12] staging: rtl8188eu: reg_bssid variable removed in hw_var_set_bssid

2015-11-07 Thread Ivan Safonov
The reg_bssid variable used only once. Also idx renamed to i and Adapter to adapter. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b

[PATCH 01/13] staging: rtl8188eu: if/else replaced by min_t

2015-11-07 Thread Ivan Safonov
Duplicated code removed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 433b926..69f8744d9 100644 --- a

[PATCH 09/12] staging: rtl8188eu: remove redundant spases

2015-11-07 Thread Ivan Safonov
They are not needed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 62f83ab..0e2528a

[PATCH 04/13] staging: rtl8188eu: remove unused hal_data_8188e members

2015-11-07 Thread Ivan Safonov
u8 *pfirmware and u32 fwsize of hal_data_8188e structure not used. The pfwdata variable used to store a pointer to the buffer and the pfwbody variable points to the firmware body (firmware without header). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 16

[PATCH 07/12] staging: rtl8188eu: sets the error code in wpa_set_encryption

2015-11-07 Thread Ivan Safonov
Most likely it is missed here. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index a076ede..7c79774 100644 --- a

Re: [PATCH 12/12] staging: rtl8188eu: remove unused RTW_STATUS_CODE function

2015-11-07 Thread Ivan Safonov
On 11/08/2015 01:53 PM, Ivan Safonov wrote: This driver is only for the Linux kernel. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/osdep_service.h | 2 -- drivers/staging/rtl8188eu/os_dep/osdep_service.c | 11 --- 2 files changed, 13 deletions(-) diff --git

[PATCH v2 01/12] staging: rtl8188eu: if/else replaced by min_t

2015-11-07 Thread Ivan Safonov
Duplicated code removed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_cmd.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/core/rtw_cmd.c b/drivers/staging/rtl8188eu/core/rtw_cmd.c index 433b926..69f8744d9 100644 --- a

[PATCH v2 02/12] staging: rtl8188eu: return value and argument types changed in _rtl88e_write_fw function

2015-11-07 Thread Ivan Safonov
Ideally the function should not change the variables outside of its body. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index

[PATCH v2 03/12] staging: rtl8188eu: change error code from -1 to -EFBIG

2015-11-07 Thread Ivan Safonov
-EFBIG more sutiable then -1 Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 5b569ef..3e354eb 100644 --- a/drivers/staging

[PATCH v2 04/12] staging: rtl8188eu: remove unused hal_data_8188e members

2015-11-07 Thread Ivan Safonov
u8 *pfirmware and u32 fwsize of hal_data_8188e structure not used. The pfwdata variable used to store a pointer to the buffer in rtl88eu_download_fw and the pfwbody variable points to the body of the firmware (without header). Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c

[PATCH v2 05/12] staging: rtl8188eu: kzalloc replaced by kmalloc

2015-11-07 Thread Ivan Safonov
_rtl88e_fill_dummy fills the array elemets with zeros if necessary. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 1d8930a

[PATCH v2 06/12] staging: rtl8188eu: use memset instead of for loop

2015-11-07 Thread Ivan Safonov
memset clearer than the for loop. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/fw.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/fw.c b/drivers/staging/rtl8188eu/hal/fw.c index 7f1df4d..298e3e8 100644 --- a/drivers

[PATCH v2 07/12] staging: rtl8188eu: sets the error code in wpa_set_encryption

2015-11-07 Thread Ivan Safonov
Most likely it is missed here. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index a076ede..7c79774 100644 --- a

[PATCH v2 08/12] staging: rtl8188eu: if (a) ; else {...} replaced by if (!a) {...}

2015-11-07 Thread Ivan Safonov
It is looks bit better. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 7c79774

[PATCH v2 09/12] staging: rtl8188eu: remove redundant spases

2015-11-07 Thread Ivan Safonov
They are not needed. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/os_dep/ioctl_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c b/drivers/staging/rtl8188eu/os_dep/ioctl_linux.c index 62f83ab..0e2528a

[PATCH v2 11/12] staging: rtl8188eu: reg_bssid variable removed in hw_var_set_bssid

2015-11-07 Thread Ivan Safonov
The reg_bssid variable used only once. Also idx renamed to i and Adapter to adapter. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b

[PATCH v2 10/12] staging: rtl8188eu: reg_macid variable removed in hw_var_set_macaddr

2015-11-07 Thread Ivan Safonov
The reg_macid variable used only once. Also idx renamed to i and Adapter to adapter. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rtl8188eu/hal/usb_halinit.c b

  1   2   3   4   5   >