• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /******************************************************************************
2  *
3  * Copyright(c) 2007 - 2017  Realtek Corporation.
4  *
5  * This program is free software; you can redistribute it and/or modify it
6  * under the terms of version 2 of the GNU General Public License as
7  * published by the Free Software Foundation.
8  *
9  * This program is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
12  * more details.
13  *
14  * The full GNU General Public License is included in this distribution in the
15  * file called LICENSE.
16  *
17  * Contact Information:
18  * wlanfae <wlanfae@realtek.com>
19  * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
20  * Hsinchu 300, Taiwan.
21  *
22  * Larry Finger <Larry.Finger@lwfinger.net>
23  *
24  *****************************************************************************/
25 #ifndef __PHYDM_HAL_TXBF_API_H__
26 #define __PHYDM_HAL_TXBF_API_H__
27 
28 #if (defined(CONFIG_BB_TXBF_API))
29 
30 #if (DM_ODM_SUPPORT_TYPE != ODM_AP)
31 #if defined(DM_ODM_CE_MAC80211)
32 #define tx_bf_nr(a, b) ({	\
33 	u8 __tx_bf_nr_a = (a);	\
34 	u8 __tx_bf_nr_b = (b);	\
35 	((__tx_bf_nr_a > __tx_bf_nr_b) ? (__tx_bf_nr_b) : (__tx_bf_nr_a)); })
36 #else
37 #define tx_bf_nr(a, b) ((a > b) ? (b) : (a))
38 #endif
39 
40 u8 beamforming_get_htndp_tx_rate(void *dm_void, u8 bfer_str_num);
41 
42 u8 beamforming_get_vht_ndp_tx_rate(void *dm_void, u8 bfer_str_num);
43 
44 #endif
45 
46 #if (RTL8822B_SUPPORT == 1 || RTL8822C_SUPPORT == 1 || RTL8192F_SUPPORT == 1 ||\
47 	RTL8814B_SUPPORT == 1 || RTL8198F_SUPPORT == 1 || RTL8812F_SUPPORT == 1)
48 u8 phydm_get_beamforming_sounding_info(void *dm_void, u16 *throughput,
49 				       u8 total_bfee_num, u8 *tx_rate);
50 u8 phydm_get_ndpa_rate(void *dm_void);
51 
52 u8 phydm_get_mu_bfee_snding_decision(void *dm_void, u16 throughput);
53 
54 #else
55 #define phydm_get_beamforming_sounding_info(dm, tp, bfee_num, rate) 0
56 #define phydm_get_ndpa_rate(dm)
57 #define phydm_get_mu_bfee_snding_decision(dm, tp)
58 
59 #endif
60 
61 #ifdef PHYDM_IC_JGR3_SERIES_SUPPORT
62 struct phydm_bf_rate_info_jgr3 {
63 	u8			enable;
64 	u8			mu_ratio_th;
65 	u32			pre_mu_ratio;
66 	u16			num_mu_vht_pkt[VHT_RATE_NUM];
67 	u16			num_qry_vht_pkt[VHT_RATE_NUM];
68 	boolean			mu_set_trxpath;
69 	u8			tx_path_en_ofdm_1sts;
70 	u8			tx_path_en_ofdm_2sts;
71 	u8			rx_path_en_ofdm;
72 	boolean			mu_been_iot;
73 };
74 
75 /*this function is only used for BFer*/
76 void phydm_txbf_rfmode(void *dm_void, u8 su_bfee_cnt, u8 mu_bfee_cnt);
77 void phydm_txbf_avoid_hang(void *dm_void);
78 void phydm_mu_rsoml_init(void *dm_void);
79 void phydm_mu_rsoml_decision(void *dm_void);
80 
81 #if (RTL8814B_SUPPORT == 1)
82 void phydm_txbf_80p80_rfmode(void *dm_void, u8 su_bfee_cnt, u8 mu_bfee_cnt);
83 #endif
84 
85 #endif /*#PHYDM_IC_JGR3_SERIES_SUPPORT*/
86 void phydm_bf_debug(void *dm_void, char input[][16], u32 *_used, char *output,
87 		    u32 *_out_len);
88 #endif
89 #endif
90