diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2016-02-01 11:18:03 +0530 |
---|---|---|
committer | Alexey Kardashevskiy <aik@ozlabs.ru> | 2016-02-08 16:40:39 +1100 |
commit | aa9566d2ed5c4fdcaa385759475c75bb0d0801d4 (patch) | |
tree | daa8fa79c2720690ed98fc8b2ca7281729ffde61 /lib/libvirtio/virtio.code | |
parent | 31312dcf4430c372318ed56ba5a9006fc6546d8d (diff) | |
download | SLOF-aa9566d2ed5c4fdcaa385759475c75bb0d0801d4.zip SLOF-aa9566d2ed5c4fdcaa385759475c75bb0d0801d4.tar.gz SLOF-aa9566d2ed5c4fdcaa385759475c75bb0d0801d4.tar.bz2 |
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 <nikunj@linux.vnet.ibm.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Diffstat (limited to 'lib/libvirtio/virtio.code')
-rw-r--r-- | lib/libvirtio/virtio.code | 8 |
1 files changed, 3 insertions, 5 deletions
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; |