[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 15/24] s390-ccw.img: Detect devices with stsch.
From: |
Alexander Graf |
Subject: |
[Qemu-ppc] [PATCH 15/24] s390-ccw.img: Detect devices with stsch. |
Date: |
Fri, 26 Apr 2013 20:19:24 +0200 |
From: Cornelia Huck <address@hidden>
stsch is the canonical way to detect devices. As a bonus, we can
abort the loop if we get cc 3, and we need to check only the valid
devices (dnv set).
Signed-off-by: Cornelia Huck <address@hidden>
Signed-off-by: Alexander Graf <address@hidden>
---
pc-bios/s390-ccw/main.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/pc-bios/s390-ccw/main.c b/pc-bios/s390-ccw/main.c
index 67f4987..fd40fa5 100644
--- a/pc-bios/s390-ccw/main.c
+++ b/pc-bios/s390-ccw/main.c
@@ -22,7 +22,7 @@ void virtio_panic(const char *string)
static void virtio_setup(void)
{
- struct irb irb;
+ struct schib schib;
int i;
int r;
bool found = false;
@@ -31,8 +31,11 @@ static void virtio_setup(void)
for (i = 0; i < 0x10000; i++) {
blk_schid.sch_no = i;
- r = tsch(blk_schid, &irb);
- if (r != 3) {
+ r = stsch_err(blk_schid, &schib);
+ if (r == 3) {
+ break;
+ }
+ if (schib.pmcw.dnv) {
if (virtio_is_blk(blk_schid)) {
found = true;
break;
--
1.6.0.2
- [Qemu-ppc] [PATCH 10/24] S390: ccw firmware: Add Makefile, (continued)
- [Qemu-ppc] [PATCH 10/24] S390: ccw firmware: Add Makefile, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 12/24] s390-ccw.img: build s390-ccw rom on s3900 system by default, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 14/24] s390-ccw.img: Fix compile warning in s390 ccw virtio code, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 05/24] S390: ccw firmware: Add main program, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 08/24] S390: ccw firmware: Add glue header, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 09/24] S390: ccw firmware: Add bootmap interpreter, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 18/24] s390-ccw.img: Get queue config from host., Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 23/24] Utilize selective runtime reg sync for hot code paths, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 20/24] S390: CCW: Use new, working firmware by default, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 06/24] S390: ccw firmware: Add sclp output, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 15/24] s390-ccw.img: Detect devices with stsch.,
Alexander Graf <=
- [Qemu-ppc] [PATCH 03/24] S390: IPL: Use different firmware for different machines, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 17/24] s390-ccw.img: Rudimentary error checking., Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 24/24] virtio-rng-s390: add properties., Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 21/24] Common: Add quick access to first boot device, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 16/24] s390-ccw.img: Enhance drain_irqs()., Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 22/24] Allow selective runtime register synchronization, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 19/24] S390: ccw firmware: Add compiled blob, Alexander Graf, 2013/04/26
- [Qemu-ppc] [PATCH 07/24] S390: ccw firmware: Add virtio device drivers, Alexander Graf, 2013/04/26
- Re: [Qemu-ppc] [PULL 00/24] s390 patch queue 2013-04-26, Alexander Graf, 2013/04/26
- Re: [Qemu-ppc] [PULL 00/24] s390 patch queue 2013-04-26, Blue Swirl, 2013/04/26