162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */ 262306a36Sopenharmony_ci/* Copyright(c) 2009-2012 Realtek Corporation.*/ 362306a36Sopenharmony_ci 462306a36Sopenharmony_ci#ifndef __RTL92CU_HW_H__ 562306a36Sopenharmony_ci#define __RTL92CU_HW_H__ 662306a36Sopenharmony_ci 762306a36Sopenharmony_ci#define H2C_RA_MASK 6 862306a36Sopenharmony_ci 962306a36Sopenharmony_ci#define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER 255 1062306a36Sopenharmony_ci 1162306a36Sopenharmony_ci#define RX_PAGE_SIZE_REG_VALUE PBP_128 1262306a36Sopenharmony_ci/* Note: We will divide number of page equally for each queue 1362306a36Sopenharmony_ci * other than public queue! */ 1462306a36Sopenharmony_ci#define TX_TOTAL_PAGE_NUMBER 0xF8 1562306a36Sopenharmony_ci#define TX_PAGE_BOUNDARY (TX_TOTAL_PAGE_NUMBER + 1) 1662306a36Sopenharmony_ci 1762306a36Sopenharmony_ci#define CHIP_B_PAGE_NUM_PUBQ 0xE7 1862306a36Sopenharmony_ci 1962306a36Sopenharmony_ci/* For Test Chip Setting 2062306a36Sopenharmony_ci * (HPQ + LPQ + PUBQ) shall be TX_TOTAL_PAGE_NUMBER */ 2162306a36Sopenharmony_ci#define CHIP_A_PAGE_NUM_PUBQ 0x7E 2262306a36Sopenharmony_ci 2362306a36Sopenharmony_ci/* For Chip A Setting */ 2462306a36Sopenharmony_ci#define WMM_CHIP_A_TX_TOTAL_PAGE_NUMBER 0xF5 2562306a36Sopenharmony_ci#define WMM_CHIP_A_TX_PAGE_BOUNDARY \ 2662306a36Sopenharmony_ci (WMM_CHIP_A_TX_TOTAL_PAGE_NUMBER + 1) /* F6 */ 2762306a36Sopenharmony_ci 2862306a36Sopenharmony_ci#define WMM_CHIP_A_PAGE_NUM_PUBQ 0xA3 2962306a36Sopenharmony_ci#define WMM_CHIP_A_PAGE_NUM_HPQ 0x29 3062306a36Sopenharmony_ci#define WMM_CHIP_A_PAGE_NUM_LPQ 0x29 3162306a36Sopenharmony_ci 3262306a36Sopenharmony_ci/* Note: For Chip B Setting ,modify later */ 3362306a36Sopenharmony_ci#define WMM_CHIP_B_TX_TOTAL_PAGE_NUMBER 0xF5 3462306a36Sopenharmony_ci#define WMM_CHIP_B_TX_PAGE_BOUNDARY \ 3562306a36Sopenharmony_ci (WMM_CHIP_B_TX_TOTAL_PAGE_NUMBER + 1) /* F6 */ 3662306a36Sopenharmony_ci 3762306a36Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_PUBQ 0xB0 3862306a36Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_HPQ 0x29 3962306a36Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_LPQ 0x1C 4062306a36Sopenharmony_ci#define WMM_CHIP_B_PAGE_NUM_NPQ 0x1C 4162306a36Sopenharmony_ci 4262306a36Sopenharmony_ci#define BOARD_TYPE_NORMAL_MASK 0xE0 4362306a36Sopenharmony_ci#define BOARD_TYPE_TEST_MASK 0x0F 4462306a36Sopenharmony_ci 4562306a36Sopenharmony_ci/* should be renamed and moved to another file */ 4662306a36Sopenharmony_cienum _BOARD_TYPE_8192CUSB { 4762306a36Sopenharmony_ci BOARD_USB_DONGLE = 0, /* USB dongle */ 4862306a36Sopenharmony_ci BOARD_USB_HIGH_PA = 1, /* USB dongle - high power PA */ 4962306a36Sopenharmony_ci BOARD_MINICARD = 2, /* Minicard */ 5062306a36Sopenharmony_ci BOARD_USB_SOLO = 3, /* USB solo-Slim module */ 5162306a36Sopenharmony_ci BOARD_USB_COMBO = 4, /* USB Combo-Slim module */ 5262306a36Sopenharmony_ci}; 5362306a36Sopenharmony_ci 5462306a36Sopenharmony_ci#define IS_HIGHT_PA(boardtype) \ 5562306a36Sopenharmony_ci ((boardtype == BOARD_USB_HIGH_PA) ? true : false) 5662306a36Sopenharmony_ci 5762306a36Sopenharmony_ci#define RTL92C_DRIVER_INFO_SIZE 4 5862306a36Sopenharmony_civoid rtl92cu_read_eeprom_info(struct ieee80211_hw *hw); 5962306a36Sopenharmony_civoid rtl92cu_enable_hw_security_config(struct ieee80211_hw *hw); 6062306a36Sopenharmony_ciint rtl92cu_hw_init(struct ieee80211_hw *hw); 6162306a36Sopenharmony_civoid rtl92cu_card_disable(struct ieee80211_hw *hw); 6262306a36Sopenharmony_ciint rtl92cu_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type); 6362306a36Sopenharmony_civoid rtl92cu_set_beacon_related_registers(struct ieee80211_hw *hw); 6462306a36Sopenharmony_civoid rtl92cu_set_beacon_interval(struct ieee80211_hw *hw); 6562306a36Sopenharmony_civoid rtl92cu_update_interrupt_mask(struct ieee80211_hw *hw, 6662306a36Sopenharmony_ci u32 add_msr, u32 rm_msr); 6762306a36Sopenharmony_civoid rtl92cu_get_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 6862306a36Sopenharmony_civoid rtl92cu_set_hw_reg(struct ieee80211_hw *hw, u8 variable, u8 *val); 6962306a36Sopenharmony_ci 7062306a36Sopenharmony_civoid rtl92cu_update_channel_access_setting(struct ieee80211_hw *hw); 7162306a36Sopenharmony_cibool rtl92cu_gpio_radio_on_off_checking(struct ieee80211_hw *hw, u8 * valid); 7262306a36Sopenharmony_civoid rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid); 7362306a36Sopenharmony_ciint rtl92c_download_fw(struct ieee80211_hw *hw); 7462306a36Sopenharmony_civoid rtl92c_set_fw_pwrmode_cmd(struct ieee80211_hw *hw, u8 mode); 7562306a36Sopenharmony_civoid rtl92c_set_fw_joinbss_report_cmd(struct ieee80211_hw *hw, u8 mstatus); 7662306a36Sopenharmony_civoid rtl92c_fill_h2c_cmd(struct ieee80211_hw *hw, 7762306a36Sopenharmony_ci u8 element_id, u32 cmd_len, u8 *p_cmdbuffer); 7862306a36Sopenharmony_cibool rtl92cu_phy_mac_config(struct ieee80211_hw *hw); 7962306a36Sopenharmony_civoid rtl92cu_update_hal_rate_tbl(struct ieee80211_hw *hw, 8062306a36Sopenharmony_ci struct ieee80211_sta *sta, 8162306a36Sopenharmony_ci u8 rssi_level, bool update_bw); 8262306a36Sopenharmony_ci 8362306a36Sopenharmony_ci#endif 84