Changeset 7c95d6f5 in mainline
- Timestamp:
- 2011-10-15T12:13:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 065064e6
- Parents:
- 8a121b1
- Location:
- uspace
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/dump.c
r8a121b1 r7c95d6f5 153 153 static void dump_tree(usb_dp_parser_t *parser, usb_dp_parser_data_t *data) 154 154 { 155 uint8_t *ptr = data->data;155 const uint8_t *ptr = data->data; 156 156 printf("Descriptor tree:\n"); 157 157 dump_tree_internal(parser, data, ptr, 0); -
uspace/drv/bus/usb/usbmid/dump.c
r8a121b1 r7c95d6f5 93 93 static void dump_tree(usb_dp_parser_t *parser, usb_dp_parser_data_t *data) 94 94 { 95 uint8_t *ptr = data->data;95 const uint8_t *ptr = data->data; 96 96 dump_tree_internal(parser, data, ptr, 0); 97 97 } -
uspace/drv/bus/usb/usbmid/explore.c
r8a121b1 r7c95d6f5 73 73 * @param list List where to add the interfaces. 74 74 */ 75 static void create_interfaces( uint8_t *config_descriptor,75 static void create_interfaces(const uint8_t *config_descriptor, 76 76 size_t config_descriptor_size, list_t *list) 77 77 { 78 usb_dp_parser_data_t data = {78 const usb_dp_parser_data_t data = { 79 79 .data = config_descriptor, 80 80 .size = config_descriptor_size, … … 149 149 150 150 /* Short cuts to save on typing ;-). */ 151 uint8_t*config_descriptor_raw = dev->descriptors.configuration;151 const void *config_descriptor_raw = dev->descriptors.configuration; 152 152 size_t config_descriptor_size = dev->descriptors.configuration_size; 153 usb_standard_configuration_descriptor_t *config_descriptor =154 (usb_standard_configuration_descriptor_t *)config_descriptor_raw;153 const usb_standard_configuration_descriptor_t *config_descriptor = 154 config_descriptor_raw; 155 155 156 156 /* Select the first configuration */ -
uspace/lib/usbdev/include/usb/dev/dp.h
r8a121b1 r7c95d6f5 65 65 typedef struct { 66 66 /** Data to be parsed. */ 67 uint8_t *data;67 const uint8_t *data; 68 68 /** Size of input data in bytes. */ 69 69 size_t size; -
uspace/lib/usbdev/include/usb/dev/driver.h
r8a121b1 r7c95d6f5 43 43 usb_standard_device_descriptor_t device; 44 44 /** Full configuration descriptor of current configuration. */ 45 uint8_t *configuration;45 const uint8_t *configuration; 46 46 size_t configuration_size; 47 47 } usb_device_descriptors_t; … … 168 168 int usb_device_retrieve_descriptors(usb_pipe_t *, usb_device_descriptors_t *); 169 169 int usb_device_create_pipes(const ddf_dev_t *, usb_device_connection_t *, 170 usb_endpoint_description_t **, uint8_t *, size_t, int, int,170 usb_endpoint_description_t **, const uint8_t *, size_t, int, int, 171 171 usb_endpoint_mapping_t **, size_t *); 172 172 int usb_device_destroy_pipes(const ddf_dev_t *, usb_endpoint_mapping_t *, size_t); … … 174 174 void usb_device_destroy(usb_device_t *); 175 175 176 size_t usb_interface_count_alternates( uint8_t *, size_t, uint8_t);177 int usb_alternate_interfaces_create( uint8_t *, size_t, int,176 size_t usb_interface_count_alternates(const uint8_t *, size_t, uint8_t); 177 int usb_alternate_interfaces_create(const uint8_t *, size_t, int, 178 178 usb_alternate_interfaces_t **); 179 179 -
uspace/lib/usbdev/include/usb/dev/pipes.h
r8a121b1 r7c95d6f5 171 171 int usb_pipe_probe_default_control(usb_pipe_t *); 172 172 int usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *, 173 size_t, uint8_t *, size_t, usb_device_connection_t *);173 size_t, const uint8_t *, size_t, usb_device_connection_t *); 174 174 int usb_pipe_register_with_speed(usb_pipe_t *, usb_speed_t, 175 175 unsigned int, usb_hc_connection_t *); -
uspace/lib/usbdev/src/altiface.c
r8a121b1 r7c95d6f5 48 48 * @return Number of alternate interfaces for @p interface_no interface. 49 49 */ 50 size_t usb_interface_count_alternates( uint8_t *config_descr,50 size_t usb_interface_count_alternates(const uint8_t *config_descr, 51 51 size_t config_descr_size, uint8_t interface_no) 52 52 { … … 90 90 * @return Error code. 91 91 */ 92 int usb_alternate_interfaces_create( uint8_t *config_descr,92 int usb_alternate_interfaces_create(const uint8_t *config_descr, 93 93 size_t config_descr_size, int interface_number, 94 94 usb_alternate_interfaces_t **alternates_ptr) … … 160 160 dp_data.data, iface_ptr); 161 161 if (iface_ptr == NULL) { 162 uint8_t *next = dp_data.data + dp_data.size;162 const uint8_t *next = dp_data.data + dp_data.size; 163 163 cur_alt_iface->nested_descriptors_size 164 164 = next - cur_alt_iface->nested_descriptors; -
uspace/lib/usbdev/src/devdrv.c
r8a121b1 r7c95d6f5 115 115 int rc = usb_device_create_pipes(dev->ddf_dev, &dev->wire, endpoints, 116 116 dev->descriptors.configuration, dev->descriptors.configuration_size, 117 dev->interface_no, alternate_setting, 118 &pipes, &pipes_count); 117 dev->interface_no, alternate_setting, &pipes, &pipes_count); 119 118 120 119 if (rc != EOK) { … … 319 318 int usb_device_create_pipes(const ddf_dev_t *dev, usb_device_connection_t *wire, 320 319 usb_endpoint_description_t **endpoints, 321 uint8_t *config_descr, size_t config_descr_size,320 const uint8_t *config_descr, size_t config_descr_size, 322 321 int interface_no, int interface_setting, 323 322 usb_endpoint_mapping_t **pipes_ptr, size_t *pipes_count_ptr) -
uspace/lib/usbdev/src/pipesinit.c
r8a121b1 r7c95d6f5 224 224 static int process_interface( 225 225 usb_endpoint_mapping_t *mapping, size_t mapping_count, 226 usb_dp_parser_t *parser,usb_dp_parser_data_t *parser_data,226 const usb_dp_parser_t *parser, const usb_dp_parser_data_t *parser_data, 227 227 const uint8_t *interface_descriptor) 228 228 { … … 284 284 int usb_pipe_initialize_from_configuration( 285 285 usb_endpoint_mapping_t *mapping, size_t mapping_count, 286 uint8_t *configuration_descriptor, size_t configuration_descriptor_size,286 const uint8_t *config_descriptor, size_t config_descriptor_size, 287 287 usb_device_connection_t *connection) 288 288 { 289 289 assert(connection); 290 290 291 if (config uration_descriptor == NULL) {291 if (config_descriptor == NULL) { 292 292 return EBADMEM; 293 293 } 294 if (config uration_descriptor_size294 if (config_descriptor_size 295 295 < sizeof(usb_standard_configuration_descriptor_t)) { 296 296 return ERANGE; … … 310 310 * Prepare the descriptor parser. 311 311 */ 312 usb_dp_parser_t dp_parser = {312 const usb_dp_parser_t dp_parser = { 313 313 .nesting = descriptor_nesting 314 314 }; 315 usb_dp_parser_data_t dp_data = {316 .data = config uration_descriptor,317 .size = config uration_descriptor_size,315 const usb_dp_parser_data_t dp_data = { 316 .data = config_descriptor, 317 .size = config_descriptor_size, 318 318 .arg = connection 319 319 }; … … 323 323 */ 324 324 const uint8_t *interface = usb_dp_get_nested_descriptor(&dp_parser, 325 &dp_data, config uration_descriptor);325 &dp_data, config_descriptor); 326 326 if (interface == NULL) { 327 327 return ENOENT; … … 331 331 &dp_parser, &dp_data, interface); 332 332 interface = usb_dp_get_sibling_descriptor(&dp_parser, &dp_data, 333 config uration_descriptor, interface);333 config_descriptor, interface); 334 334 } while (interface != NULL); 335 335
Note:
See TracChangeset
for help on using the changeset viewer.