aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mwifiex/cfg80211.c
diff options
context:
space:
mode:
authorAmitkumar Karwar <akarwar@marvell.com>2012-03-15 23:51:51 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-09 16:06:00 -0400
commitfa444bf88ce2ba17d24dd0bb279e3106acf86bed (patch)
tree010f901a998aa5856cb2062fb4eec0cd81f98372 /drivers/net/wireless/mwifiex/cfg80211.c
parent7013d3e267ef41b3dfdfedbbe6c3d3e666f0f138 (diff)
mwifiex: add set_cqm_rssi_config handler support
In this handler LOW_RSSI and HIGH_RSSI events are subscribed to FW using provided threshold value so that FW will monitor connection quality and trigger any of these events. Driver will notify cfg80211 about connection quality based on inputs from FW and provided hysteresis. Signed-off-by: Amitkumar Karwar <akarwar@marvell.com> Signed-off-by: Yogesh Ashok Powar <yogeshp@marvell.com> Signed-off-by: Bing Zhao <bzhao@marvell.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mwifiex/cfg80211.c')
-rw-r--r--drivers/net/wireless/mwifiex/cfg80211.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/wireless/mwifiex/cfg80211.c b/drivers/net/wireless/mwifiex/cfg80211.c
index 96c1e3b24da3..c7e89188c350 100644
--- a/drivers/net/wireless/mwifiex/cfg80211.c
+++ b/drivers/net/wireless/mwifiex/cfg80211.c
@@ -766,6 +766,45 @@ static int mwifiex_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
766} 766}
767 767
768/* 768/*
769 * CFG802.11 operation handler for connection quality monitoring.
770 *
771 * This function subscribes/unsubscribes HIGH_RSSI and LOW_RSSI
772 * events to FW.
773 */
774static int mwifiex_cfg80211_set_cqm_rssi_config(struct wiphy *wiphy,
775 struct net_device *dev,
776 s32 rssi_thold, u32 rssi_hyst)
777{
778 struct mwifiex_private *priv = mwifiex_netdev_get_priv(dev);
779 struct mwifiex_ds_misc_subsc_evt subsc_evt;
780
781 priv->cqm_rssi_thold = rssi_thold;
782 priv->cqm_rssi_hyst = rssi_hyst;
783
784 memset(&subsc_evt, 0x00, sizeof(struct mwifiex_ds_misc_subsc_evt));
785 subsc_evt.events = BITMASK_BCN_RSSI_LOW | BITMASK_BCN_RSSI_HIGH;
786
787 /* Subscribe/unsubscribe low and high rssi events */
788 if (rssi_thold && rssi_hyst) {
789 subsc_evt.action = HostCmd_ACT_BITWISE_SET;
790 subsc_evt.bcn_l_rssi_cfg.abs_value = abs(rssi_thold);
791 subsc_evt.bcn_h_rssi_cfg.abs_value = abs(rssi_thold);
792 subsc_evt.bcn_l_rssi_cfg.evt_freq = 1;
793 subsc_evt.bcn_h_rssi_cfg.evt_freq = 1;
794 return mwifiex_send_cmd_sync(priv,
795 HostCmd_CMD_802_11_SUBSCRIBE_EVENT,
796 0, 0, &subsc_evt);
797 } else {
798 subsc_evt.action = HostCmd_ACT_BITWISE_CLR;
799 return mwifiex_send_cmd_sync(priv,
800 HostCmd_CMD_802_11_SUBSCRIBE_EVENT,
801 0, 0, &subsc_evt);
802 }
803
804 return 0;
805}
806
807/*
769 * CFG802.11 operation handler for disconnection request. 808 * CFG802.11 operation handler for disconnection request.
770 * 809 *
771 * This function does not work when there is already a disconnection 810 * This function does not work when there is already a disconnection
@@ -1367,6 +1406,7 @@ static struct cfg80211_ops mwifiex_cfg80211_ops = {
1367 .set_power_mgmt = mwifiex_cfg80211_set_power_mgmt, 1406 .set_power_mgmt = mwifiex_cfg80211_set_power_mgmt,
1368 .set_tx_power = mwifiex_cfg80211_set_tx_power, 1407 .set_tx_power = mwifiex_cfg80211_set_tx_power,
1369 .set_bitrate_mask = mwifiex_cfg80211_set_bitrate_mask, 1408 .set_bitrate_mask = mwifiex_cfg80211_set_bitrate_mask,
1409 .set_cqm_rssi_config = mwifiex_cfg80211_set_cqm_rssi_config,
1370}; 1410};
1371 1411
1372/* 1412/*