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 support for WiFi7 802.11be modes #7271

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

Conversation

lakdif
Copy link

@lakdif lakdif commented Sep 8, 2024

80/160/240/320Mhz - EHT80,EHT160,EHT240,EHT320
Hostapd must be updated as well to provide those values

  • This PR is not from my main or master branch 💩, but a separate branch ✅
  • Each commit has a valid ✒️ Signed-off-by: <[email protected]> row (via git commit --signoff)
  • Each commit and PR title has a valid 📝 <package name>: title first line subject for packages
  • Incremented 🆙 any PKG_VERSION in the Makefile
  • Tested on: (architecture, openwrt version, browser) ✅
  • ( Preferred ) Mention: @ the original code author for feedback
  • ( Preferred ) Screenshot or mp4 of changes:
  • ( Optional ) Closes: e.g. openwrt/luci#issue-number
  • ( Optional ) Depends on: e.g. openwrt/packages#pr-number in sister repo
  • Description: (describe the changes proposed in this PR)

80/160/240/320Mhz - EHT80,EHT160,EHT240,EHT320
Hostapd must be updated as well to provide those values

Signed-off-by: lakdif <[email protected]>
@lakdif lakdif marked this pull request as draft September 8, 2024 08:57
@hnyman
Copy link
Contributor

hnyman commented Sep 8, 2024

Have you tested this?
(as it seems to have syntax errors, missing commas, I doubt that you have...)

@@ -362,6 +363,12 @@ var CBIWifiFrequencyValue = form.Value.extend({
'HE80', '80 MHz', htmodelist.HE80,
'HE160', '160 MHz', htmodelist.HE160
]
'be': [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a comma missing before this line?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added a new line after HE160 modes, where should be a missing comma?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After "]" on the previous line.
...like with all the other list elements.

@@ -382,6 +389,12 @@ var CBIWifiFrequencyValue = form.Value.extend({
'5g', '5 GHz', this.channels['5g'].length > 3,
'6g', '6 GHz', this.channels['6g'].length > 3
]
'be': [
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a comma missing before this line?

@lakdif
Copy link
Author

lakdif commented Sep 9, 2024

I don't have a 802.11be device to test it, so maybe, you as a someone who knows the syntax, and hostapd,
maybe I miss a comma here and then. This is why I submit it as draft.
I don't want any credit for that, actually it will be totally ok if you make this PR properly under your name.
Thanks.

@rmandrad
Copy link

rmandrad commented Sep 12, 2024

so I tested this as I have a wifi7 device (banana pi4 be14) ...

this is a snippet of my board.json

                "phy2": {
                        "path": "soc/11300000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0+2",
                        "info": {
                                "antenna_rx": 7,
                                "antenna_tx": 7,
                                "bands": {
                                        "6G": {
                                                "he": true,
                                                "eht": true,
                                                "max_width": 320,
                                                "modes": [
                                                        "NOHT",
                                                        "HE20",
                                                        "EHT20",
                                                        "HE80",
                                                        "EHT80",
                                                        "HE160",
                                                        "EHT160",
                                                        "EHT320"
                                                ],
                                                "default_channel": 1

this is what luci is showing
image

@rmandrad
Copy link

it doesn't work I found a few more typos

also modules/luci-base/root/usr/share/rpcd/ucode/luci & modules/luci-base/htdocs/luci-static/resources/network.js will need to change and I guess also iwinfo

@rmandrad
Copy link

rmandrad commented Sep 12, 2024

--- a/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
+++ b/modules/luci-mod-network/htdocs/luci-static/resources/view/network/wireless.js
@@ -338,7 +338,8 @@ var CBIWifiFrequencyValue = form.Value.extend({
                                '', 'Legacy', hwmodelist.a || hwmodelist.b || hwmodelist.g,
                                'n', 'N', hwmodelist.n,
                                'ac', 'AC', L.hasSystemFeature('hostapd', '11ac') && hwmodelist.ac,
-                               'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax
+                               'ax', 'AX', L.hasSystemFeature('hostapd', '11ax') && hwmodelist.ax,
+                               'be', 'BE', L.hasSystemFeature('hostapd', '11be') && hwmodelist.be
                        ];
 
                        var htmodelist = L.toArray(data[0] ? data[0].getHTModes() : null)
@@ -361,7 +362,13 @@ var CBIWifiFrequencyValue = form.Value.extend({
                                        'HE40', '40 MHz', htmodelist.HE40,
                                        'HE80', '80 MHz', htmodelist.HE80,
                                        'HE160', '160 MHz', htmodelist.HE160
-                               ]
+                               ],
+                               'be': [
+                                       'EHT80', '80 MHz', htmodelist.EHT80,
+                                       'EHT160', '160 MHz', htmodelist.EHT160,
+                                       'EHT240', '240 MHz', htmodelist.EHT240,
+                                       'EHT320', '320 MHz', htmodelist.EHT320
+                ]
                        };
 
                        this.bands = {

--- a/modules/luci-base/root/usr/share/rpcd/ucode/luci
+++ b/modules/luci-base/root/usr/share/rpcd/ucode/luci
@@ -208,7 +208,7 @@ const methods = {
                                relayd:     access('/usr/sbin/relayd') == true,
                        };
 
-                       const wifi_features = [ 'eap', '11ac', '11ax', '11r', 'acs', 'sae', 'owe', 'suiteb192', 'wep', 'wps', 'ocv' ];
+                       const wifi_features = [ 'eap', '11ac', '11ax', '11be', '11r', 'acs', 'sae', 'owe', 'suiteb192', 'wep', 'wps', 'ocv' ];
 
                        if (access('/usr/sbin/hostapd')) {
                                result.hostapd = { cli: access('/usr/sbin/hostapd_cli') == true };


--- a/modules/luci-base/htdocs/luci-static/resources/network.js
+++ b/modules/luci-base/htdocs/luci-static/resources/network.js
@@ -3374,7 +3374,7 @@ WifiDevice = baseclass.extend(/** @lends LuCI.network.WifiDevice.prototype */ {
         */
        getHWModes: function() {
                var hwmodes = this.ubus('dev', 'iwinfo', 'hwmodes');
-               return Array.isArray(hwmodes) ? hwmodes : [ 'b', 'g' ];
+               return Array.isArray(hwmodes) ? hwmodes : [ 'b', 'g', 'a' ];
        },
 
        /**

@lakdif
Copy link
Author

lakdif commented Sep 12, 2024

Please add more fixes, this was so alpha, I want to work with all of you to port it to LuCI.
Obviously there are many modes from hostapd we need to "teach" LuCI to handle.
@hnyman sorry to provide such a patch, but it wasn't a complete one, it's just PoC.
I hope you can prioritize it and review it, so at least LuCI will be ready for 802.11be.

@rmandrad
Copy link

rmandrad commented Sep 12, 2024

i closed my pull - #7277

you can check to fix your code

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.

3 participants