From 5c954c4641c7894636aa0533634ef4f5a6bed615 Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 6 Jan 2022 20:36:14 +0100 Subject: ethernet: new interface registration function Prep for supporting multiple callbacks, optional args, etc. Type: improvement Change-Id: I96244c098712e8213374678623f12527b0e7f387 Signed-off-by: Damjan Marion --- src/vnet/l2/l2_xcrw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/vnet/l2/l2_xcrw.c') diff --git a/src/vnet/l2/l2_xcrw.c b/src/vnet/l2/l2_xcrw.c index c2c325a796f..d848fac6b72 100644 --- a/src/vnet/l2/l2_xcrw.c +++ b/src/vnet/l2/l2_xcrw.c @@ -291,6 +291,7 @@ static u32 create_xcrw_interface (vlib_main_t * vm) { vnet_main_t *vnm = vnet_get_main (); + vnet_eth_interface_registration_t eir = {}; static u32 instance; u8 address[6]; u32 hw_if_index; @@ -301,10 +302,9 @@ create_xcrw_interface (vlib_main_t * vm) clib_memset (address, 0, sizeof (address)); address[2] = 0x12; - /* can returns error iff phy != 0 */ - (void) ethernet_register_interface - (vnm, xcrw_device_class.index, instance++, address, &hw_if_index, - /* flag change */ 0); + eir.dev_class_index = xcrw_device_class.index; + eir.dev_instance = instance++, eir.address = address; + hw_if_index = vnet_eth_register_interface (vnm, &eir); hi = vnet_get_hw_interface (vnm, hw_if_index); sw_if_index = hi->sw_if_index; -- cgit 1.2.3-korg