1572ff6f6SMatthew Dillon /*-
2572ff6f6SMatthew Dillon  * Copyright (c) 2005 John Bicket
3572ff6f6SMatthew Dillon  * All rights reserved.
4572ff6f6SMatthew Dillon  *
5572ff6f6SMatthew Dillon  * Redistribution and use in source and binary forms, with or without
6572ff6f6SMatthew Dillon  * modification, are permitted provided that the following conditions
7572ff6f6SMatthew Dillon  * are met:
8572ff6f6SMatthew Dillon  * 1. Redistributions of source code must retain the above copyright
9572ff6f6SMatthew Dillon  *    notice, this list of conditions and the following disclaimer,
10572ff6f6SMatthew Dillon  *    without modification.
11572ff6f6SMatthew Dillon  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12572ff6f6SMatthew Dillon  *    similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any
13572ff6f6SMatthew Dillon  *    redistribution must be conditioned upon including a substantially
14572ff6f6SMatthew Dillon  *    similar Disclaimer requirement for further binary redistribution.
15572ff6f6SMatthew Dillon  * 3. Neither the names of the above-listed copyright holders nor the names
16572ff6f6SMatthew Dillon  *    of any contributors may be used to endorse or promote products derived
17572ff6f6SMatthew Dillon  *    from this software without specific prior written permission.
18572ff6f6SMatthew Dillon  *
19572ff6f6SMatthew Dillon  * Alternatively, this software may be distributed under the terms of the
20572ff6f6SMatthew Dillon  * GNU General Public License ("GPL") version 2 as published by the Free
21572ff6f6SMatthew Dillon  * Software Foundation.
22572ff6f6SMatthew Dillon  *
23572ff6f6SMatthew Dillon  * NO WARRANTY
24572ff6f6SMatthew Dillon  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
25572ff6f6SMatthew Dillon  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
26*df052c2aSSascha Wildner  * LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY
27572ff6f6SMatthew Dillon  * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL
28572ff6f6SMatthew Dillon  * THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY,
29572ff6f6SMatthew Dillon  * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30572ff6f6SMatthew Dillon  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31572ff6f6SMatthew Dillon  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
32572ff6f6SMatthew Dillon  * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33572ff6f6SMatthew Dillon  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
34572ff6f6SMatthew Dillon  * THE POSSIBILITY OF SUCH DAMAGES.
35572ff6f6SMatthew Dillon  *
36572ff6f6SMatthew Dillon  */
37572ff6f6SMatthew Dillon #ifndef	__ATH_RATE_SAMPLE_TXSCHEDULES_H__
38572ff6f6SMatthew Dillon #define	__ATH_RATE_SAMPLE_TXSCHEDULES_H__
39572ff6f6SMatthew Dillon 
40572ff6f6SMatthew Dillon #include <sys/cdefs.h>
41848b370cSMatthew Dillon __FBSDID("$FreeBSD$");
42572ff6f6SMatthew Dillon 
43572ff6f6SMatthew Dillon #define A(_r) \
44572ff6f6SMatthew Dillon     (((_r) == 6)   ? 0 : (((_r) == 9)   ? 1 : (((_r) == 12)  ? 2 : \
45572ff6f6SMatthew Dillon     (((_r) == 18)  ? 3 : (((_r) == 24)  ? 4 : (((_r) == 36)  ? 5 : \
46572ff6f6SMatthew Dillon     (((_r) == 48)  ? 6 : (((_r) == 54)  ? 7 : 0))))))))
47572ff6f6SMatthew Dillon static const struct txschedule series_11a[] = {
48572ff6f6SMatthew Dillon 	{ 3,A( 6), 3,A(  6), 0,A(  6), 0,A( 6) },	/*   6Mb/s */
49572ff6f6SMatthew Dillon 	{ 4,A( 9), 3,A(  6), 4,A(  6), 0,A( 6) },	/*   9Mb/s */
50572ff6f6SMatthew Dillon 	{ 4,A(12), 3,A(  6), 4,A(  6), 0,A( 6) },	/*  12Mb/s */
51572ff6f6SMatthew Dillon 	{ 4,A(18), 3,A( 12), 4,A(  6), 2,A( 6) },	/*  18Mb/s */
52572ff6f6SMatthew Dillon 	{ 4,A(24), 3,A( 18), 4,A( 12), 2,A( 6) },	/*  24Mb/s */
53572ff6f6SMatthew Dillon 	{ 4,A(36), 3,A( 24), 4,A( 18), 2,A( 6) },	/*  36Mb/s */
54572ff6f6SMatthew Dillon 	{ 4,A(48), 3,A( 36), 4,A( 24), 2,A(12) },	/*  48Mb/s */
55572ff6f6SMatthew Dillon 	{ 4,A(54), 3,A( 48), 4,A( 36), 2,A(24) }	/*  54Mb/s */
56572ff6f6SMatthew Dillon };
57572ff6f6SMatthew Dillon 
58572ff6f6SMatthew Dillon #define NA1(_r) \
59572ff6f6SMatthew Dillon 	(((_r) == 6.5)  ? 8 : (((_r) == 13)  ?  9 : (((_r) == 19.5)? 10 : \
60572ff6f6SMatthew Dillon 	(((_r) == 26)  ? 11 : (((_r) == 39)  ? 12 : (((_r) == 52)  ? 13 : \
61572ff6f6SMatthew Dillon 	(((_r) == 58.5)? 14 : (((_r) == 65)  ? 15 : 0))))))))
62572ff6f6SMatthew Dillon #define NA2(_r) \
63572ff6f6SMatthew Dillon 	(((_r) == 13) ? 16 : (((_r) == 26) ? 17 : (((_r) == 39) ? 18 : \
64572ff6f6SMatthew Dillon 	(((_r) == 52) ? 19 : (((_r) == 78) ? 20 : (((_r) == 104)? 21 : \
65572ff6f6SMatthew Dillon 	(((_r) == 117)? 22 : (((_r) == 130)? 23 : 0))))))))
66572ff6f6SMatthew Dillon #define NA3(_r) \
67572ff6f6SMatthew Dillon 	(((_r) == 19.5)  ? 24 : (((_r) == 39) ? 25 : (((_r) == 58.5)  ? 26 : \
68572ff6f6SMatthew Dillon 	(((_r) == 78)  ? 27 : (((_r) == 117) ? 28 : (((_r) == 156) ? 29 : \
69572ff6f6SMatthew Dillon 	(((_r) == 175.5) ? 30 : (((_r) == 195)? 31 : 0))))))))
70572ff6f6SMatthew Dillon static const struct txschedule series_11na[] = {
71572ff6f6SMatthew Dillon 	{ 3,A( 6), 3,A(  6), 0,A(  6), 0,A( 6) },       /*   6Mb/s */
72572ff6f6SMatthew Dillon 	{ 4,A( 9), 3,A(  6), 4,A(  6), 0,A( 6) },       /*   9Mb/s */
73572ff6f6SMatthew Dillon 	{ 4,A(12), 3,A(  6), 4,A(  6), 0,A( 6) },       /*  12Mb/s */
74572ff6f6SMatthew Dillon 	{ 4,A(18), 3,A( 12), 4,A(  6), 2,A( 6) },       /*  18Mb/s */
75572ff6f6SMatthew Dillon 	{ 4,A(24), 3,A( 18), 4,A( 12), 2,A( 6) },       /*  24Mb/s */
76572ff6f6SMatthew Dillon 	{ 4,A(36), 3,A( 24), 4,A( 18), 2,A( 6) },       /*  36Mb/s */
77572ff6f6SMatthew Dillon 	{ 4,A(48), 3,A( 36), 4,A( 24), 2,A(12) },       /*  48Mb/s */
78572ff6f6SMatthew Dillon 	{ 4,A(54), 3,A( 48), 4,A( 36), 2,A(24) },       /*  54Mb/s */
79572ff6f6SMatthew Dillon 
80572ff6f6SMatthew Dillon 	/* 1 stream rates */
81572ff6f6SMatthew Dillon 
82572ff6f6SMatthew Dillon 	{ 3,NA1( 6.5), 3,NA1( 6.5), 0,NA1( 6.5), 0,NA1(6.5) },  /* 6.5Mb/s */
83572ff6f6SMatthew Dillon 	{ 4,NA1(  13), 3,NA1( 6.5), 4,NA1( 6.5), 0,NA1(6.5) },  /*  13Mb/s */
84572ff6f6SMatthew Dillon 	{ 4,NA1(19.5), 3,NA1( 6.5), 4,NA1( 6.5), 0,NA1(6.5) },  /*19.5Mb/s */
85572ff6f6SMatthew Dillon 	{ 4,NA1(  26), 3,NA1(19.5), 4,NA1( 6.5), 2,NA1(6.5) },  /*  26Mb/s */
86572ff6f6SMatthew Dillon 	{ 4,NA1(  39), 3,NA1(  26), 4,NA1(19.5), 2,NA1(6.5) },  /*  39Mb/s */
87572ff6f6SMatthew Dillon 	{ 4,NA1(  52), 3,NA1(  39), 4,NA1(  26), 2,NA1(6.5) },  /*  52Mb/s */
88572ff6f6SMatthew Dillon 	{ 4,NA1(58.5), 3,NA1(  52), 4,NA1(  39), 2,NA1( 13) },  /*58.5Mb/s */
89572ff6f6SMatthew Dillon 	{ 4,NA1(  65), 3,NA1(58.5), 4,NA1(  52), 2,NA1( 13) },  /*  65Mb/s */
90572ff6f6SMatthew Dillon 
91572ff6f6SMatthew Dillon 	/* 2 stream rates */
92572ff6f6SMatthew Dillon 
93572ff6f6SMatthew Dillon 	{ 3,NA2(  13), 3,NA2(  13), 0,NA2(  13), 0,NA2( 13) },  /*  13Mb/s */
94572ff6f6SMatthew Dillon 	{ 4,NA2(  26), 3,NA2(  13), 4,NA2(  13), 0,NA2( 13) },  /*  26Mb/s */
95572ff6f6SMatthew Dillon 	{ 4,NA2(  39), 3,NA2(  26), 4,NA2(  13), 2,NA2( 13) },  /*  39Mb/s */
96572ff6f6SMatthew Dillon 	{ 4,NA2(  52), 3,NA2(  39), 4,NA2(  26), 2,NA2( 13) },  /*  52Mb/s */
97572ff6f6SMatthew Dillon 	{ 4,NA2(  78), 3,NA2(  52), 4,NA2(  39), 2,NA2( 13) },  /*  78Mb/s */
98572ff6f6SMatthew Dillon 	{ 4,NA2( 104), 3,NA2(  78), 4,NA2(  52), 2,NA2( 13) },  /* 104Mb/s */
99572ff6f6SMatthew Dillon 	{ 4,NA2( 117), 3,NA2( 104), 4,NA2(  78), 2,NA2( 26) },  /* 117Mb/s */
100572ff6f6SMatthew Dillon 	{ 4,NA2( 130), 3,NA2( 117), 4,NA2( 104), 2,NA2( 26) },   /* 130Mb/s */
101572ff6f6SMatthew Dillon 
102572ff6f6SMatthew Dillon 	/* 3 stream rates */
103572ff6f6SMatthew Dillon 
104572ff6f6SMatthew Dillon 	{ 3,NA3(19.5), 3,NA3(19.5), 0,NA3(19.5), 0,NA3(19.5) },  /*  19Mb/s */
105572ff6f6SMatthew Dillon 	{ 3,NA3(  39), 3,NA3(19.5), 0,NA3(19.5), 0,NA3(19.5) },  /*  39Mb/s */
106572ff6f6SMatthew Dillon 	{ 3,NA3(58.5), 3,NA3(  39), 0,NA3(19.5), 0,NA3(19.5) },  /*  58Mb/s */
107572ff6f6SMatthew Dillon 	{ 3,NA3(  78), 3,NA3(58.5), 0,NA3(  39), 0,NA3(19.5) },  /*  78Mb/s */
108572ff6f6SMatthew Dillon 	{ 3,NA3( 117), 3,NA3(  78), 0,NA3(58.5), 0,NA3(19.5) },  /* 117Mb/s */
109572ff6f6SMatthew Dillon 	{ 3,NA3( 156), 3,NA3( 117), 0,NA3(  78), 0,NA3(19.5) },  /*  156Mb/s */
110572ff6f6SMatthew Dillon 	{ 3,NA3(175.5), 3,NA3( 156), 0,NA3( 117), 0,NA3(  39) },  /*  175Mb/s */
111572ff6f6SMatthew Dillon 	{ 3,NA3( 195), 3,NA3( 195), 0,NA3( 156), 0,NA3(58.5) },  /* 195Mb/s */
112572ff6f6SMatthew Dillon };
113572ff6f6SMatthew Dillon #undef A
114572ff6f6SMatthew Dillon #undef NA3
115572ff6f6SMatthew Dillon #undef NA2
116572ff6f6SMatthew Dillon #undef NA1
117572ff6f6SMatthew Dillon 
118572ff6f6SMatthew Dillon #define G(_r) \
119572ff6f6SMatthew Dillon     (((_r) == 1)   ? 0 : (((_r) == 2)   ? 1 : (((_r) == 5.5) ? 2 : \
120572ff6f6SMatthew Dillon     (((_r) == 11)  ? 3 : (((_r) == 6)   ? 4 : (((_r) == 9)   ? 5 : \
121572ff6f6SMatthew Dillon     (((_r) == 12)  ? 6 : (((_r) == 18)  ? 7 : (((_r) == 24)  ? 8 : \
122572ff6f6SMatthew Dillon     (((_r) == 36)  ? 9 : (((_r) == 48)  ? 10 : (((_r) == 54)  ? 11 : 0))))))))))))
123572ff6f6SMatthew Dillon static const struct txschedule series_11g[] = {
124572ff6f6SMatthew Dillon 	{ 3,G( 1), 3,G(  1), 0,G(  1), 0,G( 1) },	/*   1Mb/s */
125572ff6f6SMatthew Dillon 	{ 4,G( 2), 3,G(  1), 4,G(  1), 0,G( 1) },	/*   2Mb/s */
126572ff6f6SMatthew Dillon 	{ 4,G(5.5),3,G(  2), 4,G(  1), 2,G( 1) },	/* 5.5Mb/s */
127572ff6f6SMatthew Dillon 	{ 4,G(11), 3,G(5.5), 4,G(  2), 2,G( 1) },	/*  11Mb/s */
128572ff6f6SMatthew Dillon 	{ 4,G( 6), 3,G(5.5), 4,G(  2), 2,G( 1) },	/*   6Mb/s */
129572ff6f6SMatthew Dillon 	{ 4,G( 9), 3,G(  6), 4,G(5.5), 2,G( 1) },	/*   9Mb/s */
130572ff6f6SMatthew Dillon 	{ 4,G(12), 3,G( 11), 4,G(5.5), 2,G( 1) },	/*  12Mb/s */
131572ff6f6SMatthew Dillon 	{ 4,G(18), 3,G( 12), 4,G( 11), 2,G( 1) },	/*  18Mb/s */
132572ff6f6SMatthew Dillon 	{ 4,G(24), 3,G( 18), 4,G( 12), 2,G( 1) },	/*  24Mb/s */
133572ff6f6SMatthew Dillon 	{ 4,G(36), 3,G( 24), 4,G( 18), 2,G( 1) },	/*  36Mb/s */
134572ff6f6SMatthew Dillon 	{ 4,G(48), 3,G( 36), 4,G( 24), 2,G( 1) },	/*  48Mb/s */
135572ff6f6SMatthew Dillon 	{ 4,G(54), 3,G( 48), 4,G( 36), 2,G( 1) }	/*  54Mb/s */
136572ff6f6SMatthew Dillon };
137572ff6f6SMatthew Dillon 
138572ff6f6SMatthew Dillon #define NG1(_r) \
139572ff6f6SMatthew Dillon 	(((_r) == 6.5) ? 12 : (((_r) == 13) ? 13 : (((_r) == 19.5)? 14 : \
140572ff6f6SMatthew Dillon 	(((_r) == 26)  ? 15 : (((_r) == 39) ? 16 : (((_r) == 52)  ? 17 : \
141572ff6f6SMatthew Dillon 	(((_r) == 58.5)? 18 : (((_r) == 65) ? 19 : 0))))))))
142572ff6f6SMatthew Dillon #define NG2(_r) \
143572ff6f6SMatthew Dillon 	(((_r) == 13)  ? 20 : (((_r) == 26) ? 21 : (((_r) == 39)  ? 22 : \
144572ff6f6SMatthew Dillon 	(((_r) == 52)  ? 23 : (((_r) == 78) ? 24 : (((_r) == 104) ? 25 : \
145572ff6f6SMatthew Dillon 	(((_r) == 117) ? 26 : (((_r) == 130)? 27 : 0))))))))
146572ff6f6SMatthew Dillon #define NG3(_r) \
147572ff6f6SMatthew Dillon 	(((_r) == 19.5)  ? 28 : (((_r) == 39) ? 29 : (((_r) == 58.5)  ? 30 : \
148572ff6f6SMatthew Dillon 	(((_r) == 78)  ? 31 : (((_r) == 117) ? 32 : (((_r) == 156) ? 33 : \
149572ff6f6SMatthew Dillon 	(((_r) == 175.5) ? 34 : (((_r) == 195)? 35 : 0))))))))
150572ff6f6SMatthew Dillon 
151572ff6f6SMatthew Dillon static const struct txschedule series_11ng[] = {
152572ff6f6SMatthew Dillon 	{ 3,G( 1), 3,G(  1), 0,G(  1), 0,G( 1) },       /*   1Mb/s */
153572ff6f6SMatthew Dillon 	{ 4,G( 2), 3,G(  1), 4,G(  1), 0,G( 1) },       /*   2Mb/s */
154572ff6f6SMatthew Dillon 	{ 4,G(5.5),3,G(  2), 4,G(  1), 2,G( 1) },       /* 5.5Mb/s */
155572ff6f6SMatthew Dillon 	{ 4,G(11), 3,G(5.5), 4,G(  2), 2,G( 1) },       /*  11Mb/s */
156572ff6f6SMatthew Dillon 	{ 4,G( 6), 3,G(5.5), 4,G(  2), 2,G( 1) },       /*   6Mb/s */
157572ff6f6SMatthew Dillon 	{ 4,G( 9), 3,G(  6), 4,G(5.5), 2,G( 1) },       /*   9Mb/s */
158572ff6f6SMatthew Dillon 	{ 4,G(12), 3,G( 11), 4,G(5.5), 2,G( 1) },       /*  12Mb/s */
159572ff6f6SMatthew Dillon 	{ 4,G(18), 3,G( 12), 4,G( 11), 2,G( 1) },       /*  18Mb/s */
160572ff6f6SMatthew Dillon 	{ 4,G(24), 3,G( 18), 4,G( 12), 2,G( 1) },       /*  24Mb/s */
161572ff6f6SMatthew Dillon 	{ 4,G(36), 3,G( 24), 4,G( 18), 2,G( 1) },       /*  36Mb/s */
162572ff6f6SMatthew Dillon 	{ 4,G(48), 3,G( 36), 4,G( 24), 2,G( 1) },       /*  48Mb/s */
163572ff6f6SMatthew Dillon 	{ 4,G(54), 3,G( 48), 4,G( 36), 2,G( 1) },       /*  54Mb/s */
164572ff6f6SMatthew Dillon 
165572ff6f6SMatthew Dillon 	/* 1 stream rates */
166572ff6f6SMatthew Dillon 
167572ff6f6SMatthew Dillon 	{ 3,NG1( 6.5), 3,NG1( 6.5), 0,NG1( 6.5), 0,NG1(6.5) },  /* 6.5Mb/s */
168572ff6f6SMatthew Dillon 	{ 4,NG1(  13), 3,NG1( 6.5), 4,NG1( 6.5), 0,NG1(6.5) },  /*  13Mb/s */
169572ff6f6SMatthew Dillon 	{ 4,NG1(19.5), 3,NG1( 6.5), 4,NG1( 6.5), 0,NG1(6.5) },  /*19.5Mb/s */
170572ff6f6SMatthew Dillon 	{ 4,NG1(  26), 3,NG1(19.5), 4,NG1( 6.5), 2,NG1(6.5) },  /*  26Mb/s */
171572ff6f6SMatthew Dillon 	{ 4,NG1(  39), 3,NG1(  26), 4,NG1(19.5), 2,NG1(6.5) },  /*  39Mb/s */
172572ff6f6SMatthew Dillon 	{ 4,NG1(  52), 3,NG1(  39), 4,NG1(  26), 2,NG1(6.5) },  /*  52Mb/s */
173572ff6f6SMatthew Dillon 	{ 4,NG1(58.5), 3,NG1(  52), 4,NG1(  39), 2,NG1( 13) },  /*58.5Mb/s */
174572ff6f6SMatthew Dillon 	{ 4,NG1(  65), 3,NG1(58.5), 4,NG1(  52), 2,NG1( 13) },  /*  65Mb/s */
175572ff6f6SMatthew Dillon 
176572ff6f6SMatthew Dillon 	/* 2 stream rates */
177572ff6f6SMatthew Dillon 
178572ff6f6SMatthew Dillon 	{ 3,NG2(  13), 3,NG2(  13), 0,NG2(  13), 0,NG2( 13) },  /*  13Mb/s */
179572ff6f6SMatthew Dillon 	{ 4,NG2(  26), 3,NG2(  13), 4,NG2(  13), 0,NG2( 13) },  /*  26Mb/s */
180572ff6f6SMatthew Dillon 	{ 4,NG2(  39), 3,NG2(  26), 4,NG2(  13), 2,NG2( 13) },  /*  39Mb/s */
181572ff6f6SMatthew Dillon 	{ 4,NG2(  52), 3,NG2(  39), 4,NG2(  26), 2,NG2( 13) },  /*  52Mb/s */
182572ff6f6SMatthew Dillon 	{ 4,NG2(  78), 3,NG2(  52), 4,NG2(  39), 2,NG2( 13) },  /*  78Mb/s */
183572ff6f6SMatthew Dillon 	{ 4,NG2( 104), 3,NG2(  78), 4,NG2(  52), 2,NG2( 13) },  /* 104Mb/s */
184572ff6f6SMatthew Dillon 	{ 4,NG2( 117), 3,NG2( 104), 4,NG2(  78), 2,NG2( 26) },  /* 117Mb/s */
185572ff6f6SMatthew Dillon 	{ 4,NG2( 130), 3,NG2( 117), 4,NG2( 104), 2,NG2( 26) },  /* 130Mb/s */
186572ff6f6SMatthew Dillon 
187572ff6f6SMatthew Dillon 	/* 3 stream rates */
188572ff6f6SMatthew Dillon 
189572ff6f6SMatthew Dillon 	{ 3,NG3(19.5), 3,NG3(19.5), 0,NG3(19.5), 0,NG3(19.5) },  /*  19Mb/s */
190572ff6f6SMatthew Dillon 	{ 3,NG3(  39), 3,NG3(19.5), 0,NG3(19.5), 0,NG3(19.5) },  /*  39Mb/s */
191572ff6f6SMatthew Dillon 	{ 3,NG3(58.5), 3,NG3(  39), 0,NG3(19.5), 0,NG3(19.5) },  /*  58Mb/s */
192572ff6f6SMatthew Dillon 	{ 3,NG3(  78), 3,NG3(58.5), 0,NG3(  39), 0,NG3(19.5) },  /*  78Mb/s */
193572ff6f6SMatthew Dillon 	{ 3,NG3( 117), 3,NG3(  78), 0,NG3(58.5), 0,NG3(19.5) },  /* 117Mb/s */
194572ff6f6SMatthew Dillon 	{ 3,NG3( 156), 3,NG3( 117), 0,NG3(  78), 0,NG3(19.5) },  /*  156Mb/s */
195572ff6f6SMatthew Dillon 	{ 3,NG3(175.5), 3,NG3( 156), 0,NG3( 117), 0,NG3(  39) },  /*  175Mb/s */
196572ff6f6SMatthew Dillon 	{ 3,NG3( 195), 3,NG3( 195), 0,NG3( 156), 0,NG3(58.5) },  /* 195Mb/s */
197572ff6f6SMatthew Dillon 
198572ff6f6SMatthew Dillon };
199572ff6f6SMatthew Dillon #undef G
200572ff6f6SMatthew Dillon #undef NG3
201572ff6f6SMatthew Dillon #undef NG2
202572ff6f6SMatthew Dillon #undef NG1
203572ff6f6SMatthew Dillon 
204572ff6f6SMatthew Dillon #define H(_r) \
205572ff6f6SMatthew Dillon     (((_r) == 3)   ? 0 : (((_r) == 4.5) ? 1 : (((_r) == 6)  ? 2 : \
206572ff6f6SMatthew Dillon     (((_r) == 9)   ? 3 : (((_r) == 12)  ? 4 : (((_r) == 18) ? 5 : \
207572ff6f6SMatthew Dillon     (((_r) == 24)  ? 6 : (((_r) == 27)  ? 7 : 0))))))))
208572ff6f6SMatthew Dillon static const struct txschedule series_half[] = {
209572ff6f6SMatthew Dillon 	{ 3,H( 3), 3,H(  3), 0,H(  3), 0,H( 3) },	/*   3Mb/s */
210572ff6f6SMatthew Dillon 	{ 4,H(4.5),3,H(  3), 4,H(  3), 0,H( 3) },	/* 4.5Mb/s */
211572ff6f6SMatthew Dillon 	{ 4,H( 6), 3,H(  3), 4,H(  3), 0,H( 3) },	/*   6Mb/s */
212572ff6f6SMatthew Dillon 	{ 4,H( 9), 3,H(  6), 4,H(  3), 2,H( 3) },	/*   9Mb/s */
213572ff6f6SMatthew Dillon 	{ 4,H(12), 3,H(  9), 4,H(  6), 2,H( 3) },	/*  12Mb/s */
214572ff6f6SMatthew Dillon 	{ 4,H(18), 3,H( 12), 4,H(  9), 2,H( 3) },	/*  18Mb/s */
215572ff6f6SMatthew Dillon 	{ 4,H(24), 3,H( 18), 4,H( 12), 2,H( 6) },	/*  24Mb/s */
216572ff6f6SMatthew Dillon 	{ 4,H(27), 3,H( 24), 4,H( 18), 2,H(12) }	/*  27Mb/s */
217572ff6f6SMatthew Dillon };
218572ff6f6SMatthew Dillon #undef H
219572ff6f6SMatthew Dillon 
220572ff6f6SMatthew Dillon #ifdef Q
221572ff6f6SMatthew Dillon #undef Q
222572ff6f6SMatthew Dillon #endif
223572ff6f6SMatthew Dillon #define Q(_r) \
224572ff6f6SMatthew Dillon     (((_r) == 1.5) ? 0 : (((_r) ==2.25) ? 1 : (((_r) == 3)  ? 2 : \
225572ff6f6SMatthew Dillon     (((_r) == 4.5) ? 3 : (((_r) ==  6)  ? 4 : (((_r) == 9)  ? 5 : \
226572ff6f6SMatthew Dillon     (((_r) == 12)  ? 6 : (((_r) == 13.5)? 7 : 0))))))))
227572ff6f6SMatthew Dillon static const struct txschedule series_quarter[] = {
228572ff6f6SMatthew Dillon 	{ 3,Q( 1.5),3,Q(1.5), 0,Q(1.5), 0,Q(1.5) },	/* 1.5Mb/s */
229572ff6f6SMatthew Dillon 	{ 4,Q(2.25),3,Q(1.5), 4,Q(1.5), 0,Q(1.5) },	/*2.25Mb/s */
230572ff6f6SMatthew Dillon 	{ 4,Q(   3),3,Q(1.5), 4,Q(1.5), 0,Q(1.5) },	/*   3Mb/s */
231572ff6f6SMatthew Dillon 	{ 4,Q( 4.5),3,Q(  3), 4,Q(1.5), 2,Q(1.5) },	/* 4.5Mb/s */
232572ff6f6SMatthew Dillon 	{ 4,Q(   6),3,Q(4.5), 4,Q(  3), 2,Q(1.5) },	/*   6Mb/s */
233572ff6f6SMatthew Dillon 	{ 4,Q(   9),3,Q(  6), 4,Q(4.5), 2,Q(1.5) },	/*   9Mb/s */
234572ff6f6SMatthew Dillon 	{ 4,Q(  12),3,Q(  9), 4,Q(  6), 2,Q(  3) },	/*  12Mb/s */
235572ff6f6SMatthew Dillon 	{ 4,Q(13.5),3,Q( 12), 4,Q(  9), 2,Q(  6) }	/*13.5Mb/s */
236572ff6f6SMatthew Dillon };
237572ff6f6SMatthew Dillon #undef Q
238572ff6f6SMatthew Dillon 
239572ff6f6SMatthew Dillon #endif
240