summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ozwpan/ozcdev.c
Commit message (Collapse)AuthorAgeFilesLines
* staging: ozwpan: fix missing blank line after declarationAdrian Nicoara2014-09-081-0/+5
| | | | | | | Cleanup checkpatch.pl warnings. Signed-off-by: Adrian Nicoara <anicoara@uwaterloo.ca> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Simplify app interfaceChristoph Jaeger2014-08-161-15/+15
| | | | | | | | | | | 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>
* staging: ozwpan: Remove redundant initializationChristoph Jaeger2014-08-161-1/+0
| | | | | | | Member 'ops' has already been initialized by calling cdev_init(). Signed-off-by: Christoph Jaeger <email@christophjaeger.info> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging/ozwpan: coding style ether_addr_copyJérôme Pinot2014-03-171-2/+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>
* ozwpan: slight optimization of addr comparedingtianhong2013-12-261-1/+1
| | | | | | | | | | | | | 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>
* staging: ozwpan: prevent overflow in oz_cdev_write()Dan Carpenter2013-10-301-0/+3
| | | | | | | | | | 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>
* staging: ozwpan: Return error, if PD is not connected.Rupesh Gujare2013-08-281-0/+2
| | | | | | | 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>
* staging: ozwpan: Change error number.Rupesh Gujare2013-08-281-1/+1
| | | | | | | | 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>
* staging: ozwpan: Fix Documentation style.Rupesh Gujare2013-08-231-21/+19
| | | | | | | This patch fixes Kernel Documentation style. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Add a blank line between functions & declarations.Rupesh Gujare2013-08-141-0/+17
| | | | | | | | | 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>
* staging: ozwpan: Add a blank line between declaraction and code.Rupesh Gujare2013-08-141-0/+6
| | | | | | | | | 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>
* staging: ozwpan: Fix coding style.Rupesh Gujare2013-07-251-7/+8
| | | | | | | | | 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>
* staging: ozwpan: Remove old debug macro.Joe Perches2013-07-231-2/+0
| | | | | | | | 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>
* staging: ozwpan: Replace oz_trace with oz_dbgJoe Perches2013-07-231-23/+25
| | | | | | | | | 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>
* staging: ozwpan: Remove extra debug logs.Joe Perches2013-07-231-2/+0
| | | | | | | | | | 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>
* staging: ozwpan: remove event tracing code.Rupesh Gujare2013-06-171-5/+0
| | | | | | | | 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>
* staging: ozwpan: fix error return code in oz_cdev_register()Wei Yongjun2013-05-131-0/+2
| | | | | | | | 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>
* staging/ozwpan: info leak in oz_cdev_ioctl()Dan Carpenter2013-04-221-0/+1
| | | | | | | | | 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>
* staging/ozwpan: Mark read only parameters and structs as constPeter Huewe2013-02-151-1/+1
| | | | | | | | 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>
* staging/ozwpan: Remove empty and unused function oz_cdev_heartbeatPeter Huewe2013-02-151-6/+0
| | | | | | | 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>
* staging/ozwpan: Mark local functions as static (fix sparse warnings)Peter Huewe2013-02-151-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging/ozwpan: Add missing header includesPeter Huewe2013-02-151-0/+1
| | | | | | | | 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>
* staging/ozwpan: Fix NULL vs zero in ozcdev.c (sparse warning)Peter Huewe2013-02-151-12/+12
| | | | | | | | | | | 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>
* staging: ozwpan: compare pointer to NULL rather than 0Fengguang Wu2012-09-191-7/+7
| | | | | | | 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>
* staging: ozwpan: fix memcmp() test in oz_set_active_pd()Tomas Winkler2012-09-041-1/+2
| | | | | | | | | | | | | "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>
* staging: ozwpan: Unregister with sysfs while unloading.Rupesh Gujare2012-06-261-4/+8
| | | | | | | | 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>
* staging: ozwpan: udev supportRupesh Gujare2012-06-201-1/+23
| | | | | | | | 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>
* staging: ozwpan: Replace existing event logging mechanismRupesh Gujare2012-04-101-17/+0
| | | | | | | | | | | 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>
* staging: ozwpan: remove debug allocatorGreg Kroah-Hartman2012-03-021-7/+4
| | | | | | | | | 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>
* staging: ozwpan: Added character device supportChris Kelly2012-02-241-0/+524
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>
OpenPOWER on IntegriCloud