Search Linux Wireless

Re: [PATCH v2 2/6] wifi: mt76: mt7925: fix the wrong link_idx when has p2p_device

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

 



On Sat, 2025-01-18 at 10:57 +0100, Felix Fietkau wrote:
> 
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> On 14.01.25 03:07, sean.wang@xxxxxxxxxx wrote:
> > From: Ming Yen Hsieh <mingyen.hsieh@xxxxxxxxxxxx>
> > 
> > When the p2p device and MLO station concurrent, the p2p device
> > will occupy the wrong link_idx when the MLO secondary link is
> > added.
> > 
> > Fixes: e38a82d25b08 ("wifi: mt76: connac: Extend
> > mt76_connac_mcu_uni_add_dev for MLO")
> > Signed-off-by: Ming Yen Hsieh <mingyen.hsieh@xxxxxxxxxxxx>
> > Signed-off-by: Sean Wang <sean.wang@xxxxxxxxxxxx>
> > ---
> > v2: generate the patch based on the latest mt76 tree
> > ---
> >   drivers/net/wireless/mediatek/mt76/mt76.h          |  1 +
> >   .../net/wireless/mediatek/mt76/mt76_connac_mcu.c   |  4 ++--
> >   drivers/net/wireless/mediatek/mt76/mt7925/main.c   | 14
> > ++++++++++----
> >   3 files changed, 13 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
> > b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
> > index 2082e3904d76..502b76a40ca8 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7925/main.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7925/main.c
> > @@ -371,6 +376,7 @@ static int mt7925_mac_link_bss_add(struct
> > mt792x_dev *dev,
> >       mconf->mt76.band_idx = 0xff;
> >       mconf->mt76.wmm_idx = ieee80211_vif_is_mld(vif) ?
> >                             0 : mconf->mt76.idx %
> > MT76_CONNAC_MAX_WMM_SETS;
> > +     mconf->mt76.link_idx = hweight16(mvif->valid_links);
> > 
> >       if (mvif->phy->mt76->chandef.chan->band != NL80211_BAND_2GHZ)
> >               mconf->mt76.basic_rates_idx = MT792x_BASIC_RATES_TBL
> > + 4;
> 
> Why are you using hweight16 for the link idx? That doesn't make much
> sense to me. Shouldn't the actual link id be passed here, or is that
> index used in some other way?
> 
> - Felix

Hi Felix,

The link_idx tells firmware which link index this is for the MLD, and
it different from link_id. Therefore, each time a link is added,
regardless of link_id, link_idx needs to be incremented by 1.

- Yen






[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