1 /* $NetBSD: rcvbundl.h,v 1.1.14.1 2005/03/04 16:44:05 skrll Exp $ */
4 Copyright (c) 1999-2001, Intel Corporation
8 Redistribution and use in source and binary forms, with or without
9 modification, are permitted provided that the following conditions are met:
11 1. Redistributions of source code must retain the above copyright notice,
12 this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
18 3. Neither the name of Intel Corporation nor the names of its contributors
19 may be used to endorse or promote products derived from this software
20 without specific prior written permission.
22 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
23 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25 DISCLAIMED. IN NO EVENT SHALL CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
28 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31 EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 Author: Patrick J Luhmann (PJL)
40 This file contains the loadable micro code arrays to implement receive bundling on the
41 D101 A-step, D101 B-step, D101M (B-step only), D101S, D102 B-step,
42 D102 B-step with TCO work around and D012 C-step.
44 Each controller has its own specific micro code array. The array for one controller
45 is totally incompatible with any other controller, and if used will most likely
46 cause the controller to lock up and stop responding to the driver. Each micro
47 code array has its own parameter offsets (described below), and they each have
48 their own version number (which should not be confused with the version of the
49 rcvbundl.h file given above).
53 /* Size of loadable micro code image for each supported chip. */
54 #ifndef D100_NUM_MICROCODE_DWORDS
55 #define D100_NUM_MICROCODE_DWORDS 66
57 #ifndef D101_NUM_MICROCODE_DWORDS
58 #define D101_NUM_MICROCODE_DWORDS 102
60 #ifndef D101M_NUM_MICROCODE_DWORDS
61 #define D101M_NUM_MICROCODE_DWORDS 134
63 #ifndef D101S_NUM_MICROCODE_DWORDS
64 #define D101S_NUM_MICROCODE_DWORDS 134
66 #ifndef D102_NUM_MICROCODE_DWORDS
67 #define D102_NUM_MICROCODE_DWORDS 134
69 #ifndef D102_NUM_TCO_MICROCODE_DWORDS
70 #define D102_NUM_TCO_MICROCODE_DWORDS 134
74 /*************************************************************************
77 * All CPUSaver parameters are 16-bit literals that are part of a
78 * "move immediate value" instruction. By changing the value of
79 * the literal in the instruction before the code is loaded, the
80 * driver can change algorithm.
82 * CPUSAVER_DWORD - This is the location of the instruction that loads
83 * the dead-man timer with its inital value. By writing a 16-bit
84 * value to the low word of this instruction, the driver can change
85 * the timer value. The current default is either x600 or x800;
86 * experiments show that the value probably should stay within the
87 * range of x200 - x1000.
89 * CPUSAVER_BUNDLE_MAX_DWORD - This is the location of the instruction
90 * that sets the maximum number of frames that will be bundled. In
91 * some situations, such as the TCP windowing algorithm, it may be
92 * better to limit the growth of the bundle size than let it go as
93 * high as it can, because that could cause too much added latency.
94 * The default is six, because this is the number of packets in the
95 * default TCP window size. A value of 1 would make CPUSaver indicate
96 * an interrupt for every frame received. If you do not want to put
97 * a limit on the bundle size, set this value to xFFFF.
99 * CPUSAVER_MIN_SIZE_DWORD - This is the location of the instruction
100 * that contains a bit-mask describing the minimum size frame that
101 * will be bundled. The default masks the lower 7 bits, which means
102 * that any frame less than 128 bytes in length will not be bundled,
103 * but will instead immediately generate an interrupt. This does
104 * not affect the current bundle in any way. Any frame that is 128
105 * bytes or large will be bundled normally. This feature is meant
106 * to provide immediate indication of ACK frames in a TCP environment.
107 * Customers were seeing poor performance when a machine with CPUSaver
108 * enabled was sending but not receiving. The delay introduced when
109 * the ACKs were received was enough to reduce total throughput, because
110 * the sender would sit idle until the ACK was finally seen.
112 * The current default is 0xFF80, which masks out the lower 7 bits.
113 * This means that any frame which is x7F (127) bytes or smaller
114 * will cause an immediate interrupt. Because this value must be a
115 * bit mask, there are only a few valid values that can be used. To
116 * turn this feature off, the driver can write the value xFFFF to the
117 * lower word of this instruction (in the same way that the other
118 * parameters are used). Likewise, a value of 0xF800 (2047) would
119 * cause an interrupt to be generated for every frame, because all
120 * standard Ethernet frames are <= 2047 bytes in length.
121 *************************************************************************/
125 /********************************************************/
126 /* CPUSaver micro code for the D101A */
127 /********************************************************/
131 /* This value is the same for both A and B step of 558. */
132 #define D101_CPUSAVER_DWORD 72
135 #define D101_A_RCVBUNDLE_UCODE \
242 /********************************************************/
243 /* CPUSaver micro code for the D101B */
244 /********************************************************/
248 #define D101_B0_RCVBUNDLE_UCODE \
355 /********************************************************/
356 /* CPUSaver micro code for the D101M (B-step only) */
357 /********************************************************/
361 /* Parameter values for the D101M B-step */
362 #define D101M_CPUSAVER_DWORD 78
363 #define D101M_CPUSAVER_BUNDLE_MAX_DWORD 65
364 #define D101M_CPUSAVER_MIN_SIZE_DWORD 126
367 #define D101M_B_RCVBUNDLE_UCODE \
506 /********************************************************/
507 /* CPUSaver micro code for the D101S */
508 /********************************************************/
512 /* Parameter values for the D101S */
513 #define D101S_CPUSAVER_DWORD 78
514 #define D101S_CPUSAVER_BUNDLE_MAX_DWORD 67
515 #define D101S_CPUSAVER_MIN_SIZE_DWORD 129
518 #define D101S_RCVBUNDLE_UCODE \
657 /********************************************************/
658 /* CPUSaver micro code for the D102 B-step */
659 /********************************************************/
664 This version of CPUSaver is different from all others in
665 a different way. It combines the CPUSaver algorithm with
666 fixes for bugs in the B-step hardware (specifically, bugs
667 with Inline Receive).
668 Thus, when CPUSaver is disabled, this micro code image will
669 still need to be loaded. Before this happens, the hit addresses
670 for the CPUSaver algorithm must be set to 0x1FFFF. The hit
671 addresses for CPUSaver are (starting with 0, and remember that
675 /* Parameter values for the D102 B-step */
676 #define D102_B_CPUSAVER_DWORD 91
677 #define D102_B_CPUSAVER_BUNDLE_MAX_DWORD 115
678 #define D102_B_CPUSAVER_MIN_SIZE_DWORD 70
681 #define D102_B_RCVBUNDLE_UCODE \
822 /********************************************************/
823 /* TCO micro code for the D102 B-step */
824 /********************************************************/
829 This version is a fix to TCO bug. This version can be loaded instead
830 the CPUSaver version by modifing the registry key "LoadTcoUCodeInsteadOfCpuSaver"
835 #define D102_B_TCO_UCODE \
975 /********************************************************/
976 /* Micro code for the D102 C-step */
977 /********************************************************/
979 /* Parameter values for the D102 C-step */
980 #define D102_C_CPUSAVER_DWORD 46
981 #define D102_C_CPUSAVER_BUNDLE_MAX_DWORD 54
982 #define D102_C_CPUSAVER_MIN_SIZE_DWORD 133 /* not implemented */
989 // this uCode include the CPU Saver and the TCO work around
992 #define D102_C_RCVBUNDLE_UCODE \