1
0
Fork 0
Commit Graph

27 Commits (01adc80706f80a583948db6768c5571204cd5f99)

Author SHA1 Message Date
Jérôme Pinot 072dc1146f staging/ozwpan: coding style ether_addr_copy
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-17 14:47:44 -07:00
dingtianhong 93dc5e429b ozwpan: slight optimization of addr compare
Use possibly more efficient ether_addr_equal
instead of memcmp.

Cc: Rupesh Gujare <rupesh.gujare@atmel.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: devel@driverdev.osuosl.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Tan Xiaojun <tanxiaojun@huawei.com>
Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-12-26 13:31:34 -05:00
Dan Carpenter c2c65cd2e1 staging: ozwpan: prevent overflow in oz_cdev_write()
We need to check "count" so we don't overflow the ei->data buffer.

Reported-by: Nico Golde <nico@ngolde.de>
Reported-by: Fabian Yamaguchi <fabs@goesec.de>
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: stable@kernel.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2013-10-30 12:24:49 -07:00
Rupesh Gujare 8503f9016f staging: ozwpan: Return error, if PD is not connected.
Return error if we receive write(), while PD is not connected.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-28 15:18:40 -07:00
Rupesh Gujare b93d85f007 staging: ozwpan: Change error number.
Incorrect error number was returned here (EPERM), ENXIO is more
appropriate.

Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-28 15:18:40 -07:00
Rupesh Gujare 4e7fb82977 staging: ozwpan: Fix Documentation style.
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-23 10:12:32 -07:00
Rupesh Gujare 6e244a8319 staging: ozwpan: Add a blank line between functions & declarations.
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-14 14:13:43 -07:00
Rupesh Gujare 18f8191e1f staging: ozwpan: Add a blank line between declaraction and code.
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-14 14:13:43 -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 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
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 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
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
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 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 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 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
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
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