return -ENOMEM;
}
+void rndis_handler(int enable);
+
#define DEFINE_USB_FUNCTION(_id, _name, _ffs_service, _service, _handler) \
static struct usb_function _##_name##_function = { \
.id = _id, \
DEFINE_USB_FUNCTION(USB_FUNCTION_SDB, sdb, "sdbd", NULL, NULL);
DEFINE_USB_FUNCTION(USB_FUNCTION_MTP, mtp, "mtp-responder", NULL, NULL);
DEFINE_USB_FUNCTION(USB_FUNCTION_ACM, acm, NULL, "data-router", NULL);
-DEFINE_USB_FUNCTION(USB_FUNCTION_RNDIS, rndis, NULL, "rndis", NULL);
+DEFINE_USB_FUNCTION(USB_FUNCTION_RNDIS, rndis, NULL, "sshd", rndis_handler);
#undef DEFINE_USB_FUNCTION
#define MAKE_FUNC_AVAILABLE(_name, _vname) \
#include <errno.h>
#include <string.h>
+#include <libsyscommon/dbus-systemd.h>
+
#define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
#define zalloc(amount) calloc(1, amount)
return ret;
}
+void rndis_handler(int enable)
+{
+ if (enable)
+ (void)systemd_start_unit_wait_started("rndis.service", NULL, -1);
+ else
+ (void)systemd_stop_unit_wait_stopped("rndis.service", NULL, -1);
+}
+
EXPORT
int simple_translator_open(struct hw_info *info,
const char *id, struct hw_common **common)