-
Notifications
You must be signed in to change notification settings - Fork 2k
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
netdev: introduce additional flags #3632
Conversation
A first use of these flags is introduced to indicate the interface as being wireless which might be a useful information for upper layers.
I'm not happy to introduce an additional field in |
Do you need this for something right now? I'd rather integrate this into netdev2. |
It's needed for a new version of #3622, i.e. doing NDP properly for wireless medium, |
I'd prefer to stay with netopt to keep the interface clean. |
And the change itself is (as you can see) super small. So, integrating this in netdev2 should be easy. |
IMO using netopt is completely overkill here. |
@OlegHahm agreed, the change is small, so I don't mind. |
(And it would be a misuse, since being wireless is not an option or anything configurable.) |
I'm still somewhat confused about why we need that however. WiFi is on IP level not seen as wireless and the rest of the radios we aim to support use 6LoWPAN. 6LoWPAN uses its own ND (which is not merged yet) so why do we need it for #3622 |
Why not? |
@OlegHahm because it does magic to behave like a wire. |
Then how do you get the information to the upper layer, when not using netopt? netapi has no other means to carry information to other layers. |
But in reality it does not behave like Ethernet and RFC5889 applies (actually, I guess that it has been written with specifically 802.11 in mind). |
Will introduce this in a follow-up PR as an additional flag in netif. |
Oops, forgot to commit |
Hm, actually turned out to be more complicated since getting static information from the interface seems to be not foreseen in the stack... |
Yes, that's what I mean't. We really need to think if we make such exceptions to the API because it is 'overkill'. IMHO your flag solution is the right way to store the information on the device (I would however use the device's private flags and not introduce a new field to netdev). But we should use netopt regardless to get the information to the upper layer. |
Otherwise, we get quickly into situations we had in the old stack, where every layer does it's own thing and nobody has any clue how to fix stuff. |
(Because it is overkill to have a netopt for every flag, I argued month ago to have a NETOPT_FLAGS value for that and add the operations add/remove to the interfaces, when the interface was still in development, but that was voted down, so I guess we have to live with this situation now). |
I partly agree, but I'm still reluctant to go through netopt only to retrieve static information from the device. |
We do it for the frame length too. So the harm is already done ;-P |
Oh I was mistaken, you don't need to store it dev internally if you go over netopt. You can just return |
@@ -40,6 +40,11 @@ extern "C" { | |||
#define NG_NETDEV_MSG_TYPE_EVENT (0x0100) | |||
|
|||
/** | |||
* @brief Flag for indicating a wireless network 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.
Could you also use @name
with an appropriate description and wrap the #define
in @{ .. @}
?
I support @authmillenon on this, it should be done using netapi. The interface wont most probably not change so this shouldn't get fetched too often. Anyway, the flag is not set for the xbee driver. |
Ok, I try to come up with a better approach - in the worst case misusing netopt. |
A first use of these flags is introduced to indicate the interface as being wireless which might be a useful information for upper layers.