diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-01 15:26:58 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:52 -0400 |
commit | ab737a4f7dbe57b12b73f482a7b973bf00b41942 (patch) | |
tree | 33f3c44073921b9fa4c96ea5501dbfcad59567ac /net/wireless/wext-compat.c | |
parent | bc92afd92088ab41223383cc6863ab4792533c54 (diff) |
cfg80211: implement IWAP for WDS
This implements siocsiwap/giwap for WDS mode.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/wireless/wext-compat.c')
-rw-r--r-- | net/wireless/wext-compat.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 2e1ab78fb0d7..2f72dae2634f 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c | |||
@@ -1047,3 +1047,49 @@ int cfg80211_wext_giwpower(struct net_device *dev, | |||
1047 | return 0; | 1047 | return 0; |
1048 | } | 1048 | } |
1049 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwpower); | 1049 | EXPORT_SYMBOL_GPL(cfg80211_wext_giwpower); |
1050 | |||
1051 | int cfg80211_wds_wext_siwap(struct net_device *dev, | ||
1052 | struct iw_request_info *info, | ||
1053 | struct sockaddr *addr, char *extra) | ||
1054 | { | ||
1055 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
1056 | struct cfg80211_registered_device *rdev = wiphy_to_dev(wdev->wiphy); | ||
1057 | int err; | ||
1058 | |||
1059 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS)) | ||
1060 | return -EINVAL; | ||
1061 | |||
1062 | if (addr->sa_family != ARPHRD_ETHER) | ||
1063 | return -EINVAL; | ||
1064 | |||
1065 | if (netif_running(dev)) | ||
1066 | return -EBUSY; | ||
1067 | |||
1068 | if (!rdev->ops->set_wds_peer) | ||
1069 | return -EOPNOTSUPP; | ||
1070 | |||
1071 | err = rdev->ops->set_wds_peer(wdev->wiphy, dev, (u8 *) &addr->sa_data); | ||
1072 | if (err) | ||
1073 | return err; | ||
1074 | |||
1075 | memcpy(&wdev->wext.bssid, (u8 *) &addr->sa_data, ETH_ALEN); | ||
1076 | |||
1077 | return 0; | ||
1078 | } | ||
1079 | EXPORT_SYMBOL_GPL(cfg80211_wds_wext_siwap); | ||
1080 | |||
1081 | int cfg80211_wds_wext_giwap(struct net_device *dev, | ||
1082 | struct iw_request_info *info, | ||
1083 | struct sockaddr *addr, char *extra) | ||
1084 | { | ||
1085 | struct wireless_dev *wdev = dev->ieee80211_ptr; | ||
1086 | |||
1087 | if (WARN_ON(wdev->iftype != NL80211_IFTYPE_WDS)) | ||
1088 | return -EINVAL; | ||
1089 | |||
1090 | addr->sa_family = ARPHRD_ETHER; | ||
1091 | memcpy(&addr->sa_data, wdev->wext.bssid, ETH_ALEN); | ||
1092 | |||
1093 | return 0; | ||
1094 | } | ||
1095 | EXPORT_SYMBOL_GPL(cfg80211_wds_wext_giwap); | ||