aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-02-15 02:06:44 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-15 02:06:44 -0500
commitac178ef0ae9eb44fd527d87aa9b6394e05f56e1f (patch)
tree5d6bd46ecf9ce989134d3c460e1ecf5dd1fceadc /include
parentf3a7c66b5ce0b75a9774a50b5dcce93e5ba28370 (diff)
parent6d08b9b9c6eb2414c4a037407dd121298a74fb36 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'include')
-rw-r--r--include/linux/nl80211.h65
-rw-r--r--include/net/cfg80211.h154
-rw-r--r--include/net/mac80211.h10
-rw-r--r--include/net/wireless.h3
4 files changed, 228 insertions, 4 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 4bc27049f4e5..8802d1bda382 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -143,6 +143,13 @@
143 * added to all specified management frames generated by 143 * added to all specified management frames generated by
144 * kernel/firmware/driver. 144 * kernel/firmware/driver.
145 * 145 *
146 * @NL80211_CMD_GET_SCAN: get scan results
147 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
148 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
149 * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
150 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
151 * partial scan results may be available
152 *
146 * @NL80211_CMD_MAX: highest used command number 153 * @NL80211_CMD_MAX: highest used command number
147 * @__NL80211_CMD_AFTER_LAST: internal use 154 * @__NL80211_CMD_AFTER_LAST: internal use
148 */ 155 */
@@ -192,6 +199,11 @@ enum nl80211_commands {
192 199
193 NL80211_CMD_GET_REG, 200 NL80211_CMD_GET_REG,
194 201
202 NL80211_CMD_GET_SCAN,
203 NL80211_CMD_TRIGGER_SCAN,
204 NL80211_CMD_NEW_SCAN_RESULTS,
205 NL80211_CMD_SCAN_ABORTED,
206
195 /* add new commands above here */ 207 /* add new commands above here */
196 208
197 /* used to define NL80211_CMD_MAX below */ 209 /* used to define NL80211_CMD_MAX below */
@@ -305,6 +317,18 @@ enum nl80211_commands {
305 * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with 317 * @NL80211_ATTR_IE: Information element(s) data (used, e.g., with
306 * %NL80211_CMD_SET_MGMT_EXTRA_IE). 318 * %NL80211_CMD_SET_MGMT_EXTRA_IE).
307 * 319 *
320 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
321 * a single scan request, a wiphy attribute.
322 *
323 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
324 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
325 * scanning and include a zero-length SSID (wildcard) for wildcard scan
326 * @NL80211_ATTR_SCAN_GENERATION: the scan generation increases whenever the
327 * scan result list changes (BSS expired or added) so that applications
328 * can verify that they got a single, consistent snapshot (when all dump
329 * messages carried the same generation number)
330 * @NL80211_ATTR_BSS: scan result BSS
331 *
308 * @NL80211_ATTR_MAX: highest attribute number currently defined 332 * @NL80211_ATTR_MAX: highest attribute number currently defined
309 * @__NL80211_ATTR_AFTER_LAST: internal use 333 * @__NL80211_ATTR_AFTER_LAST: internal use
310 */ 334 */
@@ -372,6 +396,13 @@ enum nl80211_attrs {
372 NL80211_ATTR_MGMT_SUBTYPE, 396 NL80211_ATTR_MGMT_SUBTYPE,
373 NL80211_ATTR_IE, 397 NL80211_ATTR_IE,
374 398
399 NL80211_ATTR_MAX_NUM_SCAN_SSIDS,
400
401 NL80211_ATTR_SCAN_FREQUENCIES,
402 NL80211_ATTR_SCAN_SSIDS,
403 NL80211_ATTR_SCAN_GENERATION,
404 NL80211_ATTR_BSS,
405
375 /* add attributes here, update the policy in nl80211.c */ 406 /* add attributes here, update the policy in nl80211.c */
376 407
377 __NL80211_ATTR_AFTER_LAST, 408 __NL80211_ATTR_AFTER_LAST,
@@ -841,4 +872,38 @@ enum nl80211_channel_type {
841 NL80211_CHAN_HT40MINUS, 872 NL80211_CHAN_HT40MINUS,
842 NL80211_CHAN_HT40PLUS 873 NL80211_CHAN_HT40PLUS
843}; 874};
875
876/**
877 * enum nl80211_bss - netlink attributes for a BSS
878 *
879 * @__NL80211_BSS_INVALID: invalid
880 * @NL80211_BSS_FREQUENCY: frequency in MHz (u32)
881 * @NL80211_BSS_TSF: TSF of the received probe response/beacon (u64)
882 * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16)
883 * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16)
884 * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the
885 * raw information elements from the probe response/beacon (bin)
886 * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon
887 * in mBm (100 * dBm) (s32)
888 * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon
889 * in unspecified units, scaled to 0..100 (u8)
890 * @__NL80211_BSS_AFTER_LAST: internal
891 * @NL80211_BSS_MAX: highest BSS attribute
892 */
893enum nl80211_bss {
894 __NL80211_BSS_INVALID,
895 NL80211_BSS_BSSID,
896 NL80211_BSS_FREQUENCY,
897 NL80211_BSS_TSF,
898 NL80211_BSS_BEACON_INTERVAL,
899 NL80211_BSS_CAPABILITY,
900 NL80211_BSS_INFORMATION_ELEMENTS,
901 NL80211_BSS_SIGNAL_MBM,
902 NL80211_BSS_SIGNAL_UNSPEC,
903
904 /* keep last */
905 __NL80211_BSS_AFTER_LAST,
906 NL80211_BSS_MAX = __NL80211_BSS_AFTER_LAST - 1
907};
908
844#endif /* __LINUX_NL80211_H */ 909#endif /* __LINUX_NL80211_H */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index dd1fd51638fc..c0d1f5b708c5 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -4,6 +4,10 @@
4#include <linux/netlink.h> 4#include <linux/netlink.h>
5#include <linux/skbuff.h> 5#include <linux/skbuff.h>
6#include <linux/nl80211.h> 6#include <linux/nl80211.h>
7#include <linux/if_ether.h>
8#include <linux/ieee80211.h>
9#include <linux/wireless.h>
10#include <net/iw_handler.h>
7#include <net/genetlink.h> 11#include <net/genetlink.h>
8/* remove once we remove the wext stuff */ 12/* remove once we remove the wext stuff */
9#include <net/iw_handler.h> 13#include <net/iw_handler.h>
@@ -505,6 +509,85 @@ struct wiphy;
505struct ieee80211_channel; 509struct ieee80211_channel;
506 510
507/** 511/**
512 * struct cfg80211_ssid - SSID description
513 * @ssid: the SSID
514 * @ssid_len: length of the ssid
515 */
516struct cfg80211_ssid {
517 u8 ssid[IEEE80211_MAX_SSID_LEN];
518 u8 ssid_len;
519};
520
521/**
522 * struct cfg80211_scan_request - scan request description
523 *
524 * @ssids: SSIDs to scan for (active scan only)
525 * @n_ssids: number of SSIDs
526 * @channels: channels to scan on.
527 * @n_channels: number of channels for each band
528 * @wiphy: the wiphy this was for
529 * @ifidx: the interface index
530 */
531struct cfg80211_scan_request {
532 struct cfg80211_ssid *ssids;
533 int n_ssids;
534 struct ieee80211_channel **channels;
535 u32 n_channels;
536
537 /* internal */
538 struct wiphy *wiphy;
539 int ifidx;
540};
541
542/**
543 * enum cfg80211_signal_type - signal type
544 *
545 * @CFG80211_SIGNAL_TYPE_NONE: no signal strength information available
546 * @CFG80211_SIGNAL_TYPE_MBM: signal strength in mBm (100*dBm)
547 * @CFG80211_SIGNAL_TYPE_UNSPEC: signal strength, increasing from 0 through 100
548 */
549enum cfg80211_signal_type {
550 CFG80211_SIGNAL_TYPE_NONE,
551 CFG80211_SIGNAL_TYPE_MBM,
552 CFG80211_SIGNAL_TYPE_UNSPEC,
553};
554
555/**
556 * struct cfg80211_bss - BSS description
557 *
558 * This structure describes a BSS (which may also be a mesh network)
559 * for use in scan results and similar.
560 *
561 * @bssid: BSSID of the BSS
562 * @tsf: timestamp of last received update
563 * @beacon_interval: the beacon interval as from the frame
564 * @capability: the capability field in host byte order
565 * @information_elements: the information elements (Note that there
566 * is no guarantee that these are well-formed!)
567 * @len_information_elements: total length of the information elements
568 * @signal: signal strength value
569 * @signal_type: signal type
570 * @free_priv: function pointer to free private data
571 * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes
572 */
573struct cfg80211_bss {
574 struct ieee80211_channel *channel;
575
576 u8 bssid[ETH_ALEN];
577 u64 tsf;
578 u16 beacon_interval;
579 u16 capability;
580 u8 *information_elements;
581 size_t len_information_elements;
582
583 s32 signal;
584 enum cfg80211_signal_type signal_type;
585
586 void (*free_priv)(struct cfg80211_bss *bss);
587 u8 priv[0] __attribute__((__aligned__(sizeof(void *))));
588};
589
590/**
508 * struct cfg80211_ops - backend description for wireless configuration 591 * struct cfg80211_ops - backend description for wireless configuration
509 * 592 *
510 * This struct is registered by fullmac card drivers and/or wireless stacks 593 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -571,6 +654,11 @@ struct ieee80211_channel;
571 * @set_channel: Set channel 654 * @set_channel: Set channel
572 * 655 *
573 * @set_mgmt_extra_ie: Set extra IE data for management frames 656 * @set_mgmt_extra_ie: Set extra IE data for management frames
657 *
658 * @scan: Request to do a scan. If returning zero, the scan request is given
659 * the driver, and will be valid until passed to cfg80211_scan_done().
660 * For scan results, call cfg80211_inform_bss(); you can call this outside
661 * the scan/scan_done bracket too.
574 */ 662 */
575struct cfg80211_ops { 663struct cfg80211_ops {
576 int (*suspend)(struct wiphy *wiphy); 664 int (*suspend)(struct wiphy *wiphy);
@@ -648,6 +736,9 @@ struct cfg80211_ops {
648 int (*set_mgmt_extra_ie)(struct wiphy *wiphy, 736 int (*set_mgmt_extra_ie)(struct wiphy *wiphy,
649 struct net_device *dev, 737 struct net_device *dev,
650 struct mgmt_extra_ie_params *params); 738 struct mgmt_extra_ie_params *params);
739
740 int (*scan)(struct wiphy *wiphy, struct net_device *dev,
741 struct cfg80211_scan_request *request);
651}; 742};
652 743
653/* temporary wext handlers */ 744/* temporary wext handlers */
@@ -658,5 +749,68 @@ int cfg80211_wext_siwmode(struct net_device *dev, struct iw_request_info *info,
658 u32 *mode, char *extra); 749 u32 *mode, char *extra);
659int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info, 750int cfg80211_wext_giwmode(struct net_device *dev, struct iw_request_info *info,
660 u32 *mode, char *extra); 751 u32 *mode, char *extra);
752int cfg80211_wext_siwscan(struct net_device *dev,
753 struct iw_request_info *info,
754 union iwreq_data *wrqu, char *extra);
755int cfg80211_wext_giwscan(struct net_device *dev,
756 struct iw_request_info *info,
757 struct iw_point *data, char *extra);
758
759/**
760 * cfg80211_scan_done - notify that scan finished
761 *
762 * @request: the corresponding scan request
763 * @aborted: set to true if the scan was aborted for any reason,
764 * userspace will be notified of that
765 */
766void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted);
767
768/**
769 * cfg80211_inform_bss - inform cfg80211 of a new BSS
770 *
771 * @wiphy: the wiphy reporting the BSS
772 * @bss: the found BSS
773 * @gfp: context flags
774 *
775 * This informs cfg80211 that BSS information was found and
776 * the BSS should be updated/added.
777 */
778struct cfg80211_bss*
779cfg80211_inform_bss_frame(struct wiphy *wiphy,
780 struct ieee80211_channel *channel,
781 struct ieee80211_mgmt *mgmt, size_t len,
782 s32 signal, enum cfg80211_signal_type sigtype,
783 gfp_t gfp);
784
785struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy,
786 struct ieee80211_channel *channel,
787 const u8 *bssid,
788 const u8 *ssid, size_t ssid_len,
789 u16 capa_mask, u16 capa_val);
790static inline struct cfg80211_bss *
791cfg80211_get_ibss(struct wiphy *wiphy,
792 struct ieee80211_channel *channel,
793 const u8 *ssid, size_t ssid_len)
794{
795 return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len,
796 WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS);
797}
798
799struct cfg80211_bss *cfg80211_get_mesh(struct wiphy *wiphy,
800 struct ieee80211_channel *channel,
801 const u8 *meshid, size_t meshidlen,
802 const u8 *meshcfg);
803void cfg80211_put_bss(struct cfg80211_bss *bss);
804/**
805 * cfg80211_unlink_bss - unlink BSS from internal data structures
806 * @wiphy: the wiphy
807 * @bss: the bss to remove
808 *
809 * This function removes the given BSS from the internal data structures
810 * thereby making it no longer show up in scan results etc. Use this
811 * function when you detect a BSS is gone. Normally BSSes will also time
812 * out, so it is not necessary to use this function at all.
813 */
814void cfg80211_unlink_bss(struct wiphy *wiphy, struct cfg80211_bss *bss);
661 815
662#endif /* __NET_CFG80211_H */ 816#endif /* __NET_CFG80211_H */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 409e2c69269d..88fa3e03e3e9 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -1354,11 +1354,11 @@ enum ieee80211_ampdu_mlme_action {
1354 * 1354 *
1355 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently, 1355 * @get_tsf: Get the current TSF timer value from firmware/hardware. Currently,
1356 * this is only used for IBSS mode BSSID merging and debugging. Is not a 1356 * this is only used for IBSS mode BSSID merging and debugging. Is not a
1357 * required function. Must be atomic. 1357 * required function.
1358 * 1358 *
1359 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware. 1359 * @set_tsf: Set the TSF timer to the specified value in the firmware/hardware.
1360 * Currently, this is only used for IBSS mode debugging. Is not a 1360 * Currently, this is only used for IBSS mode debugging. Is not a
1361 * required function. Must be atomic. 1361 * required function.
1362 * 1362 *
1363 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize 1363 * @reset_tsf: Reset the TSF timer and allow firmware/hardware to synchronize
1364 * with other STAs in the IBSS. This is only used in IBSS mode. This 1364 * with other STAs in the IBSS. This is only used in IBSS mode. This
@@ -1406,7 +1406,8 @@ struct ieee80211_ops {
1406 void (*update_tkip_key)(struct ieee80211_hw *hw, 1406 void (*update_tkip_key)(struct ieee80211_hw *hw,
1407 struct ieee80211_key_conf *conf, const u8 *address, 1407 struct ieee80211_key_conf *conf, const u8 *address,
1408 u32 iv32, u16 *phase1key); 1408 u32 iv32, u16 *phase1key);
1409 int (*hw_scan)(struct ieee80211_hw *hw, u8 *ssid, size_t len); 1409 int (*hw_scan)(struct ieee80211_hw *hw,
1410 struct cfg80211_scan_request *req);
1410 int (*get_stats)(struct ieee80211_hw *hw, 1411 int (*get_stats)(struct ieee80211_hw *hw,
1411 struct ieee80211_low_level_stats *stats); 1412 struct ieee80211_low_level_stats *stats);
1412 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx, 1413 void (*get_tkip_seq)(struct ieee80211_hw *hw, u8 hw_key_idx,
@@ -1844,8 +1845,9 @@ void ieee80211_wake_queues(struct ieee80211_hw *hw);
1844 * mac80211 that the scan finished. 1845 * mac80211 that the scan finished.
1845 * 1846 *
1846 * @hw: the hardware that finished the scan 1847 * @hw: the hardware that finished the scan
1848 * @aborted: set to true if scan was aborted
1847 */ 1849 */
1848void ieee80211_scan_completed(struct ieee80211_hw *hw); 1850void ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted);
1849 1851
1850/** 1852/**
1851 * ieee80211_iterate_active_interfaces - iterate active interfaces 1853 * ieee80211_iterate_active_interfaces - iterate active interfaces
diff --git a/include/net/wireless.h b/include/net/wireless.h
index a42c1562d52b..1c6285eb1666 100644
--- a/include/net/wireless.h
+++ b/include/net/wireless.h
@@ -213,6 +213,9 @@ struct wiphy {
213 bool custom_regulatory; 213 bool custom_regulatory;
214 bool strict_regulatory; 214 bool strict_regulatory;
215 215
216 int bss_priv_size;
217 u8 max_scan_ssids;
218
216 /* If multiple wiphys are registered and you're handed e.g. 219 /* If multiple wiphys are registered and you're handed e.g.
217 * a regular netdev with assigned ieee80211_ptr, you won't 220 * a regular netdev with assigned ieee80211_ptr, you won't
218 * know whether it points to a wiphy your driver has registered 221 * know whether it points to a wiphy your driver has registered