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/mac80211 | |
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/mac80211')
-rw-r--r-- | net/mac80211/cfg.c | 11 | ||||
-rw-r--r-- | net/mac80211/wext.c | 26 |
2 files changed, 15 insertions, 22 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8c7b2cdbeeda..2cf5bf6378e4 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1369,6 +1369,16 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy, int *dbm) | |||
1369 | return 0; | 1369 | return 0; |
1370 | } | 1370 | } |
1371 | 1371 | ||
1372 | static int ieee80211_set_wds_peer(struct wiphy *wiphy, struct net_device *dev, | ||
1373 | u8 *addr) | ||
1374 | { | ||
1375 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1376 | |||
1377 | memcpy(&sdata->u.wds.remote_addr, addr, ETH_ALEN); | ||
1378 | |||
1379 | return 0; | ||
1380 | } | ||
1381 | |||
1372 | static void ieee80211_rfkill_poll(struct wiphy *wiphy) | 1382 | static void ieee80211_rfkill_poll(struct wiphy *wiphy) |
1373 | { | 1383 | { |
1374 | struct ieee80211_local *local = wiphy_priv(wiphy); | 1384 | struct ieee80211_local *local = wiphy_priv(wiphy); |
@@ -1454,6 +1464,7 @@ struct cfg80211_ops mac80211_config_ops = { | |||
1454 | .set_wiphy_params = ieee80211_set_wiphy_params, | 1464 | .set_wiphy_params = ieee80211_set_wiphy_params, |
1455 | .set_tx_power = ieee80211_set_tx_power, | 1465 | .set_tx_power = ieee80211_set_tx_power, |
1456 | .get_tx_power = ieee80211_get_tx_power, | 1466 | .get_tx_power = ieee80211_get_tx_power, |
1467 | .set_wds_peer = ieee80211_set_wds_peer, | ||
1457 | .rfkill_poll = ieee80211_rfkill_poll, | 1468 | .rfkill_poll = ieee80211_rfkill_poll, |
1458 | CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) | 1469 | CFG80211_TESTMODE_CMD(ieee80211_testmode_cmd) |
1459 | .set_power_mgmt = ieee80211_set_power_mgmt, | 1470 | .set_power_mgmt = ieee80211_set_power_mgmt, |
diff --git a/net/mac80211/wext.c b/net/mac80211/wext.c index f77929802c7a..4053d766af2d 100644 --- a/net/mac80211/wext.c +++ b/net/mac80211/wext.c | |||
@@ -140,23 +140,8 @@ static int ieee80211_ioctl_siwap(struct net_device *dev, | |||
140 | if (sdata->vif.type == NL80211_IFTYPE_STATION) | 140 | if (sdata->vif.type == NL80211_IFTYPE_STATION) |
141 | return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra); | 141 | return cfg80211_mgd_wext_siwap(dev, info, ap_addr, extra); |
142 | 142 | ||
143 | if (sdata->vif.type == NL80211_IFTYPE_WDS) { | 143 | if (sdata->vif.type == NL80211_IFTYPE_WDS) |
144 | /* | 144 | return cfg80211_wds_wext_siwap(dev, info, ap_addr, extra); |
145 | * If it is necessary to update the WDS peer address | ||
146 | * while the interface is running, then we need to do | ||
147 | * more work here, namely if it is running we need to | ||
148 | * add a new and remove the old STA entry, this is | ||
149 | * normally handled by _open() and _stop(). | ||
150 | */ | ||
151 | if (netif_running(dev)) | ||
152 | return -EBUSY; | ||
153 | |||
154 | memcpy(&sdata->u.wds.remote_addr, (u8 *) &ap_addr->sa_data, | ||
155 | ETH_ALEN); | ||
156 | |||
157 | return 0; | ||
158 | } | ||
159 | |||
160 | return -EOPNOTSUPP; | 145 | return -EOPNOTSUPP; |
161 | } | 146 | } |
162 | 147 | ||
@@ -173,11 +158,8 @@ static int ieee80211_ioctl_giwap(struct net_device *dev, | |||
173 | if (sdata->vif.type == NL80211_IFTYPE_STATION) | 158 | if (sdata->vif.type == NL80211_IFTYPE_STATION) |
174 | return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra); | 159 | return cfg80211_mgd_wext_giwap(dev, info, ap_addr, extra); |
175 | 160 | ||
176 | if (sdata->vif.type == NL80211_IFTYPE_WDS) { | 161 | if (sdata->vif.type == NL80211_IFTYPE_WDS) |
177 | ap_addr->sa_family = ARPHRD_ETHER; | 162 | return cfg80211_wds_wext_giwap(dev, info, ap_addr, extra); |
178 | memcpy(&ap_addr->sa_data, sdata->u.wds.remote_addr, ETH_ALEN); | ||
179 | return 0; | ||
180 | } | ||
181 | 163 | ||
182 | return -EOPNOTSUPP; | 164 | return -EOPNOTSUPP; |
183 | } | 165 | } |