1 \ *****************************************************************************
2 \ * Copyright (c) 2011 IBM Corporation
3 \ * All rights reserved.
4 \ * This program and the accompanying materials
5 \ * are made available under the terms of the BSD License
6 \ * which accompanies this distribution, and is available at
7 \ * http://www.opensource.org/licenses/bsd-license.php
10 \ * IBM Corporation - initial implementation
11 \ ****************************************************************************/
13 \ ." Populating " pwd cr
15 s" network" device-type
17 INSTANCE VARIABLE obp-tftp-package
19 virtio-setup-vd VALUE virtiodev
20 0 VALUE virtio-net-priv
23 \ Set up MAC address from config virtqueue
26 s" local-mac-address" get-node get-property not IF 2drop EXIT THEN
28 virtiodev i 1 virtio-get-config
31 local-mac 6 encode-bytes s" local-mac-address" property
37 \ my-unit 1 rtas-set-tce-bypass
38 virtiodev virtio-net-open not IF ." virtio-net-open failed" false EXIT THEN
47 my-args s" obp-tftp" $open-package obp-tftp-package !
48 open-count 1 + to open-count
54 open-count 1 - dup to open-count
56 virtio-net-priv virtio-net-close
57 \ my-unit 0 rtas-set-tce-bypass
61 s" close" obp-tftp-package @ $call-method
64 : read ( buf len -- actual )
72 : write ( buf len -- actual )
80 : load ( addr -- len )
81 s" load" obp-tftp-package @ $call-method
85 s" ping" obp-tftp-package @ $call-method
89 " net" get-next-alias ?dup IF
90 get-node node>path set-alias