aboutsummaryrefslogtreecommitdiff
path: root/pc-bios/s390-ccw/virtio.c
diff options
context:
space:
mode:
authorJason J. Herne <jjherne@linux.ibm.com>2019-04-04 10:34:24 -0400
committerThomas Huth <thuth@redhat.com>2019-04-12 12:40:35 +0200
commit120d04103e3f870d0fcd2a23c2ada0a4a4f036cc (patch)
tree1283b5381bf4f745a2202e601e53cf9172f48e3e /pc-bios/s390-ccw/virtio.c
parentd96c5db77f1058ee9509554f43b945c66b3aa7c9 (diff)
s390-bios: Decouple channel i/o logic from virtio
Create a separate library for channel i/o related code. This decouples channel i/o operations from virtio and allows us to make use of them for the real dasd boot path. Signed-off-by: Jason J. Herne <jjherne@linux.ibm.com> Reviewed-by: Cornelia Huck <cohuck@redhat.com> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <1554388475-18329-6-git-send-email-jjherne@linux.ibm.com> Signed-off-by: Thomas Huth <thuth@redhat.com>
Diffstat (limited to 'pc-bios/s390-ccw/virtio.c')
-rw-r--r--pc-bios/s390-ccw/virtio.c27
1 files changed, 2 insertions, 25 deletions
diff --git a/pc-bios/s390-ccw/virtio.c b/pc-bios/s390-ccw/virtio.c
index cdb66f459e..aa9da7253f 100644
--- a/pc-bios/s390-ccw/virtio.c
+++ b/pc-bios/s390-ccw/virtio.c
@@ -10,6 +10,7 @@
#include "libc.h"
#include "s390-ccw.h"
+#include "cio.h"
#include "virtio.h"
#include "virtio-scsi.h"
#include "bswap.h"
@@ -20,8 +21,6 @@ static VRing block[VIRTIO_MAX_VQS];
static char ring_area[VIRTIO_RING_SIZE * VIRTIO_MAX_VQS]
__attribute__((__aligned__(PAGE_SIZE)));
-static char chsc_page[PAGE_SIZE] __attribute__((__aligned__(PAGE_SIZE)));
-
static VDev vdev = {
.nr_vqs = 1,
.vrings = block,
@@ -94,14 +93,9 @@ static int run_ccw(VDev *vdev, int cmd, void *ptr, int len)
{
Ccw1 ccw = {};
CmdOrb orb = {};
- Schib schib;
int r;
- /* start command processing */
- stsch_err(vdev->schid, &schib);
- /* enable the subchannel for IPL device */
- schib.pmcw.ena = 1;
- msch(vdev->schid, &schib);
+ enable_subchannel(vdev->schid);
/* start subchannel command */
orb.fmt = 1;
@@ -343,20 +337,3 @@ bool virtio_is_supported(SubChannelId schid)
}
return false;
}
-
-int enable_mss_facility(void)
-{
- int ret;
- ChscAreaSda *sda_area = (ChscAreaSda *) chsc_page;
-
- memset(sda_area, 0, PAGE_SIZE);
- sda_area->request.length = 0x0400;
- sda_area->request.code = 0x0031;
- sda_area->operation_code = 0x2;
-
- ret = chsc(sda_area);
- if ((ret == 0) && (sda_area->response.code == 0x0001)) {
- return 0;
- }
- return -EIO;
-}