From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-sn1nam02on0125.outbound.protection.outlook.com ([104.47.36.125]:10314 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755780AbeDIAaW (ORCPT ); Sun, 8 Apr 2018 20:30:22 -0400 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Johannes Berg , Luca Coelho , Sasha Levin Subject: [PATCH AUTOSEL for 4.9 127/293] iwlwifi: mvm: track and report IBSS manager status to mac80211 Date: Mon, 9 Apr 2018 00:24:31 +0000 Message-ID: <20180409002239.163177-127-alexander.levin@microsoft.com> References: <20180409002239.163177-1-alexander.levin@microsoft.com> In-Reply-To: <20180409002239.163177-1-alexander.levin@microsoft.com> Content-Language: en-US Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org List-ID: From: Johannes Berg [ Upstream commit 2f0282db41194c0099a019b2761911d6c69cbdb9 ] 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 Signed-off-by: Luca Coelho Signed-off-by: Sasha Levin --- drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c | 1 + drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c | 9 +++++++++ drivers/net/wireless/intel/iwlwifi/mvm/mvm.h | 3 +++ 3 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c b/drivers/ne= t/wireless/intel/iwlwifi/mvm/mac-ctxt.c index 6b962d6b067a..ee8b12424d03 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac-ctxt.c @@ -1434,6 +1434,7 @@ void iwl_mvm_rx_beacon_notif(struct iwl_mvm *mvm, =20 beacon_notify_hdr =3D &beacon->beacon_notify_hdr; mvm->ap_last_beacon_gp2 =3D le32_to_cpu(beacon->gp2); + mvm->ibss_manager =3D beacon->ibss_mgr_status !=3D 0; =20 status =3D le16_to_cpu(beacon_notify_hdr->status.status) & TX_STATUS_MSK; IWL_DEBUG_RX(mvm, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c b/drivers/ne= t/wireless/intel/iwlwifi/mvm/mac80211.c index f1231c0ea336..3d6401eafe52 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mac80211.c @@ -3621,6 +3621,13 @@ static int iwl_mvm_switch_vif_chanctx(struct ieee802= 11_hw *hw, return ret; } =20 +static int iwl_mvm_tx_last_beacon(struct ieee80211_hw *hw) +{ + struct iwl_mvm *mvm =3D 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) @@ -4218,6 +4225,8 @@ const struct ieee80211_ops iwl_mvm_hw_ops =3D { .join_ibss =3D iwl_mvm_start_ap_ibss, .leave_ibss =3D iwl_mvm_stop_ap_ibss, =20 + .tx_last_beacon =3D iwl_mvm_tx_last_beacon, + .set_tim =3D iwl_mvm_set_tim, =20 .channel_switch =3D iwl_mvm_channel_switch, diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h b/drivers/net/wir= eless/intel/iwlwifi/mvm/mvm.h index c60703e0c246..49e84efbbb0e 100644 --- a/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h +++ b/drivers/net/wireless/intel/iwlwifi/mvm/mvm.h @@ -989,6 +989,9 @@ struct iwl_mvm { /* system time of last beacon (for AP/GO interface) */ u32 ap_last_beacon_gp2; =20 + /* indicates that we transmitted the last beacon */ + bool ibss_manager; + bool lar_regdom_set; enum iwl_mcc_source mcc_src; =20 --=20 2.15.1