aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ozwpan/ozpd.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-08-10staging: ozwpan: Remove from treeJason A. Donenfeld1-886/+0
Ozwpan is completely unmaintained and potentially a security problem. As this is a staging driver, it should be removed, since it has been abandoned. Cc: Shigekatsu Tateno <shigekatsu.tateno@atmel.com> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: ozwpan: Move code from success handling to error handlingQuentin Lambert1-26/+27
The original version was success handling rather than error handling, therefore this patch reduces nesting. Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-06staging: ozwpan: Remove allocation from delaration lineQuentin Lambert1-3/+5
This patch removes allocation from declaration line because people are known to gloss over declarations. Signed-off-by: Quentin Lambert <lambert.quentin@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08staging: ozwpan: fix redundant else after break or returnAdrian Nicoara1-6/+4
Cleanup checkpatch.pl warnings. Signed-off-by: Adrian Nicoara <anicoara@uwaterloo.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-09-08staging: ozwpan: fix missing blank line after declarationAdrian Nicoara1-0/+6
Cleanup checkpatch.pl warnings. Signed-off-by: Adrian Nicoara <anicoara@uwaterloo.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: ozwpan: Use list helpersChristoph Jaeger1-72/+34
Make use of the various list helper functions to improve readability. Signed-off-by: Christoph Jaeger <email@christophjaeger.info> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: ozwpan: Use slab cache for oz_tx_frame allocationChristoph Jaeger1-35/+6
Use a slab cache rather than rolling our own free list. Signed-off-by: Christoph Jaeger <email@christophjaeger.info> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: ozwpan: Use slab cache for oz_elt_info allocationChristoph Jaeger1-2/+0
Use a slab cache rather than rolling our own free list. Signed-off-by: Christoph Jaeger <email@christophjaeger.info> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: ozwpan: Simplify app interfaceChristoph Jaeger1-108/+43
Simplify the somewhat overcomplicated application interface; improves readability and saves a bunch of lines. Use designated struct initializers for clarity. Signed-off-by: Christoph Jaeger <email@christophjaeger.info> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-08-16staging: ozwpan: Remove dead codeChristoph Jaeger1-4/+1
No need to return a value from elt_buf_init(). Signed-off-by: Christoph Jaeger <email@christophjaeger.info> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-17staging/ozwpan: coding style ether_addr_copyJérôme Pinot1-1/+2
This fixes the following issues detected by checkpatch.pl: WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) #220: FILE: drivers/staging/ozwpan/ozcdev.c:220: + memcpy(g_cdev.active_addr, addr, ETH_ALEN); WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) #286: FILE: drivers/staging/ozwpan/ozcdev.c:286: + memcpy(addr, g_cdev.active_addr, ETH_ALEN); WARNING: Prefer ether_addr_copy() over memcpy() if the Ethernet addresses are __aligned(2) #176: FILE: drivers/staging/ozwpan/ozpd.c:176: + memcpy(pd->mac_addr, mac_addr, ETH_ALEN); Signed-off-by: Jerome Pinot <ngc891@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-03-04drivers:staging:ozwpan Replaced wrapper functions with actual spin lock functionSurendra Patil1-14/+14
* Replaced all the spin lock/unlock wrappers from oz_polling_lock_bh() and oz_polllin_unlock_bh() with spin_lock_bh(&g_polling_lock) and spin_unlock_bh(&g_polling_lock).Completely erased the wrappers defination and declaration. * declared g_polling_lock as global variable in header file and added comments to it. Module builded successfully with sparse without warnings. Signed-off-by: Surendra Patil <surendra.tux@gmail.com> Acked-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-17staging: delete non-required instances of include <linux/init.h>Paul Gortmaker1-1/+0
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-08-27staging: ozwpan: oz_pd_free() can be staticFengguang Wu1-1/+1
Cc: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-26staging: ozwpan: Fix error checking while transmitting frame.Rupesh Gujare1-4/+4
Make sure that we return negative value if oz_build_frame() returns NULL. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: ozwpan: Fix Documentation style.Rupesh Gujare1-43/+39
This patch fixes Kernel Documentation style. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: ozwpan: Fix wrong error check.Rupesh Gujare1-5/+1
schedule_work() returns true if succeeded & false on failure, error check was doing exactly reverse. Also removes extra variable. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-23staging: ozwpan: Remove memsetRupesh Gujare1-1/+0
As we are initialising structure, we do not require memset(). Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-22staging: ozwpan: Create deferred work to destroy PD object.Rupesh Gujare1-5/+23
Currently we call oz_pd_destroy() from softirq context, where we try to destroy relevant data structures, as well we kill a tasklet which always result in following kernel warning. [12279.262194] Attempt to kill tasklet from interrupt [12279.262202] Attempt to kill tasklet from interrupt This patch defers deallocation of data structures to work queue. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14staging: ozwpan: Remove unneeded initializersRupesh Gujare1-2/+2
Remove variable initialization wherever it is not required. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14staging: ozwpan: Add a blank line between functions & declarations.Rupesh Gujare1-0/+40
This patch adds a blank line between global declarations & functions for readability. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-14staging: ozwpan: Add a blank line between declaraction and code.Rupesh Gujare1-0/+22
This patch adds blank line between declaration & code for readability. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02staging: ozwpan: Drop oldest ISOC frame instead of dropping latest.Rupesh Gujare1-1/+12
In case of ISOC transfer, if TX queue is full then we start dropping latest frame, instead we should drop oldest frame & add latest frame to TX queue. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-31staging: ozwpan: High resolution timersRupesh Gujare1-10/+21
Current implementation assumes HZ = 1000 for calculating all internal timer intervals, which creates problem on platforms where HZ != 1000. As well we need resolution of less than 10 mSec for heartbeat calculation, this creates problem on some platforms where HZ is configured as HZ = 100, or around, which restricts us to timer interval of 10 mSec. This is particularly found on embedded devices. This patch moves on to use high resolution timers to calculate all timer intervals as it allows us to have very small resolution of timer interval, removing dependency on HZ. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: ozwpan: Remove old debug macro.Joe Perches1-4/+2
Remove old oz_trace & oz_trace2 macro & related header files. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-23staging: ozwpan: Replace oz_trace with oz_dbgJoe Perches1-31/+30
Introduce new debug macros: oz_dbg, oz_cdev_dbg, oz_pd_dbg and then replace old oz_trace & oz_trace2 with new macro. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-17staging: ozwpan: remove event tracing code.Rupesh Gujare1-20/+3
Removes event tracing code as it can be replaced by in-kernel tracing infrastructure. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04Revert "ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c"Greg Kroah-Hartman1-3/+4
This reverts commit 812eb995d4c0795ea1fb431146523cace2693f49. I shouldn't have applied it, my fault... Cc: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04Revert "ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.c"Greg Kroah-Hartman1-6/+6
This reverts commit 91c6c4bdb241cd27082cfa130675a2cd52cda5a4. It wasn't supposed to be applied, my fault. Cc: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.cXenia Ragiadakou1-6/+6
This patch replaces the calls to kfree_skb with calls to dev_kfree_skb. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-30ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.cXenia Ragiadakou1-4/+3
This patch replaces the calls to alloc_skb with calls to dev_alloc_skb. dev_alloc_skb has GFP_ATOMIC priority so the replacement does not change the code semantics. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-24staging: ozwpan: Revert last changesXenia Ragiadakou1-9/+10
This patch reverts the changes made by the following patches: commit id: edea341b0477ce5d53f7341f8b8cf8c91ad54ecf [PATCH 1/4] ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c commit id: b59983f525396a47cf8b28c13bbd5d5ff57859b8 [PATCH 2/4] ozwpan: replace alloc_skb with dev_alloc_skb in ozproto.c commit id: 4422a6c14d0d0bfe519ec487693f1787f64b0b90 [PATCH 3/4] ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.c commit id: e241a8b61671b487e1a04b455dbd32ab965250ef [PATCH 4/4] ozwpan: replace kfree_skb with dev_kfree_skb in ozproto.c The reason of this revert is that dev_alloc_skb() is not defined to be used in the allocation of socket buffers on the transmit path but on the receive path. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-21ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.cXenia Ragiadakou1-6/+6
This patch replaces the calls to kfree_skb with calls to dev_kfree_skb. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-21ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.cXenia Ragiadakou1-4/+3
This patch replaces the calls to alloc_skb with calls to dev_alloc_skb. dev_alloc_skb has GFP_ATOMIC priority so the replacement does not change the code semantics. Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Mark read only parameters and structs as constPeter Huewe1-8/+8
This patch marks function parameters that are used read only as well as readonly structs (and corresponding pointers) as const. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Mark local functions as static (fix sparse warnings)Peter Huewe1-2/+2
sparse complains about the following functions ozhcd.c:330:20: warning: symbol 'oz_uncancel_urb' was not declared. Should it be static? ozhcd.c:420:6: warning: symbol 'oz_complete_buffered_urb' was not declared. Should it be static? ozmain.c:25:6: warning: symbol 'g_net_dev' was not declared. Should it be static? ozevent.c:95:5: warning: symbol 'oz_events_open' was not declared. Should it be static? ozevent.c:110:5: warning: symbol 'oz_events_release' was not declared. Should it be static? ozevent.c:121:9: warning: symbol 'oz_events_read' was not declared. Should it be static? ozevent.c:160:30: warning: symbol 'oz_events_fops' was not declared. Should it be static? ozcdev.c:47:14: warning: symbol 'g_oz_class' was not declared. Should it be static? ozcdev.c:74:5: warning: symbol 'oz_cdev_open' was not declared. Should it be static? ozcdev.c:86:5: warning: symbol 'oz_cdev_release' was not declared. Should it be static? ozcdev.c:94:9: warning: symbol 'oz_cdev_read' was not declared. Should it be static? ozcdev.c:146:9: warning: symbol 'oz_cdev_write' was not declared. Should it be static? ozcdev.c:236:6: warning: symbol 'oz_cdev_ioctl' was not declared. Should it be static? ozcdev.c:300:14: warning: symbol 'oz_cdev_poll' was not declared. Should it be static? ozcdev.c:321:30: warning: symbol 'oz_fops' was not declared. Should it be static? ozproto.c:958:6: warning: context imbalance in 'oz_polling_lock_bh' - wrong count at exit ozproto.c:964:6: warning: context imbalance in 'oz_polling_unlock_bh' - unexpected unlock ozusbsvc1.c:308:6: warning: symbol 'oz_usb_handle_ep_data' was not declared. Should it be static? ozpd.c:410:6: warning: symbol 'oz_set_more_bit' was not declared. Should it be static? ozpd.c:418:6: warning: symbol 'oz_set_last_pkt_nb' was not declared. Should it be static? -> add static keyword to silence the warning and make sparse happy. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15staging/ozwpan: Fix NULL vs zero in ozpd.c (sparse warning)Peter Huewe1-34/+34
This patch fixes the warning "Using plain integer as NULL pointer", generated by sparse, by replacing the offending 0s with NULL. If the initialization with NULL was unnecessary (due to unconditional assignment before first use) it was removed. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: ozwpan: Remove redundant null check before kfree in ozpd.cSachin Kamat1-4/+2
kfree on NULL pointer is a no-op. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: ozwpan: remove pointless conditional before kfree_skb()Wei Yongjun1-2/+1
Remove pointless conditional before kfree_skb(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13staging: ozwpan: isoc latency for audio burstRupesh Gujare1-7/+1
Set audio latency. This fixes issue where audio clips heard during link outage. Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20staging: ozwpan: Set AC_VO priorityRupesh Gujare1-0/+2
Set packet priority to AC_VO for audio data. Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20staging: ozwpan: set last_pkt_nbRupesh Gujare1-0/+9
In case of trigeered ISOC mode set last_pkt_nb only when we are ready to send data. Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20staging: ozwpan: ISOC transfer in triggered modeRupesh Gujare1-30/+141
This patch implements ISOC frame transfer while PD is in triggered mode. Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-26staging: ozwpan: Fix bug where kfree is called twice.Rupesh Gujare1-2/+0
Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com> Signed-off-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02staging: ozwpan: remove debug allocatorGreg Kroah-Hartman1-16/+13
The kernel already has a debug allocator, no need to have one unique to a single driver. So delete it, replace with kfree, kmalloc, and, in a few places that need it, kzalloc(). Cc: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02Staging: ozwpan: prevent bogus dereferenceDan Carpenter1-1/+1
app_id comes from the network and can't be trusted. If it's zero then it will lead to a kernel crash. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24staging: ozwpan: Added device state supportChris Kelly1-0/+835
Added support for maintaining state and data buffering for devices connected via the network. Signed-off-by: Chris Kelly <ckelly@ozmodevices.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>