0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #ifndef _BRCM_PHY_SHIM_H_
0022 #define _BRCM_PHY_SHIM_H_
0023
0024 #include "types.h"
0025
0026 #define RADAR_TYPE_NONE 0
0027 #define RADAR_TYPE_ETSI_1 1
0028 #define RADAR_TYPE_ETSI_2 2
0029 #define RADAR_TYPE_ETSI_3 3
0030 #define RADAR_TYPE_ITU_E 4
0031 #define RADAR_TYPE_ITU_K 5
0032 #define RADAR_TYPE_UNCLASSIFIED 6
0033 #define RADAR_TYPE_BIN5 7
0034 #define RADAR_TYPE_STG2 8
0035 #define RADAR_TYPE_STG3 9
0036 #define RADAR_TYPE_FRA 10
0037
0038
0039 #define FRA_T1_20MHZ 52770
0040 #define FRA_T2_20MHZ 61538
0041 #define FRA_T3_20MHZ 66002
0042 #define FRA_T1_40MHZ 105541
0043 #define FRA_T2_40MHZ 123077
0044 #define FRA_T3_40MHZ 132004
0045 #define FRA_ERR_20MHZ 60
0046 #define FRA_ERR_40MHZ 120
0047
0048 #define ANTSEL_NA 0
0049 #define ANTSEL_2x4 1
0050 #define ANTSEL_2x3 2
0051
0052
0053 #define ANT_RX_DIV_FORCE_0 0
0054 #define ANT_RX_DIV_FORCE_1 1
0055 #define ANT_RX_DIV_START_1 2
0056 #define ANT_RX_DIV_START_0 3
0057 #define ANT_RX_DIV_ENABLE 3
0058 #define ANT_RX_DIV_DEF ANT_RX_DIV_START_0
0059
0060 #define WL_ANT_RX_MAX 2
0061 #define WL_ANT_HT_RX_MAX 3
0062 #define WL_ANT_IDX_1 0
0063 #define WL_ANT_IDX_2 1
0064
0065
0066 #define BRCMS_N_PREAMBLE_MIXEDMODE 0
0067 #define BRCMS_N_PREAMBLE_GF 1
0068 #define BRCMS_N_PREAMBLE_GF_BRCM 2
0069
0070 #define WL_TX_POWER_RATES_LEGACY 45
0071 #define WL_TX_POWER_MCS20_FIRST 12
0072 #define WL_TX_POWER_MCS20_NUM 16
0073 #define WL_TX_POWER_MCS40_FIRST 28
0074 #define WL_TX_POWER_MCS40_NUM 17
0075
0076
0077 #define WL_TX_POWER_RATES 101
0078 #define WL_TX_POWER_CCK_FIRST 0
0079 #define WL_TX_POWER_CCK_NUM 4
0080
0081 #define WL_TX_POWER_OFDM_FIRST 4
0082
0083 #define WL_TX_POWER_OFDM20_CDD_FIRST 12
0084
0085 #define WL_TX_POWER_OFDM40_SISO_FIRST 52
0086
0087 #define WL_TX_POWER_OFDM40_CDD_FIRST 60
0088 #define WL_TX_POWER_OFDM_NUM 8
0089
0090 #define WL_TX_POWER_MCS20_SISO_FIRST 20
0091
0092 #define WL_TX_POWER_MCS20_CDD_FIRST 28
0093
0094 #define WL_TX_POWER_MCS20_STBC_FIRST 36
0095
0096 #define WL_TX_POWER_MCS20_SDM_FIRST 44
0097
0098 #define WL_TX_POWER_MCS40_SISO_FIRST 68
0099
0100 #define WL_TX_POWER_MCS40_CDD_FIRST 76
0101
0102 #define WL_TX_POWER_MCS40_STBC_FIRST 84
0103
0104 #define WL_TX_POWER_MCS40_SDM_FIRST 92
0105 #define WL_TX_POWER_MCS_1_STREAM_NUM 8
0106 #define WL_TX_POWER_MCS_2_STREAM_NUM 8
0107
0108 #define WL_TX_POWER_MCS_32 100
0109 #define WL_TX_POWER_MCS_32_NUM 1
0110
0111
0112
0113 #define WL_TX_POWER_MCS20_SISO_FIRST_SSN 12
0114
0115
0116 #define WL_TX_POWER_F_ENABLED 1
0117 #define WL_TX_POWER_F_HW 2
0118 #define WL_TX_POWER_F_MIMO 4
0119 #define WL_TX_POWER_F_SISO 8
0120
0121
0122 #define BRCMS_N_TXRX_CHAIN0 0
0123 #define BRCMS_N_TXRX_CHAIN1 1
0124
0125 struct brcms_phy;
0126
0127 struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
0128 struct brcms_info *wl,
0129 struct brcms_c_info *wlc);
0130 void wlc_phy_shim_detach(struct phy_shim_info *physhim);
0131
0132
0133 struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
0134 void (*fn)(struct brcms_phy *pi),
0135 void *arg, const char *name);
0136 void wlapi_free_timer(struct wlapi_timer *t);
0137 void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
0138 bool wlapi_del_timer(struct wlapi_timer *t);
0139 void wlapi_intrson(struct phy_shim_info *physhim);
0140 u32 wlapi_intrsoff(struct phy_shim_info *physhim);
0141 void wlapi_intrsrestore(struct phy_shim_info *physhim, u32 macintmask);
0142
0143 void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, u16 v);
0144 u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
0145 void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, u16 mask, u16 val,
0146 int bands);
0147 void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
0148 void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
0149 void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
0150 void wlapi_enable_mac(struct phy_shim_info *physhim);
0151 void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask, u32 val);
0152 void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
0153 void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
0154 void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
0155 void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
0156 void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
0157 void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
0158 void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *physhim);
0159 void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *physhim);
0160 void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
0161 int len, void *buf);
0162 u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim, u8 rate);
0163 void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
0164 void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint, void *buf,
0165 int, u32 sel);
0166 void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint, const void *buf,
0167 int, u32);
0168
0169 void wlapi_high_update_phy_mode(struct phy_shim_info *physhim, u32 phy_mode);
0170 u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
0171
0172 #endif