18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/* Copyright(c) 2009-2012  Realtek Corporation.*/
38c2ecf20Sopenharmony_ci
48c2ecf20Sopenharmony_ci#ifndef __RTL92CU_HW_H__
58c2ecf20Sopenharmony_ci#define __RTL92CU_HW_H__
68c2ecf20Sopenharmony_ci
78c2ecf20Sopenharmony_ci#define H2C_RA_MASK	6
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER		255
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#define RX_PAGE_SIZE_REG_VALUE			PBP_128
128c2ecf20Sopenharmony_ci/* Note: We will divide number of page equally for each queue
138c2ecf20Sopenharmony_ci * other than public queue! */
148c2ecf20Sopenharmony_ci#define TX_TOTAL_PAGE_NUMBER			0xF8
158c2ecf20Sopenharmony_ci#define TX_PAGE_BOUNDARY			(TX_TOTAL_PAGE_NUMBER + 1)
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#define CHIP_B_PAGE_NUM_PUBQ			0xE7
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* For Test Chip Setting
208c2ecf20Sopenharmony_ci * (HPQ + LPQ + PUBQ) shall be TX_TOTAL_PAGE_NUMBER */
218c2ecf20Sopenharmony_ci#define CHIP_A_PAGE_NUM_PUBQ			0x7E
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci/* For Chip A Setting */
248c2ecf20Sopenharmony_ci#define WMM_CHIP_A_TX_TOTAL_PAGE_NUMBER		0xF5
258c2ecf20Sopenharmony_ci#define WMM_CHIP_A_TX_PAGE_BOUNDARY		\
268c2ecf20Sopenharmony_ci	(WMM_CHIP_A_TX_TOTAL_PAGE_NUMBER + 1) /* F6 */
278c2ecf20Sopenharmony_ci
288c2ecf20Sopenharmony_ci#define WMM_CHIP_A_PAGE_NUM_PUBQ		0xA3
298c2ecf20Sopenharmony_ci#define WMM_CHIP_A_PAGE_NUM_HPQ			0x29
308c2ecf20Sopenharmony_ci#define WMM_CHIP_A_PAGE_NUM_LPQ			0x29
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci/* Note: For Chip B Setting ,modify later */
338c2ecf20Sopenharmony_ci#define WMM_CHIP_B_TX_TOTAL_PAGE_NUMBER		0xF5
348c2ecf20Sopenharmony_ci#define WMM_CHIP_B_TX_PAGE_BOUNDARY		\
358c2ecf20Sopenharmony_ci	(WMM_CHIP_B_TX_TOTAL_PAGE_NUMBER + 1) /* F6 */
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_PUBQ		0xB0
388c2ecf20Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_HPQ			0x29
398c2ecf20Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_LPQ			0x1C
408c2ecf20Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_NPQ			0x1C
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci#define BOARD_TYPE_NORMAL_MASK			0xE0
438c2ecf20Sopenharmony_ci#define BOARD_TYPE_TEST_MASK			0x0F
448c2ecf20Sopenharmony_ci
458c2ecf20Sopenharmony_ci/* should be renamed and moved to another file */
468c2ecf20Sopenharmony_cienum _BOARD_TYPE_8192CUSB {
478c2ecf20Sopenharmony_ci	BOARD_USB_DONGLE		= 0,	/* USB dongle */
488c2ecf20Sopenharmony_ci	BOARD_USB_HIGH_PA		= 1,	/* USB dongle - high power PA */
498c2ecf20Sopenharmony_ci	BOARD_MINICARD			= 2,	/* Minicard */
508c2ecf20Sopenharmony_ci	BOARD_USB_SOLO			= 3,	/* USB solo-Slim module */
518c2ecf20Sopenharmony_ci	BOARD_USB_COMBO			= 4,	/* USB Combo-Slim module */
528c2ecf20Sopenharmony_ci};
538c2ecf20Sopenharmony_ci
548c2ecf20Sopenharmony_ci#define IS_HIGHT_PA(boardtype)		\
558c2ecf20Sopenharmony_ci	((boardtype == BOARD_USB_HIGH_PA) ? true : false)
568c2ecf20Sopenharmony_ci
578c2ecf20Sopenharmony_ci#define RTL92C_DRIVER_INFO_SIZE				4
588c2ecf20Sopenharmony_civoid rtl92cu_read_eeprom_info(struct ieee80211_hw *hw);
598c2ecf20Sopenharmony_civoid rtl92cu_enable_hw_security_config(struct ieee80211_hw *hw);
608c2ecf20Sopenharmony_ciint rtl92cu_hw_init(struct ieee80211_hw *hw);
618c2ecf20Sopenharmony_civoid rtl92cu_card_disable(struct ieee80211_hw *hw);
628c2ecf20Sopenharmony_ciint rtl92cu_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type);
638c2ecf20Sopenharmony_civoid rtl92cu_set_beacon_related_registers(struct ieee80211_hw *hw);
648c2ecf20Sopenharmony_civoid rtl92cu_set_beacon_interval(struct ieee80211_hw *hw);
658c2ecf20Sopenharmony_civoid rtl92cu_update_interrupt_mask(struct ieee80211_hw *hw,
668c2ecf20Sopenharmony_ci				   u32 add_msr, u32 rm_msr);
678c2ecf20Sopenharmony_civoid rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val);
688c2ecf20Sopenharmony_civoid rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val);
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_civoid rtl92cu_update_channel_access_setting(struct ieee80211_hw *hw);
718c2ecf20Sopenharmony_cibool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid);
728c2ecf20Sopenharmony_civoid rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid);
738c2ecf20Sopenharmony_ciint rtl92c_download_fw(struct ieee80211_hw *hw);
748c2ecf20Sopenharmony_civoid rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode);
758c2ecf20Sopenharmony_civoid rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus);
768c2ecf20Sopenharmony_civoid rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw,
778c2ecf20Sopenharmony_ci			 u8 element_id, u32 cmd_len, u8 *p_cmdbuffer);
788c2ecf20Sopenharmony_cibool rtl92cu_phy_mac_config(struct ieee80211_hw *hw);
798c2ecf20Sopenharmony_civoid rtl92cu_update_hal_rate_tbl(struct ieee80211_hw *hw,
808c2ecf20Sopenharmony_ci				 struct ieee80211_sta *sta,
818c2ecf20Sopenharmony_ci				 u8 rssi_level, bool update_bw);
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_ci#endif
84