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