Lines Matching defs:dev_handle

50 static int common_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface);
55 static int winusbx_open(int sub_api, struct libusb_device_handle *dev_handle);
56 static void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle);
57 static int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface);
58 static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
59 static int winusbx_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
61 static int winusbx_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);
63 static int winusbx_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);
66 static int winusbx_reset_device(int sub_api, struct libusb_device_handle *dev_handle);
71 static int hid_open(int sub_api, struct libusb_device_handle *dev_handle);
72 static void hid_close(int sub_api, struct libusb_device_handle *dev_handle);
73 static int hid_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
74 static int hid_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
75 static int hid_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);
78 static int hid_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);
80 static int hid_reset_device(int sub_api, struct libusb_device_handle *dev_handle);
85 static int composite_open(int sub_api, struct libusb_device_handle *dev_handle);
86 static void composite_close(int sub_api, struct libusb_device_handle *dev_handle);
87 static int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
88 static int composite_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting);
89 static int composite_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface);
93 static int composite_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint);
96 static int composite_reset_device(int sub_api, struct libusb_device_handle *dev_handle);
652 static int windows_assign_endpoints(struct libusb_device_handle *dev_handle, int iface, int altsetting)
655 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
658 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
660 r = libusb_get_config_descriptor(dev_handle->dev, 0, &conf_desc);
687 return priv->apib->configure_endpoints(SUB_API_NOTSET, dev_handle, iface);
721 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
723 transfer->dev_handle);
724 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
742 && (libusb_claim_interface(transfer->dev_handle, current_interface) == LIBUSB_SUCCESS) ) {
773 libusb_device_handle *dev_handle = transfer->dev_handle;
774 struct windows_device_handle_priv* handle_priv = _device_handle_priv(dev_handle);
781 r = libusb_release_interface(dev_handle, transfer_priv->interface_number);
1785 static int windows_open(struct libusb_device_handle *dev_handle)
1787 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1788 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
1795 return priv->apib->open(SUB_API_NOTSET, dev_handle);
1798 static void windows_close(struct libusb_device_handle *dev_handle)
1800 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1802 priv->apib->close(SUB_API_NOTSET, dev_handle);
1805 static int windows_get_configuration(struct libusb_device_handle *dev_handle, int *config)
1807 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1823 static int windows_set_configuration(struct libusb_device_handle *dev_handle, int config)
1825 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1831 r = libusb_control_transfer(dev_handle, LIBUSB_ENDPOINT_OUT |
1842 static int windows_claim_interface(struct libusb_device_handle *dev_handle, int iface)
1845 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1853 r = priv->apib->claim_interface(SUB_API_NOTSET, dev_handle, iface);
1856 r = windows_assign_endpoints(dev_handle, iface, 0);
1862 static int windows_set_interface_altsetting(struct libusb_device_handle *dev_handle, int iface, int altsetting)
1865 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1870 r = priv->apib->set_interface_altsetting(SUB_API_NOTSET, dev_handle, iface, altsetting);
1873 r = windows_assign_endpoints(dev_handle, iface, altsetting);
1879 static int windows_release_interface(struct libusb_device_handle *dev_handle, int iface)
1881 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1883 return priv->apib->release_interface(SUB_API_NOTSET, dev_handle, iface);
1886 static int windows_clear_halt(struct libusb_device_handle *dev_handle, unsigned char endpoint)
1888 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1889 return priv->apib->clear_halt(SUB_API_NOTSET, dev_handle, endpoint);
1892 static int windows_reset_device(struct libusb_device_handle *dev_handle)
1894 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
1895 return priv->apib->reset_device(SUB_API_NOTSET, dev_handle);
1899 static int windows_kernel_driver_active(struct libusb_device_handle *dev_handle, int iface)
1904 static int windows_attach_kernel_driver(struct libusb_device_handle *dev_handle, int iface)
1909 static int windows_detach_kernel_driver(struct libusb_device_handle *dev_handle, int iface)
1932 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
1934 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
1952 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
1954 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
1972 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
1974 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
2013 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
2021 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
2046 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
2335 static int unsupported_open(int sub_api, struct libusb_device_handle *dev_handle) {
2338 static void unsupported_close(int sub_api, struct libusb_device_handle *dev_handle) {
2341 static int unsupported_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
2344 static int unsupported_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
2347 static int unsupported_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting) {
2350 static int unsupported_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
2353 static int unsupported_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint) {
2356 static int unsupported_reset_device(int sub_api, struct libusb_device_handle *dev_handle) {
2377 static int common_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface) {
2582 static int winusbx_open(int sub_api, struct libusb_device_handle *dev_handle)
2584 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
2585 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
2586 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
2610 handle_priv->interface_handle[i].dev_handle = file_handle;
2617 static void winusbx_close(int sub_api, struct libusb_device_handle *dev_handle)
2619 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
2620 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
2631 file_handle = handle_priv->interface_handle[i].dev_handle;
2639 static int winusbx_configure_endpoints(int sub_api, struct libusb_device_handle *dev_handle, int iface)
2641 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
2642 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
2687 static int winusbx_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
2689 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
2690 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
2691 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
2709 file_handle = handle_priv->interface_handle[iface].dev_handle;
2762 file_handle = handle_priv->interface_handle[0].dev_handle;
2793 static int winusbx_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
2795 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
2796 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
2815 static int get_valid_interface(struct libusb_device_handle *dev_handle, int api_id)
2817 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
2818 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
2827 if ( (handle_priv->interface_handle[i].dev_handle != 0)
2828 && (handle_priv->interface_handle[i].dev_handle != INVALID_HANDLE_VALUE)
2864 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
2865 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
2868 transfer->dev_handle);
2883 current_interface = get_valid_interface(transfer->dev_handle, USB_API_WINUSBX);
2929 static int winusbx_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)
2931 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
2932 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
2933 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
2959 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
2961 struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
2962 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
3012 static int winusbx_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)
3014 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
3015 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
3016 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
3054 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
3055 struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
3057 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
3089 static int winusbx_reset_device(int sub_api, struct libusb_device_handle *dev_handle)
3091 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
3092 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
3093 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
3643 static int hid_open(int sub_api, struct libusb_device_handle *dev_handle)
3645 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
3646 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
3647 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
3796 static void hid_close(int sub_api, struct libusb_device_handle *dev_handle)
3798 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
3799 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
3816 static int hid_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
3818 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
3819 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
3828 // We use dev_handle as a flag for interface claimed
3829 if (handle_priv->interface_handle[iface].dev_handle == INTERFACE_CLAIMED) {
3833 handle_priv->interface_handle[iface].dev_handle = INTERFACE_CLAIMED;
3841 static int hid_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
3843 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
3844 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
3852 if (handle_priv->interface_handle[iface].dev_handle != INTERFACE_CLAIMED) {
3856 handle_priv->interface_handle[iface].dev_handle = INVALID_HANDLE_VALUE;
3861 static int hid_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)
3863 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
3883 struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
3884 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
3885 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
3904 current_interface = get_valid_interface(transfer->dev_handle, USB_API_HID);
3927 r = windows_get_configuration(transfer->dev_handle, &config);
3948 r = hid_set_interface_altsetting(0, transfer->dev_handle, setup->index, setup->value);
3993 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
3994 struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
3995 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
4089 struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
4102 static int hid_reset_device(int sub_api, struct libusb_device_handle *dev_handle)
4104 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
4120 static int hid_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)
4122 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
4123 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
4124 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4153 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
4198 static int composite_open(int sub_api, struct libusb_device_handle *dev_handle)
4200 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4222 r = usb_api_backend[USB_API_WINUSBX].open(i, dev_handle);
4229 r = hid_open(SUB_API_NOTSET, dev_handle);
4234 static void composite_close(int sub_api, struct libusb_device_handle *dev_handle)
4236 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4253 usb_api_backend[USB_API_WINUSBX].close(i, dev_handle);
4258 static int composite_claim_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
4260 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4262 claim_interface(priv->usb_interface[iface].sub_api, dev_handle, iface);
4265 static int composite_set_interface_altsetting(int sub_api, struct libusb_device_handle *dev_handle, int iface, int altsetting)
4267 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4269 set_interface_altsetting(priv->usb_interface[iface].sub_api, dev_handle, iface, altsetting);
4272 static int composite_release_interface(int sub_api, struct libusb_device_handle *dev_handle, int iface)
4274 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4276 release_interface(priv->usb_interface[iface].sub_api, dev_handle, iface);
4282 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
4283 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
4307 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
4308 struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
4309 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
4323 struct libusb_context *ctx = DEVICE_CTX(transfer->dev_handle->dev);
4324 struct windows_device_handle_priv *handle_priv = _device_handle_priv(transfer->dev_handle);
4325 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
4337 static int composite_clear_halt(int sub_api, struct libusb_device_handle *dev_handle, unsigned char endpoint)
4339 struct libusb_context *ctx = DEVICE_CTX(dev_handle->dev);
4340 struct windows_device_handle_priv *handle_priv = _device_handle_priv(dev_handle);
4341 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4351 clear_halt(priv->usb_interface[current_interface].sub_api, dev_handle, endpoint);}
4357 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
4366 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);
4371 static int composite_reset_device(int sub_api, struct libusb_device_handle *dev_handle)
4373 struct windows_device_priv *priv = _device_priv(dev_handle->dev);
4388 r = usb_api_backend[USB_API_WINUSBX].reset_device(i, dev_handle);
4401 struct windows_device_priv *priv = _device_priv(transfer->dev_handle->dev);