aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-03-23 03:02:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-03-24 16:04:33 -0400
commita97c13c34509be460dea23c86f31c02daa2428b5 (patch)
treeeb5d2860af9d6f3121254f2ef262e197b10bed34 /net
parentd6dc1a386358979e12366d1f35eeb68fc181e101 (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')
-rw-r--r--net/mac80211/cfg.c27
-rw-r--r--net/mac80211/mlme.c15
2 files changed, 42 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
1405static 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
1405static int ieee80211_set_bitrate_mask(struct wiphy *wiphy, 1431static 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};
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 865ea1cfb7bb..65eafda5738a 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -750,6 +750,11 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
750 /* And the BSSID changed - we're associated now */ 750 /* And the BSSID changed - we're associated now */
751 bss_info_changed |= BSS_CHANGED_BSSID; 751 bss_info_changed |= BSS_CHANGED_BSSID;
752 752
753 /* Tell the driver to monitor connection quality (if supported) */
754 if ((local->hw.flags & IEEE80211_HW_SUPPORTS_CQM_RSSI) &&
755 sdata->vif.bss_conf.cqm_rssi_thold)
756 bss_info_changed |= BSS_CHANGED_CQM;
757
753 ieee80211_bss_info_change_notify(sdata, bss_info_changed); 758 ieee80211_bss_info_change_notify(sdata, bss_info_changed);
754 759
755 mutex_lock(&local->iflist_mtx); 760 mutex_lock(&local->iflist_mtx);
@@ -2182,3 +2187,13 @@ int ieee80211_mgd_action(struct ieee80211_sub_if_data *sdata,
2182 *cookie = (unsigned long) skb; 2187 *cookie = (unsigned long) skb;
2183 return 0; 2188 return 0;
2184} 2189}
2190
2191void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
2192 enum nl80211_cqm_rssi_threshold_event rssi_event,
2193 gfp_t gfp)
2194{
2195 struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif);
2196
2197 cfg80211_cqm_rssi_notify(sdata->dev, rssi_event, gfp);
2198}
2199EXPORT_SYMBOL(ieee80211_cqm_rssi_notify);