-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
drivers: nrf: Added config option for OUI. #27283
Conversation
drivers/ieee802154/Kconfig.nrf5
Outdated
default 16043574 | ||
help | ||
Custom vendor OUI for OpenThread, | ||
which makes 24 oldest bits of MAC address |
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.
What does oldest
mean here, do you mean lowest
instead?
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.
Sorry I think I literally copied meaning from Polish language and I didn't realize that it's incomprehensive. I meant 24 most-significant bits and i fixed it.
Could you specify what changes exactly do you expect? I'm not sure if I understand correctly, but I have the impression that my change has quite different purpose, that the one mentioned by you. You suggested to call net_if_set_link_addr() method to set EUI64, what actually is done. My change lets user to define custom, vendor (e.g. Nordics) specific OUI address and to provide own method for generating EUI64, what might be useful in some cases. To sum up it doesn't change the way and the place of setting EUI64, but only the way of generating it in some specific situations. |
I think what @markus-becker-tridonic-com said is, we developed a standard way to proper set EUI64 for all devices and situations. Maybe we forget to cover something. Could you tell us what are the useful situations because it may be relevant to all drivers? |
@nandojve @markus-becker-tridonic-com As far as I understand the #25629 lets us configure the EUI before the interface is started but if I understand correctly it still has to be then started "manually" somewhere in the code so the user (in our understanding - product/device developer) has to modify existing code or add it to e.g. main thread. I believe that this PR has two "pros" compared to this such solution:
All in all I belive that these changes are not conflicting and CONFIG_IEEE802154_NET_IF_NO_AUTO_START might still be useful for developers. |
Ok, I understand you point, we did a generic weak method proposal at #24096, that could be extended to all 15.4 drivers and was not accepted that time. Now, we are revisiting exactly same thing here and this is what @markus-becker-tridonic-com raised. The "manually" was introduced as a solution to sync 15.4 initialization because driver can not proper set EUI without a weak method. My point is, we need follow same approach between all drivers to be consistent. Today, 15.4 drivers can only set EUI from a external source using management interface because weak methods are not allowed. I saw two paths here: 1- keep EUI from external source only by management interface; 2- introduce EUI from external source using a generic weak function as an second option. This second option must be an standard for, at least, 15.4 drivers and should be available at API header because others will need it too for the same reasons. I'll add DNM till we define the right path here, since we have more than 2 green lights. |
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.
My point is, we need follow same approach between all drivers to be consistent. Today, 15.4 drivers can only set EUI from a external source using management interface because weak methods are not allowed.
I agree, it would be better if the drivers are working in the same way. What this way is, we can debate about that. Withdrawing my +1
@nandojve @markus-becker-tridonic-com @konradderda @jukkar I have a proposition then. I will remove this EUI64 custom source changes for now, as you find it controversial and I would like to push only OUI change, which is directed to specific (nrf) radio driver. We will also create corresponding issue with the proposition of problem solution and we will tag you to discuss it soon. Do you accept such approach? |
8106e5c
to
26a073e
Compare
drivers/ieee802154/Kconfig.nrf5
Outdated
@@ -42,4 +42,12 @@ config IEEE802154_NRF5_EXT_IRQ_MGMT | |||
the system. One example of external radio IRQ provider could be | |||
a radio arbiter used in dynamic multiprotocol applications. | |||
|
|||
config IEEE802154_NRF5_VENDOR_OUI |
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.
Is this be valid for other drivers? If yes, it could be added as IEEE802154_VENDOR_OUI at Kconfig instead Kconfig.nrf5.
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 can move it, as you suggest, to general drivers Kconfig and not assign default value to it. Thanks to this it will be possible to check in specific driver files if value was set by someone and that value should be used or it wasn't and for example some default, driver defined value can be set. Do you find it being useful for other drivers? Main use case is to have some constant value, specific for given driver and use it in most cases, but also to not close the doors for some vendors and users, which might want to set own value. I think that such approach doesn't give much benefit, as with generalization of this config, each driver will have to define own default value anyway. Finding the best default value for all drivers is not possible, as this value defines specific vendor and it can't be general. Please consider also that setting OUI at the configuration level might be valid for some other drivers, but not necessarily for all, as some chips have their addresses set in the factory and it's not possible to change them. I understand your statement that all drivers should work in the same way, so please verify if described solution would be better in your opinion.
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.
If there is no objection, I do prefer define IEEE802154_VENDOR_OUI at Kconfig. As far I understand, you can silent define your own default OUI at Kconfig.nrf5, for instance, since symbol now in 15.4 scope. User always have the possibility to override Kconfig symbols.
I'm not sure if checking !defined(IEEE802154_VENDOR_OUI) is the best approach. Because if in the future we define a default value the logic will be broken. Maybe ignore vendor OUI if value is Zero could be more reliable. Remember that you can override OUI at any place. Because of that I think is better to define a default value.
drivers/ieee802154/Kconfig.nrf5
Outdated
@@ -42,4 +42,12 @@ config IEEE802154_NRF5_EXT_IRQ_MGMT | |||
the system. One example of external radio IRQ provider could be | |||
a radio arbiter used in dynamic multiprotocol applications. | |||
|
|||
config IEEE802154_NRF5_VENDOR_OUI | |||
int "Vendor Organizationally Unique Identifier" | |||
default 16043574 |
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.
Then, this could be Zephyr Project OUI, if we had one, otherwise networking folks can suggest better value. I'm thinking to use same approach from USB_DEVICE_VID, for instance.
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 answered on this in above comment
Sure, please, make it and let's fix this. |
drivers/ieee802154/ieee802154_nrf5.c
Outdated
#if CONFIG_IEEE802154_VENDOR_OUI | ||
#define IEEE802154_NRF5_VENDOR_OUI CONFIG_IEEE802154_VENDOR_OUI | ||
#else | ||
#define IEEE802154_NRF5_VENDOR_OUI (uint32_t)0xF4CE36 | ||
#endif |
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.
Not a block
You can define at Kconfig.nrf the default value, since its 15.4 global scope
config IEEE802154_VENDOR_OUI
default 0xF4CE36
When you want to change it, add below at app.conf file, for instance.
CONFIG_IEEE802154_VENDOR_OUI=XXXX
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 that it's ok to keep this value in the driver's sources since it's a constant. With the solution proposed above (IEEE802154_VENDOR_OUI is a boolean) we can easily determine if this option is used or not.
drivers/ieee802154/Kconfig
Outdated
int "Vendor Organizationally Unique Identifier" | ||
default 0 | ||
help | ||
Custom vendor OUI for OpenThread, |
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.
Can we stop referring to OpenThread? It's generic 802.15.4 driver configuration.
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.
Sure I forget to change it moving from somewhere else. Good point, done.
drivers/ieee802154/Kconfig
Outdated
@@ -39,6 +39,13 @@ config IEEE802154_RDEV | |||
help | |||
PHY is a ranging-capable device (RDEV) | |||
|
|||
config IEEE802154_VENDOR_OUI | |||
int "Vendor Organizationally Unique Identifier" | |||
default 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.
We cannot use any default value here. I would rather change this to boolean and add another one like IEEE802154_VENDOR_OUI_VALUE without default value to ensure that user will have to fill this option when IEEE802154_VENDOR_OUI is enabled.
drivers/ieee802154/ieee802154_nrf5.c
Outdated
#if CONFIG_IEEE802154_VENDOR_OUI | ||
#define IEEE802154_NRF5_VENDOR_OUI CONFIG_IEEE802154_VENDOR_OUI | ||
#else | ||
#define IEEE802154_NRF5_VENDOR_OUI (uint32_t)0xF4CE36 | ||
#endif |
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 that it's ok to keep this value in the driver's sources since it's a constant. With the solution proposed above (IEEE802154_VENDOR_OUI is a boolean) we can easily determine if this option is used or not.
To sum up, as there was a lot of discussions about OUI approach:
|
Support for defining vendor specific OUI (Organizationally Unique Identifier) was added. Signed-off-by: Kamil Kasperczyk <kamil.kasperczyk@nordicsemi.no>
Support for defining vendor specific OUI (Organizationally
Unique Identifier) was added.
Signed-off-by: Kamil Kasperczyk kamil.kasperczyk@nordicsemi.no