diff --git a/drivers/can/can_loopback.c b/drivers/can/can_loopback.c index 7150250209f..822d2a83df2 100644 --- a/drivers/can/can_loopback.c +++ b/drivers/can/can_loopback.c @@ -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); diff --git a/drivers/can/can_mcux_flexcan.c b/drivers/can/can_mcux_flexcan.c index 66b13fef54f..c46eda8dc55 100644 --- a/drivers/can/can_mcux_flexcan.c +++ b/drivers/can/can_mcux_flexcan.c @@ -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); diff --git a/drivers/can/can_net.c b/drivers/can/can_net.c index 2a1f56eb1ee..a0317156a03 100644 --- a/drivers/can/can_net.c +++ b/drivers/can/can_net.c @@ -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); diff --git a/drivers/can/can_stm32.c b/drivers/can/can_stm32.c index 357fb2fe6e7..79b4c14a502 100644 --- a/drivers/can/can_stm32.c +++ b/drivers/can/can_stm32.c @@ -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); diff --git a/drivers/ethernet/eth_e1000.c b/drivers/ethernet/eth_e1000.c index 7c1818efb41..8f4faaf2900 100644 --- a/drivers/ethernet/eth_e1000.c +++ b/drivers/ethernet/eth_e1000.c @@ -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, diff --git a/drivers/ethernet/eth_enc28j60.c b/drivers/ethernet/eth_enc28j60.c index d2eb057e877..37553082497 100644 --- a/drivers/ethernet/eth_enc28j60.c +++ b/drivers/ethernet/eth_enc28j60.c @@ -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, ð_enc28j60_0_runtime, - ð_enc28j60_0_config, CONFIG_ETH_INIT_PRIORITY, - &api_funcs, NET_ETH_MTU); + eth_enc28j60_init, device_pm_control_nop, + ð_enc28j60_0_runtime, ð_enc28j60_0_config, + CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU); #endif /* CONFIG_ETH_ENC28J60_0 */ diff --git a/drivers/ethernet/eth_enc424j600.c b/drivers/ethernet/eth_enc424j600.c index aafaba95f0b..b212f5e36b9 100644 --- a/drivers/ethernet/eth_enc424j600.c +++ b/drivers/ethernet/eth_enc424j600.c @@ -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); diff --git a/drivers/ethernet/eth_gecko.c b/drivers/ethernet/eth_gecko.c index 4c5bf5ffff1..d8da179dd5b 100644 --- a/drivers/ethernet/eth_gecko.c +++ b/drivers/ethernet/eth_gecko.c @@ -692,5 +692,5 @@ static struct eth_gecko_dev_data eth0_data = { }; ETH_NET_DEVICE_INIT(eth_gecko, CONFIG_ETH_GECKO_NAME, eth_init, - ð0_data, ð0_config, CONFIG_ETH_INIT_PRIORITY, - ð_api, ETH_GECKO_MTU); + device_pm_control_nop, ð0_data, ð0_config, + CONFIG_ETH_INIT_PRIORITY, ð_api, ETH_GECKO_MTU); diff --git a/drivers/ethernet/eth_liteeth.c b/drivers/ethernet/eth_liteeth.c index a0bce2d8096..f87f9fb7695 100644 --- a/drivers/ethernet/eth_liteeth.c +++ b/drivers/ethernet/eth_liteeth.c @@ -254,9 +254,9 @@ static const struct ethernet_api eth_api = { .send = eth_tx }; -NET_DEVICE_INIT(eth0, LITEETH_LABEL, eth_initialize, ð_data, ð_config, - CONFIG_ETH_INIT_PRIORITY, ð_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, + ð_data, ð_config, CONFIG_ETH_INIT_PRIORITY, ð_api, + ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU); static void eth_irq_config(void) { diff --git a/drivers/ethernet/eth_mcux.c b/drivers/ethernet/eth_mcux.c index 2e1beb4d3d8..979a6c0b4cb 100644 --- a/drivers/ethernet/eth_mcux.c +++ b/drivers/ethernet/eth_mcux.c @@ -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, - ð_0_context, NULL, CONFIG_ETH_INIT_PRIORITY, - &api_funcs, NET_ETH_MTU); + device_pm_control_nop, ð_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, - ð_1_context, NULL, CONFIG_ETH_INIT_PRIORITY, - &api_funcs, NET_ETH_MTU); + device_pm_control_nop, ð_1_context, NULL, + CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU); static void eth_1_config_func(void) { diff --git a/drivers/ethernet/eth_native_posix.c b/drivers/ethernet/eth_native_posix.c index b5f3f9a8b2b..322fc7390f9 100644 --- a/drivers/ethernet/eth_native_posix.c +++ b/drivers/ethernet/eth_native_posix.c @@ -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, ð_context_data, NULL, + eth_init, device_pm_control_nop, ð_context_data, NULL, CONFIG_KERNEL_INIT_PRIORITY_DEFAULT, ð_if_api, NET_ETH_MTU); diff --git a/drivers/ethernet/eth_sam_gmac.c b/drivers/ethernet/eth_sam_gmac.c index d61b39d2194..d6cb30c5daf 100644 --- a/drivers/ethernet/eth_sam_gmac.c +++ b/drivers/ethernet/eth_sam_gmac.c @@ -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, - ð0_data, ð0_config, CONFIG_ETH_INIT_PRIORITY, - ð_api, GMAC_MTU); + device_pm_control_nop, ð0_data, ð0_config, + CONFIG_ETH_INIT_PRIORITY, ð_api, GMAC_MTU); #if defined(CONFIG_PTP_CLOCK_SAM_GMAC) struct ptp_context { diff --git a/drivers/ethernet/eth_smsc911x.c b/drivers/ethernet/eth_smsc911x.c index 209cee19a14..b1a3a0f677b 100644 --- a/drivers/ethernet/eth_smsc911x.c +++ b/drivers/ethernet/eth_smsc911x.c @@ -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, ð_0_context, + eth_init, device_pm_control_nop, ð_0_context, NULL /*ð_config_0*/, CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU /*MTU*/); diff --git a/drivers/ethernet/eth_stellaris.c b/drivers/ethernet/eth_stellaris.c index e630e65be0d..dc11d582293 100644 --- a/drivers/ethernet/eth_stellaris.c +++ b/drivers/ethernet/eth_stellaris.c @@ -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, ð_data, ð_cfg, - CONFIG_ETH_INIT_PRIORITY, + eth_stellaris_dev_init, device_pm_control_nop, + ð_data, ð_cfg, CONFIG_ETH_INIT_PRIORITY, ð_stellaris_apis, ETHERNET_L2, NET_L2_GET_CTX_TYPE(ETHERNET_L2), NET_ETH_MTU); diff --git a/drivers/ethernet/eth_stm32_hal.c b/drivers/ethernet/eth_stm32_hal.c index b47b175223d..c48c998e88a 100644 --- a/drivers/ethernet/eth_stm32_hal.c +++ b/drivers/ethernet/eth_stm32_hal.c @@ -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, - ð0_data, ð0_config, CONFIG_ETH_INIT_PRIORITY, - ð_api, ETH_STM32_HAL_MTU); + device_pm_control_nop, ð0_data, ð0_config, + CONFIG_ETH_INIT_PRIORITY, ð_api, ETH_STM32_HAL_MTU); diff --git a/drivers/ieee802154/ieee802154_cc1200.c b/drivers/ieee802154/ieee802154_cc1200.c index 77106d06f7a..0217e11d6d0 100644 --- a/drivers/ieee802154/ieee802154_cc1200.c +++ b/drivers/ieee802154/ieee802154_cc1200.c @@ -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); diff --git a/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c b/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c index 30cf3c0eec9..4cff57b2090 100644 --- a/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c +++ b/drivers/ieee802154/ieee802154_cc13xx_cc26xx.c @@ -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); diff --git a/drivers/ieee802154/ieee802154_cc2520.c b/drivers/ieee802154/ieee802154_cc2520.c index a90dba7a5e1..4a920ef17a5 100644 --- a/drivers/ieee802154/ieee802154_cc2520.c +++ b/drivers/ieee802154/ieee802154_cc2520.c @@ -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); diff --git a/drivers/ieee802154/ieee802154_kw41z.c b/drivers/ieee802154/ieee802154_kw41z.c index 8b724df7ab5..3bcc332a183 100644 --- a/drivers/ieee802154/ieee802154_kw41z.c +++ b/drivers/ieee802154/ieee802154_kw41z.c @@ -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 */ diff --git a/drivers/ieee802154/ieee802154_mcr20a.c b/drivers/ieee802154/ieee802154_mcr20a.c index c58cdb1792d..ff3c6ba89a5 100644 --- a/drivers/ieee802154/ieee802154_mcr20a.c +++ b/drivers/ieee802154/ieee802154_mcr20a.c @@ -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), diff --git a/drivers/ieee802154/ieee802154_nrf5.c b/drivers/ieee802154/ieee802154_nrf5.c index bf45987bfd8..92fb62a8d60 100644 --- a/drivers/ieee802154/ieee802154_nrf5.c +++ b/drivers/ieee802154/ieee802154_nrf5.c @@ -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); diff --git a/drivers/ieee802154/ieee802154_rf2xx.c b/drivers/ieee802154/ieee802154_rf2xx.c index dc46807809e..65dcc6f2930 100644 --- a/drivers/ieee802154/ieee802154_rf2xx.c +++ b/drivers/ieee802154/ieee802154_rf2xx.c @@ -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, \ diff --git a/drivers/ieee802154/ieee802154_uart_pipe.c b/drivers/ieee802154/ieee802154_uart_pipe.c index 36eefc8e32d..e695fa275cd 100644 --- a/drivers/ieee802154/ieee802154_uart_pipe.c +++ b/drivers/ieee802154/ieee802154_uart_pipe.c @@ -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); diff --git a/drivers/modem/ublox-sara-r4.c b/drivers/modem/ublox-sara-r4.c index d0df425205a..a8ba53cedfa 100644 --- a/drivers/modem/ublox-sara-r4.c +++ b/drivers/modem/ublox-sara-r4.c @@ -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); diff --git a/drivers/modem/wncm14a2a.c b/drivers/modem/wncm14a2a.c index 7f543721ca3..c3fb43af72d 100644 --- a/drivers/modem/wncm14a2a.c +++ b/drivers/modem/wncm14a2a.c @@ -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); diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 982b6b51d99..ef1f94fbbac 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c @@ -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); diff --git a/drivers/net/ppp.c b/drivers/net/ppp.c index 3a8ecf18576..8a5bb8f7ecb 100644 --- a/drivers/net/ppp.c +++ b/drivers/net/ppp.c @@ -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); diff --git a/drivers/net/slip.c b/drivers/net/slip.c index 47658c7cb7d..29a9a05de81 100644 --- a/drivers/net/slip.c +++ b/drivers/net/slip.c @@ -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 diff --git a/drivers/wifi/esp/esp.c b/drivers/wifi/esp/esp.c index 50ddc443392..47e7661c348 100644 --- a/drivers/wifi/esp/esp.c +++ b/drivers/wifi/esp/esp.c @@ -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); diff --git a/drivers/wifi/eswifi/eswifi_core.c b/drivers/wifi/eswifi/eswifi_core.c index 5942a69e79f..d8c773c573f 100644 --- a/drivers/wifi/eswifi/eswifi_core.c +++ b/drivers/wifi/eswifi/eswifi_core.c @@ -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); diff --git a/drivers/wifi/simplelink/simplelink.c b/drivers/wifi/simplelink/simplelink.c index 2392245c70a..660450fdcea 100644 --- a/drivers/wifi/simplelink/simplelink.c +++ b/drivers/wifi/simplelink/simplelink.c @@ -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); diff --git a/drivers/wifi/winc1500/wifi_winc1500.c b/drivers/wifi/winc1500/wifi_winc1500.c index 9d4ada4fce4..36cc4a6cf62 100644 --- a/drivers/wifi/winc1500/wifi_winc1500.c +++ b/drivers/wifi/winc1500/wifi_winc1500.c @@ -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); diff --git a/include/net/ethernet.h b/include/net/ethernet.h index 6ef12d93d45..843ebd14ea0 100644 --- a/include/net/ethernet.h +++ b/include/net/ethernet.h @@ -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) diff --git a/include/net/net_if.h b/include/net/net_if.h index d32c80660c3..b9a98507009 100644 --- a/include/net/net_if.h +++ b/include/net/net_if.h @@ -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 diff --git a/subsys/usb/class/netusb/netusb.c b/subsys/usb/class/netusb/netusb.c index 8ab892f5630..6bdb9acd108 100644 --- a/subsys/usb/class/netusb/netusb.c +++ b/subsys/usb/class/netusb/netusb.c @@ -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); diff --git a/tests/net/6lo/src/main.c b/tests/net/6lo/src/main.c index 64d18bf6037..0a779c279a9 100644 --- a/tests/net/6lo/src/main.c +++ b/tests/net/6lo/src/main.c @@ -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); diff --git a/tests/net/all/src/main.c b/tests/net/all/src/main.c index adb0358ac95..2309bf6eac5 100644 --- a/tests/net/all/src/main.c +++ b/tests/net/all/src/main.c @@ -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); diff --git a/tests/net/arp/src/main.c b/tests/net/arp/src/main.c index 7e24d7de4cf..fb6f1d41ce5 100644 --- a/tests/net/arp/src/main.c +++ b/tests/net/arp/src/main.c @@ -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); diff --git a/tests/net/checksum_offload/src/main.c b/tests/net/checksum_offload/src/main.c index 478410aad6c..c297d3e724b 100644 --- a/tests/net/checksum_offload/src/main.c +++ b/tests/net/checksum_offload/src/main.c @@ -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, ð_context_offloading_disabled, - NULL, CONFIG_ETH_INIT_PRIORITY, + eth_init, device_pm_control_nop, + ð_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, ð_context_offloading_enabled, - NULL, CONFIG_ETH_INIT_PRIORITY, + eth_init, device_pm_control_nop, + ð_context_offloading_enabled, NULL, + CONFIG_ETH_INIT_PRIORITY, &api_funcs_offloading_enabled, NET_ETH_MTU); diff --git a/tests/net/context/src/main.c b/tests/net/context/src/main.c index e6e007144af..78d0d1c708c 100644 --- a/tests/net/context/src/main.c +++ b/tests/net/context/src/main.c @@ -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); diff --git a/tests/net/dhcpv4/src/main.c b/tests/net/dhcpv4/src/main.c index 8d23640e9d6..271d525d9ee 100644 --- a/tests/net/dhcpv4/src/main.c +++ b/tests/net/dhcpv4/src/main.c @@ -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); diff --git a/tests/net/ethernet_mgmt/src/main.c b/tests/net/ethernet_mgmt/src/main.c index 99a6846d5c4..2daf4da5c75 100644 --- a/tests/net/ethernet_mgmt/src/main.c +++ b/tests/net/ethernet_mgmt/src/main.c @@ -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, ð_fake_data, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, - NET_ETH_MTU); +ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop, + ð_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY, + ð_fake_api_funcs, NET_ETH_MTU); static void test_change_mac_when_up(void) { diff --git a/tests/net/hostname/src/main.c b/tests/net/hostname/src/main.c index f006720e56c..3d7f703ea33 100644 --- a/tests/net/hostname/src/main.c +++ b/tests/net/hostname/src/main.c @@ -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, ð_fake_data, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, - NET_ETH_MTU); +ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop, + ð_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY, + ð_fake_api_funcs, NET_ETH_MTU); #if NET_LOG_LEVEL >= LOG_LEVEL_DBG static const char *iface2str(struct net_if *iface) diff --git a/tests/net/icmpv4/src/main.c b/tests/net/icmpv4/src/main.c index f87cb062c2c..7c77b1a4487 100644 --- a/tests/net/icmpv4/src/main.c +++ b/tests/net/icmpv4/src/main.c @@ -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); diff --git a/tests/net/ieee802154/fragment/src/main.c b/tests/net/ieee802154/fragment/src/main.c index 465d375a311..2265ce37061 100644 --- a/tests/net/ieee802154/fragment/src/main.c +++ b/tests/net/ieee802154/fragment/src/main.c @@ -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); diff --git a/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c b/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c index 5cefd657b19..7307bd02f62 100644 --- a/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c +++ b/tests/net/ieee802154/l2/src/ieee802154_fake_driver.c @@ -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); diff --git a/tests/net/iface/src/main.c b/tests/net/iface/src/main.c index 742f3bcb012..1edc42b5907 100644 --- a/tests/net/iface/src/main.c +++ b/tests/net/iface/src/main.c @@ -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, ð_fake_data, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, - NET_ETH_MTU); +ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop, + ð_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY, + ð_fake_api_funcs, NET_ETH_MTU); #if NET_LOG_LEVEL >= LOG_LEVEL_DBG static const char *iface2str(struct net_if *iface) diff --git a/tests/net/ip-addr/src/main.c b/tests/net/ip-addr/src/main.c index a6ed264c4e4..6c7dc8bcd8a 100644 --- a/tests/net/ip-addr/src/main.c +++ b/tests/net/ip-addr/src/main.c @@ -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); diff --git a/tests/net/ipv6/src/main.c b/tests/net/ipv6/src/main.c index 44ec4c96f19..b5ba0c983f9 100644 --- a/tests/net/ipv6/src/main.c +++ b/tests/net/ipv6/src/main.c @@ -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); diff --git a/tests/net/ipv6_fragment/src/main.c b/tests/net/ipv6_fragment/src/main.c index 159670d3192..81bcb3cea73 100644 --- a/tests/net/ipv6_fragment/src/main.c +++ b/tests/net/ipv6_fragment/src/main.c @@ -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, diff --git a/tests/net/lib/dns_addremove/src/main.c b/tests/net/lib/dns_addremove/src/main.c index 5fcc10ce1e9..48db766dc8c 100644 --- a/tests/net/lib/dns_addremove/src/main.c +++ b/tests/net/lib/dns_addremove/src/main.c @@ -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, diff --git a/tests/net/lib/dns_resolve/src/main.c b/tests/net/lib/dns_resolve/src/main.c index 76dedfaa837..9cd58b946c2 100644 --- a/tests/net/lib/dns_resolve/src/main.c +++ b/tests/net/lib/dns_resolve/src/main.c @@ -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, diff --git a/tests/net/mgmt/src/mgmt.c b/tests/net/mgmt/src/mgmt.c index 8fffa4512f9..00fa9323c17 100644 --- a/tests/net/mgmt/src/mgmt.c +++ b/tests/net/mgmt/src/mgmt.c @@ -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) diff --git a/tests/net/mld/src/main.c b/tests/net/mld/src/main.c index f4ba03d16c4..43589960b59 100644 --- a/tests/net/mld/src/main.c +++ b/tests/net/mld/src/main.c @@ -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); diff --git a/tests/net/net_pkt/src/main.c b/tests/net/net_pkt/src/main.c index 05630fe0592..0899080ce7d 100644 --- a/tests/net/net_pkt/src/main.c +++ b/tests/net/net_pkt/src/main.c @@ -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); diff --git a/tests/net/promiscuous/src/main.c b/tests/net/promiscuous/src/main.c index da2f9cf4c58..0d9096a26eb 100644 --- a/tests/net/promiscuous/src/main.c +++ b/tests/net/promiscuous/src/main.c @@ -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, ð_fake_data1, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, - NET_ETH_MTU); +ETH_NET_DEVICE_INIT(eth_fake1, "eth_fake1", + eth_fake_init, device_pm_control_nop, + ð_fake_data1, NULL, CONFIG_ETH_INIT_PRIORITY, + ð_fake_api_funcs, NET_ETH_MTU); -ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", eth_fake_init, ð_fake_data2, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, - NET_ETH_MTU); +ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", + eth_fake_init, device_pm_control_nop, + ð_fake_data2, NULL, CONFIG_ETH_INIT_PRIORITY, + ð_fake_api_funcs, NET_ETH_MTU); #if NET_LOG_LEVEL >= LOG_LEVEL_DBG static const char *iface2str(struct net_if *iface) diff --git a/tests/net/ptp/clock/src/main.c b/tests/net/ptp/clock/src/main.c index 61814646502..131a2d661d0 100644 --- a/tests/net/ptp/clock/src/main.c +++ b/tests/net/ptp/clock/src/main.c @@ -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, ð_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, + ð_context_1, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU); -ETH_NET_DEVICE_INIT(eth_test_2, "eth_test_2", eth_init, ð_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, + ð_context_2, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU); -ETH_NET_DEVICE_INIT(eth_test_3, "eth_test_3", eth_init, ð_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, + ð_context_3, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU); static u64_t timestamp_to_nsec(struct net_ptp_time *ts) diff --git a/tests/net/route/src/main.c b/tests/net/route/src/main.c index 7709ea4fc6b..4463b14b02c 100644 --- a/tests/net/route/src/main.c +++ b/tests/net/route/src/main.c @@ -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) { diff --git a/tests/net/shell/src/main.c b/tests/net/shell/src/main.c index 9ebd4a3d3bd..b4b82ff9903 100644 --- a/tests/net/shell/src/main.c +++ b/tests/net/shell/src/main.c @@ -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); diff --git a/tests/net/socket/af_packet/src/main.c b/tests/net/socket/af_packet/src/main.c index 82bc4466f56..ac3acf0738d 100644 --- a/tests/net/socket/af_packet/src/main.c +++ b/tests/net/socket/af_packet/src/main.c @@ -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, ð_fake_data1, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, +ETH_NET_DEVICE_INIT(eth_fake1, "eth_fake1", eth_fake_init, + device_pm_control_nop, ð_fake_data1, NULL, + CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, NET_ETH_MTU); -ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", eth_fake_init, ð_fake_data2, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, +ETH_NET_DEVICE_INIT(eth_fake2, "eth_fake2", eth_fake_init, + device_pm_control_nop, ð_fake_data2, NULL, + CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, NET_ETH_MTU); static int setup_socket(struct net_if *iface) diff --git a/tests/net/socket/net_mgmt/src/main.c b/tests/net/socket/net_mgmt/src/main.c index d3473c5aaa2..0cf57e5159d 100644 --- a/tests/net/socket/net_mgmt/src/main.c +++ b/tests/net/socket/net_mgmt/src/main.c @@ -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, ð_fake_data, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, - NET_ETH_MTU); +ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop, + ð_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY, + ð_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) diff --git a/tests/net/socket/udp/src/main.c b/tests/net/socket/udp/src/main.c index 2e97f1db84c..7ce90c87dad 100644 --- a/tests/net/socket/udp/src/main.c +++ b/tests/net/socket/udp/src/main.c @@ -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, ð_fake_data, - NULL, CONFIG_ETH_INIT_PRIORITY, ð_fake_api_funcs, - NET_ETH_MTU); +ETH_NET_DEVICE_INIT(eth_fake, "eth_fake", eth_fake_init, device_pm_control_nop, + ð_fake_data, NULL, CONFIG_ETH_INIT_PRIORITY, + ð_fake_api_funcs, NET_ETH_MTU); static void setup_eth(void) { diff --git a/tests/net/tcp/src/main.c b/tests/net/tcp/src/main.c index 7a3414ee8e4..df84bf4fa7e 100644 --- a/tests/net/tcp/src/main.c +++ b/tests/net/tcp/src/main.c @@ -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) { diff --git a/tests/net/traffic_class/src/main.c b/tests/net/traffic_class/src/main.c index 0594a6fc1dd..0a4f1c14974 100644 --- a/tests/net/traffic_class/src/main.c +++ b/tests/net/traffic_class/src/main.c @@ -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, ð_context, - NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, +NET_DEVICE_INIT(eth_test, "eth_test", eth_init, device_pm_control_nop, + ð_context, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, DUMMY_L2, NET_L2_GET_CTX_TYPE(DUMMY_L2), NET_ETH_MTU); diff --git a/tests/net/tx_timestamp/src/main.c b/tests/net/tx_timestamp/src/main.c index bfc8039bfe6..e6c62cba997 100644 --- a/tests/net/tx_timestamp/src/main.c +++ b/tests/net/tx_timestamp/src/main.c @@ -152,12 +152,12 @@ static int eth_init(struct device *dev) return 0; } -ETH_NET_DEVICE_INIT(eth_test, "eth_test", eth_init, ð_context, - NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, +ETH_NET_DEVICE_INIT(eth_test, "eth_test", eth_init, device_pm_control_nop, + ð_context, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU); -ETH_NET_DEVICE_INIT(eth_test2, "eth_test2", eth_init, ð_context2, - NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, +ETH_NET_DEVICE_INIT(eth_test2, "eth_test2", eth_init, device_pm_control_nop, + ð_context2, NULL, CONFIG_ETH_INIT_PRIORITY, &api_funcs, NET_ETH_MTU); static void timestamp_callback(struct net_pkt *pkt) diff --git a/tests/net/udp/src/main.c b/tests/net/udp/src/main.c index 55a26b459ea..41379022063 100644 --- a/tests/net/udp/src/main.c +++ b/tests/net/udp/src/main.c @@ -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); diff --git a/tests/net/vlan/src/main.c b/tests/net/vlan/src/main.c index 4b03bd3e7bd..c806e67612c 100644 --- a/tests/net/vlan/src/main.c +++ b/tests/net/vlan/src/main.c @@ -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, ð_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, ð_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, + ð_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,