net: Reoder the initialize sequence(mac->ip->tcp/udp)

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2022-03-12 14:16:00 +08:00 committed by Petro Karashchenko
parent 7598070508
commit 8b7d08f59a

View File

@ -75,6 +75,46 @@
void net_initialize(void) void net_initialize(void)
{ {
/* Initialize the device interface layer */
devif_initialize();
#ifdef CONFIG_NET_BLUETOOTH
/* Initialize Bluetooth socket support */
bluetooth_initialize();
#endif
#ifdef CONFIG_NET_CAN
/* Initialize SocketCAN support */
can_initialize();
#endif
#ifdef CONFIG_NET_IEEE802154
/* Initialize IEEE 802.15.4 socket support */
ieee802154_initialize();
#endif
#ifdef CONFIG_NET_NETLINK
/* Initialize the Netlink IPC support */
netlink_initialize();
#endif
#ifdef CONFIG_NET_PKT
/* Initialize packet socket support */
pkt_initialize();
#endif
#ifdef CONFIG_NET_ROUTE
/* Initialize the routing table */
net_init_route();
#endif
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6
#ifdef CONFIG_NET_6LOWPAN #ifdef CONFIG_NET_6LOWPAN
/* Initialize 6LoWPAN data structures */ /* Initialize 6LoWPAN data structures */
@ -83,22 +123,12 @@ void net_initialize(void)
#endif #endif
#endif /* CONFIG_NET_IPv6 */ #endif /* CONFIG_NET_IPv6 */
/* Initialize the device interface layer */
devif_initialize();
#ifdef HAVE_FWDALLOC #ifdef HAVE_FWDALLOC
/* Initialize IP forwarding support */ /* Initialize IP forwarding support */
ipfwd_initialize(); ipfwd_initialize();
#endif #endif
#ifdef CONFIG_NET_PKT
/* Initialize packet socket support */
pkt_initialize();
#endif
#ifdef CONFIG_NET_ICMP_SOCKET #ifdef CONFIG_NET_ICMP_SOCKET
/* Initialize IPPPROTO_ICMP socket support */ /* Initialize IPPPROTO_ICMP socket support */
@ -111,30 +141,6 @@ void net_initialize(void)
icmpv6_sock_initialize(); icmpv6_sock_initialize();
#endif #endif
#ifdef CONFIG_NET_BLUETOOTH
/* Initialize Bluetooth socket support */
bluetooth_initialize();
#endif
#ifdef CONFIG_NET_IEEE802154
/* Initialize IEEE 802.15.4 socket support */
ieee802154_initialize();
#endif
#ifdef CONFIG_NET_CAN
/* Initialize SocketCAN support */
can_initialize();
#endif
#ifdef CONFIG_NET_NETLINK
/* Initialize the Netlink IPC support */
netlink_initialize();
#endif
#ifdef NET_TCP_HAVE_STACK #ifdef NET_TCP_HAVE_STACK
/* Initialize the TCP/IP connection structures */ /* Initialize the TCP/IP connection structures */
@ -157,12 +163,6 @@ void net_initialize(void)
#endif #endif
#endif #endif
#ifdef CONFIG_NET_ROUTE
/* Initialize the routing table */
net_init_route();
#endif
#ifdef CONFIG_NET_USRSOCK #ifdef CONFIG_NET_USRSOCK
/* Initialize the user-space socket API */ /* Initialize the user-space socket API */