]> bbs.cooldavid.org Git - net-next-2.6.git/blame - drivers/net/wireless/libertas/dev.h
libertas: remove unused cmd_pending waitq
[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"
e86dc1ca
KD
10#include "defs.h"
11#include "host.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;
5e047692
HS
32 struct work_struct mcast_work;
33 u32 nr_of_multicastmacaddr;
34 u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
35
36 /* CFG80211 */
ff9fc791 37 struct wireless_dev *wdev;
73714004 38 bool wiphy_registered;
e86dc1ca
KD
39 struct cfg80211_scan_request *scan_req;
40 u8 assoc_bss[ETH_ALEN];
41 u8 disassoc_reason;
5e047692
HS
42
43 /* Mesh */
44 struct net_device *mesh_dev; /* Virtual device */
4143a23d 45#ifdef CONFIG_LIBERTAS_MESH
5e047692
HS
46 u32 mesh_connect_status;
47 struct lbs_mesh_stats mstats;
876c9d3a 48 int mesh_open;
5e047692
HS
49 uint16_t mesh_tlv;
50 u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
51 u8 mesh_ssid_len;
4143a23d 52#endif
876c9d3a 53
5e047692 54 /* Debugfs */
876c9d3a
MT
55 struct dentry *debugfs_dir;
56 struct dentry *debugfs_debug;
57 struct dentry *debugfs_files[6];
876c9d3a
MT
58 struct dentry *events_dir;
59 struct dentry *debugfs_events_files[6];
876c9d3a
MT
60 struct dentry *regs_dir;
61 struct dentry *debugfs_regs_files[6];
62
5e047692 63 /* Hardware debugging */
876c9d3a
MT
64 u32 mac_offset;
65 u32 bbp_offset;
66 u32 rf_offset;
5e047692
HS
67
68 /* Power management */
69 u16 psmode;
70 u32 psstate;
71 u8 needtowakeup;
876c9d3a 72
5e047692 73 /* Deep sleep */
49125454 74 int is_deep_sleep;
66fceb69 75 int deep_sleep_required;
49125454 76 int is_auto_deep_sleep_enabled;
49125454 77 int wakeup_dev_required;
49125454 78 int is_activity_detected;
5e047692
HS
79 int auto_deep_sleep_timeout; /* in ms */
80 wait_queue_head_t ds_awake_q;
81 struct timer_list auto_deepsleep_timer;
208fdd2f 82
66fceb69
AK
83 /* Host sleep*/
84 int is_host_sleep_configured;
85 int is_host_sleep_activated;
86 wait_queue_head_t host_sleep_q;
87
5e047692
HS
88 /* Hardware access */
89 void *card;
90 u8 fw_ready;
91 u8 surpriseremoved;
69f9032d 92 int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
edf5dabf 93 void (*reset_card) (struct lbs_private *priv);
49125454
AK
94 int (*enter_deep_sleep) (struct lbs_private *priv);
95 int (*exit_deep_sleep) (struct lbs_private *priv);
96 int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
876c9d3a 97
5e047692 98 /* Adapter info (from EEPROM) */
dac10a9f 99 u32 fwrelease;
876c9d3a 100 u32 fwcapinfo;
5e047692
HS
101 u16 regioncode;
102 u8 current_addr[ETH_ALEN];
876c9d3a 103
5e047692
HS
104 /* Command download */
105 u8 dnld_sent;
106 /* bit0 1/0=data_sent/data_tx_done,
107 bit1 1/0=cmd_sent/cmd_tx_done,
108 all other bits reserved 0 */
876c9d3a 109 u16 seqnum;
876c9d3a 110 struct cmd_ctrl_node *cmd_array;
876c9d3a 111 struct cmd_ctrl_node *cur_cmd;
5e047692
HS
112 struct list_head cmdfreeq; /* free command buffers */
113 struct list_head cmdpendingq; /* pending command buffers */
5e047692 114 struct timer_list command_timer;
5e047692 115 int cmd_timed_out;
876c9d3a 116
7919b89c
HS
117 /* Command responses sent from the hardware to the driver */
118 u8 resp_idx;
119 u8 resp_buf[2][LBS_UPLD_SIZE];
120 u32 resp_len[2];
121
122 /* Events sent from hardware to driver */
45465487 123 struct kfifo event_fifo;
7919b89c 124
5e047692
HS
125 /** thread to service interrupts */
126 struct task_struct *main_thread;
127 wait_queue_head_t waitq;
128 struct workqueue_struct *work_thread;
876c9d3a 129
5e047692 130 /** Encryption stuff */
921ca03c 131 u8 authtype_auto;
e86dc1ca
KD
132 u8 wep_tx_key;
133 u8 wep_key[4][WLAN_KEY_LEN_WEP104];
134 u8 wep_key_len[4];
876c9d3a 135
5e047692
HS
136 /* Wake On LAN */
137 uint32_t wol_criteria;
138 uint8_t wol_gpio;
139 uint8_t wol_gap;
876c9d3a 140
5e047692
HS
141 /* Transmitting */
142 int tx_pending_len; /* -1 while building packet */
143 u8 tx_pending_buf[LBS_UPLD_SIZE];
144 /* protected by hard_start_xmit serialization */
876c9d3a 145 u8 txretrycount;
876c9d3a 146 struct sk_buff *currenttxskb;
876c9d3a 147
5e047692
HS
148 /* Locks */
149 struct mutex lock;
150 spinlock_t driver_lock;
151
152 /* NIC/link operation characteristics */
d9e9778c 153 u16 mac_control;
5e047692 154 u8 radio_on;
e86dc1ca 155 u8 cur_rate;
c14951fe 156 u8 channel;
87c8c72d
DW
157 s16 txpower_cur;
158 s16 txpower_min;
159 s16 txpower_max;
876c9d3a 160
5e047692
HS
161 /** Scanning */
162 struct delayed_work scan_work;
163 int scan_channel;
876c9d3a
MT
164};
165
f539f2ef
HS
166extern struct cmd_confirm_sleep confirm_sleep;
167
10078321 168#endif