Search Linux Wireless

Re: [PATCH 2/2] wifi: mac80211_hwsim: add support for switch_vif_chanctx callback

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 2024-02-15 at 21:58 +0530, Aditya Kumar Singh wrote: 
> +static int mac80211_hwsim_switch_vif_chanctx(struct ieee80211_hw *hw,
> +					     struct ieee80211_vif_chanctx_switch *vifs,
> +					     int n_vifs,
> +					     enum ieee80211_chanctx_switch_mode mode)
> +{
> +	int i;
> +
> +	if (n_vifs <= 0)
> +		return -EINVAL;
> +
> +	wiphy_dbg(hw->wiphy,
> +		  "switch vif channel context mode: %u\n", mode);
> +
> +	for (i = 0; i < n_vifs; i++) {
> +		hwsim_check_chanctx_magic(vifs[i].old_ctx);
> +		wiphy_dbg(hw->wiphy,
> +			  "switch vif channel context: %d MHz/width: %d/cfreqs:%d/%d MHz -> %d MHz/width: %d/cfreqs:%d/%d MHz\n",
> +			  vifs[i].old_ctx->def.chan->center_freq,
> +			  vifs[i].old_ctx->def.width,
> +			  vifs[i].old_ctx->def.center_freq1,
> +			  vifs[i].old_ctx->def.center_freq2,
> +			  vifs[i].new_ctx->def.chan->center_freq,
> +			  vifs[i].new_ctx->def.width,
> +			  vifs[i].new_ctx->def.center_freq1,
> +			  vifs[i].new_ctx->def.center_freq2);
> +		hwsim_set_chanctx_magic(vifs[i].new_ctx);


hwsim_set_chanctx_magic() is only partially correct, I think, this
depends on the mode? For CHANCTX_SWMODE_REASSIGN_VIF the chanctx should
already exist as well, so should also be hwsim_check_chanctx_magic() in
that case?

johannes






[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux