Changeset 8a121b1 in mainline for uspace/app


Ignore:
Timestamp:
2011-10-15T11:58:16Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7c95d6f5
Parents:
2a5b62b
Message:

usb: Make descriptors readonly.

Location:
uspace/app/usbinfo
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/desctree.c

    r2a5b62b r8a121b1  
    5050
    5151static void browse_descriptor_tree_internal(usb_dp_parser_t *parser,
    52     usb_dp_parser_data_t *data, uint8_t *root, size_t depth,
     52    usb_dp_parser_data_t *data, const uint8_t *root, size_t depth,
    5353    dump_descriptor_in_tree_t callback, void *arg)
    5454{
     
    5757        }
    5858        callback(root, depth, arg);
    59         uint8_t *child = usb_dp_get_nested_descriptor(parser, data, root);
     59        const uint8_t *child = usb_dp_get_nested_descriptor(parser, data, root);
    6060        do {
    6161                browse_descriptor_tree_internal(parser, data, child, depth + 1,
  • uspace/app/usbinfo/dump.c

    r2a5b62b r8a121b1  
    110110}
    111111
    112 static void dump_tree_descriptor(uint8_t *descriptor, size_t depth)
     112static void dump_tree_descriptor(const uint8_t *descriptor, size_t depth)
    113113{
    114114        if (descriptor == NULL) {
    115115                return;
    116116        }
    117         int type = (int) *(descriptor + 1);
     117        int type = descriptor[1];
    118118        const char *name = "unknown";
    119119        switch (type) {
     
    136136}
    137137
    138 static void dump_tree_internal(usb_dp_parser_t *parser, usb_dp_parser_data_t *data,
    139     uint8_t *root, size_t depth)
     138static void dump_tree_internal(
     139    usb_dp_parser_t *parser, usb_dp_parser_data_t *data,
     140    const uint8_t *root, size_t depth)
    140141{
    141142        if (root == NULL) {
     
    143144        }
    144145        dump_tree_descriptor(root, depth);
    145         uint8_t *child = usb_dp_get_nested_descriptor(parser, data, root);
     146        const uint8_t *child = usb_dp_get_nested_descriptor(parser, data, root);
    146147        do {
    147148                dump_tree_internal(parser, data, child, depth + 1);
  • uspace/app/usbinfo/hid.c

    r2a5b62b r8a121b1  
    5555} descriptor_walk_context_t;
    5656
    57 static bool is_descriptor_kind(uint8_t *d, usb_descriptor_type_t t)
     57static bool is_descriptor_kind(const uint8_t *d, usb_descriptor_type_t t)
    5858{
    5959        if (d == NULL) {
     
    180180 * @param arg Custom argument, passed as descriptor_walk_context_t.
    181181 */
    182 static void descriptor_walk_callback(uint8_t *raw_descriptor,
     182static void descriptor_walk_callback(const uint8_t *raw_descriptor,
    183183    size_t depth, void *arg)
    184184{
  • uspace/app/usbinfo/info.c

    r2a5b62b r8a121b1  
    5151}
    5252
    53 static void dump_match_ids_from_interface(uint8_t *descriptor, size_t depth,
    54     void *arg)
     53static void dump_match_ids_from_interface(
     54    const uint8_t *descriptor, size_t depth, void *arg)
    5555{
    5656        if (depth != 1) {
     
    165165
    166166
    167 static void dump_descriptor_tree_callback(uint8_t *descriptor,
    168     size_t depth, void *arg)
     167static void dump_descriptor_tree_callback(
     168    const uint8_t *descriptor, size_t depth, void *arg)
    169169{
    170170        const char *indent = get_indent(depth + 1);
     
    246246}
    247247
    248 static void find_string_indexes_callback(uint8_t *descriptor,
    249     size_t depth, void *arg)
     248static void find_string_indexes_callback(
     249    const uint8_t *descriptor, size_t depth, void *arg)
    250250{
    251251        size_t descriptor_length = descriptor[0];
  • uspace/app/usbinfo/usbinfo.h

    r2a5b62b r8a121b1  
    7474void destroy_device(usbinfo_device_t *);
    7575
    76 typedef void (*dump_descriptor_in_tree_t)(uint8_t *, size_t, void *);
     76typedef void (*dump_descriptor_in_tree_t)(const uint8_t *, size_t, void *);
    7777void browse_descriptor_tree(uint8_t *, size_t, usb_dp_descriptor_nesting_t *,
    7878    dump_descriptor_in_tree_t, size_t, void *);
Note: See TracChangeset for help on using the changeset viewer.