Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef B43_PHY_HT_H_
0003 #define B43_PHY_HT_H_
0004 
0005 #include "phy_common.h"
0006 
0007 
0008 #define B43_PHY_HT_BBCFG            0x001 /* BB config */
0009 #define  B43_PHY_HT_BBCFG_RSTCCA        0x4000 /* Reset CCA */
0010 #define  B43_PHY_HT_BBCFG_RSTRX         0x8000 /* Reset RX */
0011 #define B43_PHY_HT_BANDCTL          0x009 /* Band control */
0012 #define  B43_PHY_HT_BANDCTL_5GHZ        0x0001 /* Use the 5GHz band */
0013 #define B43_PHY_HT_TABLE_ADDR           0x072 /* Table address */
0014 #define B43_PHY_HT_TABLE_DATALO         0x073 /* Table data low */
0015 #define B43_PHY_HT_TABLE_DATAHI         0x074 /* Table data high */
0016 #define B43_PHY_HT_CLASS_CTL            0x0B0 /* Classifier control */
0017 #define  B43_PHY_HT_CLASS_CTL_CCK_EN        0x0001 /* CCK enable */
0018 #define  B43_PHY_HT_CLASS_CTL_OFDM_EN       0x0002 /* OFDM enable */
0019 #define  B43_PHY_HT_CLASS_CTL_WAITED_EN     0x0004 /* Waited enable */
0020 #define B43_PHY_HT_IQLOCAL_CMDGCTL      0x0C2   /* I/Q LO cal command G control */
0021 #define B43_PHY_HT_SAMP_CMD         0x0C3   /* Sample command */
0022 #define  B43_PHY_HT_SAMP_CMD_STOP       0x0002  /* Stop */
0023 #define B43_PHY_HT_SAMP_LOOP_CNT        0x0C4   /* Sample loop count */
0024 #define B43_PHY_HT_SAMP_WAIT_CNT        0x0C5   /* Sample wait count */
0025 #define B43_PHY_HT_SAMP_DEP_CNT         0x0C6   /* Sample depth count */
0026 #define B43_PHY_HT_SAMP_STAT            0x0C7   /* Sample status */
0027 #define B43_PHY_HT_EST_PWR_C1           0x118
0028 #define B43_PHY_HT_EST_PWR_C2           0x119
0029 #define B43_PHY_HT_EST_PWR_C3           0x11A
0030 #define B43_PHY_HT_TSSIMODE         0x122   /* TSSI mode */
0031 #define  B43_PHY_HT_TSSIMODE_EN         0x0001  /* TSSI enable */
0032 #define  B43_PHY_HT_TSSIMODE_PDEN       0x0002  /* Power det enable */
0033 #define B43_PHY_HT_BW1              0x1CE
0034 #define B43_PHY_HT_BW2              0x1CF
0035 #define B43_PHY_HT_BW3              0x1D0
0036 #define B43_PHY_HT_BW4              0x1D1
0037 #define B43_PHY_HT_BW5              0x1D2
0038 #define B43_PHY_HT_BW6              0x1D3
0039 #define B43_PHY_HT_TXPCTL_CMD_C1        0x1E7   /* TX power control command */
0040 #define  B43_PHY_HT_TXPCTL_CMD_C1_INIT      0x007F  /* Init */
0041 #define  B43_PHY_HT_TXPCTL_CMD_C1_COEFF     0x2000  /* Power control coefficients */
0042 #define  B43_PHY_HT_TXPCTL_CMD_C1_HWPCTLEN  0x4000  /* Hardware TX power control enable */
0043 #define  B43_PHY_HT_TXPCTL_CMD_C1_PCTLEN    0x8000  /* TX power control enable */
0044 #define B43_PHY_HT_TXPCTL_N         0x1E8   /* TX power control N num */
0045 #define  B43_PHY_HT_TXPCTL_N_TSSID      0x00FF  /* N TSSI delay */
0046 #define  B43_PHY_HT_TXPCTL_N_TSSID_SHIFT    0
0047 #define  B43_PHY_HT_TXPCTL_N_NPTIL2     0x0700  /* N PT integer log2 */
0048 #define  B43_PHY_HT_TXPCTL_N_NPTIL2_SHIFT   8
0049 #define B43_PHY_HT_TXPCTL_IDLE_TSSI     0x1E9   /* TX power control idle TSSI */
0050 #define  B43_PHY_HT_TXPCTL_IDLE_TSSI_C1     0x003F
0051 #define  B43_PHY_HT_TXPCTL_IDLE_TSSI_C1_SHIFT   0
0052 #define  B43_PHY_HT_TXPCTL_IDLE_TSSI_C2     0x3F00
0053 #define  B43_PHY_HT_TXPCTL_IDLE_TSSI_C2_SHIFT   8
0054 #define  B43_PHY_HT_TXPCTL_IDLE_TSSI_BINF   0x8000  /* Raw TSSI offset bin format */
0055 #define B43_PHY_HT_TXPCTL_TARG_PWR      0x1EA   /* TX power control target power */
0056 #define  B43_PHY_HT_TXPCTL_TARG_PWR_C1      0x00FF  /* Power 0 */
0057 #define  B43_PHY_HT_TXPCTL_TARG_PWR_C1_SHIFT    0
0058 #define  B43_PHY_HT_TXPCTL_TARG_PWR_C2      0xFF00  /* Power 1 */
0059 #define  B43_PHY_HT_TXPCTL_TARG_PWR_C2_SHIFT    8
0060 #define B43_PHY_HT_TX_PCTL_STATUS_C1        0x1ED
0061 #define B43_PHY_HT_TX_PCTL_STATUS_C2        0x1EE
0062 #define B43_PHY_HT_TXPCTL_CMD_C2        0x222
0063 #define  B43_PHY_HT_TXPCTL_CMD_C2_INIT      0x007F
0064 #define B43_PHY_HT_RSSI_C1          0x219
0065 #define B43_PHY_HT_RSSI_C2          0x21A
0066 #define B43_PHY_HT_RSSI_C3          0x21B
0067 
0068 #define B43_PHY_HT_C1_CLIP1THRES        B43_PHY_OFDM(0x00E)
0069 #define B43_PHY_HT_C2_CLIP1THRES        B43_PHY_OFDM(0x04E)
0070 #define B43_PHY_HT_C3_CLIP1THRES        B43_PHY_OFDM(0x08E)
0071 
0072 #define B43_PHY_HT_RF_SEQ_MODE          B43_PHY_EXTG(0x000)
0073 #define  B43_PHY_HT_RF_SEQ_MODE_CA_OVER     0x0001  /* Core active override */
0074 #define  B43_PHY_HT_RF_SEQ_MODE_TR_OVER     0x0002  /* Trigger override */
0075 #define B43_PHY_HT_RF_SEQ_TRIG          B43_PHY_EXTG(0x003)
0076 #define  B43_PHY_HT_RF_SEQ_TRIG_RX2TX       0x0001 /* RX2TX */
0077 #define  B43_PHY_HT_RF_SEQ_TRIG_TX2RX       0x0002 /* TX2RX */
0078 #define  B43_PHY_HT_RF_SEQ_TRIG_UPGH        0x0004 /* Update gain H */
0079 #define  B43_PHY_HT_RF_SEQ_TRIG_UPGL        0x0008 /* Update gain L */
0080 #define  B43_PHY_HT_RF_SEQ_TRIG_UPGU        0x0010 /* Update gain U */
0081 #define  B43_PHY_HT_RF_SEQ_TRIG_RST2RX      0x0020 /* Reset to RX */
0082 #define B43_PHY_HT_RF_SEQ_STATUS        B43_PHY_EXTG(0x004)
0083 /* Values for the status are the same as for the trigger */
0084 
0085 #define B43_PHY_HT_RF_CTL_CMD           0x810
0086 #define  B43_PHY_HT_RF_CTL_CMD_FORCE        0x0001
0087 #define  B43_PHY_HT_RF_CTL_CMD_CHIP0_PU     0x0002
0088 
0089 #define B43_PHY_HT_RF_CTL_INT_C1        B43_PHY_EXTG(0x04c)
0090 #define B43_PHY_HT_RF_CTL_INT_C2        B43_PHY_EXTG(0x06c)
0091 #define B43_PHY_HT_RF_CTL_INT_C3        B43_PHY_EXTG(0x08c)
0092 
0093 #define B43_PHY_HT_AFE_C1_OVER          B43_PHY_EXTG(0x110)
0094 #define B43_PHY_HT_AFE_C1           B43_PHY_EXTG(0x111)
0095 #define B43_PHY_HT_AFE_C2_OVER          B43_PHY_EXTG(0x114)
0096 #define B43_PHY_HT_AFE_C2           B43_PHY_EXTG(0x115)
0097 #define B43_PHY_HT_AFE_C3_OVER          B43_PHY_EXTG(0x118)
0098 #define B43_PHY_HT_AFE_C3           B43_PHY_EXTG(0x119)
0099 
0100 #define B43_PHY_HT_TXPCTL_CMD_C3        B43_PHY_EXTG(0x164)
0101 #define  B43_PHY_HT_TXPCTL_CMD_C3_INIT      0x007F
0102 #define B43_PHY_HT_TXPCTL_IDLE_TSSI2        B43_PHY_EXTG(0x165) /* TX power control idle TSSI */
0103 #define  B43_PHY_HT_TXPCTL_IDLE_TSSI2_C3    0x003F
0104 #define  B43_PHY_HT_TXPCTL_IDLE_TSSI2_C3_SHIFT  0
0105 #define B43_PHY_HT_TXPCTL_TARG_PWR2     B43_PHY_EXTG(0x166) /* TX power control target power */
0106 #define  B43_PHY_HT_TXPCTL_TARG_PWR2_C3     0x00FF
0107 #define  B43_PHY_HT_TXPCTL_TARG_PWR2_C3_SHIFT   0
0108 #define B43_PHY_HT_TX_PCTL_STATUS_C3        B43_PHY_EXTG(0x169)
0109 
0110 #define B43_PHY_B_BBCFG             B43_PHY_N_BMODE(0x001)
0111 #define  B43_PHY_B_BBCFG_RSTCCA         0x4000 /* Reset CCA */
0112 #define  B43_PHY_B_BBCFG_RSTRX          0x8000 /* Reset RX */
0113 #define B43_PHY_HT_TEST             B43_PHY_N_BMODE(0x00A)
0114 
0115 
0116 /* Values for PHY registers used on channel switching */
0117 struct b43_phy_ht_channeltab_e_phy {
0118     u16 bw1;
0119     u16 bw2;
0120     u16 bw3;
0121     u16 bw4;
0122     u16 bw5;
0123     u16 bw6;
0124 };
0125 
0126 
0127 struct b43_phy_ht {
0128     u16 rf_ctl_int_save[3];
0129 
0130     bool tx_pwr_ctl;
0131     u8 tx_pwr_idx[3];
0132 
0133     s32 bb_mult_save[3];
0134 
0135     u8 idle_tssi[3];
0136 };
0137 
0138 
0139 struct b43_phy_operations;
0140 extern const struct b43_phy_operations b43_phyops_ht;
0141 
0142 #endif /* B43_PHY_HT_H_ */