<s>
This	O
article	O
provides	O
information	O
about	O
the	O
communications	O
aspects	O
of	O
Universal	O
Serial	O
Bus	O
,	O
USB	B-Protocol
:	O
Signaling	O
,	O
Protocols	O
,	O
Transactions	O
.	O
</s>
<s>
Some	O
personal	O
computer	O
chipset	O
manufacturers	O
overcome	O
this	O
bottleneck	O
by	O
providing	O
multiple	O
USB2.0	O
controllers	O
within	O
the	O
southbridge	B-Device
.	O
</s>
<s>
In	O
practice	O
and	O
including	O
USB	B-Protocol
protocol	O
overhead	O
,	O
rates	O
of	O
320Mbit/s	O
(	O
38MB/s	O
)	O
are	O
sustainable	O
over	O
a	O
high-speed	O
bulk	O
endpoint	O
.	O
</s>
<s>
According	O
to	O
a	O
USB-IF	O
chairman	O
,	O
"	O
at	O
least	O
10	O
to	O
15	O
percent	O
of	O
the	O
stated	O
peak	O
60MB/s	O
(	O
480Mbit/s	O
)	O
of	O
Hi-speed	O
USB	B-Protocol
goes	O
to	O
overhead	O
—	O
the	O
communication	O
protocol	O
between	O
the	O
card	O
and	O
the	O
peripheral	O
.	O
</s>
<s>
Tables	O
illustrating	O
the	O
transfer	O
limits	O
are	O
shown	O
in	O
Chapter	O
5	O
of	O
the	O
USB	B-Protocol
spec	O
.	O
</s>
<s>
It	O
is	O
intended	O
primarily	O
to	O
save	O
cost	O
in	O
low-bandwidth	O
human	B-General_Concept
interface	I-General_Concept
devices	I-General_Concept
(	O
HID	O
)	O
such	O
as	O
keyboards	O
,	O
mice	O
,	O
and	O
joysticks	O
.	O
</s>
<s>
Full	O
speed	O
(	O
FS	O
)	O
rate	O
of	O
12Mbit/s	O
is	O
the	O
basic	O
USB	B-Protocol
data	O
rate	O
defined	O
by	O
USB1.0	O
.	O
</s>
<s>
All	O
USB	B-Protocol
hubs	O
can	O
operate	O
at	O
this	O
speed	O
.	O
</s>
<s>
High-speed	O
devices	O
must	O
also	O
be	O
capable	O
of	O
falling-back	O
to	O
full-speed	O
as	O
well	O
,	O
making	O
high-speed	O
devices	O
backward	B-General_Concept
compatible	I-General_Concept
with	O
USB1.1	O
hosts	O
.	O
</s>
<s>
USB3.0	O
connectors	O
are	O
generally	O
backward	B-General_Concept
compatible	I-General_Concept
,	O
but	O
include	O
new	O
wiring	O
and	O
full-duplex	O
operation	O
.	O
</s>
<s>
SuperSpeed+	O
(	O
SS+	O
)	O
rate	O
of	O
10Gbit/s	O
is	O
defined	O
by	O
USB	B-Protocol
3.1	O
and	O
20Gbit/s	O
,	O
using	O
2	O
lanes	O
,	O
is	O
defined	O
by	O
USB	B-Protocol
3.2	O
.	O
</s>
<s>
USB	B-Protocol
signals	O
are	O
transmitted	O
using	O
differential	O
signaling	O
on	O
a	O
twisted-pair	O
data	O
cable	O
with	O
characteristic	O
impedance	O
.	O
</s>
<s>
A	O
USB	B-Protocol
connection	O
is	O
always	O
between	O
a	O
host	O
or	O
hub	O
at	O
the	O
A	O
connector	O
end	O
,	O
and	O
a	O
device	O
or	O
hub	O
's	O
upstream	O
port	O
at	O
the	O
other	O
end	O
.	O
</s>
<s>
When	O
no	O
device	O
is	O
connected	O
,	O
this	O
pulls	O
both	O
data	O
lines	O
low	O
into	O
the	O
so-called	O
single-ended	O
zero	O
state	O
(	O
SE0	O
in	O
the	O
USB	B-Protocol
documentation	O
)	O
,	O
and	O
indicates	O
a	O
reset	O
or	O
disconnected	O
connection	O
.	O
</s>
<s>
The	O
following	O
terminology	O
is	O
used	O
to	O
assist	O
in	O
the	O
technical	O
discussion	O
regarding	O
USB	B-Protocol
PHY	O
signaling	O
.	O
</s>
<s>
Alternatively	O
,	O
it	O
is	O
waiting	O
for	O
a	O
new	O
packet	B-Protocol
.	O
</s>
<s>
This	O
may	O
indicate	O
an	O
end	O
of	O
packet	B-Protocol
signal	O
or	O
a	O
detached	O
USB	B-Protocol
device	O
.	O
</s>
<s>
The	O
idle	O
line	O
state	O
is	O
when	O
the	O
device	O
is	O
connected	O
to	O
the	O
host	O
with	O
a	O
pull-up	O
on	O
either	O
D+	O
(	O
for	O
full	O
speed	O
USB	B-Protocol
1.x	O
)	O
or	O
D−	O
(	O
for	O
low	O
speed	O
USB	B-Protocol
1.x	O
)	O
,	O
with	O
transmitter	O
output	O
on	O
both	O
host	O
and	O
device	O
is	O
set	O
to	O
high	O
impedance	O
(	O
hi-Z	O
)	O
(	O
disconnected	O
output	O
)	O
.	O
</s>
<s>
A	O
USB	B-Protocol
device	O
pulls	O
one	O
of	O
the	O
data	O
lines	O
high	O
with	O
a	O
1.5kΩ	O
resistor	O
.	O
</s>
<s>
SE0	O
≥	O
2	O
µs	O
Connect	O
USB	B-Protocol
device	O
pull	O
ups	O
on	O
D+	O
or	O
D−	O
wakes	O
the	O
host	O
from	O
detached	O
line	O
state	O
.	O
</s>
<s>
This	O
starts	O
the	O
USB	B-Protocol
enumeration	O
process	O
.	O
</s>
<s>
Sync	O
Start	O
of	O
a	O
packet	B-Protocol
line	O
transition	O
pattern	O
.	O
</s>
<s>
EOP	O
End	O
of	O
packet	B-Protocol
line	O
transition	O
pattern	O
.	O
</s>
<s>
SE0	O
,	O
SE0	O
,	O
J	O
Reset	O
Reset	O
USB	B-Protocol
device	O
to	O
a	O
known	O
initial	O
state	O
.	O
</s>
<s>
To	O
avoid	O
this	O
state	O
a	O
SOF	O
packet	B-Protocol
(	O
high	O
speed	O
)	O
or	O
a	O
keep	O
alive	O
(	O
low	O
speed	O
)	O
signal	O
is	O
given	O
.	O
</s>
<s>
USB	B-Protocol
data	O
is	O
transmitted	O
by	O
toggling	O
the	O
data	O
lines	O
between	O
the	O
J	O
state	O
and	O
the	O
opposite	O
K	O
state	O
.	O
</s>
<s>
USB	B-Protocol
encodes	O
data	O
using	O
the	O
NRZI	O
line	B-Protocol
coding	I-Protocol
:	O
</s>
<s>
To	O
ensure	O
that	O
there	O
are	O
enough	O
signal	O
transitions	O
for	O
clock	O
recovery	O
to	O
occur	O
in	O
the	O
bitstream	O
,	O
a	O
bit	B-Protocol
stuffing	I-Protocol
technique	O
is	O
applied	O
to	O
the	O
data	O
stream	O
:	O
an	O
extra	O
0bit	O
is	O
inserted	O
into	O
the	O
data	O
stream	O
after	O
any	O
occurrence	O
of	O
six	O
consecutive	O
1bits	O
.	O
</s>
<s>
Synchronization	O
Pattern	O
A	O
USB	B-Protocol
packet	B-Protocol
begins	O
with	O
an	O
8-bit	O
synchronization	O
sequence	O
,	O
00000001₂	O
.	O
</s>
<s>
The	O
final	O
1bit	O
(	O
repeated	O
Kstate	O
)	O
marks	O
the	O
end	O
of	O
the	O
sync	O
pattern	O
and	O
the	O
beginning	O
of	O
the	O
USB	B-Protocol
frame	O
.	O
</s>
<s>
For	O
high-bandwidth	O
USB	B-Protocol
,	O
the	O
packet	B-Protocol
begins	O
with	O
a	O
32-bit	O
synchronization	O
sequence	O
.	O
</s>
<s>
End	O
of	O
Packet	B-Protocol
(	O
EOP	O
)	O
EOP	O
is	O
indicated	O
by	O
the	O
transmitter	O
driving	O
2	O
bit	O
times	O
of	O
SE0	O
(	O
D+	O
and	O
D−	O
both	O
below	O
max	O
.	O
)	O
</s>
<s>
Sometimes	O
skew	O
due	O
to	O
hubs	O
can	O
add	O
as	O
much	O
as	O
one	O
bit	O
time	O
before	O
the	O
SE0	O
of	O
the	O
end	O
of	O
packet	B-Protocol
.	O
</s>
<s>
Bus	O
Reset	O
A	O
USB	B-Protocol
bus	O
is	O
reset	O
using	O
a	O
prolonged	O
(	O
10	O
to	O
20milliseconds	O
)	O
SE0	O
signal	O
.	O
</s>
<s>
A	O
device	O
that	O
is	O
high	O
speed	O
capable	O
first	O
connects	O
as	O
a	O
full	O
speed	O
device	O
(	O
D+	O
pulled	O
high	O
)	O
,	O
but	O
upon	O
receiving	O
a	O
USB	B-Protocol
RESET	O
(	O
both	O
D+	O
and	O
D−	O
driven	O
LOW	O
by	O
host	O
for	O
10	O
to	O
20ms	O
)	O
it	O
pulls	O
the	O
D−	O
line	O
high	O
,	O
known	O
as	O
chirp	O
K	O
.	O
This	O
indicates	O
to	O
the	O
host	O
that	O
the	O
device	O
is	O
high	O
bandwidth	O
.	O
</s>
<s>
Electrical	O
signalling	O
uses	O
a	O
linear	B-Architecture
feedback	I-Architecture
shift	I-Architecture
register	I-Architecture
and	O
8b/10b	B-Protocol
encoding	I-Protocol
with	O
spread	B-Architecture
spectrum	I-Architecture
clocking	I-Architecture
,	O
sent	O
at	O
a	O
nominal	O
1Volt	O
with	O
a	O
100mV	O
receiver	O
threshold	O
;	O
the	O
receiver	O
uses	O
equalization	O
training	O
.	O
</s>
<s>
Packet	B-Protocol
headers	O
are	O
protected	O
with	O
CRC-16	O
,	O
while	O
data	O
payload	O
is	O
protected	O
with	O
CRC-32	O
.	O
</s>
<s>
During	O
USB	B-Protocol
communication	O
,	O
data	O
is	O
transmitted	O
as	O
packets	B-Protocol
.	O
</s>
<s>
Initially	O
,	O
all	O
packets	B-Protocol
are	O
sent	O
from	O
the	O
host	O
via	O
the	O
root	O
hub	O
,	O
and	O
possibly	O
more	O
hubs	O
,	O
to	O
devices	O
.	O
</s>
<s>
Some	O
of	O
those	O
packets	B-Protocol
direct	O
a	O
device	O
to	O
send	O
some	O
packets	B-Protocol
in	O
reply	O
.	O
</s>
<s>
After	O
the	O
sync	O
field	O
,	O
all	O
packets	B-Protocol
are	O
made	O
of	O
8-bit	O
bytes	O
,	O
transmitted	O
least-significant	O
bit	O
first	O
.	O
</s>
<s>
The	O
first	O
byte	O
is	O
a	O
packet	B-Protocol
identifier	O
(	O
PID	O
)	O
byte	O
.	O
</s>
<s>
(	O
A	O
PID	O
byte	O
contains	O
at	O
most	O
four	O
consecutive	O
1bits	O
,	O
and	O
thus	O
never	O
needs	O
bit-stuffing	B-Protocol
,	O
even	O
when	O
combined	O
with	O
the	O
final	O
1bit	O
in	O
the	O
sync	O
byte	O
.	O
</s>
<s>
However	O
,	O
trailing	O
1bits	O
in	O
the	O
PID	O
may	O
require	O
bit-stuffing	B-Protocol
within	O
the	O
first	O
few	O
bits	O
of	O
the	O
payload	O
.	O
)	O
</s>
<s>
Packets	B-Protocol
come	O
in	O
three	O
basic	O
types	O
,	O
each	O
with	O
a	O
different	O
format	O
and	O
CRC	O
(	O
cyclic	O
redundancy	O
check	O
)	O
:	O
</s>
<s>
Handshake	O
packets	B-Protocol
consist	O
of	O
only	O
a	O
single	O
PID	O
byte	O
,	O
and	O
are	O
generally	O
sent	O
in	O
response	O
to	O
data	B-Protocol
packets	I-Protocol
.	O
</s>
<s>
Error	O
detection	O
is	O
provided	O
by	O
transmitting	O
four	O
bits	O
,	O
which	O
represent	O
the	O
packet	B-Protocol
type	O
twice	O
,	O
in	O
a	O
single	O
PID	O
byte	O
using	O
complemented	O
form	O
.	O
</s>
<s>
USB2.0	O
added	O
two	O
additional	O
handshake	O
packets	B-Protocol
:	O
NYET	O
and	O
ERR	O
.	O
</s>
<s>
A	O
second	O
use	O
for	O
a	O
NYET	O
packet	B-Protocol
is	O
to	O
tell	O
the	O
host	O
that	O
the	O
device	O
has	O
accepted	O
a	O
data	B-Protocol
packet	I-Protocol
,	O
but	O
cannot	O
accept	O
any	O
more	O
due	O
to	O
full	O
buffers	O
.	O
</s>
<s>
This	O
allows	O
a	O
host	O
to	O
switch	O
to	O
sending	O
small	O
PING	O
tokens	O
to	O
inquire	O
about	O
the	O
device	O
's	O
readiness	O
,	O
rather	O
than	O
sending	O
an	O
entire	O
unwanted	O
DATA	B-Protocol
packet	I-Protocol
just	O
to	O
elicit	O
a	O
NAK	O
.	O
</s>
<s>
The	O
only	O
handshake	O
packet	B-Protocol
the	O
USB	B-Protocol
host	O
may	O
generate	O
is	O
ACK	O
.	O
</s>
<s>
Token	O
packets	B-Protocol
consist	O
of	O
a	O
PID	O
byte	O
followed	O
by	O
two	O
payload	O
bytes	O
:	O
11bits	O
of	O
address	O
and	O
a	O
five-bit	O
CRC	O
.	O
</s>
<s>
Below	O
are	O
tokens	O
present	O
from	O
USB	B-Protocol
1.0	O
:	O
</s>
<s>
IN	O
and	O
OUT	O
tokens	O
contain	O
a	O
seven-bit	O
device	O
number	O
and	O
four-bit	O
function	O
number	O
(	O
for	O
multifunction	O
devices	O
)	O
and	O
command	O
the	O
device	O
to	O
transmit	O
DATAx	O
packets	B-Protocol
,	O
or	O
receive	O
the	O
following	O
DATAx	O
packets	B-Protocol
,	O
respectively	O
.	O
</s>
<s>
SOF	O
(	O
Start	O
of	O
Frame	O
)	O
Every	O
millisecond	O
(	O
12000	O
full-bandwidth	O
bit	O
times	O
)	O
,	O
the	O
USB	B-Protocol
host	O
transmits	O
a	O
special	O
SOF	O
(	O
start	O
of	O
frame	O
)	O
token	O
,	O
containing	O
an	O
11-bit	O
incrementing	O
frame	O
number	O
in	O
place	O
of	O
a	O
device	O
address	O
.	O
</s>
<s>
This	O
avoids	O
the	O
need	O
to	O
send	O
a	O
large	O
data	B-Protocol
packet	I-Protocol
to	O
a	O
device	O
that	O
the	O
host	O
suspects	O
is	O
unwilling	O
to	O
accept	O
it	O
.	O
</s>
<s>
Rather	O
than	O
tie	O
up	O
the	O
high-bandwidth	O
USB	B-Protocol
bus	O
sending	O
data	O
to	O
a	O
slower	O
USB	B-Protocol
device	O
,	O
the	O
nearest	O
high-bandwidth	O
capable	O
hub	O
receives	O
a	O
SPLIT	O
token	O
followed	O
by	O
one	O
or	O
two	O
USB	B-Protocol
packets	B-Protocol
at	O
high-bandwidth	O
,	O
performs	O
the	O
data	O
transfer	O
at	O
full	O
-	O
or	O
low-bandwidth	O
,	O
and	O
provides	O
the	O
response	O
at	O
high-bandwidth	O
when	O
prompted	O
by	O
a	O
second	O
SPLIT	O
token	O
.	O
</s>
<s>
ADDR	O
:	O
Address	O
of	O
USB	B-Protocol
device	O
(	O
maximum	O
of	O
127	O
devices	O
)	O
.	O
</s>
<s>
PID	O
OUT	O
would	O
be	O
for	O
sending	O
data	O
from	O
host	O
source	O
buffer	O
into	O
the	O
USB	B-Protocol
device	O
sink	O
buffer	O
.	O
)	O
</s>
<s>
By	O
default	O
,	O
all	O
USB	B-Protocol
devices	O
must	O
at	O
least	O
support	O
endpoint	O
buffer	O
0	O
(	O
EP0	O
)	O
.	O
</s>
<s>
A	O
data	B-Protocol
packet	I-Protocol
consists	O
of	O
the	O
PID	O
followed	O
by	O
0	O
–	O
1,024	O
bytes	O
of	O
data	O
payload	O
(	O
up	O
to	O
1,024	O
bytes	O
for	O
high-speed	O
devices	O
,	O
up	O
to	O
64bytes	O
for	O
full-speed	O
devices	O
,	O
and	O
at	O
most	O
eightbytes	O
for	O
low-speed	O
devices	O
)	O
,	O
and	O
a	O
16-bit	O
CRC	O
.	O
</s>
<s>
There	O
are	O
two	O
basic	O
forms	O
of	O
data	B-Protocol
packet	I-Protocol
,	O
DATA0	O
and	O
DATA1	O
.	O
</s>
<s>
A	O
data	B-Protocol
packet	I-Protocol
must	O
always	O
be	O
preceded	O
by	O
an	O
address	O
token	O
,	O
and	O
is	O
usually	O
followed	O
by	O
a	O
handshake	O
token	O
from	O
the	O
receiver	O
back	O
to	O
the	O
transmitter	O
.	O
</s>
<s>
The	O
two	O
packet	B-Protocol
types	O
provide	O
the	O
1-bit	O
sequence	O
number	O
required	O
by	O
stop-and-wait	B-Error_Name
ARQ	I-Error_Name
.	O
</s>
<s>
If	O
a	O
USB	B-Protocol
host	O
does	O
not	O
receive	O
a	O
response	O
(	O
such	O
as	O
an	O
ACK	O
)	O
for	O
data	O
it	O
has	O
transmitted	O
,	O
it	O
does	O
not	O
know	O
if	O
the	O
data	O
was	O
received	O
or	O
not	O
;	O
the	O
data	O
might	O
have	O
been	O
lost	O
in	O
transit	O
or	O
it	O
might	O
have	O
been	O
received	O
but	O
the	O
handshake	O
response	O
was	O
lost	O
.	O
</s>
<s>
To	O
solve	O
this	O
problem	O
,	O
the	O
device	O
keeps	O
track	O
of	O
the	O
type	O
of	O
DATAx	O
packet	B-Protocol
it	O
last	O
accepted	O
.	O
</s>
<s>
If	O
it	O
receives	O
another	O
DATAx	O
packet	B-Protocol
of	O
the	O
same	O
type	O
,	O
it	O
is	O
acknowledged	O
but	O
ignored	O
as	O
a	O
duplicate	O
.	O
</s>
<s>
Only	O
a	O
DATAx	O
packet	B-Protocol
of	O
the	O
opposite	O
type	O
is	O
actually	O
received	O
.	O
</s>
<s>
When	O
this	O
happens	O
,	O
the	O
receiver	O
does	O
not	O
generate	O
an	O
ACK	O
,	O
which	O
makes	O
the	O
sender	O
resend	O
the	O
packet	B-Protocol
.	O
</s>
<s>
When	O
a	O
device	O
is	O
reset	O
with	O
a	O
SETUP	O
packet	B-Protocol
,	O
it	O
expects	O
an	O
8-byte	O
DATA0	O
packet	B-Protocol
next	O
.	O
</s>
<s>
USB2.0	O
added	O
DATA2	O
and	O
MDATA	O
packet	B-Protocol
types	O
as	O
well	O
.	O
</s>
<s>
This	O
is	O
required	O
as	O
a	O
USB	B-Protocol
hub	O
functions	O
as	O
a	O
very	O
simple	O
repeater	O
,	O
broadcasting	O
the	O
host	O
message	O
to	O
all	O
connected	O
devices	O
regardless	O
if	O
the	O
packet	B-Protocol
was	O
for	O
it	O
or	O
not	O
.	O
</s>
<s>
To	O
eliminate	O
this	O
danger	O
,	O
if	O
a	O
USB	B-Protocol
hub	O
detects	O
a	O
mix	O
of	O
high	O
speed	O
or	O
full	O
speed	O
and	O
low	O
speed	O
devices	O
,	O
it	O
,	O
by	O
default	O
,	O
disables	O
communication	O
to	O
the	O
low	O
speed	O
device	O
unless	O
it	O
receives	O
a	O
request	O
to	O
switch	O
to	O
low	O
speed	O
mode	O
.	O
</s>
<s>
On	O
reception	O
of	O
a	O
PRE	O
packet	B-Protocol
however	O
,	O
it	O
temporarily	O
re-enables	O
the	O
output	O
port	O
to	O
all	O
low	O
speed	O
devices	O
,	O
to	O
allow	O
the	O
host	O
to	O
send	O
a	O
single	O
low	O
speed	O
packet	B-Protocol
to	O
low	O
speed	O
devices	O
.	O
</s>
<s>
After	O
the	O
low	O
speed	O
packet	B-Protocol
is	O
sent	O
,	O
an	O
end	O
of	O
packet	B-Protocol
(	O
EOP	O
)	O
signal	O
tells	O
the	O
hub	O
to	O
disable	O
all	O
outputs	O
to	O
low	O
speed	O
devices	O
again	O
.	O
</s>
<s>
Then	O
a	O
low-bandwidth	O
packet	B-Protocol
follows	O
,	O
beginning	O
with	O
a	O
sync	O
sequence	O
and	O
PID	O
byte	O
,	O
and	O
ending	O
with	O
a	O
brief	O
period	O
of	O
SE0	O
.	O
</s>
<s>
Full-bandwidth	O
devices	O
other	O
than	O
hubs	O
can	O
simply	O
ignore	O
the	O
PRE	O
packet	B-Protocol
and	O
its	O
low-bandwidth	O
contents	O
,	O
until	O
the	O
final	O
SE0	O
indicates	O
that	O
a	O
new	O
packet	B-Protocol
follows	O
.	O
</s>
<s>
Low	O
speed	O
packet	B-Protocol
example	O
Hub	O
disable	O
output	O
to	O
low	O
speed	O
devices	O
.	O
</s>
<s>
USB	B-Protocol
packets	B-Protocol
are	O
organized	O
into	O
transactions	O
,	O
consisting	O
of	O
a	O
token	O
packet	B-Protocol
,	O
a	O
conditional	O
data	B-Protocol
packet	I-Protocol
,	O
and	O
a	O
handshake	O
packet	B-Protocol
.	O
</s>
<s>
OUT	O
transaction	O
(	O
3	O
packets	B-Protocol
total	O
)	O
Host	O
Host	O
DevicePacket	O
PIDOUTDATAxACKPacket	O
typeTokenDataHandshakeDescriptionTell	O
device	O
onADDRxto	O
start	O
listening	O
for	O
incoming	O
data	B-Protocol
packet	I-Protocol
on	O
endpointEPx.Tell	O
USB	B-Protocol
device	O
the	O
data	O
that	O
you	O
want	O
to	O
send	O
to	O
it.Device	O
tells	O
the	O
host	O
that	O
it	O
has	O
successfully	O
received	O
and	O
loaded	O
the	O
data	O
payload	O
to	O
buffer	O
EPx	O
.	O
</s>
<s>
IN	O
transaction	O
(	O
3	O
packets	B-Protocol
total	O
)	O
Host	O
Device	O
HostPacket	O
PIDINDATAxACKPacket	O
typeTokenDataHandshakeDescriptionTell	O
device	O
onADDRxto	O
send	O
any	O
data	O
that	O
it	O
has	O
on	O
its	O
endpoint	O
bufferEPx.Device	O
checks	O
its	O
EPx	O
endpoint	O
buffer	O
and	O
sends	O
the	O
requested	O
data	O
to	O
host.Host	O
lets	O
device	O
know	O
that	O
it	O
has	O
successfully	O
received	O
the	O
payload	O
and	O
has	O
loaded	O
the	O
payload	O
into	O
its	O
EPx	O
buffer	O
.	O
</s>
<s>
SETUP	O
transaction	O
(	O
3	O
packets	B-Protocol
total	O
)	O
Host	O
Host	O
DevicePacket	O
PIDSETUPDATA0ACKPacket	O
typeTokenDataHandshakeDescriptionTell	O
device	O
onADDRxto	O
start	O
setup	O
mode	O
and	O
be	O
ready	O
for	O
a	O
data	O
packet.Send	O
to	O
device	O
the	O
8	O
bytes	O
long	O
setup	O
packet.Device	O
acknowledge	O
reception	O
of	O
SETUP	O
data	O
and	O
updates	O
its	O
setup	O
state	O
machine	O
.	O
</s>
<s>
Depending	O
on	O
the	O
setup	O
packet	B-Protocol
,	O
an	O
optional	O
data	B-Protocol
packet	I-Protocol
from	O
device	O
to	O
host	O
or	O
host	O
to	O
device	O
may	O
occur	O
.	O
</s>
<s>
A	O
setup	O
transaction	O
transfers	O
an	O
8-byte	O
setup	O
packet	B-Protocol
to	O
the	O
device	O
.	O
</s>
<s>
The	O
setup	O
packet	B-Protocol
encodes	O
the	O
direction	O
and	O
length	O
of	O
any	O
following	O
data	B-Protocol
packets	I-Protocol
.	O
</s>
<s>
wLength	O
6	O
2	O
Data	O
transfer	O
length	O
:	O
The	O
number	O
of	O
bytes	O
to	O
be	O
transferred	O
after	O
the	O
setup	O
packet	B-Protocol
.	O
</s>
<s>
It	O
consists	O
of	O
a	O
SETUP	O
token	O
,	O
a	O
DATA	B-Protocol
packet	I-Protocol
from	O
the	O
host	O
containing	O
the	O
"	O
setup	O
packet	B-Protocol
"	O
structure	O
above	O
,	O
and	O
a	O
handshake	O
packet	B-Protocol
from	O
the	O
device	O
.	O
</s>
<s>
A	O
transaction	O
containing	O
a	O
DATA	B-Protocol
packet	I-Protocol
with	O
no	O
payload	O
at	O
all	O
,	O
called	O
a	O
zero-length	O
packet	B-Protocol
.	O
</s>
<s>
A	O
transaction	O
containing	O
a	O
DATA	B-Protocol
packet	I-Protocol
with	O
a	O
length	O
smaller	O
than	O
the	O
maximum	O
packet	B-Protocol
size	O
for	O
that	O
endpoint	O
,	O
called	O
a	O
"	O
short	O
"	O
packet	B-Protocol
.	O
</s>
<s>
When	O
the	O
exact	O
amount	O
of	O
data	O
specified	O
by	O
the	O
wLength	O
field	O
of	O
the	O
setup	O
packet	B-Protocol
has	O
been	O
transmitted	O
.	O
</s>
<s>
This	O
allows	O
the	O
host	O
to	O
perform	O
bus	O
management	O
action	O
like	O
enumerating	O
new	O
USB	B-Protocol
devices	O
via	O
retrieving	O
the	O
descriptors	O
of	O
the	O
new	O
devices	O
.	O
</s>
<s>
Retrieval	O
of	O
the	O
descriptors	O
would	O
especially	O
allow	O
for	O
determining	O
the	O
USB	B-Protocol
Class	O
,	O
VID	O
,	O
and	O
PID	O
,	O
which	O
are	O
often	O
used	O
for	O
determining	O
the	O
correct	O
USB	B-Protocol
driver	O
for	O
the	O
device	O
.	O
</s>
<s>
Also	O
,	O
after	O
the	O
descriptors	O
is	O
retrieved	O
,	O
the	O
host	O
performs	O
another	O
control	O
transfer	O
exchange	O
,	O
but	O
instead	O
to	O
set	O
the	O
address	O
of	O
the	O
USB	B-Protocol
device	O
to	O
a	O
new	O
ADDRx	O
.	O
</s>
