aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/net/mac80211.h198
1 files changed, 149 insertions, 49 deletions
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 7a2463f39cfd..f0e19f9df2a7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -98,42 +98,96 @@ struct ieee80211_rate {
98 * optimizing channel utilization estimates */ 98 * optimizing channel utilization estimates */
99}; 99};
100 100
101/* 802.11g is backwards-compatible with 802.11b, so a wlan card can 101/**
102 * actually be both in 11b and 11g modes at the same time. */ 102 * enum ieee80211_phymode - PHY modes
103 *
104 * @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h
105 * @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b
106 * @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM),
107 * backwards compatible with 11b mode
108 * @NUM_IEEE80211_MODES: internal
109 */
103enum ieee80211_phymode { 110enum ieee80211_phymode {
104 MODE_IEEE80211A, /* IEEE 802.11a */ 111 MODE_IEEE80211A,
105 MODE_IEEE80211B, /* IEEE 802.11b only */ 112 MODE_IEEE80211B,
106 MODE_IEEE80211G, /* IEEE 802.11g (and 802.11b compatibility) */ 113 MODE_IEEE80211G,
107 114
108 /* keep last */ 115 /* keep last */
109 NUM_IEEE80211_MODES 116 NUM_IEEE80211_MODES
110}; 117};
111 118
119/**
120 * struct ieee80211_hw_mode - PHY mode definition
121 *
122 * This structure describes the capabilities supported by the device
123 * in a single PHY mode.
124 *
125 * @mode: the PHY mode for this definition
126 * @num_channels: number of supported channels
127 * @channels: pointer to array of supported channels
128 * @num_rates: number of supported bitrates
129 * @rates: pointer to array of supported bitrates
130 * @list: internal
131 */
112struct ieee80211_hw_mode { 132struct ieee80211_hw_mode {
113 int mode; /* MODE_IEEE80211... */ 133 struct list_head list;
114 int num_channels; /* Number of channels (below) */ 134 struct ieee80211_channel *channels;
115 struct ieee80211_channel *channels; /* Array of supported channels */ 135 struct ieee80211_rate *rates;
116 int num_rates; /* Number of rates (below) */ 136 enum ieee80211_phymode mode;
117 struct ieee80211_rate *rates; /* Array of supported rates */ 137 int num_channels;
118 138 int num_rates;
119 struct list_head list; /* Internal, don't touch */
120}; 139};
121 140
141/**
142 * struct ieee80211_tx_queue_params - transmit queue configuration
143 *
144 * The information provided in this structure is required for QoS
145 * transmit queue configuration.
146 *
147 * @aifs: arbitration interface space [0..255, -1: use default]
148 * @cw_min: minimum contention window [will be a value of the form
149 * 2^n-1 in the range 1..1023; 0: use default]
150 * @cw_max: maximum contention window [like @cw_min]
151 * @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled
152 */
122struct ieee80211_tx_queue_params { 153struct ieee80211_tx_queue_params {
123 int aifs; /* 0 .. 255; -1 = use default */ 154 int aifs;
124 int cw_min; /* 2^n-1: 1, 3, 7, .. , 1023; 0 = use default */ 155 int cw_min;
125 int cw_max; /* 2^n-1: 1, 3, 7, .. , 1023; 0 = use default */ 156 int cw_max;
126 int burst_time; /* maximum burst time in 0.1 ms (i.e., 10 = 1 ms); 157 int burst_time;
127 * 0 = disabled */
128}; 158};
129 159
160/**
161 * struct ieee80211_tx_queue_stats_data - transmit queue statistics
162 *
163 * @len: number of packets in queue
164 * @limit: queue length limit
165 * @count: number of frames sent
166 */
130struct ieee80211_tx_queue_stats_data { 167struct ieee80211_tx_queue_stats_data {
131 unsigned int len; /* num packets in queue */ 168 unsigned int len;
132 unsigned int limit; /* queue len (soft) limit */ 169 unsigned int limit;
133 unsigned int count; /* total num frames sent */ 170 unsigned int count;
134}; 171};
135 172
136enum { 173/**
174 * enum ieee80211_tx_queue - transmit queue number
175 *
176 * These constants are used with some callbacks that take a
177 * queue number to set parameters for a queue.
178 *
179 * @IEEE80211_TX_QUEUE_DATA0: data queue 0
180 * @IEEE80211_TX_QUEUE_DATA1: data queue 1
181 * @IEEE80211_TX_QUEUE_DATA2: data queue 2
182 * @IEEE80211_TX_QUEUE_DATA3: data queue 3
183 * @IEEE80211_TX_QUEUE_DATA4: data queue 4
184 * @IEEE80211_TX_QUEUE_SVP: ??
185 * @NUM_TX_DATA_QUEUES: number of data queues
186 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
187 * sent after a beacon
188 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
189 */
190enum ieee80211_tx_queue {
137 IEEE80211_TX_QUEUE_DATA0, 191 IEEE80211_TX_QUEUE_DATA0,
138 IEEE80211_TX_QUEUE_DATA1, 192 IEEE80211_TX_QUEUE_DATA1,
139 IEEE80211_TX_QUEUE_DATA2, 193 IEEE80211_TX_QUEUE_DATA2,
@@ -271,7 +325,7 @@ struct ieee80211_rx_status {
271 u64 mactime; 325 u64 mactime;
272 int freq; 326 int freq;
273 int channel; 327 int channel;
274 int phymode; 328 enum ieee80211_phymode phymode;
275 int ssi; 329 int ssi;
276 int signal; 330 int signal;
277 int noise; 331 int noise;
@@ -280,25 +334,65 @@ struct ieee80211_rx_status {
280 int flag; 334 int flag;
281}; 335};
282 336
283/* Transmit status. The low-level driver should provide this information 337/**
284 * (the subset supported by hardware) to the 802.11 code for each transmit 338 * enum ieee80211_tx_status_flags - transmit status flags
285 * frame. */ 339 *
340 * Status flags to indicate various transmit conditions.
341 *
342 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
343 * because the destination STA was in powersave mode.
344 *
345 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
346 */
347enum ieee80211_tx_status_flags {
348 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
349 IEEE80211_TX_STATUS_ACK = 1<<1,
350};
351
352/**
353 * struct ieee80211_tx_status - transmit status
354 *
355 * As much information as possible should be provided for each transmitted
356 * frame with ieee80211_tx_status().
357 *
358 * @control: a copy of the &struct ieee80211_tx_control passed to the driver
359 * in the tx() callback.
360 *
361 * @flags: transmit status flags, defined above
362 *
363 * @ack_signal: signal strength of the ACK frame
364 *
365 * @excessive_retries: set to 1 if the frame was retried many times
366 * but not acknowledged
367 *
368 * @retry_count: number of retries
369 *
370 * @queue_length: ?? REMOVE
371 * @queue_number: ?? REMOVE
372 */
286struct ieee80211_tx_status { 373struct ieee80211_tx_status {
287 /* copied ieee80211_tx_control structure */
288 struct ieee80211_tx_control control; 374 struct ieee80211_tx_control control;
289 375 u8 flags;
290#define IEEE80211_TX_STATUS_TX_FILTERED (1<<0) 376 bool excessive_retries;
291#define IEEE80211_TX_STATUS_ACK (1<<1) /* whether the TX frame was ACKed */ 377 u8 retry_count;
292 u32 flags; /* tx staus flags defined above */ 378 int ack_signal;
293 379 int queue_length;
294 int ack_signal; /* measured signal strength of the ACK frame */
295 int excessive_retries;
296 int retry_count;
297
298 int queue_length; /* information about TX queue */
299 int queue_number; 380 int queue_number;
300}; 381};
301 382
383/**
384 * enum ieee80211_conf_flags - configuration flags
385 *
386 * Flags to define PHY configuration options
387 *
388 * @IEEE80211_CONF_SHORT_SLOT_TIME: use 802.11g short slot time
389 * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported)
390 *
391 */
392enum ieee80211_conf_flags {
393 IEEE80211_CONF_SHORT_SLOT_TIME = 1<<0,
394 IEEE80211_CONF_RADIOTAP = 1<<1,
395};
302 396
303/** 397/**
304 * struct ieee80211_conf - configuration of the device 398 * struct ieee80211_conf - configuration of the device
@@ -306,31 +400,37 @@ struct ieee80211_tx_status {
306 * This struct indicates how the driver shall configure the hardware. 400 * This struct indicates how the driver shall configure the hardware.
307 * 401 *
308 * @radio_enabled: when zero, driver is required to switch off the radio. 402 * @radio_enabled: when zero, driver is required to switch off the radio.
403 * TODO make a flag
404 * @channel: IEEE 802.11 channel number
405 * @freq: frequency in MHz
406 * @channel_val: hardware specific channel value for the channel
407 * @phymode: PHY mode to activate (REMOVE)
408 * @chan: channel to switch to, pointer to the channel information
409 * @mode: pointer to mode definition
410 * @regulatory_domain: ??
411 * @beacon_int: beacon interval (TODO make interface config)
412 * @flags: configuration flags defined above
413 * @power_level: transmit power limit for current regulatory domain in dBm
414 * @antenna_max: maximum antenna gain
415 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
416 * 1/2: antenna 0/1
417 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
309 */ 418 */
310struct ieee80211_conf { 419struct ieee80211_conf {
311 int channel; /* IEEE 802.11 channel number */ 420 int channel; /* IEEE 802.11 channel number */
312 int freq; /* MHz */ 421 int freq; /* MHz */
313 int channel_val; /* hw specific value for the channel */ 422 int channel_val; /* hw specific value for the channel */
314 423
315 int phymode; /* MODE_IEEE80211A, .. */ 424 enum ieee80211_phymode phymode;
316 struct ieee80211_channel *chan; 425 struct ieee80211_channel *chan;
317 struct ieee80211_hw_mode *mode; 426 struct ieee80211_hw_mode *mode;
318 unsigned int regulatory_domain; 427 unsigned int regulatory_domain;
319 int radio_enabled; 428 int radio_enabled;
320 429
321 int beacon_int; 430 int beacon_int;
322 431 u32 flags;
323#define IEEE80211_CONF_SHORT_SLOT_TIME (1<<0) /* use IEEE 802.11g Short Slot 432 u8 power_level;
324 * Time */ 433 u8 antenna_max;
325#define IEEE80211_CONF_RADIOTAP (1<<1) /* use radiotap if supported
326 check this bit at RX time */
327 u32 flags; /* configuration flags defined above */
328
329 u8 power_level; /* transmit power limit for current
330 * regulatory domain; in dBm */
331 u8 antenna_max; /* maximum antenna gain */
332
333 /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
334 u8 antenna_sel_tx; 434 u8 antenna_sel_tx;
335 u8 antenna_sel_rx; 435 u8 antenna_sel_rx;
336}; 436};