-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
base: main
Are you sure you want to change the base?
wifi: drivers: siwx91x: Add Wi-Fi version command support #87567
Conversation
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
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); |
There was a problem hiding this comment.
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
.
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
{ | ||
sl_wifi_firmware_version_t fw_version = { 0 }; | ||
struct siwx91x_dev *sidev = dev->data; | ||
static char fw_version_str[128]; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 *
.
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
@@ -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" |
There was a problem hiding this comment.
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.
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
@@ -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 }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can write = { };
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
{ | ||
sl_wifi_firmware_version_t fw_version = { 0 }; | ||
struct siwx91x_dev *sidev = dev->data; | ||
static char fw_version_str[128]; |
There was a problem hiding this comment.
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>
d453a14
to
f533734
Compare
@@ -20,7 +21,7 @@ | |||
#include "sl_wifi.h" | |||
#include "sl_net.h" | |||
|
|||
#define SIWX91X_INTERFACE_MASK (0x03) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
Add support for the Wi-Fi version command to retrieve the Wi-Fi firmware and driver version information.