-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: API to check if an interface is Wi-Fi #58869
Conversation
dc25a25
to
9576ddd
Compare
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 really don't like putting custom fields into the API structs, no matter how convenient it is.
Would this be acceptable? I don't think we even need to rename the struct, as
|
Is this really different? IMO we should rather introduce some sort of |
So, another op similar to |
That's what I had in mind. Not sure though, if this should be covered in this PR? It doesn't seem to be strictly related to the original problem this PR is trying to solve (verify if an interface is a Wi-Fi interface). |
The problem with this is that we need to know if the interface is Wi-Fi before calling Well, whatever way we introduced WIFI_OFFLOAD support in this PR, it will be extended to WIFI_NATIVE and will be used in subsequent PR for wifi_mgmt native handling. |
To recap: (Had evaluated many options for this simple flag :) ) We need a way for drivers to tell type of Wi-Fi fundamentally (native, offloaded - default).
@rlubos WDYT about option#1? |
So let's try to keep it simple. Let's for a moment put aside We have 2 types of devices: native (using Ethernet L2) and offloaded (using offloaded_netdev):
is more complicated than:
Or even, if the maintainer has no problem with that, we could simply add a capability whether it's a Wi-Fi device, and use
That should be enough to tell whether any kind of interface is a Wi-Fi interface or not. And with this information, you can be confident that you work with |
This is fine with me,
I guess you are referring to add this to L2 API to get fetch underlying driver caps?
Ok.
Let me implement this, thanks for your inputs. |
Do we have devices that offload Networking stack but not Wi-Fi? This won't work then, we again need indication from the driver. |
Not sure I follow the question. What do you mean by "offload Networking stack but not Wi-Fi?"? |
I am referring to a hypothetical case where Wi-Fi stack is part of Zephry (Either wifi_mgmt or driver). Its a case of YAGNI, anyways I guess we can handle this easily but adding another enum. |
Wi-Fi is based on L2 Ethernet, so, all drivers are registered as Ethernet L2, but in order to distinguish true Ethernet and Wi-Fi devices, add a L2 type within Ethernet. Also, handle offloaded net devices that also offload Wi-Fi. This approach is better than adding a new Wi-Fi L2 as that would mean invasive changes which are unnecessary. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Identify the Wi-Fi capability to the networking stack and also the type of Wi-Fi (Native vs Offloaded), this helps identifying Wi-Fi interfaces that can be used by applications. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
The API should be defined independent of L2_PTP define, this fixes build error and also the doc error, as the next function will have two doxygen headers. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
Add a configuration option to set Wi-Fi as default interface and also add an API to get first available Wi-Fi interface. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
As this is Wi-Fi shell use only Wi-Fi interfaces, if none are found fail. Signed-off-by: Chaitanya Tata <Chaitanya.Tata@nordicsemi.no>
a9414dd
to
c2026b7
Compare
No description provided.