Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tx_power check during eeprom loading #954

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yukariin
Copy link

@Yukariin Yukariin commented Feb 5, 2025

Hello.
As pointed out in openwrt/openwrt/issues/17489 - some BPI-R4-BE14 cards come with a stock firmware with no tx_power values for 2.4G and 5G bands. Which basically prevents using the 2/5G band as it defaults to 6dBm.
This PR adds a basic check in mt7996_eeprom_load that reads the power value from the first channel group for each band. If any of them is zero, it falls back to loading the default firmware from the disk.
It was confirmed working on both affected and unaffected devices in the main issue.

danpawlik added a commit to danpawlik/bpi-r4-mtk that referenced this pull request Feb 5, 2025
Let's add tx_power patch [1] to the builds.

[1] openwrt/mt76#954
@rmandrad
Copy link

rmandrad commented Feb 5, 2025

@nbd168 ?

@razvanphp
Copy link

Would this trick also work on MT7921?

@Headcrabed
Copy link

Such kind of patch should be sent to linux kernel mail list rather than here.

@Headcrabed
Copy link

Besides, when sending patches, please rebase your patch on this repo: https://github.com/nbd168/wireless

@Headcrabed
Copy link

Also I'm not sure if your patch is doing things right... I asked someone who is more knowledged about this, he said that the actual supported TX power caculation is not only depending on MT_EE_TX0_POWER_*G but also some other parameters...

@Headcrabed
Copy link

Headcrabed commented Feb 8, 2025

As far as I know, Sinovoip has delibrately limited TX power for 2.4/5ghz to 20dBm to follow Chinese legal constrictions in BE14 eeprom. And the constrictions are working correctly in BPI's mtwifi-based closed-source firmware.

@morrownr
Copy link

morrownr commented Feb 9, 2025

@razvanphp

see patchwork for wifi: mt76: fix returned txpower for mt7921 and mt7925

It is a series of patches that came in today.

@razvanphp
Copy link

haha, I know, I’m the Author of that patch series 🙂

@Headcrabed
Copy link

haha, I know, I’m the Author of that patch series 🙂

@razvanphp Bro your patch really needs line wrapping XD

@razvanphp
Copy link

@Headcrabed I've sent v2 which fixes the line wrapping and also added cleanup for MT7996 as you suggested. Thanks!

@morrownr
Copy link

@razvanphp

You will hate me for this but I just noticed:

You forgot to add the following below your Signed-off :

Cc: stable@vger.kernel.org

That keys those that do the backports to apply it to all currently maintained kernels and we could certainly use this being applied to 6.12 for mt7925 and 6.12 and 6.6 for mt7921.

@Headcrabed
Copy link

@razvanphp

You will hate me for this but I just noticed:

You forgot to add the following below your Signed-off :

Cc: stable@vger.kernel.org

That keys those that do the backports to apply it to all currently maintained kernels and we could certainly use this being applied to 6.12 for mt7925 and 6.12 and 6.6 for mt7921.

I think the CC could be added in reply?

@morrownr
Copy link

@Headcrabed

I've never had a problem doing it the way I am. I think there is some code that does something to make sure it gets to where it is going.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants