iwlwifi: mvm: track and report IBSS manager status to mac80211
authorJohannes Berg <johannes.berg@intel.com>
Thu, 20 Apr 2017 08:29:03 +0000 (10:29 +0200)
committerLuca Coelho <luciano.coelho@intel.com>
Thu, 22 Jun 2017 21:13:00 +0000 (00:13 +0300)
Shaul reported that when iwlmvm was sending beacons, it didn't properly
also take ownership of the probe responses. This is because the whole
mac80211 callback (tx_last_beacon) wasn't implemented. Fix that to make
IBSS discovery work better.

Reported-by: Shaul Triebitz <shaul.triebitz@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c
drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c
drivers/net/wireless/intel/iwlwifi/mvm/mvm.h

index d573ac7394147ee89d91aa0a143426ba1ffe0c44..50a71da2e96e332cb56bf73c16ea5f3baea3f46a 100644 (file)
@@ -1457,6 +1457,7 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm,
 
        beacon_notify_hdr = &beacon->beacon_notify_hdr;
        mvm->ap_last_beacon_gp2 = le32_to_cpu(beacon->gp2);
+       mvm->ibss_manager = beacon->ibss_mgr_status != 0;
 
        agg_status = iwl_mvm_get_agg_status(mvm, beacon_notify_hdr);
        status = le16_to_cpu(agg_status->status) & TX_STATUS_MSK;
index 05041d37773bd00c7878ce2a9ac0b222bb76e5e4..75ec567ab9e2de21336ca2ad7b2b420108326bf0 100644 (file)
@@ -3737,6 +3737,13 @@ static int iwl_mvm_switch_vif_chanctx(struct ieee80211_hw *hw,
        return ret;
 }
 
+static int iwl_mvm_tx_last_beacon(struct ieee80211_hw *hw)
+{
+       struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
+
+       return mvm->ibss_manager;
+}
+
 static int iwl_mvm_set_tim(struct ieee80211_hw *hw,
                           struct ieee80211_sta *sta,
                           bool set)
@@ -4338,6 +4345,8 @@ const struct ieee80211_ops iwl_mvm_hw_ops = {
        .join_ibss = iwl_mvm_start_ap_ibss,
        .leave_ibss = iwl_mvm_stop_ap_ibss,
 
+       .tx_last_beacon = iwl_mvm_tx_last_beacon,
+
        .set_tim = iwl_mvm_set_tim,
 
        .channel_switch = iwl_mvm_channel_switch,
index cdd13bc343e6cfa4a8b9b59c594e68ba9915d040..a4bee9c740e03a6641adf73374819aed9599154d 100644 (file)
@@ -1021,6 +1021,9 @@ struct iwl_mvm {
        /* system time of last beacon (for AP/GO interface) */
        u32 ap_last_beacon_gp2;
 
+       /* indicates that we transmitted the last beacon */
+       bool ibss_manager;
+
        bool lar_regdom_set;
        enum iwl_mcc_source mcc_src;