summaryrefslogtreecommitdiffstats
path: root/drivers/usb/wusbcore/wa-hc.h
diff options
context:
space:
mode:
authorThomas Pugliese <thomas.pugliese@gmail.com>2013-10-04 10:40:45 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-05 17:54:13 -0700
commit7a32d9be33e2409e19fef4434188d49d1fb1959e (patch)
tree73af5d520ad7a933393840e49fc4df874475d4a3 /drivers/usb/wusbcore/wa-hc.h
parente4a49a6015efa6bd35f107640a497380d5e4ed48 (diff)
downloadop-kernel-dev-7a32d9be33e2409e19fef4434188d49d1fb1959e.zip
op-kernel-dev-7a32d9be33e2409e19fef4434188d49d1fb1959e.tar.gz
usb: wusbcore: add support for isoc out transfers
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>
Diffstat (limited to 'drivers/usb/wusbcore/wa-hc.h')
-rw-r--r--drivers/usb/wusbcore/wa-hc.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/usb/wusbcore/wa-hc.h b/drivers/usb/wusbcore/wa-hc.h
index ab39934..b44aca3 100644
--- a/drivers/usb/wusbcore/wa-hc.h
+++ b/drivers/usb/wusbcore/wa-hc.h
@@ -122,6 +122,11 @@ struct wa_rpipe {
};
+enum wa_dti_state {
+ WA_DTI_TRANSFER_RESULT_PENDING,
+ WA_DTI_ISOC_PACKET_STATUS_PENDING
+};
+
/**
* Instance of a HWA Host Controller
*
@@ -181,6 +186,15 @@ struct wahc {
spinlock_t rpipe_bm_lock; /* protect rpipe_bm */
struct mutex rpipe_mutex; /* assigning resources to endpoints */
+ /*
+ * dti_state is used to track the state of the dti_urb. When dti_state
+ * is WA_DTI_ISOC_PACKET_STATUS_PENDING, dti_isoc_xfer_in_progress and
+ * dti_isoc_xfer_seg identify which xfer the incoming isoc packet status
+ * refers to.
+ */
+ enum wa_dti_state dti_state;
+ u32 dti_isoc_xfer_in_progress;
+ u8 dti_isoc_xfer_seg;
struct urb *dti_urb; /* URB for reading xfer results */
struct urb *buf_in_urb; /* URB for reading data in */
struct edc dti_edc; /* DTI error density counter */
@@ -247,6 +261,7 @@ static inline void wa_init(struct wahc *wa)
{
edc_init(&wa->nep_edc);
atomic_set(&wa->notifs_queued, 0);
+ wa->dti_state = WA_DTI_TRANSFER_RESULT_PENDING;
wa_rpipe_init(wa);
edc_init(&wa->dti_edc);
INIT_LIST_HEAD(&wa->xfer_list);
OpenPOWER on IntegriCloud