diff options
Diffstat (limited to 'include/net/wireless.h')
-rw-r--r-- | include/net/wireless.h | 65 |
1 files changed, 64 insertions, 1 deletions
diff --git a/include/net/wireless.h b/include/net/wireless.h index 9324f8dd183e..721efb363db7 100644 --- a/include/net/wireless.h +++ b/include/net/wireless.h | |||
@@ -60,6 +60,7 @@ enum ieee80211_channel_flags { | |||
60 | * with cfg80211. | 60 | * with cfg80211. |
61 | * | 61 | * |
62 | * @center_freq: center frequency in MHz | 62 | * @center_freq: center frequency in MHz |
63 | * @max_bandwidth: maximum allowed bandwidth for this channel, in MHz | ||
63 | * @hw_value: hardware-specific value for the channel | 64 | * @hw_value: hardware-specific value for the channel |
64 | * @flags: channel flags from &enum ieee80211_channel_flags. | 65 | * @flags: channel flags from &enum ieee80211_channel_flags. |
65 | * @orig_flags: channel flags at registration time, used by regulatory | 66 | * @orig_flags: channel flags at registration time, used by regulatory |
@@ -73,6 +74,7 @@ enum ieee80211_channel_flags { | |||
73 | struct ieee80211_channel { | 74 | struct ieee80211_channel { |
74 | enum ieee80211_band band; | 75 | enum ieee80211_band band; |
75 | u16 center_freq; | 76 | u16 center_freq; |
77 | u8 max_bandwidth; | ||
76 | u16 hw_value; | 78 | u16 hw_value; |
77 | u32 flags; | 79 | u32 flags; |
78 | int max_antenna_gain; | 80 | int max_antenna_gain; |
@@ -178,6 +180,7 @@ struct ieee80211_supported_band { | |||
178 | * struct wiphy - wireless hardware description | 180 | * struct wiphy - wireless hardware description |
179 | * @idx: the wiphy index assigned to this item | 181 | * @idx: the wiphy index assigned to this item |
180 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | 182 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> |
183 | * @reg_notifier: the driver's regulatory notification callback | ||
181 | */ | 184 | */ |
182 | struct wiphy { | 185 | struct wiphy { |
183 | /* assign these fields before you register the wiphy */ | 186 | /* assign these fields before you register the wiphy */ |
@@ -185,6 +188,9 @@ struct wiphy { | |||
185 | /* permanent MAC address */ | 188 | /* permanent MAC address */ |
186 | u8 perm_addr[ETH_ALEN]; | 189 | u8 perm_addr[ETH_ALEN]; |
187 | 190 | ||
191 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | ||
192 | u16 interface_modes; | ||
193 | |||
188 | /* If multiple wiphys are registered and you're handed e.g. | 194 | /* If multiple wiphys are registered and you're handed e.g. |
189 | * a regular netdev with assigned ieee80211_ptr, you won't | 195 | * a regular netdev with assigned ieee80211_ptr, you won't |
190 | * know whether it points to a wiphy your driver has registered | 196 | * know whether it points to a wiphy your driver has registered |
@@ -194,6 +200,9 @@ struct wiphy { | |||
194 | 200 | ||
195 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; | 201 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; |
196 | 202 | ||
203 | /* Lets us get back the wiphy on the callback */ | ||
204 | int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); | ||
205 | |||
197 | /* fields below are read-only, assigned by cfg80211 */ | 206 | /* fields below are read-only, assigned by cfg80211 */ |
198 | 207 | ||
199 | /* the item in /sys/class/ieee80211/ points to this, | 208 | /* the item in /sys/class/ieee80211/ points to this, |
@@ -214,9 +223,11 @@ struct wiphy { | |||
214 | * the netdev.) | 223 | * the netdev.) |
215 | * | 224 | * |
216 | * @wiphy: pointer to hardware description | 225 | * @wiphy: pointer to hardware description |
226 | * @iftype: interface type | ||
217 | */ | 227 | */ |
218 | struct wireless_dev { | 228 | struct wireless_dev { |
219 | struct wiphy *wiphy; | 229 | struct wiphy *wiphy; |
230 | enum nl80211_iftype iftype; | ||
220 | 231 | ||
221 | /* private to the generic wireless code */ | 232 | /* private to the generic wireless code */ |
222 | struct list_head list; | 233 | struct list_head list; |
@@ -319,7 +330,6 @@ extern int ieee80211_frequency_to_channel(int freq); | |||
319 | */ | 330 | */ |
320 | extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | 331 | extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, |
321 | int freq); | 332 | int freq); |
322 | |||
323 | /** | 333 | /** |
324 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency | 334 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency |
325 | */ | 335 | */ |
@@ -328,4 +338,57 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq) | |||
328 | { | 338 | { |
329 | return __ieee80211_get_channel(wiphy, freq); | 339 | return __ieee80211_get_channel(wiphy, freq); |
330 | } | 340 | } |
341 | |||
342 | /** | ||
343 | * __regulatory_hint - hint to the wireless core a regulatory domain | ||
344 | * @wiphy: if a driver is providing the hint this is the driver's very | ||
345 | * own &struct wiphy | ||
346 | * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain | ||
347 | * should be in. If @rd is set this should be NULL | ||
348 | * @rd: a complete regulatory domain, if passed the caller need not worry | ||
349 | * about freeing it | ||
350 | * | ||
351 | * The Wireless subsystem can use this function to hint to the wireless core | ||
352 | * what it believes should be the current regulatory domain by | ||
353 | * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory | ||
354 | * domain should be in or by providing a completely build regulatory domain. | ||
355 | * | ||
356 | * Returns -EALREADY if *a regulatory domain* has already been set. Note that | ||
357 | * this could be by another driver. It is safe for drivers to continue if | ||
358 | * -EALREADY is returned, if drivers are not capable of world roaming they | ||
359 | * should not register more channels than they support. Right now we only | ||
360 | * support listening to the first driver hint. If the driver is capable | ||
361 | * of world roaming but wants to respect its own EEPROM mappings for | ||
362 | * specific regulatory domains it should register the @reg_notifier callback | ||
363 | * on the &struct wiphy. Returns 0 if the hint went through fine or through an | ||
364 | * intersection operation. Otherwise a standard error code is returned. | ||
365 | * | ||
366 | */ | ||
367 | extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, | ||
368 | const char *alpha2, struct ieee80211_regdomain *rd); | ||
369 | /** | ||
370 | * regulatory_hint - driver hint to the wireless core a regulatory domain | ||
371 | * @wiphy: the driver's very own &struct wiphy | ||
372 | * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain | ||
373 | * should be in. If @rd is set this should be NULL. Note that if you | ||
374 | * set this to NULL you should still set rd->alpha2 to some accepted | ||
375 | * alpha2. | ||
376 | * @rd: a complete regulatory domain provided by the driver. If passed | ||
377 | * the driver does not need to worry about freeing it. | ||
378 | * | ||
379 | * Wireless drivers can use this function to hint to the wireless core | ||
380 | * what it believes should be the current regulatory domain by | ||
381 | * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory | ||
382 | * domain should be in or by providing a completely build regulatory domain. | ||
383 | * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried | ||
384 | * for a regulatory domain structure for the respective country. If | ||
385 | * a regulatory domain is build and passed you should set the alpha2 | ||
386 | * if possible, otherwise set it to the special value of "99" which tells | ||
387 | * the wireless core it is unknown. If you pass a built regulatory domain | ||
388 | * and we return non zero you are in charge of kfree()'ing the structure. | ||
389 | * | ||
390 | * See __regulatory_hint() documentation for possible return values. | ||
391 | */ | ||
392 | extern int regulatory_hint(struct wiphy *wiphy, | ||
393 | const char *alpha2, struct ieee80211_regdomain *rd); | ||
331 | #endif /* __NET_WIRELESS_H */ | 394 | #endif /* __NET_WIRELESS_H */ |