-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Conversation
43b38b3
to
2391922
Compare
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
@@ -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; |
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.
Use inverse Christmas tree order wherever possible
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
} 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); |
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.
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
e1f8a48
to
7c2a545
Compare
drivers/wifi/siwx91x/siwx91x_wifi.c
Outdated
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); |
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.
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]>
Please retry analysis of this Pull-Request directly on SonarQube Cloud |
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.