1 /* SPDX-License-Identifier: GPL-2.0 */
2 /* Copyright(c) 2009-2012  Realtek Corporation.*/
3 
4 #ifndef __RTL_CORE_H__
5 #define __RTL_CORE_H__
6 
7 #define RTL_SUPPORTED_FILTERS		\
8 	(FIF_ALLMULTI | FIF_CONTROL | \
9 	FIF_OTHER_BSS | \
10 	FIF_FCSFAIL | \
11 	FIF_BCN_PRBRESP_PROMISC)
12 
13 #define DM_DIG_THRESH_HIGH		40
14 #define DM_DIG_THRESH_LOW		35
15 #define DM_FALSEALARM_THRESH_LOW	400
16 #define DM_FALSEALARM_THRESH_HIGH	1000
17 
18 #define DM_DIG_MAX			0x3e
19 #define DM_DIG_MIN			0x1e
20 #define DM_DIG_MAX_AP			0x32
21 #define DM_DIG_BACKOFF_MAX		12
22 #define DM_DIG_BACKOFF_MIN		-4
23 #define DM_DIG_BACKOFF_DEFAULT		10
24 
25 enum cck_packet_detection_threshold {
26 	CCK_PD_STAGE_LOWRSSI = 0,
27 	CCK_PD_STAGE_HIGHRSSI = 1,
28 	CCK_FA_STAGE_LOW = 2,
29 	CCK_FA_STAGE_HIGH = 3,
30 	CCK_PD_STAGE_MAX = 4,
31 };
32 
33 enum dm_dig_ext_port_alg_e {
34 	DIG_EXT_PORT_STAGE_0 = 0,
35 	DIG_EXT_PORT_STAGE_1 = 1,
36 	DIG_EXT_PORT_STAGE_2 = 2,
37 	DIG_EXT_PORT_STAGE_3 = 3,
38 	DIG_EXT_PORT_STAGE_MAX = 4,
39 };
40 
41 enum dm_dig_connect_e {
42 	DIG_STA_DISCONNECT,
43 	DIG_STA_CONNECT,
44 	DIG_STA_BEFORE_CONNECT,
45 	DIG_MULTISTA_DISCONNECT,
46 	DIG_MULTISTA_CONNECT,
47 	DIG_AP_DISCONNECT,
48 	DIG_AP_CONNECT,
49 	DIG_AP_ADD_STATION,
50 	DIG_CONNECT_MAX
51 };
52 
53 extern const struct ieee80211_ops rtl_ops;
54 
55 void rtl_init_sw_leds(struct ieee80211_hw *hw);
56 void rtl_fw_cb(const struct firmware *firmware, void *context);
57 void rtl_wowlan_fw_cb(const struct firmware *firmware, void *context);
58 void rtl_addr_delay(u32 addr);
59 void rtl_rfreg_delay(struct ieee80211_hw *hw, enum radio_path rfpath, u32 addr,
60 		     u32 mask, u32 data);
61 void rtl_bb_delay(struct ieee80211_hw *hw, u32 addr, u32 data);
62 bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb);
63 bool rtl_btc_status_false(void);
64 void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igval);
65 void rtl_update_beacon_work_callback(struct work_struct *work);
66 
67 #endif
68