diff options
author | Juuso Oikarinen <juuso.oikarinen@nokia.com> | 2010-03-23 03:02:34 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-03-24 16:04:33 -0400 |
commit | a97c13c34509be460dea23c86f31c02daa2428b5 (patch) | |
tree | eb5d2860af9d6f3121254f2ef262e197b10bed34 /net/mac80211/cfg.c | |
parent | d6dc1a386358979e12366d1f35eeb68fc181e101 (diff) |
mac80211: Add support for connection quality monitoring
Add support for the set_cqm_config op. This op function configures the
requested connection quality monitor rssi threshold and rssi hysteresis
values to the hardware if the hardware supports
IEEE80211_HW_SUPPORTS_CQM.
For unsupported hardware, currently -EOPNOTSUPP is returned, so the mac80211
is currently not doing connection quality monitoring on the host. This could be
added later, if needed.
Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Reviewed-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.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index b7116ef84a3b..c8f520529eec 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c | |||
@@ -1402,6 +1402,32 @@ static int ieee80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev, | |||
1402 | return 0; | 1402 | return 0; |
1403 | } | 1403 | } |
1404 | 1404 | ||
1405 | static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy, | ||
1406 | struct net_device *dev, | ||
1407 | s32 rssi_thold, u32 rssi_hyst) | ||
1408 | { | ||
1409 | struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); | ||
1410 | struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr); | ||
1411 | struct ieee80211_vif *vif = &sdata->vif; | ||
1412 | struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; | ||
1413 | |||
1414 | if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_CQM_RSSI)) | ||
1415 | return -EOPNOTSUPP; | ||
1416 | |||
1417 | if (rssi_thold == bss_conf->cqm_rssi_thold && | ||
1418 | rssi_hyst == bss_conf->cqm_rssi_hyst) | ||
1419 | return 0; | ||
1420 | |||
1421 | bss_conf->cqm_rssi_thold = rssi_thold; | ||
1422 | bss_conf->cqm_rssi_hyst = rssi_hyst; | ||
1423 | |||
1424 | /* tell the driver upon association, unless already associated */ | ||
1425 | if (sdata->u.mgd.associated) | ||
1426 | ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM); | ||
1427 | |||
1428 | return 0; | ||
1429 | } | ||
1430 | |||
1405 | static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, | 1431 | static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, |
1406 | struct net_device *dev, | 1432 | struct net_device *dev, |
1407 | const u8 *addr, | 1433 | const u8 *addr, |
@@ -1506,4 +1532,5 @@ struct cfg80211_ops mac80211_config_ops = { | |||
1506 | .remain_on_channel = ieee80211_remain_on_channel, | 1532 | .remain_on_channel = ieee80211_remain_on_channel, |
1507 | .cancel_remain_on_channel = ieee80211_cancel_remain_on_channel, | 1533 | .cancel_remain_on_channel = ieee80211_cancel_remain_on_channel, |
1508 | .action = ieee80211_action, | 1534 | .action = ieee80211_action, |
1535 | .set_cqm_rssi_config = ieee80211_set_cqm_rssi_config, | ||
1509 | }; | 1536 | }; |