@@ -652,7 +652,6 @@ struct mac80211_hwsim_data {
652
652
u32 ciphers [ARRAY_SIZE (hwsim_ciphers )];
653
653
654
654
struct mac_address addresses [2 ];
655
- struct ieee80211_chanctx_conf * chanctx ;
656
655
int channels , idx ;
657
656
bool use_chanctx ;
658
657
bool destroy_on_close ;
@@ -2870,11 +2869,6 @@ static int mac80211_hwsim_croc(struct ieee80211_hw *hw,
2870
2869
static int mac80211_hwsim_add_chanctx (struct ieee80211_hw * hw ,
2871
2870
struct ieee80211_chanctx_conf * ctx )
2872
2871
{
2873
- struct mac80211_hwsim_data * hwsim = hw -> priv ;
2874
-
2875
- mutex_lock (& hwsim -> mutex );
2876
- hwsim -> chanctx = ctx ;
2877
- mutex_unlock (& hwsim -> mutex );
2878
2872
hwsim_set_chanctx_magic (ctx );
2879
2873
wiphy_dbg (hw -> wiphy ,
2880
2874
"add channel context control: %d MHz/width: %d/cfreqs:%d/%d MHz\n" ,
@@ -2886,11 +2880,6 @@ static int mac80211_hwsim_add_chanctx(struct ieee80211_hw *hw,
2886
2880
static void mac80211_hwsim_remove_chanctx (struct ieee80211_hw * hw ,
2887
2881
struct ieee80211_chanctx_conf * ctx )
2888
2882
{
2889
- struct mac80211_hwsim_data * hwsim = hw -> priv ;
2890
-
2891
- mutex_lock (& hwsim -> mutex );
2892
- hwsim -> chanctx = NULL ;
2893
- mutex_unlock (& hwsim -> mutex );
2894
2883
wiphy_dbg (hw -> wiphy ,
2895
2884
"remove channel context control: %d MHz/width: %d/cfreqs:%d/%d MHz\n" ,
2896
2885
ctx -> def .chan -> center_freq , ctx -> def .width ,
@@ -2903,11 +2892,6 @@ static void mac80211_hwsim_change_chanctx(struct ieee80211_hw *hw,
2903
2892
struct ieee80211_chanctx_conf * ctx ,
2904
2893
u32 changed )
2905
2894
{
2906
- struct mac80211_hwsim_data * hwsim = hw -> priv ;
2907
-
2908
- mutex_lock (& hwsim -> mutex );
2909
- hwsim -> chanctx = ctx ;
2910
- mutex_unlock (& hwsim -> mutex );
2911
2895
hwsim_check_chanctx_magic (ctx );
2912
2896
wiphy_dbg (hw -> wiphy ,
2913
2897
"change channel context control: %d MHz/width: %d/cfreqs:%d/%d MHz\n" ,
@@ -4278,7 +4262,6 @@ static int mac80211_hwsim_new_radio(struct genl_info *info,
4278
4262
hw -> wiphy -> max_remain_on_channel_duration = 1000 ;
4279
4263
data -> if_combination .radar_detect_widths = 0 ;
4280
4264
data -> if_combination .num_different_channels = data -> channels ;
4281
- data -> chanctx = NULL ;
4282
4265
} else {
4283
4266
data -> if_combination .num_different_channels = 1 ;
4284
4267
data -> if_combination .radar_detect_widths =
@@ -4853,13 +4836,9 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2,
4853
4836
if (data2 -> use_chanctx ) {
4854
4837
if (data2 -> tmp_chan )
4855
4838
channel = data2 -> tmp_chan ;
4856
- else if (data2 -> chanctx )
4857
- channel = data2 -> chanctx -> def .chan ;
4858
4839
} else {
4859
4840
channel = data2 -> channel ;
4860
4841
}
4861
- if (!channel )
4862
- goto out ;
4863
4842
4864
4843
if (!hwsim_virtio_enabled ) {
4865
4844
if (hwsim_net_get_netgroup (genl_info_net (info )) !=
@@ -4890,6 +4869,7 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2,
4890
4869
rx_status .freq );
4891
4870
if (!iter_data .channel )
4892
4871
goto out ;
4872
+ rx_status .band = iter_data .channel -> band ;
4893
4873
4894
4874
mutex_lock (& data2 -> mutex );
4895
4875
if (!hwsim_chans_compat (iter_data .channel , channel )) {
@@ -4902,11 +4882,13 @@ static int hwsim_cloned_frame_received_nl(struct sk_buff *skb_2,
4902
4882
}
4903
4883
}
4904
4884
mutex_unlock (& data2 -> mutex );
4885
+ } else if (!channel ) {
4886
+ goto out ;
4905
4887
} else {
4906
4888
rx_status .freq = channel -> center_freq ;
4889
+ rx_status .band = channel -> band ;
4907
4890
}
4908
4891
4909
- rx_status .band = channel -> band ;
4910
4892
rx_status .rate_idx = nla_get_u32 (info -> attrs [HWSIM_ATTR_RX_RATE ]);
4911
4893
rx_status .signal = nla_get_u32 (info -> attrs [HWSIM_ATTR_SIGNAL ]);
4912
4894
0 commit comments