aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/cfg.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2009-04-20 12:39:05 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:57:17 -0400
commitb9a5f8cab751d362f7c2d94899ca788c22fcd1ef (patch)
treee769e2f59ef845cf7c7cc93b64d33eeed49bb9f7 /net/mac80211/cfg.c
parent9e52b0623c6eb49c3f23a326c1fb97bdecc49ba1 (diff)
nl80211: Add set/get for frag/rts threshold and retry limits
Add new nl80211 attributes that can be used with NL80211_CMD_SET_WIPHY and NL80211_CMD_GET_WIPHY to manage fragmentation/RTS threshold and retry limits. Since these values are stored in struct wiphy, remove the local copy from mac80211 where feasible (frag & rts threshold). The retry limits are currently needed in struct ieee80211_conf, but these could be eventually removed since the driver should have access to the values in struct wiphy. Signed-off-by: Jouni Malinen <j@w1.fi> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/cfg.c')
-rw-r--r--net/mac80211/cfg.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 14013dc64474..5e1c230744b5 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1298,6 +1298,32 @@ static int ieee80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
1298 return ieee80211_ibss_leave(sdata); 1298 return ieee80211_ibss_leave(sdata);
1299} 1299}
1300 1300
1301static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
1302{
1303 struct ieee80211_local *local = wiphy_priv(wiphy);
1304
1305 if (changed & WIPHY_PARAM_RTS_THRESHOLD) {
1306 int err;
1307
1308 if (local->ops->set_rts_threshold) {
1309 err = local->ops->set_rts_threshold(
1310 local_to_hw(local), wiphy->rts_threshold);
1311 if (err)
1312 return err;
1313 }
1314 }
1315
1316 if (changed & WIPHY_PARAM_RETRY_SHORT)
1317 local->hw.conf.short_frame_max_tx_count = wiphy->retry_short;
1318 if (changed & WIPHY_PARAM_RETRY_LONG)
1319 local->hw.conf.long_frame_max_tx_count = wiphy->retry_long;
1320 if (changed &
1321 (WIPHY_PARAM_RETRY_SHORT | WIPHY_PARAM_RETRY_LONG))
1322 ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_RETRY_LIMITS);
1323
1324 return 0;
1325}
1326
1301struct cfg80211_ops mac80211_config_ops = { 1327struct cfg80211_ops mac80211_config_ops = {
1302 .add_virtual_intf = ieee80211_add_iface, 1328 .add_virtual_intf = ieee80211_add_iface,
1303 .del_virtual_intf = ieee80211_del_iface, 1329 .del_virtual_intf = ieee80211_del_iface,
@@ -1336,4 +1362,5 @@ struct cfg80211_ops mac80211_config_ops = {
1336 .disassoc = ieee80211_disassoc, 1362 .disassoc = ieee80211_disassoc,
1337 .join_ibss = ieee80211_join_ibss, 1363 .join_ibss = ieee80211_join_ibss,
1338 .leave_ibss = ieee80211_leave_ibss, 1364 .leave_ibss = ieee80211_leave_ibss,
1365 .set_wiphy_params = ieee80211_set_wiphy_params,
1339}; 1366};