summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ozwpan/ozhcd.c
Commit message (Collapse)AuthorAgeFilesLines
* usb: hcd: move controller wakeup setting initialization to individual driverPeter Chen2013-12-081-0/+2
| | | | | | | | | | | | | | | Individual controller driver has different requirement for wakeup setting, so move it from core to itself. In order to align with current etting the default wakeup setting is enabled (except for chipidea host). Pass compile test with below commands: make O=outout/all allmodconfig make -j$CPU_NUM O=outout/all drivers/usb Signed-off-by: Peter Chen <peter.chen@freescale.com> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Increase ISOC IN buffer depthRupesh Gujare2013-08-281-1/+1
| | | | | | | | Buffer depth of 50 units is not sufficient when there is considerable delay occuring on air due to interference, increase ISOC IN buffer depth to 100 units. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Reset PORT_ENABLE bit.Rupesh Gujare2013-08-271-1/+1
| | | | | | | Reset PORT_ENABLE bit of port status on loosing PD. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Add debounce time before unregistering.Rupesh Gujare2013-08-271-0/+5
| | | | | | | | | | | | | | | Fixes following error caused during unloading driver. [ 1127.542888] usb 5-1: USB disconnect, device number 2 [ 1127.542909] ozwpan ozwpan: remove, state 1 [ 1127.542933] usb usb5: USB disconnect, device number 1 [ 1127.618634] hub 5-0:1.0: hub_port_status failed (err = -19) [ 1127.618647] hub_port_connect_change: 45 callbacks suppressed [ 1127.618657] hub 5-0:1.0: connect-debounce failed, port 1 disabled [ 1127.618668] hub 5-0:1.0: cannot disable port 1 (err = -19) Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: change variable type.Rupesh Gujare2013-08-261-2/+2
| | | | | | | | We have icreased interrupt end point buffer size to 512 bytes, Change variable data type to accomodate it. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Increase interrupt end point buffer sizeRupesh Gujare2013-08-261-1/+2
| | | | | | | | Increase interrupt end point buffer size & convert hard coded value to macro for better readability. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Convert hard coded value to MacroRupesh Gujare2013-08-261-1/+2
| | | | | | | Use macro instead of hard coded value for readability. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Check for correct config number.Rupesh Gujare2013-08-261-1/+1
| | | | | | | Check for valid config number before completing set interface. 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-68/+66
| | | | | | | 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: Check error condition before creating endpoint.Rupesh Gujare2013-08-221-0/+2
| | | | | | | Check if interface number is correct before creating an end point. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Fix crash for race condition.Rupesh Gujare2013-08-221-2/+3
| | | | | | | | | Do not allocate a port to new device or process URB when its status is yet to be read. This avoids race condition when USB core read hub status a bit late, while new device tries to acquire port. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Remove extra variable.Rupesh Gujare2013-08-151-2/+1
| | | | | | | | We should not use extra variable just to copy pointer value, renaming parameter name serves pupose & removes extra variable. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Remove unneeded variable initializerRupesh Gujare2013-08-151-1/+1
| | | | | | | | We are assigning value to hport before returning, there is no need to initialize it. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Separate success & failure case for oz_hcd_pd_arrived()Dan Carpenter2013-08-141-27/+27
| | | | | | | | | | | | | | | | | | | | | This patch separates success & failure block along with fixing following issues:- 1. The way oz_hcd_pd_arrived() looks now it's easy to think we free "ep" but actually we do this spaghetti thing of setting it to NULL on success. 2. It is hard to read it because there are unlocks scattered throughout. 3. Currently we set "ep" to NULL on the success path and then test it and or free it. In current code you have to scroll to the start of the function to read code. Original patch was submitted by Dan here :- http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2013-August/040113.html Signed-off-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: Swap arguments of oz_ep_alloc() to match kmalloc()Rupesh Gujare2013-08-141-3/+3
| | | | | | | | Swap arguments of oz_ep_alloc() to match kmalloc() for better 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: Remove unneeded initializersRupesh Gujare2013-08-141-9/+9
| | | | | | | | 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>
* staging: ozwpan: Make oz_hcd_pd_departed() take a struct pointer.Rupesh Gujare2013-08-141-2/+2
| | | | | | | | | | oz_hcd_pd_departed() takes struct oz_port pointer instead of void *, change function declaration to avoid ambiguity. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 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: Make oz_hcd_pd_arrived() return a struct pointerRupesh Gujare2013-08-141-2/+2
| | | | | | | | | | oz_hcd_pd_arrived returns struct oz_port *, change function declaration to avoid ambiguity. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 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: Remove unnecessary pointer check.Rupesh Gujare2013-08-141-1/+1
| | | | | | | | | | We are already checking "ep" earlier in function. Do not need to check again. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 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-08-141-2/+2
| | | | | | | | | Put spaces around math operations. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 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: Simply if conditionRupesh Gujare2013-08-141-4/+5
| | | | | | | | | Making code simpler for readability. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> 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 functions & declarations.Rupesh Gujare2013-08-141-0/+68
| | | | | | | | | 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/+28
| | | | | | | | | 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: Return correct hub status.Rupesh Gujare2013-08-121-2/+9
| | | | | | | | Fix a bug where we were not returning correct hub status for 8th port. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Reset port configuration number.Rupesh Gujare2013-08-121-0/+1
| | | | | | | Make sure that we reset port configuration no. when PD departs. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Fixes crash due to invalid port aceess.Rupesh Gujare2013-08-121-2/+7
| | | | | | | | This patch fixes kernel crash issue, when we receive URB request after de-enumerating device. Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: Fix build warning.Rupesh Gujare2013-08-121-2/+2
| | | | | | | | | | | | | This patch fixes following build warning. drivers/built-in.o: In function `oz_hcd_heartbeat': >> (.text+0x30aadd): undefined reference to `__divdi3' drivers/built-in.o: In function `oz_hcd_heartbeat': >> (.text+0x30ac85): undefined reference to `__divdi3' Reported-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Rupesh Gujare <rupesh.gujare@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ozwpan: High resolution timersRupesh Gujare2013-07-311-45/+46
| | | | | | | | | | | | | | | | | | 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>
* staging: ozwpan: Remove old debug macro.Joe Perches2013-07-231-6/+1
| | | | | | | | 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-131/+130
| | | | | | | | | 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-20/+8
| | | | | | | | | | 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-47/+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 access byteorder for wMaxPacketSize in ozhcd.cXenia Ragiadakou2013-05-171-1/+1
| | | | | | | | | | | | | 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>
* staging/ozwpan: Mark read only parameters and structs as constPeter Huewe2013-02-151-4/+5
| | | | | | | | 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: Mark local functions as static (fix sparse warnings)Peter Huewe2013-02-151-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ozhcd.c (sparse warning)Peter Huewe2013-02-151-67/+68
| | | | | | | | | | | 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: Fix following warning.Rupesh Gujare2013-01-291-1/+1
| | | | | | | | | | | The patch ae926051d7eb: "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>
* staging: ozwpan: Remove redundant null check before kfree in ozhcd.cSachin Kamat2012-11-211-2/+1
| | | | | | | | 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>
* staging: ozwpan: use tasklet_kill in device remove/release processXiaotian Feng2012-10-311-2/+2
| | | | | | | | | | | | | | 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>
* staging: ozwpan: use list_move_tail instead of list_del/list_add_tailWei Yongjun2012-09-051-10/+5
| | | | | | | | | | 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>
* staging: ozwpan: Return correct actual_length to userlandRupesh Gujare2012-08-131-6/+8
| | | | | | | | 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>
* staging: ozwpan: Insulate driver from HZ valueRupesh Gujare2012-08-131-4/+4
| | | | | | | | 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>
* staging: ozwpan: buffer frame if urb not available.Rupesh Gujare2012-08-131-4/+63
| | | | | | | | 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>
* staging,ozwpan: Fix typo in comments within staging/ozwpanMasanari Iida2012-04-251-2/+2
| | | | | | | | 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>
* staging:ozwpan:ozhcd.c Fix typos in staging:ozwpanJustin P. Mattock2012-04-101-1/+1
| | | | | | | | 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>
* staging: ozwpan: remove debug allocatorGreg Kroah-Hartman2012-03-021-10/+9
| | | | | | | | | 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 USB HCD implementationChris Kelly2012-02-241-0/+2257
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>
OpenPOWER on IntegriCloud