diff options
author | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-07-24 14:25:45 +0530 |
---|---|---|
committer | Nikunj A Dadhania <nikunj@linux.vnet.ibm.com> | 2013-07-24 14:46:21 +0530 |
commit | ec63c93846f3853ef1816b2126e48e009590be14 (patch) | |
tree | 154ba007e7206080759c95dc7f68f7d69522e1f9 /board-qemu/slof | |
parent | 0d3488393a2b729fc0888399e0f8e2491d279284 (diff) | |
download | SLOF-ec63c93846f3853ef1816b2126e48e009590be14.zip SLOF-ec63c93846f3853ef1816b2126e48e009590be14.tar.gz SLOF-ec63c93846f3853ef1816b2126e48e009590be14.tar.bz2 |
scsi: unify and use make-disk-alias
Combine both cdrom and disk alias creation.
[ some more scope of unifying discovery routine ]
Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Diffstat (limited to 'board-qemu/slof')
-rw-r--r-- | board-qemu/slof/vio-vscsi.fs | 28 | ||||
-rw-r--r-- | board-qemu/slof/virtio-scsi.fs | 29 |
2 files changed, 8 insertions, 49 deletions
diff --git a/board-qemu/slof/vio-vscsi.fs b/board-qemu/slof/vio-vscsi.fs index ca709f6..11bf48d 100644 --- a/board-qemu/slof/vio-vscsi.fs +++ b/board-qemu/slof/vio-vscsi.fs @@ -499,26 +499,6 @@ TRUE VALUE first-time-init? 10000 \ Larger value seem to have problems with some CDROMs ; -\ FIXME: Make these two common somewhat, possibly passing the -\ unit "name" as an argument -: make-disk-alias ( srplun -- ) - " disk" find-alias 0<> IF drop THEN - get-node node>path - 20 allot - " /disk@" string-cat \ srplun npath npathl - rot base @ >r hex (u.) r> base ! string-cat - " disk" 2swap set-alias -; - -: make-cdrom-alias ( srplun -- ) - " cdrom" find-alias 0<> IF drop THEN - get-node node>path - 20 allot - " /disk@" string-cat \ srplun npath npathl - rot base @ >r hex (u.) r> base ! string-cat - " cdrom" 2swap set-alias -; - \ FIXME: Most of the stuff below should be made common : wrapped-inquiry ( -- true | false ) @@ -578,10 +558,10 @@ TRUE VALUE first-time-init? \ and maybe provide better printout & more cases \ XXX FIXME: Actually check for LUNs sector inquiry-data>peripheral c@ CASE - 0 OF ." DISK : " current-target make-disk-alias ENDOF - 5 OF ." CD-ROM : " current-target make-cdrom-alias ENDOF - 7 OF ." OPTICAL : " current-target make-cdrom-alias ENDOF - e OF ." RED-BLOCK: " current-target make-disk-alias ENDOF + 0 OF ." DISK : " " disk" current-target make-disk-alias ENDOF + 5 OF ." CD-ROM : " " cdrom" current-target make-disk-alias ENDOF + 7 OF ." OPTICAL : " " cdrom" current-target make-disk-alias ENDOF + e OF ." RED-BLOCK: " " disk" current-target make-disk-alias ENDOF dup dup OF ." ? (" . 8 emit 29 emit 5 spaces ENDOF ENDCASE sector .inquiry-text cr diff --git a/board-qemu/slof/virtio-scsi.fs b/board-qemu/slof/virtio-scsi.fs index bedfe76..b910ab0 100644 --- a/board-qemu/slof/virtio-scsi.fs +++ b/board-qemu/slof/virtio-scsi.fs @@ -152,27 +152,6 @@ scsi-open lxjoin (set-target) ; -\ FIXME: Make these two common somewhat, possibly passing the -\ unit "name" as an argument - -: make-disk-alias ( srplun -- ) - " disk" find-alias 0<> IF drop THEN - get-node node>path - 20 allot - " /disk@" string-cat \ srplun npath npathl - rot base @ >r hex (u.) r> base ! string-cat - " disk" 2swap set-alias -; - -: make-cdrom-alias ( srplun -- ) - " cdrom" find-alias 0<> IF drop THEN - get-node node>path - 20 allot - " /disk@" string-cat \ srplun npath npathl - rot base @ >r hex (u.) r> base ! string-cat - " cdrom" 2swap set-alias -; - \ FIXME Remove use of "sector" : wrapped-inquiry ( -- true | false ) inquiry dup 0= IF drop false EXIT THEN @@ -202,10 +181,10 @@ CREATE sectorlun d# 512 allot \ and maybe provide better printout & more cases \ XXX FIXME: Actually check for LUNs sector inquiry-data>peripheral c@ CASE - 0 OF ." DISK : " current-target make-disk-alias ENDOF - 5 OF ." CD-ROM : " current-target make-cdrom-alias ENDOF - 7 OF ." OPTICAL : " current-target make-cdrom-alias ENDOF - e OF ." RED-BLOCK: " current-target make-disk-alias ENDOF + 0 OF ." DISK : " " disk" current-target make-disk-alias ENDOF + 5 OF ." CD-ROM : " " cdrom" current-target make-disk-alias ENDOF + 7 OF ." OPTICAL : " " cdrom" current-target make-disk-alias ENDOF + e OF ." RED-BLOCK: " " disk" current-target make-disk-alias ENDOF dup dup OF ." ? (" . 8 emit 29 emit 5 spaces ENDOF ENDCASE sector .inquiry-text cr |