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

[Silabs] [EFR32] Adds translation between spec WiFi Security Types #25458

Conversation

rosahay-silabs
Copy link
Contributor

Fixes #25118

Encoding the enum provided by driver in scan result callback to CHIP spec based enum, decoding them back to driver based enum on the connect API.

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

PR #25458: Size comparison from af3fdc5 to 8f8544d

Full report (1 build for cc32xx)
platform target config section af3fdc5 8f8544d change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643465 643465 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930213 930213 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 300024 300024 0 0.0
.debug_info 20262928 20262928 0 0.0
.debug_line 2657820 2657820 0 0.0
.debug_loc 2800026 2800026 0 0.0
.debug_ranges 282240 282240 0 0.0
.debug_str 3023883 3023883 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105929 105929 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 378514 378514 0 0.0
.symtab 256560 256560 0 0.0
.text 535412 535412 0 0.0

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

PR #25458: Size comparison from af3fdc5 to f507bca

Full report (1 build for cc32xx)
platform target config section af3fdc5 f507bca change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643465 643465 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930213 930213 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 300024 300024 0 0.0
.debug_info 20262928 20262928 0 0.0
.debug_line 2657820 2657820 0 0.0
.debug_loc 2800026 2800026 0 0.0
.debug_ranges 282240 282240 0 0.0
.debug_str 3023883 3023883 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105929 105929 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 378514 378514 0 0.0
.symtab 256560 256560 0 0.0
.text 535412 535412 0 0.0

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

PR #25458: Size comparison from af3fdc5 to 060b49e

Decreases (1 build for cc32xx)
platform target config section af3fdc5 060b49e change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20262928 20262927 -1 -0.0
Full report (4 builds for cc32xx, mbed, qpg)
platform target config section af3fdc5 060b49e change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643465 643465 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930213 930213 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 300024 300024 0 0.0
.debug_info 20262928 20262927 -1 -0.0
.debug_line 2657820 2657820 0 0.0
.debug_loc 2800026 2800026 0 0.0
.debug_ranges 282240 282240 0 0.0
.debug_str 3023883 3023883 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105929 105929 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 378514 378514 0 0.0
.symtab 256560 256560 0 0.0
.text 535412 535412 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2467384 2467384 0 0.0
.bss 215804 215804 0 0.0
.data 5880 5880 0 0.0
.text 1430028 1430028 0 0.0
qpg lighting-app qpg6105+debug (read/write) 1151852 1151852 0 0.0
.bss 99812 99812 0 0.0
.data 852 852 0 0.0
.text 598948 598948 0 0.0
lock-app qpg6105+debug (read/write) 1118892 1118892 0 0.0
.bss 96292 96292 0 0.0
.data 864 864 0 0.0
.text 565992 565992 0 0.0

Copy link
Member

@jmartinez-silabs jmartinez-silabs left a comment

Choose a reason for hiding this comment

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

Wouldn't it be simpler to just do the conversion in a single location, in the WiFi Diagnostic function
DiagnosticDataProviderImpl::GetWiFiSecurityType ?

Converting your WFX or RSI security enums to the Matter WiFiNetworkDiagnostics::SecurityTypeEnum ?

@rosahay-silabs
Copy link
Contributor Author

Wouldn't it be simpler to just do the conversion in a single location, in the WiFi Diagnostic function DiagnosticDataProviderImpl::GetWiFiSecurityType ?

Converting your WFX or RSI security enums to the Matter WiFiNetworkDiagnostics::SecurityTypeEnum ?

Yes agreed, but that is something I want to pick up without blocking the spec. We have a task to clean up the code here, including the global variables and functions. Including and not limiting only this, it also includes a proper structure to save AP details which seems to be different for WF200 and RS9116, we can remove quite a few duplicate codes with a clean-up. I will also introduce guard style if statement instead of if-else littered everywhere.

@jmartinez-silabs
Copy link
Member

ok, I'll approve then so you can continue your clean up

@github-actions
Copy link

github-actions bot commented Mar 3, 2023

PR #25458: Size comparison from af3fdc5 to 9091af6

Full report (1 build for cc32xx)
platform target config section af3fdc5 9091af6 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643465 643465 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930213 930213 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 300024 300024 0 0.0
.debug_info 20262928 20262928 0 0.0
.debug_line 2657820 2657820 0 0.0
.debug_loc 2800026 2800026 0 0.0
.debug_ranges 282240 282240 0 0.0
.debug_str 3023883 3023883 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105929 105929 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 378514 378514 0 0.0
.symtab 256560 256560 0 0.0
.text 535412 535412 0 0.0

Copy link
Contributor

@jmeg-sfy jmeg-sfy left a comment

Choose a reason for hiding this comment

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

sound like a bit of factorization improvement is needed
unless you wish to copy/paste everything again when SiWx918 then SiWx920 comes up....

@brosahay
Copy link
Contributor

brosahay commented Mar 3, 2023

sound like a bit of factorization improvement is needed unless you wish to copy/paste everything again when SiWx918 then SiWx920 comes up....

Yes, agreed that we are replicating code for now, and a refactor effort is required. This was done to meet the spec requirement without changing the logic much, the refactor effort will be done in a phased manner since it requires quite a good amount of testing.

@rosahay-silabs rosahay-silabs force-pushed the bugfix/efr32-wifi-sec-type-spec branch from 9b0455d to edecd39 Compare March 6, 2023 04:30
@github-actions
Copy link

github-actions bot commented Mar 6, 2023

PR #25458: Size comparison from 32fb896 to edecd39

Increases (1 build for cc32xx)
platform target config section 32fb896 edecd39 change % change
cc32xx lock CC3235SF_LAUNCHXL .debug_info 20262927 20262929 2 0.0
Full report (2 builds for cc32xx, mbed)
platform target config section 32fb896 edecd39 change % change
cc32xx lock CC3235SF_LAUNCHXL 0 0 0 0.0
(read only) 643465 643465 0 0.0
(read/write) 203688 203688 0 0.0
.ARM.attributes 44 44 0 0.0
.ARM.exidx 8 8 0 0.0
.bss 197088 197088 0 0.0
.comment 194 194 0 0.0
.data 1480 1480 0 0.0
.debug_abbrev 930213 930213 0 0.0
.debug_aranges 87336 87336 0 0.0
.debug_frame 300024 300024 0 0.0
.debug_info 20262927 20262929 2 0.0
.debug_line 2657822 2657822 0 0.0
.debug_loc 2800026 2800026 0 0.0
.debug_ranges 282240 282240 0 0.0
.debug_str 3023883 3023883 0 0.0
.ramVecs 780 780 0 0.0
.resetVecs 64 64 0 0.0
.rodata 105929 105929 0 0.0
.shstrtab 232 232 0 0.0
.stab 204 204 0 0.0
.stabstr 441 441 0 0.0
.stack 2048 2048 0 0.0
.strtab 378514 378514 0 0.0
.symtab 256560 256560 0 0.0
.text 535412 535412 0 0.0
mbed lock-app CY8CPROTO_062_4343W+release (read only) 6224 6224 0 0.0
(read/write) 2467384 2467384 0 0.0
.bss 215804 215804 0 0.0
.data 5880 5880 0 0.0
.text 1430028 1430028 0 0.0

@jmartinez-silabs jmartinez-silabs enabled auto-merge (squash) March 6, 2023 13:04
@jmartinez-silabs jmartinez-silabs merged commit 7e7b7af into project-chip:master Mar 6, 2023
@rosahay-silabs rosahay-silabs deleted the bugfix/efr32-wifi-sec-type-spec branch March 6, 2023 17:27
@@ -149,28 +148,19 @@ typedef enum
/* Note that these are same as RSI_security */
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these in fact still the same as RSI_security?

But also, is there a reason this is not just using the spec-defined enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

now, they are not same as rsi_security, it was a comment which I plan to clean up during the cleanup activity.

@@ -274,7 +264,7 @@ typedef enum
typedef struct wfx_wifi_scan_result
{
char ssid[32 + 1];
uint8_t security;
wfx_sec_t security;
Copy link
Contributor

Choose a reason for hiding this comment

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

This does not look right. For a scan result, the security type is a bitmap, not an enum, in the spec. See "11.8.5.1. WiFiSecurityBitmap", which is not the same thing as the "11.14.5.1. SecurityTypeEnum" used by network diagnostics. It looks to me like the enums above match the latter, but not the scan result bitmap.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

I don't see how that can work. That ConvertSecuritytype function expects a bitmap as input (not the bit test it's doing) and converts to a different bitmap. But wfx_sec_t is not a bitmap....

lecndav pushed a commit to lecndav/connectedhomeip that referenced this pull request Mar 22, 2023
…roject-chip#25458)

* Adds fix for project-chip#25118

* Adds fix for unused-variable-warning

* Adds fix for rsi_wlan_connect_async invoke

* Adding break statements for default case.

* Update examples/platform/silabs/efr32/rs911x/rsi_if.c

Co-authored-by: Jonathan Mégevand <77852424+jmeg-sfy@users.noreply.github.com>

---------

Co-authored-by: Jonathan Mégevand <77852424+jmeg-sfy@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Platform][Silabs][WIFI] The possible SecurityTypes returned from GetWiFiSecurityType doesn't match the spec.
6 participants