2 * Definitions for RTL818x hardware
4 * Copyright 2007 Michael Wu <flamingice@sourmilk.net>
5 * Copyright 2007 Andrea Merello <andreamrl@tiscali.it>
7 * Based on the r8187 driver, which is:
8 * Copyright 2005 Andrea Merello <andreamrl@tiscali.it>, et al.
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
37 #define RTL818X_CMD_TX_ENABLE (1 << 2)
38 #define RTL818X_CMD_RX_ENABLE (1 << 3)
39 #define RTL818X_CMD_RESET (1 << 4)
43 #define RTL818X_INT_RX_OK (1 << 0)
44 #define RTL818X_INT_RX_ERR (1 << 1)
45 #define RTL818X_INT_TXL_OK (1 << 2)
46 #define RTL818X_INT_TXL_ERR (1 << 3)
47 #define RTL818X_INT_RX_DU (1 << 4)
48 #define RTL818X_INT_RX_FO (1 << 5)
49 #define RTL818X_INT_TXN_OK (1 << 6)
50 #define RTL818X_INT_TXN_ERR (1 << 7)
51 #define RTL818X_INT_TXH_OK (1 << 8)
52 #define RTL818X_INT_TXH_ERR (1 << 9)
53 #define RTL818X_INT_TXB_OK (1 << 10)
54 #define RTL818X_INT_TXB_ERR (1 << 11)
55 #define RTL818X_INT_ATIM (1 << 12)
56 #define RTL818X_INT_BEACON (1 << 13)
57 #define RTL818X_INT_TIME_OUT (1 << 14)
58 #define RTL818X_INT_TX_FO (1 << 15)
60 #define RTL818X_TX_CONF_LOOPBACK_MAC (1 << 17)
61 #define RTL818X_TX_CONF_NO_ICV (1 << 19)
62 #define RTL818X_TX_CONF_DISCW (1 << 20)
63 #define RTL818X_TX_CONF_R8180_ABCD (2 << 25)
64 #define RTL818X_TX_CONF_R8180_F (3 << 25)
65 #define RTL818X_TX_CONF_R8185_ABC (4 << 25)
66 #define RTL818X_TX_CONF_R8185_D (5 << 25)
67 #define RTL818X_TX_CONF_HWVER_MASK (7 << 25)
68 #define RTL818X_TX_CONF_CW_MIN (1 << 31)
70 #define RTL818X_RX_CONF_MONITOR (1 << 0)
71 #define RTL818X_RX_CONF_NICMAC (1 << 1)
72 #define RTL818X_RX_CONF_MULTICAST (1 << 2)
73 #define RTL818X_RX_CONF_BROADCAST (1 << 3)
74 #define RTL818X_RX_CONF_DATA (1 << 18)
75 #define RTL818X_RX_CONF_CTRL (1 << 19)
76 #define RTL818X_RX_CONF_MGMT (1 << 20)
77 #define RTL818X_RX_CONF_BSSID (1 << 23)
78 #define RTL818X_RX_CONF_RX_AUTORESETPHY (1 << 28)
79 #define RTL818X_RX_CONF_ONLYERLPKT (1 << 31)
83 #define RTL818X_EEPROM_CMD_READ (1 << 0)
84 #define RTL818X_EEPROM_CMD_WRITE (1 << 1)
85 #define RTL818X_EEPROM_CMD_CK (1 << 2)
86 #define RTL818X_EEPROM_CMD_CS (1 << 3)
87 #define RTL818X_EEPROM_CMD_NORMAL (0 << 6)
88 #define RTL818X_EEPROM_CMD_LOAD (1 << 6)
89 #define RTL818X_EEPROM_CMD_PROGRAM (2 << 6)
90 #define RTL818X_EEPROM_CMD_CONFIG (3 << 6)
96 #define RTL818X_MSR_NO_LINK (0 << 2)
97 #define RTL818X_MSR_ADHOC (1 << 2)
98 #define RTL818X_MSR_INFRA (2 << 2)
100 #define RTL818X_CONFIG3_ANAPARAM_WRITE (1 << 6)
102 #define RTL818X_CONFIG4_POWEROFF (1 << 6)
103 #define RTL818X_CONFIG4_VCOOFF (1 << 7)
109 __le16 BEACON_INTERVAL;
111 __le16 BEACON_INTERVAL_TIME;
112 __le16 ATIMTR_INTERVAL;
125 #define RTL818X_TX_AGC_CTL_PERPACKET_GAIN_SHIFT (1 << 0)
126 #define RTL818X_TX_AGC_CTL_PERPACKET_ANTSEL_SHIFT (1 << 1)
127 #define RTL818X_TX_AGC_CTL_FEEDBACK_ANT (1 << 2)
139 #define RTL818X_CW_CONF_PERPACKET_CW_SHIFT (1 << 0)
140 #define RTL818X_CW_CONF_PERPACKET_RETRY_SHIFT (1 << 1)
154 } __attribute__((packed));
156 static const struct ieee80211_rate rtl818x_rates[] = {
159 .flags = IEEE80211_RATE_CCK },
162 .flags = IEEE80211_RATE_CCK },
165 .flags = IEEE80211_RATE_CCK },
168 .flags = IEEE80211_RATE_CCK },
171 .flags = IEEE80211_RATE_OFDM },
174 .flags = IEEE80211_RATE_OFDM },
177 .flags = IEEE80211_RATE_OFDM },
180 .flags = IEEE80211_RATE_OFDM },
183 .flags = IEEE80211_RATE_OFDM },
186 .flags = IEEE80211_RATE_OFDM },
189 .flags = IEEE80211_RATE_OFDM },
192 .flags = IEEE80211_RATE_OFDM },
195 static const struct ieee80211_channel rtl818x_channels[] = {
226 #endif /* RTL818X_H */