Commit graph

135 commits

Author SHA1 Message Date
Rupesh Gujare 83e4817fc3 staging: ozwpan: Mark string as const
Make sure that we mark const string so that it does not get modified.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02 11:56:55 +08:00
Rupesh Gujare 8a3cac62ef staging: ozwpan: Use kernel list function for managing interface list.
Managing interface list, is easier if we use kernel list_* API
than managing it on our own.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-02 11:56:55 +08:00
Rupesh Gujare 8fd0700774 staging: ozwpan: High resolution timers
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-31 17:48:21 -07:00
Rupesh Gujare 8079154a1d staging: ozwpan: Fix coding style.
This patch fixes coding style issues reported by Dan here:-
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2012-June/027767.html

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-25 13:40:53 -07:00
Joe Perches ba628ad0ba staging: ozwpan: Rename Kbuild to Makefile
Rename Kbuild to usual Makefile, consistent with
Kernel build structure.

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-23 14:34:53 -07:00
Joe Perches 155c71435c staging: ozwpan: Convert macro to function.
Replace macro with inline function.

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-23 14:34:53 -07:00
Joe Perches 05f608f237 staging: ozwpan: Remove old debug macro.
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-23 14:34:53 -07:00
Joe Perches f724b58434 staging: ozwpan: Replace oz_trace with oz_dbg
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-07-23 14:34:52 -07:00
Joe Perches 30f1e5a9ab staging: ozwpan: Remove extra debug logs.
Remove unnecessary debug logs. Most of these logs
print function name at the start of function, which
are not really required.

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-23 14:34:52 -07:00
Rupesh Gujare 255ece7c4d staging: ozwpan: remove event tracing code.
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-17 14:48:12 -07:00
Greg Kroah-Hartman ec0ee957f6 Revert "ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c"
This reverts commit 812eb995d4.

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-04 16:03:22 -07:00
Greg Kroah-Hartman 6b790d0fae Revert "ozwpan: replace alloc_skb with dev_alloc_skb in ozproto.c"
This reverts commit c314796538.

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-04 16:02:46 -07:00
Greg Kroah-Hartman dd3cef0f07 Revert "ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.c"
This reverts commit 91c6c4bdb2.

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-06-04 16:02:03 -07:00
Greg Kroah-Hartman e79f864d59 Revert "ozwpan: replace kfree_skb with dev_kfree_skb in ozproto.c"
This reverts commit 5109c8a0c1.

I shouldn't have applied this, my fault...

Cc: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-06-04 16:01:33 -07:00
Xenia Ragiadakou 5109c8a0c1 ozwpan: replace kfree_skb with dev_kfree_skb in ozproto.c
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-30 21:04:39 +09:00
Xenia Ragiadakou 91c6c4bdb2 ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.c
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-30 21:04:39 +09:00
Xenia Ragiadakou c314796538 ozwpan: replace alloc_skb with dev_alloc_skb in ozproto.c
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-30 21:04:38 +09:00
Xenia Ragiadakou 812eb995d4 ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c
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-30 21:04:37 +09:00
Xenia Ragiadakou 42b4212baa staging: ozwpan: Revert last changes
This patch reverts the changes made by the following patches:

commit id: edea341b04
[PATCH 1/4] ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c

commit id: b59983f525
[PATCH 2/4] ozwpan: replace alloc_skb with dev_alloc_skb in ozproto.c

commit id: 4422a6c14d
[PATCH 3/4] ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.c

commit id: e241a8b616
[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-24 15:25:53 -07:00
Xenia Ragiadakou 4422a6c14d ozwpan: replace kfree_skb with dev_kfree_skb in ozproto.c
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-21 10:54:45 -07:00
Xenia Ragiadakou e241a8b616 ozwpan: replace kfree_skb with dev_kfree_skb in ozpd.c
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-21 10:54:45 -07:00
Xenia Ragiadakou edea341b04 ozwpan: replace alloc_skb with dev_alloc_skb in ozproto.c
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-21 10:54:45 -07:00
Xenia Ragiadakou b59983f525 ozwpan: replace alloc_skb with dev_alloc_skb in ozpd.c
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-21 10:54:45 -07:00
Xenia Ragiadakou cb560c401b staging: ozwpan: fix access byteorder for wMaxPacketSize in ozhcd.c
This patch fixes the access byteorder of wMaxPacketSize
which is __le16, following the USB standard, and needs to
be converted into native cpu byteorder in order to be accessed.

Instead of using le16_to_cpu(hep->desc.wMaxPacketSize),
it was used the usb_endpoint_maxp() function, defined in
<uapi/linux/usb/ch9.h>

Signed-off-by: Xenia Ragiadakou <burzalodowa@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-17 11:51:17 -07:00
Wei Yongjun b491564eb2 staging: ozwpan: fix error return code in oz_cdev_register()
Fix to return a negative error code from the error handling
case instead of 0, as done elsewhere in this function.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-05-13 18:02:29 -04:00
Dan Carpenter 2516ffac94 staging/ozwpan: info leak in oz_cdev_ioctl()
If we're not maxed out then oz_get_pd_list() leaves part of the "list"
struct uninitialized.  We should clear this so that no stack information
is leaked to userspace.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-22 10:25:46 -07:00
Peter Huewe dc7f5b3594 staging/ozwpan: Mark read only parameters and structs as const
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-15 15:14:30 -08:00
Peter Huewe 89fe22b6ac staging/ozwpan: Remove empty and unused function oz_cdev_heartbeat
oz_cdev_heartbeat is empty and unused -> safe to remove.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 15:14:30 -08:00
Peter Huewe a7f74c3005 staging/ozwpan: Mark local functions as static (fix sparse warnings)
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-15 15:14:30 -08:00
Peter Huewe 4f9d5b2f9a staging/ozwpan: Add missing header includes
ozcdev.c and ozhcd.c should include their own header file, so sparse
knows which functions are declared and which not.

Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 15:14:30 -08:00
Peter Huewe 7be7d6def3 staging/ozwpan: Fix NULL vs zero in ozhcd.c (sparse warning)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe ba346a4367 staging/ozwpan: Fix NULL vs zero in ozusbsvc.c (sparse warning)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe bc501c551c staging/ozwpan: Fix NULL vs zero in ozcdev.c (sparse warning)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe 41ebb8a1c5 staging/ozwpan: Fix NULL vs zero in ozproto.c (sparse warning)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:25:11 -08:00
Peter Huewe 953b19013a staging/ozwpan: Fix NULL vs zero in ozeltbuf.c (sparse warning)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:23:50 -08:00
Peter Huewe 4d1b2fbbaf staging/ozwpan: Fix NULL vs zero in ozusbsvc1.c (sparse warning)
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-02-15 10:23:50 -08:00
Peter Huewe 86b02be043 staging/ozwpan: Fix NULL vs zero in ozpd.c (sparse warning)
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>
2013-02-15 10:23:49 -08:00
Rupesh Gujare b360cb9726 staging:ozwpan: Fix following warning.
The patch ae926051d7: "staging: ozwpan: Added USB HCD
implementation" from Feb 20, 2012, leads to the following warning:
drivers/staging/ozwpan/ozhcd.c:1094 oz_hcd_heartbeat()
	 warn: what is this condition about? 'ep->buffered_units * 50'

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-29 23:25:10 -05:00
Rupesh Gujare c4048c641a staging:ozwpan: Change email address.
As part of transition caused due to acquisition of Ozmo Devices by Atmel,
my email address is changed.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25 11:23:07 -08:00
Chris Kelly 8edca3fe9e staging:ozwpan: Removed myself (Chris Kelly) as maintainer.
Removed myself (ckelly@ozmodevices.com) as maintainer of ozwpan.
Removed my email address from the TODO file.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-25 11:23:05 -08:00
Sachin Kamat 7010157b08 staging: ozwpan: Remove redundant null check before kfree in ozhcd.c
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-11-21 13:50:12 -08:00
Sachin Kamat ba34efba7a staging: ozwpan: Remove redundant null check before kfree in ozproto.c
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-11-21 13:50:12 -08:00
Sachin Kamat b150718ecb staging: ozwpan: Remove redundant null check before kfree in ozpd.c
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-11-21 13:50:12 -08:00
Sachin Kamat 43f971ebca staging: ozwpan: Include oz_events_clear() conditionally
oz_events_clear() is referenced only when CONFIG_DEBUG_FS is defined.
Move the definition too under this flag.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 13:50:11 -08:00
Xiaotian Feng 984a4a0378 staging: ozwpan: use tasklet_kill in device remove/release process
Some driver uses tasklet_disable in device remove/release process,
tasklet_disable will inc tasklet->count and return. If the tasklet
is not handled yet under some softirq pressure, the tasklet will be
placed on the tasklet_vec, never have a chance to be excuted. This might
lead to a heavy loaded ksoftirqd, wakeup with pending_softirq, but
tasklet is disabled. tasklet_kill should be used in this case.

Signed-off-by: Xiaotian Feng <dannyfeng@tencent.com>
Cc: Rupesh Gujare <rgujare@ozmodevices.com>
Cc: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-31 15:14:41 -07:00
Fengguang Wu 3d9562a6ed staging: ozwpan: compare pointer to NULL rather than 0
Generated by: scripts/coccinelle/null/badzero.cocci

Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-19 09:28:14 +01:00
Greg Kroah-Hartman 6a2a2cdd57 Merge 3.6-rc6 into staging-next
This pulls in the staging tree fixes in 3.6-rc6 into our branch to resolve the
merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-16 17:17:25 -07:00
Wei Yongjun 094e74c204 staging: ozwpan: use list_move_tail instead of list_del/list_add_tail
Using list_move_tail() instead of list_del() + list_add_tail().

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05 11:58:24 -07:00
Wei Yongjun 0c925aa043 staging: ozwpan: remove pointless conditional before kfree_skb()
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-09-04 13:12:13 -07:00
Masanari Iida ba07275faf staging: ozwpan: Fix typo in staging/ozwpan
Fix spelling typo in staging/ozwpan

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 13:12:13 -07:00
Tomas Winkler 07732be2ef staging: ozwpan: fix memcmp() test in oz_set_active_pd()
"addr" is a pointer so it's either 4 or 8 bytes, but actually we want
to compare 6 bytes (ETH_ALEN).

As network stack already provides helper function
is_zero_ether_addr() we use that instead of memcmp

Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Acked-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 12:48:00 -07:00
Rupesh Gujare 3c1669d8a7 staging: ozwpan: Bump version number
Bump version numbers to keep in sync with internal
version information.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:17:17 -07:00
Rupesh Gujare 86d03a0f4f staging: ozwpan: isoc latency for audio burst
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-08-13 19:17:17 -07:00
Rupesh Gujare 5494ebdf3c staging: ozwpan: Return correct actual_length to userland
This fixes issue where wrong retrun value was received
by userland application after writing data to raw hid device.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:17:17 -07:00
Rupesh Gujare 24168911be staging: ozwpan: Insulate driver from HZ value
This patch fixes issue caused due to different HZ
value on system which do not have HZ=1000

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:17:17 -07:00
Rupesh Gujare 28a7229588 staging: ozwpan: buffer frame if urb not available.
For interrupt end point buffer frames, if urb is not available
& give back as soon as urb is received from usb core.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-13 19:17:17 -07:00
Rupesh Gujare 4b29a3058c staging: ozwpan: Update TODO file
Update TODO file.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 15:07:56 -07:00
Rupesh Gujare ba0a7ae713 staging: ozwpan: Unregister with sysfs while unloading.
Destroy device node & unregister device class from sysfs while unloading
driver

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-26 15:07:56 -07:00
Rupesh Gujare 86c948b441 staging: ozwpan: Set AC_VO priority
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-20 16:05:35 -07:00
Rupesh Gujare 6261c1ee6c staging: ozwpan: udev support
Register ozmo_wpan class with sysfs & support for udev
to create device node.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 16:05:35 -07:00
Rupesh Gujare 00ec12b827 staging: ozwpan: set last_pkt_nb
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-20 16:05:35 -07:00
Rupesh Gujare fec9f24b62 staging: ozwpan: kmalloc flag
Pass right flag as memory is assigned in process
 context.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 16:05:35 -07:00
Rupesh Gujare df49093ae4 staging: ozwpan: Correct ioctl numbers.
ioctl numbers were not in order, rearranging them in ascending order.

Signed-off-by: Rupesh Gujare <rgujare@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-20 16:05:35 -07:00
Rupesh Gujare 33e6ada17f staging: ozwpan: ISOC transfer in triggered mode
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-06-20 16:05:34 -07:00
Greg Kroah-Hartman d210267741 Merge 3.4-rc5 into staging-next
This resolves the conflict in:
	drivers/staging/vt6656/ioctl.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-02 11:48:07 -07:00
Rupesh Gujare 89f21cc050 staging: ozwpan: Fix bug where kfree is called twice.
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-04-26 12:40:53 -07:00
Rupesh Gujare 8176df8e95 staging: ozwpan: Fix bug where kfree is called twice.
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-04-25 17:30:42 -07:00
Masanari Iida 8dc245970a staging,ozwpan: Fix typo in comments within staging/ozwpan
Correct spelling in comments withon staging/ozwpan

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Acked-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 10:59:16 -07:00
Rupesh Gujare 68a75f3f1a staging: ozwpan: Replace existing event logging mechanism
This patch replaces existing event logging mechanism from ioctl to debugfs.
This patch replaces previous patch submitted by Chris Kelly. Previous patch can
be found at :-
http://article.gmane.org/gmane.linux.usb.general/60026/

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-04-10 09:40:52 -07:00
Justin P. Mattock 595914fea3 staging:ozwpan:ozhcd.c Fix typos in staging:ozwpan
The below patch fixes a typo that I found while reading.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Acked-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:29:21 -07:00
Chris Kelly 678b7c1707 staging: ozwpan: Added new maintainer for ozwpan
Added Rupesh Gujare to MAINTAINERS file and contact in TODO file
for ozwpan driver.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:18:59 -07:00
Randy Dunlap 9948bc7e1d staging: ozwpan depends on NET
Fix build errors:  add depends on NET.

ERROR: "skb_clone" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "dev_get_by_name" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "dev_remove_pack" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "init_net" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "__alloc_skb" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "kfree_skb" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "dev_add_pack" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "consume_skb" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "dev_queue_xmit" [drivers/staging/ozwpan/ozwpan.ko] undefined!
ERROR: "skb_put" [drivers/staging/ozwpan/ozwpan.ko] undefined!

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Acked-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-14 12:14:26 -07:00
Greg Kroah-Hartman 1ec41a31fb staging: ozwpan: remove debug allocator
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-02 16:51:09 -08:00
Dan Carpenter 92a6253299 Staging: ozwpan: prevent bogus dereference
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-03-02 16:32:21 -08:00
Chris Kelly f2e332662b staging: ozwpan: added TODO file.
Added TODO file for ozwpan driver.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-02 16:32:21 -08:00
Chris Kelly 0339d3dbbf staging: ozwpan: Reduced size of oz_evtlist structure.
This structure is used in an ioctl definition and was causing the
64-bit PowerPC build to fail. The size of the array in the structure
has been reduced to fix this.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-29 15:23:37 -08:00
Chris Kelly b0406db5b3 staging: ozwpan: Plumbed in Kconfig and Kbuild
Added Kconfig and Kbuild files for ozwpan USB over WiFi driver.
Modified parent Makefile and Kconfig to include them.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:29:24 -08:00
Chris Kelly 066b222941 staging: ozwpan: Added debug support
Added tracing facilities and also memory allocation and URB tracking.
This is for debugging purposes and is all optional and can be switched
out at compile time.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:26:52 -08:00
Chris Kelly 56ff32fe1c staging: ozwpan: Added event logging support
The event logging subsystem allows internal events in the driver to
be logged. This facilitates testing the correct operation of the
driver. This subsystem is optional and can be switched out at
compile time.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:26:52 -08:00
Chris Kelly 23af8c2a08 staging: ozwpan: Added character device support
The character device provides a management interface to the driver
and also provides an additional service to the protocol for side
band communication with the device.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:26:51 -08:00
Chris Kelly b3147863b5 staging: ozwpan: Added USB service to protocol
The L2 protocol supports various services, one of which is USB.
This provides the implementation of that service and plumbs it to
the virtual USB HCD.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:26:51 -08:00
Chris Kelly ae926051d7 staging: ozwpan: Added USB HCD implementation
Added the implementation of the virtual USB HCD that is used to
present devices connected via the network to the USB subsystem.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:26:51 -08:00
Chris Kelly bc3157dde3 staging: ozwpan: Added device state support
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>
2012-02-24 09:26:51 -08:00
Chris Kelly 1619cb6f2d staging: ozwpan: Added basic L2 protocol support
Added the basic implementation of the L2 protocol support used to
communicate with devices over the network.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:26:50 -08:00
Chris Kelly 62450bca86 staging: ozwpan: Added driver entry code
This series of patches adds the Ozmo USB over WiFi driver to the
driver staging directory. This is a driver for a virtual USB HCD
and uses an L2 network protocol to talk to the device.
This patch adds the driver entry code and a README file with more
details.

Signed-off-by: Chris Kelly <ckelly@ozmodevices.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-24 09:26:50 -08:00