2014-02-09 12:24:15 +01:00
|
|
|
/*
|
|
|
|
* QTest testcase for IndustryPack Octal-RS232
|
|
|
|
*
|
|
|
|
* Copyright (c) 2014 SUSE LINUX Products GmbH
|
|
|
|
*
|
|
|
|
* This work is licensed under the terms of the GNU GPL, version 2 or later.
|
|
|
|
* See the COPYING file in the top-level directory.
|
|
|
|
*/
|
|
|
|
|
2016-02-08 19:08:51 +01:00
|
|
|
#include "qemu/osdep.h"
|
2022-03-30 11:39:05 +02:00
|
|
|
#include "libqtest.h"
|
2019-05-23 16:35:07 +02:00
|
|
|
#include "qemu/module.h"
|
2018-08-17 12:48:27 +02:00
|
|
|
#include "libqos/qgraph.h"
|
|
|
|
|
|
|
|
typedef struct QIpoctal232 QIpoctal232;
|
|
|
|
|
|
|
|
struct QIpoctal232 {
|
|
|
|
QOSGraphObject obj;
|
|
|
|
};
|
2014-02-09 12:24:15 +01:00
|
|
|
|
|
|
|
/* Tests only initialization so far. TODO: Replace with functional tests */
|
2018-08-17 12:48:27 +02:00
|
|
|
static void nop(void *obj, void *data, QGuestAllocator *alloc)
|
2014-02-09 12:24:15 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2018-08-17 12:48:27 +02:00
|
|
|
static void *ipoctal232_create(void *pci_bus, QGuestAllocator *alloc,
|
|
|
|
void *addr)
|
2014-02-09 12:24:15 +01:00
|
|
|
{
|
2018-08-17 12:48:27 +02:00
|
|
|
QIpoctal232 *ipoctal232 = g_new0(QIpoctal232, 1);
|
2014-02-09 12:24:15 +01:00
|
|
|
|
2018-08-17 12:48:27 +02:00
|
|
|
return &ipoctal232->obj;
|
|
|
|
}
|
2014-02-09 12:24:15 +01:00
|
|
|
|
2018-08-17 12:48:27 +02:00
|
|
|
static void ipoctal232_register_nodes(void)
|
|
|
|
{
|
|
|
|
qos_node_create_driver("ipoctal232", ipoctal232_create);
|
|
|
|
qos_node_consumes("ipoctal232", "ipack", &(QOSGraphEdgeOptions) {
|
|
|
|
.extra_device_opts = "bus=ipack0.0",
|
|
|
|
});
|
|
|
|
}
|
2014-02-09 12:24:15 +01:00
|
|
|
|
2018-08-17 12:48:27 +02:00
|
|
|
libqos_init(ipoctal232_register_nodes);
|
2014-02-09 12:24:15 +01:00
|
|
|
|
2018-08-17 12:48:27 +02:00
|
|
|
static void register_ipoctal232_test(void)
|
|
|
|
{
|
|
|
|
qos_add_test("nop", "ipoctal232", nop, NULL);
|
2014-02-09 12:24:15 +01:00
|
|
|
}
|
2018-08-17 12:48:27 +02:00
|
|
|
|
|
|
|
libqos_init(register_ipoctal232_test);
|