2 * (c) Copyright 2002-2010, Ralink Technology, Inc.
3 * Copyright (C) 2018 Stanislaw Gruszka <stf_xl@wp.pl>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2
7 * as published by the Free Software Foundation
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 #ifndef _MT76X0_PHY_H_
15 #define _MT76X0_PHY_H_
17 #define RF_G_BAND 0x0100
18 #define RF_A_BAND 0x0200
19 #define RF_A_BAND_LB 0x0400
20 #define RF_A_BAND_MB 0x0800
21 #define RF_A_BAND_HB 0x1000
22 #define RF_A_BAND_11J 0x2000
29 #define MT_RF(bank, reg) ((bank) << 16 | (reg))
30 #define MT_RF_BANK(offset) (offset >> 16)
31 #define MT_RF_REG(offset) (offset & 0xff)
33 struct mt76x0_bbp_switch_item {
35 struct mt76_reg_pair reg_pair;
38 struct mt76x0_rf_switch_item {
44 struct mt76x0_freq_item {
53 u8 pllR32_b4b0; /* PLL_DEN (Denomina - 8) */
55 u8 pllR31_b4b0; /* PLL_K (Nominator *)*/
56 u8 pllR30_b7; /* sdm_reset_n */
57 u8 pllR30_b6b2; /* sdmmash_prbs,sin */
58 u8 pllR30_b1; /* sdm_bp */
59 u16 pll_n; /* R30<0>, R29<7:0> (hex) */
60 u8 pllR28_b7b6; /* isi,iso */
61 u8 pllR28_b5b4; /* pfd_dly */
62 u8 pllR28_b3b2; /* clksel option */
63 u32 pll_sdm_k; /* R28<1:0>, R27<7:0>, R26<7:0> (hex) SDM_k */
64 u8 pllR24_b1b0; /* xo_div */
67 struct mt76x0_rate_pwr_item {
72 struct mt76x0_rate_pwr_tab {
73 struct mt76x0_rate_pwr_item cck[4];
74 struct mt76x0_rate_pwr_item ofdm[8];
75 struct mt76x0_rate_pwr_item ht[8];
76 struct mt76x0_rate_pwr_item vht[10];
77 struct mt76x0_rate_pwr_item stbc[8];
78 struct mt76x0_rate_pwr_item mcs32;
81 #endif /* _MT76X0_PHY_H_ */