From aa9566d2ed5c4fdcaa385759475c75bb0d0801d4 Mon Sep 17 00:00:00 2001 From: Nikunj A Dadhania Date: Mon, 1 Feb 2016 11:18:03 +0530 Subject: virtio-net: move setup-mac to the open routine MAC reading should be done after the initialization of the device after the features negotiation. Adjust the open routine accordingly. There is no point in sending the mac address to the virtionet_open. Change the signature. Also read the mac address directly from the config space to remove the dependency of getting the mac address from the open routine. Signed-off-by: Nikunj A Dadhania Reviewed-by: Thomas Huth Signed-off-by: Alexey Kardashevskiy --- lib/libvirtio/virtio.code | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/libvirtio/virtio.code') diff --git a/lib/libvirtio/virtio.code b/lib/libvirtio/virtio.code index 9e6c475..0c22ecc 100644 --- a/lib/libvirtio/virtio.code +++ b/lib/libvirtio/virtio.code @@ -122,14 +122,12 @@ MIRP /******** virtio-net ********/ -// : virtio-net-open ( mac-addr-str len dev -- false | [ driver true ] ) +// : virtio-net-open ( dev -- false | [ driver true ] ) PRIM(virtio_X2d_net_X2d_open) { - void *dev = TOS.a; POP; - int len = TOS.u; POP; - char *mac_addr = TOS.a; + void *dev = TOS.a; - net_driver_t *net_driver = virtionet_open(mac_addr, len, dev); + net_driver_t *net_driver = virtionet_open(dev); if (net_driver) { TOS.u = (unsigned long)net_driver; PUSH; -- cgit v1.1