
Specification
NET2272 USB Peripheral Controller
______________________________________________________________________________
NetChip Technology, Inc., 2003
Patent Pending
335 Pioneer Way, Mountain View, California 94041
TEL (650) 526-1490
FAX (650) 526-1494
http://www.netchip.com
Rev 1.2, October 15, 2003
43
5.7
NetChip Virtual Endpoints
5.7.1 Overview:
The Net2272 features NetChip Virtual Endpoint hardware support which enables firmware to implement any
number of USB device endpoints up to the maximum of 15 per direction, excluding endpoint 0 (see the USB 2.0
Specification sections 8.3.2.2 and 9.6.6). Hardware support for endpoint virtualization consists of the Virtual
Endpoint registers (VIRTOUT0, VIRTOUT1, VIRTIN0, and VIRTIN1) and the Virtual Endpoint Interrupt.
In this section, "logical endpoint" refers to the endpoint number from the point of view of the host (embedded in IN,
OUT, and SETUP tokens), "physical endpoint" refers to the Net2272 hardware endpoint (0, A, B, or C), and
"unassigned endpoint" refers to a logical endpoint number that is not currently assigned (via the Endpoint Address
field in the EP_CFG register) to a physical endpoint.
If the Virtual Endpoint Enable bit of the USBCLT1 register is low (default), the Net2272 responds to a host request
to an unassigned endpoint with a timeout. The host considers a timeout response to be a fatal error. The host retries
a transaction with a fatal error, but after a fixed number of retries, the host shuts down the pipe (endpoint).
If Virtual Endpoint Enable bit is high, the Net2272 responds to all requests on unassigned endpoints with a NAK.
This causes the host to retry the request until an ACK is returned.
In addition to NAKing, the Net2272 sets the bit in the Virtual Interrupt register that corresponds to the requesting
logical endpoint number. For example, if the host requests an IN on endpoint 3 when none of the Net2272 physical
endpoints is assigned to address 3 with direction IN, bit 3 of the VIRTIN0 register is set (and the Net2272 NAKs
the IN request).
While any of the Virtual Endpoint register bits are set, the Virtual Endpoint Interrupt status bit will be set. If this
interrupt is enabled, firmware is notified that the host has tried to access an unassigned endpoint. Firmware can then
re-assign one of the physical endpoints to the new logical endpoint so the data transaction can proceed.
Virtual Endpoint participation is completely flexible: all physical endpoints (excluding endpoint 0) may participate
in Virtual Endpoint re-assignment, or some physical endpoints can be dedicated to specific high-usage logical
endpoints.
5.7.2 Endpoint Virtualization
Virtualization relies on the ability of the firmware to capture, preserve, and restore the complete endpoint state as it
switches the available physical endpoint resources between a larger number of logical endpoints (similar to a CPU
context switch). NetChip Virtual Endpoint hardware support makes all the endpoint state information available to
the firmware.
When re-assigning endpoints, firmware must take care that USB traffic is not disturbed. Specifically, an endpoint
should not be reprogrammed or flushed while the endpoint is enabled. NetChip Virtual Endpoint hardware support
includes logic to prevent an endpoint's enable state from changing while a USB transaction to the endpoint is in
progress, so firmware should first disable the endpoint, and then check that the enable has succeeded (there may be a
delay while a pending USB transaction completes).