aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/wl1251/main.c6
-rw-r--r--drivers/net/wireless/wl12xx/main.c4
-rw-r--r--include/net/mac80211.h14
-rw-r--r--net/mac80211/cfg.c10
-rw-r--r--net/mac80211/debugfs.c2
-rw-r--r--net/mac80211/mlme.c4
6 files changed, 16 insertions, 24 deletions
diff --git a/drivers/net/wireless/wl1251/main.c b/drivers/net/wireless/wl1251/main.c
index 86540db6f1a8..41302c7b1ad0 100644
--- a/drivers/net/wireless/wl1251/main.c
+++ b/drivers/net/wireless/wl1251/main.c
@@ -514,7 +514,8 @@ static int wl1251_op_add_interface(struct ieee80211_hw *hw,
514 struct wl1251 *wl = hw->priv; 514 struct wl1251 *wl = hw->priv;
515 int ret = 0; 515 int ret = 0;
516 516
517 vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER; 517 vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
518 IEEE80211_VIF_SUPPORTS_CQM_RSSI;
518 519
519 wl1251_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM", 520 wl1251_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
520 vif->type, vif->addr); 521 vif->type, vif->addr);
@@ -1340,8 +1341,7 @@ int wl1251_init_ieee80211(struct wl1251 *wl)
1340 1341
1341 wl->hw->flags = IEEE80211_HW_SIGNAL_DBM | 1342 wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |
1342 IEEE80211_HW_SUPPORTS_PS | 1343 IEEE80211_HW_SUPPORTS_PS |
1343 IEEE80211_HW_SUPPORTS_UAPSD | 1344 IEEE80211_HW_SUPPORTS_UAPSD;
1344 IEEE80211_HW_SUPPORTS_CQM_RSSI;
1345 1345
1346 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) | 1346 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
1347 BIT(NL80211_IFTYPE_ADHOC); 1347 BIT(NL80211_IFTYPE_ADHOC);
diff --git a/drivers/net/wireless/wl12xx/main.c b/drivers/net/wireless/wl12xx/main.c
index afc5381f2870..f8748cedbae1 100644
--- a/drivers/net/wireless/wl12xx/main.c
+++ b/drivers/net/wireless/wl12xx/main.c
@@ -2060,7 +2060,8 @@ static int wl1271_op_add_interface(struct ieee80211_hw *hw,
2060 u8 role_type; 2060 u8 role_type;
2061 bool booted = false; 2061 bool booted = false;
2062 2062
2063 vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER; 2063 vif->driver_flags |= IEEE80211_VIF_BEACON_FILTER |
2064 IEEE80211_VIF_SUPPORTS_CQM_RSSI;
2064 2065
2065 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM", 2066 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
2066 ieee80211_vif_type_p2p(vif), vif->addr); 2067 ieee80211_vif_type_p2p(vif), vif->addr);
@@ -4904,7 +4905,6 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
4904 IEEE80211_HW_SUPPORTS_UAPSD | 4905 IEEE80211_HW_SUPPORTS_UAPSD |
4905 IEEE80211_HW_HAS_RATE_CONTROL | 4906 IEEE80211_HW_HAS_RATE_CONTROL |
4906 IEEE80211_HW_CONNECTION_MONITOR | 4907 IEEE80211_HW_CONNECTION_MONITOR |
4907 IEEE80211_HW_SUPPORTS_CQM_RSSI |
4908 IEEE80211_HW_REPORTS_TX_ACK_STATUS | 4908 IEEE80211_HW_REPORTS_TX_ACK_STATUS |
4909 IEEE80211_HW_SPECTRUM_MGMT | 4909 IEEE80211_HW_SPECTRUM_MGMT |
4910 IEEE80211_HW_AP_LINK_PS | 4910 IEEE80211_HW_AP_LINK_PS |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index ae8db247bdeb..650185876846 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -856,9 +856,14 @@ struct ieee80211_channel_switch {
856 * 856 *
857 * @IEEE80211_VIF_BEACON_FILTER: the device performs beacon filtering 857 * @IEEE80211_VIF_BEACON_FILTER: the device performs beacon filtering
858 * on this virtual interface to avoid unnecessary CPU wakeups 858 * on this virtual interface to avoid unnecessary CPU wakeups
859 * @IEEE80211_VIF_SUPPORTS_CQM_RSSI: the device can do connection quality
860 * monitoring on this virtual interface -- i.e. it can monitor
861 * connection quality related parameters, such as the RSSI level and
862 * provide notifications if configured trigger levels are reached.
859 */ 863 */
860enum ieee80211_vif_flags { 864enum ieee80211_vif_flags {
861 IEEE80211_VIF_BEACON_FILTER = BIT(0), 865 IEEE80211_VIF_BEACON_FILTER = BIT(0),
866 IEEE80211_VIF_SUPPORTS_CQM_RSSI = BIT(1),
862}; 867};
863 868
864/** 869/**
@@ -1119,11 +1124,6 @@ enum sta_notify_cmd {
1119 * When this flag is set, signaling beacon-loss will cause an immediate 1124 * When this flag is set, signaling beacon-loss will cause an immediate
1120 * change to disassociated state. 1125 * change to disassociated state.
1121 * 1126 *
1122 * @IEEE80211_HW_SUPPORTS_CQM_RSSI:
1123 * Hardware can do connection quality monitoring - i.e. it can monitor
1124 * connection quality related parameters, such as the RSSI level and
1125 * provide notifications if configured trigger levels are reached.
1126 *
1127 * @IEEE80211_HW_NEED_DTIM_PERIOD: 1127 * @IEEE80211_HW_NEED_DTIM_PERIOD:
1128 * This device needs to know the DTIM period for the BSS before 1128 * This device needs to know the DTIM period for the BSS before
1129 * associating. 1129 * associating.
@@ -1167,7 +1167,7 @@ enum ieee80211_hw_flags {
1167 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17, 1167 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17,
1168 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18, 1168 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
1169 IEEE80211_HW_CONNECTION_MONITOR = 1<<19, 1169 IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
1170 IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20, 1170 /* reuse bit 20 */
1171 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21, 1171 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1172 IEEE80211_HW_AP_LINK_PS = 1<<22, 1172 IEEE80211_HW_AP_LINK_PS = 1<<22,
1173 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23, 1173 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
@@ -3408,7 +3408,7 @@ void ieee80211_enable_dyn_ps(struct ieee80211_vif *vif);
3408 * @rssi_event: the RSSI trigger event type 3408 * @rssi_event: the RSSI trigger event type
3409 * @gfp: context flags 3409 * @gfp: context flags
3410 * 3410 *
3411 * When the %IEEE80211_HW_SUPPORTS_CQM_RSSI is set, and a connection quality 3411 * When the %IEEE80211_VIF_SUPPORTS_CQM_RSSI is set, and a connection quality
3412 * monitoring is configured with an rssi threshold, the driver will inform 3412 * monitoring is configured with an rssi threshold, the driver will inform
3413 * whenever the rssi level reaches the threshold. 3413 * whenever the rssi level reaches the threshold.
3414 */ 3414 */
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index d86730fe75c8..74c9301681e5 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1873,7 +1873,6 @@ static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy,
1873 s32 rssi_thold, u32 rssi_hyst) 1873 s32 rssi_thold, u32 rssi_hyst)
1874{ 1874{
1875 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); 1875 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1876 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1877 struct ieee80211_vif *vif = &sdata->vif; 1876 struct ieee80211_vif *vif = &sdata->vif;
1878 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 1877 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
1879 1878
@@ -1884,14 +1883,9 @@ static int ieee80211_set_cqm_rssi_config(struct wiphy *wiphy,
1884 bss_conf->cqm_rssi_thold = rssi_thold; 1883 bss_conf->cqm_rssi_thold = rssi_thold;
1885 bss_conf->cqm_rssi_hyst = rssi_hyst; 1884 bss_conf->cqm_rssi_hyst = rssi_hyst;
1886 1885
1887 if (!(local->hw.flags & IEEE80211_HW_SUPPORTS_CQM_RSSI)) {
1888 if (sdata->vif.type != NL80211_IFTYPE_STATION)
1889 return -EOPNOTSUPP;
1890 return 0;
1891 }
1892
1893 /* tell the driver upon association, unless already associated */ 1886 /* tell the driver upon association, unless already associated */
1894 if (sdata->u.mgd.associated) 1887 if (sdata->u.mgd.associated &&
1888 sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI)
1895 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM); 1889 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM);
1896 1890
1897 return 0; 1891 return 0;
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index e8868dae1c01..affe64be9092 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -257,8 +257,6 @@ static ssize_t hwflags_read(struct file *file, char __user *user_buf,
257 sf += snprintf(buf + sf, mxln - sf, "REPORTS_TX_ACK_STATUS\n"); 257 sf += snprintf(buf + sf, mxln - sf, "REPORTS_TX_ACK_STATUS\n");
258 if (local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR) 258 if (local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
259 sf += snprintf(buf + sf, mxln - sf, "CONNECTION_MONITOR\n"); 259 sf += snprintf(buf + sf, mxln - sf, "CONNECTION_MONITOR\n");
260 if (local->hw.flags & IEEE80211_HW_SUPPORTS_CQM_RSSI)
261 sf += snprintf(buf + sf, mxln - sf, "SUPPORTS_CQM_RSSI\n");
262 if (local->hw.flags & IEEE80211_HW_SUPPORTS_PER_STA_GTK) 260 if (local->hw.flags & IEEE80211_HW_SUPPORTS_PER_STA_GTK)
263 sf += snprintf(buf + sf, mxln - sf, "SUPPORTS_PER_STA_GTK\n"); 261 sf += snprintf(buf + sf, mxln - sf, "SUPPORTS_PER_STA_GTK\n");
264 if (local->hw.flags & IEEE80211_HW_AP_LINK_PS) 262 if (local->hw.flags & IEEE80211_HW_AP_LINK_PS)
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index b51eb49d8525..de3268c7be1e 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -1043,7 +1043,7 @@ static void ieee80211_set_associated(struct ieee80211_sub_if_data *sdata,
1043 bss_info_changed |= BSS_CHANGED_BSSID; 1043 bss_info_changed |= BSS_CHANGED_BSSID;
1044 1044
1045 /* Tell the driver to monitor connection quality (if supported) */ 1045 /* Tell the driver to monitor connection quality (if supported) */
1046 if ((local->hw.flags & IEEE80211_HW_SUPPORTS_CQM_RSSI) && 1046 if (sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI &&
1047 bss_conf->cqm_rssi_thold) 1047 bss_conf->cqm_rssi_thold)
1048 bss_info_changed |= BSS_CHANGED_CQM; 1048 bss_info_changed |= BSS_CHANGED_CQM;
1049 1049
@@ -1882,7 +1882,7 @@ static void ieee80211_rx_mgmt_beacon(struct ieee80211_sub_if_data *sdata,
1882 1882
1883 if (bss_conf->cqm_rssi_thold && 1883 if (bss_conf->cqm_rssi_thold &&
1884 ifmgd->count_beacon_signal >= IEEE80211_SIGNAL_AVE_MIN_COUNT && 1884 ifmgd->count_beacon_signal >= IEEE80211_SIGNAL_AVE_MIN_COUNT &&
1885 !(local->hw.flags & IEEE80211_HW_SUPPORTS_CQM_RSSI)) { 1885 !(sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_CQM_RSSI)) {
1886 int sig = ifmgd->ave_beacon_signal / 16; 1886 int sig = ifmgd->ave_beacon_signal / 16;
1887 int last_event = ifmgd->last_cqm_event_signal; 1887 int last_event = ifmgd->last_cqm_event_signal;
1888 int thold = bss_conf->cqm_rssi_thold; 1888 int thold = bss_conf->cqm_rssi_thold;