162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* Copyright(c) 2009-2012 Realtek Corporation.*/ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#ifndef __RTL92C_MAC_H__ 562306a36Sopenharmony_ci#define __RTL92C_MAC_H__ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER 255 862306a36Sopenharmony_ci#define DRIVER_EARLY_INT_TIME 0x05 962306a36Sopenharmony_ci#define BCN_DMA_ATIME_INT_TIME 0x02 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_civoid rtl92c_read_chip_version(struct ieee80211_hw *hw); 1262306a36Sopenharmony_cibool rtl92c_llt_write(struct ieee80211_hw *hw, u32 address, u32 data); 1362306a36Sopenharmony_cibool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary); 1462306a36Sopenharmony_civoid rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index, 1562306a36Sopenharmony_ci u8 *p_macaddr, bool is_group, u8 enc_algo, 1662306a36Sopenharmony_ci bool is_wepkey, bool clear_all); 1762306a36Sopenharmony_civoid rtl92c_enable_interrupt(struct ieee80211_hw *hw); 1862306a36Sopenharmony_civoid rtl92c_disable_interrupt(struct ieee80211_hw *hw); 1962306a36Sopenharmony_civoid rtl92c_set_qos(struct ieee80211_hw *hw, int aci); 2062306a36Sopenharmony_ci 2162306a36Sopenharmony_ci/*--------------------------------------------------------------- 2262306a36Sopenharmony_ci * Hardware init functions 2362306a36Sopenharmony_ci *---------------------------------------------------------------*/ 2462306a36Sopenharmony_civoid rtl92c_init_interrupt(struct ieee80211_hw *hw); 2562306a36Sopenharmony_civoid rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size); 2662306a36Sopenharmony_ci 2762306a36Sopenharmony_ciint rtl92c_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 2862306a36Sopenharmony_civoid rtl92c_init_network_type(struct ieee80211_hw *hw); 2962306a36Sopenharmony_civoid rtl92c_init_adaptive_ctrl(struct ieee80211_hw *hw); 3062306a36Sopenharmony_civoid rtl92c_init_rate_fallback(struct ieee80211_hw *hw); 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_civoid rtl92c_init_edca_param(struct ieee80211_hw *hw, 3362306a36Sopenharmony_ci u16 queue, 3462306a36Sopenharmony_ci u16 txop, 3562306a36Sopenharmony_ci u8 ecwmax, 3662306a36Sopenharmony_ci u8 ecwmin, 3762306a36Sopenharmony_ci u8 aifs); 3862306a36Sopenharmony_ci 3962306a36Sopenharmony_civoid rtl92c_init_edca(struct ieee80211_hw *hw); 4062306a36Sopenharmony_civoid rtl92c_init_ampdu_aggregation(struct ieee80211_hw *hw); 4162306a36Sopenharmony_civoid rtl92c_init_beacon_max_error(struct ieee80211_hw *hw); 4262306a36Sopenharmony_civoid rtl92c_init_rdg_setting(struct ieee80211_hw *hw); 4362306a36Sopenharmony_civoid rtl92c_init_retry_function(struct ieee80211_hw *hw); 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_civoid rtl92c_disable_fast_edca(struct ieee80211_hw *hw); 4662306a36Sopenharmony_civoid rtl92c_set_min_space(struct ieee80211_hw *hw, bool is2T); 4762306a36Sopenharmony_ci 4862306a36Sopenharmony_ciu32 rtl92c_get_txdma_status(struct ieee80211_hw *hw); 4962306a36Sopenharmony_ci 5062306a36Sopenharmony_cistruct rx_fwinfo_92c { 5162306a36Sopenharmony_ci u8 gain_trsw[4]; 5262306a36Sopenharmony_ci u8 pwdb_all; 5362306a36Sopenharmony_ci u8 cfosho[4]; 5462306a36Sopenharmony_ci u8 cfotail[4]; 5562306a36Sopenharmony_ci s8 rxevm[2]; 5662306a36Sopenharmony_ci s8 rxsnr[4]; 5762306a36Sopenharmony_ci u8 pdsnr[2]; 5862306a36Sopenharmony_ci u8 csi_current[2]; 5962306a36Sopenharmony_ci u8 csi_target[2]; 6062306a36Sopenharmony_ci u8 sigevm; 6162306a36Sopenharmony_ci u8 max_ex_pwr; 6262306a36Sopenharmony_ci u8 ex_intf_flag:1; 6362306a36Sopenharmony_ci u8 sgi_en:1; 6462306a36Sopenharmony_ci u8 rxsc:2; 6562306a36Sopenharmony_ci u8 reserve:4; 6662306a36Sopenharmony_ci} __packed; 6762306a36Sopenharmony_ci 6862306a36Sopenharmony_cistruct rx_desc_92c { 6962306a36Sopenharmony_ci u32 length:14; 7062306a36Sopenharmony_ci u32 crc32:1; 7162306a36Sopenharmony_ci u32 icverror:1; 7262306a36Sopenharmony_ci u32 drv_infosize:4; 7362306a36Sopenharmony_ci u32 security:3; 7462306a36Sopenharmony_ci u32 qos:1; 7562306a36Sopenharmony_ci u32 shift:2; 7662306a36Sopenharmony_ci u32 phystatus:1; 7762306a36Sopenharmony_ci u32 swdec:1; 7862306a36Sopenharmony_ci u32 lastseg:1; 7962306a36Sopenharmony_ci u32 firstseg:1; 8062306a36Sopenharmony_ci u32 eor:1; 8162306a36Sopenharmony_ci u32 own:1; 8262306a36Sopenharmony_ci u32 macid:5; /* word 1 */ 8362306a36Sopenharmony_ci u32 tid:4; 8462306a36Sopenharmony_ci u32 hwrsvd:5; 8562306a36Sopenharmony_ci u32 paggr:1; 8662306a36Sopenharmony_ci u32 faggr:1; 8762306a36Sopenharmony_ci u32 a1_fit:4; 8862306a36Sopenharmony_ci u32 a2_fit:4; 8962306a36Sopenharmony_ci u32 pam:1; 9062306a36Sopenharmony_ci u32 pwr:1; 9162306a36Sopenharmony_ci u32 moredata:1; 9262306a36Sopenharmony_ci u32 morefrag:1; 9362306a36Sopenharmony_ci u32 type:2; 9462306a36Sopenharmony_ci u32 mc:1; 9562306a36Sopenharmony_ci u32 bc:1; 9662306a36Sopenharmony_ci u32 seq:12; /* word 2 */ 9762306a36Sopenharmony_ci u32 frag:4; 9862306a36Sopenharmony_ci u32 nextpktlen:14; 9962306a36Sopenharmony_ci u32 nextind:1; 10062306a36Sopenharmony_ci u32 rsvd:1; 10162306a36Sopenharmony_ci u32 rxmcs:6; /* word 3 */ 10262306a36Sopenharmony_ci u32 rxht:1; 10362306a36Sopenharmony_ci u32 amsdu:1; 10462306a36Sopenharmony_ci u32 splcp:1; 10562306a36Sopenharmony_ci u32 bandwidth:1; 10662306a36Sopenharmony_ci u32 htc:1; 10762306a36Sopenharmony_ci u32 tcpchk_rpt:1; 10862306a36Sopenharmony_ci u32 ipcchk_rpt:1; 10962306a36Sopenharmony_ci u32 tcpchk_valid:1; 11062306a36Sopenharmony_ci u32 hwpcerr:1; 11162306a36Sopenharmony_ci u32 hwpcind:1; 11262306a36Sopenharmony_ci u32 iv0:16; 11362306a36Sopenharmony_ci u32 iv1; /* word 4 */ 11462306a36Sopenharmony_ci u32 tsfl; /* word 5 */ 11562306a36Sopenharmony_ci u32 bufferaddress; /* word 6 */ 11662306a36Sopenharmony_ci u32 bufferaddress64; /* word 7 */ 11762306a36Sopenharmony_ci} __packed; 11862306a36Sopenharmony_ci 11962306a36Sopenharmony_cienum rtl_desc_qsel rtl92c_map_hwqueue_to_fwqueue(u16 fc, 12062306a36Sopenharmony_ci unsigned int 12162306a36Sopenharmony_ci skb_queue); 12262306a36Sopenharmony_civoid rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw, 12362306a36Sopenharmony_ci struct sk_buff *skb, 12462306a36Sopenharmony_ci struct rtl_stats *pstats, 12562306a36Sopenharmony_ci struct rx_desc_92c *pdesc, 12662306a36Sopenharmony_ci struct rx_fwinfo_92c *p_drvinfo); 12762306a36Sopenharmony_ci 12862306a36Sopenharmony_ci/*--------------------------------------------------------------- 12962306a36Sopenharmony_ci * Card disable functions 13062306a36Sopenharmony_ci *---------------------------------------------------------------*/ 13162306a36Sopenharmony_ci 13262306a36Sopenharmony_ci#endif 133