Changeset b4b534ac in mainline for uspace/lib/usbdev/include/usb/dev/alternate_ifaces.h
- Timestamp:
- 2016-07-22T08:24:47Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f76d2c2
- Parents:
- 5b18137 (diff), 8351f9a4 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/alternate_ifaces.h
r5b18137 rb4b534ac 1 1 /* 2 2 * Copyright (c) 2011 Vojtech Horky 3 * Copyright (c) 2013 Jan Vesely 3 4 * All rights reserved. 4 5 * … … 31 32 */ 32 33 /** @file 33 * Functions needed by hub drivers. 34 * 35 * For class specific requests, see usb/classes/hub.h. 34 * USB device driver framework. 36 35 */ 37 36 38 #ifndef LIBUSBDEV_ HUB_H_39 #define LIBUSBDEV_ HUB_H_37 #ifndef LIBUSBDEV_ALTERNATE_IFACES_H_ 38 #define LIBUSBDEV_ALTERNATE_IFACES_H_ 40 39 41 #include < ddf/driver.h>40 #include <usb/descriptor.h> 42 41 #include <sys/types.h> 43 #include <errno.h>44 #include <usb/hc.h>45 42 46 extern int usb_hc_new_device_wrapper(ddf_dev_t *, ddf_fun_t *, 47 usb_hc_connection_t *, usb_speed_t, int (*)(void *), void *, 48 usb_address_t *, ddf_dev_ops_t *); 49 50 /** Info about device attached to host controller. 51 * 52 * This structure exists only to keep the same signature of 53 * usb_hc_register_device() when more properties of the device 54 * would have to be passed to the host controller. 43 /** Wrapper for data related to alternate interface setting. 44 * The pointers will typically point inside configuration descriptor and 45 * thus you shall not deallocate them. 55 46 */ 56 47 typedef struct { 57 /** Device address. */ 58 usb_address_t address; 59 /** DDF function (external) of the device. */ 60 ddf_fun_t *fun; 61 } usb_hub_attached_device_t; 48 /** Interface descriptor. */ 49 const usb_standard_interface_descriptor_t *interface; 50 /** Pointer to start of descriptor tree bound with this interface. */ 51 const uint8_t *nested_descriptors; 52 /** Size of data pointed by nested_descriptors in bytes. */ 53 size_t nested_descriptors_size; 54 } usb_alternate_interface_descriptors_t; 62 55 63 extern int usb_hub_register_device(usb_hc_connection_t *, 64 const usb_hub_attached_device_t *); 56 /** Alternate interface settings. */ 57 typedef struct { 58 /** Array of alternate interfaces descriptions. */ 59 const usb_alternate_interface_descriptors_t *alternatives; 60 /** Size of @c alternatives array. */ 61 size_t alternative_count; 62 /** Index of currently selected one. */ 63 size_t current; 64 } usb_alternate_interfaces_t; 65 65 66 static inline int usb_hub_unregister_device(usb_hc_connection_t *conn, 67 const usb_hub_attached_device_t *attached_device) 68 { 69 assert(conn); 70 if (attached_device == NULL) 71 return EBADMEM; 72 73 return usb_hc_release_address(conn, attached_device->address); 74 } 66 size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t); 67 int usb_alternate_interfaces_init(usb_alternate_interfaces_t *, 68 const uint8_t *, size_t, int); 69 void usb_alternate_interfaces_deinit(usb_alternate_interfaces_t *); 75 70 76 71 #endif 77 78 72 /** 79 73 * @}
Note:
See TracChangeset
for help on using the changeset viewer.