2021-02-23 08:45:45

by Ryder Lee

[permalink] [raw]
Subject: [PATCH 2/2] mt76: mt7615: remove hdr->fw_ver check

Only mt7615 uses v1 version. Also, some of released firmware doesn't
have hdr->fw_ver.

Signed-off-by: Ryder Lee <[email protected]>
---
drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
index 393ce09d3956..65c6ab14fe6f 100644
--- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
+++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
@@ -1449,8 +1449,7 @@ static int mt7615_load_n9(struct mt7615_dev *dev, const char *name)
sizeof(dev->mt76.hw->wiphy->fw_version),
"%.10s-%.15s", hdr->fw_ver, hdr->build_date);

- if (!is_mt7615(&dev->mt76) &&
- !strncmp(hdr->fw_ver, "2.0", sizeof(hdr->fw_ver))) {
+ if (!is_mt7615(&dev->mt76)) {
dev->fw_ver = MT7615_FIRMWARE_V2;
dev->mcu_ops = &sta_update_ops;
} else {
--
2.18.0


2021-02-23 09:33:37

by Lorenzo Bianconi

[permalink] [raw]
Subject: Re: [PATCH 2/2] mt76: mt7615: remove hdr->fw_ver check

> Only mt7615 uses v1 version. Also, some of released firmware doesn't
> have hdr->fw_ver.
>
> Signed-off-by: Ryder Lee <[email protected]>
> ---
> drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> index 393ce09d3956..65c6ab14fe6f 100644
> --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> @@ -1449,8 +1449,7 @@ static int mt7615_load_n9(struct mt7615_dev *dev, const char *name)
> sizeof(dev->mt76.hw->wiphy->fw_version),
> "%.10s-%.15s", hdr->fw_ver, hdr->build_date);
>
> - if (!is_mt7615(&dev->mt76) &&
> - !strncmp(hdr->fw_ver, "2.0", sizeof(hdr->fw_ver))) {
> + if (!is_mt7615(&dev->mt76)) {
> dev->fw_ver = MT7615_FIRMWARE_V2;
> dev->mcu_ops = &sta_update_ops;
> } else {

so there are some v2 fw version w/o fw_ver field, correct? Is this fw in
linux-firmware?

Regards,
Lorenzo

> --
> 2.18.0
>


Attachments:
(No filename) (1.08 kB)
signature.asc (235.00 B)
Download all attachments

2021-02-23 14:43:52

by Ryder Lee

[permalink] [raw]
Subject: Re: [PATCH 2/2] mt76: mt7615: remove hdr->fw_ver check

On Tue, 2021-02-23 at 10:12 +0100, Lorenzo Bianconi wrote:
> > Only mt7615 uses v1 version. Also, some of released firmware doesn't
> > have hdr->fw_ver.
> >
> > Signed-off-by: Ryder Lee <[email protected]>
> > ---
> > drivers/net/wireless/mediatek/mt76/mt7615/mcu.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> > index 393ce09d3956..65c6ab14fe6f 100644
> > --- a/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> > +++ b/drivers/net/wireless/mediatek/mt76/mt7615/mcu.c
> > @@ -1449,8 +1449,7 @@ static int mt7615_load_n9(struct mt7615_dev *dev, const char *name)
> > sizeof(dev->mt76.hw->wiphy->fw_version),
> > "%.10s-%.15s", hdr->fw_ver, hdr->build_date);
> >
> > - if (!is_mt7615(&dev->mt76) &&
> > - !strncmp(hdr->fw_ver, "2.0", sizeof(hdr->fw_ver))) {
> > + if (!is_mt7615(&dev->mt76)) {
> > dev->fw_ver = MT7615_FIRMWARE_V2;
> > dev->mcu_ops = &sta_update_ops;
> > } else {
>
> so there are some v2 fw version w/o fw_ver field, correct? Is this fw in
> linux-firmware?
>
I will post it.

Actually all MTK stock firmwares don't include that version info, so
considering users may use binaries from some manufactures. I think this
can make life more easier. This patch should work for all firmwares we
can find everywhere. Even 7615 v2 can be backward compatible to v1.

Ryder