mac80211: don't always advertise remain-on-channel
authorJohannes Berg <johannes.berg@intel.com>
Mon, 26 Mar 2012 16:47:18 +0000 (18:47 +0200)
committerJohn W. Linville <linville@tuxdriver.com>
Tue, 10 Apr 2012 18:54:04 +0000 (14:54 -0400)
Not all devices are really capable of implementing
remain-on-channel, even if it is implemented in SW,
as they can't necessarily deal with channel changes
while associated.

Remove the WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL and add
it only if either the driver has remain_on_channel
implemented in the driver/device.

Also add it to all drivers that advertise P2P right
now since those definitely have to have it working.

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>
drivers/net/wireless/ath/ath9k/htc_drv_init.c
drivers/net/wireless/ath/ath9k/init.c
drivers/net/wireless/ath/carl9170/fw.c
drivers/net/wireless/mac80211_hwsim.c
drivers/net/wireless/wl12xx/main.c
net/mac80211/main.c

index a2e939a280aab591504ac421d24ff9f296008f13..25213d521bc2ddc9d2beaa916f48f5a2d66ee03a 100644 (file)
@@ -713,7 +713,8 @@ static void ath9k_set_hw_capab(struct ath9k_htc_priv *priv,
 
        hw->wiphy->flags &= ~WIPHY_FLAG_PS_ON_BY_DEFAULT;
 
-       hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
+       hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN |
+                           WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 
        hw->queues = 4;
        hw->channel_change_time = 5000;
index fc8156eb6eba6c454953fa196e952f61e64ad031..daaa86f2463b2e9e69a634b995728e564574fea9 100644 (file)
@@ -678,6 +678,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)
 
        hw->wiphy->flags |= WIPHY_FLAG_IBSS_RSN;
        hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
+       hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 
        hw->queues = 4;
        hw->max_rates = 4;
index cffde8d9a521d26ed6ea5886daad4693c15fc108..5c73c03872f36139931dfcba40cd9b3720e7ff99 100644 (file)
@@ -355,6 +355,8 @@ static int carl9170_fw(struct ar9170 *ar, const __u8 *data, size_t len)
 
        ar->hw->wiphy->interface_modes |= if_comb_types;
 
+       ar->hw->wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
+
 #undef SUPPORTED
        return carl9170_fw_tx_sequence(ar);
 }
index b7ce6a6e355f68c30d2c55cb772dfd8d5414af57..8737f4e52cbcfa4e2df62d1ce5195f40dcb6e06c 100644 (file)
@@ -1791,7 +1791,8 @@ static int __init init_mac80211_hwsim(void)
                            IEEE80211_HW_SUPPORTS_DYNAMIC_SMPS |
                            IEEE80211_HW_AMPDU_AGGREGATION;
 
-               hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS;
+               hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
+                                   WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 
                /* ask mac80211 to reserve space for magic */
                hw->vif_data_size = sizeof(struct hwsim_vif_priv);
index b1555fb5815b48c4347126c4762cb84b7a8d599a..362ff1a7067ec732965350bd6b69f24fba7a4bc2 100644 (file)
@@ -5242,7 +5242,8 @@ static int wl1271_init_ieee80211(struct wl1271 *wl)
        wl->hw->wiphy->max_sched_scan_ie_len = WL1271_CMD_TEMPL_MAX_SIZE -
                sizeof(struct ieee80211_header);
 
-       wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD;
+       wl->hw->wiphy->flags |= WIPHY_FLAG_AP_UAPSD |
+                               WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 
        /* make sure all our channels fit in the scanned_ch bitmask */
        BUILD_BUG_ON(ARRAY_SIZE(wl1271_channels) +
index 16336480c631a6bd61d47d1137d57ba80ce7aca4..d019f0d3a0fe2a6c318a3b3318802c03d77c5250 100644 (file)
@@ -557,8 +557,10 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
                        WIPHY_FLAG_4ADDR_AP |
                        WIPHY_FLAG_4ADDR_STATION |
                        WIPHY_FLAG_REPORTS_OBSS |
-                       WIPHY_FLAG_OFFCHAN_TX |
-                       WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
+                       WIPHY_FLAG_OFFCHAN_TX;
+
+       if (ops->remain_on_channel)
+               wiphy->flags |= WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
 
        wiphy->features = NL80211_FEATURE_SK_TX_STATUS |
                          NL80211_FEATURE_HT_IBSS;