aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/host/whci/qset.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb/host/whci/qset.c')
-rw-r--r--drivers/usb/host/whci/qset.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/drivers/usb/host/whci/qset.c b/drivers/usb/host/whci/qset.c
index 7be74314ee12..640b38fbd051 100644
--- a/drivers/usb/host/whci/qset.c
+++ b/drivers/usb/host/whci/qset.c
@@ -89,11 +89,16 @@ static void qset_fill_qh(struct whc_qset *qset, struct urb *urb)
89 QH_INFO3_TX_RATE_53_3 89 QH_INFO3_TX_RATE_53_3
90 | QH_INFO3_TX_PWR(0) /* 0 == max power */ 90 | QH_INFO3_TX_PWR(0) /* 0 == max power */
91 ); 91 );
92
93 qset->qh.cur_window = cpu_to_le32((1 << qset->max_burst) - 1);
92} 94}
93 95
94/** 96/**
95 * qset_clear - clear fields in a qset so it may be reinserted into a 97 * qset_clear - clear fields in a qset so it may be reinserted into a
96 * schedule 98 * schedule.
99 *
100 * The sequence number and current window are not cleared (see
101 * qset_reset()).
97 */ 102 */
98void qset_clear(struct whc *whc, struct whc_qset *qset) 103void qset_clear(struct whc *whc, struct whc_qset *qset)
99{ 104{
@@ -101,9 +106,8 @@ void qset_clear(struct whc *whc, struct whc_qset *qset)
101 qset->remove = 0; 106 qset->remove = 0;
102 107
103 qset->qh.link = cpu_to_le32(QH_LINK_NTDS(8) | QH_LINK_T); 108 qset->qh.link = cpu_to_le32(QH_LINK_NTDS(8) | QH_LINK_T);
104 qset->qh.status = cpu_to_le16(QH_STATUS_ICUR(qset->td_start)); 109 qset->qh.status = qset->qh.status & QH_STATUS_SEQ_MASK;
105 qset->qh.err_count = 0; 110 qset->qh.err_count = 0;
106 qset->qh.cur_window = cpu_to_le32((1 << qset->max_burst) - 1);
107 qset->qh.scratch[0] = 0; 111 qset->qh.scratch[0] = 0;
108 qset->qh.scratch[1] = 0; 112 qset->qh.scratch[1] = 0;
109 qset->qh.scratch[2] = 0; 113 qset->qh.scratch[2] = 0;
@@ -114,6 +118,20 @@ void qset_clear(struct whc *whc, struct whc_qset *qset)
114} 118}
115 119
116/** 120/**
121 * qset_reset - reset endpoint state in a qset.
122 *
123 * Clears the sequence number and current window. This qset must not
124 * be in the ASL or PZL.
125 */
126void qset_reset(struct whc *whc, struct whc_qset *qset)
127{
128 wait_for_completion(&qset->remove_complete);
129
130 qset->qh.status &= ~QH_STATUS_SEQ_MASK;
131 qset->qh.cur_window = cpu_to_le32((1 << qset->max_burst) - 1);
132}
133
134/**
117 * get_qset - get the qset for an async endpoint 135 * get_qset - get the qset for an async endpoint
118 * 136 *
119 * A new qset is created if one does not already exist. 137 * A new qset is created if one does not already exist.