ccid: Introduce ccid_slot_ops + implement simulator/stub for it
This adds a new interface to the CCID implementation, on the card/slot
side. The purpose of this interface (based on function pointers) is
to allow for different real hardware or virtual implementations.
Change-Id: I2c38aa69594a3b22bb5b5e256edfb48481e42793
diff --git a/ccid/ccid_main_functionfs.c b/ccid/ccid_main_functionfs.c
index e32fbf7..06ab0f3 100644
--- a/ccid/ccid_main_functionfs.c
+++ b/ccid/ccid_main_functionfs.c
@@ -139,6 +139,7 @@
#include <osmocom/core/logging.h>
#include "ccid_device.h"
+#include "ccid_slot_sim.h"
#ifndef FUNCTIONFS_SUPPORTS_POLL
#include <libaio.h>
@@ -509,7 +510,7 @@
signal(SIGUSR1, &signal_handler);
- ccid_instance_init(&ci, &c_ops, "", &ufh);
+ ccid_instance_init(&ci, &c_ops, &slotsim_slot_ops, "", &ufh);
ufh.ccid_handle = &ci;
if (argc < 2) {