|
|
1.1 root 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
8: \ *
9: \ * Contributors:
10: \ * IBM Corporation - initial implementation
11: \ ****************************************************************************/
12:
13: \ ." Populating " pwd cr
14:
15: s" network" device-type
16:
17: INSTANCE VARIABLE obp-tftp-package
18:
19: /vd-len BUFFER: virtiodev
20: virtiodev virtio-setup-vd
21:
22: : open ( -- okay? )
23: open IF
24: \ my-unit 1 rtas-set-tce-bypass
25: my-args s" obp-tftp" $open-package obp-tftp-package !
26: true
27: ELSE
28: false
29: THEN
30: ;
31:
32: : close ( -- )
33: s" close" obp-tftp-package @ $call-method
34: \ my-unit 0 rtas-set-tce-bypass
35: close
36: ;
37:
38: : load ( addr -- len )
39: s" load" obp-tftp-package @ $call-method
40: ;
41:
42: : ping ( -- )
43: s" ping" obp-tftp-package @ $call-method
44: ;
45:
46: \ Set up MAC address from config virtqueue
47: 6 BUFFER: local-mac
48: : setup-mac ( -- )
49: 6 0 DO
50: virtiodev i 1 virtio-get-config
51: local-mac i + c!
52: LOOP
53: local-mac 6 encode-bytes s" local-mac-address" property
54: ;
55: setup-mac
56:
57: : setup-alias ( -- )
58: s" net" find-alias 0= IF
59: s" net" get-node node>path set-alias
60: ELSE
61: drop
62: THEN
63: ;
64: setup-alias
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.