Commit f2b74922 authored by Jukka Rissanen's avatar Jukka Rissanen
Browse files

ethernet: Add driver initialization priority to Kconfig

The default kernel init priority is too low. Make this
configurable and set the default priority so that the
ethernet driver is started just before the network stack.

This commit adds generic ethernet priority and changes
currently available ethernet drivers to use it.

Change-Id: If695e52b6dd9ea227f10ba306bb145d72d2312b0
Signed-off-by: default avatarJukka Rissanen <jukka.rissanen@linux.intel.com>
parent e12d73e4
Loading
Loading
Loading
Loading
+10 −0
Changes for drivers/ethernet/Kconfig: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -31,6 +31,16 @@ config SYS_LOG_ETHERNET_LEVEL
	  3 INFO, write SYS_LOG_INF in adition to previous levels
	  4 DEBUG, write SYS_LOG_DBG in adition to previous levels

config ETH_INIT_PRIORITY
	int
	prompt "Ethernet driver init priority"
	default 80
	help
	  Ethernet device driver initialization priority.
	  Do not mess with it unless you know what you are doing.
	  Note that the priority needs to be lower than the net stack
	  so that it can start before the networking sub-system.

menuconfig ETH_DW
	bool
	prompt "Synopsys DesignWare Ethernet driver"
+0 −9
Changes for drivers/ethernet/Kconfig.enc28j60: 0 added lines, 9 removed lines.
Original line number Diff line number Diff line
@@ -44,15 +44,6 @@ config ETH_EN28J60_0_FULL_DUPLEX
	Enable Full Duplex. Device is configured half duplex
	when disabled.

config ETH_ENC28J60_0_INIT_PRIORITY
	int
	prompt "ENC28J60C init priority"
	default 80
	help
	Device driver initialization priority.
	Since the device is connected to SPI bus, its driver has
	to be initialized after the SPI one.

config ETH_ENC28J60_0_GPIO_PORT_NAME
	string "GPIO controller port name"
	default "GPIO_0"
+1 −1
Changes for drivers/ethernet/eth_dw.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -314,7 +314,7 @@ static struct eth_runtime eth_0_runtime = {

DEVICE_INIT(eth_dw_0, CONFIG_ETH_DW_0_NAME, eth_initialize,
				&eth_0_runtime, &eth_config_0,
				NANOKERNEL, CONFIG_KERNEL_INIT_PRIORITY_DEVICE);
				NANOKERNEL, CONFIG_ETH_INIT_PRIORITY);

static int eth_net_tx(struct net_buf *buf)
{
+1 −1
Changes for drivers/ethernet/eth_enc28j60.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -689,7 +689,7 @@ static const struct eth_enc28j60_config eth_enc28j60_0_config = {
NET_DEVICE_INIT(enc28j60_0, CONFIG_ETH_ENC28J60_0_NAME,
		eth_enc28j60_init, &eth_enc28j60_0_runtime,
		&eth_enc28j60_0_config,
		CONFIG_ETH_ENC28J60_0_INIT_PRIORITY,
		CONFIG_ETH_INIT_PRIORITY,
		&api_funcs_0, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 1500);

#endif /* CONFIG_ETH_ENC28J60_0 */
+1 −1
Changes for drivers/ethernet/eth_enc28j60_legacy.c: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -633,7 +633,7 @@ static const struct eth_enc28j60_config eth_enc28j60_0_config = {
DEVICE_AND_API_INIT(eth_enc28j60_0, CONFIG_ETH_ENC28J60_0_NAME,
		    &eth_enc28j60_init, &eth_enc28j60_0_runtime,
		    &eth_enc28j60_0_config, POST_KERNEL,
		    CONFIG_ETH_ENC28J60_0_INIT_PRIORITY, &api_funcs);
		    CONFIG_ETH_INIT_PRIORITY, &api_funcs);

static int eth_net_tx(struct net_buf *buf)
{
Loading