Because there is no need to setup interface not supported by target,
check availability of interface and ignore the target which is not
available. Since this, the interface not providing available function
will be also ignored.
Change-Id: Ic7cf11e2d46bd6b979cc02a87cb392cfb04ed399
Signed-off-by: Dongwoo Lee <dwoo08.lee@samsung.com>
LIST_FOREACH(driver, &interface_avail_list, entry) {
struct tfm_interface *intf;
+ if (!driver->ops.available) {
+ fprintf(stderr,
+ "Cannot check availability for interface %s.\n",
+ driver->name);
+ continue;
+ }
+
+ /* Ignore not supported interface */
+ if (!driver->ops.available())
+ continue;
+
intf = (struct tfm_interface *)malloc(sizeof(*intf));
if (!intf)
goto err;
int (*disconnect)(struct tfm_interface *intf);
ssize_t (*rx_data)(int fd, void *buf, ssize_t len);
ssize_t (*tx_data)(int fd, void *buf, ssize_t len);
+ int (*available)(void);
};
struct tfm_interface_driver {