diff options
author | David S. Miller <davem@davemloft.net> | 2008-09-19 19:17:12 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-09-19 19:17:12 -0400 |
commit | d950f264ff7260d8c1e124158d758db13e1ad2d0 (patch) | |
tree | 8a8758af70d72b94e51609a5088a5739d00d8793 /include/net | |
parent | 04da2cf9bb133355b7073be25ef3ce88c8edc135 (diff) | |
parent | 375da53b8e5e3ff2330b66b377e07a6151a93fe5 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/cfg80211.h | 60 | ||||
-rw-r--r-- | include/net/mac80211.h | 105 | ||||
-rw-r--r-- | include/net/wireless.h | 58 |
3 files changed, 186 insertions, 37 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 0a72d1e3d3ab..9f40c4d417d7 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -287,6 +287,66 @@ struct bss_parameters { | |||
287 | int use_short_slot_time; | 287 | int use_short_slot_time; |
288 | }; | 288 | }; |
289 | 289 | ||
290 | /** | ||
291 | * enum reg_set_by - Indicates who is trying to set the regulatory domain | ||
292 | * @REGDOM_SET_BY_INIT: regulatory domain was set by initialization. We will be | ||
293 | * using a static world regulatory domain by default. | ||
294 | * @REGDOM_SET_BY_CORE: Core queried CRDA for a dynamic world regulatory domain. | ||
295 | * @REGDOM_SET_BY_USER: User asked the wireless core to set the | ||
296 | * regulatory domain. | ||
297 | * @REGDOM_SET_BY_DRIVER: a wireless drivers has hinted to the wireless core | ||
298 | * it thinks its knows the regulatory domain we should be in. | ||
299 | * @REGDOM_SET_BY_COUNTRY_IE: the wireless core has received an 802.11 country | ||
300 | * information element with regulatory information it thinks we | ||
301 | * should consider. | ||
302 | */ | ||
303 | enum reg_set_by { | ||
304 | REGDOM_SET_BY_INIT, | ||
305 | REGDOM_SET_BY_CORE, | ||
306 | REGDOM_SET_BY_USER, | ||
307 | REGDOM_SET_BY_DRIVER, | ||
308 | REGDOM_SET_BY_COUNTRY_IE, | ||
309 | }; | ||
310 | |||
311 | struct ieee80211_freq_range { | ||
312 | u32 start_freq_khz; | ||
313 | u32 end_freq_khz; | ||
314 | u32 max_bandwidth_khz; | ||
315 | }; | ||
316 | |||
317 | struct ieee80211_power_rule { | ||
318 | u32 max_antenna_gain; | ||
319 | u32 max_eirp; | ||
320 | }; | ||
321 | |||
322 | struct ieee80211_reg_rule { | ||
323 | struct ieee80211_freq_range freq_range; | ||
324 | struct ieee80211_power_rule power_rule; | ||
325 | u32 flags; | ||
326 | }; | ||
327 | |||
328 | struct ieee80211_regdomain { | ||
329 | u32 n_reg_rules; | ||
330 | char alpha2[2]; | ||
331 | struct ieee80211_reg_rule reg_rules[]; | ||
332 | }; | ||
333 | |||
334 | #define MHZ_TO_KHZ(freq) (freq * 1000) | ||
335 | #define KHZ_TO_MHZ(freq) (freq / 1000) | ||
336 | #define DBI_TO_MBI(gain) (gain * 100) | ||
337 | #define MBI_TO_DBI(gain) (gain / 100) | ||
338 | #define DBM_TO_MBM(gain) (gain * 100) | ||
339 | #define MBM_TO_DBM(gain) (gain / 100) | ||
340 | |||
341 | #define REG_RULE(start, end, bw, gain, eirp, reg_flags) { \ | ||
342 | .freq_range.start_freq_khz = (start) * 1000, \ | ||
343 | .freq_range.end_freq_khz = (end) * 1000, \ | ||
344 | .freq_range.max_bandwidth_khz = (bw) * 1000, \ | ||
345 | .power_rule.max_antenna_gain = (gain) * 100, \ | ||
346 | .power_rule.max_eirp = (eirp) * 100, \ | ||
347 | .flags = reg_flags, \ | ||
348 | } | ||
349 | |||
290 | /* from net/wireless.h */ | 350 | /* from net/wireless.h */ |
291 | struct wiphy; | 351 | struct wiphy; |
292 | 352 | ||
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index fb9e62211c34..003e4a03874e 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -160,6 +160,7 @@ struct ieee80211_low_level_stats { | |||
160 | * @BSS_CHANGED_ERP_PREAMBLE: preamble changed | 160 | * @BSS_CHANGED_ERP_PREAMBLE: preamble changed |
161 | * @BSS_CHANGED_ERP_SLOT: slot timing changed | 161 | * @BSS_CHANGED_ERP_SLOT: slot timing changed |
162 | * @BSS_CHANGED_HT: 802.11n parameters changed | 162 | * @BSS_CHANGED_HT: 802.11n parameters changed |
163 | * @BSS_CHANGED_BASIC_RATES: Basic rateset changed | ||
163 | */ | 164 | */ |
164 | enum ieee80211_bss_change { | 165 | enum ieee80211_bss_change { |
165 | BSS_CHANGED_ASSOC = 1<<0, | 166 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -167,6 +168,7 @@ enum ieee80211_bss_change { | |||
167 | BSS_CHANGED_ERP_PREAMBLE = 1<<2, | 168 | BSS_CHANGED_ERP_PREAMBLE = 1<<2, |
168 | BSS_CHANGED_ERP_SLOT = 1<<3, | 169 | BSS_CHANGED_ERP_SLOT = 1<<3, |
169 | BSS_CHANGED_HT = 1<<4, | 170 | BSS_CHANGED_HT = 1<<4, |
171 | BSS_CHANGED_BASIC_RATES = 1<<5, | ||
170 | }; | 172 | }; |
171 | 173 | ||
172 | /** | 174 | /** |
@@ -187,6 +189,9 @@ enum ieee80211_bss_change { | |||
187 | * @assoc_ht: association in HT mode | 189 | * @assoc_ht: association in HT mode |
188 | * @ht_conf: ht capabilities | 190 | * @ht_conf: ht capabilities |
189 | * @ht_bss_conf: ht extended capabilities | 191 | * @ht_bss_conf: ht extended capabilities |
192 | * @basic_rates: bitmap of basic rates, each bit stands for an | ||
193 | * index into the rate table configured by the driver in | ||
194 | * the current band. | ||
190 | */ | 195 | */ |
191 | struct ieee80211_bss_conf { | 196 | struct ieee80211_bss_conf { |
192 | /* association related data */ | 197 | /* association related data */ |
@@ -200,6 +205,7 @@ struct ieee80211_bss_conf { | |||
200 | u16 beacon_int; | 205 | u16 beacon_int; |
201 | u16 assoc_capability; | 206 | u16 assoc_capability; |
202 | u64 timestamp; | 207 | u64 timestamp; |
208 | u64 basic_rates; | ||
203 | /* ht related data */ | 209 | /* ht related data */ |
204 | bool assoc_ht; | 210 | bool assoc_ht; |
205 | struct ieee80211_ht_info *ht_conf; | 211 | struct ieee80211_ht_info *ht_conf; |
@@ -294,6 +300,9 @@ enum mac80211_tx_control_flags { | |||
294 | * (2) driver internal use (if applicable) | 300 | * (2) driver internal use (if applicable) |
295 | * (3) TX status information - driver tells mac80211 what happened | 301 | * (3) TX status information - driver tells mac80211 what happened |
296 | * | 302 | * |
303 | * The TX control's sta pointer is only valid during the ->tx call, | ||
304 | * it may be NULL. | ||
305 | * | ||
297 | * @flags: transmit info flags, defined above | 306 | * @flags: transmit info flags, defined above |
298 | * @band: TBD | 307 | * @band: TBD |
299 | * @tx_rate_idx: TBD | 308 | * @tx_rate_idx: TBD |
@@ -321,10 +330,11 @@ struct ieee80211_tx_info { | |||
321 | 330 | ||
322 | union { | 331 | union { |
323 | struct { | 332 | struct { |
333 | /* NB: vif can be NULL for injected frames */ | ||
324 | struct ieee80211_vif *vif; | 334 | struct ieee80211_vif *vif; |
325 | struct ieee80211_key_conf *hw_key; | 335 | struct ieee80211_key_conf *hw_key; |
336 | struct ieee80211_sta *sta; | ||
326 | unsigned long jiffies; | 337 | unsigned long jiffies; |
327 | u16 aid; | ||
328 | s8 rts_cts_rate_idx, alt_retry_rate_idx; | 338 | s8 rts_cts_rate_idx, alt_retry_rate_idx; |
329 | u8 retry_limit; | 339 | u8 retry_limit; |
330 | u8 icv_len; | 340 | u8 icv_len; |
@@ -472,33 +482,6 @@ struct ieee80211_conf { | |||
472 | }; | 482 | }; |
473 | 483 | ||
474 | /** | 484 | /** |
475 | * enum ieee80211_if_types - types of 802.11 network interfaces | ||
476 | * | ||
477 | * @IEEE80211_IF_TYPE_INVALID: invalid interface type, not used | ||
478 | * by mac80211 itself | ||
479 | * @IEEE80211_IF_TYPE_AP: interface in AP mode. | ||
480 | * @IEEE80211_IF_TYPE_MGMT: special interface for communication with hostap | ||
481 | * daemon. Drivers should never see this type. | ||
482 | * @IEEE80211_IF_TYPE_STA: interface in STA (client) mode. | ||
483 | * @IEEE80211_IF_TYPE_IBSS: interface in IBSS (ad-hoc) mode. | ||
484 | * @IEEE80211_IF_TYPE_MNTR: interface in monitor (rfmon) mode. | ||
485 | * @IEEE80211_IF_TYPE_WDS: interface in WDS mode. | ||
486 | * @IEEE80211_IF_TYPE_VLAN: VLAN interface bound to an AP, drivers | ||
487 | * will never see this type. | ||
488 | * @IEEE80211_IF_TYPE_MESH_POINT: 802.11s mesh point | ||
489 | */ | ||
490 | enum ieee80211_if_types { | ||
491 | IEEE80211_IF_TYPE_INVALID, | ||
492 | IEEE80211_IF_TYPE_AP, | ||
493 | IEEE80211_IF_TYPE_STA, | ||
494 | IEEE80211_IF_TYPE_IBSS, | ||
495 | IEEE80211_IF_TYPE_MESH_POINT, | ||
496 | IEEE80211_IF_TYPE_MNTR, | ||
497 | IEEE80211_IF_TYPE_WDS, | ||
498 | IEEE80211_IF_TYPE_VLAN, | ||
499 | }; | ||
500 | |||
501 | /** | ||
502 | * struct ieee80211_vif - per-interface data | 485 | * struct ieee80211_vif - per-interface data |
503 | * | 486 | * |
504 | * Data in this structure is continually present for driver | 487 | * Data in this structure is continually present for driver |
@@ -509,7 +492,7 @@ enum ieee80211_if_types { | |||
509 | * sizeof(void *). | 492 | * sizeof(void *). |
510 | */ | 493 | */ |
511 | struct ieee80211_vif { | 494 | struct ieee80211_vif { |
512 | enum ieee80211_if_types type; | 495 | enum nl80211_iftype type; |
513 | /* must be last */ | 496 | /* must be last */ |
514 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | 497 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); |
515 | }; | 498 | }; |
@@ -517,7 +500,7 @@ struct ieee80211_vif { | |||
517 | static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | 500 | static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) |
518 | { | 501 | { |
519 | #ifdef CONFIG_MAC80211_MESH | 502 | #ifdef CONFIG_MAC80211_MESH |
520 | return vif->type == IEEE80211_IF_TYPE_MESH_POINT; | 503 | return vif->type == NL80211_IFTYPE_MESH_POINT; |
521 | #endif | 504 | #endif |
522 | return false; | 505 | return false; |
523 | } | 506 | } |
@@ -528,7 +511,7 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
528 | * @vif: pointer to a driver-use per-interface structure. The pointer | 511 | * @vif: pointer to a driver-use per-interface structure. The pointer |
529 | * itself is also used for various functions including | 512 | * itself is also used for various functions including |
530 | * ieee80211_beacon_get() and ieee80211_get_buffered_bc(). | 513 | * ieee80211_beacon_get() and ieee80211_get_buffered_bc(). |
531 | * @type: one of &enum ieee80211_if_types constants. Determines the type of | 514 | * @type: one of &enum nl80211_iftype constants. Determines the type of |
532 | * added/removed interface. | 515 | * added/removed interface. |
533 | * @mac_addr: pointer to MAC address of the interface. This pointer is valid | 516 | * @mac_addr: pointer to MAC address of the interface. This pointer is valid |
534 | * until the interface is removed (i.e. it cannot be used after | 517 | * until the interface is removed (i.e. it cannot be used after |
@@ -544,7 +527,7 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
544 | * in pure monitor mode. | 527 | * in pure monitor mode. |
545 | */ | 528 | */ |
546 | struct ieee80211_if_init_conf { | 529 | struct ieee80211_if_init_conf { |
547 | enum ieee80211_if_types type; | 530 | enum nl80211_iftype type; |
548 | struct ieee80211_vif *vif; | 531 | struct ieee80211_vif *vif; |
549 | void *mac_addr; | 532 | void *mac_addr; |
550 | }; | 533 | }; |
@@ -673,6 +656,33 @@ enum set_key_cmd { | |||
673 | }; | 656 | }; |
674 | 657 | ||
675 | /** | 658 | /** |
659 | * struct ieee80211_sta - station table entry | ||
660 | * | ||
661 | * A station table entry represents a station we are possibly | ||
662 | * communicating with. Since stations are RCU-managed in | ||
663 | * mac80211, any ieee80211_sta pointer you get access to must | ||
664 | * either be protected by rcu_read_lock() explicitly or implicitly, | ||
665 | * or you must take good care to not use such a pointer after a | ||
666 | * call to your sta_notify callback that removed it. | ||
667 | * | ||
668 | * @addr: MAC address | ||
669 | * @aid: AID we assigned to the station if we're an AP | ||
670 | * @supp_rates: Bitmap of supported rates (per band) | ||
671 | * @ht_info: HT capabilities of this STA | ||
672 | * @drv_priv: data area for driver use, will always be aligned to | ||
673 | * sizeof(void *), size is determined in hw information. | ||
674 | */ | ||
675 | struct ieee80211_sta { | ||
676 | u64 supp_rates[IEEE80211_NUM_BANDS]; | ||
677 | u8 addr[ETH_ALEN]; | ||
678 | u16 aid; | ||
679 | struct ieee80211_ht_info ht_info; | ||
680 | |||
681 | /* must be last */ | ||
682 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | ||
683 | }; | ||
684 | |||
685 | /** | ||
676 | * enum sta_notify_cmd - sta notify command | 686 | * enum sta_notify_cmd - sta notify command |
677 | * | 687 | * |
678 | * Used with the sta_notify() callback in &struct ieee80211_ops, this | 688 | * Used with the sta_notify() callback in &struct ieee80211_ops, this |
@@ -816,6 +826,8 @@ enum ieee80211_hw_flags { | |||
816 | * | 826 | * |
817 | * @vif_data_size: size (in bytes) of the drv_priv data area | 827 | * @vif_data_size: size (in bytes) of the drv_priv data area |
818 | * within &struct ieee80211_vif. | 828 | * within &struct ieee80211_vif. |
829 | * @sta_data_size: size (in bytes) of the drv_priv data area | ||
830 | * within &struct ieee80211_sta. | ||
819 | */ | 831 | */ |
820 | struct ieee80211_hw { | 832 | struct ieee80211_hw { |
821 | struct ieee80211_conf conf; | 833 | struct ieee80211_conf conf; |
@@ -827,12 +839,15 @@ struct ieee80211_hw { | |||
827 | unsigned int extra_tx_headroom; | 839 | unsigned int extra_tx_headroom; |
828 | int channel_change_time; | 840 | int channel_change_time; |
829 | int vif_data_size; | 841 | int vif_data_size; |
842 | int sta_data_size; | ||
830 | u16 queues; | 843 | u16 queues; |
831 | u16 ampdu_queues; | 844 | u16 ampdu_queues; |
832 | u16 max_listen_interval; | 845 | u16 max_listen_interval; |
833 | s8 max_signal; | 846 | s8 max_signal; |
834 | }; | 847 | }; |
835 | 848 | ||
849 | struct ieee80211_hw *wiphy_to_hw(struct wiphy *wiphy); | ||
850 | |||
836 | /** | 851 | /** |
837 | * SET_IEEE80211_DEV - set device for 802.11 hardware | 852 | * SET_IEEE80211_DEV - set device for 802.11 hardware |
838 | * | 853 | * |
@@ -1108,7 +1123,7 @@ enum ieee80211_ampdu_mlme_action { | |||
1108 | * This callback must be implemented and atomic. | 1123 | * This callback must be implemented and atomic. |
1109 | * | 1124 | * |
1110 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit | 1125 | * @set_tim: Set TIM bit. mac80211 calls this function when a TIM bit |
1111 | * must be set or cleared for a given AID. Must be atomic. | 1126 | * must be set or cleared for a given STA. Must be atomic. |
1112 | * | 1127 | * |
1113 | * @set_key: See the section "Hardware crypto acceleration" | 1128 | * @set_key: See the section "Hardware crypto acceleration" |
1114 | * This callback can sleep, and is only called between add_interface | 1129 | * This callback can sleep, and is only called between add_interface |
@@ -1122,7 +1137,9 @@ enum ieee80211_ampdu_mlme_action { | |||
1122 | * @hw_scan: Ask the hardware to service the scan request, no need to start | 1137 | * @hw_scan: Ask the hardware to service the scan request, no need to start |
1123 | * the scan state machine in stack. The scan must honour the channel | 1138 | * the scan state machine in stack. The scan must honour the channel |
1124 | * configuration done by the regulatory agent in the wiphy's registered | 1139 | * configuration done by the regulatory agent in the wiphy's registered |
1125 | * bands. | 1140 | * bands. When the scan finishes, ieee80211_scan_completed() must be |
1141 | * called; note that it also must be called when the scan cannot finish | ||
1142 | * because the hardware is turned off! Anything else is a bug! | ||
1126 | * | 1143 | * |
1127 | * @get_stats: return low-level statistics | 1144 | * @get_stats: return low-level statistics |
1128 | * | 1145 | * |
@@ -1192,7 +1209,8 @@ struct ieee80211_ops { | |||
1192 | unsigned int changed_flags, | 1209 | unsigned int changed_flags, |
1193 | unsigned int *total_flags, | 1210 | unsigned int *total_flags, |
1194 | int mc_count, struct dev_addr_list *mc_list); | 1211 | int mc_count, struct dev_addr_list *mc_list); |
1195 | int (*set_tim)(struct ieee80211_hw *hw, int aid, int set); | 1212 | int (*set_tim)(struct ieee80211_hw *hw, struct ieee80211_sta *sta, |
1213 | bool set); | ||
1196 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, | 1214 | int (*set_key)(struct ieee80211_hw *hw, enum set_key_cmd cmd, |
1197 | const u8 *local_address, const u8 *address, | 1215 | const u8 *local_address, const u8 *address, |
1198 | struct ieee80211_key_conf *key); | 1216 | struct ieee80211_key_conf *key); |
@@ -1209,7 +1227,7 @@ struct ieee80211_ops { | |||
1209 | int (*set_retry_limit)(struct ieee80211_hw *hw, | 1227 | int (*set_retry_limit)(struct ieee80211_hw *hw, |
1210 | u32 short_retry, u32 long_retr); | 1228 | u32 short_retry, u32 long_retr); |
1211 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 1229 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
1212 | enum sta_notify_cmd, const u8 *addr); | 1230 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
1213 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, | 1231 | int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, |
1214 | const struct ieee80211_tx_queue_params *params); | 1232 | const struct ieee80211_tx_queue_params *params); |
1215 | int (*get_tx_stats)(struct ieee80211_hw *hw, | 1233 | int (*get_tx_stats)(struct ieee80211_hw *hw, |
@@ -1219,7 +1237,7 @@ struct ieee80211_ops { | |||
1219 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1237 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1220 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1238 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1221 | enum ieee80211_ampdu_mlme_action action, | 1239 | enum ieee80211_ampdu_mlme_action action, |
1222 | const u8 *addr, u16 tid, u16 *ssn); | 1240 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
1223 | }; | 1241 | }; |
1224 | 1242 | ||
1225 | /** | 1243 | /** |
@@ -1769,4 +1787,17 @@ void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
1769 | */ | 1787 | */ |
1770 | void ieee80211_notify_mac(struct ieee80211_hw *hw, | 1788 | void ieee80211_notify_mac(struct ieee80211_hw *hw, |
1771 | enum ieee80211_notification_types notif_type); | 1789 | enum ieee80211_notification_types notif_type); |
1790 | |||
1791 | /** | ||
1792 | * ieee80211_find_sta - find a station | ||
1793 | * | ||
1794 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
1795 | * @addr: station's address | ||
1796 | * | ||
1797 | * This function must be called under RCU lock and the | ||
1798 | * resulting pointer is only valid under RCU lock as well. | ||
1799 | */ | ||
1800 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, | ||
1801 | const u8 *addr); | ||
1802 | |||
1772 | #endif /* MAC80211_H */ | 1803 | #endif /* MAC80211_H */ |
diff --git a/include/net/wireless.h b/include/net/wireless.h index 1dc8ec3daa2f..e4378cc6bf8e 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 */ |
@@ -197,6 +200,9 @@ struct wiphy { | |||
197 | 200 | ||
198 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; | 201 | struct ieee80211_supported_band *bands[IEEE80211_NUM_BANDS]; |
199 | 202 | ||
203 | /* Lets us get back the wiphy on the callback */ | ||
204 | int (*reg_notifier)(struct wiphy *wiphy, enum reg_set_by setby); | ||
205 | |||
200 | /* fields below are read-only, assigned by cfg80211 */ | 206 | /* fields below are read-only, assigned by cfg80211 */ |
201 | 207 | ||
202 | /* the item in /sys/class/ieee80211/ points to this, | 208 | /* the item in /sys/class/ieee80211/ points to this, |
@@ -322,6 +328,58 @@ extern int ieee80211_frequency_to_channel(int freq); | |||
322 | */ | 328 | */ |
323 | extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | 329 | extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, |
324 | int freq); | 330 | int freq); |
331 | /** | ||
332 | * __regulatory_hint - hint to the wireless core a regulatory domain | ||
333 | * @wiphy: if a driver is providing the hint this is the driver's very | ||
334 | * own &struct wiphy | ||
335 | * @alpha2: the ISO/IEC 3166 alpha2 being claimed the regulatory domain | ||
336 | * should be in. If @rd is set this should be NULL | ||
337 | * @rd: a complete regulatory domain, if passed the caller need not worry | ||
338 | * about freeing it | ||
339 | * | ||
340 | * The Wireless subsystem can use this function to hint to the wireless core | ||
341 | * what it believes should be the current regulatory domain by | ||
342 | * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory | ||
343 | * domain should be in or by providing a completely build regulatory domain. | ||
344 | * | ||
345 | * Returns -EALREADY if *a regulatory domain* has already been set. Note that | ||
346 | * this could be by another driver. It is safe for drivers to continue if | ||
347 | * -EALREADY is returned, if drivers are not capable of world roaming they | ||
348 | * should not register more channels than they support. Right now we only | ||
349 | * support listening to the first driver hint. If the driver is capable | ||
350 | * of world roaming but wants to respect its own EEPROM mappings for | ||
351 | * specific regulatory domains it should register the @reg_notifier callback | ||
352 | * on the &struct wiphy. Returns 0 if the hint went through fine or through an | ||
353 | * intersection operation. Otherwise a standard error code is returned. | ||
354 | * | ||
355 | */ | ||
356 | extern int __regulatory_hint(struct wiphy *wiphy, enum reg_set_by set_by, | ||
357 | const char *alpha2, struct ieee80211_regdomain *rd); | ||
358 | /** | ||
359 | * regulatory_hint - driver hint to the wireless core a regulatory domain | ||
360 | * @wiphy: the driver's very own &struct wiphy | ||
361 | * @alpha2: the ISO/IEC 3166 alpha2 the driver claims its regulatory domain | ||
362 | * should be in. If @rd is set this should be NULL. Note that if you | ||
363 | * set this to NULL you should still set rd->alpha2 to some accepted | ||
364 | * alpha2. | ||
365 | * @rd: a complete regulatory domain provided by the driver. If passed | ||
366 | * the driver does not need to worry about freeing it. | ||
367 | * | ||
368 | * Wireless drivers can use this function to hint to the wireless core | ||
369 | * what it believes should be the current regulatory domain by | ||
370 | * giving it an ISO/IEC 3166 alpha2 country code it knows its regulatory | ||
371 | * domain should be in or by providing a completely build regulatory domain. | ||
372 | * If the driver provides an ISO/IEC 3166 alpha2 userspace will be queried | ||
373 | * for a regulatory domain structure for the respective country. If | ||
374 | * a regulatory domain is build and passed you should set the alpha2 | ||
375 | * if possible, otherwise set it to the special value of "99" which tells | ||
376 | * the wireless core it is unknown. If you pass a built regulatory domain | ||
377 | * and we return non zero you are in charge of kfree()'ing the structure. | ||
378 | * | ||
379 | * See __regulatory_hint() documentation for possible return values. | ||
380 | */ | ||
381 | extern int regulatory_hint(struct wiphy *wiphy, | ||
382 | const char *alpha2, struct ieee80211_regdomain *rd); | ||
325 | 383 | ||
326 | /** | 384 | /** |
327 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency | 385 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency |