netdev: Rework netdev_eth to layered structure#9330
netdev: Rework netdev_eth to layered structure#9330bergzand wants to merge 14 commits intoRIOT-OS:masterfrom
Conversation
Adds a bootstrap function to provide setting up the layered structure for the netdev devices. The structs end up on the stack providing some sort of dynamic allocation for the layers
|
It definitely breaks |
OpenThread only uses raw netdev. So, shouldn't break anything there |
| dev->context = netif; | ||
| /* register the event callback with the device driver */ | ||
| dev->event_callback = _event_cb; | ||
| dev->context = netif; |
There was a problem hiding this comment.
Yeah, I have to check this, probably still unrelated, but I have a hunch that I switched the order intentionally
There was a problem hiding this comment.
Always document your work. Future you and your peers will thank you. ;-)
7b35df8 to
3342c3f
Compare
|
Adapted LwIP to this PR |
| netdev_tap_setup(&netdev_taps[i], &netdev_tap_params[i]); | ||
| if (netif_add(&netif[i], &netdev_taps[i], lwip_netdev_init, | ||
| netdev_eth_add((netdev_t*)&netdev_taps[i], ð_layer[i]); | ||
| if (netif_add(&netif[i], ð_layer[i], lwip_netdev_init, |
There was a problem hiding this comment.
Ah... easier than I anticipated ^^
There was a problem hiding this comment.
Yeah, but not a solution that scales nicely. If we ever start supporting more devices we might want to refactor this to something that scales.
There was a problem hiding this comment.
Yupp, but then lwip_netdev_init needs some heavy refactoring anyways.
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you want me to ignore this issue, please mark it with the "State: don't stale" label. Thank you for your contributions. |
Contribution description
This PR changes the netdev_eth module to a layered structure. The change here is that the netdev_driver_t functions of the netdev_eth struct are called first, and the functions of the hardware driver are called next.
The hardware drivers are adapted to not call the netdev_eth get and set functions anymore.
The
hwdevstruct member in thenetdev_eth_tis only required to handle the L2 network stats and can be removed as soon as the stats are moved to a separate layer.@miri64 Could it be that I'm also breaking the other (non-gnrc) network stacks here?
Issues/PRs references
Depends on #9329