Changes in uspace/lib/usbdev/include/usb/dev/driver.h [6883abfa:70452dd4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/include/usb/dev/driver.h
r6883abfa r70452dd4 36 36 #define LIBUSBDEV_DRIVER_H_ 37 37 38 #include <usb/hc.h>39 #include <usb/dev/usb_device_connection.h>40 38 #include <usb/dev/pipes.h> 41 39 … … 45 43 usb_standard_device_descriptor_t device; 46 44 /** Full configuration descriptor of current configuration. */ 47 constuint8_t *configuration;45 uint8_t *configuration; 48 46 size_t configuration_size; 49 47 } usb_device_descriptors_t; … … 55 53 typedef struct { 56 54 /** Interface descriptor. */ 57 constusb_standard_interface_descriptor_t *interface;55 usb_standard_interface_descriptor_t *interface; 58 56 /** Pointer to start of descriptor tree bound with this interface. */ 59 constuint8_t *nested_descriptors;57 uint8_t *nested_descriptors; 60 58 /** Size of data pointed by nested_descriptors in bytes. */ 61 59 size_t nested_descriptors_size; … … 74 72 /** USB device structure. */ 75 73 typedef struct { 76 /** Connection to USB hc, used by wire and arbitrary requests. */77 usb_hc_connection_t hc_conn;78 /** Connection backing the pipes.79 * Typically, you will not need to use this attribute at all.80 */81 usb_device_connection_t wire;82 74 /** The default control pipe. */ 83 75 usb_pipe_t ctrl_pipe; … … 95 87 int interface_no; 96 88 97 /** Alternative interfaces. */ 98 usb_alternate_interfaces_t alternate_interfaces; 89 /** Alternative interfaces. 90 * Set to NULL when the driver controls whole device 91 * (i.e. more (or any) interfaces). 92 */ 93 usb_alternate_interfaces_t *alternate_interfaces; 99 94 100 95 /** Some useful descriptors. */ 101 96 usb_device_descriptors_t descriptors; 102 97 103 /** Generic DDF device backing this one. DO NOT TOUCH!*/98 /** Generic DDF device backing this one. */ 104 99 ddf_dev_t *ddf_dev; 105 100 /** Custom driver data. … … 108 103 */ 109 104 void *driver_data; 105 106 /** Connection backing the pipes. 107 * Typically, you will not need to use this attribute at all. 108 */ 109 usb_device_connection_t wire; 110 110 } usb_device_t; 111 111 112 112 /** USB driver ops. */ 113 113 typedef struct { 114 /** Callback when a new device was added to the system. */ 115 int (*device_add)(usb_device_t *); 116 /** Callback when a device is about to be removed from the system. */ 117 int (*device_rem)(usb_device_t *); 118 /** Callback when a device was removed from the system. */ 119 int (*device_gone)(usb_device_t *); 114 /** Callback when new device is about to be controlled by the driver. */ 115 int (*add_device)(usb_device_t *); 120 116 } usb_driver_ops_t; 121 117 … … 156 152 \endcode 157 153 */ 158 constusb_endpoint_description_t **endpoints;154 usb_endpoint_description_t **endpoints; 159 155 /** Driver ops. */ 160 constusb_driver_ops_t *ops;156 usb_driver_ops_t *ops; 161 157 } usb_driver_t; 162 158 163 int usb_driver_main(const usb_driver_t *); 164 165 int usb_device_init(usb_device_t *, ddf_dev_t *, 166 const usb_endpoint_description_t **, const char **); 167 void usb_device_deinit(usb_device_t *); 159 int usb_driver_main(usb_driver_t *); 168 160 169 161 int usb_device_select_interface(usb_device_t *, uint8_t, 170 constusb_endpoint_description_t **);162 usb_endpoint_description_t **); 171 163 172 164 int usb_device_retrieve_descriptors(usb_pipe_t *, usb_device_descriptors_t *); 173 void usb_device_release_descriptors(usb_device_descriptors_t *); 165 int usb_device_create_pipes(ddf_dev_t *, usb_device_connection_t *, 166 usb_endpoint_description_t **, uint8_t *, size_t, int, int, 167 usb_endpoint_mapping_t **, size_t *); 168 int usb_device_destroy_pipes(ddf_dev_t *, usb_endpoint_mapping_t *, size_t); 169 int usb_device_create(ddf_dev_t *, usb_endpoint_description_t **, usb_device_t **, const char **); 170 void usb_device_destroy(usb_device_t *); 174 171 175 int usb_device_create_pipes(usb_device_connection_t *, 176 const usb_endpoint_description_t **, const uint8_t *, size_t, int, int, 177 usb_endpoint_mapping_t **, size_t *); 178 void usb_device_destroy_pipes(usb_endpoint_mapping_t *, size_t); 172 size_t usb_interface_count_alternates(uint8_t *, size_t, uint8_t); 173 int usb_alternate_interfaces_create(uint8_t *, size_t, int, 174 usb_alternate_interfaces_t **); 179 175 180 void * usb_device_data_alloc(usb_device_t *, size_t);181 182 size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t);183 int usb_alternate_interfaces_init(usb_alternate_interfaces_t *,184 const uint8_t *, size_t, int);185 void usb_alternate_interfaces_deinit(usb_alternate_interfaces_t *);186 176 #endif 187 177 /**
Note:
See TracChangeset
for help on using the changeset viewer.