Commit graph

99 commits

Author SHA1 Message Date
Ivan Safonov 2b2ea09e74 staging:r8188eu: Use lib80211 to decrypt WEP-frames
Use native lib80211 WEP decrypt instead of custom implementation.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-19 18:06:35 +01:00
Hans de Goede 66d32fdcbf staging: rtl8188eu: Revert 4 commits breaking ARP
Commit 2ba8444c97 ("staging:r8188eu: move IV/ICV trimming into
decrypt() and also place it after rtl88eu_mon_recv_hook()") breaks ARP.

After this commit ssh-ing to a laptop with r8188eu wifi no longer works
if the machine connecting has never communicated with the laptop before.
This is 100% reproducable using "arp -d <ipv4> && ssh <ipv4>" to ssh to
a laptop with r8188eu wifi.

This commit reverts 4 commits in total:

1. Commit 79650ffde3 ("staging:r8188eu: trim IV/ICV fields in
   validate_recv_data_frame()")
This commit depends on 2 of the other commits being reverted.

2. Commit 02b19b4c49 ("staging:r8188eu: inline unprotect_frame() in
   mon_recv_decrypted_recv()")
The inline code is wrong the un-inlined version contains:
	if (skb->len < hdr_len + iv_len + icv_len)
		return;
	...
Where as the inline-ed code introduced by this commit does:
	if (skb->len < hdr_len + iv_len + icv_len) {
		...
Note the same check, but now to actually continue doing ... instead
of to not do it, so this commit is no good.

3. Commit d86e16da6a ("staging:r8188eu: use different mon_recv_decrypted()
   inside rtl88eu_mon_recv_hook() and rtl88eu_mon_xmit_hook().")
This commit introduced a 1:1 copy of a function so that one of the
2 copies can be modified in the 2 commits we're already reverting.

4. Commit 2ba8444c97 ("staging:r8188eu: move IV/ICV trimming into
   decrypt() and also place it after rtl88eu_mon_recv_hook()")
This is the commit actually breaking ARP.

Note this commit is a straight-forward squash of the revert of these
4 commits, without any changes.

Cc: stable@vger.kernel.org
Cc: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-02 11:58:28 +01:00
Kees Cook b7749656e9 staging: rtl8188eu: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Juliana Rodrigues <juliana.orod@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: Gargi Sharma <gs051095@gmail.com>
Cc: sayli karnik <karniksayli1995@gmail.com>
Cc: Yamanappagouda Patil <goudapatilk@gmail.com>
Cc: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Victor Carvajal <carva005@gmail.com>
Cc: Sebastian Haas <sehaas@deebas.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18 15:33:15 +02:00
Srishti Sharma ac5f9de6d9 Staging: rtl8188eu: core: Use list_entry instead of container_of
For variables that have type struct list_head* use list_entry to
access current list element instead of using container_of.
Done using the following semantic patch by coccinelle.

@r@
identifier e;
struct list_head* l;
@@

<... when != l == NULL
l;
...>

(
e=
-container_of
+list_entry
    (
     ...)
)

Signed-off-by: Srishti Sharma <srishtishar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03 18:22:23 +02:00
Georgiana Chelu e8d93aca1b Staging: rtl8188eu: core: Fix line over 80 characters
Fix warning reported by checkpatch.pl script:
WARNING: line over 80 characters

Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29 15:31:49 +02:00
Georgiana Chelu 154acdb804 Staging: rtl8188eu: core: Add spaces around '+'
Improve the coding style by adding spaces around
arithmetic operation.

Issue reported by checkpatch.pl script.

Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29 15:31:49 +02:00
Georgiana Chelu 2742a7ddda Staging: rtl8188eu: core: Use __func__ instead of function name
Replace the function name from format string with the
constant __func__ to avoid multiple changes in case
the name of the function will be modified.

Issue reported by checkpatch.pl script.

Signed-off-by: Georgiana Chelu <georgiana.chelu93@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29 15:31:49 +02:00
Linus Torvalds 5518b69b76 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next
Pull networking updates from David Miller:
 "Reasonably busy this cycle, but perhaps not as busy as in the 4.12
  merge window:

   1) Several optimizations for UDP processing under high load from
      Paolo Abeni.

   2) Support pacing internally in TCP when using the sch_fq packet
      scheduler for this is not practical. From Eric Dumazet.

   3) Support mutliple filter chains per qdisc, from Jiri Pirko.

   4) Move to 1ms TCP timestamp clock, from Eric Dumazet.

   5) Add batch dequeueing to vhost_net, from Jason Wang.

   6) Flesh out more completely SCTP checksum offload support, from
      Davide Caratti.

   7) More plumbing of extended netlink ACKs, from David Ahern, Pablo
      Neira Ayuso, and Matthias Schiffer.

   8) Add devlink support to nfp driver, from Simon Horman.

   9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa
      Prabhu.

  10) Add stack depth tracking to BPF verifier and use this information
      in the various eBPF JITs. From Alexei Starovoitov.

  11) Support XDP on qed device VFs, from Yuval Mintz.

  12) Introduce BPF PROG ID for better introspection of installed BPF
      programs. From Martin KaFai Lau.

  13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann.

  14) For loads, allow narrower accesses in bpf verifier checking, from
      Yonghong Song.

  15) Support MIPS in the BPF selftests and samples infrastructure, the
      MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David
      Daney.

  16) Support kernel based TLS, from Dave Watson and others.

  17) Remove completely DST garbage collection, from Wei Wang.

  18) Allow installing TCP MD5 rules using prefixes, from Ivan
      Delalande.

  19) Add XDP support to Intel i40e driver, from Björn Töpel

  20) Add support for TC flower offload in nfp driver, from Simon
      Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub
      Kicinski, and Bert van Leeuwen.

  21) IPSEC offloading support in mlx5, from Ilan Tayari.

  22) Add HW PTP support to macb driver, from Rafal Ozieblo.

  23) Networking refcount_t conversions, From Elena Reshetova.

  24) Add sock_ops support to BPF, from Lawrence Brako. This is useful
      for tuning the TCP sockopt settings of a group of applications,
      currently via CGROUPs"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits)
  net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap
  dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap
  cxgb4: Support for get_ts_info ethtool method
  cxgb4: Add PTP Hardware Clock (PHC) support
  cxgb4: time stamping interface for PTP
  nfp: default to chained metadata prepend format
  nfp: remove legacy MAC address lookup
  nfp: improve order of interfaces in breakout mode
  net: macb: remove extraneous return when MACB_EXT_DESC is defined
  bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case
  bpf: fix return in load_bpf_file
  mpls: fix rtm policy in mpls_getroute
  net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t
  net, ax25: convert ax25_route.refcount from atomic_t to refcount_t
  net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t
  net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t
  net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t
  ...
2017-07-05 12:31:59 -07:00
yuan linyu b952f4dff2 net: manual clean code which call skb_put_[data:zero]
Signed-off-by: yuan linyu <Linyu.Yuan@alcatel-sbell.com.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-20 13:30:15 -04:00
Johannes Berg 59ae1d127a networking: introduce and use skb_put_data()
A common pattern with skb_put() is to just want to memcpy()
some data into the new space, introduce skb_put_data() for
this.

An spatch similar to the one for skb_put_zero() converts many
of the places using it:

    @@
    identifier p, p2;
    expression len, skb, data;
    type t, t2;
    @@
    (
    -p = skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    |
    -p = (t)skb_put(skb, len);
    +p = skb_put_data(skb, data, len);
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, len);
    |
    -memcpy(p, data, len);
    )

    @@
    type t, t2;
    identifier p, p2;
    expression skb, data;
    @@
    t *p;
    ...
    (
    -p = skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    |
    -p = (t *)skb_put(skb, sizeof(t));
    +p = skb_put_data(skb, data, sizeof(t));
    )
    (
    p2 = (t2)p;
    -memcpy(p2, data, sizeof(*p));
    |
    -memcpy(p, data, sizeof(*p));
    )

    @@
    expression skb, len, data;
    @@
    -memcpy(skb_put(skb, len), data, len);
    +skb_put_data(skb, data, len);

(again, manually post-processed to retain some comments)

Reviewed-by: Stephen Hemminger <stephen@networkplumber.org>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-16 11:48:37 -04:00
Ivan Safonov 79650ffde3 staging:r8188eu: trim IV/ICV fields in validate_recv_data_frame()
Length of IV/ICV fields calculated here, so trim these field here too.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15 07:41:59 +02:00
Ivan Safonov 2ba8444c97 staging:r8188eu: move IV/ICV trimming into decrypt() and also place it after rtl88eu_mon_recv_hook()
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 <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15 07:41:59 +02:00
Ivan Safonov 2288387936 staging:r8188eu: remove sw_decrypt member of security_priv struct
sw_decrypt always is 0, so replace it with 0.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08 17:11:54 +02:00
Ivan Safonov 90a6969250 staging:r8188eu: add iv length to frame data offset
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 <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-23 14:28:47 +01:00
Ivan Safonov 0bb2b81ee4 staging:r8188eu: use DIV_ROUND_UP() in rtw_signal_stat_timer_hdl()
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 <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-06 09:17:00 +01:00
Ivan Safonov df47a14c2c staging:r8188eu: replace recv_frame->rx_(data|len|tail) with pkt->(data|len|tail) and remove unused recvframe_(put|pull|pull_tail)()
recv_frame->rx_(data|len|tail) duplicate pkt (skb) data|len|tail members
and require special functions recvframe_(put|pull|pull_tail)()
instead of skb_(put|pull|trim).
Replace rx_(data|len|tail) with pkt->(data|len|tail),
remove rx_(data|len|tail) and remove recvframe_(put|pull|pull_tail)().

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09 13:22:09 +01:00
Arnd Bergmann 6e01700602 staging: rtl: fix possible NULL pointer dereference
gcc-7 detects that wlanhdr_to_ethhdr() in two drivers calls memcpy() with
a destination argument that an earlier function call may have set to NULL:

staging/rtl8188eu/core/rtw_recv.c: In function 'wlanhdr_to_ethhdr':
staging/rtl8188eu/core/rtw_recv.c:1318:2: warning: argument 1 null where non-null expected [-Wnonnull]
staging/rtl8712/rtl871x_recv.c: In function 'r8712_wlanhdr_to_ethhdr':
staging/rtl8712/rtl871x_recv.c:649:2: warning: argument 1 null where non-null expected [-Wnonnull]

I'm fixing this by adding a NULL pointer check and returning failure
from the function, which is hopefully already handled properly.

This seems to date back to when the drivers were originally added,
so backporting the fix to stable seems appropriate. There are other
related realtek drivers in the kernel, but none of them contain a
function with a similar name or produce this warning.

Cc: stable@vger.kernel.org
Fixes: 1cc18a22b9 ("staging: r8188eu: Add files for new driver - part 5")
Fixes: 2865d42c78 ("staging: r8712u: Add the new driver to the mainline kernel")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-16 18:08:57 +01:00
Yamanappagouda Patil 8bfea03410 staging: rtl8188eu: fixed 'braces are not necessary for single statement blocks'.
Fixed checkpatch.pl warnings in rtl8188eu module core folder files.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-10 17:41:30 +01:00
Ivan Safonov 80c96e08c4 staging:r8188eu: remove unused WIFI_MP_*STATE and WIFI_MP_CTX* definitions
fw_state member of struct mlme_priv never obtain WIFI_MP_STATE value,
so code only for (fw_state == WIFI_MP_STATE) is dead.
Remove it, WIFI_MP_*STATE and WIFI_MP_CTX* definitions.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-05 18:50:05 +01:00
Luca Ceresoli 6b8b810f2c staging: rtl8188eu: remove unused members from struct recv_priv
Since commit da25a8ec6b ("staging: rtl8188eu: remove unused
debugging functions") is_signal_dbg is never set to true, so the code
under if (adapter->recvpriv.is_signal_dbg) is dead. Remove the
variable and the dead code.

The signal_strength_dbg was referenced only in the code that is being
removed, so remove it as well.

Also fix coding style issues in the touched lines.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: devel@driverdev.osuosl.org
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 17:10:08 +01:00
Yamanappagouda Patil 7d2af82cc5 staging: rtl8188eu: In core directory, fixed 'missing a balnk line after declarations' warnings.
Fixed checkpatch.pl warnings in rtl8188eu/core directory.

Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03 16:52:44 +01:00
Ivan Safonov 165601c98f staging:r8188eu: change poiter type from u8 to void for pallocated_frame_buf member of recv_priv structure
pallocated_frame_buf used only to preserve pointer for vfree function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:30 +02:00
Ivan Safonov d70c509152 staging:r8188eu: remove precv_frame_buf member of recv_priv structure
precv_frame_buf is used as local variable only in one function.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:30 +02:00
Ivan Safonov d7689c821d staging:r8188eu: remove rx_pending_cnt member of recv_priv structure
Value of this variable does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:29 +02:00
Ivan Safonov 437a7b6e11 staging:r8188eu: remove free_recvframe_cnt member of recv_priv structure
Value of free_recvframe_cnt does not used.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:29 +02:00
Ivan Safonov 30f5687367 staging:r8188eu: remove wrappers for LedControl8188eu function
There is no reason to use these wrappers.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:18 +02:00
Ivan Safonov bb5cd2e531 staging:r8188eu: remove rtw_os_recv_resource_alloc function
This simple function does not allocate any resource.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16 10:25:14 +02:00
Ivan Safonov fb11340875 staging: r8188eu: replace N_BYTE_ALIGMENT macro with PTR_ALIGN
PTR_ALIGN is a bit shorter than N_BYTE_ALIGMENT.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20 13:33:49 +02:00
Luca Ceresoli 181c6c679d staging: rtl8188eu: declare internal function as static
This function is only used inside rtw_recv.c. Which is quite logical,
since it's a timer callback: it is passed as the _fn argument to
setup_timer(). So it is internal to rtw_recv.c and should be static.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Geliang Tang <geliangtang@163.com>
Cc: Jakub Sitnicki <jsitnicki@gmail.com>
Cc: Ivan Safonov <insafonov@gmail.com>
Cc: Kyle Kuffermann <kyle.kuffermann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12 13:02:33 +02:00
Kyle Kuffermann fb025382b4 staging: rtl8188eu: Remove license paragraph with mailing address
This fixes the issue reported by checkpatch.pl:

	"Do not include the paragraph about writing to the Free Software
	Foundation's mailing address from the sample GPL notice. The FSF
	has changed addresses in the past, and may do so again.  Linux
	already includes a copy of the GPL."

in all files for the rtl8188eu driver.

Signed-off-by: Kyle Kuffermann <kyle.kuffermann@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28 07:30:36 -07:00
Bhaktipriya Shridhar 7570ad9104 staging: rtl8188eu: core: Remove NULL test before vfree
vfree frees the virtually continuous memory area starting at addr.
If addr is NULL, no operation is performed. So NULL test is not needed
before vfree.

This was done using Coccinelle:

@@
expression x;
@@
-if (x != NULL)
    vfree(x);

@@
expression x;
@@

-if (x != NULL) {
vfree(x);
x = NULL;
-}

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar bd37c43c8d staging: rtl8188eu: core: Remove casts of pointer to same type
Casting a pointer to a pointer of the same type is unnecessary, so remove
these unnecessary casts.

This was done with Coccinelle:

@@
type T;
T *ptr;
@@
- (T *)ptr
+ ptr

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Bhaktipriya Shridhar b383f2acbd staging: rtl8188eu: core: Remove unnecessary braces
This patch removes braces for single statement blocks. The warning
was detected using checkpatch.pl.
Coccinelle was used to make the change.

@@
expression e,e1;
@@

- if (e) {
+ if (e)
  e1;
- }

Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20 15:06:51 -08:00
Geliang Tang b9f1c275b6 staging: rtl8188eu: use list_first_entry_or_null()
Use list_first_entry_or_null() instead of list_empty() + container_of()
to simplify the code.

Signed-off-by: Geliang Tang <geliangtang@163.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Andy Shevchenko fb27e19c08 staging: rtl8188eu: replace open-coded print_hex_dump()
No need to reinvent a wheel, i.e. print_hex_dump(). Replace an open-coded
variant by generic kernel helper.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 19:00:46 -08:00
Ivan Safonov 160edfddf7 staging: rtl8188eu: operator = replaced by += in loop increment
x = x + a and x += a equivalen, but second preferably.

Signed-off-by: Ivan Safonov <insafonov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29 09:09:08 +09:00
Jakub Sitnicki 0a0796eb16 staging: rtl8188eu: Introduce monitor interface for IEEE 802.11 frames
This adds support for monitoring IEEE 802.11 Data and Management frames
received or transmitted by a RTL8188EU-based device handled by this
driver.

The monitor interface is not enabled by default and will be registered
only if monitor_enable module parameter is set to 1.  When enabled it
will show up as a monX network device, which can be used by the
userspace programs for monitoring network traffic.

It is intended as an exploratory/debugging tool for rtl8188eu driver.

Signed-off-by: Jakub Sitnicki <jsitnicki@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-18 19:53:50 -07:00
Sudip Mukherjee b17c858def staging: rtl8188eu: remove multiple blank line
Multiple blank lines is against the kernel coding style and checkpatch
complains for that.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:17:59 -07:00
Sudip Mukherjee a45515f383 staging: rtl8188eu: remove unused function
The function rtw_init_recvframe() was not being used.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:17:59 -07:00
Sudip Mukherjee fbd0968708 staging: rtl8188eu: remove exit label
An exit label which does nothing except return, is not worth having. So
remove it.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:17:59 -07:00
Sudip Mukherjee 0b47649c78 staging: rtl8188eu: make function void
The return value of rtw_os_recv_resource_alloc() is never checked, so
make it as void. Moreover as of now the function can not fail.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:17:58 -07:00
Sudip Mukherjee 1695cd29b2 staging: rtl8188eu: remove unused argument
The function rtw_os_recv_resource_alloc() only uses the argument
struct recv_frame *. So remove the other unused argument.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:17:58 -07:00
Paul Gortmaker 04fbf979b3 rtl8188eu: don't duplicate ieee80211 constants for status/reason
These are all defined as a part of the standard and should not be
duplicated on a per-driver basis.  Use the global ones and delete the
local ones.

Note that a couple of them had slight wording differences, things like
INVALID vs. NOT_VALID or similar, so they are aligned with the global
naming conventions here, as dictated by compile testing.

This isn't the totality of duplicated data removed, but it is a start.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:13 +02:00
Haneen Mohammed adb3d770d2 Staging: rtl8188eu: Remove parentheses around right side an assignment
Parentheses are not needed around the right hand side of an assignment.
This patch remove parenthese of such occurenses. Issue was detected and
solved using the following coccinelle script:

@rule1@
identifier x, y, z;
expression E1, E2;
@@

(
x = (y == z);
|
x = (E1 == E2);
|
 x =
-(
...
-)
 ;
)

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:08:01 +01:00
Vaishali Thakkar 28af7ea81e Staging: rtl8188eu: Eliminate use of _init_timer
This patch introduces the use of API function setup_timer
instead of driver specific function init_timer as it is
the preferred and standard way to set and setup the timer.
To be compatible with the changes, argument types of
referenced functions are changed. Also, definition of
function _init_timer is removed as it is no longer needed
after this change.

Here, these cases are handled using Coccinelle and
semantic patch used for this is as follows:

@@ expression x, y; identifier a, b;@@

- _init_timer (&x, y, a, b);
+ setup_timer (&x, a, (unsigned long)b);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:07:15 +01:00
Vaishali Thakkar 4d4efe3e95 Staging: rtl8188eu: Eliminate use of _set_timer
This patch introduces the use of API function mod_timer
instead of driver specific function _set_timer as it is
a more efficient and standard way to update the expire
field of an active timer. Also, definition of function
_set_timer is removed as it is no longer needed after
this change.

Here, these cases are handled using Coccinelle and
semantic patch used for this is as follows:

@@ expression x; expression y;@@

- _set_timer (&x, y);
+ mod_timer (&x, jiffies + msecs_to_jiffies (y));

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 16:04:55 +01:00
Sudip Mukherjee c78a964c25 staging: rtl8188eu: unneeded return variable
a variable is declared and initialized and then never updated in the
function.This default value is then used as the return from the
function.
So removed that unneeded return variable and returning that default
initial value directly.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-07 09:45:35 -08:00
Jia He 7be921a226 staging: rtl8188eu: Fix coding style space related ERROR problems
This fixes space related ERROR reports by checkpatch.pl
Generated by $ git ls-files "drivers/staging/rtl8188eu/*.[ch]" | \
  xargs ./scripts/checkpatch.pl -f --fix-inplace --strict --types=SPACING
Already checked by text comparasion
$git diff -w
and binary comparasion of r8188eu.ko
$objdiff diff <old_commit> <new_commit>

Signed-off-by: Jia He <hejianet@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-11-03 18:13:34 -08:00
Tapasweni Pathak 60c8991148 staging: rtl8188eu: core: Remove useless cast on void pointer
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-30 13:05:48 -07:00
navin patidar 0cccd45f0a staging: rtl8188eu: Remove mp( mesh point) mode support
We've already removed non-standard ioctl handlers, used by driver
to support mp mode.

Signed-off-by: navin patidar <navin.patidar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-07-09 21:08:47 -07:00