public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Pierre Morel <pmorel@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: frankja@linux.ibm.com, david@redhat.com, thuth@redhat.com,
	cohuck@redhat.com, imbrenda@linux.ibm.com, drjones@redhat.com
Subject: [kvm-unit-tests PATCH 2/7] s390x: css: add callback for emnumeration
Date: Fri, 27 Aug 2021 12:17:15 +0200	[thread overview]
Message-ID: <1630059440-15586-3-git-send-email-pmorel@linux.ibm.com> (raw)
In-Reply-To: <1630059440-15586-1-git-send-email-pmorel@linux.ibm.com>

We will need to look for a device inside the channel subsystem
based upon device specificities.

Let's provide a callback for an upper layer to be called during
the enumeration of the channel subsystem.

Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>
---
 lib/s390x/css.h     | 3 ++-
 lib/s390x/css_lib.c | 4 +++-
 s390x/css.c         | 2 +-
 3 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/s390x/css.h b/lib/s390x/css.h
index d644971f..2005f4d7 100644
--- a/lib/s390x/css.h
+++ b/lib/s390x/css.h
@@ -278,7 +278,8 @@ void dump_irb(struct irb *irbp);
 void dump_pmcw(struct pmcw *p);
 void dump_orb(struct orb *op);
 
-int css_enumerate(void);
+typedef int (enumerate_cb_t)(int);
+int css_enumerate(enumerate_cb_t *f);
 #define MAX_ENABLE_RETRIES      5
 
 #define IO_SCH_ISC      3
diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c
index efc70576..484f9c41 100644
--- a/lib/s390x/css_lib.c
+++ b/lib/s390x/css_lib.c
@@ -117,7 +117,7 @@ bool get_chsc_scsc(void)
  * On success return the first subchannel ID found.
  * On error return an invalid subchannel ID containing cc
  */
-int css_enumerate(void)
+int css_enumerate(enumerate_cb_t *f)
 {
 	struct pmcw *pmcw = &schib.pmcw;
 	int scn_found = 0;
@@ -153,6 +153,8 @@ int css_enumerate(void)
 			schid = scn | SCHID_ONE;
 		report_info("Found subchannel %08x", scn | SCHID_ONE);
 		dev_found++;
+		if (f)
+			f(scn | SCHID_ONE);
 	}
 
 out:
diff --git a/s390x/css.c b/s390x/css.c
index c340c539..b50fbc67 100644
--- a/s390x/css.c
+++ b/s390x/css.c
@@ -29,7 +29,7 @@ struct ccw1 *ccw;
 
 static void test_enumerate(void)
 {
-	test_device_sid = css_enumerate();
+	test_device_sid = css_enumerate(NULL);
 	if (test_device_sid & SCHID_ONE) {
 		report(1, "Schid of first I/O device: 0x%08x", test_device_sid);
 		return;
-- 
2.25.1


  parent reply	other threads:[~2021-08-27 10:17 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-27 10:17 [kvm-unit-tests PATCH 0/7] Extending VIRTIO with a data transfer test Pierre Morel
2021-08-27 10:17 ` [kvm-unit-tests PATCH 1/7] arm: virtio: move VIRTIO transport initialization inside virtio-mmio Pierre Morel
2021-11-03  7:00   ` Thomas Huth
2021-11-03  7:41     ` Andrew Jones
2021-11-08 12:20       ` Pierre Morel
2021-08-27 10:17 ` Pierre Morel [this message]
2021-11-03  7:29   ` [kvm-unit-tests PATCH 2/7] s390x: css: add callback for emnumeration Thomas Huth
2021-11-08 12:21     ` Pierre Morel
2021-08-27 10:17 ` [kvm-unit-tests PATCH 3/7] s390x: virtio: CCW transport implementation Pierre Morel
2021-11-03  7:46   ` Andrew Jones
2021-11-08 12:35     ` Pierre Morel
2021-11-03  7:49   ` Thomas Huth
2021-11-08 12:34     ` Pierre Morel
2021-11-09  7:01       ` Thomas Huth
2021-11-09  8:51         ` Pierre Morel
2021-08-27 10:17 ` [kvm-unit-tests PATCH 4/7] s390x: css: registering IRQ Pierre Morel
2021-11-03  8:01   ` Thomas Huth
2021-11-08 12:36     ` Pierre Morel
2021-08-27 10:17 ` [kvm-unit-tests PATCH 5/7] virtio: implement the virtio_add_inbuf routine Pierre Morel
2021-11-03  7:51   ` Andrew Jones
2021-11-08 12:36     ` Pierre Morel
2021-08-27 10:17 ` [kvm-unit-tests PATCH 6/7] s390x: virtio tests setup Pierre Morel
2021-11-03  7:56   ` Andrew Jones
2021-11-03  8:14     ` Thomas Huth
2021-11-08 13:00       ` Pierre Morel
2021-11-09  7:10         ` Thomas Huth
2021-11-09  8:42           ` Andrew Jones
2021-11-09  9:01             ` Pierre Morel
2021-11-08 12:53     ` Pierre Morel
2021-08-27 10:17 ` [kvm-unit-tests PATCH 7/7] s390x: virtio data transfer Pierre Morel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1630059440-15586-3-git-send-email-pmorel@linux.ibm.com \
    --to=pmorel@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=david@redhat.com \
    --cc=drjones@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox