Commit Graph

57 Commits

Author SHA1 Message Date
Punit Vara a1b42bef0a Staging: rtl8712: Use ether_addr_equal() over memcmp()
This patch is to the rtl871x_ioctl_linux.c file that fixes up following
warning reported by checkpatch.pl :

-Prefer ether_addr_equal() or ether_addr_equal_unaligned() over memcmp()

bssid and pnetwork->network.MacAddress both are 6 byte
array which aligned with u16

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:15:57 -07:00
Punit Vara e904cc8f57 Staging: rtl8712: Fix warning prefer eth_broadcast_addr() over memset()
This patch is to the rtl871x_ioctl_linux.c that fixes up following
warning by checkpatch.pl:

-Prefer eth_broadcast_addr() over memset()

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:15:57 -07:00
Luis de Bethencourt 681cd988d3 staging: rtl8712: fix negative level value
range->avg_qual.level is of type uint8, so it shouldn't be assigned a
negative number. Assigning it 0x100 - 78, which is the equivalent
to (20 + -98) dBm when IW_QUAL_DBM is set.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:43:20 -07:00
Alison Schofield 29b1b61435 staging: rtl8712: Move constant to right of test or replace with "!"
Move constant to the right side of comparison operator or replace
equality operator (==) with the unary negation operator (!) if the
comparison is to zero.

Addesses multiple instances of the checkpatch.pl warning:
WARNING: Comparisons should place the constant on the right side of the
test

Signed-off-by: Alison Schofield <amsfield22@gmail.com>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:25:32 +01:00
Andy Shevchenko 3fe1be87ab staging: rtl8712: re-use mac_pton()
...instead of custom approach

Cc: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:48:15 +02:00
Joshua Clayton 7fb539eda2 staging: rtl8712: change SupportedRates to rates
Change the value to a name that conforms to Linux coding style.

"rates" is equally expressive in this context, and I have left alone
a comment and function name that describe the rates as supported rates.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:04 -07:00
Joshua Clayton db55b1652e staging: rtl8712: remove typedefs
Coding style fix.
Get rid of typedefs NDIS_802_11_RATES and NDIS_802_11_RATES_EX
Undo any casting that was done as a result of the typedef.

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:04 -07:00
Joshua Clayton 44367877c6 staging: rtl8712: remove duplicate struct
struct ndis_wlan_bssid_ex is a doppelganger of struct wlan_bssid_ex,
and is used about a third as often.

Switch all instances to wlan_bssid_ex, and remove ndis_wlan_bssid_ex

This also gets rid of a use of typedef NDIS_802_11_RATES_EX

Signed-off-by: Joshua Clayton <stillcompiling@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:14:03 -07:00
Dogukan Ergun 07e9e619db staging: rtl8712: fix else after break or return warning
This patch fixes checkpatch.pl warning.
WARNING: else is not generally useful after a break or return

Signed-off-by: Dogukan Ergun <dogukan.ergun@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-13 14:45:51 -07:00
Dan Carpenter b5eed730bd staging: rtl8712: freeing an ERR_PTR
If memdup_user() fails then "pparmbuf" is an error pointer and we can't
pass it to kfree().  I changed the "goto _r871x_mp_ioctl_hdl_exit" to a
direct return.

I changed the earlier goto to a direct return as well for consistency
and removed the "pparmbuf = NULL" initializer since it's no longer
needed.

Fixes: 45de432775 ('Staging: rtl8712: Use memdup_user() instead of copy_from_user()')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-08 01:58:04 +02:00
Julia Lawall 8f47c28b5a staging: rtl8712: Drop unneeded cast on netdev_priv
The result of netdev_priv is already implicitly cast to the type of the
left side of the assignment.

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

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

x =
- (T *)
  netdev_priv(...)
// </smpl>

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03 15:15:40 +02:00
Cristina Opriceana 45de432775 Staging: rtl8712: Use memdup_user() instead of copy_from_user()
Use memdup_user() to avoid its duplicated implementation and simplify
code. memdup_user() uses GFP_KERNEL instead of GFP_ATOMIC,
which is valid because copy_from_user() might sleep and it's useless
to make the allocation atomic. Found with coccinelle.

Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-01 17:26:58 +02:00
Haneen Mohammed e0e982b436 Staging: rtl8712: replace memcpy with ether_addr_copy
This patch replace memcpy with ethe_addr_copy to address the following
warning generated by checkpatch.pl: ""Prefer ether_addr_copy over memcpy
if the Ethernet addresses are __aligned(2)"

Follwoing is the output of pahole for the relevant datastructures:
1- for  "iwe.u.ap_addr.sa_data" and "wrqu->ap_addr.sa_data"

struct sockaddr {
        sa_family_t                sa_family;            /*     0     2 */
        char                       sa_data[14];          /*     2    14 */

        /* size: 16, cachelines: 1, members: 2 */
        /* last cacheline: 16 bytes */
};

struct iw_event {
        __u16                      len;                  /*     0     2 */
        __u16                      cmd;                  /*     2     2 */

        /* XXX 4 bytes hole, try to pack */

        union iwreq_data           u;                    /*     8    16 */

        /* size: 24, cachelines: 1, members: 3 */
        /* sum members: 20, holes: 1, sum holes: 4 */
        /* last cacheline: 24 bytes */
};

2- for  "pnetwork->network.MacAddress" and "pcur_bss->MacAddress"

struct wlan_network {
        struct list_head           list;                 /*     0    16 */
        int                        network_type;         /*    16     4 */
        int                        fixed;                /*    20     4 */
        unsigned int               last_scanned;         /*    24     4 */
        int                        aid;                  /*    28     4 */
        int                        join_res;             /*    32     4 */
        struct ndis_wlan_bssid_ex  network;              /*    36   884 */
        /* --- cacheline 14 boundary (896 bytes) was 24 bytes ago ---   */

        /* size: 920, cachelines: 15, members: 7 */
        /* last cacheline: 24 bytes */
};

struct ndis_wlan_bssid_ex {
        u32                        Length;               /*     0     4 */
        unsigned char              MacAddress[6];        /*     4     6 */
        u8                         Reserved[2];          /*    10     2 */
        struct ndis_802_11_ssid    Ssid;                 /*    12    36 */
        u32                        Privacy;              /*    48     4 */
        s32                        Rssi;                 /*    52     4 */
        enum NDIS_802_11_NETWORK_TYPE NetworkTypeInUse;  /*    56     4 */
        struct NDIS_802_11_CONFIGURATION Configuration;  /*    60    32 */
        /* --- cacheline 1 boundary (64 bytes) was 28 bytes ago --- */
        enum NDIS_802_11_NETWORK_INFRASTRUCTURE InfrastructureMode; /* 92     4 */
        NDIS_802_11_RATES_EX       SupportedRates;       /*    96    16 */
        u32                        IELength;             /*   112     4 */
        u8                         IEs[768];             /*   116   768 */
        /* --- cacheline 13 boundary (832 bytes) was 52 bytes ago --- */

        /* size: 884, cachelines: 14, members: 12 */
        /* last cacheline: 52 bytes */
};

Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18 10:32:39 +01:00
Aya Mahfouz 22905b8594 staging: rtl8712: replace memset(x,0,ETH_ALEN)
eth_zero_addr() is a wrapper function for memset if 0 is going to
be assigned to a mac address. The aforementioned function replaces
memset. In addition, linux/etherdevice.h was included as a header
since it is the file that defines the inline function eth_zero_addr().
The changes were carried out using the following coccinelle script:

@header@
@@

#include <linux/etherdevice.h>

@eth_zero_addr@
expression e;
@@

-memset(e,0,ETH_ALEN);
+eth_zero_addr(e);

@eth_broadcast_addr@
identifier e;
@@

-memset(e,\(0xff\|0xFF\|255\),ETH_ALEN);
+eth_broadcast_addr(e);

@linux_header depends on !header && (eth_zero_addr || eth_broadcast_addr) @
@@

+ #include <linux/etherdevice.h>
+

@special_header depends on !header && !linux_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>
+

@custom_header depends on !header && !linux_header && !special_header && (eth_zero_addr || eth_broadcast_addr) @
@@

+
+ #include <linux/etherdevice.h>

Signed-off-by: Aya Mahfouz <mahfouz.saif.elyazal@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06 15:30:07 -08:00
Vaishali Thakkar 875b7dec47 Staging: rtl8712: Use mod_timer
This patch introduces the use of API function mod_timer
instead of driver specific function as it is a more
efficient and standard way to update the expire field of
an active timer.

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-26 15:11:22 -08:00
Max Perepelitsyn 0636b4603f staging: rtl8712: remove spaces before commas
checkpatch.pl fix for
ERROR: space prohibited before that ',' (ctx:WxE)

Signed-off-by: Max Perepelitsyn <mperepelitsyn@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-17 14:20:25 -08:00
Sudip Mukherjee e29d3ebcda staging: rtl8712: remove unused variables
unused variables are removed. These variables were only assigned some
values and after that they were never being used. So they are safe to
be removed , and it has been build tested.

I left a call to r8712_read32(padapter, TCR) and
r8712_read8(padapter, SDIO_HCPWM) .

r8712_read32() and r8712_read8() is ultimately calling usb_read32()
and usb_read8() respectively. and they are again calling
r8712_usbctrl_vendorreq().
this r8712_usbctrl_vendorreq() is communicating through the usb bus
and is sending and receiving the control msg.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-29 17:37:26 +08:00
Tapasweni Pathak 646da830fd staging: rtl8712: Remove unnecessary cast for argument of kfree
This patch removes all occurrences of unnecessary cast on the
argument to kfree, all over in rtl8712.

There is no need of the cast on the argument to kfree.

Greped to find occurrences.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-20 10:29:19 +08:00
Tapasweni Pathak 02a29d2d92 staging: rtl8712: add new line after declarations
This patch fixes checkpatch.pl warning in hal_init.c file
WARNING : Missing a blank line after declarations

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-28 22:41:23 -04:00
Tapasweni Pathak 57b6686ebb Staging: rtl8712 : Fix line over 80 characters
This patch fixes checkpatch.pl warning in files of rtl8712
WARNING : line over 80 characters

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:14:36 -07:00
Tapasweni Pathak 730cb373f3 Staging: rtl8712: remove break after return statement
This patch fixes checkpatch.pl warning in rtl871x_ioctl_linux.c file
WARNING : break is not useful after goto or return

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-23 08:02:06 -07:00
James A Shackleford e99a428a1d staging: rtl8712: remove function get_list_head
get_list_head is an inline that returns &list->head.  This patch removes this
inline and directly applies &list->head where applicable.

Signed-off-by: James A Shackleford <shack@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:33:16 -04:00
James A Shackleford 849fb0a887 staging: rtl8712: remove wrapper function get_next
get_next is just an inline wrapper around return list->next.  This
patch removes the wrapper and directly uses list->next where
applicable.

Signed-off-by: James A Shackleford <shack@linux.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-26 20:33:16 -04:00
Rickard Strandqvist 3ae70746d0 staging: rtl8712: rtl871x_ioctl_linux.c: Cleaning up useless if statement
The same code regardless of the outcome of the if statement.
And clean up another duplicate line of code.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 16:44:06 -07:00
Vitaly Osipov 91d435fe36 staging: rtl8712: remove _malloc()
This patch removes all usage of _malloc() and the function itself. Most
uses are straightforward replacements by kmalloc(..., GFP_ATOMIC),
because this was the definition of _malloc(). In a few places it
was possible to use kzalloc() or memdup_user.

A further improvement would be to replace GFP_ATOMIC with GFP_KERNEL
where possible.

Verified by compilation only.

Initial replacement done by running a Coccinelle script along the lines
of:

@@
type T;
expression E;
identifier V;
@@
- V = (T) _malloc(E);
+ V = kmalloc(E, GFP_ATOMIC);

@@
expression E, E1;
@@
- E1 = _malloc(E);
+ E1 = kmalloc(E, GFP_ATOMIC);

Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25 11:04:44 -07:00
Christian Engelmayer 55d4f6cc4c staging: rtl8712: fix potential leak in r871x_wx_set_enc_ext()
Fix a potential leak in the error path of r871x_wx_set_enc_ext(). In case the
requested algorithm is not supported by the driver, the function returns
without freeing the already allocated 'param' struct. Move the input
verification to the beginning of the function so that the direct return is
safe. Detected by Coverity - CID 144373.

Signed-off-by: Christian Engelmayer <cengelma@gmx.at>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-24 01:57:14 +09:00
Paul Gortmaker 885a947e5b staging: delete non-required instances of include <linux/init.h>
None of these files are actually using any __init type directives
and hence don't need to include <linux/init.h>.  Most are just a
left over from __devinit and __cpuinit removal, or simply due to
code getting copied from one driver to the next.

Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17 10:08:14 -08:00
Thomas Cort 77e73e8c90 Staging: rtl8712: fix spaces before semicolons
Resolve all of the 'WARNING: space prohibited before semicolon'
checkpatch warnings for rtl8712.

Signed-off-by: Thomas Cort <linuxgeek@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-03 13:50:54 -07:00
Andy Shevchenko 87fa05e8ab staging: rtl8712: return MAC in standard form
MAC respresentation should follow standard form.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23 14:52:19 -07:00
Przemo Firszt 0024a1e734 rtl8712: replace min with min_t
I've changed the ugly casting here and used min_t() instead.  I
also changed the u16 to a u32 because ->network.Ssid.SsidLength
is 32 bits.  It doesn't make a difference, but truncating the
upper bits away is sloppy.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11 16:39:11 -08:00
Przemo Firszt 87a573ada0 rtl8712: replace printk with better solutions
Replace printk with netdev_printk helpers, dev_printk helpers or
pr_err/warn/info if there is no device info available.

Signed-off-by: Przemo Firszt <przemo@firszt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-11 16:39:11 -08:00
Cyril Roelandt 2df29e7bf2 staging: rtl8712: avoid a useless call to memset().
In r8711_wx_get_wap(), make sure we do not call memcpy() on a memory area that
has just been zeroed by a call to memset().

Signed-off-by: Cyril Roelandt <tipecaml@gmail.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 14:53:58 -08:00
Wei Yongjun 605fba82a2 staging: r8712u: fix potential NULL pointer dereference in r871x_wps_start()
The dereference should be moved below the NULL test.

dpatch engine is used to auto generate this patch.
(https://github.com/weiyj/dpatch)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22 13:30:01 -07:00
Wei Yongjun 779477f296 staging: r8712u: use is_broadcast_ether_addr() to simplify the code
Using is_broadcast_ether_addr() to simplify the code.

spatch with a semantic match is used to found this problem.
(http://coccinelle.lip6.fr/)

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 14:03:40 -07:00
Justin P. Mattock be10ac2b96 staging: rtl8712: Fix typos.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-09 13:46:01 -07:00
Marcos Paulo de Souza b0d5c79884 drivers: staging: rtl8172: Remove unneeded include of version.h
The output of "make versioncheck" told us that:

drivers/staging/rtl8712/osdep_service.h: 32 linux/version.h not needed.
drivers/staging/rtl8712/rtl871x_ioctl_linux.c: 46 linux/version.h not needed.

If we take a look at these files, we will agree to remove it.

Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Cc: <devel@driverdev.osuosl.org>
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
ACKed-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:59:03 -07:00
Jim Cromie b330f606ed staging: replace open-coded ARRAY_SIZEs
spatch http://coccinelle.lip6.fr/rules/array.cocci did these.

Signed-off-by: Jim Cromie <jim.cromie@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 15:25:55 -07:00
Larry Finger da3e6ec2f4 staging: r8712u: Fix regression in signal level after commit c6dc001
In commit c6dc001 "staging: r8712u: Merging Realtek's latest (v2.6.6).
Various fixes", the returned qual.qual member of the iw_statistics
struct was changed. For strong signals, this change made no difference;
however for medium and weak signals it results in a low signal that
shows considerable fluctuation, When using wicd for a medium-strength
AP, the value reported in the status line is reduced from 100% to 60% by
this bug.

This problem is reported in https://bugzilla.kernel.org/show_bug.cgi?id=42826.

Reported-and-tested-by: Robert Crawford <wrc1944@gmail.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-29 16:28:56 -08:00
Ali Bahar 2192e60654 staging: r8712u: Most return-values changed from -1 to proper errno macros.
The ioctl handlers were frequently returning -1 upon failure. Most of
these have now been changed to proper errno macros.
The few remaining ones have been left untouched because either the
handler is not called (and so cannot be tested), or the function never
fails (and so cannot be system-tested), or requires new code to
distinguish its failures.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 17:00:36 -07:00
Ali Bahar c6dc001f2a staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.
passive_mode added to private ioctls.
New private ioctls added for RSSI, link speed, mac address, scan type,
and DCE-D.
In r8711_wx_get_scan(), we now sleep only 100 times, instead of 1000.
In r8711_wx_set_essid(), added a check for Ad-Hoc state.
In r8711_wx_get_rate(), added a check for RTL8712_RF_2T2R RF type.
Added Set chplan.
In r871x_get_wireless_stats(), updated the mechanism for displaying
link quality.
Added SetDIG and SetRA commands.
r8712_joinbss_cmd() no longer checks for Ad-Hoc mode.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 17:00:35 -07:00
Ali Bahar c13b6f2498 staging: r8712u: Merging Realtek's latest (v2.6.6). Use stack, not malloc.
translate_scan() now uses the stack for some variables, instead of mallocing.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 17:00:33 -07:00
Ali Bahar 359140aaea staging: r8712u: Merging Realtek's latest (v2.6.6). Updated include directives.
These are the new include directives for header files.
The following were (somehow!) not explicity in Realtek's, but proved necessary:
"linux/usb.h" is needed for usb_alloc_urb();
"linux/interrupt.h" is needed for tasklet_struct. It was often a nested
include.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 17:00:32 -07:00
Ali Bahar 7c1f4203a2 staging: r8712u: Merging Realtek's latest (v2.6.6). Renamed _netdev_priv.
Renamed _netdev_priv to netdev_priv.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-06 17:00:30 -07:00
Dan Carpenter 5ae717139a rtl8712: don't just return -EFAULT in wpa_supplicant_ioctl()
There were some curly braces missing so the original code in
wpa_supplicant_ioctl() pretty much always returned -EFAULT without
doing anything.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:16:35 -07:00
Ali Bahar d1661dfdb9 staging: r8712u: Sets to SSID, and to AP MAC#, can now be done when the interface is Down.
The original Realtek code assumed that ioctl Sets get done after the
interface is Up. This included the set to Essid and to the AP MAC#;
and it fit Realtek's installation procedure. But there is no such
necessity for the adapter, and no stated requirement found
elsewhere. Also, wireless drivers typically permit this.

A typical error message used to be:
Error for wireless request "Set ESSID" (8B1A) :
    SET failed on device wlan0 ; Operation not permitted.

Signed-off-by: Ali Bahar <ali@internetDog.org>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 12:24:31 -07:00
Javier M. Mellid 2657c30e23 staging: rtl8712: fixed coding style issues
Fixed some style and format issues with code.

Signed-off-by: Javier M. Mellid <jmunhoz@igalia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20 14:13:31 -07:00
Alexander Beregalov 4008386593 Staging: rtl8712: redundant null check before kfree()
Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-04-20 13:45:59 -07:00
Ilia Mirkin b7977fa250 staging: rtl8712: 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
Xiaochen Wang 4495c15f29 staging: rtl8712: check _malloc return value
Description: The original check is wrong.

Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07 13:46:38 -08:00
Xiaochen Wang cd92274093 staging: rtl8712: check copy_from_user return value
Description:return -EFAULT if copy_to_user() fails

Signed-off-by: Xiaochen Wang <wangxiaochen0@gmail.com>
Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-07 13:46:38 -08:00