-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Rethinking network interface auto-initialization #4672
Description
Working on non-GNRC I realized that even most netdev2 devices are auto-initialized very GNRC-dependent so I think it makes sense to make the auto-initialization of network devices more granular.
There are a two things to consider:
- netdev(2) auto-initialization
- netdev(2) => interface mapping for every stack
The first one should be doable pretty straight forward with our current approach (just leave out the GNRC stuff). The second needs to have a default setting for every stack (e.g. gnrc_nomac interface for at86rf2xx or default gnrc_netdev2 for cc11xx), but should also be easily overridable by an application (if e.g. another mac layer is to be used). One way to do this could be to e.g. could be that every stack needs to define a function. For GNRC this might be:
void gnrc_init_netif(netdev2_t *dev, void *netif_params);where netif_params is a stack-related (or even interface-type related) data type that gives the parameters for the actual stack-internal interface initialization function(s). The mapping can then be done to provide a struct type to the auto-initialization.