aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/rtl8712 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-03-02sched/headers: Prepare for new header dependencies before moving code to <linux/sched/signal.h>Ingo Molnar2-1/+2
We are going to split <linux/sched/signal.h> out of <linux/sched.h>, which will have to be picked up from other headers and a couple of .c files. Create a trivial placeholder <linux/sched/signal.h> file that just maps to <linux/sched.h> to make this patch obviously correct and bisectable. Include the new header in the files that are going to need it. Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: Mike Galbraith <efault@gmx.de> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: linux-kernel@vger.kernel.org Signed-off-by: Ingo Molnar <mingo@kernel.org>
2017-02-12staging: r8712u: Fix Sparse warnings in rtl871x_mlme.cLarry Finger1-5/+4
Sparse reports the following: CHECK drivers/staging/rtl8712/rtl871x_mlme.c drivers/staging/rtl8712/rtl871x_mlme.c:1653:46: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_mlme.c:1653:46: expected unsigned int [unsigned] [usertype] DSConfig drivers/staging/rtl8712/rtl871x_mlme.c:1653:46: got restricted __le32 [usertype] <noident> drivers/staging/rtl8712/rtl871x_mlme.c:1656:56: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_mlme.c:1656:56: expected unsigned int [unsigned] [usertype] ATIMWindow drivers/staging/rtl8712/rtl871x_mlme.c:1656:56: got restricted __le32 [usertype] <noident> drivers/staging/rtl8712/rtl871x_mlme.c:1712:35: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_mlme.c:1712:35: expected restricted __le16 [addressable] [usertype] cap_info drivers/staging/rtl8712/rtl871x_mlme.c:1712:35: got int Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: r8712u: Fix Sparse warnings in rtl871x_ioctl_linux.cLarry Finger1-2/+2
Sparse reports the following: CHECK drivers/staging/rtl8712/rtl871x_ioctl_linux.c drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1422:46: warning: restricted __le16 degrades to integer drivers/staging/rtl8712/rtl871x_ioctl_linux.c:1424:46: warning: restricted __le16 degrades to integer Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: r8712u: Fix Sparse endian warning in rtl871x_recv.cLarry Finger1-2/+3
Sparse reports the following: CHECK drivers/staging/rtl8712/rtl871x_recv.c drivers/staging/rtl8712/rtl871x_recv.c:657:21: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_recv.c:657:21: expected unsigned short [unsigned] [assigned] [usertype] len drivers/staging/rtl8712/rtl871x_recv.c:657:21: got restricted __be16 [usertype] <noident> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: r8712u: Fix Sparse warning in rtl871x_xmit.cLarry Finger1-3/+4
Sparse reports the following: CHECK drivers/staging/rtl8712/rtl871x_xmit.c drivers/staging/rtl8712/rtl871x_xmit.c:350:44: warning: restricted __le32 degrades to integer drivers/staging/rtl8712/rtl871x_xmit.c:491:23: warning: incorrect type in initializer (different base types) drivers/staging/rtl8712/rtl871x_xmit.c:491:23: expected unsigned short [usertype] *fctrl drivers/staging/rtl8712/rtl871x_xmit.c:491:23: got restricted __le16 *<noident> drivers/staging/rtl8712/rtl871x_xmit.c:580:36: warning: incorrect type in assignment (different base types) drivers/staging/rtl8712/rtl871x_xmit.c:580:36: expected unsigned short [unsigned] [short] [usertype] <noident> drivers/staging/rtl8712/rtl871x_xmit.c:580:36: got restricted __be16 [usertype] <noident> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: r8712u: Fix macros used to read/write the TX/RX descriptorsLarry Finger1-57/+52
Although the driver works on big-endian hardware, Sparse generates a lot of warnings. Many of these are the result of incorrect coding of these macros. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: rtl8712u: Fix endian settings for structs describing network packetsLarry Finger1-42/+42
The headers describing a number of network packets do not have the correct endian settings for several types of data. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: rtl8712: Fix some Sparse endian messagesLarry Finger1-3/+3
Sparse reports the following: CHECK drivers/staging/rtl8712/rtl8712_xmit.c drivers/staging/rtl8712/rtl8712_xmit.c:564:42: warning: cast from restricted __le32 drivers/staging/rtl8712/rtl8712_xmit.c:569:42: warning: cast from restricted __le32 drivers/staging/rtl8712/rtl8712_xmit.c:571:42: warning: cast from restricted __le32 Each of these cases is transferring a quantity that is little-endian. There is no need for conversion. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-09staging: rtl8712: rtl8712: fixed missing conversion to le32Carlos Palminha1-1/+1
Fixed missing conversion to le32, detected by sparse (invalid assignment from int to __le32) Signed-off-by: Carlos Palminha <palminha@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-25Staging: rtl8712: fix spelling errorsJoseph Wright5-12/+12
Found by checkpatch: - s/cacluated/calculated/ - s/convertor/converter/ - s/psudo/pseudo/ - s/halfs/halves/ Signed-off-by: Joseph Wright <rjosephwright@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-16staging: rtl: fix possible NULL pointer dereferenceArnd Bergmann1-1/+6
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: 1cc18a22b96b ("staging: r8188eu: Add files for new driver - part 5") Fixes: 2865d42c78a9 ("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-07staging:rtl8712 Aligned code with open parenthesisScott Matheina1-3/+3
Aligned code with open parenthesis to fix a checkpatch warning Signed-off-by: Scott Matheina <scott@matheina.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-07staging:rtl8712: Removed unnecessary parenthesesScott Matheina1-2/+2
Removed unnecessary parentheses identified by checkpatch Signed-off-by: Scott Matheina <scott@matheina.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: used a better macroJannik Becher1-1/+1
Fixed a sparse warning. Using be16_to_cpus() to avoid double assignment. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed u16 to __be16Jannik Becher1-5/+5
Fixed sparse warning. Just changed u16 to __be16 and typecasts. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed cast to __le16Jannik Becher1-7/+7
Fixed sparse warning. Changed u16 to __le16 Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed u32 to __le32Jannik Becher3-10/+9
Fixed sparse warnings. Deleted cpu_to_le32() for enum. I'm not sure why it was there. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: fixed little endian problemJannik Becher1-1/+1
Fixed a sparse warning. Using function le16_to_cpus() to avoid double assignment. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed uint to __le32Jannik Becher1-2/+3
Fixed a sparse warning. Just changed uint to __le32. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed u32 to __le32Jannik Becher1-10/+8
Fixed sparse warning. Just changed u32 to __le32. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed typecast to __leJannik Becher1-6/+6
Fixed sparse warning. Changed uint to __le16 and __le32. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed GetFrameSubType macroJannik Becher2-4/+4
Fixed a sparse warning. GetFrameSubType and GetFrameType should cast to __le16. Furthermore GetFramSubType should use le16_to_cpu instead of cpu_to_le16. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: casted variables to __le32Jannik Becher1-6/+6
Fixed a sparse warning. Casting __le32 variables to the right type. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed function argument to __le32Jannik Becher2-2/+2
Fixed a sparse warning "cast to restricted __le32". Function argument is of type __le32. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed variables to __le32Jannik Becher2-10/+11
Fixed sparse warning "cast to restricted __le32". Changed struct tx_desc members to __le32 and pcmdbuf to __le32. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed struct members to __le32Jannik Becher1-3/+3
Fixed sparse warning "cast to restricted __le32". struct sitesurvey_parm uses little endian members. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03staging: rtl8712: changed struct members to __le32Jannik Becher1-14/+14
Fixed sparse warning "cast to restricted __le32". struct recv_stat and struct phy_stat have always little endian members. Signed-off-by: Jannik Becher <becher.jannik@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-06Staging:rtl8712: Fixed coding style issueHarsh Jain1-6/+6
Fixes following checkpatch.pl warning Block comments should align the * on each line Signed-off-by: Harsh Jain <harshjain32@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21Staging: rtl8712: rtl871x_*: Removed unnecessary else statements after a break or returnShiva Kerdel2-4/+4
The indent code blocks of the else statements were unnecessary and are better written without them. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-21staging: rtl8712: Fix coding style warnings on Block commentsVijai Kumar K6-113/+101
Fixed checkpatch.pl warnings related to Block comments in staging/rtl8712/*.c files. Signed-off-by: Vijai Kumar K <vijaikumar.kanagarajan@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-17Staging: rtl8712: Fixed 'tabstop' coding style warnings.Yamanappagouda Patil2-13/+13
Fixed checkpatch warning "Statements should start on a tabstop" in rtl8712 module. Signed-off-by: Yamanappagouda Patil <goudapatilk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-07staging : rtl8712: Free memory when kmalloc failsSouptick Joarder2-2/+8
There are few functions where we need to free previously allocated memory when kmalloc fails. Else it may lead to memory leakage. In _init_cmd_priv() and _r8712_init_xmit_priv(), in few places we are not freeing previously allocated memory when kmalloc fails. Signed-off-by: Souptick joarder <jrdr.linux@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16Staging: rtl8712: remove unused functionsBhumika Goyal3-33/+0
Remove the functions sleep_schedulable, down_scanned_network, up_scanned_network and get_free_xmit_queue as they are not used anywhere in the kernel. Functions detected using coccinelle but changes done by hand. Script: @initialize:python@ @@ def display(name,p): print(name,p[0].file) @r1@ identifier func; type T; position p; @@ static T func@p(...) { ... } @r@ identifier r1.func; @@ func @script:python depends on !r@ func << r1.func; p << r1.p; @@ display(func,p) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-28staging: rtl8712: Change _LED_STATE enum in rtl871x driver to avoid conflicts with LED namespaceZach Brown1-194/+194
Adding led support for phy causes namespace conflicts for some phy drivers. The rtl871 driver declared an enum for representing LED states. The enum contains constant LED_OFF which conflicted with declaration found in linux/leds.h. LED_OFF changed to LED_STATE_OFF In order to avoid a possible future collision LED_ON was changed to LED_STATE_ON as well. Signed-off-by: Zach Brown <zach.brown@ni.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-28Fixes: 3d44a78f0d8b ("staging: rtl8712: Remove unnecessary 'else'")Matthew Kilgore1-1/+2
An "unnecessary" 'else' was removed due to complains from checkpatch.pl as it is preceded by a 'return', however the 'else' branch is necessary as an earlier branch of the 'if' falls through. By removing the 'else', that route now hits the 'break' and the 'while' loop exits prematurely. This commit reverts that change and puts the original 'else' back in place. Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27staging: rtl8712: Remove unnecessary 'else'Namrata A Shettar1-2/+1
Remove unnecessary 'else' after 'return' to resolve checkpatch issue. Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-26staging: rtl8172: usb_intf.c: Fixed block comment coding styleGonçalo Salazar1-1/+1
Fixed a block comment indentation in the rtl8712 usb_intf.c file. Signed-off-by: Gonçalo Salazar <glbsalazar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: rtl8712: rtl871x_cmd: Use !x instead of x == NULL.Sandhya Bankar1-11/+11
Use !x instead of x == NULL. This patch was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: rtl8712: rtl8712_xmit: Use !x instead of x == NULLSandhya Bankar1-1/+1
Use !x instead of x == NULL. This patch was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: rtl8712: rtl8712_recv: Use !x instead of x == NULLSandhya Bankar1-6/+6
Use !x instead of x == NULL. This patch was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-20Staging: rtl8712: rtl8712_efuse: Use !x instead of x == NULL.Sandhya Bankar1-1/+1
Use !x instead of x == NULL. This patch was found by checkpatch. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-17staging: rtl8712: Rename misspelt macroNamrata A Shettar1-5/+5
Correct the word 'success' being misspelt in the macro: - LED_BLINK_WPS_SUCESS_INTERVAL_ALPHA => LED_BLINK_WPS_SUCCESS_INTERVAL_ALPHA Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-16staging: rtl8712: fix double lock bug in SetPSModeWorkItemCallback()Wei Yongjun1-1/+1
Fix a double lock bug in SetPSModeWorkItemCallback(). Fixes: 5c2ba8b85e35 ("rtl8712: pwrctrl_priv: Replace semaphore lock with mutex") Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: rtl8712: fix block commentsShaily Sangwan2-139/+139
This patch fixes the following checkpatch.pl warning: Block comments use * on subsequent lines Signed-off-by: Shaily Sangwan <shaily15297@yahoo.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13staging: rtl8712: fix coding style error reported from checkpatchOmri Arad1-2/+2
removed the following: ERROR: code indent should use tabs where possible WARNING: please, no spaces at the start of a line WARNING: Statements should start on a tabstop Signed-off-by: Omri Arad <omriarad3@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-12staging: rtl8712: checkpatch cleanup: block comments using a trailing */Raphaël Beamonte29-134/+268
Fix checkpatch.pl warning "Block comments use a trailing */ on a separate line" on multiple files of the driver by editing the affected comments. Signed-off-by: Raphaël Beamonte <raphael.beamonte@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02staging: rtl8172: fixed comment style in rts871x_cmd.cLouie Lu1-21/+25
Fixed comment style warning by checkpatch: * Block comments use * on subsequent lines * Block comments use a trailing */ on a separate line Signed-off-by: Louie Lu <louie.lu@hopebaytech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-02staging: rtl8712: delete one space before if statementLouie Lu1-1/+1
This patch fixed minor checkpatch warning: WARNING: Statements should start on a tabstop Signed-off-by: Louie Lu <louie.lu@hopebaytech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-01rtl8712: pwrctrl_priv: Replace semaphore lock with mutexBinoy Jayan4-29/+17
The semaphore 'lock' in 'pwrctrl_priv' is used as a simple mutex, so it should be written as one. Semaphores are going away in the future. _enter_pwrlock was using down_interruptible(), so the lock could be broken by sending a signal. This could be a bug, because nothing checks the return code here. Hence, using mutex_lock instead of the interruptible version. Removing the now unused _enter_pwrlock and _down_sema. Signed-off-by: Binoy Jayan <binoy.jayan@linaro.org> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: r8712u: Handle some false positives from kmemleakLarry Finger1-0/+2
When this driver preallocates some URBs, kmemleak is unable to find that allocated memory when it scans. When the driver is unloaded, that memory is reclaimed, therefore, the report is a false positive. Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>