Commit ea086359a63bd0dd85c1d784d0425340649613fa

Authored by Johannes Berg
Committed by John W. Linville
1 parent c1288b1278

mac80211: make CQM RSSI support per virtual interface

Similar to the previous beacon filtering patch,
make CQM RSSI support depend on the flags that
the driver set for virtual interfaces.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Acked-by: Luciano Coelho <coelho@ti.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

Showing 6 changed files with 16 additions and 24 deletions Side-by-side Diff

drivers/net/wireless/wl1251/main.c
... ... @@ -514,7 +514,8 @@
514 514 struct wl1251 *wl = hw->priv;
515 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 520 wl1251_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
520 521 vif->type, vif->addr);
... ... @@ -1340,8 +1341,7 @@
1340 1341  
1341 1342 wl->hw->flags = IEEE80211_HW_SIGNAL_DBM |
1342 1343 IEEE80211_HW_SUPPORTS_PS |
1343   - IEEE80211_HW_SUPPORTS_UAPSD |
1344   - IEEE80211_HW_SUPPORTS_CQM_RSSI;
  1344 + IEEE80211_HW_SUPPORTS_UAPSD;
1345 1345  
1346 1346 wl->hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
1347 1347 BIT(NL80211_IFTYPE_ADHOC);
drivers/net/wireless/wl12xx/main.c
... ... @@ -2060,7 +2060,8 @@
2060 2060 u8 role_type;
2061 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 2066 wl1271_debug(DEBUG_MAC80211, "mac80211 add interface type %d mac %pM",
2066 2067 ieee80211_vif_type_p2p(vif), vif->addr);
... ... @@ -4904,7 +4905,6 @@
4904 4905 IEEE80211_HW_SUPPORTS_UAPSD |
4905 4906 IEEE80211_HW_HAS_RATE_CONTROL |
4906 4907 IEEE80211_HW_CONNECTION_MONITOR |
4907   - IEEE80211_HW_SUPPORTS_CQM_RSSI |
4908 4908 IEEE80211_HW_REPORTS_TX_ACK_STATUS |
4909 4909 IEEE80211_HW_SPECTRUM_MGMT |
4910 4910 IEEE80211_HW_AP_LINK_PS |
include/net/mac80211.h
... ... @@ -856,9 +856,14 @@
856 856 *
857 857 * @IEEE80211_VIF_BEACON_FILTER: the device performs beacon filtering
858 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 */
860 864 enum ieee80211_vif_flags {
861 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 @@
1119 1124 * When this flag is set, signaling beacon-loss will cause an immediate
1120 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 1127 * @IEEE80211_HW_NEED_DTIM_PERIOD:
1128 1128 * This device needs to know the DTIM period for the BSS before
1129 1129 * associating.
... ... @@ -1167,7 +1167,7 @@
1167 1167 IEEE80211_HW_SUPPORTS_UAPSD = 1<<17,
1168 1168 IEEE80211_HW_REPORTS_TX_ACK_STATUS = 1<<18,
1169 1169 IEEE80211_HW_CONNECTION_MONITOR = 1<<19,
1170   - IEEE80211_HW_SUPPORTS_CQM_RSSI = 1<<20,
  1170 + /* reuse bit 20 */
1171 1171 IEEE80211_HW_SUPPORTS_PER_STA_GTK = 1<<21,
1172 1172 IEEE80211_HW_AP_LINK_PS = 1<<22,
1173 1173 IEEE80211_HW_TX_AMPDU_SETUP_IN_HW = 1<<23,
... ... @@ -3408,7 +3408,7 @@
3408 3408 * @rssi_event: the RSSI trigger event type
3409 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 3412 * monitoring is configured with an rssi threshold, the driver will inform
3413 3413 * whenever the rssi level reaches the threshold.
3414 3414 */
... ... @@ -1873,7 +1873,6 @@
1873 1873 s32 rssi_thold, u32 rssi_hyst)
1874 1874 {
1875 1875 struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
1876   - struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
1877 1876 struct ieee80211_vif *vif = &sdata->vif;
1878 1877 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
1879 1878  
1880 1879  
... ... @@ -1884,14 +1883,9 @@
1884 1883 bss_conf->cqm_rssi_thold = rssi_thold;
1885 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 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 1889 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_CQM);
1896 1890  
1897 1891 return 0;
net/mac80211/debugfs.c
... ... @@ -257,8 +257,6 @@
257 257 sf += snprintf(buf + sf, mxln - sf, "REPORTS_TX_ACK_STATUS\n");
258 258 if (local->hw.flags & IEEE80211_HW_CONNECTION_MONITOR)
259 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 260 if (local->hw.flags & IEEE80211_HW_SUPPORTS_PER_STA_GTK)
263 261 sf += snprintf(buf + sf, mxln - sf, "SUPPORTS_PER_STA_GTK\n");
264 262 if (local->hw.flags & IEEE80211_HW_AP_LINK_PS)
... ... @@ -1043,7 +1043,7 @@
1043 1043 bss_info_changed |= BSS_CHANGED_BSSID;
1044 1044  
1045 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 1047 bss_conf->cqm_rssi_thold)
1048 1048 bss_info_changed |= BSS_CHANGED_CQM;
1049 1049  
... ... @@ -1882,7 +1882,7 @@
1882 1882  
1883 1883 if (bss_conf->cqm_rssi_thold &&
1884 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 1886 int sig = ifmgd->ave_beacon_signal / 16;
1887 1887 int last_event = ifmgd->last_cqm_event_signal;
1888 1888 int thold = bss_conf->cqm_rssi_thold;