1 /* SPDX-License-Identifier: GPL-2.0 */
2 /*
3  * Copyright(c) 2008 - 2010 Realtek Corporation. All rights reserved.
4  *
5  * Contact Information: wlanfae <wlanfae@realtek.com>
6  */
7 #ifndef _R819XU_PHY_H
8 #define _R819XU_PHY_H
9 
10 #define MAX_DOZE_WAITING_TIMES_9x 64
11 
12 enum hw90_block {
13 	HW90_BLOCK_MAC = 0,
14 	HW90_BLOCK_PHY0 = 1,
15 	HW90_BLOCK_PHY1 = 2,
16 	HW90_BLOCK_RF = 3,
17 	HW90_BLOCK_MAXIMUM = 4,
18 };
19 
20 enum rf90_radio_path {
21 	RF90_PATH_A = 0,
22 	RF90_PATH_B = 1,
23 	RF90_PATH_C = 2,
24 	RF90_PATH_D = 3,
25 	RF90_PATH_MAX
26 };
27 
28 void rtl92e_set_bb_reg(struct net_device *dev, u32 dwRegAddr,
29 		       u32 dwBitMask, u32 dwData);
30 u32 rtl92e_get_bb_reg(struct net_device *dev, u32 dwRegAddr, u32 dwBitMask);
31 void rtl92e_set_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
32 		       u32 RegAddr, u32 BitMask, u32 Data);
33 u32 rtl92e_get_rf_reg(struct net_device *dev, enum rf90_radio_path eRFPath,
34 		      u32 RegAddr, u32 BitMask);
35 void rtl92e_config_mac(struct net_device *dev);
36 bool rtl92e_check_bb_and_rf(struct net_device *dev,
37 			    enum hw90_block CheckBlock,
38 			    enum rf90_radio_path eRFPath);
39 bool rtl92e_config_bb(struct net_device *dev);
40 void rtl92e_get_tx_power(struct net_device *dev);
41 void rtl92e_set_tx_power(struct net_device *dev, u8 channel);
42 u8 rtl92e_config_rf_path(struct net_device *dev, enum rf90_radio_path eRFPath);
43 
44 u8 rtl92e_set_channel(struct net_device *dev, u8 channel);
45 void rtl92e_set_bw_mode(struct net_device *dev,
46 			enum ht_channel_width bandwidth,
47 			enum ht_extchnl_offset Offset);
48 void rtl92e_init_gain(struct net_device *dev, u8 Operation);
49 
50 void rtl92e_set_rf_off(struct net_device *dev);
51 
52 bool rtl92e_set_rf_power_state(struct net_device *dev,
53 			       enum rt_rf_power_state rf_power_state);
54 
55 void rtl92e_scan_op_backup(struct net_device *dev, u8 Operation);
56 
57 #endif
58