Universal Serial Bus Specification Revision 2.0
procedure Compare_buffs IS
variable match:boolean:=FALSE;
begin
--
--Is_new_SS is true when BC_buff.status == NEW_SS
--Is_old_SS is true when BC_buff.status == OLD_SS
--Is_no_space is true when BC_buff.status == NO_SPACE
-- Assume nospace and intialize index to 0. BC_buff.status := NO_SPACE;
BC_buff.index := 0;
FOR i IN 0 to num_buffs-1 LOOP IF NOT match THEN
-- Re-use buffer with same Device Address/End point. IF (token.endpt = cam(i).store.endpt AND
token.dev_addr = cam(i).store.dev_addr AND ((token.direction = cam(i).store.direction AND
split.ep_type /= CONTROL) OR split.ep_type = CONTROL)) THEN
-- If The buffer is already pending/ready this must be a retry.
IF (cam(i).match.state = READY OR cam(i).match.state = PENDING) THEN BC_buff.status := OLD_SS;
ELSE
BC_buff.status := NEW_SS; END IF;
BC_buff.index := i; match := TRUE;
-- Otherwise use the buffer if it’s old. ELSIF (cam(i).match.state = OLD) THEN
BC_buff.status := NEW_SS; BC_buff.index := i;
END IF; END IF;
END LOOP;
end Compare_buffs;
Figure 11-47. Sample Algorithm for Compare_buffs
Figure 11-48 shows the sequence of packets for a start-split transaction for the full-/low-speed bulk OUT transfer type. The block labeled SSPLIT represents a split transaction token packet as described in Chapter 8. It is followed by an OUT token packet (or SETUP token packet for a control setup transaction). If the high-speed handler times out after the SSPLIT or OUT token packets, and does not receive the following OUT/SETUP or DATA0/1 packets, it will not respond with a handshake as indicated by the dotted line transitions labeled “se1” or “se2”. This causes the host to subsequently see a transaction error
(timeout) (labeled “se2” and indicated with a dashed line). If the high-speed handler receives the DATA0/1 packet and it fails the CRC check, it takes the transition “se2” which causes the host to timeout and follow the “se2” transition.