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..
13 #include <linux/kfifo.h>
19 uint16_t sp_stabletime;
20 uint8_t sp_calcontrol;
21 uint8_t sp_extsleepclk;
26 /** Private structure for the MV device */
29 /* Basic networking */
30 struct net_device *dev;
33 struct work_struct mcast_work;
34 u32 nr_of_multicastmacaddr;
35 u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN];
38 struct wireless_dev *wdev;
41 struct net_device *mesh_dev; /* Virtual device */
42 #ifdef CONFIG_LIBERTAS_MESH
43 u32 mesh_connect_status;
44 struct lbs_mesh_stats mstats;
47 u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1];
52 struct net_device *rtap_net_dev;
56 struct dentry *debugfs_dir;
57 struct dentry *debugfs_debug;
58 struct dentry *debugfs_files[6];
59 struct dentry *events_dir;
60 struct dentry *debugfs_events_files[6];
61 struct dentry *regs_dir;
62 struct dentry *debugfs_regs_files[6];
64 /* Hardware debugging */
68 struct lbs_offset_value offsetvalue;
70 /* Power management */
77 int is_auto_deep_sleep_enabled;
78 int wakeup_dev_required;
79 int is_activity_detected;
80 int auto_deep_sleep_timeout; /* in ms */
81 wait_queue_head_t ds_awake_q;
82 struct timer_list auto_deepsleep_timer;
88 int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb);
89 void (*reset_card) (struct lbs_private *priv);
90 int (*enter_deep_sleep) (struct lbs_private *priv);
91 int (*exit_deep_sleep) (struct lbs_private *priv);
92 int (*reset_deep_sleep_wakeup) (struct lbs_private *priv);
94 /* Adapter info (from EEPROM) */
98 u8 current_addr[ETH_ALEN];
100 /* Command download */
102 /* bit0 1/0=data_sent/data_tx_done,
103 bit1 1/0=cmd_sent/cmd_tx_done,
104 all other bits reserved 0 */
106 struct cmd_ctrl_node *cmd_array;
107 struct cmd_ctrl_node *cur_cmd;
108 struct list_head cmdfreeq; /* free command buffers */
109 struct list_head cmdpendingq; /* pending command buffers */
110 wait_queue_head_t cmd_pending;
111 struct timer_list command_timer;
114 /* Command responses sent from the hardware to the driver */
117 u8 resp_buf[2][LBS_UPLD_SIZE];
120 /* Events sent from hardware to driver */
121 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,33))
122 struct kfifo event_fifo;
124 struct kfifo *event_fifo;
127 /** thread to service interrupts */
128 struct task_struct *main_thread;
129 wait_queue_head_t waitq;
130 struct workqueue_struct *work_thread;
132 /** Encryption stuff */
133 struct lbs_802_11_security secinfo;
134 struct enc_key wpa_mcast_key;
135 struct enc_key wpa_unicast_key;
136 u8 wpa_ie[MAX_WPA_IE_LEN];
139 struct enc_key wep_keys[4];
142 uint32_t wol_criteria;
147 int tx_pending_len; /* -1 while building packet */
148 u8 tx_pending_buf[LBS_UPLD_SIZE];
149 /* protected by hard_start_xmit serialization */
151 struct sk_buff *currenttxskb;
155 spinlock_t driver_lock;
157 /* NIC/link operation characteristics */
166 struct delayed_work scan_work;
168 /* remember which channel was scanned last, != 0 if currently scanning */
169 u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1];
173 struct delayed_work assoc_work;
174 struct current_bss_params curbssparams;
176 struct list_head network_list;
177 struct list_head network_free_list;
178 struct bss_descriptor *networks;
179 struct assoc_request * pending_assoc_req;
180 struct assoc_request * in_progress_assoc_req;
181 uint16_t enablehwauto;
189 char name[DEV_NAME_LEN];
191 struct iw_statistics wstats;
193 #define MAX_REGION_CHANNEL_NUM 2
194 struct region_channel region_channel[MAX_REGION_CHANNEL_NUM];
196 /** Requested Signal Strength*/
197 u16 SNR[MAX_TYPE_B][MAX_TYPE_AVG];
198 u16 NF[MAX_TYPE_B][MAX_TYPE_AVG];
199 u8 RSSI[MAX_TYPE_B][MAX_TYPE_AVG];
200 u8 rawSNR[DEFAULT_DATA_AVG_FACTOR];
201 u8 rawNF[DEFAULT_DATA_AVG_FACTOR];
206 extern struct cmd_confirm_sleep confirm_sleep;