Deleted Added
full compact
if_iwivar.h (178354) if_iwivar.h (191746)
1/* $FreeBSD: head/sys/dev/iwi/if_iwivar.h 178354 2008-04-20 20:35:46Z sam $ */
1/* $FreeBSD: head/sys/dev/iwi/if_iwivar.h 191746 2009-05-02 15:14:18Z thompsa $ */
2
3/*-
4 * Copyright (c) 2004, 2005
5 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 101 unchanged lines hidden (view full) ---

111 const struct firmware *fp; /* image handle */
112 const char *data; /* firmware image data */
113 size_t size; /* firmware image size */
114 const char *name; /* associated image name */
115};
116
117struct iwi_vap {
118 struct ieee80211vap iwi_vap;
2
3/*-
4 * Copyright (c) 2004, 2005
5 * Damien Bergamini <damien.bergamini@free.fr>. All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
9 * are met:

--- 101 unchanged lines hidden (view full) ---

111 const struct firmware *fp; /* image handle */
112 const char *data; /* firmware image data */
113 size_t size; /* firmware image size */
114 const char *name; /* associated image name */
115};
116
117struct iwi_vap {
118 struct ieee80211vap iwi_vap;
119 struct task iwi_authsuccess_task;
120 struct task iwi_assocsuccess_task;
121 struct task iwi_assocfailed_task;
122
123 int (*iwi_newstate)(struct ieee80211vap *,
124 enum ieee80211_state, int);
125};
126#define IWI_VAP(vap) ((struct iwi_vap *)(vap))
127
128struct iwi_softc {
129 struct ifnet *sc_ifp;
130 void (*sc_node_free)(struct ieee80211_node *);
131 device_t sc_dev;
132
133 struct mtx sc_mtx;
119
120 int (*iwi_newstate)(struct ieee80211vap *,
121 enum ieee80211_state, int);
122};
123#define IWI_VAP(vap) ((struct iwi_vap *)(vap))
124
125struct iwi_softc {
126 struct ifnet *sc_ifp;
127 void (*sc_node_free)(struct ieee80211_node *);
128 device_t sc_dev;
129
130 struct mtx sc_mtx;
134 struct mtx sc_cmdlock;
135 char sc_cmdname[12]; /* e.g. "iwi0_cmd" */
136 uint8_t sc_mcast[IEEE80211_ADDR_LEN];
137 struct unrhdr *sc_unr;
131 uint8_t sc_mcast[IEEE80211_ADDR_LEN];
132 struct unrhdr *sc_unr;
138 struct taskqueue *sc_tq; /* private task queue */
139 struct taskqueue *sc_tq2; /* reset task queue */
140
141 uint32_t flags;
142#define IWI_FLAG_FW_INITED (1 << 0)
143#define IWI_FLAG_BUSY (1 << 3) /* busy sending a command */
144#define IWI_FLAG_ASSOCIATED (1 << 4) /* currently associated */
145#define IWI_FLAG_CHANNEL_SCAN (1 << 5)
146 uint32_t fw_state;
147#define IWI_FW_IDLE 0

--- 42 unchanged lines hidden (view full) ---

190 int antenna;
191 int bluetooth;
192 struct iwi_associate assoc;
193 struct iwi_wme_params wme[3];
194 u_int sc_scangen;
195
196 struct task sc_radiontask; /* radio on processing */
197 struct task sc_radiofftask; /* radio off processing */
133
134 uint32_t flags;
135#define IWI_FLAG_FW_INITED (1 << 0)
136#define IWI_FLAG_BUSY (1 << 3) /* busy sending a command */
137#define IWI_FLAG_ASSOCIATED (1 << 4) /* currently associated */
138#define IWI_FLAG_CHANNEL_SCAN (1 << 5)
139 uint32_t fw_state;
140#define IWI_FW_IDLE 0

--- 42 unchanged lines hidden (view full) ---

183 int antenna;
184 int bluetooth;
185 struct iwi_associate assoc;
186 struct iwi_wme_params wme[3];
187 u_int sc_scangen;
188
189 struct task sc_radiontask; /* radio on processing */
190 struct task sc_radiofftask; /* radio off processing */
198 struct task sc_scanaborttask; /* cancel active scan */
199 struct task sc_restarttask; /* restart adapter processing */
191 struct task sc_restarttask; /* restart adapter processing */
200 struct task sc_opstask; /* scan / auth processing */
192 struct task sc_disassoctask;
201
202 unsigned int sc_softled : 1, /* enable LED gpio status */
203 sc_ledstate: 1, /* LED on/off state */
204 sc_blinking: 1; /* LED blink operation active */
205 u_int sc_nictype; /* NIC type from EEPROM */
206 u_int sc_ledpin; /* mask for activity LED */
207 u_int sc_ledidle; /* idle polling interval */
208 int sc_ledevent; /* time of last LED event */

--- 5 unchanged lines hidden (view full) ---

214 struct callout sc_ledtimer; /* led off timer */
215 struct callout sc_wdtimer; /* watchdog timer */
216 struct callout sc_rftimer; /* rfkill timer */
217
218 int sc_tx_timer;
219 int sc_state_timer; /* firmware state timer */
220 int sc_busy_timer; /* firmware cmd timer */
221
193
194 unsigned int sc_softled : 1, /* enable LED gpio status */
195 sc_ledstate: 1, /* LED on/off state */
196 sc_blinking: 1; /* LED blink operation active */
197 u_int sc_nictype; /* NIC type from EEPROM */
198 u_int sc_ledpin; /* mask for activity LED */
199 u_int sc_ledidle; /* idle polling interval */
200 int sc_ledevent; /* time of last LED event */

--- 5 unchanged lines hidden (view full) ---

206 struct callout sc_ledtimer; /* led off timer */
207 struct callout sc_wdtimer; /* watchdog timer */
208 struct callout sc_rftimer; /* rfkill timer */
209
210 int sc_tx_timer;
211 int sc_state_timer; /* firmware state timer */
212 int sc_busy_timer; /* firmware cmd timer */
213
222#define IWI_CMD_MAXOPS 10
223 int sc_cmd[IWI_CMD_MAXOPS];
224 unsigned long sc_arg[IWI_CMD_MAXOPS];
225 int sc_cmd_cur; /* current queued scan task */
226 int sc_cmd_next; /* last queued scan task */
227#define IWI_CMD_FREE 0 /* for marking slots unused */
228#define IWI_SCAN_START 1
229#define IWI_SET_CHANNEL 2
230#define IWI_AUTH 3
231#define IWI_ASSOC 4
232#define IWI_DISASSOC 5
233#define IWI_SCAN_CURCHAN 6
234#define IWI_SCAN_ALLCHAN 7
235#define IWI_SET_WME 8
236
237 struct iwi_rx_radiotap_header sc_rxtap;
238 int sc_rxtap_len;
239
240 struct iwi_tx_radiotap_header sc_txtap;
241 int sc_txtap_len;
242};
243
244#define IWI_STATE_BEGIN(_sc, _state) do { \

--- 27 unchanged lines hidden (view full) ---

272#define IWI_LOCK(sc) do { \
273 if (!(__waslocked = mtx_owned(&(sc)->sc_mtx))) \
274 mtx_lock(&(sc)->sc_mtx); \
275} while (0)
276#define IWI_UNLOCK(sc) do { \
277 if (!__waslocked) \
278 mtx_unlock(&(sc)->sc_mtx); \
279} while (0)
214 struct iwi_rx_radiotap_header sc_rxtap;
215 int sc_rxtap_len;
216
217 struct iwi_tx_radiotap_header sc_txtap;
218 int sc_txtap_len;
219};
220
221#define IWI_STATE_BEGIN(_sc, _state) do { \

--- 27 unchanged lines hidden (view full) ---

249#define IWI_LOCK(sc) do { \
250 if (!(__waslocked = mtx_owned(&(sc)->sc_mtx))) \
251 mtx_lock(&(sc)->sc_mtx); \
252} while (0)
253#define IWI_UNLOCK(sc) do { \
254 if (!__waslocked) \
255 mtx_unlock(&(sc)->sc_mtx); \
256} while (0)
280#define IWI_CMD_LOCK_INIT(sc) do { \
281 snprintf((sc)->sc_cmdname, sizeof((sc)->sc_cmdname), "%s_cmd", \
282 device_get_nameunit((sc)->sc_dev)); \
283 mtx_init(&(sc)->sc_cmdlock, (sc)->sc_cmdname, NULL, MTX_DEF); \
284} while (0)
285#define IWI_CMD_LOCK_DESTROY(sc) mtx_destroy(&(sc)->sc_cmdlock)
286#define IWI_CMD_LOCK(sc) mtx_lock(&(sc)->sc_cmdlock)
287#define IWI_CMD_UNLOCK(sc) mtx_unlock(&(sc)->sc_cmdlock)