18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2012  Realtek Corporation.*/
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef __RTL92C_MAC_H__
58c2ecf20Sopenharmony_ci#define __RTL92C_MAC_H__
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER		255
88c2ecf20Sopenharmony_ci#define DRIVER_EARLY_INT_TIME					0x05
98c2ecf20Sopenharmony_ci#define BCN_DMA_ATIME_INT_TIME				0x02
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_civoid rtl92c_read_chip_version(struct ieee80211_hw *hw);
128c2ecf20Sopenharmony_cibool rtl92c_llt_write(struct ieee80211_hw *hw, u32 address, u32 data);
138c2ecf20Sopenharmony_cibool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary);
148c2ecf20Sopenharmony_civoid rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
158c2ecf20Sopenharmony_ci		     u8 *p_macaddr, bool is_group, u8 enc_algo,
168c2ecf20Sopenharmony_ci		     bool is_wepkey, bool clear_all);
178c2ecf20Sopenharmony_civoid rtl92c_enable_interrupt(struct ieee80211_hw *hw);
188c2ecf20Sopenharmony_civoid rtl92c_disable_interrupt(struct ieee80211_hw *hw);
198c2ecf20Sopenharmony_civoid rtl92c_set_qos(struct ieee80211_hw *hw, int aci);
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci/*---------------------------------------------------------------
228c2ecf20Sopenharmony_ci *	Hardware init functions
238c2ecf20Sopenharmony_ci *---------------------------------------------------------------*/
248c2ecf20Sopenharmony_civoid rtl92c_init_interrupt(struct ieee80211_hw *hw);
258c2ecf20Sopenharmony_civoid rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size);
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ciint rtl92c_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type);
288c2ecf20Sopenharmony_civoid rtl92c_init_network_type(struct ieee80211_hw *hw);
298c2ecf20Sopenharmony_civoid rtl92c_init_adaptive_ctrl(struct ieee80211_hw *hw);
308c2ecf20Sopenharmony_civoid rtl92c_init_rate_fallback(struct ieee80211_hw *hw);
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_civoid rtl92c_init_edca_param(struct ieee80211_hw *hw,
338c2ecf20Sopenharmony_ci							u16 queue,
348c2ecf20Sopenharmony_ci							u16 txop,
358c2ecf20Sopenharmony_ci							u8 ecwmax,
368c2ecf20Sopenharmony_ci							u8 ecwmin,
378c2ecf20Sopenharmony_ci							u8 aifs);
388c2ecf20Sopenharmony_ci
398c2ecf20Sopenharmony_civoid rtl92c_init_edca(struct ieee80211_hw *hw);
408c2ecf20Sopenharmony_civoid rtl92c_init_ampdu_aggregation(struct ieee80211_hw *hw);
418c2ecf20Sopenharmony_civoid rtl92c_init_beacon_max_error(struct ieee80211_hw *hw);
428c2ecf20Sopenharmony_civoid rtl92c_init_rdg_setting(struct ieee80211_hw *hw);
438c2ecf20Sopenharmony_civoid rtl92c_init_retry_function(struct ieee80211_hw *hw);
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_civoid rtl92c_disable_fast_edca(struct ieee80211_hw *hw);
468c2ecf20Sopenharmony_civoid rtl92c_set_min_space(struct ieee80211_hw *hw, bool is2T);
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ciu32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
498c2ecf20Sopenharmony_ci
508c2ecf20Sopenharmony_cistruct rx_fwinfo_92c {
518c2ecf20Sopenharmony_ci	u8 gain_trsw[4];
528c2ecf20Sopenharmony_ci	u8 pwdb_all;
538c2ecf20Sopenharmony_ci	u8 cfosho[4];
548c2ecf20Sopenharmony_ci	u8 cfotail[4];
558c2ecf20Sopenharmony_ci	s8 rxevm[2];
568c2ecf20Sopenharmony_ci	s8 rxsnr[4];
578c2ecf20Sopenharmony_ci	u8 pdsnr[2];
588c2ecf20Sopenharmony_ci	u8 csi_current[2];
598c2ecf20Sopenharmony_ci	u8 csi_target[2];
608c2ecf20Sopenharmony_ci	u8 sigevm;
618c2ecf20Sopenharmony_ci	u8 max_ex_pwr;
628c2ecf20Sopenharmony_ci	u8 ex_intf_flag:1;
638c2ecf20Sopenharmony_ci	u8 sgi_en:1;
648c2ecf20Sopenharmony_ci	u8 rxsc:2;
658c2ecf20Sopenharmony_ci	u8 reserve:4;
668c2ecf20Sopenharmony_ci} __packed;
678c2ecf20Sopenharmony_ci
688c2ecf20Sopenharmony_cistruct rx_desc_92c {
698c2ecf20Sopenharmony_ci	u32 length:14;
708c2ecf20Sopenharmony_ci	u32 crc32:1;
718c2ecf20Sopenharmony_ci	u32 icverror:1;
728c2ecf20Sopenharmony_ci	u32 drv_infosize:4;
738c2ecf20Sopenharmony_ci	u32 security:3;
748c2ecf20Sopenharmony_ci	u32 qos:1;
758c2ecf20Sopenharmony_ci	u32 shift:2;
768c2ecf20Sopenharmony_ci	u32 phystatus:1;
778c2ecf20Sopenharmony_ci	u32 swdec:1;
788c2ecf20Sopenharmony_ci	u32 lastseg:1;
798c2ecf20Sopenharmony_ci	u32 firstseg:1;
808c2ecf20Sopenharmony_ci	u32 eor:1;
818c2ecf20Sopenharmony_ci	u32 own:1;
828c2ecf20Sopenharmony_ci	u32 macid:5;	/* word 1 */
838c2ecf20Sopenharmony_ci	u32 tid:4;
848c2ecf20Sopenharmony_ci	u32 hwrsvd:5;
858c2ecf20Sopenharmony_ci	u32 paggr:1;
868c2ecf20Sopenharmony_ci	u32 faggr:1;
878c2ecf20Sopenharmony_ci	u32 a1_fit:4;
888c2ecf20Sopenharmony_ci	u32 a2_fit:4;
898c2ecf20Sopenharmony_ci	u32 pam:1;
908c2ecf20Sopenharmony_ci	u32 pwr:1;
918c2ecf20Sopenharmony_ci	u32 moredata:1;
928c2ecf20Sopenharmony_ci	u32 morefrag:1;
938c2ecf20Sopenharmony_ci	u32 type:2;
948c2ecf20Sopenharmony_ci	u32 mc:1;
958c2ecf20Sopenharmony_ci	u32 bc:1;
968c2ecf20Sopenharmony_ci	u32 seq:12;	/* word 2 */
978c2ecf20Sopenharmony_ci	u32 frag:4;
988c2ecf20Sopenharmony_ci	u32 nextpktlen:14;
998c2ecf20Sopenharmony_ci	u32 nextind:1;
1008c2ecf20Sopenharmony_ci	u32 rsvd:1;
1018c2ecf20Sopenharmony_ci	u32 rxmcs:6;	/* word 3 */
1028c2ecf20Sopenharmony_ci	u32 rxht:1;
1038c2ecf20Sopenharmony_ci	u32 amsdu:1;
1048c2ecf20Sopenharmony_ci	u32 splcp:1;
1058c2ecf20Sopenharmony_ci	u32 bandwidth:1;
1068c2ecf20Sopenharmony_ci	u32 htc:1;
1078c2ecf20Sopenharmony_ci	u32 tcpchk_rpt:1;
1088c2ecf20Sopenharmony_ci	u32 ipcchk_rpt:1;
1098c2ecf20Sopenharmony_ci	u32 tcpchk_valid:1;
1108c2ecf20Sopenharmony_ci	u32 hwpcerr:1;
1118c2ecf20Sopenharmony_ci	u32 hwpcind:1;
1128c2ecf20Sopenharmony_ci	u32 iv0:16;
1138c2ecf20Sopenharmony_ci	u32 iv1;	/* word 4 */
1148c2ecf20Sopenharmony_ci	u32 tsfl;	/* word 5 */
1158c2ecf20Sopenharmony_ci	u32 bufferaddress;	/* word 6 */
1168c2ecf20Sopenharmony_ci	u32 bufferaddress64;	/* word 7 */
1178c2ecf20Sopenharmony_ci} __packed;
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_cienum rtl_desc_qsel rtl92c_map_hwqueue_to_fwqueue(u16 fc,
1208c2ecf20Sopenharmony_ci							  unsigned int
1218c2ecf20Sopenharmony_ci							  skb_queue);
1228c2ecf20Sopenharmony_civoid rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw,
1238c2ecf20Sopenharmony_ci				      struct sk_buff *skb,
1248c2ecf20Sopenharmony_ci				      struct rtl_stats *pstats,
1258c2ecf20Sopenharmony_ci				      struct rx_desc_92c *pdesc,
1268c2ecf20Sopenharmony_ci				      struct rx_fwinfo_92c *p_drvinfo);
1278c2ecf20Sopenharmony_ci
1288c2ecf20Sopenharmony_ci/*---------------------------------------------------------------
1298c2ecf20Sopenharmony_ci *	Card disable functions
1308c2ecf20Sopenharmony_ci *---------------------------------------------------------------*/
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci#endif
133