Lines Matching refs:svc
903 struct tb_service *svc = container_of(dev, struct tb_service, dev); in key_show() local
909 return sysfs_emit(buf, "%*pE\n", (int)strlen(svc->key), svc->key); in key_show()
913 static int get_modalias(const struct tb_service *svc, char *buf, size_t size) in get_modalias() argument
915 return snprintf(buf, size, "tbsvc:k%sp%08Xv%08Xr%08X", svc->key, in get_modalias()
916 svc->prtcid, svc->prtcvers, svc->prtcrevs); in get_modalias()
922 struct tb_service *svc = container_of(dev, struct tb_service, dev); in modalias_show() local
925 get_modalias(svc, buf, PAGE_SIZE - 2); in modalias_show()
933 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcid_show() local
935 return sysfs_emit(buf, "%u\n", svc->prtcid); in prtcid_show()
942 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcvers_show() local
944 return sysfs_emit(buf, "%u\n", svc->prtcvers); in prtcvers_show()
951 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcrevs_show() local
953 return sysfs_emit(buf, "%u\n", svc->prtcrevs); in prtcrevs_show()
960 struct tb_service *svc = container_of(dev, struct tb_service, dev); in prtcstns_show() local
962 return sysfs_emit(buf, "0x%08x\n", svc->prtcstns); in prtcstns_show()
987 const struct tb_service *svc = container_of_const(dev, struct tb_service, dev); in tb_service_uevent() local
990 get_modalias(svc, modalias, sizeof(modalias)); in tb_service_uevent()
996 struct tb_service *svc = container_of(dev, struct tb_service, dev); in tb_service_release() local
997 struct tb_xdomain *xd = tb_service_parent(svc); in tb_service_release()
999 tb_service_debugfs_remove(svc); in tb_service_release()
1000 ida_simple_remove(&xd->service_ids, svc->id); in tb_service_release()
1001 kfree(svc->key); in tb_service_release()
1002 kfree(svc); in tb_service_release()
1016 struct tb_service *svc; in remove_missing_service() local
1018 svc = tb_to_service(dev); in remove_missing_service()
1019 if (!svc) in remove_missing_service()
1022 if (!tb_property_find(xd->remote_properties, svc->key, in remove_missing_service()
1032 struct tb_service *svc; in find_service() local
1034 svc = tb_to_service(dev); in find_service()
1035 if (!svc) in find_service()
1038 return !strcmp(svc->key, p->key); in find_service()
1041 static int populate_service(struct tb_service *svc, in populate_service() argument
1050 svc->prtcid = p->value.immediate; in populate_service()
1053 svc->prtcvers = p->value.immediate; in populate_service()
1056 svc->prtcrevs = p->value.immediate; in populate_service()
1059 svc->prtcstns = p->value.immediate; in populate_service()
1061 svc->key = kstrdup(property->key, GFP_KERNEL); in populate_service()
1062 if (!svc->key) in populate_service()
1070 struct tb_service *svc; in enumerate_services() local
1093 svc = kzalloc(sizeof(*svc), GFP_KERNEL); in enumerate_services()
1094 if (!svc) in enumerate_services()
1097 if (populate_service(svc, p)) { in enumerate_services()
1098 kfree(svc); in enumerate_services()
1104 kfree(svc->key); in enumerate_services()
1105 kfree(svc); in enumerate_services()
1108 svc->id = id; in enumerate_services()
1109 svc->dev.bus = &tb_bus_type; in enumerate_services()
1110 svc->dev.type = &tb_service_type; in enumerate_services()
1111 svc->dev.parent = &xd->dev; in enumerate_services()
1112 dev_set_name(&svc->dev, "%s.%d", dev_name(&xd->dev), svc->id); in enumerate_services()
1114 tb_service_debugfs_init(svc); in enumerate_services()
1116 if (device_register(&svc->dev)) { in enumerate_services()
1117 put_device(&svc->dev); in enumerate_services()