net: Enable PM settings on network devices

By changing the various *NET_DEVICE* macros. It is up to the device
drivers to either set a proper PM function or, if not supported or PM
disabled, to use device_pm_control_nop relevantly.

All existing macro calls are updated. Since no PM support was added so
far, device_pm_control_nop is used as the default everywhere.

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
This commit is contained in:
Tomasz Bursztyka 2020-02-25 10:45:25 +01:00 committed by Jukka Rissanen
parent ebe20f99c7
commit 4ae72db135
67 changed files with 197 additions and 143 deletions

View file

@ -308,7 +308,7 @@ static int socket_can_init_1(struct device *dev)
}
NET_DEVICE_INIT(socket_can_loopback_1, SOCKET_CAN_NAME_1, socket_can_init_1,
&socket_can_context_1, NULL,
device_pm_control_nop, &socket_can_context_1, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&socket_can_api,
CANBUS_RAW_L2, NET_L2_GET_CTX_TYPE(CANBUS_RAW_L2), CAN_MTU);

View file

@ -749,7 +749,7 @@ static int socket_can_init_0(struct device *dev)
}
NET_DEVICE_INIT(socket_can_flexcan_0, SOCKET_CAN_NAME_1, socket_can_init_0,
&socket_can_context_1, NULL,
device_pm_control_nop, &socket_can_context_1, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&socket_can_api,
CANBUS_RAW_L2, NET_L2_GET_CTX_TYPE(CANBUS_RAW_L2), CAN_MTU);

View file

@ -398,7 +398,7 @@ static int net_can_init(struct device *dev)
static struct net_can_context net_can_context_1;
NET_DEVICE_INIT(net_can_1, CONFIG_CAN_NET_NAME, net_can_init,
&net_can_context_1, NULL,
device_pm_control_nop, &net_can_context_1, NULL,
CONFIG_CAN_NET_INIT_PRIORITY,
&net_can_api_inst,
CANBUS_L2, NET_L2_GET_CTX_TYPE(CANBUS_L2), NET_CAN_MTU);

View file

@ -1119,7 +1119,7 @@ static int socket_can_init_1(struct device *dev)
}
NET_DEVICE_INIT(socket_can_stm32_1, SOCKET_CAN_NAME_1, socket_can_init_1,
&socket_can_context_1, NULL,
device_pm_control_nop, &socket_can_context_1, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&socket_can_api,
CANBUS_RAW_L2, NET_L2_GET_CTX_TYPE(CANBUS_RAW_L2), CAN_MTU);
@ -1197,7 +1197,7 @@ static int socket_can_init_2(struct device *dev)
}
NET_DEVICE_INIT(socket_can_stm32_2, SOCKET_CAN_NAME_2, socket_can_init_2,
&socket_can_context_2, NULL,
device_pm_control_nop, &socket_can_context_2, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEVICE,
&socket_can_api,
CANBUS_RAW_L2, NET_L2_GET_CTX_TYPE(CANBUS_RAW_L2), CAN_MTU);

View file

@ -250,6 +250,7 @@ static const struct ethernet_api e1000_api = {
NET_DEVICE_INIT(eth_e1000,
"ETH_0",
e1000_probe,
device_pm_control_nop,
&e1000_dev,
NULL,
CONFIG_ETH_INIT_PRIORITY,

View file

@ -830,8 +830,8 @@ static const struct eth_enc28j60_config eth_enc28j60_0_config = {
};
ETH_NET_DEVICE_INIT(enc28j60_0, DT_INST_0_MICROCHIP_ENC28J60_LABEL,
eth_enc28j60_init, &eth_enc28j60_0_runtime,
&eth_enc28j60_0_config, CONFIG_ETH_INIT_PRIORITY,
&api_funcs, NET_ETH_MTU);
eth_enc28j60_init, device_pm_control_nop,
&eth_enc28j60_0_runtime, &eth_enc28j60_0_config,
CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU);
#endif /* CONFIG_ETH_ENC28J60_0 */

View file

@ -766,6 +766,6 @@ static const struct enc424j600_config enc424j600_0_config = {
};
ETH_NET_DEVICE_INIT(enc424j600_0, DT_INST_0_MICROCHIP_ENC424J600_LABEL,
enc424j600_init, &enc424j600_0_runtime,
&enc424j600_0_config, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_ETH_MTU);
enc424j600_init, device_pm_control_nop,
&enc424j600_0_runtime, &enc424j600_0_config,
CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU);

View file

@ -692,5 +692,5 @@ static struct eth_gecko_dev_data eth0_data = {
};
ETH_NET_DEVICE_INIT(eth_gecko, CONFIG_ETH_GECKO_NAME, eth_init,
&eth0_data, &eth0_config, CONFIG_ETH_INIT_PRIORITY,
&eth_api, ETH_GECKO_MTU);
device_pm_control_nop, &eth0_data, &eth0_config,
CONFIG_ETH_INIT_PRIORITY, &eth_api, ETH_GECKO_MTU);

View file

@ -254,9 +254,9 @@ static const struct ethernet_api eth_api = {
.send = eth_tx
};
NET_DEVICE_INIT(eth0, LITEETH_LABEL, eth_initialize, &eth_data, &eth_config,
CONFIG_ETH_INIT_PRIORITY, &eth_api, ETHERNET_L2,
NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU);
NET_DEVICE_INIT(eth0, LITEETH_LABEL, eth_initialize, device_pm_control_nop,
&eth_data, &eth_config, CONFIG_ETH_INIT_PRIORITY, &eth_api,
ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU);
static void eth_irq_config(void)
{

View file

@ -1127,8 +1127,8 @@ static struct eth_context eth_0_context = {
};
ETH_NET_DEVICE_INIT(eth_mcux_0, DT_ETH_MCUX_0_NAME, eth_init,
&eth_0_context, NULL, CONFIG_ETH_INIT_PRIORITY,
&api_funcs, NET_ETH_MTU);
device_pm_control_nop, &eth_0_context, NULL,
CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU);
static void eth_0_config_func(void)
{
@ -1185,8 +1185,8 @@ static struct eth_context eth_1_context = {
};
ETH_NET_DEVICE_INIT(eth_mcux_1, DT_ETH_MCUX_1_NAME, eth_init,
&eth_1_context, NULL, CONFIG_ETH_INIT_PRIORITY,
&api_funcs, NET_ETH_MTU);
device_pm_control_nop, &eth_1_context, NULL,
CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU);
static void eth_1_config_func(void)
{

View file

@ -584,7 +584,7 @@ static const struct ethernet_api eth_if_api = {
};
ETH_NET_DEVICE_INIT(eth_native_posix, ETH_NATIVE_POSIX_DRV_NAME,
eth_init, &eth_context_data, NULL,
eth_init, device_pm_control_nop, &eth_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &eth_if_api,
NET_ETH_MTU);

View file

@ -2360,8 +2360,8 @@ static struct eth_sam_dev_data eth0_data = {
};
ETH_NET_DEVICE_INIT(eth0_sam_gmac, CONFIG_ETH_SAM_GMAC_NAME, eth_initialize,
&eth0_data, &eth0_config, CONFIG_ETH_INIT_PRIORITY,
&eth_api, GMAC_MTU);
device_pm_control_nop, &eth0_data, &eth0_config,
CONFIG_ETH_INIT_PRIORITY, &eth_api, GMAC_MTU);
#if defined(CONFIG_PTP_CLOCK_SAM_GMAC)
struct ptp_context {

View file

@ -678,6 +678,6 @@ int eth_init(struct device *dev)
static struct eth_context eth_0_context;
ETH_NET_DEVICE_INIT(eth_smsc911x_0, "smsc911x_0",
eth_init, &eth_0_context,
eth_init, device_pm_control_nop, &eth_0_context,
NULL /*&eth_config_0*/, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_ETH_MTU /*MTU*/);

View file

@ -352,7 +352,7 @@ static const struct ethernet_api eth_stellaris_apis = {
};
NET_DEVICE_INIT(eth_stellaris, DT_INST_LABEL(0),
eth_stellaris_dev_init, &eth_data, &eth_cfg,
CONFIG_ETH_INIT_PRIORITY,
eth_stellaris_dev_init, device_pm_control_nop,
&eth_data, &eth_cfg, CONFIG_ETH_INIT_PRIORITY,
&eth_stellaris_apis, ETHERNET_L2,
NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU);

View file

@ -594,5 +594,5 @@ static struct eth_stm32_hal_dev_data eth0_data = {
};
ETH_NET_DEVICE_INIT(eth0_stm32_hal, CONFIG_ETH_STM32_HAL_NAME, eth_initialize,
&eth0_data, &eth0_config, CONFIG_ETH_INIT_PRIORITY,
&eth_api, ETH_STM32_HAL_MTU);
device_pm_control_nop, &eth0_data, &eth0_config,
CONFIG_ETH_INIT_PRIORITY, &eth_api, ETH_STM32_HAL_MTU);

View file

@ -847,7 +847,8 @@ static struct ieee802154_radio_api cc1200_radio_api = {
};
NET_DEVICE_INIT(cc1200, CONFIG_IEEE802154_CC1200_DRV_NAME,
cc1200_init, &cc1200_context_data, NULL,
cc1200_init, device_pm_control_nop,
&cc1200_context_data, NULL,
CONFIG_IEEE802154_CC1200_INIT_PRIO,
&cc1200_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), 125);

View file

@ -715,7 +715,8 @@ static struct ieee802154_cc13xx_cc26xx_data ieee802154_cc13xx_cc26xx_data = {
NET_DEVICE_INIT(ieee802154_cc13xx_cc26xx,
CONFIG_IEEE802154_CC13XX_CC26XX_DRV_NAME,
ieee802154_cc13xx_cc26xx_init, &ieee802154_cc13xx_cc26xx_data,
NULL, CONFIG_IEEE802154_CC13XX_CC26XX_INIT_PRIO,
ieee802154_cc13xx_cc26xx_init, device_pm_control_nop,
&ieee802154_cc13xx_cc26xx_data, NULL,
CONFIG_IEEE802154_CC13XX_CC26XX_INIT_PRIO,
&ieee802154_cc13xx_cc26xx_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), IEEE802154_MTU);

View file

@ -1146,7 +1146,8 @@ DEVICE_AND_API_INIT(cc2520, CONFIG_IEEE802154_CC2520_DRV_NAME,
&cc2520_radio_api);
#else
NET_DEVICE_INIT(cc2520, CONFIG_IEEE802154_CC2520_DRV_NAME,
cc2520_init, &cc2520_context_data, NULL,
cc2520_init, device_pm_control_nop,
&cc2520_context_data, NULL,
CONFIG_IEEE802154_CC2520_INIT_PRIO,
&cc2520_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), 125);

View file

@ -1108,6 +1108,7 @@ NET_DEVICE_INIT(
kw41z, /* Device Name */
CONFIG_IEEE802154_KW41Z_DRV_NAME, /* Driver Name */
kw41z_init, /* Initialization Function */
device_pm_control_nop, /* No PM API support */
&kw41z_context_data, /* Context data */
NULL, /* Configuration info */
CONFIG_IEEE802154_KW41Z_INIT_PRIO, /* Initial priority */

View file

@ -1471,7 +1471,7 @@ DEVICE_AND_API_INIT(mcr20a, CONFIG_IEEE802154_MCR20A_DRV_NAME,
&mcr20a_radio_api);
#else
NET_DEVICE_INIT(mcr20a, CONFIG_IEEE802154_MCR20A_DRV_NAME,
mcr20a_init, &mcr20a_context_data, NULL,
mcr20a_init, device_pm_control_nop, &mcr20a_context_data, NULL,
CONFIG_IEEE802154_MCR20A_INIT_PRIO,
&mcr20a_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2),

View file

@ -627,7 +627,7 @@ static struct ieee802154_radio_api nrf5_radio_api = {
#if defined(CONFIG_NET_L2_IEEE802154) || defined(CONFIG_NET_L2_OPENTHREAD)
NET_DEVICE_INIT(nrf5_154_radio, CONFIG_IEEE802154_NRF5_DRV_NAME,
nrf5_init, &nrf5_data, &nrf5_radio_cfg,
nrf5_init, device_pm_control_nop, &nrf5_data, &nrf5_radio_cfg,
CONFIG_IEEE802154_NRF5_INIT_PRIO,
&nrf5_radio_api, L2,
L2_CTX_TYPE, MTU);

View file

@ -895,6 +895,7 @@ static struct ieee802154_radio_api rf2xx_radio_api = {
rf2xx_##n, \
DT_INST_##n##_ATMEL_RF2XX_LABEL, \
&rf2xx_init, \
device_pm_control_nop, \
&rf2xx_ctx_data_##n, \
&rf2xx_ctx_config_##n, \
CONFIG_IEEE802154_RF2XX_INIT_PRIO, \

View file

@ -384,7 +384,8 @@ static struct ieee802154_radio_api upipe_radio_api = {
};
NET_DEVICE_INIT(upipe_15_4, CONFIG_IEEE802154_UPIPE_DRV_NAME,
upipe_init, &upipe_context_data, NULL,
upipe_init, device_pm_control_nop,
&upipe_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&upipe_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), 125);

View file

@ -1523,6 +1523,6 @@ error:
}
NET_DEVICE_OFFLOAD_INIT(modem_sara, CONFIG_MODEM_UBLOX_SARA_R4_NAME,
modem_init, &mdata, NULL,
modem_init, device_pm_control_nop, &mdata, NULL,
CONFIG_MODEM_UBLOX_SARA_R4_INIT_PRIORITY, &api_funcs,
MDM_MAX_DATA_LENGTH);

View file

@ -1836,6 +1836,6 @@ static struct net_if_api api_funcs = {
};
NET_DEVICE_OFFLOAD_INIT(modem_wncm14a2a, "MODEM_WNCM14A2A",
wncm14a2a_init, &ictx,
wncm14a2a_init, device_pm_control_nop, &ictx,
NULL, CONFIG_MODEM_WNCM14A2A_INIT_PRIORITY, &api_funcs,
MDM_MAX_DATA_LENGTH);

View file

@ -100,7 +100,7 @@ static struct dummy_api loopback_api = {
};
NET_DEVICE_INIT(loopback, "lo",
loopback_dev_init, NULL, NULL,
loopback_dev_init, device_pm_control_nop, NULL, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&loopback_api, DUMMY_L2,
NET_L2_GET_CTX_TYPE(DUMMY_L2), 536);

View file

@ -721,6 +721,6 @@ static const struct ppp_api ppp_if_api = {
};
NET_DEVICE_INIT(ppp, CONFIG_NET_PPP_DRV_NAME, ppp_driver_init,
&ppp_driver_context_data, NULL,
device_pm_control_nop, &ppp_driver_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &ppp_if_api,
PPP_L2, NET_L2_GET_CTX_TYPE(PPP_L2), PPP_MTU);

View file

@ -455,9 +455,11 @@ static const struct ethernet_api slip_if_api = {
#define _SLIP_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(ETHERNET_L2)
#define _SLIP_MTU 1500
ETH_NET_DEVICE_INIT(slip, CONFIG_SLIP_DRV_NAME, slip_init, &slip_context_data,
NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &slip_if_api,
_SLIP_MTU);
ETH_NET_DEVICE_INIT(slip, CONFIG_SLIP_DRV_NAME,
slip_init, device_pm_control_nop,
&slip_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&slip_if_api, _SLIP_MTU);
#else
static const struct dummy_api slip_if_api = {
@ -470,7 +472,7 @@ static const struct dummy_api slip_if_api = {
#define _SLIP_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
#define _SLIP_MTU 576
NET_DEVICE_INIT(slip, CONFIG_SLIP_DRV_NAME, slip_init, &slip_context_data,
NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, &slip_if_api,
_SLIP_L2_LAYER, _SLIP_L2_CTX_TYPE, _SLIP_MTU);
NET_DEVICE_INIT(slip, CONFIG_SLIP_DRV_NAME, slip_init, device_pm_control_nop,
&slip_context_data, NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&slip_if_api, _SLIP_L2_LAYER, _SLIP_L2_CTX_TYPE, _SLIP_MTU);
#endif

View file

@ -871,6 +871,6 @@ error:
}
NET_DEVICE_OFFLOAD_INIT(wifi_esp, CONFIG_WIFI_ESP_NAME,
esp_init, &esp_driver_data, NULL,
esp_init, device_pm_control_nop, &esp_driver_data, NULL,
CONFIG_WIFI_INIT_PRIORITY, &esp_api,
ESP_MTU);

View file

@ -680,5 +680,5 @@ static const struct net_wifi_mgmt_offload eswifi_offload_api = {
};
NET_DEVICE_OFFLOAD_INIT(eswifi_mgmt, CONFIG_WIFI_ESWIFI_NAME,
eswifi_init, &eswifi0, NULL,
eswifi_init, device_pm_control_nop, &eswifi0, NULL,
CONFIG_WIFI_INIT_PRIORITY, &eswifi_offload_api, 1500);

View file

@ -262,6 +262,7 @@ static int simplelink_init(struct device *dev)
}
NET_DEVICE_OFFLOAD_INIT(simplelink, CONFIG_WIFI_SIMPLELINK_NAME,
simplelink_init, &simplelink_data, NULL,
simplelink_init, device_pm_control_nop,
&simplelink_data, NULL,
CONFIG_WIFI_INIT_PRIORITY, &simplelink_api,
CONFIG_WIFI_SIMPLELINK_MAX_PACKET_SIZE);

View file

@ -1113,6 +1113,6 @@ static int winc1500_init(struct device *dev)
}
NET_DEVICE_OFFLOAD_INIT(winc1500, CONFIG_WIFI_WINC1500_NAME,
winc1500_init, &w1500_data, NULL,
winc1500_init, device_pm_control_nop, &w1500_data, NULL,
CONFIG_WIFI_INIT_PRIORITY, &winc1500_api,
CONFIG_WIFI_WINC1500_MAX_PACKET_SIZE);

View file

@ -616,6 +616,8 @@ static inline bool net_eth_get_vlan_status(struct net_if *iface)
* @param drv_name The name this instance of the driver exposes to
* the system.
* @param init_fn Address to the init function of the driver.
* @param pm_control_fn Pointer to device_pm_control function.
* Can be empty function (device_pm_control_nop) if not implemented.
* @param data Pointer to the device's configuration data.
* @param cfg_info The address to the structure containing the
* configuration information for this instance of the driver.
@ -625,18 +627,18 @@ static inline bool net_eth_get_vlan_status(struct net_if *iface)
* @param mtu Maximum transfer unit in bytes for this network interface.
*/
#if defined(CONFIG_NET_VLAN)
#define ETH_NET_DEVICE_INIT(dev_name, drv_name, init_fn, \
data, cfg_info, prio, api, mtu) \
DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
#define ETH_NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
data, cfg_info, prio, api, mtu) \
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
NET_L2_DATA_INIT(dev_name, 0, NET_L2_GET_CTX_TYPE(ETHERNET_L2)); \
NET_IF_INIT(dev_name, 0, ETHERNET_L2, mtu, NET_VLAN_MAX_COUNT)
#else /* CONFIG_NET_VLAN */
#define ETH_NET_DEVICE_INIT(dev_name, drv_name, init_fn, \
#define ETH_NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
data, cfg_info, prio, api, mtu) \
NET_DEVICE_INIT(dev_name, drv_name, init_fn, \
NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
data, cfg_info, prio, api, ETHERNET_L2, \
NET_L2_GET_CTX_TYPE(ETHERNET_L2), mtu)

View file

@ -2170,6 +2170,8 @@ struct net_if_api {
* @param drv_name The name this instance of the driver exposes to
* the system.
* @param init_fn Address to the init function of the driver.
* @param pm_control_fn Pointer to device_pm_control function.
* Can be empty function (device_pm_control_nop) if not implemented.
* @param data Pointer to the device's configuration data.
* @param cfg_info The address to the structure containing the
* configuration information for this instance of the driver.
@ -2180,12 +2182,12 @@ struct net_if_api {
* @param l2_ctx_type Type of L2 context data.
* @param mtu Maximum transfer unit in bytes for this network interface.
*/
#define NET_DEVICE_INIT(dev_name, drv_name, init_fn, \
data, cfg_info, prio, api, l2, \
l2_ctx_type, mtu) \
DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
NET_L2_DATA_INIT(dev_name, 0, l2_ctx_type); \
#define NET_DEVICE_INIT(dev_name, drv_name, init_fn, pm_control_fn, \
data, cfg_info, prio, api, l2, \
l2_ctx_type, mtu) \
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
NET_L2_DATA_INIT(dev_name, 0, l2_ctx_type); \
NET_IF_INIT(dev_name, 0, l2, mtu, NET_IF_MAX_CONFIGS)
/**
@ -2201,6 +2203,8 @@ struct net_if_api {
* the system.
* @param instance Instance identifier.
* @param init_fn Address to the init function of the driver.
* @param pm_control_fn Pointer to device_pm_control function.
* Can be empty function (device_pm_control_nop) if not implemented.
* @param data Pointer to the device's configuration data.
* @param cfg_info The address to the structure containing the
* configuration information for this instance of the driver.
@ -2212,10 +2216,10 @@ struct net_if_api {
* @param mtu Maximum transfer unit in bytes for this network interface.
*/
#define NET_DEVICE_INIT_INSTANCE(dev_name, drv_name, instance, init_fn, \
data, cfg_info, prio, api, l2, \
l2_ctx_type, mtu) \
DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
pm_control_fn, data, cfg_info, prio, \
api, l2, l2_ctx_type, mtu) \
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
NET_L2_DATA_INIT(dev_name, instance, l2_ctx_type); \
NET_IF_INIT(dev_name, instance, l2, mtu, NET_IF_MAX_CONFIGS)
@ -2230,6 +2234,8 @@ struct net_if_api {
* @param drv_name The name this instance of the driver exposes to
* the system.
* @param init_fn Address to the init function of the driver.
* @param pm_control_fn Pointer to device_pm_control function.
* Can be empty function (device_pm_control_nop) if not implemented.
* @param data Pointer to the device's configuration data.
* @param cfg_info The address to the structure containing the
* configuration information for this instance of the driver.
@ -2238,10 +2244,11 @@ struct net_if_api {
* used by the driver. Can be NULL.
* @param mtu Maximum transfer unit in bytes for this network interface.
*/
#define NET_DEVICE_OFFLOAD_INIT(dev_name, drv_name, init_fn, \
data, cfg_info, prio, api, mtu) \
DEVICE_AND_API_INIT(dev_name, drv_name, init_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
#define NET_DEVICE_OFFLOAD_INIT(dev_name, drv_name, init_fn, \
pm_control_fn, data, cfg_info, prio, \
api, mtu) \
DEVICE_DEFINE(dev_name, drv_name, init_fn, pm_control_fn, data, \
cfg_info, POST_KERNEL, prio, api); \
NET_IF_OFFLOAD_INIT(dev_name, 0, mtu)
#ifdef __cplusplus

View file

@ -160,6 +160,7 @@ static int netusb_init_dev(struct device *dev)
return 0;
}
NET_DEVICE_INIT(eth_netusb, "eth_netusb", netusb_init_dev, NULL, NULL,
NET_DEVICE_INIT(eth_netusb, "eth_netusb", netusb_init_dev,
device_pm_control_nop, NULL, NULL,
CONFIG_ETH_INIT_PRIORITY, &netusb_api_funcs, ETHERNET_L2,
NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU);

View file

@ -270,7 +270,7 @@ static struct dummy_api net_6lo_if_api = {
};
NET_DEVICE_INIT(net_6lo_test, "net_6lo_test",
net_6lo_dev_init, NULL, NULL,
net_6lo_dev_init, device_pm_control_nop, NULL, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_6lo_if_api, DUMMY_L2, NET_L2_GET_CTX_TYPE(DUMMY_L2), 127);

View file

@ -31,7 +31,8 @@ static struct dummy_api offload_if_api = {
};
NET_DEVICE_OFFLOAD_INIT(net_offload, "net_offload",
NULL, &offload_context_data, NULL,
NULL, device_pm_control_nop,
&offload_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&offload_if_api, 0);

View file

@ -300,7 +300,8 @@ static const struct dummy_api net_arp_if_api = {
#endif
NET_DEVICE_INIT(net_arp_test, "net_arp_test",
net_arp_dev_init, &net_arp_context_data, NULL,
net_arp_dev_init, device_pm_control_nop,
&net_arp_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_arp_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);

View file

@ -289,15 +289,17 @@ static int eth_init(struct device *dev)
ETH_NET_DEVICE_INIT(eth_offloading_disabled_test,
"eth_offloading_disabled_test",
eth_init, &eth_context_offloading_disabled,
NULL, CONFIG_ETH_INIT_PRIORITY,
eth_init, device_pm_control_nop,
&eth_context_offloading_disabled, NULL,
CONFIG_ETH_INIT_PRIORITY,
&api_funcs_offloading_disabled,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_offloading_enabled_test,
"eth_offloading_enabled_test",
eth_init, &eth_context_offloading_enabled,
NULL, CONFIG_ETH_INIT_PRIORITY,
eth_init, device_pm_control_nop,
&eth_context_offloading_enabled, NULL,
CONFIG_ETH_INIT_PRIORITY,
&api_funcs_offloading_enabled,
NET_ETH_MTU);

View file

@ -967,7 +967,8 @@ static struct dummy_api net_context_if_api = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
NET_DEVICE_INIT(net_context_test, "net_context_test",
net_context_dev_init, &net_context_data, NULL,
net_context_dev_init, device_pm_control_nop,
&net_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_context_if_api, _ETH_L2_LAYER,
_ETH_L2_CTX_TYPE, 127);

View file

@ -380,7 +380,8 @@ static struct dummy_api net_dhcpv4_if_api = {
};
NET_DEVICE_INIT(net_dhcpv4_test, "net_dhcpv4_test",
net_dhcpv4_dev_init, &net_dhcpv4_context_data, NULL,
net_dhcpv4_dev_init, device_pm_control_nop,
&net_dhcpv4_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_dhcpv4_if_api, DUMMY_L2,
NET_L2_GET_CTX_TYPE(DUMMY_L2), 127);

View file

@ -301,9 +301,9 @@ static int eth_fake_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, &eth_fake_data,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop,
&eth_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY,
&eth_fake_api_funcs, NET_ETH_MTU);
static void test_change_mac_when_up(void)
{

View file

@ -120,6 +120,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test,
"iface1",
iface1,
net_iface_dev_init,
device_pm_control_nop,
&net_iface1_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
@ -181,9 +182,9 @@ static int eth_fake_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, &eth_fake_data,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop,
&eth_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY,
&eth_fake_api_funcs, NET_ETH_MTU);
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
static const char *iface2str(struct net_if *iface)

View file

@ -305,7 +305,8 @@ static struct dummy_api net_icmpv4_if_api = {
};
NET_DEVICE_INIT(net_icmpv4_test, "net_icmpv4_test",
net_icmpv4_dev_init, &net_icmpv4_context_data, NULL,
net_icmpv4_dev_init, device_pm_control_nop,
&net_icmpv4_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_icmpv4_if_api, DUMMY_L2,
NET_L2_GET_CTX_TYPE(DUMMY_L2), 127);

View file

@ -182,7 +182,7 @@ static struct dummy_api net_fragment_if_api = {
};
NET_DEVICE_INIT(net_fragment_test, "net_fragment_test",
net_fragment_dev_init, NULL, NULL,
net_fragment_dev_init, device_pm_control_nop, NULL, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_fragment_if_api, DUMMY_L2,
NET_L2_GET_CTX_TYPE(DUMMY_L2), 127);

View file

@ -126,7 +126,7 @@ static struct ieee802154_radio_api fake_radio_api = {
};
NET_DEVICE_INIT(fake, "fake_ieee802154",
fake_init, NULL, NULL,
fake_init, device_pm_control_nop, NULL, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&fake_radio_api, IEEE802154_L2,
NET_L2_GET_CTX_TYPE(IEEE802154_L2), 125);

View file

@ -149,6 +149,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test,
"iface1",
iface1,
net_iface_dev_init,
device_pm_control_nop,
&net_iface1_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
@ -161,6 +162,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface2_test,
"iface2",
iface2,
net_iface_dev_init,
device_pm_control_nop,
&net_iface2_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
@ -173,6 +175,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface3_test,
"iface3",
iface3,
net_iface_dev_init,
device_pm_control_nop,
&net_iface3_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
@ -257,9 +260,9 @@ static int eth_fake_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, &eth_fake_data,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop,
&eth_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY,
&eth_fake_api_funcs, NET_ETH_MTU);
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
static const char *iface2str(struct net_if *iface)

View file

@ -153,13 +153,15 @@ static struct dummy_api net_test_if_api = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
NET_DEVICE_INIT_INSTANCE(net_addr_test1, "net_addr_test1", iface1,
net_test_init, &net_test_context_data, NULL,
net_test_init, device_pm_control_nop,
&net_test_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_test_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE,
127);
NET_DEVICE_INIT_INSTANCE(net_addr_test2, "net_addr_test2", iface2,
net_test_init, &net_test_context_data, NULL,
net_test_init, device_pm_control_nop,
&net_test_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_test_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE,
127);

View file

@ -283,7 +283,7 @@ static const struct ethernet_api net_test_if_api = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(ETHERNET_L2)
NET_DEVICE_INIT(net_test_ipv6, "net_test_ipv6",
net_test_dev_init, &net_test_data, NULL,
net_test_dev_init, device_pm_control_nop, &net_test_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_test_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE,
127);

View file

@ -1365,6 +1365,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test,
"iface1",
iface1,
net_iface_dev_init,
device_pm_control_nop,
&net_iface1_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
@ -1377,6 +1378,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface2_test,
"iface2",
iface2,
net_iface_dev_init,
device_pm_control_nop,
&net_iface2_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,

View file

@ -132,6 +132,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test,
"iface1",
iface1,
net_iface_dev_init,
device_pm_control_nop,
&net_iface1_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,

View file

@ -186,6 +186,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test,
"iface1",
iface1,
net_iface_dev_init,
device_pm_control_nop,
&net_iface1_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,

View file

@ -90,7 +90,8 @@ static struct dummy_api fake_iface_api = {
};
NET_DEVICE_INIT(net_event_test, "net_event_test",
fake_dev_init, NULL, NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
fake_dev_init, device_pm_control_nop,
NULL, NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&fake_iface_api, DUMMY_L2, NET_L2_GET_CTX_TYPE(DUMMY_L2), 127);
void test_requesting_nm(void)

View file

@ -142,7 +142,7 @@ static struct dummy_api net_test_if_api = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
NET_DEVICE_INIT(net_test_mld, "net_test_mld",
net_test_dev_init, &net_test_data, NULL,
net_test_dev_init, device_pm_control_nop, &net_test_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_test_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE,
127);

View file

@ -73,7 +73,7 @@ static const struct dummy_api fake_dev_api = {
#endif
NET_DEVICE_INIT(fake_dev, "fake_dev",
fake_dev_init, NULL, NULL,
fake_dev_init, device_pm_control_nop, NULL, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&fake_dev_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE,
NET_ETH_MTU);

View file

@ -142,13 +142,15 @@ static int eth_fake_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_fake1, "eth_fake1", eth_fake_init, &eth_fake_data1,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake1, "eth_fake1",
eth_fake_init, device_pm_control_nop,
&eth_fake_data1, NULL, CONFIG_ETH_INIT_PRIORITY,
&eth_fake_api_funcs, NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", eth_fake_init, &eth_fake_data2,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2",
eth_fake_init, device_pm_control_nop,
&eth_fake_data2, NULL, CONFIG_ETH_INIT_PRIORITY,
&eth_fake_api_funcs, NET_ETH_MTU);
#if NET_LOG_LEVEL >= LOG_LEVEL_DBG
static const char *iface2str(struct net_if *iface)

View file

@ -155,16 +155,16 @@ static int eth_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_test_1, "eth_test_1", eth_init, &eth_context_1, NULL,
CONFIG_ETH_INIT_PRIORITY, &api_funcs,
ETH_NET_DEVICE_INIT(eth_test_1, "eth_test_1", eth_init, device_pm_control_nop,
&eth_context_1, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_test_2, "eth_test_2", eth_init, &eth_context_2, NULL,
CONFIG_ETH_INIT_PRIORITY, &api_funcs,
ETH_NET_DEVICE_INIT(eth_test_2, "eth_test_2", eth_init, device_pm_control_nop,
&eth_context_2, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_test_3, "eth_test_3", eth_init, &eth_context_3, NULL,
CONFIG_ETH_INIT_PRIORITY, &api_funcs,
ETH_NET_DEVICE_INIT(eth_test_3, "eth_test_3", eth_init, device_pm_control_nop,
&eth_context_3, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_ETH_MTU);
static u64_t timestamp_to_nsec(struct net_ptp_time *ts)

View file

@ -217,14 +217,18 @@ static struct dummy_api net_route_if_api_peer = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
NET_DEVICE_INIT_INSTANCE(net_route_test, "net_route_test", host,
net_route_dev_init, &net_route_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_route_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);
net_route_dev_init, device_pm_control_nop,
&net_route_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_route_if_api, _ETH_L2_LAYER,
_ETH_L2_CTX_TYPE, 127);
NET_DEVICE_INIT_INSTANCE(net_route_test_peer, "net_route_test_peer", peer,
net_route_dev_init, &net_route_data_peer, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_route_if_api_peer, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);
net_route_dev_init, device_pm_control_nop,
&net_route_data_peer, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_route_if_api_peer, _ETH_L2_LAYER,
_ETH_L2_CTX_TYPE, 127);
static void test_init(void)
{

View file

@ -135,7 +135,8 @@ static struct dummy_api net_udp_if_api = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
NET_DEVICE_INIT(net_udp_test, "net_udp_test",
net_udp_dev_init, &net_udp_context_data, NULL,
net_udp_dev_init, device_pm_control_nop,
&net_udp_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_udp_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);

View file

@ -67,12 +67,14 @@ static int eth_fake_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_fake1, "eth_fake1", eth_fake_init, &eth_fake_data1,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
ETH_NET_DEVICE_INIT(eth_fake1, "eth_fake1", eth_fake_init,
device_pm_control_nop, &eth_fake_data1, NULL,
CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", eth_fake_init, &eth_fake_data2,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", eth_fake_init,
device_pm_control_nop, &eth_fake_data2, NULL,
CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
static int setup_socket(struct net_if *iface)

View file

@ -262,9 +262,9 @@ static int eth_fake_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, &eth_fake_data,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop,
&eth_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY,
&eth_fake_api_funcs, NET_ETH_MTU);
/* A test thread that spits out events that we can catch and show to user */
static void trigger_events(void)

View file

@ -808,9 +808,9 @@ static int eth_fake_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, &eth_fake_data,
NULL, CONFIG_ETH_INIT_PRIORITY, &eth_fake_api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop,
&eth_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY,
&eth_fake_api_funcs, NET_ETH_MTU);
static void setup_eth(void)
{

View file

@ -1384,14 +1384,17 @@ static struct dummy_api net_tcp_if_api_peer = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
NET_DEVICE_INIT_INSTANCE(net_tcp_test, "net_tcp_test", host,
net_tcp_dev_init, &net_tcp_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_tcp_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);
net_tcp_dev_init, device_pm_control_nop,
&net_tcp_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_tcp_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);
NET_DEVICE_INIT_INSTANCE(net_tcp_test_peer, "net_tcp_test_peer", peer,
net_tcp_dev_init, &net_tcp_context_data_peer, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_tcp_if_api_peer, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);
net_tcp_dev_init, device_pm_control_nop,
&net_tcp_context_data_peer, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_tcp_if_api_peer,
_ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);
static bool test_init_tcp_context(void)
{

View file

@ -265,8 +265,8 @@ static int eth_init(struct device *dev)
* is quite unlikely that this would be done in real life but for testing
* purposes create it here.
*/
NET_DEVICE_INIT(eth_test, "eth_test", eth_init, &eth_context,
NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_DEVICE_INIT(eth_test, "eth_test", eth_init, device_pm_control_nop,
&eth_context, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
DUMMY_L2, NET_L2_GET_CTX_TYPE(DUMMY_L2),
NET_ETH_MTU);

View file

@ -152,12 +152,12 @@ static int eth_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_test, "eth_test", eth_init, &eth_context,
NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
ETH_NET_DEVICE_INIT(eth_test, "eth_test", eth_init, device_pm_control_nop,
&eth_context, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_ETH_MTU);
ETH_NET_DEVICE_INIT(eth_test2, "eth_test2", eth_init, &eth_context2,
NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
ETH_NET_DEVICE_INIT(eth_test2, "eth_test2", eth_init, device_pm_control_nop,
&eth_context2, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
NET_ETH_MTU);
static void timestamp_callback(struct net_pkt *pkt)

View file

@ -137,7 +137,8 @@ static struct dummy_api net_udp_if_api = {
#define _ETH_L2_CTX_TYPE NET_L2_GET_CTX_TYPE(DUMMY_L2)
NET_DEVICE_INIT(net_udp_test, "net_udp_test",
net_udp_dev_init, &net_udp_context_data, NULL,
net_udp_dev_init, device_pm_control_nop,
&net_udp_context_data, NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
&net_udp_if_api, _ETH_L2_LAYER, _ETH_L2_CTX_TYPE, 127);

View file

@ -170,7 +170,8 @@ static int eth_vlan_init(struct device *dev)
return 0;
}
ETH_NET_DEVICE_INIT(eth_vlan_test, "eth_vlan_test", eth_vlan_init,
ETH_NET_DEVICE_INIT(eth_vlan_test, "eth_vlan_test",
eth_vlan_init, device_pm_control_nop,
&eth_vlan_context, NULL, CONFIG_ETH_INIT_PRIORITY,
&api_funcs, NET_ETH_MTU);
@ -187,9 +188,9 @@ static int eth_init(struct device *dev)
* is quite unlikely that this would be done in real life but for testing
* purposes create it here.
*/
NET_DEVICE_INIT(eth_test, "eth_test", eth_init, &eth_vlan_context,
NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs,
ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2),
NET_DEVICE_INIT(eth_test, "eth_test", eth_init, device_pm_control_nop,
&eth_vlan_context, NULL, CONFIG_ETH_INIT_PRIORITY,
&api_funcs, ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2),
NET_ETH_MTU);
struct net_if_test {
@ -251,6 +252,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface1_test,
"iface1",
iface1,
net_iface_dev_init,
device_pm_control_nop,
&net_iface1_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,
@ -263,6 +265,7 @@ NET_DEVICE_INIT_INSTANCE(net_iface2_test,
"iface2",
iface2,
net_iface_dev_init,
device_pm_control_nop,
&net_iface2_data,
NULL,
CONFIG_KERNEL_INIT_PRIORITY_DEFAULT,