Skip to content

drivers: wifi: siwx91x: Handling data packets for AP mode #90860

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

Merged
merged 1 commit into from
Jun 4, 2025

Conversation

ragurram26
Copy link
Contributor

In the raw data send API, the interface was hardcoded for client mode. Now, we determine the opermode and pass the appropriate interface to the raw data API based on the current opermode.

@@ -1336,6 +1336,8 @@ static int siwx91x_send(const struct device *dev, struct net_pkt *pkt)
size_t pkt_len = net_pkt_get_len(pkt);
struct net_buf *buf = NULL;
int ret;
sl_wifi_operation_mode_t opermode;
sl_wifi_interface_t interface = SL_WIFI_CLIENT_INTERFACE;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use inverse Christmas tree order wherever possible

} else if (opermode == SL_SI91X_ACCESS_POINT_MODE) {
interface = SL_WIFI_AP_INTERFACE;
}
ret = sl_wifi_send_raw_data_frame(interface, buf->data, pkt_len);
Copy link
Collaborator

Choose a reason for hiding this comment

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

sl_wifi_interface_t interface = sl_wifi_get_default_interface(); sl_wifi_send_raw_data_frame(FIELD_GET(SIWX91X_INTERFACE_MASK, interface), buf->data, pkt_len);

I suggest using this approach to maintain consistency in interface handling

@ragurram26 ragurram26 force-pushed the ap_mode_data branch 3 times, most recently from e1f8a48 to 7c2a545 Compare June 3, 2025 04:45
asmellby
asmellby previously approved these changes Jun 4, 2025
jerome-pouiller
jerome-pouiller previously approved these changes Jun 4, 2025
ret = sl_wifi_send_raw_data_frame(SL_WIFI_CLIENT_INTERFACE, buf->data, pkt_len);
interface = sl_wifi_get_default_interface();
ret = sl_wifi_send_raw_data_frame(
FIELD_GET(SIWX91X_INTERFACE_MASK, interface), buf->data, pkt_len);
Copy link
Collaborator

@jerome-pouiller jerome-pouiller Jun 4, 2025

Choose a reason for hiding this comment

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

Nitpick: the prefered place to split a line is between the arguments:

	ret = sl_wifi_send_raw_data_frame(FIELD_GET(SIWX91X_INTERFACE_MASK, interface),
 					  buf->data, pkt_len);

In the raw data send API, the interface was hardcoded
for client mode. Now, we determine the opermode and
pass the appropriate interface to the raw data API
based on the current opermode.

Signed-off-by: Rahul Gurram <[email protected]>
Copy link

sonarqubecloud bot commented Jun 4, 2025

Please retry analysis of this Pull-Request directly on SonarQube Cloud

@jerome-pouiller jerome-pouiller requested a review from asmellby June 4, 2025 14:56
@nashif nashif merged commit 9781a35 into zephyrproject-rtos:main Jun 4, 2025
27 checks passed
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.

6 participants