1 |
786 |
skrzyp |
#===============================================================================
|
2 |
|
|
#
|
3 |
|
|
# bulk-boundaries.tcl
|
4 |
|
|
#
|
5 |
|
|
# Support for USB testing
|
6 |
|
|
#
|
7 |
|
|
#===============================================================================
|
8 |
|
|
## ####ECOSGPLCOPYRIGHTBEGIN####
|
9 |
|
|
## -------------------------------------------
|
10 |
|
|
## This file is part of eCos, the Embedded Configurable Operating System.
|
11 |
|
|
## Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
|
12 |
|
|
##
|
13 |
|
|
## eCos is free software; you can redistribute it and/or modify it under
|
14 |
|
|
## the terms of the GNU General Public License as published by the Free
|
15 |
|
|
## Software Foundation; either version 2 or (at your option) any later
|
16 |
|
|
## version.
|
17 |
|
|
##
|
18 |
|
|
## eCos is distributed in the hope that it will be useful, but WITHOUT
|
19 |
|
|
## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
20 |
|
|
## FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
21 |
|
|
## for more details.
|
22 |
|
|
##
|
23 |
|
|
## You should have received a copy of the GNU General Public License
|
24 |
|
|
## along with eCos; if not, write to the Free Software Foundation, Inc.,
|
25 |
|
|
## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
26 |
|
|
##
|
27 |
|
|
## As a special exception, if other files instantiate templates or use
|
28 |
|
|
## macros or inline functions from this file, or you compile this file
|
29 |
|
|
## and link it with other works to produce a work based on this file,
|
30 |
|
|
## this file does not by itself cause the resulting work to be covered by
|
31 |
|
|
## the GNU General Public License. However the source code for this file
|
32 |
|
|
## must still be made available in accordance with section (3) of the GNU
|
33 |
|
|
## General Public License v2.
|
34 |
|
|
##
|
35 |
|
|
## This exception does not invalidate any other reasons why a work based
|
36 |
|
|
## on this file might be covered by the GNU General Public License.
|
37 |
|
|
## -------------------------------------------
|
38 |
|
|
## ####ECOSGPLCOPYRIGHTEND####
|
39 |
|
|
#===============================================================================
|
40 |
|
|
######DESCRIPTIONBEGIN####
|
41 |
|
|
#
|
42 |
|
|
# Author(s): asl
|
43 |
|
|
# Date: 2006-04-21
|
44 |
|
|
# Purpose: Test the bulk endpoints with different sizes of packets
|
45 |
|
|
# at the important boundaries.
|
46 |
|
|
#
|
47 |
|
|
#####DESCRIPTIONEND####
|
48 |
|
|
#===============================================================================
|
49 |
|
|
|
50 |
|
|
set pktsizes { 1 2 3 4 5 7 8 9 15 16 17 31 32 33 63 64 65 127 128 129 \
|
51 |
|
|
255 256 257 511 512 513 1023 1024 1025 2047 2048 2049 \
|
52 |
|
|
4095 4096 4097 }
|
53 |
|
|
|
54 |
|
|
if { 0 != [llength $usbtest::bulk_in_endpoints] } {
|
55 |
|
|
puts "Bulk IN endpoints: $usbtest::bulk_in_endpoints"
|
56 |
|
|
foreach ep $usbtest::bulk_in_endpoints {
|
57 |
|
|
puts [format " %2d: packet sizes %d to %d, padding %d" $ep \
|
58 |
|
|
$usbtest::bulk_in($ep,min_size) \
|
59 |
|
|
$usbtest::bulk_in($ep,max_size) \
|
60 |
|
|
$usbtest::bulk_in($ep,max_in_padding)]
|
61 |
|
|
foreach pktsize $pktsizes {
|
62 |
|
|
if { $pktsize <= $usbtest::bulk_in($ep,max_size) } {
|
63 |
|
|
puts [format "Testing IN endpoint %d with packet size %4d" \
|
64 |
|
|
$ep $pktsize]
|
65 |
|
|
usbtest::reset
|
66 |
|
|
usbtest::bulktest $ep in 5 txsize1=$pktsize format=byteseq \
|
67 |
|
|
data1=42 data* $usbtest::MULTIPLIER \
|
68 |
|
|
data+ $usbtest::INCREMENT
|
69 |
|
|
if { [usbtest::start 10] } {
|
70 |
|
|
puts "Passed"
|
71 |
|
|
} else {
|
72 |
|
|
puts "Failed"
|
73 |
|
|
foreach result $usbtest::results {
|
74 |
|
|
puts $result
|
75 |
|
|
}
|
76 |
|
|
}
|
77 |
|
|
}
|
78 |
|
|
}
|
79 |
|
|
}
|
80 |
|
|
}
|
81 |
|
|
|
82 |
|
|
if { 0 != [llength $usbtest::bulk_out_endpoints] } {
|
83 |
|
|
puts "Bulk OUT endpoints: $usbtest::bulk_out_endpoints"
|
84 |
|
|
foreach ep $usbtest::bulk_out_endpoints {
|
85 |
|
|
puts [format " %2d: packet sizes %d to %d" $ep \
|
86 |
|
|
$usbtest::bulk_out($ep,min_size) \
|
87 |
|
|
$usbtest::bulk_out($ep,max_size)]
|
88 |
|
|
foreach pktsize $pktsizes {
|
89 |
|
|
if { $pktsize <= $usbtest::bulk_out($ep,max_size) } {
|
90 |
|
|
puts [format "Testing OUT endpoint %d with packet size %4d" \
|
91 |
|
|
$ep $pktsize]
|
92 |
|
|
usbtest::reset
|
93 |
|
|
usbtest::bulktest $ep out 5 txsize1=$pktsize format=byteseq \
|
94 |
|
|
data1=42 data* $usbtest::MULTIPLIER \
|
95 |
|
|
data+ $usbtest::INCREMENT rxsize1=4096
|
96 |
|
|
if { [usbtest::start 10] } {
|
97 |
|
|
puts "Passed"
|
98 |
|
|
} else {
|
99 |
|
|
puts "Failed"
|
100 |
|
|
foreach result $usbtest::results {
|
101 |
|
|
puts $result
|
102 |
|
|
}
|
103 |
|
|
}
|
104 |
|
|
}
|
105 |
|
|
}
|
106 |
|
|
}
|
107 |
|
|
}
|