[SLOF] [PATCH v3 12/22] virtio-net: move setup-mac to the open routine
Nikunj A Dadhania
nikunj at linux.vnet.ibm.com
Fri Jan 22 21:54:55 AEDT 2016
MAC reading should be done after the initialization of the device after
the features negotiation.
Signed-off-by: Nikunj A Dadhania <nikunj at linux.vnet.ibm.com>
---
board-qemu/slof/virtio-net.fs | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/board-qemu/slof/virtio-net.fs b/board-qemu/slof/virtio-net.fs
index 412b34f..130ee15 100644
--- a/board-qemu/slof/virtio-net.fs
+++ b/board-qemu/slof/virtio-net.fs
@@ -21,9 +21,21 @@ virtiodev virtio-setup-vd
0 VALUE virtio-net-priv
0 VALUE open-count
+\ Set up MAC address from config virtqueue
+6 BUFFER: local-mac
+: setup-mac ( -- )
+ s" local-mac-address" get-node get-property not IF 2drop EXIT THEN
+ 6 0 DO
+ virtiodev i 1 virtio-get-config
+ local-mac i + c!
+ LOOP
+ local-mac 6 encode-bytes s" local-mac-address" property
+;
+
: open ( -- okay? )
open-count 0= IF
open IF
+ setup-mac
\ my-unit 1 rtas-set-tce-bypass
s" local-mac-address" get-node get-property not IF
virtiodev virtio-net-open dup not IF ." virtio-net-open failed" EXIT THEN
@@ -77,17 +89,6 @@ virtiodev virtio-setup-vd
s" ping" obp-tftp-package @ $call-method
;
-\ Set up MAC address from config virtqueue
-6 BUFFER: local-mac
-: setup-mac ( -- )
- 6 0 DO
- virtiodev i 1 virtio-get-config
- local-mac i + c!
- LOOP
- local-mac 6 encode-bytes s" local-mac-address" property
-;
-setup-mac
-
: setup-alias ( -- )
" net" get-next-alias ?dup IF
get-node node>path set-alias
--
2.5.0
More information about the SLOF
mailing list