Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dev.h
Go to the documentation of this file.
1 /*
2  * This file contains definitions and data structures specific
3  * to Marvell 802.11 NIC. It contains the Device Information
4  * structure struct lbs_private..
5  */
6 #ifndef _LBS_DEV_H_
7 #define _LBS_DEV_H_
8 
9 #include "defs.h"
10 #include "decl.h"
11 #include "host.h"
12 
13 #include <linux/kfifo.h>
14 
15 /* sleep_params */
16 struct sleep_params {
23 };
24 
25 /* Mesh statistics */
27  u32 fwd_bcast_cnt; /* Fwd: Broadcast counter */
28  u32 fwd_unicast_cnt; /* Fwd: Unicast counter */
29  u32 fwd_drop_ttl; /* Fwd: TTL zero */
30  u32 fwd_drop_rbt; /* Fwd: Recently Broadcasted */
31  u32 fwd_drop_noroute; /* Fwd: No route to Destination */
32  u32 fwd_drop_nobuf; /* Fwd: Run out of internal buffers */
33  u32 drop_blind; /* Rx: Dropped by blinding table */
34  u32 tx_failed_cnt; /* Tx: Failed transmissions */
35 };
36 
37 /* Private structure for the MV device */
38 struct lbs_private {
39 
40  /* Basic networking */
41  struct net_device *dev;
46 
47  /* CFG80211 */
48  struct wireless_dev *wdev;
54 
55  /* Mesh */
56  struct net_device *mesh_dev; /* Virtual device */
57 #ifdef CONFIG_LIBERTAS_MESH
58  struct lbs_mesh_stats mstats;
59  uint16_t mesh_tlv;
60  u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
61  u8 mesh_ssid_len;
62  u8 mesh_channel;
63 #endif
64 
65  /* Debugfs */
68  struct dentry *debugfs_files[6];
69  struct dentry *events_dir;
71  struct dentry *regs_dir;
73 
74  /* Hardware debugging */
78 
79  /* Power management */
83 
84  /* Deep sleep */
90  int auto_deep_sleep_timeout; /* in ms */
93 
94  /* Host sleep*/
98 
99  /* Hardware access */
100  void *card;
112 
113  /* Adapter info (from EEPROM) */
119 
120  /* Command download */
122  /* bit0 1/0=data_sent/data_tx_done,
123  bit1 1/0=cmd_sent/cmd_tx_done,
124  all other bits reserved 0 */
128  struct list_head cmdfreeq; /* free command buffers */
129  struct list_head cmdpendingq; /* pending command buffers */
132 
133  /* Command responses sent from the hardware to the driver */
137 
138  /* Events sent from hardware to driver */
139  struct kfifo event_fifo;
140 
141  /* thread to service interrupts */
145 
146  /* Encryption stuff */
151 
152  /* Wake On LAN */
157 
158  /* Transmitting */
159  int tx_pending_len; /* -1 while building packet */
161  /* protected by hard_start_xmit serialization */
165 
166  /* Locks */
167  struct mutex lock;
169 
170  /* NIC/link operation characteristics */
178 
179  /* Scanning */
182  /* Queue of things waiting for scan completion */
184  /* Whether the scan was initiated internally and not by cfg80211 */
186 
187  /* Firmware load */
190  struct device *fw_device;
191  const struct firmware *helper_fw;
192  const struct lbs_fw_table *fw_table;
193  const struct lbs_fw_table *fw_iter;
195 };
196 
197 extern struct cmd_confirm_sleep confirm_sleep;
198 
199 /* Check if there is an interface active. */
200 static inline int lbs_iface_active(struct lbs_private *priv)
201 {
202  int r;
203 
204  r = netif_running(priv->dev);
205  if (priv->mesh_dev)
206  r |= netif_running(priv->mesh_dev);
207 
208  return r;
209 }
210 
211 #endif