Hi Lorenzo, On Thu, Aug 18, 2022 at 12:39 AM Lorenzo Bianconi <lorenzo@xxxxxxxxxx> wrote: > > > Hi Lorenzo, > > > > On Wed, Aug 17, 2022 at 12:18 AM Lorenzo Bianconi <lorenzo@xxxxxxxxxx> wrote: > > > > > > > From: Sean Wang <sean.wang@xxxxxxxxxxxx> > > > > > > > > Introduce remain_on_channel support. Additionally, we add > > > > mt7921_check_offload_capability to disable .remain_on_channel and > > > > .cancel_remain_on_channel and related configuration because those > > > > operations would rely on the fundamental MCU commands that will be only > > > > supported with newer firmware. > > > > > > > > Co-developed-by: Deren Wu <deren.wu@xxxxxxxxxxxx> > > > > Signed-off-by: Deren Wu <deren.wu@xxxxxxxxxxxx> > > > > Signed-off-by: Sean Wang <sean.wang@xxxxxxxxxxxx> > > > > --- > > > > .../net/wireless/mediatek/mt76/mt7921/init.c | 36 ++++++ > > > > .../net/wireless/mediatek/mt76/mt7921/main.c | 112 ++++++++++++++++++ > > > > .../net/wireless/mediatek/mt76/mt7921/mcu.c | 24 ++++ > > > > .../wireless/mediatek/mt76/mt7921/mt7921.h | 34 ++++++ > > > > .../net/wireless/mediatek/mt76/mt7921/pci.c | 13 +- > > > > .../net/wireless/mediatek/mt76/mt7921/sdio.c | 11 +- > > > > .../net/wireless/mediatek/mt76/mt7921/usb.c | 1 + > > > > 7 files changed, 225 insertions(+), 6 deletions(-) > > > > > > > > diff --git a/drivers/net/wireless/mediatek/mt76/mt7921/init.c b/drivers/net/wireless/mediatek/mt76/mt7921/init.c > > > > index cd960e23770f..1b7a18d42f5b 100644 > > > > --- a/drivers/net/wireless/mediatek/mt76/mt7921/init.c > > > > +++ b/drivers/net/wireless/mediatek/mt76/mt7921/init.c > > > > @@ -44,6 +44,35 @@ mt7921_regd_notifier(struct wiphy *wiphy, > > > > mt7921_mutex_release(dev); > > > > } > > > > > > > > +static int mt7921_check_offload_capability(struct mt7921_dev *dev) > > > > +{ > > > > + struct ieee80211_hw *hw = mt76_hw(dev); > > > > + int year, mon, day, hour, min, sec; > > > > + struct wiphy *wiphy = hw->wiphy; > > > > + bool fw_can_roc = false; > > > > + int ret; > > > > + > > > > + ret = sscanf(dev->mt76.hw->wiphy->fw_version + 11, "%4d%2d%2d%2d%2d%2d", > > > > + &year, &mon, &day, &hour, &min, &sec); > > > > > > does the fw have a differnt base version with respect to the previous ones? > > > checking the date is a bit ugly. > > > > I admitted that way was a bit ugly, but I have investigated for a > > while, and that is the only way we can use to distinguish the version > > in current mt7921 firmware. > > the fw seems pretty new (2022/7/15), is it already available in linux-firmware > git tree? If not I guess you can increment fw version in a more evident way. > For the future please remember to do it for major fw changes. The new FW is not released in linux-firmware. I will try to figure out a better way to recognize the FW can support the feature and add it in v2. Sean > > > > > > <snip>