Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 1 | /****************************************************************************** |
| 2 | * |
| 3 | * Copyright(c) 2009-2010 Realtek Corporation. |
| 4 | * |
| 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. |
| 8 | * |
| 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 |
| 12 | * more details. |
| 13 | * |
| 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 |
| 17 | * |
| 18 | * The full GNU General Public License is included in this distribution in the |
| 19 | * file called LICENSE. |
| 20 | * |
| 21 | * Contact Information: |
| 22 | * wlanfae <wlanfae@realtek.com> |
| 23 | * Realtek Corporation, No. 2, Innovation Road II, Hsinchu Science Park, |
| 24 | * Hsinchu 300, Taiwan. |
| 25 | * |
| 26 | * Larry Finger <Larry.Finger@lwfinger.net> |
| 27 | *****************************************************************************/ |
| 28 | |
| 29 | #ifndef __RTL_BASE_H__ |
| 30 | #define __RTL_BASE_H__ |
| 31 | |
| 32 | #define RTL_DUMMY_OFFSET 0 |
Larry Finger | 62e6397 | 2011-02-11 14:27:46 -0600 | [diff] [blame] | 33 | #define RTL_RX_DESC_SIZE 24 |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 34 | #define RTL_DUMMY_UNIT 8 |
| 35 | #define RTL_TX_DUMMY_SIZE (RTL_DUMMY_OFFSET * RTL_DUMMY_UNIT) |
| 36 | #define RTL_TX_DESC_SIZE 32 |
| 37 | #define RTL_TX_HEADER_SIZE (RTL_TX_DESC_SIZE + RTL_TX_DUMMY_SIZE) |
| 38 | |
| 39 | #define HT_AMSDU_SIZE_4K 3839 |
| 40 | #define HT_AMSDU_SIZE_8K 7935 |
| 41 | |
| 42 | #define MAX_BIT_RATE_40MHZ_MCS15 300 /* Mbps */ |
| 43 | #define MAX_BIT_RATE_40MHZ_MCS7 150 /* Mbps */ |
| 44 | |
| 45 | #define RTL_RATE_COUNT_LEGACY 12 |
| 46 | #define RTL_CHANNEL_COUNT 14 |
| 47 | |
| 48 | #define FRAME_OFFSET_FRAME_CONTROL 0 |
| 49 | #define FRAME_OFFSET_DURATION 2 |
| 50 | #define FRAME_OFFSET_ADDRESS1 4 |
| 51 | #define FRAME_OFFSET_ADDRESS2 10 |
| 52 | #define FRAME_OFFSET_ADDRESS3 16 |
| 53 | #define FRAME_OFFSET_SEQUENCE 22 |
| 54 | #define FRAME_OFFSET_ADDRESS4 24 |
| 55 | |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 56 | |
| 57 | #define SET_80211_PS_POLL_AID(_hdr, _val) \ |
Larry Finger | 9e0bc67 | 2011-02-19 16:30:02 -0600 | [diff] [blame] | 58 | (*(u16 *)((u8 *)(_hdr) + 2) = le16_to_cpu(_val)) |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 59 | #define SET_80211_PS_POLL_BSSID(_hdr, _val) \ |
Larry Finger | 9e0bc67 | 2011-02-19 16:30:02 -0600 | [diff] [blame] | 60 | memcpy(((u8 *)(_hdr)) + 4, (u8 *)(_val), ETH_ALEN) |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 61 | #define SET_80211_PS_POLL_TA(_hdr, _val) \ |
Larry Finger | 9e0bc67 | 2011-02-19 16:30:02 -0600 | [diff] [blame] | 62 | memcpy(((u8 *)(_hdr)) + 10, (u8 *)(_val), ETH_ALEN) |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 63 | |
| 64 | #define SET_80211_HDR_DURATION(_hdr, _val) \ |
Larry Finger | 9e0bc67 | 2011-02-19 16:30:02 -0600 | [diff] [blame] | 65 | (*(u16 *)((u8 *)(_hdr) + FRAME_OFFSET_DURATION) = le16_to_cpu(_val)) |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 66 | #define SET_80211_HDR_ADDRESS1(_hdr, _val) \ |
Larry Finger | 9e0bc67 | 2011-02-19 16:30:02 -0600 | [diff] [blame] | 67 | memcpy((u8 *)(_hdr)+FRAME_OFFSET_ADDRESS1, (u8*)(_val), ETH_ALEN) |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 68 | #define SET_80211_HDR_ADDRESS2(_hdr, _val) \ |
Larry Finger | 9e0bc67 | 2011-02-19 16:30:02 -0600 | [diff] [blame] | 69 | memcpy((u8 *)(_hdr) + FRAME_OFFSET_ADDRESS2, (u8 *)(_val), ETH_ALEN) |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 70 | #define SET_80211_HDR_ADDRESS3(_hdr, _val) \ |
Larry Finger | 9e0bc67 | 2011-02-19 16:30:02 -0600 | [diff] [blame] | 71 | memcpy((u8 *)(_hdr)+FRAME_OFFSET_ADDRESS3, (u8 *)(_val), ETH_ALEN) |
Larry Finger | 0c81733 | 2010-12-08 11:12:31 -0600 | [diff] [blame] | 72 | |
| 73 | int rtl_init_core(struct ieee80211_hw *hw); |
| 74 | void rtl_deinit_core(struct ieee80211_hw *hw); |
| 75 | void rtl_init_rx_config(struct ieee80211_hw *hw); |
| 76 | void rtl_init_rfkill(struct ieee80211_hw *hw); |
| 77 | void rtl_deinit_rfkill(struct ieee80211_hw *hw); |
| 78 | |
| 79 | void rtl_watch_dog_timer_callback(unsigned long data); |
| 80 | void rtl_deinit_deferred_work(struct ieee80211_hw *hw); |
| 81 | |
| 82 | bool rtl_action_proc(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx); |
| 83 | bool rtl_tx_mgmt_proc(struct ieee80211_hw *hw, struct sk_buff *skb); |
| 84 | u8 rtl_is_special_data(struct ieee80211_hw *hw, struct sk_buff *skb, u8 is_tx); |
| 85 | |
| 86 | void rtl_watch_dog_timer_callback(unsigned long data); |
| 87 | int rtl_tx_agg_start(struct ieee80211_hw *hw, const u8 *ra, |
| 88 | u16 tid, u16 *ssn); |
| 89 | int rtl_tx_agg_stop(struct ieee80211_hw *hw, const u8 *ra, u16 tid); |
| 90 | void rtl_watchdog_wq_callback(void *data); |
| 91 | |
| 92 | void rtl_get_tcb_desc(struct ieee80211_hw *hw, |
| 93 | struct ieee80211_tx_info *info, |
| 94 | struct sk_buff *skb, struct rtl_tcb_desc *tcb_desc); |
| 95 | |
| 96 | extern struct attribute_group rtl_attribute_group; |
| 97 | #endif |