-
Notifications
You must be signed in to change notification settings - Fork 198
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
Simplify configuration #333
Conversation
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.
Great work, this really simplifies the usage of the library.
Just a few trivial comments.
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.
For strings in configuration, I think it would be more user-friendly to let them be pointers instead of arrays (i.e. const char*
instead of char[N
]).
include/pnet_api.h
Outdated
char port_name[PNET_PORT_NAME_MAX_SIZE]; /**< Terminated string */ | ||
uint16_t rtclass_2_status; | ||
uint16_t rtclass_3_status; | ||
pnet_netif_name_t port_netif; |
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.
pnet_netif_name_t port_netif; | |
const char * network_interface_name; |
(Assuming that pnet_cfg_t is no longer stored in pnet_t.)
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.
Remove pnet_cfg_t from pnet_t is out of the scope for this task. I will use name "netif_name".
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.
Beware that the copy of pnet_cfg_t in pnet_t will be a shallow copy, unless the strings are also copied.
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.
Add this to src/device/pf_port.c:
#if PNET_MAX_SUBSLOTS < (2 + PNET_NUMBER_OF_PHYSICAL_PORTS)
#error "DAP requires 2 + PNET_NUMBER_OF_PHYSICAL_PORTS subslots. Increase PNET_MAX_SUBSLOTS."
#endif
b7d6ebf
to
f8f567e
Compare
Comments handled, rebased on master. @pyhys I think you need to re-review updaes |
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.
Great!
f8f567e
to
1177f53
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.
Reviewed pnet_api.h and pf_types.h
Moved initialization of mac addresses and lldp port name to stack.
1177f53
to
c18e847
Compare
c18e847
to
a58e9dd
Compare
Removed occurrence of PNET_MAX_PORT that emerged due to rebase. |
Implements part of enhancements suggested in #316.
Main change is that ethernet address and port name are not configuration parameters set by sample application.
To review the the update check out changes in pnet_api.h and pf_types.h rest of the updates follows from these updates.
A second commit renames PNET_MAX_PORT to PNET_NUMBER_OF_PHYSICAL_PORTS
Rebased on #332 to avoid future merge conflict.