This source file includes following definitions.
- lbs_iface_active
1
2
3
4
5
6
7 #ifndef _LBS_DEV_H_
8 #define _LBS_DEV_H_
9
10 #include "defs.h"
11 #include "decl.h"
12 #include "host.h"
13
14 #include <linux/kfifo.h>
15
16
17 struct sleep_params {
18 uint16_t sp_error;
19 uint16_t sp_offset;
20 uint16_t sp_stabletime;
21 uint8_t sp_calcontrol;
22 uint8_t sp_extsleepclk;
23 uint16_t sp_reserved;
24 };
25
26
27 struct lbs_mesh_stats {
28 u32 fwd_bcast_cnt;
29 u32 fwd_unicast_cnt;
30 u32 fwd_drop_ttl;
31 u32 fwd_drop_rbt;
32 u32 fwd_drop_noroute;
33 u32 fwd_drop_nobuf;
34 u32 drop_blind;
35 u32 tx_failed_cnt;
36 };
37
38
39 struct lbs_private {
40
41
42 struct net_device *dev;
43 u32 connect_status;
44 struct work_struct mcast_work;
45 u32 nr_of_multicastmacaddr;
46 u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
47
48
49 struct wireless_dev *wdev;
50 bool wiphy_registered;
51 struct cfg80211_scan_request *scan_req;
52 u8 assoc_bss[ETH_ALEN];
53 u8 country_code[IEEE80211_COUNTRY_STRING_LEN];
54 u8 disassoc_reason;
55
56
57 struct net_device *mesh_dev;
58 #ifdef CONFIG_LIBERTAS_MESH
59 struct lbs_mesh_stats mstats;
60 uint16_t mesh_tlv;
61 u8 mesh_channel;
62 #endif
63
64
65 struct dentry *debugfs_dir;
66 struct dentry *debugfs_debug;
67 struct dentry *debugfs_files[6];
68 struct dentry *events_dir;
69 struct dentry *debugfs_events_files[6];
70 struct dentry *regs_dir;
71 struct dentry *debugfs_regs_files[6];
72
73
74 u32 mac_offset;
75 u32 bbp_offset;
76 u32 rf_offset;
77
78
79 u16 psmode;
80 u32 psstate;
81 u8 needtowakeup;
82
83
84 int is_deep_sleep;
85 int deep_sleep_required;
86 int is_auto_deep_sleep_enabled;
87 int wakeup_dev_required;
88 int is_activity_detected;
89 int auto_deep_sleep_timeout;
90 wait_queue_head_t ds_awake_q;
91 struct timer_list auto_deepsleep_timer;
92
93
94 int is_host_sleep_configured;
95 int is_host_sleep_activated;
96 wait_queue_head_t host_sleep_q;
97
98
99 void *card;
100 bool iface_running;
101 u8 is_polling;
102 u8 fw_ready;
103 u8 surpriseremoved;
104 u8 setup_fw_on_resume;
105 u8 power_up_on_resume;
106 int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
107 void (*reset_card) (struct lbs_private *priv);
108 int (*power_save) (struct lbs_private *priv);
109 int (*power_restore) (struct lbs_private *priv);
110 int (*enter_deep_sleep) (struct lbs_private *priv);
111 int (*exit_deep_sleep) (struct lbs_private *priv);
112 int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
113
114
115 u32 fwrelease;
116 u32 fwcapinfo;
117 u16 regioncode;
118 u8 current_addr[ETH_ALEN];
119 u8 copied_hwaddr;
120
121
122 u8 dnld_sent;
123
124
125
126 u16 seqnum;
127 struct cmd_ctrl_node *cmd_array;
128 struct cmd_ctrl_node *cur_cmd;
129 struct list_head cmdfreeq;
130 struct list_head cmdpendingq;
131 struct timer_list command_timer;
132 int cmd_timed_out;
133
134
135 u8 resp_idx;
136 u8 resp_buf[2][LBS_UPLD_SIZE];
137 u32 resp_len[2];
138
139
140 struct kfifo event_fifo;
141
142
143 struct task_struct *main_thread;
144 wait_queue_head_t waitq;
145 struct workqueue_struct *work_thread;
146
147
148 u8 authtype_auto;
149 u8 wep_tx_key;
150 u8 wep_key[4][WLAN_KEY_LEN_WEP104];
151 u8 wep_key_len[4];
152
153
154 uint32_t wol_criteria;
155 uint8_t wol_gpio;
156 uint8_t wol_gap;
157 bool ehs_remove_supported;
158
159
160 int tx_pending_len;
161 u8 tx_pending_buf[LBS_UPLD_SIZE];
162
163 u8 txretrycount;
164 struct sk_buff *currenttxskb;
165 struct timer_list tx_lockup_timer;
166
167
168 struct mutex lock;
169 spinlock_t driver_lock;
170
171
172 u16 mac_control;
173 u8 radio_on;
174 u8 cur_rate;
175 u8 channel;
176 s16 txpower_cur;
177 s16 txpower_min;
178 s16 txpower_max;
179
180
181 struct delayed_work scan_work;
182 int scan_channel;
183
184 wait_queue_head_t scan_q;
185
186 bool internal_scan;
187
188
189 u32 fw_model;
190 wait_queue_head_t fw_waitq;
191 struct device *fw_device;
192 const struct firmware *helper_fw;
193 const struct lbs_fw_table *fw_table;
194 const struct lbs_fw_table *fw_iter;
195 lbs_fw_cb fw_callback;
196 };
197
198 extern struct cmd_confirm_sleep confirm_sleep;
199
200
201 static inline int lbs_iface_active(struct lbs_private *priv)
202 {
203 int r;
204
205 r = netif_running(priv->dev);
206 if (priv->mesh_dev)
207 r |= netif_running(priv->mesh_dev);
208
209 return r;
210 }
211
212 #endif