2 * Copyright (c) 2010 Broadcom Corporation
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18 #include "phytbl_lcn.h"
20 static const u32 dot11lcn_gain_tbl_rev0
[] = {
119 static const u32 dot11lcn_gain_tbl_rev1
[] = {
218 static const u16 dot11lcn_aux_gain_idx_tbl_rev0
[] = {
259 static const u32 dot11lcn_gain_idx_tbl_rev0
[] = {
410 static const u16 dot11lcn_aux_gain_idx_tbl_2G
[] = {
451 static const u8 dot11lcn_gain_val_tbl_2G
[] = {
522 static const u32 dot11lcn_gain_idx_tbl_2G
[] = {
677 static const u32 dot11lcn_gain_tbl_2G
[] = {
776 static const u32 dot11lcn_gain_tbl_extlna_2G
[] = {
875 static const u16 dot11lcn_aux_gain_idx_tbl_extlna_2G
[] = {
916 static const u8 dot11lcn_gain_val_tbl_extlna_2G
[] = {
987 static const u32 dot11lcn_gain_idx_tbl_extlna_2G
[] = {
1142 static const u32 dot11lcn_aux_gain_idx_tbl_5G
[] = {
1183 static const u32 dot11lcn_gain_val_tbl_5G
[] = {
1254 static const u32 dot11lcn_gain_idx_tbl_5G
[] = {
1409 static const u32 dot11lcn_gain_tbl_5G
[] = {
1508 const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev0
[] = {
1509 {&dot11lcn_gain_tbl_rev0
,
1510 ARRAY_SIZE(dot11lcn_gain_tbl_rev0
), 18,
1513 {&dot11lcn_aux_gain_idx_tbl_rev0
,
1514 ARRAY_SIZE(dot11lcn_aux_gain_idx_tbl_rev0
), 14, 0, 16}
1516 {&dot11lcn_gain_idx_tbl_rev0
,
1517 ARRAY_SIZE(dot11lcn_gain_idx_tbl_rev0
), 13, 0, 32}
1521 static const struct phytbl_info dot11lcnphytbl_rx_gain_info_rev1
[] = {
1522 {&dot11lcn_gain_tbl_rev1
,
1523 ARRAY_SIZE(dot11lcn_gain_tbl_rev1
), 18,
1526 {&dot11lcn_aux_gain_idx_tbl_rev0
,
1527 ARRAY_SIZE(dot11lcn_aux_gain_idx_tbl_rev0
), 14, 0, 16}
1529 {&dot11lcn_gain_idx_tbl_rev0
,
1530 ARRAY_SIZE(dot11lcn_gain_idx_tbl_rev0
), 13, 0, 32}
1534 const struct phytbl_info dot11lcnphytbl_rx_gain_info_2G_rev2
[] = {
1535 {&dot11lcn_gain_tbl_2G
,
1536 ARRAY_SIZE(dot11lcn_gain_tbl_2G
), 18, 0,
1539 {&dot11lcn_aux_gain_idx_tbl_2G
,
1540 ARRAY_SIZE(dot11lcn_aux_gain_idx_tbl_2G
), 14, 0, 16}
1542 {&dot11lcn_gain_idx_tbl_2G
,
1543 ARRAY_SIZE(dot11lcn_gain_idx_tbl_2G
),
1546 {&dot11lcn_gain_val_tbl_2G
,
1547 ARRAY_SIZE(dot11lcn_gain_val_tbl_2G
),
1551 const struct phytbl_info dot11lcnphytbl_rx_gain_info_5G_rev2
[] = {
1552 {&dot11lcn_gain_tbl_5G
,
1553 ARRAY_SIZE(dot11lcn_gain_tbl_5G
), 18, 0,
1556 {&dot11lcn_aux_gain_idx_tbl_5G
,
1557 ARRAY_SIZE(dot11lcn_aux_gain_idx_tbl_5G
), 14, 0, 16}
1559 {&dot11lcn_gain_idx_tbl_5G
,
1560 ARRAY_SIZE(dot11lcn_gain_idx_tbl_5G
),
1563 {&dot11lcn_gain_val_tbl_5G
,
1564 ARRAY_SIZE(dot11lcn_gain_val_tbl_5G
),
1568 const struct phytbl_info dot11lcnphytbl_rx_gain_info_extlna_2G_rev2
[] = {
1569 {&dot11lcn_gain_tbl_extlna_2G
,
1570 ARRAY_SIZE(dot11lcn_gain_tbl_extlna_2G
), 18, 0, 32}
1572 {&dot11lcn_aux_gain_idx_tbl_extlna_2G
,
1573 ARRAY_SIZE(dot11lcn_aux_gain_idx_tbl_extlna_2G
), 14, 0, 16}
1575 {&dot11lcn_gain_idx_tbl_extlna_2G
,
1576 ARRAY_SIZE(dot11lcn_gain_idx_tbl_extlna_2G
), 13, 0, 32}
1578 {&dot11lcn_gain_val_tbl_extlna_2G
,
1579 ARRAY_SIZE(dot11lcn_gain_val_tbl_extlna_2G
), 17, 0, 8}
1582 const struct phytbl_info dot11lcnphytbl_rx_gain_info_extlna_5G_rev2
[] = {
1583 {&dot11lcn_gain_tbl_5G
,
1584 ARRAY_SIZE(dot11lcn_gain_tbl_5G
), 18, 0,
1587 {&dot11lcn_aux_gain_idx_tbl_5G
,
1588 ARRAY_SIZE(dot11lcn_aux_gain_idx_tbl_5G
), 14, 0, 16}
1590 {&dot11lcn_gain_idx_tbl_5G
,
1591 ARRAY_SIZE(dot11lcn_gain_idx_tbl_5G
),
1594 {&dot11lcn_gain_val_tbl_5G
,
1595 ARRAY_SIZE(dot11lcn_gain_val_tbl_5G
),
1599 const u32 dot11lcnphytbl_rx_gain_info_sz_rev0
=
1600 ARRAY_SIZE(dot11lcnphytbl_rx_gain_info_rev0
);
1602 const u32 dot11lcnphytbl_rx_gain_info_2G_rev2_sz
=
1603 ARRAY_SIZE(dot11lcnphytbl_rx_gain_info_2G_rev2
);
1605 const u32 dot11lcnphytbl_rx_gain_info_5G_rev2_sz
=
1606 ARRAY_SIZE(dot11lcnphytbl_rx_gain_info_5G_rev2
);
1608 static const u16 dot11lcn_min_sig_sq_tbl_rev0
[] = {
1675 static const u16 dot11lcn_noise_scale_tbl_rev0
[] = {
1742 static const u32 dot11lcn_fltr_ctrl_tbl_rev0
[] = {
1755 static const u32 dot11lcn_ps_ctrl_tbl_rev0
[] = {
1778 static const u16 dot11lcn_sw_ctrl_tbl_4313_epa_rev0_combo
[] = {
1846 static const u16 dot11lcn_sw_ctrl_tbl_4313_bt_epa_p250_rev0
[] = {
1913 static const u16 dot11lcn_sw_ctrl_tbl_4313_epa_rev0
[] = {
1980 static const u16 dot11lcn_sw_ctrl_tbl_4313_rev0
[] = {
2047 static const u16 dot11lcn_sw_ctrl_tbl_4313_ipa_rev0_combo
[] = {
2114 static const u16 dot11lcn_sw_ctrl_tbl_rev0
[] = {
2181 static const u8 dot11lcn_nf_table_rev0
[] = {
2200 static const u8 dot11lcn_gain_val_tbl_rev0
[] = {
2263 static const u8 dot11lcn_spur_tbl_rev0
[] = {
2394 static const u16 dot11lcn_unsup_mcs_tbl_rev0
[] = {
2551 static const u16 dot11lcn_iq_local_tbl_rev0
[] = {
2662 static const u32 dot11lcn_papd_compdelta_tbl_rev0
[] = {
2825 const struct phytbl_info dot11lcnphytbl_info_rev0
[] = {
2826 {&dot11lcn_min_sig_sq_tbl_rev0
,
2827 ARRAY_SIZE(dot11lcn_min_sig_sq_tbl_rev0
), 2, 0, 16}
2829 {&dot11lcn_noise_scale_tbl_rev0
,
2830 ARRAY_SIZE(dot11lcn_noise_scale_tbl_rev0
), 1, 0, 16}
2832 {&dot11lcn_fltr_ctrl_tbl_rev0
,
2833 ARRAY_SIZE(dot11lcn_fltr_ctrl_tbl_rev0
), 11, 0, 32}
2835 {&dot11lcn_ps_ctrl_tbl_rev0
,
2836 ARRAY_SIZE(dot11lcn_ps_ctrl_tbl_rev0
), 12, 0, 32}
2838 {&dot11lcn_gain_idx_tbl_rev0
,
2839 ARRAY_SIZE(dot11lcn_gain_idx_tbl_rev0
), 13, 0, 32}
2841 {&dot11lcn_aux_gain_idx_tbl_rev0
,
2842 ARRAY_SIZE(dot11lcn_aux_gain_idx_tbl_rev0
), 14, 0, 16}
2844 {&dot11lcn_sw_ctrl_tbl_rev0
,
2845 ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_rev0
), 15, 0, 16}
2847 {&dot11lcn_nf_table_rev0
,
2848 ARRAY_SIZE(dot11lcn_nf_table_rev0
), 16,
2851 {&dot11lcn_gain_val_tbl_rev0
,
2852 ARRAY_SIZE(dot11lcn_gain_val_tbl_rev0
), 17, 0, 8}
2854 {&dot11lcn_gain_tbl_rev0
,
2855 ARRAY_SIZE(dot11lcn_gain_tbl_rev0
), 18,
2858 {&dot11lcn_spur_tbl_rev0
,
2859 ARRAY_SIZE(dot11lcn_spur_tbl_rev0
), 20,
2862 {&dot11lcn_unsup_mcs_tbl_rev0
,
2863 ARRAY_SIZE(dot11lcn_unsup_mcs_tbl_rev0
), 23, 0, 16}
2865 {&dot11lcn_iq_local_tbl_rev0
,
2866 ARRAY_SIZE(dot11lcn_iq_local_tbl_rev0
), 0, 0, 16}
2868 {&dot11lcn_papd_compdelta_tbl_rev0
,
2869 ARRAY_SIZE(dot11lcn_papd_compdelta_tbl_rev0
), 24, 0, 32}
2873 const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313
= {
2874 &dot11lcn_sw_ctrl_tbl_4313_rev0
,
2875 ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_rev0
), 15, 0, 16
2878 const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_ipa
= {
2879 &dot11lcn_sw_ctrl_tbl_4313_ipa_rev0_combo
,
2880 ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_ipa_rev0_combo
), 15, 0, 16
2883 const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_epa
= {
2884 &dot11lcn_sw_ctrl_tbl_4313_epa_rev0
,
2885 ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_epa_rev0
), 15, 0, 16
2888 const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa
= {
2889 &dot11lcn_sw_ctrl_tbl_4313_epa_rev0_combo
,
2890 ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_epa_rev0_combo
), 15, 0, 16
2893 const struct phytbl_info dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250
= {
2894 &dot11lcn_sw_ctrl_tbl_4313_bt_epa_p250_rev0
,
2895 ARRAY_SIZE(dot11lcn_sw_ctrl_tbl_4313_bt_epa_p250_rev0
), 15, 0, 16
2898 const u32 dot11lcnphytbl_info_sz_rev0
=
2899 ARRAY_SIZE(dot11lcnphytbl_info_rev0
);
2901 const struct lcnphy_tx_gain_tbl_entry
2902 dot11lcnphy_2GHz_extPA_gaintable_rev0
[128] = {
3033 const struct lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_gaintable_rev0
[128] = {
3164 const struct lcnphy_tx_gain_tbl_entry dot11lcnphy_5GHz_gaintable_rev0
[128] = {
3165 {255, 255, 0xf0, 0, 152},
3166 {255, 255, 0xf0, 0, 147},
3167 {255, 255, 0xf0, 0, 143},
3168 {255, 255, 0xf0, 0, 139},
3169 {255, 255, 0xf0, 0, 135},
3170 {255, 255, 0xf0, 0, 131},
3171 {255, 255, 0xf0, 0, 128},
3172 {255, 255, 0xf0, 0, 124},
3173 {255, 255, 0xf0, 0, 121},
3174 {255, 255, 0xf0, 0, 117},
3175 {255, 255, 0xf0, 0, 114},
3176 {255, 255, 0xf0, 0, 111},
3177 {255, 255, 0xf0, 0, 107},
3178 {255, 255, 0xf0, 0, 104},
3179 {255, 255, 0xf0, 0, 101},
3180 {255, 255, 0xf0, 0, 99},
3181 {255, 255, 0xf0, 0, 96},
3182 {255, 255, 0xf0, 0, 93},
3183 {255, 255, 0xf0, 0, 90},
3184 {255, 255, 0xf0, 0, 88},
3185 {255, 255, 0xf0, 0, 85},
3186 {255, 255, 0xf0, 0, 83},
3187 {255, 255, 0xf0, 0, 81},
3188 {255, 255, 0xf0, 0, 78},
3189 {255, 255, 0xf0, 0, 76},
3190 {255, 255, 0xf0, 0, 74},
3191 {255, 255, 0xf0, 0, 72},
3192 {255, 255, 0xf0, 0, 70},
3193 {255, 255, 0xf0, 0, 68},
3194 {255, 255, 0xf0, 0, 66},
3195 {255, 255, 0xf0, 0, 64},
3196 {255, 248, 0xf0, 0, 64},
3197 {255, 241, 0xf0, 0, 64},
3198 {255, 251, 0xe0, 0, 64},
3199 {255, 244, 0xe0, 0, 64},
3200 {255, 254, 0xd0, 0, 64},
3201 {255, 246, 0xd0, 0, 64},
3202 {255, 239, 0xd0, 0, 64},
3203 {255, 249, 0xc0, 0, 64},
3204 {255, 242, 0xc0, 0, 64},
3205 {255, 255, 0xb0, 0, 64},
3206 {255, 248, 0xb0, 0, 64},
3207 {255, 241, 0xb0, 0, 64},
3208 {255, 254, 0xa0, 0, 64},
3209 {255, 246, 0xa0, 0, 64},
3210 {255, 239, 0xa0, 0, 64},
3211 {255, 255, 0x90, 0, 64},
3212 {255, 248, 0x90, 0, 64},
3213 {255, 241, 0x90, 0, 64},
3214 {255, 234, 0x90, 0, 64},
3215 {255, 255, 0x80, 0, 64},
3216 {255, 248, 0x80, 0, 64},
3217 {255, 241, 0x80, 0, 64},
3218 {255, 234, 0x80, 0, 64},
3219 {255, 255, 0x70, 0, 64},
3220 {255, 248, 0x70, 0, 64},
3221 {255, 241, 0x70, 0, 64},
3222 {255, 234, 0x70, 0, 64},
3223 {255, 227, 0x70, 0, 64},
3224 {255, 221, 0x70, 0, 64},
3225 {255, 215, 0x70, 0, 64},
3226 {255, 208, 0x70, 0, 64},
3227 {255, 203, 0x70, 0, 64},
3228 {255, 197, 0x70, 0, 64},
3229 {255, 255, 0x60, 0, 64},
3230 {255, 248, 0x60, 0, 64},
3231 {255, 241, 0x60, 0, 64},
3232 {255, 234, 0x60, 0, 64},
3233 {255, 227, 0x60, 0, 64},
3234 {255, 221, 0x60, 0, 64},
3235 {255, 255, 0x50, 0, 64},
3236 {255, 248, 0x50, 0, 64},
3237 {255, 241, 0x50, 0, 64},
3238 {255, 234, 0x50, 0, 64},
3239 {255, 227, 0x50, 0, 64},
3240 {255, 221, 0x50, 0, 64},
3241 {255, 215, 0x50, 0, 64},
3242 {255, 208, 0x50, 0, 64},
3243 {255, 255, 0x40, 0, 64},
3244 {255, 248, 0x40, 0, 64},
3245 {255, 241, 0x40, 0, 64},
3246 {255, 234, 0x40, 0, 64},
3247 {255, 227, 0x40, 0, 64},
3248 {255, 221, 0x40, 0, 64},
3249 {255, 215, 0x40, 0, 64},
3250 {255, 208, 0x40, 0, 64},
3251 {255, 203, 0x40, 0, 64},
3252 {255, 197, 0x40, 0, 64},
3253 {255, 255, 0x30, 0, 64},
3254 {255, 248, 0x30, 0, 64},
3255 {255, 241, 0x30, 0, 64},
3256 {255, 234, 0x30, 0, 64},
3257 {255, 227, 0x30, 0, 64},
3258 {255, 221, 0x30, 0, 64},
3259 {255, 215, 0x30, 0, 64},
3260 {255, 208, 0x30, 0, 64},
3261 {255, 203, 0x30, 0, 64},
3262 {255, 197, 0x30, 0, 64},
3263 {255, 191, 0x30, 0, 64},
3264 {255, 186, 0x30, 0, 64},
3265 {255, 181, 0x30, 0, 64},
3266 {255, 175, 0x30, 0, 64},
3267 {255, 255, 0x20, 0, 64},
3268 {255, 248, 0x20, 0, 64},
3269 {255, 241, 0x20, 0, 64},
3270 {255, 234, 0x20, 0, 64},
3271 {255, 227, 0x20, 0, 64},
3272 {255, 221, 0x20, 0, 64},
3273 {255, 215, 0x20, 0, 64},
3274 {255, 208, 0x20, 0, 64},
3275 {255, 203, 0x20, 0, 64},
3276 {255, 197, 0x20, 0, 64},
3277 {255, 191, 0x20, 0, 64},
3278 {255, 186, 0x20, 0, 64},
3279 {255, 181, 0x20, 0, 64},
3280 {255, 175, 0x20, 0, 64},
3281 {255, 170, 0x20, 0, 64},
3282 {255, 166, 0x20, 0, 64},
3283 {255, 161, 0x20, 0, 64},
3284 {255, 156, 0x20, 0, 64},
3285 {255, 152, 0x20, 0, 64},
3286 {255, 148, 0x20, 0, 64},
3287 {255, 143, 0x20, 0, 64},
3288 {255, 139, 0x20, 0, 64},
3289 {255, 135, 0x20, 0, 64},
3290 {255, 132, 0x20, 0, 64},
3291 {255, 255, 0x10, 0, 64},
3292 {255, 248, 0x10, 0, 64},