diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-04-19 15:24:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-04-22 16:57:17 -0400 |
commit | 04a773ade0680d862b479d7219973df60f7a3834 (patch) | |
tree | fc759eb79099fefd7f1329bcb2b703008cb0adfe /include/net/cfg80211.h | |
parent | 691597cb26f236ac7471f1adf925a134c86799d6 (diff) |
cfg80211/nl80211: add IBSS API
This adds IBSS API along with (preliminary) wext handlers.
The wext handlers can only do IBSS so you need to call them
from your own wext handlers if the mode is IBSS.
The nl80211 API requires
* an SSID
* a channel (frequency) for the case that a new IBSS
has to be created
It optionally supports
* a flag to fix the channel
* a fixed BSSID
The cfg80211 code also takes care to leave the IBSS before
the netdev is set down. If wireless extensions are used, it
also caches values when the interface is down and instructs
the driver to join when the interface is set up.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 019a41efa0bb..5287a3e56e7c 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -658,6 +658,31 @@ struct cfg80211_disassoc_request { | |||
658 | }; | 658 | }; |
659 | 659 | ||
660 | /** | 660 | /** |
661 | * struct cfg80211_ibss_params - IBSS parameters | ||
662 | * | ||
663 | * This structure defines the IBSS parameters for the join_ibss() | ||
664 | * method. | ||
665 | * | ||
666 | * @ssid: The SSID, will always be non-null. | ||
667 | * @ssid_len: The length of the SSID, will always be non-zero. | ||
668 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not | ||
669 | * search for IBSSs with a different BSSID. | ||
670 | * @channel: The channel to use if no IBSS can be found to join. | ||
671 | * @channel_fixed: The channel should be fixed -- do not search for | ||
672 | * IBSSs to join on other channels. | ||
673 | * @ie: information element(s) to include in the beacon | ||
674 | * @ie_len: length of that | ||
675 | */ | ||
676 | struct cfg80211_ibss_params { | ||
677 | u8 *ssid; | ||
678 | u8 *bssid; | ||
679 | struct ieee80211_channel *channel; | ||
680 | u8 *ie; | ||
681 | u8 ssid_len, ie_len; | ||
682 | bool channel_fixed; | ||
683 | }; | ||
684 | |||
685 | /** | ||
661 | * struct cfg80211_ops - backend description for wireless configuration | 686 | * struct cfg80211_ops - backend description for wireless configuration |
662 | * | 687 | * |
663 | * This struct is registered by fullmac card drivers and/or wireless stacks | 688 | * This struct is registered by fullmac card drivers and/or wireless stacks |
@@ -732,6 +757,11 @@ struct cfg80211_disassoc_request { | |||
732 | * @assoc: Request to (re)associate with the specified peer | 757 | * @assoc: Request to (re)associate with the specified peer |
733 | * @deauth: Request to deauthenticate from the specified peer | 758 | * @deauth: Request to deauthenticate from the specified peer |
734 | * @disassoc: Request to disassociate from the specified peer | 759 | * @disassoc: Request to disassociate from the specified peer |
760 | * | ||
761 | * @join_ibss: Join the specified IBSS (or create if necessary). Once done, call | ||
762 | * cfg80211_ibss_joined(), also call that function when changing BSSID due | ||
763 | * to a merge. | ||
764 | * @leave_ibss: Leave the IBSS. | ||
735 | */ | 765 | */ |
736 | struct cfg80211_ops { | 766 | struct cfg80211_ops { |
737 | int (*suspend)(struct wiphy *wiphy); | 767 | int (*suspend)(struct wiphy *wiphy); |
@@ -817,6 +847,10 @@ struct cfg80211_ops { | |||
817 | struct cfg80211_deauth_request *req); | 847 | struct cfg80211_deauth_request *req); |
818 | int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, | 848 | int (*disassoc)(struct wiphy *wiphy, struct net_device *dev, |
819 | struct cfg80211_disassoc_request *req); | 849 | struct cfg80211_disassoc_request *req); |
850 | |||
851 | int (*join_ibss)(struct wiphy *wiphy, struct net_device *dev, | ||
852 | struct cfg80211_ibss_params *params); | ||
853 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); | ||
820 | }; | 854 | }; |
821 | 855 | ||
822 | /* temporary wext handlers */ | 856 | /* temporary wext handlers */ |
@@ -839,6 +873,28 @@ int cfg80211_wext_siwmlme(struct net_device *dev, | |||
839 | int cfg80211_wext_giwrange(struct net_device *dev, | 873 | int cfg80211_wext_giwrange(struct net_device *dev, |
840 | struct iw_request_info *info, | 874 | struct iw_request_info *info, |
841 | struct iw_point *data, char *extra); | 875 | struct iw_point *data, char *extra); |
876 | int cfg80211_ibss_wext_siwfreq(struct net_device *dev, | ||
877 | struct iw_request_info *info, | ||
878 | struct iw_freq *freq, char *extra); | ||
879 | int cfg80211_ibss_wext_giwfreq(struct net_device *dev, | ||
880 | struct iw_request_info *info, | ||
881 | struct iw_freq *freq, char *extra); | ||
882 | int cfg80211_ibss_wext_siwessid(struct net_device *dev, | ||
883 | struct iw_request_info *info, | ||
884 | struct iw_point *data, char *ssid); | ||
885 | int cfg80211_ibss_wext_giwessid(struct net_device *dev, | ||
886 | struct iw_request_info *info, | ||
887 | struct iw_point *data, char *ssid); | ||
888 | int cfg80211_ibss_wext_siwap(struct net_device *dev, | ||
889 | struct iw_request_info *info, | ||
890 | struct sockaddr *ap_addr, char *extra); | ||
891 | int cfg80211_ibss_wext_giwap(struct net_device *dev, | ||
892 | struct iw_request_info *info, | ||
893 | struct sockaddr *ap_addr, char *extra); | ||
894 | |||
895 | /* wext helper for now (to be removed) */ | ||
896 | struct ieee80211_channel *cfg80211_wext_freq(struct wiphy *wiphy, | ||
897 | struct iw_freq *freq); | ||
842 | 898 | ||
843 | /** | 899 | /** |
844 | * cfg80211_scan_done - notify that scan finished | 900 | * cfg80211_scan_done - notify that scan finished |
@@ -984,4 +1040,20 @@ void cfg80211_michael_mic_failure(struct net_device *dev, const u8 *addr, | |||
984 | enum nl80211_key_type key_type, int key_id, | 1040 | enum nl80211_key_type key_type, int key_id, |
985 | const u8 *tsc); | 1041 | const u8 *tsc); |
986 | 1042 | ||
1043 | /** | ||
1044 | * cfg80211_ibss_joined - notify cfg80211 that device joined an IBSS | ||
1045 | * | ||
1046 | * @dev: network device | ||
1047 | * @bssid: the BSSID of the IBSS joined | ||
1048 | * @gfp: allocation flags | ||
1049 | * | ||
1050 | * This function notifies cfg80211 that the device joined an IBSS or | ||
1051 | * switched to a different BSSID. Before this function can be called, | ||
1052 | * either a beacon has to have been received from the IBSS, or one of | ||
1053 | * the cfg80211_inform_bss{,_frame} functions must have been called | ||
1054 | * with the locally generated beacon -- this guarantees that there is | ||
1055 | * always a scan result for this IBSS. cfg80211 will handle the rest. | ||
1056 | */ | ||
1057 | void cfg80211_ibss_joined(struct net_device *dev, const u8 *bssid, gfp_t gfp); | ||
1058 | |||
987 | #endif /* __NET_CFG80211_H */ | 1059 | #endif /* __NET_CFG80211_H */ |