1
0
Fork 0
Commit Graph

40 Commits (75a6f82a0d10ef8f13cd8fe7212911a0252ab99e)

Author SHA1 Message Date
Paul Gortmaker 7c6e3f24c3 rtl8192u: align local ieee80211_wmm_ac_param struct fields with global
The <linux/ieee80211.h> and this local file both have a struct of the
same name.  They also have the same field sizes and generally the
same fields, as can be seen here:

   ~/git/linux-head$ git grep -A4 'struct ieee80211_wmm_ac_param {'
   drivers/staging/rtl8192u/ieee80211/ieee80211.h:struct ieee80211_wmm_ac_param {
   drivers/staging/rtl8192u/ieee80211/ieee80211.h- u8 ac_aci_acm_aifsn;
   drivers/staging/rtl8192u/ieee80211/ieee80211.h- u8 ac_ecwmin_ecwmax;
   drivers/staging/rtl8192u/ieee80211/ieee80211.h- u16 ac_txop_limit;
   drivers/staging/rtl8192u/ieee80211/ieee80211.h-};
   --
   include/linux/ieee80211.h:struct ieee80211_wmm_ac_param {
   include/linux/ieee80211.h-      u8 aci_aifsn; /* AIFSN, ACM, ACI */
   include/linux/ieee80211.h-      u8 cw; /* ECWmin, ECWmax (CW = 2^ECW - 1) */
   include/linux/ieee80211.h-      __le16 txop_limit;
   include/linux/ieee80211.h-} __packed;
   ~/git/linux-head$

Here we just align the local field names with the main system one.  Then
we can add an include of the system one and delete the local copy in one
smooth step in a follow-on commit.

Not that the replacement:

 for i in `find . -name '*.[ch]'` ; do sed -i 's/ac_aci_acm_aifsn/aci_aifsn/g' $i ; done
 for i in `find . -name '*.[ch]'` ; do sed -i 's/ac_ecwmin_ecwmax/cw/g' $i ; done
 for i in `find . -name '*.[ch]'` ; do sed -i 's/ac_txop_limit/txop_limit/g' $i ; done

implicitly shows that only one of the three fields is currently used.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 09:24:14 +02:00
Paul Gortmaker 5c2918a5ba rtl8192u: don't trample on <linux/ieee80211.h> struct namespace
In order to start reducing the duplicated code/constants/macros in this
driver, we need to include <linux/ieee80211.h> to provide the defacto
versions.  However this driver has structs with the same name as the
ones in the main include, so namespace collision prevents us from doing
step #1.

Since the structs actually differ in their respective fields, we can't
simply delete the local ones without impacting the runtime; a conversion
to use the global ones can be considered at a later date if desired.

Rename the ones here with a vendor specific prefix so that we won't have
the namespace collision, and hence can continue on with the cleanup.

Automated conversion done with:

    for i in `find . -name '*.[ch]'` ; do \
      sed -i 's/struct ieee80211_hdr/struct rtl_80211_hdr/g' $i ; \
    done

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
Dan Carpenter c4151700bb Staging: rtl8192u: use correct array for debug output
This is supposed to be ->rates_ex[] instead of ->rates[].  I found this
because static checkers complain than ->rates is too small so we're
reading beyond the end of the array.  It has 12 elements instead of 15.

This bug was apparently copy and pasted from ipw2x00.  I fixed it before
in that driver 428e3cf5f9 ('ipw2x00: printing the wrong array in
debug code')

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:40:49 +02:00
Haneen Mohammed dde48b99d2 Staging: rtl8192u: Add space before open parenthesis
Space is required before the open parenthesis.
This patch adds space after if to address that issue.
This was done with the help of the following Coccinelle script:

@r@
position p1,p2;
@@
if@p1 (@p2 ...) {
        ...
}
@script:python@
p1 << r.p1;
p2 << r.p2;
@@

l1 = int (p1[0].line)
l2 = int (p2[0].line)
c1 = int (p1[0].column)
c2 = int (p2[0].column)
if (l2 == l1 and c1 + 2 != c2):
  cocci.include_match(False)

@@
position r.p1,r.p2;
@@
- if@p1 (
+ if (
...) {
        ...
}

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-26 10:35:33 +01:00
Dilek Uzulmez 8236589b7c Staging: rtl8192u: Fix do not use // c99 comments.
This patch fixes checkpatch.pl issues with "do not use // C99 comments" errors in ieee80211_rx.c

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:52:42 +01:00
Dilek Uzulmez ca67dfefd8 Staging: rtl8192u: Added #include <linux/uaccess.h> instead of <asm/uaccess.h>
The following patch fixes the checkpatch.pl warning:
WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h>

Signed-off-by: Dilek Uzulmez <dilekuzulmez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:50:16 +01:00
Vaishali Thakkar 6465144c3d Staging: rtl8192u: Convert use of __constant_<foo> to <foo>
Using functions of the form __constant_<foo> isn't preferred
outside of include/uapi/ as using the function without
__constant_ is identical when the argument is a constant.
So, this patch replaces __constant_htons with htons.

This is done using Coccinelle and semantic patch used for
this is as follows:

@@identifier x;@@

(
- __constant_htons(x)
+ htons(x)
|
- __constant_htonl(x)
+ htonl(x)
|
- __constant_ntohs(x)
+ htons(x)
|
- __constant_ntohl(x)
+ htonl(x)
)

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:50:16 +01:00
Cristina Opriceana 19cd22972f Staging: drivers: Bool initializations should use true/false
This patch replaces bool initializations of 1/0 with true/false in order
to increase readability and respect the standards. Warning found by
coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Navya Sri Nizamkari 609de3ae93 staging: rtl8192u: Remove commented header.
This patch removes the commented header <linux/config.h>
as it is not used in modern linux systems.

Signed-off-by: Navya Sri Nizamkari <navyasri.tech@gmail.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 13:37:31 -08:00
Greg Donald d59d6f5d38 staging: rtl8192u: Fix "space prohibited after that open parenthesis '('" errors
Fix checkpatch.pl "space prohibited after that open parenthesis '('" errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 16:48:43 +08:00
Valdis Kletnieks 79d99c305f staging/rtl8192u - check for skb alloc failure
It's possible for dev_alloc_skb() to fail. Propagate the error to the caller,
so it can clean up and drop the packet. The sender should end up retransmitting
the packet, hopefully at a time we're prepared to allocate skb's again.

Reported-By: Nicholas Krause <xerofoify@gmail.com>
Signed-Off-By: Valdis Kletnieks <valdis.kletnieks@vt.edu>

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08 15:22:52 -07:00
Greg Donald 0b4ef0a641 drivers: staging: rtl8192u: Fix space required after that ',' errors
Fix checkpatch.pl space required after that ',' errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-30 13:56:38 -07:00
Paul Bolle c284e1da6d staging: rtl8192u: remove checks for CONFIG_IEEE80211_CRYPT_TKIP
Ever since rtl8192u was added as a staging driver in v2.6.33 it contained
checks for CONFIG_IEEE80211_CRYPT_TKIP. But the Kconfig symbol
IEEE80211_CRYPT_TKIP was renamed to LIB80211_CRYPT_TKIP in v2.6.29. So
these checks have always evaluated to false. And these checks were rather
odd to begin with, since rtl8192u comes with its own ieee80211 stack,
which has support for TKIP built in.

Now the safe and easy thing to do here would be to remove these checks
and the code they hide. But it turns out that with some minor cleanup
the code currently hidden behind these checks builds cleanly. And by
building it we allow the people actually running this code to test
whether it is any good.

That minor cleanup is needed because ieee80211_encrypt_fragment()
accesses struct sk_buff's data member as if it is a struct
ieee80211_hdr. It's not. See, in ieee80211_xmit() a struct
ieee80211_hdr_3addrqos is skb_put() into the sk_buff with which
ieee80211_encrypt_fragment() will be called. So switch from
ieee80211_hdr to ieee80211_hdr_3addrqos here.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 15:14:12 -07:00
Greg Kroah-Hartman 81aa143bae Revert "staging: rtl8192u: rename CONFIG_IEEE80211_CRYPT_TKIP"
This reverts commit f8cc81f845.

It breaks the build in linux-next.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-28 14:15:37 -07:00
Paul Bolle f8cc81f845 staging: rtl8192u: rename CONFIG_IEEE80211_CRYPT_TKIP
The Kconfig symbol IEEE80211_CRYPT_TKIP was renamed to
LIB80211_CRYPT_TKIP in commit 274bfb8dc5 ("lib80211: absorb crypto
bits from net/ieee80211"). So when rtl8192u was added as a staging
driver in v2.6.33 its checks for CONFIG_IEEE80211_CRYPT_TKIP were
already outdated. Use CONFIG_LIB80211_CRYPT_TKIP instead, as was clearly
intended.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26 20:19:26 -07:00
Peter Senna Tschudin 4764ca981b drivers/staging: Remove useless return variables
This patch remove variables that are initialized with a constant,
are never updated, and are only used as parameter of return.
Return the constant instead of using a variable.

Verified by compilation only.

The coccinelle script that find and fixes this issue is:
// <smpl>
@@
type T;
constant C;
identifier ret;
@@
- T ret = C;
... when != ret
    when strict
return
- ret
+ C
;
// </smpl>

Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-26 10:32:15 -07:00
Joe Perches f8628a47ba staging: Convert __FUNCTION__ to __func__
Use the normal mechanism for emitting a function name.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25 11:05:07 -07:00
Joel Pelaez Jorge e6c1ef6ce9 Staging: rtl8192u: Remove old WIRELESS_EXT support
Remove support for building against ancient WIRELESS_EXT versions,
only leaving support for the current version: 22

Signed-off-by: Joel Pelaez Jorge <joelpelaez@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 04:42:20 +09:00
Benoit Taine 539b4f72d0 staging/rtl8192u: Put EXPORT_SYMBOL just after the exported function
Export of symbols statement must be placed right after the definition to meet
kernel coding style guidelines. This issue was reported by checkpatch.

A simplified version of the semantic patch that makes this change is as
follows (http://coccinelle.lip6.fr/):

// <smpl>

@ r @ identifier f; @@
- EXPORT_SYMBOL(f);

@@ identifier r.f; @@
  f(...) { ... }
+ EXPORT_SYMBOL(f);

// </smpl>

Signed-off-by: Benoit Taine <benoit.taine@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 21:37:20 +09:00
Ana Rey 4b10d50c36 staging: rtl8192u: make in ieee80211/ieee80211_rx.c some local functions static
Make some local functions (AddReorderEntry, RxReorderIndicate and
parse_subframe) static and fix coding style in this function
declarations when It is necessary.

Fix the following sparse warnings in ieee80211/ieee80211_rx.c

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:521:1: warning: symbol 'AddReorderEntry' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:604:6: warning: symbol 'RxReorderIndicatePacket' was not declared. Should it be static?
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:774:4: warning: symbol 'parse_subframe' was not declared. Should it be static?

Signed-off-by: Ana Rey <anarey@gmail.com>
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
2014-03-16 18:16:44 -07:00
Himangi Saraogi 1a324441e0 Staging:rtl8192:ieee80211: Fix sparse warning cast to restricted __le32
This patch fixes the following sparse warnings in ieee80211_rx.c:
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:2201:34: warning: cast
to restricted __le32
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:2202:34: warning: cast
to restricted __le32
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:2203:36: warning: cast
to restricted __le32

by changing the annotation in the structure header file for struct
ieee80211_probe_response for time_stamp and altering the cast
for beacon_interval to le16.

Signed-off-by: Himangi Saraogi <himangi774@gmail.com>
Reviewed-by: Bob Copeland <me@bobcopeland.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-07 16:06:47 -08:00
Teodora Baluta 57a8852912 Staging: rtl8192u: fix checkpatch.pl error
This patch fixes the checkpatch.pl script error:
ERROR: do not use C99 // comments
+static long ieee80211_translate_todbm(u8 signal_strength_index)// 0-100
index.

Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16 09:40:30 -07:00
Teodora Baluta 46326d2622 Staging: rtl8192u: fix sparse warnings for static functions
Fix sparse warnings in static function in driver rtl8192u

Signed-off-by: Teodora Baluta <teobaluta@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-16 09:39:32 -07:00
Andrea Merello 559a4c318c staging: Update e-mail address for Andrea Merello
A lot of files contain reference to my old e-mail address.
Now I'm going not to read mail from it anymore, so update it
with my current address everywhere.

Signed-off-by: Andrea Merello <andrea.merello@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-27 22:03:53 -07:00
Dave Jones 0c29359252 staging/rtl8192u: remove commented out __list_for_each usage
Also remove another commented out open-coded list manipulation while we're there.

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-18 11:22:58 -07:00
Xenia Ragiadakou ea77527a45 STAGING: rtl8192u/ieee80211: fix checkpatch error about pointer position in ieee80211_rx.c
This patch fixes the pointer position in ieee80211_rx.c
to meet the kernel coding style conventions.

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 07:14:51 -07:00
Sebastian Hahn fdc64a9eda staging/rtl8192u: indent with tabs, not spaces
Converted staging/rtl8187se to use tabs instead of spaces for
indentation to fix the checkpatch error "code indent should use tabs
where possible".

Signed-off-by: Sebastian Hahn <snsehahn@cip.cs.fau.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:53:40 -08:00
Sebastian Hahn 35997ff0ca staging/rtl8192u: cleanfile run
Run cleanfile on all files inside drivers/staging/rtl819u

Signed-off-by: Sebastian Hahn <snsehahn@cip.cs.fau.de>
Signed-off-by: Jennifer Naumann <Jennifer.Naumann@informatik.stud.uni-erlangen.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 12:52:58 -08:00
Joe Perches 14fc42355f staging: Remove test of is_broadcast with is_multicast
A broadcast packet is a multicast packet, no need to test twice.

Reorder one defective test in rtl_core of is_multi_ether_addr
before is_broadcast_ether_addr as the is_multi returns true for
broadcast frames.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09 13:52:23 -07:00
Masanari Iida 73e2918990 staging: Fix typo in multiple files
Collect spelling typo in multiple files within staging directory.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:31:01 -07:00
Masanari Iida d0bc218b0a staging: Fix typo in ieee80211_rx.c
Correct spelling "suppported" to "supported" in
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c

Signed-off-by: Masanari iida<standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:51:17 -08:00
Jesper Juhl 41134db17a Remove unneeded version.h includes from drivers/staging/rtl*/
It was pointed out by 'make versioncheck' that some includes of
linux/version.h are not needed in drivers/staging/rtl8187se/,
drivers/staging/rtl8192e/, drivers/staging/rtl8192u/ &
drivers/staging/rtl8712/.
This patch removes them.

Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-07-05 10:39:40 -07:00
Lucas De Marchi 25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Ilia Mirkin e72714fb20 staging: rtl8192u: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 11:57:35 -07:00
David Chosrova 0e7a3e7a74 Staging: rtl8192u: remove dead code to disable dot11d
This patch removes all the ENABLE_DOT11D ifdefs.
It is always defined for driver. DOT11D has to do with regulatory domains.

What prompted this patch was a warning message in Sparse.

drivers/staging/rtl8192u/r8192U_core.c:247:1: warning: "eqMacAddr"
redefined in file included from drivers/staging/rtl8192u/:81:81:
drivers/staging/rtl8192u/dot11d.h:35:1: warning: this is the location
of the previous definition

Now there are no ifdefs around dot11d.h it made no sense to have this
second definition, so I removed that macro as well. ( Thanks Dan ;-) ).

Acked-by. Dan Carpenter <error27@gmail.com>
Signed-off-by: David Chosrova <dada2372@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-01 14:51:16 -08:00
Julia Lawall 4498dbcd2d staging: rtl8193*: Remove double test
The 1 element of the array is tested twice.  Change the code so that the
remaining 3 element of the array is tested instead of testing the 1 element
a second time.

The sematic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@expression@
expression E;
@@

(
* E
  || ... || E
|
* E
  && ... && E
)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 15:22:37 -07:00
Julia Lawall 324148788b Staging: Drop memory allocation cast
Drop cast on the result of kmalloc and similar functions.

The semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@@
type T;
@@

- (T *)
  (\(kmalloc\|kzalloc\|kcalloc\|kmem_cache_alloc\|kmem_cache_zalloc\|
   kmem_cache_alloc_node\|kmalloc_node\|kzalloc_node\)(...))
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 16:06:48 -07:00
Joe Perches 0ee9f67c40 Staging: rtl8187x: Use %pM for mac address output
Uncompiled.  Doesn't currently build anyway.

Converted MAC_FMT to %pM
Converted some %02x%02x%02x%02x%02x%02x to %pm
Converted MAC_ARG to direct use
Removed MAC_FMT and MAC_ARG macros

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:29 -08:00
Mauro Carvalho Chehab 50a09b3b09 Staging: rtl8192u: remove dead code
Remove #ifse against older kernel versions;
Remove codes marked with #if 0;
Remove #if 1

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00
Jerry Chuang 8fc8598e61 Staging: Added Realtek rtl8192u driver to staging
Add Realtek linux driver for rtl8192u as provided by Realtek

rtl8192u_linux_2.6.0006.1031.2008.tar.gz, send to me C/C staging ML.

This version won't compile against upstream, doesn't follow
Linux CodingStyle and has their own ieee80211 stack.

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:22 -08:00