2 * Shared defines for all mac80211 Prism54 code
6 * Based on the islsm (softmac prism54) driver, which is:
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
17 #ifdef CONFIG_P54_LEDS
18 #include <linux/leds.h>
19 #endif /* CONFIG_P54_LEDS */
21 #define ISL38XX_DEV_FIRMWARE_ADDR 0x20000
23 #define BR_CODE_MIN 0x80000000
24 #define BR_CODE_COMPONENT_ID 0x80000001
25 #define BR_CODE_COMPONENT_VERSION 0x80000002
26 #define BR_CODE_DEPENDENT_IF 0x80000003
27 #define BR_CODE_EXPOSED_IF 0x80000004
28 #define BR_CODE_DESCR 0x80000101
29 #define BR_CODE_MAX 0x8FFFFFFF
30 #define BR_CODE_END_OF_BRA 0xFF0000FF
31 #define LEGACY_BR_CODE_END_OF_BRA 0xFFFFFFFF
39 /* Interface role definitions */
40 #define BR_INTERFACE_ROLE_SERVER 0x0000
41 #define BR_INTERFACE_ROLE_CLIENT 0x8000
43 #define BR_DESC_PRIV_CAP_WEP BIT(0)
44 #define BR_DESC_PRIV_CAP_TKIP BIT(1)
45 #define BR_DESC_PRIV_CAP_MICHAEL BIT(2)
46 #define BR_DESC_PRIV_CAP_CCX_CP BIT(3)
47 #define BR_DESC_PRIV_CAP_CCX_MIC BIT(4)
48 #define BR_DESC_PRIV_CAP_AESCCMP BIT(5)
68 #define FW_FMAC 0x464d4143
69 #define FW_LM86 0x4c4d3836
70 #define FW_LM87 0x4c4d3837
71 #define FW_LM20 0x4c4d3230
73 struct bootrec_comp_id {
77 struct bootrec_comp_ver {
87 /* provide 16 bytes for the transport back-end */
88 #define P54_TX_INFO_DATA_SIZE 16
90 /* stored in ieee80211_tx_info's rate_driver_data */
95 void *data[P54_TX_INFO_DATA_SIZE / sizeof(void *)];
102 #define P54_MAX_CTRL_FRAME_LEN 0x1000
104 #define P54_SET_QUEUE(queue, ai_fs, cw_min, cw_max, _txop) \
106 queue.aifs = cpu_to_le16(ai_fs); \
107 queue.cwmin = cpu_to_le16(cw_min); \
108 queue.cwmax = cpu_to_le16(cw_max); \
109 queue.txop = cpu_to_le16(_txop); \
112 struct p54_edcf_queue_param {
119 struct p54_rssi_linear_approximation {
126 struct p54_cal_database {
134 #define EEPROM_READBACK_LEN 0x3fc
144 #ifdef CONFIG_P54_LEDS
146 #define P54_LED_MAX_NAME_LEN 31
149 struct ieee80211_hw *hw_dev;
150 struct led_classdev led_dev;
151 char name[P54_LED_MAX_NAME_LEN + 1];
153 unsigned int toggled;
155 unsigned int registered;
158 #endif /* CONFIG_P54_LEDS */
160 struct p54_tx_queue_stats {
167 struct ieee80211_hw *hw;
168 struct ieee80211_vif *vif;
169 void (*tx)(struct ieee80211_hw *dev, struct sk_buff *skb);
170 int (*open)(struct ieee80211_hw *dev);
171 void (*stop)(struct ieee80211_hw *dev);
172 struct sk_buff_head tx_pending;
173 struct sk_buff_head tx_queue;
174 struct mutex conf_mutex;
176 /* memory management (as seen by the firmware) */
183 /* firmware/hardware info */
184 unsigned int tx_hdr_len;
186 unsigned int fw_interface;
189 /* (e)DCF / QOS state */
191 spinlock_t tx_stats_lock;
192 struct p54_tx_queue_stats tx_stats[8];
193 struct p54_edcf_queue_param qos_params[8];
197 u8 rx_diversity_mask;
198 u8 tx_diversity_mask;
199 unsigned int output_power;
201 /* calibration, output power limit and rssi<->dBm conversation data */
202 struct pda_iq_autocal_entry *iq_autocal;
203 unsigned int iq_autocal_len;
204 struct p54_cal_database *curve_data;
205 struct p54_cal_database *output_limit;
206 struct p54_rssi_linear_approximation rssical_db[IEEE80211_NUM_BANDS];
207 struct ieee80211_supported_band *band_table[IEEE80211_NUM_BANDS];
210 u8 mac_addr[ETH_ALEN];
213 unsigned int filter_flags;
215 u32 tsf_low32, tsf_high32;
218 bool powersave_override;
219 __le32 beacon_req_id;
220 struct completion beacon_comp;
222 /* cryptographic engine information */
225 unsigned long *used_rxkeys;
228 #ifdef CONFIG_P54_LEDS
229 struct p54_led_dev leds[4];
230 struct delayed_work led_work;
231 #endif /* CONFIG_P54_LEDS */
232 u16 softled_state; /* bit field of glowing LEDs */
235 struct ieee80211_low_level_stats stats;
236 struct delayed_work work;
238 /* eeprom handling */
240 struct completion eeprom_comp;
241 struct mutex eeprom_mutex;
244 /* interfaces for the drivers */
245 int p54_rx(struct ieee80211_hw *dev, struct sk_buff *skb);
246 void p54_free_skb(struct ieee80211_hw *dev, struct sk_buff *skb);
247 int p54_parse_firmware(struct ieee80211_hw *dev, const struct firmware *fw);
248 int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len);
249 int p54_read_eeprom(struct ieee80211_hw *dev);
251 struct ieee80211_hw *p54_init_common(size_t priv_data_len);
252 int p54_register_common(struct ieee80211_hw *dev, struct device *pdev);
253 void p54_free_common(struct ieee80211_hw *dev);
255 void p54_unregister_common(struct ieee80211_hw *dev);