aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h99
-rw-r--r--include/linux/ssb/ssb.h10
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h4
-rw-r--r--include/net/cfg80211.h24
-rw-r--r--include/net/mac80211.h384
-rw-r--r--include/net/wireless.h168
6 files changed, 497 insertions, 192 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 9fecf902419c..a9f0b93324a2 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -161,6 +161,12 @@ enum nl80211_commands {
161 * given for %NL80211_CMD_GET_STATION, nested attribute containing 161 * given for %NL80211_CMD_GET_STATION, nested attribute containing
162 * info as possible, see &enum nl80211_sta_stats. 162 * info as possible, see &enum nl80211_sta_stats.
163 * 163 *
164 * @NL80211_ATTR_WIPHY_BANDS: Information about an operating bands,
165 * consisting of a nested array.
166 *
167 * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of
168 * &enum nl80211_mntr_flags.
169 *
164 * @NL80211_ATTR_MAX: highest attribute number currently defined 170 * @NL80211_ATTR_MAX: highest attribute number currently defined
165 * @__NL80211_ATTR_AFTER_LAST: internal use 171 * @__NL80211_ATTR_AFTER_LAST: internal use
166 */ 172 */
@@ -195,6 +201,10 @@ enum nl80211_attrs {
195 NL80211_ATTR_STA_VLAN, 201 NL80211_ATTR_STA_VLAN,
196 NL80211_ATTR_STA_STATS, 202 NL80211_ATTR_STA_STATS,
197 203
204 NL80211_ATTR_WIPHY_BANDS,
205
206 NL80211_ATTR_MNTR_FLAGS,
207
198 /* add attributes here, update the policy in nl80211.c */ 208 /* add attributes here, update the policy in nl80211.c */
199 209
200 __NL80211_ATTR_AFTER_LAST, 210 __NL80211_ATTR_AFTER_LAST,
@@ -280,4 +290,93 @@ enum nl80211_sta_stats {
280 NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1 290 NL80211_STA_STAT_MAX = __NL80211_STA_STAT_AFTER_LAST - 1
281}; 291};
282 292
293/**
294 * enum nl80211_band_attr - band attributes
295 * @__NL80211_BAND_ATTR_INVALID: attribute number 0 is reserved
296 * @NL80211_BAND_ATTR_FREQS: supported frequencies in this band,
297 * an array of nested frequency attributes
298 * @NL80211_BAND_ATTR_RATES: supported bitrates in this band,
299 * an array of nested bitrate attributes
300 */
301enum nl80211_band_attr {
302 __NL80211_BAND_ATTR_INVALID,
303 NL80211_BAND_ATTR_FREQS,
304 NL80211_BAND_ATTR_RATES,
305
306 /* keep last */
307 __NL80211_BAND_ATTR_AFTER_LAST,
308 NL80211_BAND_ATTR_MAX = __NL80211_BAND_ATTR_AFTER_LAST - 1
309};
310
311/**
312 * enum nl80211_frequency_attr - frequency attributes
313 * @NL80211_FREQUENCY_ATTR_FREQ: Frequency in MHz
314 * @NL80211_FREQUENCY_ATTR_DISABLED: Channel is disabled in current
315 * regulatory domain.
316 * @NL80211_FREQUENCY_ATTR_PASSIVE_SCAN: Only passive scanning is
317 * permitted on this channel in current regulatory domain.
318 * @NL80211_FREQUENCY_ATTR_NO_IBSS: IBSS networks are not permitted
319 * on this channel in current regulatory domain.
320 * @NL80211_FREQUENCY_ATTR_RADAR: Radar detection is mandatory
321 * on this channel in current regulatory domain.
322 */
323enum nl80211_frequency_attr {
324 __NL80211_FREQUENCY_ATTR_INVALID,
325 NL80211_FREQUENCY_ATTR_FREQ,
326 NL80211_FREQUENCY_ATTR_DISABLED,
327 NL80211_FREQUENCY_ATTR_PASSIVE_SCAN,
328 NL80211_FREQUENCY_ATTR_NO_IBSS,
329 NL80211_FREQUENCY_ATTR_RADAR,
330
331 /* keep last */
332 __NL80211_FREQUENCY_ATTR_AFTER_LAST,
333 NL80211_FREQUENCY_ATTR_MAX = __NL80211_FREQUENCY_ATTR_AFTER_LAST - 1
334};
335
336/**
337 * enum nl80211_bitrate_attr - bitrate attributes
338 * @NL80211_BITRATE_ATTR_RATE: Bitrate in units of 100 kbps
339 * @NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE: Short preamble supported
340 * in 2.4 GHz band.
341 */
342enum nl80211_bitrate_attr {
343 __NL80211_BITRATE_ATTR_INVALID,
344 NL80211_BITRATE_ATTR_RATE,
345 NL80211_BITRATE_ATTR_2GHZ_SHORTPREAMBLE,
346
347 /* keep last */
348 __NL80211_BITRATE_ATTR_AFTER_LAST,
349 NL80211_BITRATE_ATTR_MAX = __NL80211_BITRATE_ATTR_AFTER_LAST - 1
350};
351
352/**
353 * enum nl80211_mntr_flags - monitor configuration flags
354 *
355 * Monitor configuration flags.
356 *
357 * @__NL80211_MNTR_FLAG_INVALID: reserved
358 *
359 * @NL80211_MNTR_FLAG_FCSFAIL: pass frames with bad FCS
360 * @NL80211_MNTR_FLAG_PLCPFAIL: pass frames with bad PLCP
361 * @NL80211_MNTR_FLAG_CONTROL: pass control frames
362 * @NL80211_MNTR_FLAG_OTHER_BSS: disable BSSID filtering
363 * @NL80211_MNTR_FLAG_COOK_FRAMES: report frames after processing.
364 * overrides all other flags.
365 *
366 * @__NL80211_MNTR_FLAG_AFTER_LAST: internal use
367 * @NL80211_MNTR_FLAG_MAX: highest possible monitor flag
368 */
369enum nl80211_mntr_flags {
370 __NL80211_MNTR_FLAG_INVALID,
371 NL80211_MNTR_FLAG_FCSFAIL,
372 NL80211_MNTR_FLAG_PLCPFAIL,
373 NL80211_MNTR_FLAG_CONTROL,
374 NL80211_MNTR_FLAG_OTHER_BSS,
375 NL80211_MNTR_FLAG_COOK_FRAMES,
376
377 /* keep last */
378 __NL80211_MNTR_FLAG_AFTER_LAST,
379 NL80211_MNTR_FLAG_MAX = __NL80211_MNTR_FLAG_AFTER_LAST - 1
380};
381
283#endif /* __LINUX_NL80211_H */ 382#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 20add65215af..860d28c6d149 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -72,8 +72,10 @@ struct ssb_device;
72/* Lowlevel read/write operations on the device MMIO. 72/* Lowlevel read/write operations on the device MMIO.
73 * Internal, don't use that outside of ssb. */ 73 * Internal, don't use that outside of ssb. */
74struct ssb_bus_ops { 74struct ssb_bus_ops {
75 u8 (*read8)(struct ssb_device *dev, u16 offset);
75 u16 (*read16)(struct ssb_device *dev, u16 offset); 76 u16 (*read16)(struct ssb_device *dev, u16 offset);
76 u32 (*read32)(struct ssb_device *dev, u16 offset); 77 u32 (*read32)(struct ssb_device *dev, u16 offset);
78 void (*write8)(struct ssb_device *dev, u16 offset, u8 value);
77 void (*write16)(struct ssb_device *dev, u16 offset, u16 value); 79 void (*write16)(struct ssb_device *dev, u16 offset, u16 value);
78 void (*write32)(struct ssb_device *dev, u16 offset, u32 value); 80 void (*write32)(struct ssb_device *dev, u16 offset, u32 value);
79}; 81};
@@ -344,6 +346,10 @@ void ssb_device_disable(struct ssb_device *dev, u32 core_specific_flags);
344 346
345 347
346/* Device MMIO register read/write functions. */ 348/* Device MMIO register read/write functions. */
349static inline u8 ssb_read8(struct ssb_device *dev, u16 offset)
350{
351 return dev->ops->read8(dev, offset);
352}
347static inline u16 ssb_read16(struct ssb_device *dev, u16 offset) 353static inline u16 ssb_read16(struct ssb_device *dev, u16 offset)
348{ 354{
349 return dev->ops->read16(dev, offset); 355 return dev->ops->read16(dev, offset);
@@ -352,6 +358,10 @@ static inline u32 ssb_read32(struct ssb_device *dev, u16 offset)
352{ 358{
353 return dev->ops->read32(dev, offset); 359 return dev->ops->read32(dev, offset);
354} 360}
361static inline void ssb_write8(struct ssb_device *dev, u16 offset, u8 value)
362{
363 dev->ops->write8(dev, offset, value);
364}
355static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value) 365static inline void ssb_write16(struct ssb_device *dev, u16 offset, u16 value)
356{ 366{
357 dev->ops->write16(dev, offset, value); 367 dev->ops->write16(dev, offset, value);
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index 536851b946f6..b548a54ff1f5 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -390,6 +390,10 @@ extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
390extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, 390extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc,
391 u32 ticks); 391 u32 ticks);
392 392
393void ssb_chipco_irq_mask(struct ssb_chipcommon *cc, u32 mask, u32 value);
394
395u32 ssb_chipco_irq_status(struct ssb_chipcommon *cc, u32 mask);
396
393/* Chipcommon GPIO pin access. */ 397/* Chipcommon GPIO pin access. */
394u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask); 398u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask);
395u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value); 399u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value);
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index bcc480b8892a..ab4caf63954f 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -163,6 +163,26 @@ struct station_stats {
163 u32 tx_bytes; 163 u32 tx_bytes;
164}; 164};
165 165
166/**
167 * enum monitor_flags - monitor flags
168 *
169 * Monitor interface configuration flags. Note that these must be the bits
170 * according to the nl80211 flags.
171 *
172 * @MONITOR_FLAG_FCSFAIL: pass frames with bad FCS
173 * @MONITOR_FLAG_PLCPFAIL: pass frames with bad PLCP
174 * @MONITOR_FLAG_CONTROL: pass control frames
175 * @MONITOR_FLAG_OTHER_BSS: disable BSSID filtering
176 * @MONITOR_FLAG_COOK_FRAMES: report frames after processing
177 */
178enum monitor_flags {
179 MONITOR_FLAG_FCSFAIL = 1<<NL80211_MNTR_FLAG_FCSFAIL,
180 MONITOR_FLAG_PLCPFAIL = 1<<NL80211_MNTR_FLAG_PLCPFAIL,
181 MONITOR_FLAG_CONTROL = 1<<NL80211_MNTR_FLAG_CONTROL,
182 MONITOR_FLAG_OTHER_BSS = 1<<NL80211_MNTR_FLAG_OTHER_BSS,
183 MONITOR_FLAG_COOK_FRAMES = 1<<NL80211_MNTR_FLAG_COOK_FRAMES,
184};
185
166/* from net/wireless.h */ 186/* from net/wireless.h */
167struct wiphy; 187struct wiphy;
168 188
@@ -213,10 +233,10 @@ struct wiphy;
213 */ 233 */
214struct cfg80211_ops { 234struct cfg80211_ops {
215 int (*add_virtual_intf)(struct wiphy *wiphy, char *name, 235 int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
216 enum nl80211_iftype type); 236 enum nl80211_iftype type, u32 *flags);
217 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex); 237 int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
218 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex, 238 int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
219 enum nl80211_iftype type); 239 enum nl80211_iftype type, u32 *flags);
220 240
221 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev, 241 int (*add_key)(struct wiphy *wiphy, struct net_device *netdev,
222 u8 key_index, u8 *mac_addr, 242 u8 key_index, u8 *mac_addr,
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 9083bafb63ca..7a80c3981237 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -38,7 +38,11 @@
38 * called in hardware interrupt context. The low-level driver must not call any 38 * called in hardware interrupt context. The low-level driver must not call any
39 * other functions in hardware interrupt context. If there is a need for such 39 * other functions in hardware interrupt context. If there is a need for such
40 * call, the low-level driver should first ACK the interrupt and perform the 40 * call, the low-level driver should first ACK the interrupt and perform the
41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue function. 41 * IEEE 802.11 code call after this, e.g. from a scheduled workqueue or even
42 * tasklet function.
43 *
44 * NOTE: If the driver opts to use the _irqsafe() functions, it may not also
45 * use the non-irqsafe functions!
42 */ 46 */
43 47
44/** 48/**
@@ -69,95 +73,6 @@
69 * not do so then mac80211 may add this under certain circumstances. 73 * not do so then mac80211 may add this under certain circumstances.
70 */ 74 */
71 75
72#define IEEE80211_CHAN_W_SCAN 0x00000001
73#define IEEE80211_CHAN_W_ACTIVE_SCAN 0x00000002
74#define IEEE80211_CHAN_W_IBSS 0x00000004
75
76/* Channel information structure. Low-level driver is expected to fill in chan,
77 * freq, and val fields. Other fields will be filled in by 80211.o based on
78 * hostapd information and low-level driver does not need to use them. The
79 * limits for each channel will be provided in 'struct ieee80211_conf' when
80 * configuring the low-level driver with hw->config callback. If a device has
81 * a default regulatory domain, IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED
82 * can be set to let the driver configure all fields */
83struct ieee80211_channel {
84 short chan; /* channel number (IEEE 802.11) */
85 short freq; /* frequency in MHz */
86 int val; /* hw specific value for the channel */
87 int flag; /* flag for hostapd use (IEEE80211_CHAN_*) */
88 unsigned char power_level;
89 unsigned char antenna_max;
90};
91
92#define IEEE80211_RATE_ERP 0x00000001
93#define IEEE80211_RATE_BASIC 0x00000002
94#define IEEE80211_RATE_PREAMBLE2 0x00000004
95#define IEEE80211_RATE_SUPPORTED 0x00000010
96#define IEEE80211_RATE_OFDM 0x00000020
97#define IEEE80211_RATE_CCK 0x00000040
98#define IEEE80211_RATE_MANDATORY 0x00000100
99
100#define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
101#define IEEE80211_RATE_MODULATION(f) \
102 (f & (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
103
104/* Low-level driver should set PREAMBLE2, OFDM and CCK flags.
105 * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
106 * configuration. */
107struct ieee80211_rate {
108 int rate; /* rate in 100 kbps */
109 int val; /* hw specific value for the rate */
110 int flags; /* IEEE80211_RATE_ flags */
111 int val2; /* hw specific value for the rate when using short preamble
112 * (only when IEEE80211_RATE_PREAMBLE2 flag is set, i.e., for
113 * 2, 5.5, and 11 Mbps) */
114 signed char min_rssi_ack;
115 unsigned char min_rssi_ack_delta;
116
117 /* following fields are set by 80211.o and need not be filled by the
118 * low-level driver */
119 int rate_inv; /* inverse of the rate (LCM(all rates) / rate) for
120 * optimizing channel utilization estimates */
121};
122
123/**
124 * enum ieee80211_phymode - PHY modes
125 *
126 * @MODE_IEEE80211A: 5GHz as defined by 802.11a/802.11h
127 * @MODE_IEEE80211B: 2.4 GHz as defined by 802.11b
128 * @MODE_IEEE80211G: 2.4 GHz as defined by 802.11g (with OFDM),
129 * backwards compatible with 11b mode
130 * @NUM_IEEE80211_MODES: internal
131 */
132enum ieee80211_phymode {
133 MODE_IEEE80211A,
134 MODE_IEEE80211B,
135 MODE_IEEE80211G,
136
137 /* keep last */
138 NUM_IEEE80211_MODES
139};
140
141/**
142 * struct ieee80211_ht_info - describing STA's HT capabilities
143 *
144 * This structure describes most essential parameters needed
145 * to describe 802.11n HT capabilities for an STA.
146 *
147 * @ht_supported: is HT supported by STA, 0: no, 1: yes
148 * @cap: HT capabilities map as described in 802.11n spec
149 * @ampdu_factor: Maximum A-MPDU length factor
150 * @ampdu_density: Minimum A-MPDU spacing
151 * @supp_mcs_set: Supported MCS set as described in 802.11n spec
152 */
153struct ieee80211_ht_info {
154 u8 ht_supported;
155 u16 cap; /* use IEEE80211_HT_CAP_ */
156 u8 ampdu_factor;
157 u8 ampdu_density;
158 u8 supp_mcs_set[16];
159};
160
161/** 76/**
162 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics 77 * struct ieee80211_ht_bss_info - describing BSS's HT characteristics
163 * 78 *
@@ -175,46 +90,22 @@ struct ieee80211_ht_bss_info {
175}; 90};
176 91
177/** 92/**
178 * struct ieee80211_hw_mode - PHY mode definition
179 *
180 * This structure describes the capabilities supported by the device
181 * in a single PHY mode.
182 *
183 * @list: internal
184 * @channels: pointer to array of supported channels
185 * @rates: pointer to array of supported bitrates
186 * @mode: the PHY mode for this definition
187 * @num_channels: number of supported channels
188 * @num_rates: number of supported bitrates
189 * @ht_info: PHY's 802.11n HT abilities for this mode
190 */
191struct ieee80211_hw_mode {
192 struct list_head list;
193 struct ieee80211_channel *channels;
194 struct ieee80211_rate *rates;
195 enum ieee80211_phymode mode;
196 int num_channels;
197 int num_rates;
198 struct ieee80211_ht_info ht_info;
199};
200
201/**
202 * struct ieee80211_tx_queue_params - transmit queue configuration 93 * struct ieee80211_tx_queue_params - transmit queue configuration
203 * 94 *
204 * The information provided in this structure is required for QoS 95 * The information provided in this structure is required for QoS
205 * transmit queue configuration. 96 * transmit queue configuration. Cf. IEEE 802.11 7.3.2.29.
206 * 97 *
207 * @aifs: arbitration interface space [0..255, -1: use default] 98 * @aifs: arbitration interface space [0..255, -1: use default]
208 * @cw_min: minimum contention window [will be a value of the form 99 * @cw_min: minimum contention window [will be a value of the form
209 * 2^n-1 in the range 1..1023; 0: use default] 100 * 2^n-1 in the range 1..1023; 0: use default]
210 * @cw_max: maximum contention window [like @cw_min] 101 * @cw_max: maximum contention window [like @cw_min]
211 * @burst_time: maximum burst time in units of 0.1ms, 0 meaning disabled 102 * @txop: maximum burst time in units of 32 usecs, 0 meaning disabled
212 */ 103 */
213struct ieee80211_tx_queue_params { 104struct ieee80211_tx_queue_params {
214 int aifs; 105 s16 aifs;
215 int cw_min; 106 u16 cw_min;
216 int cw_max; 107 u16 cw_max;
217 int burst_time; 108 u16 txop;
218}; 109};
219 110
220/** 111/**
@@ -246,6 +137,7 @@ struct ieee80211_tx_queue_stats_data {
246 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be 137 * @IEEE80211_TX_QUEUE_AFTER_BEACON: transmit queue for frames to be
247 * sent after a beacon 138 * sent after a beacon
248 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames 139 * @IEEE80211_TX_QUEUE_BEACON: transmit queue for beacon frames
140 * @NUM_TX_DATA_QUEUES_AMPDU: adding more queues for A-MPDU
249 */ 141 */
250enum ieee80211_tx_queue { 142enum ieee80211_tx_queue {
251 IEEE80211_TX_QUEUE_DATA0, 143 IEEE80211_TX_QUEUE_DATA0,
@@ -261,11 +153,12 @@ enum ieee80211_tx_queue {
261 * this struct need to have fixed values. As soon as it is removed, we can 153 * this struct need to have fixed values. As soon as it is removed, we can
262 * fix these entries. */ 154 * fix these entries. */
263 IEEE80211_TX_QUEUE_AFTER_BEACON = 6, 155 IEEE80211_TX_QUEUE_AFTER_BEACON = 6,
264 IEEE80211_TX_QUEUE_BEACON = 7 156 IEEE80211_TX_QUEUE_BEACON = 7,
157 NUM_TX_DATA_QUEUES_AMPDU = 16
265}; 158};
266 159
267struct ieee80211_tx_queue_stats { 160struct ieee80211_tx_queue_stats {
268 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES]; 161 struct ieee80211_tx_queue_stats_data data[NUM_TX_DATA_QUEUES_AMPDU];
269}; 162};
270 163
271struct ieee80211_low_level_stats { 164struct ieee80211_low_level_stats {
@@ -318,11 +211,13 @@ struct ieee80211_bss_conf {
318 211
319struct ieee80211_tx_control { 212struct ieee80211_tx_control {
320 struct ieee80211_vif *vif; 213 struct ieee80211_vif *vif;
321 int tx_rate; /* Transmit rate, given as the hw specific value for the 214 struct ieee80211_rate *tx_rate;
322 * rate (from struct ieee80211_rate) */ 215
323 int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw 216 /* Transmit rate for RTS/CTS frame */
324 * specific value for the rate (from 217 struct ieee80211_rate *rts_cts_rate;
325 * struct ieee80211_rate) */ 218
219 /* retry rate for the last retries */
220 struct ieee80211_rate *alt_retry_rate;
326 221
327#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for 222#define IEEE80211_TXCTL_REQ_TX_STATUS (1<<0)/* request TX status callback for
328 * this frame */ 223 * this frame */
@@ -337,10 +232,12 @@ struct ieee80211_tx_control {
337#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to 232#define IEEE80211_TXCTL_NO_ACK (1<<4) /* tell the low level not to
338 * wait for an ack */ 233 * wait for an ack */
339#define IEEE80211_TXCTL_RATE_CTRL_PROBE (1<<5) 234#define IEEE80211_TXCTL_RATE_CTRL_PROBE (1<<5)
340#define IEEE80211_TXCTL_CLEAR_DST_MASK (1<<6) 235#define IEEE80211_TXCTL_CLEAR_PS_FILT (1<<6) /* clear powersave filter
236 * for destination station */
341#define IEEE80211_TXCTL_REQUEUE (1<<7) 237#define IEEE80211_TXCTL_REQUEUE (1<<7)
342#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of 238#define IEEE80211_TXCTL_FIRST_FRAGMENT (1<<8) /* this is a first fragment of
343 * the frame */ 239 * the frame */
240#define IEEE80211_TXCTL_SHORT_PREAMBLE (1<<9)
344#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send 241#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10) /* this frame should be send
345 * using the through 242 * using the through
346 * set_retry_limit configured 243 * set_retry_limit configured
@@ -348,6 +245,8 @@ struct ieee80211_tx_control {
348#define IEEE80211_TXCTL_EAPOL_FRAME (1<<11) /* internal to mac80211 */ 245#define IEEE80211_TXCTL_EAPOL_FRAME (1<<11) /* internal to mac80211 */
349#define IEEE80211_TXCTL_SEND_AFTER_DTIM (1<<12) /* send this frame after DTIM 246#define IEEE80211_TXCTL_SEND_AFTER_DTIM (1<<12) /* send this frame after DTIM
350 * beacon */ 247 * beacon */
248#define IEEE80211_TXCTL_AMPDU (1<<13) /* this frame should be sent
249 * as part of an A-MPDU */
351 u32 flags; /* tx control flags defined 250 u32 flags; /* tx control flags defined
352 * above */ 251 * above */
353 u8 key_idx; /* keyidx from hw->set_key(), undefined if 252 u8 key_idx; /* keyidx from hw->set_key(), undefined if
@@ -355,20 +254,11 @@ struct ieee80211_tx_control {
355 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. 254 u8 retry_limit; /* 1 = only first attempt, 2 = one retry, ..
356 * This could be used when set_retry_limit 255 * This could be used when set_retry_limit
357 * is not implemented by the driver */ 256 * is not implemented by the driver */
358 u8 power_level; /* per-packet transmit power level, in dBm */
359 u8 antenna_sel_tx; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ 257 u8 antenna_sel_tx; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */
360 u8 icv_len; /* length of the ICV/MIC field in octets */ 258 u8 icv_len; /* length of the ICV/MIC field in octets */
361 u8 iv_len; /* length of the IV field in octets */ 259 u8 iv_len; /* length of the IV field in octets */
362 u8 queue; /* hardware queue to use for this frame; 260 u8 queue; /* hardware queue to use for this frame;
363 * 0 = highest, hw->queues-1 = lowest */ 261 * 0 = highest, hw->queues-1 = lowest */
364 struct ieee80211_rate *rate; /* internal 80211.o rate */
365 struct ieee80211_rate *rts_rate; /* internal 80211.o rate
366 * for RTS/CTS */
367 int alt_retry_rate; /* retry rate for the last retries, given as the
368 * hw specific value for the rate (from
369 * struct ieee80211_rate). To be used to limit
370 * packet dropping when probing higher rates, if hw
371 * supports multiple retry rates. -1 = not used */
372 int type; /* internal */ 262 int type; /* internal */
373}; 263};
374 264
@@ -391,7 +281,8 @@ struct ieee80211_tx_control {
391 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on 281 * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
392 * the frame. 282 * the frame.
393 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field) 283 * @RX_FLAG_TSFT: The timestamp passed in the RX status (@mactime field)
394 * is valid. 284 * is valid. This is useful in monitor mode and necessary for beacon frames
285 * to enable IBSS merging.
395 */ 286 */
396enum mac80211_rx_flags { 287enum mac80211_rx_flags {
397 RX_FLAG_MMIC_ERROR = 1<<0, 288 RX_FLAG_MMIC_ERROR = 1<<0,
@@ -410,27 +301,26 @@ enum mac80211_rx_flags {
410 * The low-level driver should provide this information (the subset 301 * The low-level driver should provide this information (the subset
411 * supported by hardware) to the 802.11 code with each received 302 * supported by hardware) to the 802.11 code with each received
412 * frame. 303 * frame.
413 * @mactime: MAC timestamp as defined by 802.11 304 * @mactime: value in microseconds of the 64-bit Time Synchronization Function
305 * (TSF) timer when the first data symbol (MPDU) arrived at the hardware.
306 * @band: the active band when this frame was received
414 * @freq: frequency the radio was tuned to when receiving this frame, in MHz 307 * @freq: frequency the radio was tuned to when receiving this frame, in MHz
415 * @channel: channel the radio was tuned to
416 * @phymode: active PHY mode
417 * @ssi: signal strength when receiving this frame 308 * @ssi: signal strength when receiving this frame
418 * @signal: used as 'qual' in statistics reporting 309 * @signal: used as 'qual' in statistics reporting
419 * @noise: PHY noise when receiving this frame 310 * @noise: PHY noise when receiving this frame
420 * @antenna: antenna used 311 * @antenna: antenna used
421 * @rate: data rate 312 * @rate_idx: index of data rate into band's supported rates
422 * @flag: %RX_FLAG_* 313 * @flag: %RX_FLAG_*
423 */ 314 */
424struct ieee80211_rx_status { 315struct ieee80211_rx_status {
425 u64 mactime; 316 u64 mactime;
317 enum ieee80211_band band;
426 int freq; 318 int freq;
427 int channel;
428 enum ieee80211_phymode phymode;
429 int ssi; 319 int ssi;
430 int signal; 320 int signal;
431 int noise; 321 int noise;
432 int antenna; 322 int antenna;
433 int rate; 323 int rate_idx;
434 int flag; 324 int flag;
435}; 325};
436 326
@@ -441,12 +331,14 @@ struct ieee80211_rx_status {
441 * 331 *
442 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted 332 * @IEEE80211_TX_STATUS_TX_FILTERED: The frame was not transmitted
443 * because the destination STA was in powersave mode. 333 * because the destination STA was in powersave mode.
444 *
445 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged 334 * @IEEE80211_TX_STATUS_ACK: Frame was acknowledged
335 * @IEEE80211_TX_STATUS_AMPDU: The frame was aggregated, so status
336 * is for the whole aggregation.
446 */ 337 */
447enum ieee80211_tx_status_flags { 338enum ieee80211_tx_status_flags {
448 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0, 339 IEEE80211_TX_STATUS_TX_FILTERED = 1<<0,
449 IEEE80211_TX_STATUS_ACK = 1<<1, 340 IEEE80211_TX_STATUS_ACK = 1<<1,
341 IEEE80211_TX_STATUS_AMPDU = 1<<2,
450}; 342};
451 343
452/** 344/**
@@ -457,24 +349,25 @@ enum ieee80211_tx_status_flags {
457 * 349 *
458 * @control: a copy of the &struct ieee80211_tx_control passed to the driver 350 * @control: a copy of the &struct ieee80211_tx_control passed to the driver
459 * in the tx() callback. 351 * in the tx() callback.
460 *
461 * @flags: transmit status flags, defined above 352 * @flags: transmit status flags, defined above
462 * 353 * @retry_count: number of retries
463 * @ack_signal: signal strength of the ACK frame
464 *
465 * @excessive_retries: set to 1 if the frame was retried many times 354 * @excessive_retries: set to 1 if the frame was retried many times
466 * but not acknowledged 355 * but not acknowledged
467 * 356 * @ampdu_ack_len: number of aggregated frames.
468 * @retry_count: number of retries 357 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
469 * 358 * @ampdu_ack_map: block ack bit map for the aggregation.
359 * relevant only if IEEE80211_TX_STATUS_AMPDU was set.
360 * @ack_signal: signal strength of the ACK frame
470 * @queue_length: ?? REMOVE 361 * @queue_length: ?? REMOVE
471 * @queue_number: ?? REMOVE 362 * @queue_number: ?? REMOVE
472 */ 363 */
473struct ieee80211_tx_status { 364struct ieee80211_tx_status {
474 struct ieee80211_tx_control control; 365 struct ieee80211_tx_control control;
475 u8 flags; 366 u8 flags;
476 bool excessive_retries;
477 u8 retry_count; 367 u8 retry_count;
368 bool excessive_retries;
369 u8 ampdu_ack_len;
370 u64 ampdu_ack_map;
478 int ack_signal; 371 int ack_signal;
479 int queue_length; 372 int queue_length;
480 int queue_number; 373 int queue_number;
@@ -502,41 +395,30 @@ enum ieee80211_conf_flags {
502 * 395 *
503 * @radio_enabled: when zero, driver is required to switch off the radio. 396 * @radio_enabled: when zero, driver is required to switch off the radio.
504 * TODO make a flag 397 * TODO make a flag
505 * @channel: IEEE 802.11 channel number
506 * @freq: frequency in MHz
507 * @channel_val: hardware specific channel value for the channel
508 * @phymode: PHY mode to activate (REMOVE)
509 * @chan: channel to switch to, pointer to the channel information
510 * @mode: pointer to mode definition
511 * @regulatory_domain: ??
512 * @beacon_int: beacon interval (TODO make interface config) 398 * @beacon_int: beacon interval (TODO make interface config)
513 * @flags: configuration flags defined above 399 * @flags: configuration flags defined above
514 * @power_level: transmit power limit for current regulatory domain in dBm 400 * @power_level: requested transmit power (in dBm)
515 * @antenna_max: maximum antenna gain 401 * @max_antenna_gain: maximum antenna gain (in dBi)
516 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity, 402 * @antenna_sel_tx: transmit antenna selection, 0: default/diversity,
517 * 1/2: antenna 0/1 403 * 1/2: antenna 0/1
518 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx 404 * @antenna_sel_rx: receive antenna selection, like @antenna_sel_tx
519 * @ht_conf: describes current self configuration of 802.11n HT capabilies 405 * @ht_conf: describes current self configuration of 802.11n HT capabilies
520 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters 406 * @ht_bss_conf: describes current BSS configuration of 802.11n HT parameters
407 * @channel: the channel to tune to
521 */ 408 */
522struct ieee80211_conf { 409struct ieee80211_conf {
523 int channel; /* IEEE 802.11 channel number */
524 int freq; /* MHz */
525 int channel_val; /* hw specific value for the channel */
526
527 enum ieee80211_phymode phymode;
528 struct ieee80211_channel *chan;
529 struct ieee80211_hw_mode *mode;
530 unsigned int regulatory_domain; 410 unsigned int regulatory_domain;
531 int radio_enabled; 411 int radio_enabled;
532 412
533 int beacon_int; 413 int beacon_int;
534 u32 flags; 414 u32 flags;
535 u8 power_level; 415 int power_level;
536 u8 antenna_max; 416 int max_antenna_gain;
537 u8 antenna_sel_tx; 417 u8 antenna_sel_tx;
538 u8 antenna_sel_rx; 418 u8 antenna_sel_rx;
539 419
420 struct ieee80211_channel *channel;
421
540 struct ieee80211_ht_info ht_conf; 422 struct ieee80211_ht_info ht_conf;
541 struct ieee80211_ht_bss_info ht_bss_conf; 423 struct ieee80211_ht_bss_info ht_bss_conf;
542}; 424};
@@ -757,15 +639,19 @@ enum sta_notify_cmd {
757 * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because 639 * %IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE is also not set because
758 * otherwise the stack will not know when the DTIM beacon was sent. 640 * otherwise the stack will not know when the DTIM beacon was sent.
759 * 641 *
760 * @IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED: 642 * @IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE:
761 * Channels are already configured to the default regulatory domain 643 * Hardware is not capable of short slot operation on the 2.4 GHz band.
762 * specified in the device's EEPROM 644 *
645 * @IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE:
646 * Hardware is not capable of receiving frames with short preamble on
647 * the 2.4 GHz band.
763 */ 648 */
764enum ieee80211_hw_flags { 649enum ieee80211_hw_flags {
765 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0, 650 IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE = 1<<0,
766 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, 651 IEEE80211_HW_RX_INCLUDES_FCS = 1<<1,
767 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, 652 IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2,
768 IEEE80211_HW_DEFAULT_REG_DOMAIN_CONFIGURED = 1<<3, 653 IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3,
654 IEEE80211_HW_2GHZ_SHORT_PREAMBLE_INCAPABLE = 1<<4,
769}; 655};
770 656
771/** 657/**
@@ -777,7 +663,8 @@ enum ieee80211_hw_flags {
777 * @wiphy: This points to the &struct wiphy allocated for this 663 * @wiphy: This points to the &struct wiphy allocated for this
778 * 802.11 PHY. You must fill in the @perm_addr and @dev 664 * 802.11 PHY. You must fill in the @perm_addr and @dev
779 * members of this structure using SET_IEEE80211_DEV() 665 * members of this structure using SET_IEEE80211_DEV()
780 * and SET_IEEE80211_PERM_ADDR(). 666 * and SET_IEEE80211_PERM_ADDR(). Additionally, all supported
667 * bands (with channels, bitrates) are registered here.
781 * 668 *
782 * @conf: &struct ieee80211_conf, device configuration, don't use. 669 * @conf: &struct ieee80211_conf, device configuration, don't use.
783 * 670 *
@@ -913,8 +800,18 @@ static inline void SET_IEEE80211_PERM_ADDR(struct ieee80211_hw *hw, u8 *addr)
913 * parameter to see whether multicast frames should be accepted 800 * parameter to see whether multicast frames should be accepted
914 * or dropped. 801 * or dropped.
915 * 802 *
916 * All unsupported flags in @total_flags must be cleared, i.e. you 803 * All unsupported flags in @total_flags must be cleared.
917 * should clear all bits except those you honoured. 804 * Hardware does not support a flag if it is incapable of _passing_
805 * the frame to the stack. Otherwise the driver must ignore
806 * the flag, but not clear it.
807 * You must _only_ clear the flag (announce no support for the
808 * flag to mac80211) if you are not able to pass the packet type
809 * to the stack (so the hardware always filters it).
810 * So for example, you should clear @FIF_CONTROL, if your hardware
811 * always filters control frames. If your hardware always passes
812 * control frames to the kernel and is incapable of filtering them,
813 * you do _not_ clear the @FIF_CONTROL flag.
814 * This rule applies to all other FIF flags as well.
918 */ 815 */
919 816
920/** 817/**
@@ -967,10 +864,14 @@ enum ieee80211_filter_flags {
967 * &struct ieee80211_ops to indicate which action is needed. 864 * &struct ieee80211_ops to indicate which action is needed.
968 * @IEEE80211_AMPDU_RX_START: start Rx aggregation 865 * @IEEE80211_AMPDU_RX_START: start Rx aggregation
969 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation 866 * @IEEE80211_AMPDU_RX_STOP: stop Rx aggregation
867 * @IEEE80211_AMPDU_TX_START: start Tx aggregation
868 * @IEEE80211_AMPDU_TX_STOP: stop Tx aggregation
970 */ 869 */
971enum ieee80211_ampdu_mlme_action { 870enum ieee80211_ampdu_mlme_action {
972 IEEE80211_AMPDU_RX_START, 871 IEEE80211_AMPDU_RX_START,
973 IEEE80211_AMPDU_RX_STOP, 872 IEEE80211_AMPDU_RX_STOP,
873 IEEE80211_AMPDU_TX_START,
874 IEEE80211_AMPDU_TX_STOP,
974}; 875};
975 876
976/** 877/**
@@ -1051,7 +952,9 @@ enum ieee80211_ampdu_mlme_action {
1051 * given local_address is enabled. 952 * given local_address is enabled.
1052 * 953 *
1053 * @hw_scan: Ask the hardware to service the scan request, no need to start 954 * @hw_scan: Ask the hardware to service the scan request, no need to start
1054 * the scan state machine in stack. 955 * the scan state machine in stack. The scan must honour the channel
956 * configuration done by the regulatory agent in the wiphy's registered
957 * bands.
1055 * 958 *
1056 * @get_stats: return low-level statistics 959 * @get_stats: return low-level statistics
1057 * 960 *
@@ -1111,7 +1014,8 @@ enum ieee80211_ampdu_mlme_action {
1111 * The RA/TID combination determines the destination and TID we want 1014 * The RA/TID combination determines the destination and TID we want
1112 * the ampdu action to be performed for. The action is defined through 1015 * the ampdu action to be performed for. The action is defined through
1113 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn) 1016 * ieee80211_ampdu_mlme_action. Starting sequence number (@ssn)
1114 * is the first frame we expect to perform the action on. 1017 * is the first frame we expect to perform the action on. notice
1018 * that TX/RX_STOP can pass NULL for this parameter.
1115 */ 1019 */
1116struct ieee80211_ops { 1020struct ieee80211_ops {
1117 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb, 1021 int (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb,
@@ -1162,7 +1066,7 @@ struct ieee80211_ops {
1162 int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf); 1066 int (*conf_ht)(struct ieee80211_hw *hw, struct ieee80211_conf *conf);
1163 int (*ampdu_action)(struct ieee80211_hw *hw, 1067 int (*ampdu_action)(struct ieee80211_hw *hw,
1164 enum ieee80211_ampdu_mlme_action action, 1068 enum ieee80211_ampdu_mlme_action action,
1165 const u8 *ra, u16 tid, u16 ssn); 1069 const u8 *addr, u16 tid, u16 *ssn);
1166}; 1070};
1167 1071
1168/** 1072/**
@@ -1272,10 +1176,6 @@ static inline char *ieee80211_get_radio_led_name(struct ieee80211_hw *hw)
1272#endif 1176#endif
1273} 1177}
1274 1178
1275/* Register a new hardware PHYMODE capability to the stack. */
1276int ieee80211_register_hwmode(struct ieee80211_hw *hw,
1277 struct ieee80211_hw_mode *mode);
1278
1279/** 1179/**
1280 * ieee80211_unregister_hw - Unregister a hardware device 1180 * ieee80211_unregister_hw - Unregister a hardware device
1281 * 1181 *
@@ -1308,7 +1208,10 @@ void __ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1308 * buffer in @skb must start with an IEEE 802.11 header or a radiotap 1208 * buffer in @skb must start with an IEEE 802.11 header or a radiotap
1309 * header if %RX_FLAG_RADIOTAP is set in the @status flags. 1209 * header if %RX_FLAG_RADIOTAP is set in the @status flags.
1310 * 1210 *
1311 * This function may not be called in IRQ context. 1211 * This function may not be called in IRQ context. Calls to this function
1212 * for a single hardware must be synchronized against each other. Calls
1213 * to this function and ieee80211_rx_irqsafe() may not be mixed for a
1214 * single hardware.
1312 * 1215 *
1313 * @hw: the hardware this frame came in on 1216 * @hw: the hardware this frame came in on
1314 * @skb: the buffer to receive, owned by mac80211 after this call 1217 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1325,7 +1228,10 @@ static inline void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb,
1325 * ieee80211_rx_irqsafe - receive frame 1228 * ieee80211_rx_irqsafe - receive frame
1326 * 1229 *
1327 * Like ieee80211_rx() but can be called in IRQ context 1230 * Like ieee80211_rx() but can be called in IRQ context
1328 * (internally defers to a workqueue.) 1231 * (internally defers to a tasklet.)
1232 *
1233 * Calls to this function and ieee80211_rx() may not be mixed for a
1234 * single hardware.
1329 * 1235 *
1330 * @hw: the hardware this frame came in on 1236 * @hw: the hardware this frame came in on
1331 * @skb: the buffer to receive, owned by mac80211 after this call 1237 * @skb: the buffer to receive, owned by mac80211 after this call
@@ -1344,6 +1250,11 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1344 * transmitted. It is permissible to not call this function for 1250 * transmitted. It is permissible to not call this function for
1345 * multicast frames but this can affect statistics. 1251 * multicast frames but this can affect statistics.
1346 * 1252 *
1253 * This function may not be called in IRQ context. Calls to this function
1254 * for a single hardware must be synchronized against each other. Calls
1255 * to this function and ieee80211_tx_status_irqsafe() may not be mixed
1256 * for a single hardware.
1257 *
1347 * @hw: the hardware the frame was transmitted by 1258 * @hw: the hardware the frame was transmitted by
1348 * @skb: the frame that was transmitted, owned by mac80211 after this call 1259 * @skb: the frame that was transmitted, owned by mac80211 after this call
1349 * @status: status information for this frame; the status pointer need not 1260 * @status: status information for this frame; the status pointer need not
@@ -1353,6 +1264,22 @@ void ieee80211_rx_irqsafe(struct ieee80211_hw *hw,
1353void ieee80211_tx_status(struct ieee80211_hw *hw, 1264void ieee80211_tx_status(struct ieee80211_hw *hw,
1354 struct sk_buff *skb, 1265 struct sk_buff *skb,
1355 struct ieee80211_tx_status *status); 1266 struct ieee80211_tx_status *status);
1267
1268/**
1269 * ieee80211_tx_status_irqsafe - irq-safe transmit status callback
1270 *
1271 * Like ieee80211_tx_status() but can be called in IRQ context
1272 * (internally defers to a tasklet.)
1273 *
1274 * Calls to this function and ieee80211_tx_status() may not be mixed for a
1275 * single hardware.
1276 *
1277 * @hw: the hardware the frame was transmitted by
1278 * @skb: the frame that was transmitted, owned by mac80211 after this call
1279 * @status: status information for this frame; the status pointer need not
1280 * be valid after this function returns and is not freed by mac80211,
1281 * it is recommended that it points to a stack area
1282 */
1356void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, 1283void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
1357 struct sk_buff *skb, 1284 struct sk_buff *skb,
1358 struct ieee80211_tx_status *status); 1285 struct ieee80211_tx_status *status);
@@ -1449,7 +1376,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1449 * @hw: pointer obtained from ieee80211_alloc_hw(). 1376 * @hw: pointer obtained from ieee80211_alloc_hw().
1450 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. 1377 * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf.
1451 * @frame_len: the length of the frame. 1378 * @frame_len: the length of the frame.
1452 * @rate: the rate (in 100kbps) at which the frame is going to be transmitted. 1379 * @rate: the rate at which the frame is going to be transmitted.
1453 * 1380 *
1454 * Calculate the duration field of some generic frame, given its 1381 * Calculate the duration field of some generic frame, given its
1455 * length and transmission rate (in 100kbps). 1382 * length and transmission rate (in 100kbps).
@@ -1457,7 +1384,7 @@ __le16 ieee80211_ctstoself_duration(struct ieee80211_hw *hw,
1457__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, 1384__le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw,
1458 struct ieee80211_vif *vif, 1385 struct ieee80211_vif *vif,
1459 size_t frame_len, 1386 size_t frame_len,
1460 int rate); 1387 struct ieee80211_rate *rate);
1461 1388
1462/** 1389/**
1463 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames 1390 * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames
@@ -1574,4 +1501,81 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw,
1574 struct ieee80211_vif *vif), 1501 struct ieee80211_vif *vif),
1575 void *data); 1502 void *data);
1576 1503
1504/**
1505 * ieee80211_start_tx_ba_session - Start a tx Block Ack session.
1506 * @hw: pointer as obtained from ieee80211_alloc_hw().
1507 * @ra: receiver address of the BA session recipient
1508 * @tid: the TID to BA on.
1509 * @return: success if addBA request was sent, failure otherwise
1510 *
1511 * Although mac80211/low level driver/user space application can estimate
1512 * the need to start aggregation on a certain RA/TID, the session level
1513 * will be managed by the mac80211.
1514 */
1515int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1516
1517/**
1518 * ieee80211_start_tx_ba_cb - low level driver ready to aggregate.
1519 * @hw: pointer as obtained from ieee80211_alloc_hw().
1520 * @ra: receiver address of the BA session recipient.
1521 * @tid: the TID to BA on.
1522 *
1523 * This function must be called by low level driver once it has
1524 * finished with preparations for the BA session.
1525 */
1526void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid);
1527
1528/**
1529 * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate.
1530 * @hw: pointer as obtained from ieee80211_alloc_hw().
1531 * @ra: receiver address of the BA session recipient.
1532 * @tid: the TID to BA on.
1533 *
1534 * This function must be called by low level driver once it has
1535 * finished with preparations for the BA session.
1536 * This version of the function is irq safe.
1537 */
1538void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1539 u16 tid);
1540
1541/**
1542 * ieee80211_stop_tx_ba_session - Stop a Block Ack session.
1543 * @hw: pointer as obtained from ieee80211_alloc_hw().
1544 * @ra: receiver address of the BA session recipient
1545 * @tid: the TID to stop BA.
1546 * @initiator: if indicates initiator DELBA frame will be sent.
1547 * @return: error if no sta with matching da found, success otherwise
1548 *
1549 * Although mac80211/low level driver/user space application can estimate
1550 * the need to stop aggregation on a certain RA/TID, the session level
1551 * will be managed by the mac80211.
1552 */
1553int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw,
1554 u8 *ra, u16 tid,
1555 enum ieee80211_back_parties initiator);
1556
1557/**
1558 * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate.
1559 * @hw: pointer as obtained from ieee80211_alloc_hw().
1560 * @ra: receiver address of the BA session recipient.
1561 * @tid: the desired TID to BA on.
1562 *
1563 * This function must be called by low level driver once it has
1564 * finished with preparations for the BA session tear down.
1565 */
1566void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid);
1567
1568/**
1569 * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate.
1570 * @hw: pointer as obtained from ieee80211_alloc_hw().
1571 * @ra: receiver address of the BA session recipient.
1572 * @tid: the desired TID to BA on.
1573 *
1574 * This function must be called by low level driver once it has
1575 * finished with preparations for the BA session tear down.
1576 * This version of the function is irq safe.
1577 */
1578void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra,
1579 u16 tid);
1580
1577#endif /* MAC80211_H */ 1581#endif /* MAC80211_H */
diff --git a/include/net/wireless.h b/include/net/wireless.h
index d30c4ba8fd99..c7f805ee5545 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -13,6 +13,162 @@
13#include <net/cfg80211.h> 13#include <net/cfg80211.h>
14 14
15/** 15/**
16 * enum ieee80211_band - supported frequency bands
17 *
18 * The bands are assigned this way because the supported
19 * bitrates differ in these bands.
20 *
21 * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band
22 * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7)
23 */
24enum ieee80211_band {
25 IEEE80211_BAND_2GHZ,
26 IEEE80211_BAND_5GHZ,
27
28 /* keep last */
29 IEEE80211_NUM_BANDS
30};
31
32/**
33 * enum ieee80211_channel_flags - channel flags
34 *
35 * Channel flags set by the regulatory control code.
36 *
37 * @IEEE80211_CHAN_DISABLED: This channel is disabled.
38 * @IEEE80211_CHAN_PASSIVE_SCAN: Only passive scanning is permitted
39 * on this channel.
40 * @IEEE80211_CHAN_NO_IBSS: IBSS is not allowed on this channel.
41 * @IEEE80211_CHAN_RADAR: Radar detection is required on this channel.
42 */
43enum ieee80211_channel_flags {
44 IEEE80211_CHAN_DISABLED = 1<<0,
45 IEEE80211_CHAN_PASSIVE_SCAN = 1<<1,
46 IEEE80211_CHAN_NO_IBSS = 1<<2,
47 IEEE80211_CHAN_RADAR = 1<<3,
48};
49
50/**
51 * struct ieee80211_channel - channel definition
52 *
53 * This structure describes a single channel for use
54 * with cfg80211.
55 *
56 * @center_freq: center frequency in MHz
57 * @hw_value: hardware-specific value for the channel
58 * @flags: channel flags from &enum ieee80211_channel_flags.
59 * @orig_flags: channel flags at registration time, used by regulatory
60 * code to support devices with additional restrictions
61 * @band: band this channel belongs to.
62 * @max_antenna_gain: maximum antenna gain in dBi
63 * @max_power: maximum transmission power (in dBm)
64 * @orig_mag: internal use
65 * @orig_mpwr: internal use
66 */
67struct ieee80211_channel {
68 enum ieee80211_band band;
69 u16 center_freq;
70 u16 hw_value;
71 u32 flags;
72 int max_antenna_gain;
73 int max_power;
74 u32 orig_flags;
75 int orig_mag, orig_mpwr;
76};
77
78/**
79 * enum ieee80211_rate_flags - rate flags
80 *
81 * Hardware/specification flags for rates. These are structured
82 * in a way that allows using the same bitrate structure for
83 * different bands/PHY modes.
84 *
85 * @IEEE80211_RATE_SHORT_PREAMBLE: Hardware can send with short
86 * preamble on this bitrate; only relevant in 2.4GHz band and
87 * with CCK rates.
88 * @IEEE80211_RATE_MANDATORY_A: This bitrate is a mandatory rate
89 * when used with 802.11a (on the 5 GHz band); filled by the
90 * core code when registering the wiphy.
91 * @IEEE80211_RATE_MANDATORY_B: This bitrate is a mandatory rate
92 * when used with 802.11b (on the 2.4 GHz band); filled by the
93 * core code when registering the wiphy.
94 * @IEEE80211_RATE_MANDATORY_G: This bitrate is a mandatory rate
95 * when used with 802.11g (on the 2.4 GHz band); filled by the
96 * core code when registering the wiphy.
97 * @IEEE80211_RATE_ERP_G: This is an ERP rate in 802.11g mode.
98 */
99enum ieee80211_rate_flags {
100 IEEE80211_RATE_SHORT_PREAMBLE = 1<<0,
101 IEEE80211_RATE_MANDATORY_A = 1<<1,
102 IEEE80211_RATE_MANDATORY_B = 1<<2,
103 IEEE80211_RATE_MANDATORY_G = 1<<3,
104 IEEE80211_RATE_ERP_G = 1<<4,
105};
106
107/**
108 * struct ieee80211_rate - bitrate definition
109 *
110 * This structure describes a bitrate that an 802.11 PHY can
111 * operate with. The two values @hw_value and @hw_value_short
112 * are only for driver use when pointers to this structure are
113 * passed around.
114 *
115 * @flags: rate-specific flags
116 * @bitrate: bitrate in units of 100 Kbps
117 * @hw_value: driver/hardware value for this rate
118 * @hw_value_short: driver/hardware value for this rate when
119 * short preamble is used
120 */
121struct ieee80211_rate {
122 u32 flags;
123 u16 bitrate;
124 u16 hw_value, hw_value_short;
125};
126
127/**
128 * struct ieee80211_ht_info - describing STA's HT capabilities
129 *
130 * This structure describes most essential parameters needed
131 * to describe 802.11n HT capabilities for an STA.
132 *
133 * @ht_supported: is HT supported by STA, 0: no, 1: yes
134 * @cap: HT capabilities map as described in 802.11n spec
135 * @ampdu_factor: Maximum A-MPDU length factor
136 * @ampdu_density: Minimum A-MPDU spacing
137 * @supp_mcs_set: Supported MCS set as described in 802.11n spec
138 */
139struct ieee80211_ht_info {
140 u16 cap; /* use IEEE80211_HT_CAP_ */
141 u8 ht_supported;
142 u8 ampdu_factor;
143 u8 ampdu_density;
144 u8 supp_mcs_set[16];
145};
146
147/**
148 * struct ieee80211_supported_band - frequency band definition
149 *
150 * This structure describes a frequency band a wiphy
151 * is able to operate in.
152 *
153 * @channels: Array of channels the hardware can operate in
154 * in this band.
155 * @band: the band this structure represents
156 * @n_channels: Number of channels in @channels
157 * @bitrates: Array of bitrates the hardware can operate with
158 * in this band. Must be sorted to give a valid "supported
159 * rates" IE, i.e. CCK rates first, then OFDM.
160 * @n_bitrates: Number of bitrates in @bitrates
161 */
162struct ieee80211_supported_band {
163 struct ieee80211_channel *channels;
164 struct ieee80211_rate *bitrates;
165 enum ieee80211_band band;
166 int n_channels;
167 int n_bitrates;
168 struct ieee80211_ht_info ht_info;
169};
170
171/**
16 * struct wiphy - wireless hardware description 172 * struct wiphy - wireless hardware description
17 * @idx: the wiphy index assigned to this item 173 * @idx: the wiphy index assigned to this item
18 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 174 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
@@ -30,6 +186,8 @@ struct wiphy {
30 * help determine whether you own this wiphy or not. */ 186 * help determine whether you own this wiphy or not. */
31 void *privid; 187 void *privid;
32 188
189 struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS];
190
33 /* fields below are read-only, assigned by cfg80211 */ 191 /* fields below are read-only, assigned by cfg80211 */
34 192
35 /* the item in /sys/class/ieee80211/ points to this, 193 /* the item in /sys/class/ieee80211/ points to this,
@@ -136,4 +294,14 @@ extern void wiphy_unregister(struct wiphy *wiphy);
136 */ 294 */
137extern void wiphy_free(struct wiphy *wiphy); 295extern void wiphy_free(struct wiphy *wiphy);
138 296
297/**
298 * ieee80211_channel_to_frequency - convert channel number to frequency
299 */
300extern int ieee80211_channel_to_frequency(int chan);
301
302/**
303 * ieee80211_frequency_to_channel - convert frequency to channel number
304 */
305extern int ieee80211_frequency_to_channel(int freq);
306
139#endif /* __NET_WIRELESS_H */ 307#endif /* __NET_WIRELESS_H */