summaryrefslogtreecommitdiff
path: root/drivers/usb/wusbcore
AgeCommit message (Collapse)AuthorFilesLines
2014-01-09usb: delete non-required instances of include <linux/init.h>Paul Gortmaker2-2/+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>
2014-01-08USB: wusbcore: fix up coding style issues in wa-nep.cRahul Bedarkar1-4/+6
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08USB: wusbcore: fix up coding style issues in wa-rpipe.cRahul Bedarkar1-3/+3
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08USB: wusbcore: fix up coding style issues in wusbhc.c and wusbhc.hRahul Bedarkar2-8/+14
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08USB: wusbcore: fix up line break coding style issues in mmc.cRahul Bedarkar1-3/+6
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08USB: wusbcore: fix up line break coding style issues in security.cRahul Bedarkar1-7/+11
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08USB: wusbcore: fix up line break coding style issues in wa-hc.hRahul Bedarkar1-4/+4
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08USB: wusbcore: fix up minor coding style issues in cbaf.cRahul Bedarkar1-5/+7
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-01-08USB: wusbcore: correct spelling mistakes in comments and error stringRahul Bedarkar7-12/+12
Signed-off-by: Rahul Bedarkar <rahulbedarkar89@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-21usb: wusbcore: add debug prints to reservation and channel changeThomas Pugliese2-0/+2
This patch adds debug prints to the reservation and channel change sequence to help with debugging channel change problems. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-18usb: wusbcore: add isochronous IN support to HWAThomas Pugliese1-98/+207
This patch adds support for isochronous IN transfers to the HWA driver. The changes include removing the checks that return errors for isoc IN URBs and adding functionality to read the isoc data returned from the HWA. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-16Merge branch 3.13-rc4 into usb-nextGreg Kroah-Hartman5-103/+153
2013-12-10usb: wusbcore: set packet count correctly on isoc transfersThomas Pugliese1-0/+5
This patch correctly sets the dwNumOfPackets field of the HWA transfer request for isochronous transfers with multiple segments. Previously all segments used the value that was set for the first segment which may not be correct. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-10usb: wusbcore: move isoc_frame_index from wa_xfer to wa_segThomas Pugliese1-11/+10
If multiple segments belonging to an isoc transfer are submitted concurrently, the isoc_frame_index field in struct wa_xfer can get corrupted. This patch moves the isoc_frame_index field from struct wa_xfer to struct wa_seg to prevent this from happening. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-10usb: wusbcore: use USB_CTRL_SET_TIMEOUT and USB_CTRL_GET_TIMEOUTThomas Pugliese4-22/+23
Use USB_CTRL_SET_TIMEOUT and USB_CTRL_GET_TIMEOUT for USB control messages instead of an arbitrary 1s timeout value. This is particularly useful for WUSB since in the worst case RF scanario, a WUSB device can be unresponsive for up to 4s and still be connected. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-10usb: wusbcore: fix short transfersThomas Pugliese1-54/+74
If a URB is broken up into multiple transfer segments and a short transfer occurs in any segment other than the last, the URB will currently get stuck in the driver forever. This patch adds a check for a short transfer and cleans up any pending segments so the URB can complete properly. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-09usb: wusbcore: return -ENOENT for unlinked URBs.Thomas Pugliese1-3/+5
Return -ENOENT for unlinked URBs. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-09usb: wusbcore: add more info to debug prints in urb_unlink pathThomas Pugliese1-10/+11
Add more info to debug prints in urb_unlink path Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-09usb: wusbcore: add calls to usb_hcd_link_urb_to_ep, ↵Thomas Pugliese2-3/+25
usb_hcd_unlink_urb_from_ep, and Add calls to usb_hcd_link_urb_to_ep, usb_hcd_unlink_urb_from_ep, and usb_hcd_check_unlink_urb in the appropriate locations. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-03usb: wusbcore: fix deadlock in wusbhc_gtk_rekeyThomas Pugliese3-68/+60
When multiple wireless USB devices are connected and one of the devices disconnects, the host will distribute a new group key to the remaining devicese using wusbhc_gtk_rekey. wusbhc_gtk_rekey takes the wusbhc->mutex and holds it while it submits a URB to set the new key. This causes a deadlock in wa_urb_enqueue when it calls a device lookup helper function that takes the same lock. This patch changes wusbhc_gtk_rekey to submit a work item to set the GTK so that the URB is submitted without holding wusbhc->mutex. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-03usb: wusbcore: do device lookup while holding the hc mutexThomas Pugliese1-18/+25
This patch modifies the device notification handler to not look up the wusb_dev object before it calls the lower-level handler routines since the wusbhc mutex is not held when calling those routines and the device could go away in the meantime. Instead, let the individual notification handlers get the device ptr if they need to after they have taken the mutex. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-12-03usb: wusbcore: send keepalives to unauthenticated devicesThomas Pugliese1-4/+1
This patch modifies the WUSB device disconnect timer code to send keepalives to all connected devices even if they are not authenticated. This fixes a problem where unauthenticated devices that lose their connection before they are authenticated will stay in the device tree forever. More importantly, devices in this situation will never relinquish their port on the root hub so eventually all root ports will be taken up and no other devices can connect. A comment in the existing code states that there are some devices that may not respond to keepalives if they have not been authenticated. That comment is about 5 years old and I don't know of any WUSB devices that act that way. Either way, any buggy devices that may still be around will continue to work as long as they can transition to the authenticated state within the WUSB LOA timeout of 4s, which is not unreasonable to expect. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-30usb: wusbcore: change WA_SEGS_MAX to a legal valueThomas Pugliese1-2/+3
change WA_SEGS_MAX to a number that is legal according to the WUSB spec. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-30usb: wusbcore: add a quirk for Alereon HWA device isoc behaviorThomas Pugliese3-14/+52
Add a quirk for Alereon HWA devices to concatenate the frames of isoc transfer requests. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-30usb: wusbcore: combine multiple isoc frames in a single transfer request.Thomas Pugliese1-111/+255
Combine multiple isoc frames in a single transfer request. This allows the HWA to take advantage of bursting to deliver data to endpoints whose logical service interval is less than the minimum wireless USB service interval of 4ms. Wireless audio quality is much improved after this update. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-30usb: wusbcore: set the RPIPE wMaxPacketSize value correctlyThomas Pugliese1-1/+4
For isochronous endpoints, set the RPIPE wMaxPacketSize value using wOverTheAirPacketSize from the endpoint companion descriptor instead of wMaxPacketSize from the normal endpoint descriptor. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-20USB: wusbcore: fix usb_dev leaksAlexey Khoroshilov1-0/+3
cbaf_probe() does cbaf->usb_dev = usb_get_dev(interface_to_usbdev(iface)), but there is no usb_put_dev() anywhere in cbaf. The patch adds usb_put_dev() to cbaf_disconnect() and to an error path in cbaf_probe(). Also it adds missed usb_put_intf(iface) to the error path. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19usb: wusbcore: preserve endianness of cached descriptorsThomas Pugliese1-1/+1
Do not overwrite the multi-byte fields of usb_wa_descriptor with their cpu format values after reading the descriptor. Leave the values as __le16 and swap on use. This is more consistent with other uses of USB descriptors. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-19usb: wusbcore: serialize access to the HWA data out endpointThomas Pugliese3-21/+152
This patch serializes access to the HWA data transfer out (DTO) endpoint. This prevents a situation where two transfer requests being sent concurrently to separate downstream endpoints could interleave their transfer request and transfer data packets causing data corruption. The transfer processing code will now attempt to acquire the DTO resource before sending a transfer to the HWA. If it cannot acquire the resource, the RPIPE that the transfer is assigned to will be placed on a waiting list. When the DTO resource is released, the actor releasing the resource will serivce the RPIPEs that are waiting. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-12usb: Remove unnecessary semicolonsJoe Perches2-3/+3
These aren't necessary after switch and if blocks. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-07usb: wusbcore: fix string formatting warnings on 64-bit buildsThomas Pugliese1-2/+2
This patch fixes compile warnings on 64-bit builds that were introduced by the recent isoc changes. Reported-by: kbuild test robot <fengguang.wu@intel.com> Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-06usb: wusbcore: add support for isoc out transfersThomas Pugliese2-102/+406
This patch adds support for isochronous out transfers to the HWA. The primary changes are: 1. Add a isoc_pack_desc_urb field to struct wa_seg. This urb is used to send the isochronous packet info message to the HWA which describes the isoc data segment(s) that will be sent as the payload of the transfer request. 2. Use the URB iso_frame_desc field to populate the isochronous packet info message and data segments sent to the HWA. 3. After the data is sent and transfer result is returned from the HWA, read the isoc packet status message from the HWA. The contents of the isoc packet status message are used to set the iso_frame_desc status and actual_length fields in the original isoc URB. This feature required the addition of a some state tracking variables in struct wahc so the dti_urb knows what type of packet it expects to receive next. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-04usb: wusbcore: set the RPIPE bOverTheAirInterval for isoc endpointsThomas Pugliese1-2/+4
This patch sets the RPIPE bOverTheAirInterval field for RPIPES which refer to isochronous endpoints. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-04usb: wusbcore: avoid stack overflow in URB enqueue error pathThomas Pugliese1-13/+38
This patch modifies wa_urb_enqueue to return an error and not call the urb completion routine if it failed to enqueue the urb because the HWA device is gone. This prevents a stack overflow due to infinite submit/complete recursion when unplugging the HWA while connected to a HID device. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-01usb: wusbcore: fix build warning on 64-bit buildsThomas Pugliese1-1/+1
Fix a build warning found by the kbuild test robot in the most recent wusbcore patches. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-01usb: wusbcore: clean up urb dequeue processThomas Pugliese1-35/+87
This patch updates URB dequeue handling in wusbcore to make it more reliable when a URB has been broken up into multiple WUSB transfer request segments. In wa_urb_dequeue, don't mark segments in the WA_SEG_SUBMITTED, WA_SEG_PENDING or WA_SEG_DTI_PENDING states as completed if an ABORT TRANSFER request was sent to the HWA to clean them up. Wait for the HWA to return a transfer result indicating that it has aborted the request before cleaning it up. This prevents the DTI state machine from losing track of transfers and avoids confusion in the case where a read transfer segment is dequeued after the driver has received the transfer result but before the data is received. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-01usb: wusbcore: include the xfer_id in debug printsThomas Pugliese1-45/+49
Include the xfer_id in debug prints for transfers and transfer segments. This makes it much easier to correlate debug logs to USB analyzer logs. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-10-01usb: wusbcore: fix endianess issues when using dwTransferIDThomas Pugliese1-9/+11
Add a new function to get the xfer ID in little endian format (wa_xfer_id_le32), and use it instead of wa_xfer_id where appropriate. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-27usb: wusbcore: set pointers to NULL after freeing in error casesThomas Pugliese1-0/+2
This patch fixes two cases where error handling code was freeing memory but not setting the pointer to NULL. This could lead to a double free in the HWA shutdown code. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-27usb: wusbcore: clean up the sg list that was created for out transfersThomas Pugliese1-0/+4
Clean up the SG list after transfer completetion for out transfers if one was created by the HWA. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-27usb: wusbcore: resource cleanup fix in __wa_xfer_setup_segsThomas Pugliese1-54/+67
This patch updates __wa_xfer_setup_segs error path to only clean up the xfer->seg entry that it failed to create and then set that entry to NULL. wa_xfer_destroy will clean up the remaining xfer->segs that were fully created. It also moves the code to create the dto sg list to an out of line function to make __wa_xfer_setup_segs easier to read. Prior to this change, __wa_xfer_setup_segs would clean up all entries in the xfer->seg array in case of an error but it did not set them to NULL. This resulted in a double free when wa_xfer_destroy was eventually called by the higher level error handler. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-27usb: wusbcore: allow wa_xfer_destroy to clean up partially constructed xfersThomas Pugliese1-2/+8
If __wa_xfer_setup fails, it can leave a partially constructed wa_xfer object. The error handling code eventually calls wa_xfer_destroy which does not check for NULL before dereferencing xfer->seg which could cause a kernel panic. This change also makes sure to free xfer->seg which was being leaked for all transfers before this change. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-27usb: wusbcore: rename fields in struct wahcThomas Pugliese3-18/+18
Rename xfer_result to dti_buf and xfer_result_size to dti_buf_size in struct wahc. The dti buffer will also be used for isochronous status packets once isochronous transfers are supported. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-27usb: wusbcore: rename urb to tr_urb in struct wa_segThomas Pugliese1-14/+16
Rename urb to tr_urb in struct wa_seg to make it clear that the urb is used for the transfer request. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-26USB: WUSBCORE: use list_move_tail instead of list_del/list_add_tailWei Yongjun1-4/+2
Using list_move_tail() instead of list_del() + list_add_tail(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-19Merge 3.11-rc6 into usb-nextGreg Kroah-Hartman1-2/+7
We want these USB fixes in this branch as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-16USB: WUSBCORE: Use usb_init_urb instead of creating the URB manuallyThomas Pugliese1-6/+9
In wa_seg_init, use usb_init_urb to init the URB object contained in the transfer segment instead of initializing it manually. Use kmalloc to allocate the memory for segment instead of kzalloc and then use memset to set the non-URB portion of the transfer segment struct to 0 since that was already done by usb_init_urb. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-16USB: WUSBCORE: fix leak of urb in wa_xfer_destroy.Thomas Pugliese1-5/+4
The check to free the URB was the opposite of the correct case. This patch removes the check altogether since the ptr will be NULL if the URB was not allocated. Also use usb_free_urb instead of usb_put_urb. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-16USB: WUSBCORE: fix resource cleanup in error path in __wa_xfer_setup_segsThomas Pugliese1-2/+4
Use usb_free_urb instead of kfree in error path and point to the correct URB. Also remember to clean up the sg list for the URB if it was allocated. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-16USB: WUSBCORE: clear RPIPE stall for control endpointsThomas Pugliese3-12/+108
When the HWA encounters a STALL on a control endpoint, it should clear the RPIPE_STALL feature on the RPIPE before processing the next transfer request. Otherwise, all transfer requests on that endpoint after the first STALL will fail because the RPIPE is still in the halted state. This also removes the unneccessary call to spin_lock_irqsave for a nested lock that was present in the first patch. Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>