aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/wireless.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/net/wireless.h')
-rw-r--r--include/net/wireless.h90
1 files changed, 47 insertions, 43 deletions
diff --git a/include/net/wireless.h b/include/net/wireless.h
index 721efb363db7..21c5d966142d 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -10,6 +10,7 @@
10#include <linux/netdevice.h> 10#include <linux/netdevice.h>
11#include <linux/debugfs.h> 11#include <linux/debugfs.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/ieee80211.h>
13#include <net/cfg80211.h> 14#include <net/cfg80211.h>
14 15
15/** 16/**
@@ -133,23 +134,23 @@ struct ieee80211_rate {
133}; 134};
134 135
135/** 136/**
136 * struct ieee80211_ht_info - describing STA's HT capabilities 137 * struct ieee80211_sta_ht_cap - STA's HT capabilities
137 * 138 *
138 * This structure describes most essential parameters needed 139 * This structure describes most essential parameters needed
139 * to describe 802.11n HT capabilities for an STA. 140 * to describe 802.11n HT capabilities for an STA.
140 * 141 *
141 * @ht_supported: is HT supported by STA, 0: no, 1: yes 142 * @ht_supported: is HT supported by the STA
142 * @cap: HT capabilities map as described in 802.11n spec 143 * @cap: HT capabilities map as described in 802.11n spec
143 * @ampdu_factor: Maximum A-MPDU length factor 144 * @ampdu_factor: Maximum A-MPDU length factor
144 * @ampdu_density: Minimum A-MPDU spacing 145 * @ampdu_density: Minimum A-MPDU spacing
145 * @supp_mcs_set: Supported MCS set as described in 802.11n spec 146 * @mcs: Supported MCS rates
146 */ 147 */
147struct ieee80211_ht_info { 148struct ieee80211_sta_ht_cap {
148 u16 cap; /* use IEEE80211_HT_CAP_ */ 149 u16 cap; /* use IEEE80211_HT_CAP_ */
149 u8 ht_supported; 150 bool ht_supported;
150 u8 ampdu_factor; 151 u8 ampdu_factor;
151 u8 ampdu_density; 152 u8 ampdu_density;
152 u8 supp_mcs_set[16]; 153 struct ieee80211_mcs_info mcs;
153}; 154};
154 155
155/** 156/**
@@ -173,13 +174,18 @@ struct ieee80211_supported_band {
173 enum ieee80211_band band; 174 enum ieee80211_band band;
174 int n_channels; 175 int n_channels;
175 int n_bitrates; 176 int n_bitrates;
176 struct ieee80211_ht_info ht_info; 177 struct ieee80211_sta_ht_cap ht_cap;
177}; 178};
178 179
179/** 180/**
180 * struct wiphy - wireless hardware description 181 * struct wiphy - wireless hardware description
181 * @idx: the wiphy index assigned to this item 182 * @idx: the wiphy index assigned to this item
182 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> 183 * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name>
184 * @fw_handles_regulatory: tells us the firmware for this device
185 * has its own regulatory solution and cannot identify the
186 * ISO / IEC 3166 alpha2 it belongs to. When this is enabled
187 * we will disregard the first regulatory hint (when the
188 * initiator is %REGDOM_SET_BY_CORE).
183 * @reg_notifier: the driver's regulatory notification callback 189 * @reg_notifier: the driver's regulatory notification callback
184 */ 190 */
185struct wiphy { 191struct wiphy {
@@ -191,6 +197,8 @@ struct wiphy {
191 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ 197 /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */
192 u16 interface_modes; 198 u16 interface_modes;
193 199
200 bool fw_handles_regulatory;
201
194 /* If multiple wiphys are registered and you're handed e.g. 202 /* If multiple wiphys are registered and you're handed e.g.
195 * a regular netdev with assigned ieee80211_ptr, you won't 203 * a regular netdev with assigned ieee80211_ptr, you won't
196 * know whether it points to a wiphy your driver has registered 204 * know whether it points to a wiphy your driver has registered
@@ -262,9 +270,9 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy)
262/** 270/**
263 * wiphy_name - get wiphy name 271 * wiphy_name - get wiphy name
264 */ 272 */
265static inline char *wiphy_name(struct wiphy *wiphy) 273static inline const char *wiphy_name(struct wiphy *wiphy)
266{ 274{
267 return wiphy->dev.bus_id; 275 return dev_name(&wiphy->dev);
268} 276}
269 277
270/** 278/**
@@ -340,55 +348,51 @@ ieee80211_get_channel(struct wiphy *wiphy, int freq)
340} 348}
341 349
342/** 350/**
343 * __regulatory_hint - hint to the wireless core a regulatory domain 351 * ieee80211_get_response_rate - get basic rate for a given rate
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 * 352 *
356 * Returns -EALREADY if *a regulatory domain* has already been set. Note that 353 * @sband: the band to look for rates in
357 * this could be by another driver. It is safe for drivers to continue if 354 * @basic_rates: bitmap of basic rates
358 * -EALREADY is returned, if drivers are not capable of world roaming they 355 * @bitrate: the bitrate for which to find the basic rate
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 * 356 *
357 * This function returns the basic rate corresponding to a given
358 * bitrate, that is the next lower bitrate contained in the basic
359 * rate map, which is, for this function, given as a bitmap of
360 * indices of rates in the band's bitrate table.
366 */ 361 */
367extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, 362struct ieee80211_rate *
368 const char *alpha2, struct ieee80211_regdomain *rd); 363ieee80211_get_response_rate(struct ieee80211_supported_band *sband,
364 u64 basic_rates, int bitrate);
365
369/** 366/**
370 * regulatory_hint - driver hint to the wireless core a regulatory domain 367 * regulatory_hint - driver hint to the wireless core a regulatory domain
371 * @wiphy: the driver's very own &struct wiphy 368 * @wiphy: the wireless device giving the hint (used only for reporting
369 * conflicts)
372 * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain 370 * @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 371 * 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 372 * set this to NULL you should still set rd->alpha2 to some accepted
375 * alpha2. 373 * 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 * 374 *
379 * Wireless drivers can use this function to hint to the wireless core 375 * Wireless drivers can use this function to hint to the wireless core
380 * what it believes should be the current regulatory domain by 376 * what it believes should be the current regulatory domain by
381 * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory 377 * 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. 378 * 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 379 * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried
384 * for a regulatory domain structure for the respective country. If 380 * for a regulatory domain structure for the respective country.
385 * a regulatory domain is build and passed you should set the alpha2 381 */
386 * if possible, otherwise set it to the special value of "99" which tells 382extern void regulatory_hint(struct wiphy *wiphy, const char *alpha2);
387 * the wireless core it is unknown. If you pass a built regulatory domain 383
388 * and we return non zero you are in charge of kfree()'ing the structure. 384/**
385 * regulatory_hint_11d - hints a country IE as a regulatory domain
386 * @wiphy: the wireless device giving the hint (used only for reporting
387 * conflicts)
388 * @country_ie: pointer to the country IE
389 * @country_ie_len: length of the country IE
389 * 390 *
390 * See __regulatory_hint() documentation for possible return values. 391 * We will intersect the rd with the what CRDA tells us should apply
392 * for the alpha2 this country IE belongs to, this prevents APs from
393 * sending us incorrect or outdated information against a country.
391 */ 394 */
392extern int regulatory_hint(struct wiphy *wiphy, 395extern void regulatory_hint_11d(struct wiphy *wiphy,
393 const char *alpha2, struct ieee80211_regdomain *rd); 396 u8 *country_ie,
397 u8 country_ie_len);
394#endif /* __NET_WIRELESS_H */ 398#endif /* __NET_WIRELESS_H */