NO:
W90P710 Programming Guide
VERSION:
2.1
PAGE:
83
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed,
distributed or reproduced without permission from Winbond.
Table No.: 1200-0003-07-A
info = TD_CC | TD_DP_SETUP | TD_T_DATA0;
td_fill(info, ctrl, 8, urb, cnt++);
if (data_len > 0)
{
info = usb_pipeout(urb->pipe)? (TD_CC | TD_R | TD_DP_OUT | TD_T_DATA1) :
(TD_CC | TD_R | TD_DP_IN | TD_T_DATA1);
td_fill(info, data, data_len, urb, cnt++);
}
info = usb_pipeout(urb->pipe)? (TD_CC | TD_DP_IN | TD_T_DATA1) :
(TD_CC | TD_DP_OUT | TD_T_DATA1);
td_fill(info, NULL, 0, urb, cnt++);
writel(OHCI_CLF, &ohci->regs->HcCommandStatus); /* start Control list */
6.5.5.2
Bulk Transfer
The maximum buffer size for a bulk
Transfer Descriptor
is 4096 bytes. Thus, for a Bulk Transfer,
HCD
simply generates a
TD
for each 4096 bytes data length. For example, if the transfer buffer length
of an
IRP
is 9KB, then
HCD
will generate three
TD
s for this
IRP
.
Because OHCI handles the data toggles by itself, it just deed to set the toggle bits for the first
TD
.
The data toggle setting of the subsequent
TD
s were processed by OHCI controller. OHCI controller
can get the toggle value from the DataToggle bit of
Endpoint Descriptor
.
The following is an example code of Bulk Transfer :
info = usb_pipeout(urb->pipe)? (TD_CC | TD_DP_OUT) : (TD_CC | TD_DP_IN);
while(data_len > 4096)
{
td_fill(info | (cnt? TD_T_TOGGLE : toggle), data, 4096, urb, cnt);
data = (VOID *)((UINT32)data + 4096);
data_len -= 4096;
cnt++;
}
info = usb_pipeout(urb->pipe)? (TD_CC | TD_DP_OUT) : (TD_CC | TD_R | TD_DP_IN);
td_fill(info | (cnt? TD_T_TOGGLE : toggle), data, data_len, urb, cnt);
cnt++;
writel (OHCI_BLF, &ohci->regs->HcCommandStatus); /* start bulk list */
6.5.5.3
Interrupt Transfer
The maximum buffer size for an Interrupt
Transfer Descriptor
is 64 bytes. The USB Client
Software should not deliver an
IRP
with transfer length exceeding 64 bytes.
HCD
makes only one
TD
for an Interrupt Transfer, which is one-shot. On completion of the
TD
,
HCD
may re-submit the