Commit | Line | Data |
---|---|---|
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" |
2d46502d HS |
10 | #include "scan.h" |
11 | #include "assoc.h" | |
876c9d3a | 12 | |
45465487 | 13 | #include <linux/kfifo.h> |
876c9d3a MT |
14 | |
15 | /** sleep_params */ | |
16 | struct 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 | 27 | struct lbs_private { |
5e047692 HS |
28 | |
29 | /* Basic networking */ | |
30 | struct net_device *dev; | |
31 | u32 connect_status; | |
32 | int infra_open; | |
33 | struct work_struct mcast_work; | |
34 | u32 nr_of_multicastmacaddr; | |
35 | u8 multicastlist[MRVDRV_MAX_MULTICAST_LIST_SIZE][ETH_ALEN]; | |
36 | ||
37 | /* CFG80211 */ | |
ff9fc791 | 38 | struct wireless_dev *wdev; |
5e047692 HS |
39 | |
40 | /* Mesh */ | |
41 | struct net_device *mesh_dev; /* Virtual device */ | |
42 | u32 mesh_connect_status; | |
43 | struct lbs_mesh_stats mstats; | |
876c9d3a | 44 | int mesh_open; |
684d6b36 | 45 | int mesh_fw_ver; |
d21b31fd | 46 | int mesh_autostart_enabled; |
5e047692 HS |
47 | uint16_t mesh_tlv; |
48 | u8 mesh_ssid[IEEE80211_MAX_SSID_LEN + 1]; | |
49 | u8 mesh_ssid_len; | |
50 | struct work_struct sync_channel; | |
876c9d3a | 51 | |
5e047692 | 52 | /* Monitor mode */ |
965f8bbc | 53 | struct net_device *rtap_net_dev; |
5e047692 | 54 | u32 monitormode; |
876c9d3a | 55 | |
5e047692 | 56 | /* Debugfs */ |
876c9d3a MT |
57 | struct dentry *debugfs_dir; |
58 | struct dentry *debugfs_debug; | |
59 | struct dentry *debugfs_files[6]; | |
876c9d3a MT |
60 | struct dentry *events_dir; |
61 | struct dentry *debugfs_events_files[6]; | |
876c9d3a MT |
62 | struct dentry *regs_dir; |
63 | struct dentry *debugfs_regs_files[6]; | |
64 | ||
5e047692 | 65 | /* Hardware debugging */ |
876c9d3a MT |
66 | u32 mac_offset; |
67 | u32 bbp_offset; | |
68 | u32 rf_offset; | |
5e047692 HS |
69 | struct lbs_offset_value offsetvalue; |
70 | ||
71 | /* Power management */ | |
72 | u16 psmode; | |
73 | u32 psstate; | |
74 | u8 needtowakeup; | |
876c9d3a | 75 | |
5e047692 | 76 | /* Deep sleep */ |
49125454 | 77 | int is_deep_sleep; |
49125454 | 78 | int is_auto_deep_sleep_enabled; |
49125454 | 79 | int wakeup_dev_required; |
49125454 | 80 | int is_activity_detected; |
5e047692 HS |
81 | int auto_deep_sleep_timeout; /* in ms */ |
82 | wait_queue_head_t ds_awake_q; | |
83 | struct timer_list auto_deepsleep_timer; | |
208fdd2f | 84 | |
5e047692 HS |
85 | /* Hardware access */ |
86 | void *card; | |
87 | u8 fw_ready; | |
88 | u8 surpriseremoved; | |
69f9032d | 89 | int (*hw_host_to_card) (struct lbs_private *priv, u8 type, u8 *payload, u16 nb); |
edf5dabf | 90 | void (*reset_card) (struct lbs_private *priv); |
49125454 AK |
91 | int (*enter_deep_sleep) (struct lbs_private *priv); |
92 | int (*exit_deep_sleep) (struct lbs_private *priv); | |
93 | int (*reset_deep_sleep_wakeup) (struct lbs_private *priv); | |
876c9d3a | 94 | |
5e047692 | 95 | /* Adapter info (from EEPROM) */ |
dac10a9f | 96 | u32 fwrelease; |
876c9d3a | 97 | u32 fwcapinfo; |
5e047692 HS |
98 | u16 regioncode; |
99 | u8 current_addr[ETH_ALEN]; | |
876c9d3a | 100 | |
5e047692 HS |
101 | /* Command download */ |
102 | u8 dnld_sent; | |
103 | /* bit0 1/0=data_sent/data_tx_done, | |
104 | bit1 1/0=cmd_sent/cmd_tx_done, | |
105 | all other bits reserved 0 */ | |
876c9d3a | 106 | u16 seqnum; |
876c9d3a | 107 | struct cmd_ctrl_node *cmd_array; |
876c9d3a | 108 | struct cmd_ctrl_node *cur_cmd; |
5e047692 HS |
109 | struct list_head cmdfreeq; /* free command buffers */ |
110 | struct list_head cmdpendingq; /* pending command buffers */ | |
876c9d3a | 111 | wait_queue_head_t cmd_pending; |
5e047692 HS |
112 | struct timer_list command_timer; |
113 | int nr_retries; | |
114 | int cmd_timed_out; | |
876c9d3a | 115 | |
7919b89c | 116 | /* Command responses sent from the hardware to the driver */ |
5e047692 | 117 | int cur_cmd_retcode; |
7919b89c HS |
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 HS |
130 | /** Encryption stuff */ |
131 | struct lbs_802_11_security secinfo; | |
132 | struct enc_key wpa_mcast_key; | |
133 | struct enc_key wpa_unicast_key; | |
134 | u8 wpa_ie[MAX_WPA_IE_LEN]; | |
135 | u8 wpa_ie_len; | |
136 | u16 wep_tx_keyidx; | |
137 | struct enc_key wep_keys[4]; | |
876c9d3a | 138 | |
5e047692 HS |
139 | /* Wake On LAN */ |
140 | uint32_t wol_criteria; | |
141 | uint8_t wol_gpio; | |
142 | uint8_t wol_gap; | |
876c9d3a | 143 | |
5e047692 HS |
144 | /* Transmitting */ |
145 | int tx_pending_len; /* -1 while building packet */ | |
146 | u8 tx_pending_buf[LBS_UPLD_SIZE]; | |
147 | /* protected by hard_start_xmit serialization */ | |
876c9d3a | 148 | u8 txretrycount; |
876c9d3a | 149 | struct sk_buff *currenttxskb; |
876c9d3a | 150 | |
5e047692 HS |
151 | /* Locks */ |
152 | struct mutex lock; | |
153 | spinlock_t driver_lock; | |
154 | ||
155 | /* NIC/link operation characteristics */ | |
d9e9778c | 156 | u16 mac_control; |
5e047692 | 157 | u8 radio_on; |
c14951fe | 158 | u8 channel; |
87c8c72d DW |
159 | s16 txpower_cur; |
160 | s16 txpower_min; | |
161 | s16 txpower_max; | |
876c9d3a | 162 | |
5e047692 HS |
163 | /** Scanning */ |
164 | struct delayed_work scan_work; | |
165 | int scan_channel; | |
166 | /* remember which channel was scanned last, != 0 if currently scanning */ | |
167 | u8 scan_ssid[IEEE80211_MAX_SSID_LEN + 1]; | |
168 | u8 scan_ssid_len; | |
876c9d3a | 169 | |
5e047692 HS |
170 | /* Associating */ |
171 | struct delayed_work assoc_work; | |
172 | struct current_bss_params curbssparams; | |
173 | u8 mode; | |
174 | struct list_head network_list; | |
175 | struct list_head network_free_list; | |
176 | struct bss_descriptor *networks; | |
e76850d6 DW |
177 | struct assoc_request * pending_assoc_req; |
178 | struct assoc_request * in_progress_assoc_req; | |
5e047692 HS |
179 | u16 capability; |
180 | uint16_t enablehwauto; | |
181 | uint16_t ratebitmap; | |
876c9d3a | 182 | |
5e047692 HS |
183 | /* ADHOC */ |
184 | u16 beacon_period; | |
185 | u8 beacon_enable; | |
186 | u8 adhoccreate; | |
876c9d3a | 187 | |
5e047692 HS |
188 | /* WEXT */ |
189 | char name[DEV_NAME_LEN]; | |
190 | u8 nodename[16]; | |
191 | struct iw_statistics wstats; | |
192 | u8 cur_rate; | |
193 | #define MAX_REGION_CHANNEL_NUM 2 | |
194 | struct region_channel region_channel[MAX_REGION_CHANNEL_NUM]; | |
876c9d3a | 195 | |
876c9d3a | 196 | /** Requested Signal Strength*/ |
876c9d3a MT |
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]; | |
202 | u16 nextSNRNF; | |
203 | u16 numSNRNF; | |
876c9d3a MT |
204 | }; |
205 | ||
f539f2ef HS |
206 | extern struct cmd_confirm_sleep confirm_sleep; |
207 | ||
10078321 | 208 | #endif |