summaryrefslogtreecommitdiff
path: root/drivers/staging/wlan-ng/p80211conv.c
AgeCommit message (Collapse)AuthorFilesLines
2017-08-19drivers/staging/wlan-ng/p80211conv.c: fixed a potential memory leakLynn Lei1-0/+1
Fixed a potential memory leak inside skb_ether_to_p80211() When the wep_encrypt() fails the code return 2 directly Which causes the p80211_wep->data dangling Add a kfree statement to reclaim that memory allocated Signed-off-by: Lynn Lei <lynnl.yet@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-16networking: make skb_push & __skb_push return void pointersJohannes Berg1-9/+5
It seems like a historic accident that these return unsigned char *, and in many places that means casts are required, more often than not. Make these functions return void * and remove all the casts across the tree, adding a (u8 *) cast only where the unsigned char pointer was used directly, all done with the following spatch: @@ expression SKB, LEN; typedef u8; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - *(fn(SKB, LEN)) + *(u8 *)fn(SKB, LEN) @@ expression E, SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; type T; @@ - E = ((T *)(fn(SKB, LEN))) + E = fn(SKB, LEN) @@ expression SKB, LEN; identifier fn = { skb_push, __skb_push, skb_push_rcsum }; @@ - fn(SKB, LEN)[0] + *(u8 *)fn(SKB, LEN) Note that the last part there converts from push(...)[0] to the more idiomatic *(u8 *)push(...). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-03-06staging: wlan-ng: remove extra parenthesesGargi Sharma1-1/+1
Removes extra parentheses around function arguments. Issue detected and resolved using the following coccinelle script: @@ expression e; identifier f; @@ f(..., -( e -) ,...) Signed-off-by: Gargi Sharma <gs051095@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-12staging: wlan-ng: reduce type warningsAlexander Alemayhu1-1/+1
Fixes the following sparse output: drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:132:25: warning: cast to restricted __be16 drivers/staging/wlan-ng/p80211conv.c:154:38: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/p80211conv.c:154:38: expected unsigned short [unsigned] [usertype] type drivers/staging/wlan-ng/p80211conv.c:154:38: got restricted __be16 [usertype] <noident> drivers/staging/wlan-ng/p80211conv.c:390:42: warning: cast to restricted __le16 drivers/staging/wlan-ng/p80211conv.c:413:29: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/p80211conv.c:413:29: expected unsigned short [unsigned] [usertype] type drivers/staging/wlan-ng/p80211conv.c:413:29: got restricted __be16 [usertype] <noident> drivers/staging/wlan-ng/p80211conv.c:481:29: warning: incorrect type in assignment (different base types) drivers/staging/wlan-ng/p80211conv.c:481:29: expected unsigned short [unsigned] [usertype] type drivers/staging/wlan-ng/p80211conv.c:481:29: got restricted __be16 [usertype] <noident> Signed-off-by: Alexander Alemayhu <alexander@alemayhu.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10staging: wlan-ng: remove unnecessary out of memory message in p80211conv.cSergio Paracuellos1-2/+0
This patch fix the following checkpatch script warning: WARNING: Possible unnecessary 'out of memory' message. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: wlan-ng: Replace data type declaration with variable of same type ↵Sergio Paracuellos1-1/+1
in p80211conv.c sizeof(*var) instead of sizeof(struct XXX) is preferred. Fix it in p80211conv.c file. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: wlan-ng: fix block comment warnings in p80211conv.cSergio Paracuellos1-159/+159
This patch fix the following checkpatch.pl warnings in p80211conv.c: WARNING: Block comments should align the * on each line Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-28staging: wlan-ng: avoid new typedef: netdevice_tSergio Paracuellos1-1/+1
This patch fixes the following checkpatch.pl warning in p80211netdev.h: WARNING: do not add new typedefs It applies for typedef netdevice_t Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: wlan-ng: Remove the typedef to the 'wlandevice' structuresayli karnik1-3/+3
This patch removes the typedef 'wlandevice_t' to the 'wlandevice' structure. Signed-off-by: sayli karnik <karniksayli1995@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-29Staging: wlan-ng: no need for memcpy() since its arguments are already equalClaudiu Beznea1-1/+0
This patch removes the memcpy() for two variables which were previously tested with memcmp(). The result of memcmp() was zero which means that the previously tested variables were already equal. Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-28Staging: wlan-ng: defined oui_rfc1042[] and oui_8021h[] arrays as const arraysClaudiu Beznea1-2/+2
This patch defines oui_rfc1042[] and oui_8021h[] arrays from p80211conv.c as const arrays since these are not changed anywhere in code. Signed-off-by: Claudiu Beznea <claudiu.beznea@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: wlan-ng: NULL comparisons made elegantPranjal Bhor1-5/+5
Elegance added for NULL comparisons Signed-off-by: Pranjal Bhor <bhor.pranjal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: wlan-ng: Open parenthesis alignment style fixPranjal Bhor1-12/+12
Alignment of lines matched with open parenthesis Signed-off-by: Pranjal Bhor <bhor.pranjal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: wlan-ng: Coding style fix for casting operationPranjal Bhor1-7/+7
Removed spaces after casting operating Signed-off-by: Pranjal Bhor <bhor.pranjal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: wlan-ng: Removed blank lines after bracesPranjal Bhor1-4/+0
Blank lines before closing braces and after opening braces have been removed. Signed-off-by: Pranjal Bhor <bhor.pranjal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: wlan-ng: Logical continuation fixesPranjal Bhor1-23/+24
Logical continuation coding style issues fixed while condition checking Signed-off-by: Pranjal Bhor <bhor.pranjal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-08staging: wlan-ng: Fixed block comments coding style issuePranjal Bhor1-12/+21
All block comment lines now begin with "*" and end with "*/" on a new line. Signed-off-by: Pranjal Bhor <bhor.pranjal@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-13staging/wlan-ng : Remove duplicated defines from p80211Anish Bhatt1-25/+25
ETH_ALEN/ETH_HLEN can be used instead of WLAN_ETHADDR_LEN & WLAN_ETHHDR_LEN, replace directly or use eth_addr* functions where applicable. Signed-off-by: Anish Bhatt <anish@chelsio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-16staging: wlan-ng: Replace hard coded values with MACRO'sHari Prasath Gujulan Elango1-2/+2
This patch replaces hard coded values with global definitions for the Ethernet IEEE 802.3 interface defined in standard header file. Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31staging: wlan-ng: check return value of kmallocGujulan Elango, Hari Prasath (H.)1-0/+2
check return value of kmalloc before accessing the memory pointer and return -ENOMEM if allocation fails. Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-18staging: wlan-ng: Fix typo in comments and printkMasanari Iida1-1/+1
This patch fix spelling typo in comments and print. Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-10-28staging: wlan-ng: Fix incorrect type in assignmentsEbru Akagunduz1-1/+1
fc variable type was u16 and it has an assignment from cpu_to_le16() so its type changed as __le16. This bug found by sparse. Signed-off-by: Ebru Akagunduz <ebru.akagunduz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-02staging: wlan-ng: coding style problem fixModestas Stankus1-1/+0
WARNING: break is not useful after a goto or return 201: FILE: drivers/staging/wlan-ng/p80211conv.c:201: + return 1; + break; Signed-off-by: Modestas Stankus <stankus.modestas@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23staging: wlan-ng: use netdev_() instead of printk()Vitaly Osipov1-15/+16
Replaced all uses of printk() in wlan-ng with netdev_err / _warn where a netdev exists. If a few cases where a netdev does not yet exist, dev_ or pr_ was used. Checkpatch complains about lines over 80 chars or split string constants - the messages are just too long, keeping it completely happy would make the code less readable. Signed-off-by: Vitaly Osipov <vitaly.osipov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-11staging:wlan-ng: cleanup p80211skb_free and p80211skb_rxmeta_detachDevendra Naga1-6/+3
these functions doesn't need return at the end of the function Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-02-01Staging: wlan-ng: fix 2 space coding style issuesAdam Thompson1-2/+2
This patch to p80211conv.c fixes to space coding style warnings found with checkpatch.pl Signed-off-by: Adam Thompson <adam@lotpblog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-10Staging: wlan-ng: fixed coding style issues in p80211conv.cJohan Meiring1-17/+28
This is a patch to the p80211conv.c file that fixes a couple of coding style issues found by the checkpatch.pl tool. Signed-off-by: Johan Meiring <johanmeiring@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-03Staging: wlan-ng: fix style issues in p80211conv.hEdgardo Hames1-32/+32
This patch removes typedefs in p80211conv.h. Signed-off-by: Edgardo Hames <ehames@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-03Staging: wlan-ng: fix style issues for p80211hdr.hEdgardo Hames1-3/+3
Removed typedef and other style issues. Signed-off-by: Edgardo Hames <ehames@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-15Staging: Use kcalloc or kzallocJulia Lawall1-2/+1
Use kcalloc or kzalloc rather than the combination of kmalloc and memset. The semantic patch that makes this change is as follows: (http://coccinelle.lip6.fr/) // <smpl> @@ expression x,y,flags; statement S; type T; @@ x = - kmalloc + kcalloc ( - y * sizeof(T), + y, sizeof(T), flags); if (x == NULL) S -memset(x, 0, y * sizeof(T)); @@ expression x,size,flags; statement S; @@ -x = kmalloc(size,flags); +x = kzalloc(size,flags); if (x == NULL) S -memset(x, 0, size); // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk>
2010-05-11Staging: wlan-ng: fix spaces coding style issue in p80211conv.cRuslan Pisarev1-1/+1
This is a patch to the p80211conv.c file that fixed up a TAB and spaces Errors found by the checkpatch.pl tools, like spaces required around that '&' (ctx:VxV) Signed-off-by: Ruslan Pisarev <ruslan@rpisarev.org.ua> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04Staging: Merge two branches of coding style fixes togetherGreg Kroah-Hartman1-8/+7
Turns out that multiple people sent pretty much the same patch for the same staging drivers. Commit these in two different branches and merge them together to get a more complete coverage of the cleanup and properly credit everyone for the work that they did. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04Staging: wlan-ng: More checkpatch.pl error cleanupsAndrew Elwell1-7/+7
Signed-off-by: Andrew Elwell <Andrew.Elwell@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-04Staging: wlan-ng: multiple safe style cleanupsSvenne Krap1-11/+12
Cleanups as suggested by checkpatch.pl utiltiy. .o's from before and after cleanup have matching SHA1s. Signed-off-by: Svenne Krap <svenne@krap.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-09-15staging: wlan-ng: scripts/checkpatch.pl error fixes.Mithlesh Thukral1-6/+6
scripts/checkpatch.pl error fixes. This is a TODO item. This patch fixes most of the errors reported by checkpatch.pl in wlan-ng directory of staging tree. Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19Staging: wlan-ng: Lindent cleanupsMithlesh Thukral1-11/+10
Lindent script cleanups in wlan-ng driver in the staging tree. This is a item in the TODO list. Signed-off-by: Mithlesh Thukral <mithlesh@linsyssoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19Staging: wlan-ng: Change KERN_DEBUG or pr_debug to match orig driverKarl Relton1-1/+1
Change uses of KERN_DEBUG over to pr_debug to match original driver where messages are only needed during driver development. Signed-off-by: Karl Relton <karllinuxtest.relton@ntlworld.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Remove the now empty wlan_compat.hMoritz Muehlenhoff1-2/+0
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: p80211conv.c: Coding style cleanupsMoritz Muehlenhoff1-141/+141
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Replace WLAN_LOG_DEBUG() with printk(KERN_DEBUGMoritz Muehlenhoff1-12/+12
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Remove dead/unused code from p80211conv.cMoritz Muehlenhoff1-19/+0
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Replace WLAN_LOG_WARNING() with printk()Moritz Muehlenhoff1-1/+1
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Replace WLAN_LOG_ERROR() with printk()Moritz Muehlenhoff1-10/+10
Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Use generic byteorder macrosMoritz Muehlenhoff1-6/+7
This patch removes the ieee2host16(), ieee2host32(), host2ieee16() and host2ieee32() macros and replaces them with the generic ones. Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Remove DBFENTER/DBFEXIT macrosMoritz Muehlenhoff1-12/+1
Remove the ugly DBFENTER/DBFEXIT macros, which are only inserted to add "<---" and "--->" at the function start/end at higher debug levels and which make the code a lot less readable. Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-04Staging: wlan-ng: Remove use of WLAN_ADDR_LENMoritz Muehlenhoff1-9/+9
Replace the driver local WLAN_ADDR_LEN constant through the kernel-wide ETH_ALEN definiton. Signed-off-by: Moritz Muehlenhoff <jmm@debian.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07Staging: wlan-ng: skb_p80211_to_ether() - payload_length is unsigned, check ↵Roel Kluin1-2/+2
before subtraction payload_length is unsigned, check before subtraction Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
2009-01-07Staging: wlan-ng: remove unused #include <version.h>Huang Weiyi1-1/+0
The file(s) below do not use LINUX_VERSION_CODE nor KERNEL_VERSION. drivers/staging/wlan-ng/p80211conv.c drivers/staging/wlan-ng/p80211req.c drivers/staging/wlan-ng/p80211wext.c drivers/staging/wlan-ng/prism2mgmt.c This patch removes the said #include <version.h>. Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07Staging: wlan-ng: p80211conv.c copy code from wlan-ng-devel branch to not ↵Richard Kennedy1-1/+48
drop packets allow card to correctly receive network packets, without this change all incoming packets are dropped. code copied from the latest wlan-ng-devel tree. Signed-off-by: Richard Kennedy <richard@rsk.demon.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-07Staging: wlan-ng: Consolidate wlan-ng into a single module.Solomon Peachy1-3/+0
There's no point in having a separate 'p80211' module, as nobody else is ever going to use it. Push everyting into a single module, and get rid of all exports. Signed-off-by: Solomon Peachy <pizza@shaftnet.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>