2 * Copyright (c) 2002-2008 Sam Leffler, Errno Consulting
3 * Copyright (c) 2002-2006 Atheros Communications, Inc.
5 * Permission to use, copy, modify, and/or distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 * $FreeBSD: head/sys/dev/ath/ath_hal/ar5211/ar5211_phy.c 191022 2009-04-13 21:01:08Z sam $
23 #include "ah_internal.h"
25 #include "ar5211/ar5211.h"
27 /* shorthands to compact tables for readability */
28 #define OFDM IEEE80211_T_OFDM
29 #define CCK IEEE80211_T_CCK
30 #define TURBO IEEE80211_T_TURBO
32 HAL_RATE_TABLE ar5211_11a_table = {
33 8, /* number of rates */
37 /* valid rateCode Preamble dot11Rate Rate */
38 /* 6 Mb */ { AH_TRUE, OFDM, 6000, 0x0b, 0x00, (0x80|12), 0 },
39 /* 9 Mb */ { AH_TRUE, OFDM, 9000, 0x0f, 0x00, 18, 0 },
40 /* 12 Mb */ { AH_TRUE, OFDM, 12000, 0x0a, 0x00, (0x80|24), 2 },
41 /* 18 Mb */ { AH_TRUE, OFDM, 18000, 0x0e, 0x00, 36, 2 },
42 /* 24 Mb */ { AH_TRUE, OFDM, 24000, 0x09, 0x00, (0x80|48), 4 },
43 /* 36 Mb */ { AH_TRUE, OFDM, 36000, 0x0d, 0x00, 72, 4 },
44 /* 48 Mb */ { AH_TRUE, OFDM, 48000, 0x08, 0x00, 96, 4 },
45 /* 54 Mb */ { AH_TRUE, OFDM, 54000, 0x0c, 0x00, 108, 4 }
49 HAL_RATE_TABLE ar5211_turbo_table = {
50 8, /* number of rates */
54 /* valid rateCode Preamble dot11Rate Rate */
55 /* 6 Mb */ { AH_TRUE, TURBO, 12000, 0x0b, 0x00, (0x80|12), 0 },
56 /* 9 Mb */ { AH_TRUE, TURBO, 18000, 0x0f, 0x00, 18, 0 },
57 /* 12 Mb */ { AH_TRUE, TURBO, 24000, 0x0a, 0x00, (0x80|24), 2 },
58 /* 18 Mb */ { AH_TRUE, TURBO, 36000, 0x0e, 0x00, 36, 2 },
59 /* 24 Mb */ { AH_TRUE, TURBO, 48000, 0x09, 0x00, (0x80|48), 4 },
60 /* 36 Mb */ { AH_TRUE, TURBO, 72000, 0x0d, 0x00, 72, 4 },
61 /* 48 Mb */ { AH_TRUE, TURBO, 96000, 0x08, 0x00, 96, 4 },
62 /* 54 Mb */ { AH_TRUE, TURBO, 108000, 0x0c, 0x00, 108, 4 }
66 HAL_RATE_TABLE ar5211_11b_table = {
67 4, /* number of rates */
71 /* valid rateCode Preamble dot11Rate Rate */
72 /* 1 Mb */ { AH_TRUE, CCK, 1000, 0x0b, 0x00, (0x80| 2), 0 },
73 /* 2 Mb */ { AH_TRUE, CCK, 2000, 0x0a, 0x04, (0x80| 4), 1 },
74 /* 5.5 Mb */ { AH_TRUE, CCK, 5500, 0x09, 0x04, (0x80|11), 1 },
75 /* 11 Mb */ { AH_TRUE, CCK, 11000, 0x08, 0x04, (0x80|22), 1 }
84 const HAL_RATE_TABLE *
85 ar5211GetRateTable(struct ath_hal *ah, u_int mode)
90 rt = &ar5211_11a_table;
93 rt = &ar5211_11b_table;
96 rt = &ar5211_turbo_table;
99 HALDEBUG(ah, HAL_DEBUG_ANY, "%s: invalid mode 0x%x\n",
103 ath_hal_setupratetable(ah, rt);