]> bbs.cooldavid.org Git - net-next-2.6.git/blame - drivers/net/wireless/libertas/dev.h
Merge branch 'master' of /repos/git/net-next-2.6
[net-next-2.6.git] / drivers / net / wireless / libertas / dev.h
CommitLineData
876c9d3a
MT
1/**
2 * This file contains definitions and data structures specific
3 * to Marvell 802.11 NIC. It contains the Device Information
aa21c004 4 * structure struct lbs_private..
876c9d3a 5 */
10078321
HS
6#ifndef _LBS_DEV_H_
7#define _LBS_DEV_H_
876c9d3a 8
5e8e8b57 9#include "mesh.h"
2d46502d
HS
10#include "scan.h"
11#include "assoc.h"
876c9d3a 12
45465487 13#include <linux/kfifo.h>
876c9d3a
MT
14
15/** sleep_params */
16struct sleep_params {
3fbe104c
DW
17 uint16_t sp_error;
18 uint16_t sp_offset;
19 uint16_t sp_stabletime;
20 uint8_t sp_calcontrol;
21 uint8_t sp_extsleepclk;
22 uint16_t sp_reserved;
876c9d3a
MT
23};
24
876c9d3a
MT
25
26/** Private structure for the MV device */
69f9032d 27struct lbs_private {
5e047692
HS
28
29 /* Basic networking */
30 struct net_device *dev;
31 u32 connect_status;
32 int infra_open;
33 struct work_struct mcast_work;
34 u32 nr_of_multicastmacaddr;
35 u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
36
37 /* CFG80211 */
ff9fc791 38 struct wireless_dev *wdev;
73714004 39 bool wiphy_registered;
5e047692
HS
40
41 /* Mesh */
42 struct net_device *mesh_dev; /* Virtual device */
4143a23d 43#ifdef CONFIG_LIBERTAS_MESH
5e047692
HS
44 u32 mesh_connect_status;
45 struct lbs_mesh_stats mstats;
876c9d3a 46 int mesh_open;
5e047692
HS
47 uint16_t mesh_tlv;
48 u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
49 u8 mesh_ssid_len;
4143a23d 50#endif
876c9d3a 51
5e047692 52 /* Monitor mode */
965f8bbc 53 struct net_device *rtap_net_dev;
5e047692 54 u32 monitormode;
876c9d3a 55
5e047692 56 /* Debugfs */
876c9d3a
MT
57 struct dentry *debugfs_dir;
58 struct dentry *debugfs_debug;
59 struct dentry *debugfs_files[6];
876c9d3a
MT
60 struct dentry *events_dir;
61 struct dentry *debugfs_events_files[6];
876c9d3a
MT
62 struct dentry *regs_dir;
63 struct dentry *debugfs_regs_files[6];
64
5e047692 65 /* Hardware debugging */
876c9d3a
MT
66 u32 mac_offset;
67 u32 bbp_offset;
68 u32 rf_offset;
5e047692
HS
69 struct lbs_offset_value offsetvalue;
70
71 /* Power management */
72 u16 psmode;
73 u32 psstate;
74 u8 needtowakeup;
876c9d3a 75
5e047692 76 /* Deep sleep */
49125454 77 int is_deep_sleep;
66fceb69 78 int deep_sleep_required;
49125454 79 int is_auto_deep_sleep_enabled;
49125454 80 int wakeup_dev_required;
49125454 81 int is_activity_detected;
5e047692
HS
82 int auto_deep_sleep_timeout; /* in ms */
83 wait_queue_head_t ds_awake_q;
84 struct timer_list auto_deepsleep_timer;
208fdd2f 85
66fceb69
AK
86 /* Host sleep*/
87 int is_host_sleep_configured;
88 int is_host_sleep_activated;
89 wait_queue_head_t host_sleep_q;
90
5e047692
HS
91 /* Hardware access */
92 void *card;
93 u8 fw_ready;
94 u8 surpriseremoved;
69f9032d 95 int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
edf5dabf 96 void (*reset_card) (struct lbs_private *priv);
49125454
AK
97 int (*enter_deep_sleep) (struct lbs_private *priv);
98 int (*exit_deep_sleep) (struct lbs_private *priv);
99 int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
876c9d3a 100
5e047692 101 /* Adapter info (from EEPROM) */
dac10a9f 102 u32 fwrelease;
876c9d3a 103 u32 fwcapinfo;
5e047692
HS
104 u16 regioncode;
105 u8 current_addr[ETH_ALEN];
876c9d3a 106
5e047692
HS
107 /* Command download */
108 u8 dnld_sent;
109 /* bit0 1/0=data_sent/data_tx_done,
110 bit1 1/0=cmd_sent/cmd_tx_done,
111 all other bits reserved 0 */
876c9d3a 112 u16 seqnum;
876c9d3a 113 struct cmd_ctrl_node *cmd_array;
876c9d3a 114 struct cmd_ctrl_node *cur_cmd;
5e047692
HS
115 struct list_head cmdfreeq; /* free command buffers */
116 struct list_head cmdpendingq; /* pending command buffers */
876c9d3a 117 wait_queue_head_t cmd_pending;
5e047692 118 struct timer_list command_timer;
5e047692 119 int cmd_timed_out;
876c9d3a 120
7919b89c 121 /* Command responses sent from the hardware to the driver */
5e047692 122 int cur_cmd_retcode;
7919b89c
HS
123 u8 resp_idx;
124 u8 resp_buf[2][LBS_UPLD_SIZE];
125 u32 resp_len[2];
126
127 /* Events sent from hardware to driver */
45465487 128 struct kfifo event_fifo;
7919b89c 129
5e047692
HS
130 /** thread to service interrupts */
131 struct task_struct *main_thread;
132 wait_queue_head_t waitq;
133 struct workqueue_struct *work_thread;
876c9d3a 134
5e047692
HS
135 /** Encryption stuff */
136 struct lbs_802_11_security secinfo;
137 struct enc_key wpa_mcast_key;
138 struct enc_key wpa_unicast_key;
139 u8 wpa_ie[MAX_WPA_IE_LEN];
140 u8 wpa_ie_len;
141 u16 wep_tx_keyidx;
142 struct enc_key wep_keys[4];
921ca03c 143 u8 authtype_auto;
876c9d3a 144
5e047692
HS
145 /* Wake On LAN */
146 uint32_t wol_criteria;
147 uint8_t wol_gpio;
148 uint8_t wol_gap;
876c9d3a 149
5e047692
HS
150 /* Transmitting */
151 int tx_pending_len; /* -1 while building packet */
152 u8 tx_pending_buf[LBS_UPLD_SIZE];
153 /* protected by hard_start_xmit serialization */
876c9d3a 154 u8 txretrycount;
876c9d3a 155 struct sk_buff *currenttxskb;
876c9d3a 156
5e047692
HS
157 /* Locks */
158 struct mutex lock;
159 spinlock_t driver_lock;
160
161 /* NIC/link operation characteristics */
d9e9778c 162 u16 mac_control;
5e047692 163 u8 radio_on;
c14951fe 164 u8 channel;
87c8c72d
DW
165 s16 txpower_cur;
166 s16 txpower_min;
167 s16 txpower_max;
876c9d3a 168
5e047692
HS
169 /** Scanning */
170 struct delayed_work scan_work;
171 int scan_channel;
172 /* remember which channel was scanned last, != 0 if currently scanning */
173 u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
174 u8 scan_ssid_len;
876c9d3a 175
5e047692
HS
176 /* Associating */
177 struct delayed_work assoc_work;
178 struct current_bss_params curbssparams;
179 u8 mode;
180 struct list_head network_list;
181 struct list_head network_free_list;
182 struct bss_descriptor *networks;
e76850d6
DW
183 struct assoc_request * pending_assoc_req;
184 struct assoc_request * in_progress_assoc_req;
5e047692 185 uint16_t enablehwauto;
876c9d3a 186
5e047692
HS
187 /* ADHOC */
188 u16 beacon_period;
189 u8 beacon_enable;
190 u8 adhoccreate;
876c9d3a 191
5e047692
HS
192 /* WEXT */
193 char name[DEV_NAME_LEN];
194 u8 nodename[16];
195 struct iw_statistics wstats;
196 u8 cur_rate;
197#define MAX_REGION_CHANNEL_NUM 2
198 struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
876c9d3a 199
876c9d3a 200 /** Requested Signal Strength*/
876c9d3a
MT
201 u16 SNR[MAX_TYPE_B][MAX_TYPE_AVG];
202 u16 NF[MAX_TYPE_B][MAX_TYPE_AVG];
203 u8 RSSI[MAX_TYPE_B][MAX_TYPE_AVG];
204 u8 rawSNR[DEFAULT_DATA_AVG_FACTOR];
205 u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
206 u16 nextSNRNF;
207 u16 numSNRNF;
876c9d3a
MT
208};
209
f539f2ef
HS
210extern struct cmd_confirm_sleep confirm_sleep;
211
10078321 212#endif