Search Linux Wireless

Re: [PATCH] wifi: mac80211: remove DEAUTH_NEED_MGD_TX_PREP

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

 



Hi,

On Thu, 27 Jun 2024 at 10:40, Johannes Berg <johannes@xxxxxxxxxxxxxxxx> wrote:
>
> From: Johannes Berg <johannes.berg@xxxxxxxxx>
>
> This flag is annoying because it puts a lot of logic into mac80211
> that could just as well be in the driver (only iwlmvm uses it) and
> the implementation is also broken for MLO.
>
> Remove the flag in favour of calling drv_mgd_prepare_tx() without
> any conditions even for the deauth-while-assoc case. The drivers
> that implement it can take the appropriate actions, which for the
> only user of DEAUTH_NEED_MGD_TX_PREP (iwlmvm) is a bit more tricky
> than the implementation in mac80211 is anyway, and all others have
> no need and can just exit if info->was_assoc is set.
>
> Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@xxxxxxxxx>
> Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
> ---
>  .../net/wireless/intel/iwlwifi/mvm/mac80211.c | 12 ++++----
>  .../wireless/intel/iwlwifi/mvm/mld-mac80211.c |  2 ++
>  drivers/net/wireless/intel/iwlwifi/mvm/mvm.h  |  4 +++
>  .../wireless/intel/iwlwifi/mvm/time-event.c   |  2 ++
>  include/net/mac80211.h                        | 22 ++++-----------
>  net/mac80211/debugfs.c                        |  1 -
>  net/mac80211/main.c                           |  3 --
>  net/mac80211/mlme.c                           | 28 ++++---------------
>  8 files changed, 25 insertions(+), 49 deletions(-)
>

(snip)

> diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
> index 3d207d79d11f..3804a5fa4a2a 100644
> --- a/net/mac80211/mlme.c
> +++ b/net/mac80211/mlme.c
> @@ -3521,6 +3521,10 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
>         u64 changed = 0;
>         struct ieee80211_prep_tx_info info = {
>                 .subtype = stype,
> +               .was_assoc = true,
> +               .link_id = sdata->vif.active_links ?
> +                               __ffs(sdata->vif.active_links) :
> +                               0,

Shouldn't the else be -1?

>         };
>
>         lockdep_assert_wiphy(local->hw.wiphy);
> @@ -3569,29 +3573,7 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
>
>         /* deauthenticate/disassociate now */
>         if (tx || frame_buf) {
> -               /*
> -                * In multi channel scenarios guarantee that the virtual
> -                * interface is granted immediate airtime to transmit the
> -                * deauthentication frame by calling mgd_prepare_tx, if the
> -                * driver requested so.
> -                */
> -               if (ieee80211_hw_check(&local->hw, DEAUTH_NEED_MGD_TX_PREP)) {
> -                       for (link_id = 0; link_id < ARRAY_SIZE(sdata->link);
> -                            link_id++) {
> -                               struct ieee80211_link_data *link;
> -
> -                               link = sdata_dereference(sdata->link[link_id],
> -                                                        sdata);
> -                               if (!link)
> -                                       continue;
> -                               if (link->u.mgd.have_beacon)
> -                                       break;
> -                       }
> -                       if (link_id == IEEE80211_MLD_MAX_NUM_LINKS) {
> -                               info.link_id = ffs(sdata->vif.active_links) - 1;

Here it would be ffs(0) - 1, which is -1, not 0.

Regards,
Jonas




[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