aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas/dev.h
diff options
context:
space:
mode:
authorHolger Schurig <hs4233@mail.mn-solutions.de>2009-10-22 09:30:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:37 -0400
commit5e047692245c7b8d338ddeece156721d594ca985 (patch)
treed5fb31fc22485d4dd2d284dcdccc7f83dd6ec518 /drivers/net/wireless/libertas/dev.h
parent2d46502dce3c79c3c15ac537cb271911f58d12d1 (diff)
libertas: sort variables in struct lbs_private
Having the variables in logical groups allows us to easier #ifdef stuff out. No functional change. Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas/dev.h')
-rw-r--r--drivers/net/wireless/libertas/dev.h257
1 files changed, 104 insertions, 153 deletions
diff --git a/drivers/net/wireless/libertas/dev.h b/drivers/net/wireless/libertas/dev.h
index cc245820d3f..27f0f1f2a58 100644
--- a/drivers/net/wireless/libertas/dev.h
+++ b/drivers/net/wireless/libertas/dev.h
@@ -35,113 +35,96 @@ struct lbs_mesh_stats {
35 35
36/** Private structure for the MV device */ 36/** Private structure for the MV device */
37struct lbs_private { 37struct lbs_private {
38
39 /* Basic networking */
40 struct net_device *dev;
41 u32 connect_status;
42 int infra_open;
43 struct work_struct mcast_work;
44 u32 nr_of_multicastmacaddr;
45 u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
46
47 /* CFG80211 */
38 struct wireless_dev *wdev; 48 struct wireless_dev *wdev;
49
50 /* Mesh */
51 struct net_device *mesh_dev; /* Virtual device */
52 u32 mesh_connect_status;
53 struct lbs_mesh_stats mstats;
39 int mesh_open; 54 int mesh_open;
40 int mesh_fw_ver; 55 int mesh_fw_ver;
41 int infra_open;
42 int mesh_autostart_enabled; 56 int mesh_autostart_enabled;
57 uint16_t mesh_tlv;
58 u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
59 u8 mesh_ssid_len;
60 struct work_struct sync_channel;
43 61
44 char name[DEV_NAME_LEN]; 62 /* Monitor mode */
45
46 void *card;
47 struct net_device *dev;
48
49 struct net_device *mesh_dev; /* Virtual device */
50 struct net_device *rtap_net_dev; 63 struct net_device *rtap_net_dev;
64 u32 monitormode;
51 65
52 struct iw_statistics wstats; 66 /* Debugfs */
53 struct lbs_mesh_stats mstats;
54 struct dentry *debugfs_dir; 67 struct dentry *debugfs_dir;
55 struct dentry *debugfs_debug; 68 struct dentry *debugfs_debug;
56 struct dentry *debugfs_files[6]; 69 struct dentry *debugfs_files[6];
57
58 struct dentry *events_dir; 70 struct dentry *events_dir;
59 struct dentry *debugfs_events_files[6]; 71 struct dentry *debugfs_events_files[6];
60
61 struct dentry *regs_dir; 72 struct dentry *regs_dir;
62 struct dentry *debugfs_regs_files[6]; 73 struct dentry *debugfs_regs_files[6];
63 74
75 /* Hardware debugging */
64 u32 mac_offset; 76 u32 mac_offset;
65 u32 bbp_offset; 77 u32 bbp_offset;
66 u32 rf_offset; 78 u32 rf_offset;
79 struct lbs_offset_value offsetvalue;
80
81 /* Power management */
82 u16 psmode;
83 u32 psstate;
84 u8 needtowakeup;
67 85
68 /** Deep sleep flag */ 86 /* Deep sleep */
69 int is_deep_sleep; 87 int is_deep_sleep;
70 /** Auto deep sleep enabled flag */
71 int is_auto_deep_sleep_enabled; 88 int is_auto_deep_sleep_enabled;
72 /** Device wakeup required flag */
73 int wakeup_dev_required; 89 int wakeup_dev_required;
74 /** Auto deep sleep flag*/
75 int is_activity_detected; 90 int is_activity_detected;
76 /** Auto deep sleep timeout (in miliseconds) */ 91 int auto_deep_sleep_timeout; /* in ms */
77 int auto_deep_sleep_timeout; 92 wait_queue_head_t ds_awake_q;
78 93 struct timer_list auto_deepsleep_timer;
79 /** Deep sleep wait queue */
80 wait_queue_head_t ds_awake_q;
81
82 /* Download sent:
83 bit0 1/0=data_sent/data_tx_done,
84 bit1 1/0=cmd_sent/cmd_tx_done,
85 all other bits reserved 0 */
86 u8 dnld_sent;
87
88 /** thread to service interrupts */
89 struct task_struct *main_thread;
90 wait_queue_head_t waitq;
91 struct workqueue_struct *work_thread;
92
93 struct work_struct mcast_work;
94
95 /** Scanning */
96 struct delayed_work scan_work;
97 struct delayed_work assoc_work;
98 struct work_struct sync_channel;
99 /* remember which channel was scanned last, != 0 if currently scanning */
100 int scan_channel;
101 u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
102 u8 scan_ssid_len;
103 94
104 /** Hardware access */ 95 /* Hardware access */
96 void *card;
97 u8 fw_ready;
98 u8 surpriseremoved;
105 int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); 99 int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
106 void (*reset_card) (struct lbs_private *priv); 100 void (*reset_card) (struct lbs_private *priv);
107 int (*enter_deep_sleep) (struct lbs_private *priv); 101 int (*enter_deep_sleep) (struct lbs_private *priv);
108 int (*exit_deep_sleep) (struct lbs_private *priv); 102 int (*exit_deep_sleep) (struct lbs_private *priv);
109 int (*reset_deep_sleep_wakeup) (struct lbs_private *priv); 103 int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
110 104
111 /* Wake On LAN */ 105 /* Adapter info (from EEPROM) */
112 uint32_t wol_criteria;
113 uint8_t wol_gpio;
114 uint8_t wol_gap;
115
116 /** Wlan adapter data structure*/
117 /** STATUS variables */
118 u32 fwrelease; 106 u32 fwrelease;
119 u32 fwcapinfo; 107 u32 fwcapinfo;
108 u16 regioncode;
109 u8 current_addr[ETH_ALEN];
120 110
121 struct mutex lock; 111 /* Command download */
122 112 u8 dnld_sent;
123 /* TX packet ready to be sent... */ 113 /* bit0 1/0=data_sent/data_tx_done,
124 int tx_pending_len; /* -1 while building packet */ 114 bit1 1/0=cmd_sent/cmd_tx_done,
125 115 all other bits reserved 0 */
126 u8 tx_pending_buf[LBS_UPLD_SIZE];
127 /* protected by hard_start_xmit serialization */
128
129 /** command-related variables */
130 u16 seqnum; 116 u16 seqnum;
131
132 struct cmd_ctrl_node *cmd_array; 117 struct cmd_ctrl_node *cmd_array;
133 /** Current command */
134 struct cmd_ctrl_node *cur_cmd; 118 struct cmd_ctrl_node *cur_cmd;
135 int cur_cmd_retcode; 119 struct list_head cmdfreeq; /* free command buffers */
136 /** command Queues */ 120 struct list_head cmdpendingq; /* pending command buffers */
137 /** Free command buffers */
138 struct list_head cmdfreeq;
139 /** Pending command buffers */
140 struct list_head cmdpendingq;
141
142 wait_queue_head_t cmd_pending; 121 wait_queue_head_t cmd_pending;
122 struct timer_list command_timer;
123 int nr_retries;
124 int cmd_timed_out;
143 125
144 /* Command responses sent from the hardware to the driver */ 126 /* Command responses sent from the hardware to the driver */
127 int cur_cmd_retcode;
145 u8 resp_idx; 128 u8 resp_idx;
146 u8 resp_buf[2][LBS_UPLD_SIZE]; 129 u8 resp_buf[2][LBS_UPLD_SIZE];
147 u32 resp_len[2]; 130 u32 resp_len[2];
@@ -149,90 +132,75 @@ struct lbs_private {
149 /* Events sent from hardware to driver */ 132 /* Events sent from hardware to driver */
150 struct kfifo *event_fifo; 133 struct kfifo *event_fifo;
151 134
152 /* nickname */ 135 /** thread to service interrupts */
153 u8 nodename[16]; 136 struct task_struct *main_thread;
154 137 wait_queue_head_t waitq;
155 /** spin locks */ 138 struct workqueue_struct *work_thread;
156 spinlock_t driver_lock;
157
158 /** Timers */
159 struct timer_list command_timer;
160 struct timer_list auto_deepsleep_timer;
161 int nr_retries;
162 int cmd_timed_out;
163
164 /** current ssid/bssid related parameters*/
165 struct current_bss_params curbssparams;
166
167 uint16_t mesh_tlv;
168 u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
169 u8 mesh_ssid_len;
170
171 /* IW_MODE_* */
172 u8 mode;
173
174 /* Scan results list */
175 struct list_head network_list;
176 struct list_head network_free_list;
177 struct bss_descriptor *networks;
178
179 u16 beacon_period;
180 u8 beacon_enable;
181 u8 adhoccreate;
182
183 /** capability Info used in Association, start, join */
184 u16 capability;
185
186 /** MAC address information */
187 u8 current_addr[ETH_ALEN];
188 u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
189 u32 nr_of_multicastmacaddr;
190 139
191 /** 802.11 statistics */ 140 /** Encryption stuff */
192// struct cmd_DS_802_11_GET_STAT wlan802_11Stat; 141 struct lbs_802_11_security secinfo;
142 struct enc_key wpa_mcast_key;
143 struct enc_key wpa_unicast_key;
144 u8 wpa_ie[MAX_WPA_IE_LEN];
145 u8 wpa_ie_len;
146 u16 wep_tx_keyidx;
147 struct enc_key wep_keys[4];
193 148
194 uint16_t enablehwauto; 149 /* Wake On LAN */
195 uint16_t ratebitmap; 150 uint32_t wol_criteria;
151 uint8_t wol_gpio;
152 uint8_t wol_gap;
196 153
154 /* Transmitting */
155 int tx_pending_len; /* -1 while building packet */
156 u8 tx_pending_buf[LBS_UPLD_SIZE];
157 /* protected by hard_start_xmit serialization */
197 u8 txretrycount; 158 u8 txretrycount;
198
199 /** Tx-related variables (for single packet tx) */
200 struct sk_buff *currenttxskb; 159 struct sk_buff *currenttxskb;
201 160
202 /** NIC Operation characteristics */ 161 /* Locks */
162 struct mutex lock;
163 spinlock_t driver_lock;
164
165 /* NIC/link operation characteristics */
203 u16 mac_control; 166 u16 mac_control;
204 u32 connect_status; 167 u8 radio_on;
205 u32 mesh_connect_status;
206 u16 regioncode;
207 s16 txpower_cur; 168 s16 txpower_cur;
208 s16 txpower_min; 169 s16 txpower_min;
209 s16 txpower_max; 170 s16 txpower_max;
210 171
211 /** POWER MANAGEMENT AND PnP SUPPORT */ 172 /** Scanning */
212 u8 surpriseremoved; 173 struct delayed_work scan_work;
213 174 int scan_channel;
214 u16 psmode; /* Wlan802_11PowermodeCAM=disable 175 /* remember which channel was scanned last, != 0 if currently scanning */
215 Wlan802_11PowermodeMAX_PSP=enable */ 176 u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
216 u32 psstate; 177 u8 scan_ssid_len;
217 u8 needtowakeup;
218 178
179 /* Associating */
180 struct delayed_work assoc_work;
181 struct current_bss_params curbssparams;
182 u8 mode;
183 struct list_head network_list;
184 struct list_head network_free_list;
185 struct bss_descriptor *networks;
219 struct assoc_request * pending_assoc_req; 186 struct assoc_request * pending_assoc_req;
220 struct assoc_request * in_progress_assoc_req; 187 struct assoc_request * in_progress_assoc_req;
188 u16 capability;
189 uint16_t enablehwauto;
190 uint16_t ratebitmap;
221 191
222 /** Encryption parameter */ 192 /* ADHOC */
223 struct lbs_802_11_security secinfo; 193 u16 beacon_period;
224 194 u8 beacon_enable;
225 /** WEP keys */ 195 u8 adhoccreate;
226 struct enc_key wep_keys[4];
227 u16 wep_tx_keyidx;
228
229 /** WPA keys */
230 struct enc_key wpa_mcast_key;
231 struct enc_key wpa_unicast_key;
232 196
233 /** WPA Information Elements*/ 197 /* WEXT */
234 u8 wpa_ie[MAX_WPA_IE_LEN]; 198 char name[DEV_NAME_LEN];
235 u8 wpa_ie_len; 199 u8 nodename[16];
200 struct iw_statistics wstats;
201 u8 cur_rate;
202#define MAX_REGION_CHANNEL_NUM 2
203 struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
236 204
237 /** Requested Signal Strength*/ 205 /** Requested Signal Strength*/
238 u16 SNR[MAX_TYPE_B][MAX_TYPE_AVG]; 206 u16 SNR[MAX_TYPE_B][MAX_TYPE_AVG];
@@ -242,23 +210,6 @@ struct lbs_private {
242 u8 rawNF[DEFAULT_DATA_AVG_FACTOR]; 210 u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
243 u16 nextSNRNF; 211 u16 nextSNRNF;
244 u16 numSNRNF; 212 u16 numSNRNF;
245
246 u8 radio_on;
247
248 /** data rate stuff */
249 u8 cur_rate;
250
251 /** RF calibration data */
252
253#define MAX_REGION_CHANNEL_NUM 2
254 /** region channel data */
255 struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
256
257 /** MISCELLANEOUS */
258 struct lbs_offset_value offsetvalue;
259
260 u32 monitormode;
261 u8 fw_ready;
262}; 213};
263 214
264extern struct cmd_confirm_sleep confirm_sleep; 215extern struct cmd_confirm_sleep confirm_sleep;