@@ -4608,10 +4608,11 @@ void iwl_mvm_change_chanctx(struct ieee80211_hw *hw,
4608
4608
* Returns true if we're done assigning the chanctx
4609
4609
* (either on failure or success)
4610
4610
*/
4611
- bool __iwl_mvm_assign_vif_chanctx_common (struct iwl_mvm * mvm ,
4612
- struct ieee80211_vif * vif ,
4613
- struct ieee80211_chanctx_conf * ctx ,
4614
- bool switching_chanctx , int * ret )
4611
+ static bool
4612
+ __iwl_mvm_assign_vif_chanctx_common (struct iwl_mvm * mvm ,
4613
+ struct ieee80211_vif * vif ,
4614
+ struct ieee80211_chanctx_conf * ctx ,
4615
+ bool switching_chanctx , int * ret )
4615
4616
{
4616
4617
u16 * phy_ctxt_id = (u16 * )ctx -> drv_priv ;
4617
4618
struct iwl_mvm_phy_ctxt * phy_ctxt = & mvm -> phy_ctxts [* phy_ctxt_id ];
@@ -4651,12 +4652,16 @@ bool __iwl_mvm_assign_vif_chanctx_common(struct iwl_mvm *mvm,
4651
4652
4652
4653
static int __iwl_mvm_assign_vif_chanctx (struct iwl_mvm * mvm ,
4653
4654
struct ieee80211_vif * vif ,
4655
+ struct ieee80211_bss_conf * link_conf ,
4654
4656
struct ieee80211_chanctx_conf * ctx ,
4655
4657
bool switching_chanctx )
4656
4658
{
4657
4659
struct iwl_mvm_vif * mvmvif = iwl_mvm_vif_from_mac80211 (vif );
4658
4660
int ret ;
4659
4661
4662
+ if (WARN_ON (!link_conf ))
4663
+ return - EINVAL ;
4664
+
4660
4665
if (__iwl_mvm_assign_vif_chanctx_common (mvm , vif , ctx ,
4661
4666
switching_chanctx , & ret ))
4662
4667
goto out ;
@@ -4736,7 +4741,7 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw,
4736
4741
int ret ;
4737
4742
4738
4743
mutex_lock (& mvm -> mutex );
4739
- ret = __iwl_mvm_assign_vif_chanctx (mvm , vif , ctx , false);
4744
+ ret = __iwl_mvm_assign_vif_chanctx (mvm , vif , link_conf , ctx , false);
4740
4745
mutex_unlock (& mvm -> mutex );
4741
4746
4742
4747
return ret ;
@@ -4748,9 +4753,9 @@ static int iwl_mvm_assign_vif_chanctx(struct ieee80211_hw *hw,
4748
4753
* Returns if chanctx unassign chanctx is done
4749
4754
* (either on failure or success)
4750
4755
*/
4751
- bool __iwl_mvm_unassign_vif_chanctx_common (struct iwl_mvm * mvm ,
4752
- struct ieee80211_vif * vif ,
4753
- bool switching_chanctx )
4756
+ static bool __iwl_mvm_unassign_vif_chanctx_common (struct iwl_mvm * mvm ,
4757
+ struct ieee80211_vif * vif ,
4758
+ bool switching_chanctx )
4754
4759
{
4755
4760
struct iwl_mvm_vif * mvmvif = iwl_mvm_vif_from_mac80211 (vif );
4756
4761
@@ -4788,6 +4793,7 @@ bool __iwl_mvm_unassign_vif_chanctx_common(struct iwl_mvm *mvm,
4788
4793
4789
4794
static void __iwl_mvm_unassign_vif_chanctx (struct iwl_mvm * mvm ,
4790
4795
struct ieee80211_vif * vif ,
4796
+ struct ieee80211_bss_conf * link_conf ,
4791
4797
struct ieee80211_chanctx_conf * ctx ,
4792
4798
bool switching_chanctx )
4793
4799
{
@@ -4827,7 +4833,7 @@ static void iwl_mvm_unassign_vif_chanctx(struct ieee80211_hw *hw,
4827
4833
struct iwl_mvm * mvm = IWL_MAC80211_GET_MVM (hw );
4828
4834
4829
4835
mutex_lock (& mvm -> mutex );
4830
- __iwl_mvm_unassign_vif_chanctx (mvm , vif , ctx , false);
4836
+ __iwl_mvm_unassign_vif_chanctx (mvm , vif , link_conf , ctx , false);
4831
4837
mutex_unlock (& mvm -> mutex );
4832
4838
}
4833
4839
@@ -4839,7 +4845,8 @@ iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm,
4839
4845
int ret ;
4840
4846
4841
4847
mutex_lock (& mvm -> mutex );
4842
- ops -> __unassign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].old_ctx , true);
4848
+ ops -> __unassign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].link_conf ,
4849
+ vifs [0 ].old_ctx , true);
4843
4850
__iwl_mvm_remove_chanctx (mvm , vifs [0 ].old_ctx );
4844
4851
4845
4852
ret = __iwl_mvm_add_chanctx (mvm , vifs [0 ].new_ctx );
@@ -4848,8 +4855,8 @@ iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm,
4848
4855
goto out_reassign ;
4849
4856
}
4850
4857
4851
- ret = ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].new_ctx ,
4852
- true);
4858
+ ret = ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].link_conf ,
4859
+ vifs [ 0 ]. new_ctx , true);
4853
4860
if (ret ) {
4854
4861
IWL_ERR (mvm ,
4855
4862
"failed to assign new_ctx during channel switch\n" );
@@ -4871,8 +4878,8 @@ iwl_mvm_switch_vif_chanctx_swap(struct iwl_mvm *mvm,
4871
4878
goto out_restart ;
4872
4879
}
4873
4880
4874
- if (ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].old_ctx ,
4875
- true)) {
4881
+ if (ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].link_conf ,
4882
+ vifs [ 0 ]. old_ctx , true)) {
4876
4883
IWL_ERR (mvm , "failed to reassign old_ctx after failure.\n" );
4877
4884
goto out_restart ;
4878
4885
}
@@ -4897,10 +4904,11 @@ iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm,
4897
4904
int ret ;
4898
4905
4899
4906
mutex_lock (& mvm -> mutex );
4900
- ops -> __unassign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].old_ctx , true);
4907
+ ops -> __unassign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].link_conf ,
4908
+ vifs [0 ].old_ctx , true);
4901
4909
4902
- ret = ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].new_ctx ,
4903
- true);
4910
+ ret = ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].link_conf ,
4911
+ vifs [ 0 ]. new_ctx , true);
4904
4912
if (ret ) {
4905
4913
IWL_ERR (mvm ,
4906
4914
"failed to assign new_ctx during channel switch\n" );
@@ -4910,8 +4918,8 @@ iwl_mvm_switch_vif_chanctx_reassign(struct iwl_mvm *mvm,
4910
4918
goto out ;
4911
4919
4912
4920
out_reassign :
4913
- if (ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].old_ctx ,
4914
- true)) {
4921
+ if (ops -> __assign_vif_chanctx (mvm , vifs [0 ].vif , vifs [0 ].link_conf ,
4922
+ vifs [ 0 ]. old_ctx , true)) {
4915
4923
IWL_ERR (mvm , "failed to reassign old_ctx after failure.\n" );
4916
4924
goto out_restart ;
4917
4925
}
0 commit comments