1
0
Fork 0
Commit Graph

32 Commits (cab054ab47fa3fdf1c597a9874363680bfdab33e)

Author SHA1 Message Date
Luis de Bethencourt 4ef2de5ae0 staging: rtl8712: spaces preferred around operands
Clean up all instances of checkpatch.pl checks:
CHECK: spaces preferred around that '+'
(and other operands)

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:26:59 -07:00
Luis de Bethencourt 1ca96884b1 staging: rtl8712: Remove boolean comparisons
Boolean tests do not need explicit comparison to true or false.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:26:59 -07:00
Shivani Bhardwaj adc6b375aa Staging: rtl8712: os_intfs: Remove unnecessary cast
Explicit type conversions are not required and so, they should be
removed.
Semantic patch used:
@@
type T;
T e;
identifier x;
@@

* T x = (T)e;

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:12:30 -07:00
Punit Vara 852681eb4a Staging: rtl8712: os_intfs.c : Coding style warning fix for block comment
This is patch to the os_intfs.c file that fixes up following warning
reported by checkpatch.pl :

-Block comments use a trailing */ on a separate line

Signed-off-by: Punit Vara <punitvara@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-08 10:34:50 +01:00
Luca Ceresoli 73b4276365 staging: rtl8712: remove useless return value
The loadparam() function cannot fail, it's called only once and its return
value is ignored there.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:58 +09:00
Luca Ceresoli a0825db8d1 staging: rtl8712: remove unneeded forward declaration
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:57 +09:00
Luca Ceresoli 2ede90f996 staging: rtl8712: remove useless comment
"step 2" does mean much as there is no "step 1" stated anywhere...

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Cc: Greg Kroah-Hartman <greg@kroah.com>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:49:57 +09:00
Jagan Teki 71d667b800 staging: rtl8712: Use ether_addr_copy() instead of memcpy()
Fixes Warning encounter this by applying checkpatch.pl against this file:
Prefer ether_addr_copy() over memcpy() if the Ethernet addresses
are __aligned(2)

pahole output for respective structures:
- 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 */
};

- pnetdev->dev_addr
dev_addr is interface address infor from generic net_device structure
which is properly aligned and have some patches with this change as well.
"staging: rtl8712: fix Prefer ether_addr_copy() over memcpy()"
(sha1: 36e4d8826b)

Signed-off-by: Jagan Teki <jteki@openedev.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 11:47:56 +09: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
Vaishali Thakkar 6501c8e7d8 Staging: rtl8712: Eliminate use of _cancel_timer_ex
Use timer API function del_timer_sync instead of driver
specific function _cancel_timer_ex as besides deactivating
a timer, it ensures that the timer is stopped on all
CPUs before the driver exists. Also, definition of function
_cancel_timer_ex is removed as it is no longer needed after
this change.

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

@@ expression x; @@

- _cancel_timer_ex (&x);
+ del_timer_sync (&x);

Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-16 15:46:07 +01:00
Vaishali Thakkar e922df7d3e Staging: rtl8712: 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 setup and set the timer.
To be compatible with the change, argument types of
referenced functions are changed. Also, definition of
function _init_timer is removed as it is no longer needed
after this change.

This is done 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-06 09:54:34 -08:00
Vaishali Thakkar c703c750cc Staging: rtl8712: 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-01 17:02:11 -08:00
Thomas Vegas 22649bb2b6 staging: rtl8712: Remove useless variable 'fw_found'
The net device only exists when firmware is loaded successfully.
Firmware presence variable is only used through r871xu_dev_remove() and
this function already checks for net device existence.

Signed-off-by: Thomas Vegas <thomas@grouk.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-06-19 16:40:07 -07:00
Dan Carpenter b16aad354a Staging: rtl8712: fix an error test in start_drv_threads()
Testing for "if (IS_ERR(padapter->cmdThread) < 0)" doesn't make sense.
The kthread_run() function returns error pointers on error pointers on
error so it should just be "if (IS_ERR(padapter->cmdThread))".

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-06 11:58:32 -08: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
Kees Cook f170168b9a drivers: avoid parsing names as kthread_run() format strings
Calling kthread_run with a single name parameter causes it to be handled
as a format string. Many callers are passing potentially dynamic string
content, so use "%s" in those cases to avoid any potential accidents.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-07-03 16:07:41 -07: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
Devendra Naga e1656648c9 staging: rtl8712: remove assignment of 0 to a static global variable
fixes the following checkpatch warning:

drivers/staging/rtl8712/os_intfs.c:99: ERROR: do not initialise statics
to 0 or NULL

as statics are always initialised to 0.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-26 09:23:31 -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
Larry Finger 2080913e01 staging: r8712u: Fix regression caused by commit 8c213fa
In commit 8c213fa "staging: r8712u: Use asynchronous firmware loading",
the command to release the firmware was placed in the wrong routine.

In combination with the bug introduced in commit a5ee652 "staging: r8712u:
Interface-state not fully tracked", the driver attempts to upload firmware
that had already been released. This bug is the source of one of the
problems in https://bugs.archlinux.org/task/27996#comment89833.

Tested-by: Alberto Lago Ballesteros <saniukeokusainaya@gmail.com>
Tested-by: Adrian <agib@gmx.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-29 16:28:51 -08:00
Larry Finger 9f4bc8cf3f staging: r8712u: Fix regression introduced by commit a5ee652
In commit a5ee652 "staging: r8712u: Interface-state not fully tracked",
the private boolean "bup" was set false when the interface was brought down,
as that seemed appropriate. This change has not caused any problems when
using NetworkManager or manual control of the device; however, when wicd
control is used, there is a locking problem in wpa_supplicant, as shown in
https://bugzilla.kernel.org/show_bug.cgi?id=42818.

This fix reverts the only code change in commit a5ee652. My
analysis is that "bup" is badly named. In its present form, it
seems to indicate the up/down state of the device, but its usage
is more consistent with an initialized/uninitialized state. That
problem will be addressed in a later patch.

Note: Commit 8c213fa, which introdued asynchronous firmware loading
for this driver, exposed this bug to a greater extent. That bug
is addressed in the next patch in this series.

This bug is also responsible for the bug in
https://bugzilla.kernel.org/show_bug.cgi?id=42815. and this bug is
also part of the problems discussed at https://bugs.archlinux.org/task/27996#comment89950.

Tested-by: Alberto Lago Ballesteros <saniukeokusainaya@gmail.com>
Tested-by: Adrian <agib@gmx.de>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@vger.kernel.org> [3.2+]
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-29 16:28:50 -08:00
Greg Kroah-Hartman b91867f2ee Merge tag 'staging-3.3-rc3' into staging-next
This was done to resolve some merge issues with the following files that
had changed in both branches:
	drivers/staging/rtl8712/rtl871x_sta_mgt.c
	drivers/staging/tidspbridge/rmgr/drv_interface.c
	drivers/staging/zcache/zcache-main.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-10 10:58:25 -08:00
Larry Finger 86587b671b staging: r8712u: Simplify semaphores
I am preparing to convert this driver from semaphore to mutex locking,
The first step has been to eliminate a number of semaphores that were
initialized but never used, and one whose only use was a single "up"
after initialization. A total of 9 semaphores were removed in this process.

One other change was to remove some inline semaphore routines that were
unused.

In addition, several cases had the following structure:

down()
if () {
   ...
}
up()

The locking overhead was reduced by moving the up/down inside the if
block.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:12:55 -08:00
Larry Finger 8c213fa591 staging: r8712u: Use asynchronous firmware loading
In https://bugs.archlinux.org/task/27996, failure of driver r8712u is
reported, with a timeout during module loading due to synchronous loading
of the firmware. The code now uses request_firmware_nowait().

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-08 14:14:15 -08:00
Ali Bahar ee5b1aadfd staging: r8712u: Merging Realtek's latest (v2.6.6). Various fixes.
In r8712_generate_ie(), HT check is no longer done.
Removed r8712_add_ht_addt_info().
Changes to defragmentation handling, and queue selection.
Get TSSI command.
Added an Ad-Hoc check to is_desired_network()
r8712_ind_disconnect() now checks for Linked state.
r8712_xmit_bh() now schedules an xmit tasklet.

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 6c19d86b9b staging: r8712u: Merging Realtek's latest (v2.6.6). stop_drv_timers moved.
stop_drv_timers() is now done in r871xu_dev_remove(), not netdev_close().

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 7bcd9ce6de staging: r8712u: Merging Realtek's latest (v2.6.6). Removed os_free_netdev.
Replaced (Realtek's)  os_free_netdev by (linux's own) free_netdev.

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
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
Ali Bahar a5ee65290d staging: r8712u: Interface-state not fully tracked.
padapter->bup is True when the interface has been
brought Up. But it was not being reset when the
interface is taken Down.
This has not caused a known problem, as other
state variables may be compensating for it. Never
the less, it is now properly tracked.

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:32 -07:00
Larry Finger d19b86473e staging: r8712u: Add module parameter to disable turbo mode
Signed-off-by: Albert Wang <albert_wang@realtek.com.tw>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 10:59:52 -07:00
Larry Finger 2865d42c78 staging: r8712u: Add the new driver to the mainline kernel
This code is for a completely new version of the Realtek 8192 USB devices
such as the D-Link DWA-130. The Realtek code, which was originally for
Linux, Windows XP and Windows CE, has been stripped of all code not needed
for Linux. In addition, only one additional configuration variable, which
enables AP mode, remains.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Florian Schilhabel <florian.c.schilhabel@googlemail.com>
Tested-by: Frederic Leroy <fredo@starox.org>
2010-08-20 10:15:30 -05:00