Lines Matching refs:edev
68 struct usbip_exported_device *edev = NULL; in usbip_exported_device_new() local
73 edev = calloc(1, sizeof(struct usbip_exported_device)); in usbip_exported_device_new()
75 edev->sudev = in usbip_exported_device_new()
77 if (!edev->sudev) { in usbip_exported_device_new()
82 if (hdriver->ops.read_device(edev->sudev, &edev->udev) < 0) in usbip_exported_device_new()
85 edev->status = read_attr_usbip_status(&edev->udev); in usbip_exported_device_new()
86 if (edev->status < 0) in usbip_exported_device_new()
91 edev->udev.bNumInterfaces * sizeof(struct usbip_usb_interface); in usbip_exported_device_new()
93 edev_old = edev; in usbip_exported_device_new()
94 edev = realloc(edev, size); in usbip_exported_device_new()
95 if (!edev) { in usbip_exported_device_new()
96 edev = edev_old; in usbip_exported_device_new()
101 for (i = 0; i < edev->udev.bNumInterfaces; i++) { in usbip_exported_device_new()
105 hdriver->ops.read_interface(&edev->udev, i, &edev->uinf[i]); in usbip_exported_device_new()
108 return edev; in usbip_exported_device_new()
110 if (edev->sudev) in usbip_exported_device_new()
111 udev_device_unref(edev->sudev); in usbip_exported_device_new()
112 if (edev) in usbip_exported_device_new()
113 free(edev); in usbip_exported_device_new()
120 struct usbip_exported_device *edev; in refresh_exported_devices() local
141 edev = usbip_exported_device_new(hdriver, path); in refresh_exported_devices()
142 if (!edev) { in refresh_exported_devices()
147 list_add(&edev->node, &hdriver->edev_list); in refresh_exported_devices()
158 struct usbip_exported_device *edev; in usbip_exported_device_destroy() local
161 edev = list_entry(i, struct usbip_exported_device, node); in usbip_exported_device_destroy()
163 free(edev); in usbip_exported_device_destroy()
212 int usbip_export_device(struct usbip_exported_device *edev, int sockfd) in usbip_export_device() argument
220 if (edev->status != SDEV_ST_AVAILABLE) { in usbip_export_device()
221 dbg("device not available: %s", edev->udev.busid); in usbip_export_device()
222 switch (edev->status) { in usbip_export_device()
232 dbg("status unknown: 0x%x", edev->status); in usbip_export_device()
240 edev->udev.path, attr_name); in usbip_export_device()
262 info("connect: %s", edev->udev.busid); in usbip_export_device()
271 struct usbip_exported_device *edev; in usbip_generic_get_device() local
275 edev = list_entry(i, struct usbip_exported_device, node); in usbip_generic_get_device()
277 return edev; in usbip_generic_get_device()