Changeset 9e279c4 in mainline


Ignore:
Timestamp:
2012-07-20T15:25:32Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8d355aa8
Parents:
3795f9c
Message:

Merge lsusb to usbinfo.

Use -l or —list to get the list.

Location:
uspace
Files:
1 deleted
4 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/Makefile

    r3795f9c r9e279c4  
    4747        app/klog \
    4848        app/loc \
    49         app/lsusb \
    5049        app/mkfat \
    5150        app/mkexfat \
  • uspace/app/usbinfo/Makefile

    r3795f9c r9e279c4  
    4747        hid.c \
    4848        info.c \
     49        list.c \
    4950        main.c
    5051
  • uspace/app/usbinfo/list.c

    r3795f9c r9e279c4  
    4747#include <usb/hc.h>
    4848
    49 #define NAME "lsusb"
     49#include "usbinfo.h"
    5050
    5151#define MAX_USB_ADDRESS USB11_ADDRESS_MAX
     
    9090}
    9191
    92 int main(int argc, char *argv[])
     92void list(void)
    9393{
    9494        category_id_t usbhc_cat;
     
    102102                printf(NAME ": Error resolving category '%s'",
    103103                    USB_HC_CATEGORY);
    104                 return 1;
     104                return;
    105105        }
    106106
     
    108108        if (rc != EOK) {
    109109                printf(NAME ": Error getting list of host controllers.\n");
    110                 return 1;
     110                return;
    111111        }
    112112
     
    131131
    132132        free(svcs);
    133 
    134         return 0;
    135133}
    136134
  • uspace/app/usbinfo/main.c

    r3795f9c r9e279c4  
    6262
    6363        _OPTION("-h --help", "Print this help and exit.");
     64        _OPTION("-l --list", "Print a list of host controllers and devices.");
    6465        _OPTION("-i --identification", "Brief device identification.");
    6566        _OPTION("-m --match-ids", "Print match ids generated for the device.");
     
    8283        {"help", no_argument, NULL, 'h'},
    8384        {"identification", no_argument, NULL, 'i'},
     85        {"list", no_argument, NULL, 'l'},
    8486        {"match-ids", no_argument, NULL, 'm'},
    8587        {"descriptor-tree", no_argument, NULL, 't'},
     
    9193        {0, 0, NULL, 0}
    9294};
    93 static const char *short_options = "himtTsSrR";
     95static const char *short_options = "hilmtTsSrR";
    9496
    9597static usbinfo_action_t actions[] = {
     
    157159                        case -1:
    158160                                break;
     161                        case 'l':
     162                                list();
     163                                return 0;
    159164                        case '?':
    160165                                print_usage(argv[0]);
  • uspace/app/usbinfo/usbinfo.h

    r3795f9c r9e279c4  
    7979    dump_descriptor_in_tree_t, size_t, void *);
    8080
     81void list(void);
    8182
    8283void dump_short_device_identification(usbinfo_device_t *);
Note: See TracChangeset for help on using the changeset viewer.