FreeRDP
libusb_udevman.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <winpr/crt.h>
#include <winpr/cmdline.h>
#include <winpr/collections.h>
#include <freerdp/addin.h>
#include "urbdrc_types.h"
#include "urbdrc_main.h"
#include "libusb_udevice.h"
#include <libusb.h>

Macros

#define LIBUSB_HOTPLUG_NO_FLAGS   0
 
#define BASIC_STATE_FUNC_DEFINED(_arg, _type)
 
#define BASIC_STATE_FUNC_REGISTER(_arg, _man)
 
#define freerdp_urbdrc_client_subsystem_entry   FREERDP_API freerdp_urbdrc_client_subsystem_entry
 

Typedefs

typedef UDEVMAN * PUDEVMAN
 

Functions

static BOOL poll_libusb_events (UDEVMAN *udevman)
 
static void udevman_rewind (IUDEVMAN *idevman)
 
static BOOL udevman_has_next (IUDEVMAN *idevman)
 
static IUDEVICE * udevman_get_next (IUDEVMAN *idevman)
 
static IUDEVICE * udevman_get_udevice_by_addr (IUDEVMAN *idevman, BYTE bus_number, BYTE dev_number)
 
static size_t udevman_register_udevice (IUDEVMAN *idevman, BYTE bus_number, BYTE dev_number, UINT16 idVendor, UINT16 idProduct, UINT32 flag)
 
static BOOL udevman_unregister_udevice (IUDEVMAN *idevman, BYTE bus_number, BYTE dev_number)
 
static BOOL udevman_unregister_all_udevices (IUDEVMAN *idevman)
 
static int udevman_is_auto_add (IUDEVMAN *idevman)
 
static IUDEVICE * udevman_get_udevice_by_UsbDevice (IUDEVMAN *idevman, UINT32 UsbDevice)
 
static IUDEVICE * udevman_get_udevice_by_ChannelID (IUDEVMAN *idevman, UINT32 channelID)
 
static void udevman_loading_lock (IUDEVMAN *idevman)
 
static void udevman_loading_unlock (IUDEVMAN *idevman)
 
static UINT32 udevman_get_next_device_id (IUDEVMAN *idevman)
 
static void udevman_set_next_device_id (IUDEVMAN *idevman, UINT32 _t)
 
static void udevman_free (IUDEVMAN *idevman)
 
static BOOL filter_by_class (uint8_t bDeviceClass, uint8_t bDeviceSubClass)
 
static BOOL append (char *dst, size_t length, const char *src)
 
static BOOL device_is_filtered (struct libusb_device *dev, const struct libusb_device_descriptor *desc, libusb_hotplug_event event)
 
static int hotplug_callback (struct libusb_context *ctx, struct libusb_device *dev, libusb_hotplug_event event, void *user_data)
 
static BOOL udevman_initialize (IUDEVMAN *idevman, UINT32 channelId)
 
static BOOL udevman_vid_pid_pair_equals (const void *objA, const void *objB)
 
static BOOL udevman_parse_device_id_addr (const char **str, UINT16 *id1, UINT16 *id2, UINT16 max, char split_sign, char delimiter)
 
static BOOL urbdrc_udevman_register_devices (UDEVMAN *udevman, const char *devices, BOOL add_by_addr)
 
static UINT urbdrc_udevman_parse_addin_args (UDEVMAN *udevman, const ADDIN_ARGV *args)
 
static UINT udevman_listener_created_callback (IUDEVMAN *iudevman)
 
static void udevman_load_interface (UDEVMAN *udevman)
 
static DWORD poll_thread (LPVOID lpThreadParameter)
 
UINT freerdp_urbdrc_client_subsystem_entry (PFREERDP_URBDRC_SERVICE_ENTRY_POINTS pEntryPoints)
 

Macro Definition Documentation

◆ BASIC_STATE_FUNC_DEFINED

#define BASIC_STATE_FUNC_DEFINED (   _arg,
  _type 
)
Value:
static _type udevman_get_##_arg(IUDEVMAN* idevman) \
{ \
UDEVMAN* udevman = (UDEVMAN*)idevman; \
return udevman->_arg; \
} \
static void udevman_set_##_arg(IUDEVMAN* idevman, _type _t) \
{ \
UDEVMAN* udevman = (UDEVMAN*)idevman; \
udevman->_arg = _t; \
}

◆ BASIC_STATE_FUNC_REGISTER

#define BASIC_STATE_FUNC_REGISTER (   _arg,
  _man 
)
Value:
_man->iface.get_##_arg = udevman_get_##_arg; \
_man->iface.set_##_arg = udevman_set_##_arg

◆ freerdp_urbdrc_client_subsystem_entry

#define freerdp_urbdrc_client_subsystem_entry   FREERDP_API freerdp_urbdrc_client_subsystem_entry

◆ LIBUSB_HOTPLUG_NO_FLAGS

#define LIBUSB_HOTPLUG_NO_FLAGS   0

FreeRDP: A Remote Desktop Protocol Implementation RemoteFX USB Redirection

Copyright 2012 Atrust corp. Copyright 2012 Alfred Liu alfre.nosp@m.d.li.nosp@m.u@atr.nosp@m.usco.nosp@m.rp.co.nosp@m.m

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Typedef Documentation

◆ PUDEVMAN

typedef UDEVMAN* PUDEVMAN

Function Documentation

◆ append()

static BOOL append ( char *  dst,
size_t  length,
const char *  src 
)
static
Here is the caller graph for this function:

◆ device_is_filtered()

static BOOL device_is_filtered ( struct libusb_device *  dev,
const struct libusb_device_descriptor *  desc,
libusb_hotplug_event  event 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ filter_by_class()

static BOOL filter_by_class ( uint8_t  bDeviceClass,
uint8_t  bDeviceSubClass 
)
static
Here is the caller graph for this function:

◆ freerdp_urbdrc_client_subsystem_entry()

UINT freerdp_urbdrc_client_subsystem_entry ( PFREERDP_URBDRC_SERVICE_ENTRY_POINTS  pEntryPoints)
Here is the call graph for this function:

◆ hotplug_callback()

static int hotplug_callback ( struct libusb_context *  ctx,
struct libusb_device *  dev,
libusb_hotplug_event  event,
void *  user_data 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ poll_libusb_events()

static BOOL poll_libusb_events ( UDEVMAN *  udevman)
static
Here is the caller graph for this function:

◆ poll_thread()

static DWORD poll_thread ( LPVOID  lpThreadParameter)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_free()

static void udevman_free ( IUDEVMAN *  idevman)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_get_next()

static IUDEVICE* udevman_get_next ( IUDEVMAN *  idevman)
static
Here is the caller graph for this function:

◆ udevman_get_next_device_id()

static UINT32 udevman_get_next_device_id ( IUDEVMAN *  idevman)
static

◆ udevman_get_udevice_by_addr()

static IUDEVICE* udevman_get_udevice_by_addr ( IUDEVMAN *  idevman,
BYTE  bus_number,
BYTE  dev_number 
)
static
Here is the caller graph for this function:

◆ udevman_get_udevice_by_ChannelID()

static IUDEVICE* udevman_get_udevice_by_ChannelID ( IUDEVMAN *  idevman,
UINT32  channelID 
)
static
Here is the caller graph for this function:

◆ udevman_get_udevice_by_UsbDevice()

static IUDEVICE* udevman_get_udevice_by_UsbDevice ( IUDEVMAN *  idevman,
UINT32  UsbDevice 
)
static
Here is the caller graph for this function:

◆ udevman_has_next()

static BOOL udevman_has_next ( IUDEVMAN *  idevman)
static
Here is the caller graph for this function:

◆ udevman_initialize()

static BOOL udevman_initialize ( IUDEVMAN *  idevman,
UINT32  channelId 
)
static
Here is the caller graph for this function:

◆ udevman_is_auto_add()

static int udevman_is_auto_add ( IUDEVMAN *  idevman)
static
Here is the caller graph for this function:

◆ udevman_listener_created_callback()

static UINT udevman_listener_created_callback ( IUDEVMAN *  iudevman)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_load_interface()

static void udevman_load_interface ( UDEVMAN *  udevman)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_loading_lock()

static void udevman_loading_lock ( IUDEVMAN *  idevman)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_loading_unlock()

static void udevman_loading_unlock ( IUDEVMAN *  idevman)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_parse_device_id_addr()

static BOOL udevman_parse_device_id_addr ( const char **  str,
UINT16 id1,
UINT16 id2,
UINT16  max,
char  split_sign,
char  delimiter 
)
static
Here is the caller graph for this function:

◆ udevman_register_udevice()

static size_t udevman_register_udevice ( IUDEVMAN *  idevman,
BYTE  bus_number,
BYTE  dev_number,
UINT16  idVendor,
UINT16  idProduct,
UINT32  flag 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_rewind()

static void udevman_rewind ( IUDEVMAN *  idevman)
static
Here is the caller graph for this function:

◆ udevman_set_next_device_id()

static void udevman_set_next_device_id ( IUDEVMAN *  idevman,
UINT32  _t 
)
static

◆ udevman_unregister_all_udevices()

static BOOL udevman_unregister_all_udevices ( IUDEVMAN *  idevman)
static
Here is the caller graph for this function:

◆ udevman_unregister_udevice()

static BOOL udevman_unregister_udevice ( IUDEVMAN *  idevman,
BYTE  bus_number,
BYTE  dev_number 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ udevman_vid_pid_pair_equals()

static BOOL udevman_vid_pid_pair_equals ( const void *  objA,
const void *  objB 
)
static
Here is the caller graph for this function:

◆ urbdrc_udevman_parse_addin_args()

static UINT urbdrc_udevman_parse_addin_args ( UDEVMAN *  udevman,
const ADDIN_ARGV *  args 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ urbdrc_udevman_register_devices()

static BOOL urbdrc_udevman_register_devices ( UDEVMAN *  udevman,
const char *  devices,
BOOL  add_by_addr 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: