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

wifi: drivers: siwx91x: Add Wi-Fi version command support #87567

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

Conversation

ArunmaniAlagarsamy2710
Copy link
Contributor

Add support for the Wi-Fi version command to retrieve the Wi-Fi firmware and driver version information.

Comment on lines 732 to 735
fw_version.chip_id, fw_version.rom_id,
fw_version.major, fw_version.minor,
fw_version.security_version, fw_version.patch_num,
fw_version.customer_id, fw_version.build_num);
Copy link
Member

Choose a reason for hiding this comment

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

Alignment issue. They should be aligned to same column as fw_version_str.

{
sl_wifi_firmware_version_t fw_version = { 0 };
struct siwx91x_dev *sidev = dev->data;
static char fw_version_str[128];
Copy link
Member

Choose a reason for hiding this comment

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

This looks a bit excessive if we only print couple of ints. If we make this smaller, we could use a stack variable and save some memory.

Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, 32 bytes seems sufficient. However, I don't believe we can allocate it on the stack since params->fw_version is a char *.

@jukkar jukkar requested a review from jerome-pouiller March 24, 2025 15:05
@@ -20,7 +21,7 @@
#include "sl_wifi.h"
#include "sl_net.h"

#define SIWX91X_INTERFACE_MASK (0x03)
#define SIWX91X_DRIVER_VERSION "2025.6.0-alpha"
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe the version of this driver is actually "Zephyr 4.2". If you want to get the version of Wiseconnect SDK, you probably need to import a symbol from Wiseconnect.

@@ -709,6 +710,36 @@ static int siwx91x_stats(const struct device *dev, struct net_stats_wifi *stats)
}
#endif

static int siwx91x_wifi_version(const struct device *dev, struct wifi_version *params)
{
sl_wifi_firmware_version_t fw_version = { 0 };
Copy link
Contributor

Choose a reason for hiding this comment

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

you can write = { };

{
sl_wifi_firmware_version_t fw_version = { 0 };
struct siwx91x_dev *sidev = dev->data;
static char fw_version_str[128];
Copy link
Contributor

Choose a reason for hiding this comment

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

Indeed, 32 bytes seems sufficient. However, I don't believe we can allocate it on the stack since params->fw_version is a char *.

Add support for the Wi-Fi version command to retrieve
the Wi-Fi firmware and driver version information.

Signed-off-by: Arunmani Alagarsamy <arunmani.a@silabs.com>
@@ -20,7 +21,7 @@
#include "sl_wifi.h"
#include "sl_net.h"

#define SIWX91X_INTERFACE_MASK (0x03)
Copy link
Contributor

Choose a reason for hiding this comment

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

This symbol is not used anymore?

Choose a reason for hiding this comment

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

This definition is also present in nwp.h

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

Successfully merging this pull request may close these issues.

5 participants