1 /* SPDX-License-Identifier: GPL-2.0 */
5 /* Channel switch: The size of command tables for switch channel */
6 #define MAX_PRECMD_CNT 16
7 #define MAX_RFDEPENDCMD_CNT 16
8 #define MAX_POSTCMD_CNT 16
10 enum switch_chan_cmd_id {
12 CMD_ID_SET_TX_PWR_LEVEL,
13 CMD_ID_WRITE_PORT_ULONG,
14 CMD_ID_WRITE_PORT_USHORT,
15 CMD_ID_WRITE_PORT_UCHAR,
19 /* -----------------------Define structure---------------------- */
20 /* 1. Switch channel related */
22 enum switch_chan_cmd_id cmd_id;
33 HW90_BLOCK_MAXIMUM = 4, /* Never use this */
36 enum rf90_radio_path_e {
37 RF90_PATH_A = 0, /* Radio Path A */
38 RF90_PATH_B = 1, /* Radio Path B */
39 RF90_PATH_C = 2, /* Radio Path C */
40 RF90_PATH_D = 3, /* Radio Path D */
41 RF90_PATH_MAX /* Max RF number 92 support */
44 u8 rtl8192_phy_CheckIsLegalRFPath(struct net_device *dev, u32 e_rfpath);
45 void rtl8192_setBBreg(struct net_device *dev, u32 reg_addr,
46 u32 bitmask, u32 data);
47 u32 rtl8192_QueryBBReg(struct net_device *dev, u32 reg_addr, u32 bitmask);
48 void rtl8192_phy_SetRFReg(struct net_device *dev,
49 enum rf90_radio_path_e e_rfpath,
50 u32 reg_addr, u32 bitmask, u32 data);
51 u32 rtl8192_phy_QueryRFReg(struct net_device *dev,
52 enum rf90_radio_path_e e_rfpath,
53 u32 reg_addr, u32 bitmask);
54 void rtl8192_phy_configmac(struct net_device *dev);
55 void rtl8192_phyConfigBB(struct net_device *dev, u8 ConfigType);
56 u8 rtl8192_phy_checkBBAndRF(struct net_device *dev,
57 enum hw90_block_e CheckBlock,
58 enum rf90_radio_path_e e_rfpath);
59 void rtl8192_BBConfig(struct net_device *dev);
60 void rtl8192_phy_getTxPower(struct net_device *dev);
61 void rtl8192_phy_setTxPower(struct net_device *dev, u8 channel);
62 void rtl8192_phy_RFConfig(struct net_device *dev);
63 void rtl8192_phy_updateInitGain(struct net_device *dev);
64 u8 rtl8192_phy_ConfigRFWithHeaderFile(struct net_device *dev,
65 enum rf90_radio_path_e e_rfpath);
67 u8 rtl8192_phy_SwChnl(struct net_device *dev, u8 channel);
68 void rtl8192_SetBWMode(struct net_device *dev,
69 enum ht_channel_width bandwidth,
70 enum ht_extension_chan_offset offset);
71 void rtl8192_SwChnl_WorkItem(struct net_device *dev);
72 void rtl8192_SetBWModeWorkItem(struct net_device *dev);
73 bool rtl8192_SetRFPowerState(struct net_device *dev,
74 RT_RF_POWER_STATE eRFPowerState);
75 void InitialGain819xUsb(struct net_device *dev, u8 Operation);
77 void InitialGainOperateWorkItemCallBack(struct work_struct *work);