#include <linux/device.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/random.h>
static DEFINE_IDA(tb_domain_ida);
static bool match_service_id(const struct tb_service_id *id,
const struct tb_service *svc)
if (id->match_flags & TBSVC_MATCH_PROTOCOL_KEY) {
if (strcmp(id->protocol_key, svc->key))
if (id->match_flags & TBSVC_MATCH_PROTOCOL_ID) {
if (id->protocol_id != svc->prtcid)
if (id->match_flags & TBSVC_MATCH_PROTOCOL_VERSION) {
if (id->protocol_version != svc->prtcvers)
if (id->match_flags & TBSVC_MATCH_PROTOCOL_VERSION) {
if (id->protocol_revision != svc->prtcrevs)
static const struct tb_service_id *__tb_service_match(struct device *dev,
struct device_driver *drv)
struct tb_service_driver *driver;
const struct tb_service_id *ids;
svc = tb_to_service(dev);
driver = container_of(drv, struct tb_service_driver, driver);