1 /******************************************************************************
3 * Copyright(c) 2009-2012 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
18 * The full GNU General Public License is included in this distribution in the
19 * file called LICENSE.
21 * Contact Information:
22 * wlanfae <wlanfae@realtek.com>
23 * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park,
24 * Hsinchu 300, Taiwan.
26 * Larry Finger <Larry.Finger@lwfinger.net>
28 *****************************************************************************/
30 #ifndef __RTL92C_MAC_H__
31 #define __RTL92C_MAC_H__
33 #define LLT_LAST_ENTRY_OF_TX_PKT_BUFFER 255
34 #define DRIVER_EARLY_INT_TIME 0x05
35 #define BCN_DMA_ATIME_INT_TIME 0x02
37 void rtl92c_read_chip_version(struct ieee80211_hw *hw);
38 bool rtl92c_llt_write(struct ieee80211_hw *hw, u32 address, u32 data);
39 bool rtl92c_init_llt_table(struct ieee80211_hw *hw, u32 boundary);
40 void rtl92c_set_key(struct ieee80211_hw *hw, u32 key_index,
41 u8 *p_macaddr, bool is_group, u8 enc_algo,
42 bool is_wepkey, bool clear_all);
43 void rtl92c_enable_interrupt(struct ieee80211_hw *hw);
44 void rtl92c_disable_interrupt(struct ieee80211_hw *hw);
45 void rtl92c_set_qos(struct ieee80211_hw *hw, int aci);
48 /*---------------------------------------------------------------
49 * Hardware init functions
50 *---------------------------------------------------------------*/
51 void rtl92c_set_mac_addr(struct ieee80211_hw *hw, const u8 *addr);
52 void rtl92c_init_interrupt(struct ieee80211_hw *hw);
53 void rtl92c_init_driver_info_size(struct ieee80211_hw *hw, u8 size);
55 int rtl92c_set_network_type(struct ieee80211_hw *hw, enum nl80211_iftype type);
56 void rtl92c_init_network_type(struct ieee80211_hw *hw);
57 void rtl92c_init_adaptive_ctrl(struct ieee80211_hw *hw);
58 void rtl92c_init_rate_fallback(struct ieee80211_hw *hw);
60 void rtl92c_init_edca_param(struct ieee80211_hw *hw,
67 void rtl92c_init_edca(struct ieee80211_hw *hw);
68 void rtl92c_init_ampdu_aggregation(struct ieee80211_hw *hw);
69 void rtl92c_init_beacon_max_error(struct ieee80211_hw *hw, bool infra_mode);
70 void rtl92c_init_rdg_setting(struct ieee80211_hw *hw);
71 void rtl92c_init_retry_function(struct ieee80211_hw *hw);
73 void rtl92c_init_beacon_parameters(struct ieee80211_hw *hw,
74 enum version_8192c version);
76 void rtl92c_disable_fast_edca(struct ieee80211_hw *hw);
77 void rtl92c_set_min_space(struct ieee80211_hw *hw, bool is2T);
80 u16 rtl92c_get_mgt_filter(struct ieee80211_hw *hw);
81 void rtl92c_set_mgt_filter(struct ieee80211_hw *hw, u16 filter);
82 u16 rtl92c_get_ctrl_filter(struct ieee80211_hw *hw);
83 void rtl92c_set_ctrl_filter(struct ieee80211_hw *hw, u16 filter);
84 u16 rtl92c_get_data_filter(struct ieee80211_hw *hw);
85 void rtl92c_set_data_filter(struct ieee80211_hw *hw, u16 filter);
88 u32 rtl92c_get_txdma_status(struct ieee80211_hw *hw);
90 struct rx_fwinfo_92c {
122 u32 macid:5; /* word 1 */
136 u32 seq:12; /* word 2 */
141 u32 rxmcs:6; /* word 3 */
153 u32 iv1; /* word 4 */
154 u32 tsfl; /* word 5 */
155 u32 bufferaddress; /* word 6 */
156 u32 bufferaddress64; /* word 7 */
159 enum rtl_desc_qsel rtl92c_map_hwqueue_to_fwqueue(u16 fc,
162 void rtl92c_translate_rx_signal_stuff(struct ieee80211_hw *hw,
164 struct rtl_stats *pstats,
165 struct rx_desc_92c *pdesc,
166 struct rx_fwinfo_92c *p_drvinfo);
168 /*---------------------------------------------------------------
169 * Card disable functions
170 *---------------------------------------------------------------*/