[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 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 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 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 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 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 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 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

[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 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

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] 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

[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: 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

[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: 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: 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: 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: r8188eu: remove unnecessary type casts (struct wlan_bssid_ex *)

2020-10-04 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: 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: 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: remove unnecessary type cast of rtw_netdev_priv() result

2020-08-15 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 --- drivers/staging/rtl8188eu/core/rtw_debug.c| 8 +- drivers/staging/rtl8188eu/core/rtw_pwrctrl.c | 2 +- .../staging

[PATCH] staging: rtl8723bs: replace rtw_netdev_priv define with inline function

2020-08-02 Thread Ivan Safonov
The function guarantees type checking of arguments and return value. Result of rtw_netdev_priv macro can be assigned to pointer with incompatible type without warning. The function allow compiler to perform this check. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8723bs/include

[PATCH v3] staging: r8188eu: replace rtw_netdev_priv define with inline function

2020-08-01 Thread Ivan Safonov
The function guarantees type checking of arguments and return value. Result of rtw_netdev_priv macro can be assigned to pointer with incompatible type without warning. The function allow compiler to perform this check. Signed-off-by: Ivan Safonov --- Changes in v2: - add blank line after

[PATCH v2] staging: r8188eu: replace rtw_netdev_priv define with inline function

2020-08-01 Thread Ivan Safonov
The function guarantees type checking of arguments and return value. Result of rtw_netdev_priv macro can be assigned to pointer with incompatible type without warning. The function allow compiler to perform this check. Signed-off-by: Ivan Safonov --- Changes in v2: - add blank line after

Re: [PATCH] staging: r8188eu: replace rtw_netdev_priv define with inline function

2020-08-01 Thread Ivan Safonov
On 8/1/20 12:51 PM, Greg Kroah-Hartman wrote: On Sat, Aug 01, 2020 at 12:47:07PM +0300, Ivan Safonov wrote: The function guarantees type checking of arguments and return value. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/osdep_service.h | 6 -- 1 file changed, 4

[PATCH] staging: r8188eu: replace rtw_netdev_priv define with inline function

2020-08-01 Thread Ivan Safonov
The function guarantees type checking of arguments and return value. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/osdep_service.h | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h b/drivers/staging

[PATCH] staging: r8188eu: use proper type for second argiment of rtw_(aes|tkip|wep)_(decrypt|encrypt)

2020-07-26 Thread Ivan Safonov
-by: Ivan Safonov --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 2 +- drivers/staging/rtl8188eu/core/rtw_recv.c | 6 +-- drivers/staging/rtl8188eu/core/rtw_security.c | 50 +-- drivers/staging/rtl8188eu/core/rtw_xmit.c | 6 +-- .../staging/rtl8188eu/include

Re: [PATCH] staging: r8188eu: remove unused members of struct xmit_buf

2020-07-13 Thread Ivan Safonov
On 7/13/20 5:23 PM, Dan Carpenter wrote: On Mon, Jul 13, 2020 at 04:16:07PM +0300, Dan Carpenter wrote: On Sun, Jul 12, 2020 at 03:38:21PM +0300, Ivan Safonov wrote: Remove unused members of struct xmit_buf: alloc_sz, ff_hwaddr, dma_transfer_addr, bpending and last. Signed-off-by: Ivan

Re: [PATCH] staging: r8188eu: remove unused members of struct xmit_buf

2020-07-12 Thread Ivan Safonov
On 7/12/20 8:55 PM, Larry Finger wrote: On 7/12/20 7:38 AM, Ivan Safonov wrote: Remove unused members of struct xmit_buf: alloc_sz, ff_hwaddr, dma_transfer_addr, bpending and last. Signed-off-by: Ivan Safonov --- Have you tested this change? Previously with this driver, an unused quantity

[PATCH] staging: r8188eu: remove unused members of struct xmit_buf

2020-07-12 Thread Ivan Safonov
Remove unused members of struct xmit_buf: alloc_sz, ff_hwaddr, dma_transfer_addr, bpending and last. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8188eu/include/rtw_xmit.h | 5 - drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 1 - 2 files changed, 6 deletions(-) diff --git

[PATCH v2] staging:r8723bs: remove wrappers around skb_clone() and remove unnecessary in_interrupt() call

2020-05-31 Thread Ivan Safonov
Wrappers around skb_clone() do not simplify the driver code. The skb_clone() is always called from an interrupt handler, so use GFP_ATOMIC allocation only. Signed-off-by: Ivan Safonov --- Changes in v2: - in_interrupt() removal has been described. drivers/staging/rtl8723bs/include

Re: [PATCH] staging:r8723bs: remove wrappers around skb_clone()

2020-05-31 Thread Ivan Safonov
On 5/31/20 8:36 PM, Joe Perches wrote: On Sun, 2020-05-31 at 20:28 +0300, Ivan Safonov wrote: On 5/31/20 7:15 PM, Joe Perches wrote: On Sun, 2020-05-31 at 19:08 +0300, Ivan Safonov wrote: Wrappers around skb_clone() do not simplify the driver code. [] -inline struct sk_buff *_rtw_skb_clone

Re: [PATCH] staging:r8723bs: remove wrappers around skb_clone()

2020-05-31 Thread Ivan Safonov
On 5/31/20 7:15 PM, Joe Perches wrote: On Sun, 2020-05-31 at 19:08 +0300, Ivan Safonov wrote: Wrappers around skb_clone() do not simplify the driver code. [] -inline struct sk_buff *_rtw_skb_clone(struct sk_buff *skb) -{ - return skb_clone(skb, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL

[PATCH] staging:r8723bs: remove wrappers around skb_clone()

2020-05-31 Thread Ivan Safonov
Wrappers around skb_clone() do not simplify the driver code. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8723bs/include/osdep_service.h | 3 --- drivers/staging/rtl8723bs/os_dep/osdep_service.c | 5 - drivers/staging/rtl8723bs/os_dep/recv_linux.c | 2 +- 3 files changed, 1

[PATCH] staging:rtl8712: avoid skb_clone after skb allocation fail

2020-05-31 Thread Ivan Safonov
The skb allocated when out of memory is likely to be discarded during subsequent processing. Signed-off-by: Ivan Safonov --- drivers/staging/rtl8712/rtl8712_recv.c | 29 ++ 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/drivers/staging/rtl8712

[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 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

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] 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 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: 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-12 Thread Ivan Safonov
l8723bs: Remove function rtw_modular64()' have same bug. Ivan Safonov. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

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: 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

[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

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. https

[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

[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] 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

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

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-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

[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

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 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

[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 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 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

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

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

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

[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 <insafo...@gmail.com> --- drivers/staging/rtl81

[PATCH] staging:r8188eu: Use lib80211 to support TKIP

2018-03-09 Thread Ivan Safonov
Custom TKIP decryption replaced with lib80211 implementation. MIC check use lib80211 too. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/Kconfig | 1 + drivers/staging/rtl8188eu/core/rtw_recv.c | 161 -- drivers/s

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

2018-02-27 Thread Ivan Safonov
On 02/26/2018 10:56 AM, Dan Carpenter wrote: On Fri, Feb 23, 2018 at 05:57:42PM +0300, Ivan Safonov wrote: Custom AES decrypt implementation replaced with lib80211 library. Signed-off-by: Ivan Safonov <insafo...@gmail.com> The new code looks like original RTL code (really bad)

[PATCH] staging:r8188eu: use lib80211 CCMP decrypt

2018-02-23 Thread Ivan Safonov
Custom AES decrypt implementation replaced with lib80211 library. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/Kconfig | 1 + drivers/staging/rtl8188eu/core/rtw_security.c | 266 +- 2 files changed, 51 insertions(+

[PATCH 4/4] staging:r8188eu: Remove unused struct pkt_file

2018-02-04 Thread Ivan Safonov
Struct pkt_file is unused now, so remove it and correponding functions. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/include/xmit_osdep.h | 13 - drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 37 -- 2 files chang

[PATCH 1/4] staging:r8188eu: Remove struct pkt_file from set_qos()

2018-02-04 Thread Ivan Safonov
Struct pkt_file is a base to simple wrapper for skb_copy_bits(). Use skb_copy_bits() without wrappers. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_xmit.c | 26 ++ 1 file changed, 10 insertions(+), 16 deletions(-) diff

[PATCH 2/4] staging:r8188eu: Remove struct pkt_file from update_attrib()

2018-02-04 Thread Ivan Safonov
Struct pkt_file is a base to simple wrapper for skb_copy_bits(). Do not use struct pkt_file in update_attrib(). Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_xmit.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff

[PATCH 3/4] staging:r8188eu: Remove struct pkt_file from rtw_xmitframe_coalesce()

2018-02-04 Thread Ivan Safonov
Struct pkt_file is a base to simple wrapper for skb_copy_bits(). Eliminate struct pkt_file usage in rtw_xmitframe_coalesce(). Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_xmit.c | 17 + 1 file changed, 5 insertions(+), 12 del

[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 <insafo...@gmail.com> --- .../staging/rtl8192u/ieee80211/ieee80211_softmac.c | 27 +++--- drivers/staging/rtl8192u/ieee80211/ieee8021

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

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

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

2017-05-02 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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/os_dep/mon.c | 23 ++- 1 file changed, 22 insertions(+), 1 deletion(-) diff

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

2017-05-02 Thread Ivan Safonov
Length of IV/ICV fields calculated here, so trim these field here too. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_recv.c | 17 ++--- drivers/staging/rtl8188eu/os_dep/mon.c| 19 --- 2 files changed, 14 insertions(

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

2017-05-02 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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/os_dep/mon.c | 16 +++- 1 file changed, 15 insertions(+), 1 deletion(-)

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

2017-05-02 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 <insafo...@gmail.

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

2017-05-02 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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/i

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

2017-05-02 Thread Ivan Safonov
ieee80211_get_hdrlen is unused, remove it and all corresponding code. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 27 -- drivers/staging/rtl8188eu/include/ieee80211.h | 13 - 2 files chang

[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 <insafo...@gmail.com> --- 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 chan

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 2 files chan

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_xmit.c| 10 -- drivers/staging/rtl8188eu/hal/rtl8188eu_xmit.c | 3 +-- drivers/staging/rtl8188eu/include/rtw_security.h | 1 - d

[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 <insafo...@gmail.com> --- 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_intf

[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 <insafo...@gmail.com> --- 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_intf

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/include/drv_types.h | 1 - drivers/staging/rtl8188eu/os_dep/os_intfs.c | 3 +-- 2 files changed, 1 insertion

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

2017-03-28 Thread Ivan Safonov
;%s(%d): %s", __func__, __line__, 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.linuxd

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

2017-03-21 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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_ap.c | 13 ++--- 1 file changed, 2 insertions(

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 11 ++- 1 file changed, 2 inse

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c | 24 1 file chan

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_ap.c | 9 ++--- 1 file changed, 2 inse

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_ioctl_set.c | 4 +--- 1 file changed, 1 ins

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/hal/usb_halinit.c | 3 --- drivers/staging/rtl8188eu/include/hal_intf

[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 <insafo...@gmail.com> --- 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

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_recv.c | 10 ++ 1 file changed, 2 insertions(+), 8 deletions(-) diff

[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 <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_wlan_util.c | 11 ++- 1 file changed, 2 inse

[PATCH 1/4] staging:r8188eu: replace rx_end member of recv_frame with pkt->end

2017-02-06 Thread Ivan Safonov
rx_end is duplication of pkt->end pointer. pkt->end is preferred, because it is native skb field supported by skb_*() functions. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/include/rtw_recv.h | 3 +-- drivers/staging/rtl8188eu/os_dep/usb_ops

[PATCH 4/4] staging:r8188eu: replace recv_frame->rx_(data|len|tail) with pkt->(data|len|tail) and remove unused recvframe_(put|pull|pull_tail)()

2017-02-06 Thread Ivan Safonov
l_tail)(). Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/core/rtw_mlme_ext.c| 52 +++--- drivers/staging/rtl8188eu/core/rtw_recv.c| 92 drivers/staging/rtl8188eu/core/rtw_security.c| 12 ++-- drivers/staging/r

[PATCH 2/4] staging:r8188eu: remove unused rtw_ieee80211_bar structure definition

2017-02-06 Thread Ivan Safonov
rtw_ieee80211_bar structure definition does not used. Remove it. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/include/wifi.h | 15 --- 1 file changed, 15 deletions(-) diff --git a/drivers/staging/rtl8188eu/include/wifi.h b/drivers/s

[PATCH 3/4] staging:r8188eu: update pkt->(data|tail|len) synchronously with rx_(data|tail|len) in recv_frame structure

2017-02-06 Thread Ivan Safonov
Original driver code uses rx_* members to store skb (pkt) fields (instead of pkt->* members), pkt->* updated only after data completely formed, not in process. Update pkt->* after data buffer changed (with rx_*). Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/st

Re: [PATCH] drivers: staging: rtl8188eu: include: wifi: Unnecessary do-while removed from macro

2017-01-14 Thread Ivan Safonov
On 01/14/2017 10:40 PM, Greg KH wrote: On Sun, Jan 15, 2017 at 12:44:41AM +0530, Kartikey singh wrote: Even better yet, remove it and rebuild the driver and see if it breaks :) Only if the code is not between #ifn?def / #endif... ___ devel mailing

[PATCH 7/7] staging:r8188eu: remove unused rx_head member of struct recv_frame

2017-01-12 Thread Ivan Safonov
Value of rx_head member of struct recv_frame does not used. Remove it. Signed-off-by: Ivan Safonov <insafo...@gmail.com> --- drivers/staging/rtl8188eu/include/rtw_recv.h | 1 - drivers/staging/rtl8188eu/os_dep/usb_ops_linux.c | 1 - 2 files changed, 2 deletions(-) diff --git a/d

  1   2   3   4   5   >