Changeset d1e580a in mainline for uspace/app


Ignore:
Timestamp:
2012-07-29T03:07:52Z (13 years ago)
Author:
Sean Bartell <wingedtachikoma@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
10334c2e
Parents:
d7c8e39f (diff), b2ba418 (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.
Message:

Merge mainline changes

Location:
uspace/app
Files:
1 deleted
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/Makefile

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

    rd7c8e39f rd1e580a  
    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

    rd7c8e39f rd1e580a  
    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[] = {
     
    146148        }
    147149
     150        bool something_active = false;
    148151        /*
    149152         * Process command-line options. They determine what shall be
     
    156159                switch (opt) {
    157160                        case -1:
     161                                break;
     162                        case 'l':
     163                                list();
    158164                                break;
    159165                        case '?':
     
    168174                                        if (actions[idx].opt == opt) {
    169175                                                actions[idx].active = true;
     176                                                something_active = true;
    170177                                                break;
    171178                                        }
     
    178185
    179186        /* Set the default action. */
    180         int idx = 0;
    181         bool something_active = false;
    182         while (actions[idx].opt != 0) {
    183                 if (actions[idx].active) {
    184                         something_active = true;
    185                         break;
    186                 }
    187                 idx++;
    188         }
    189187        if (!something_active) {
    190188                actions[0].active = true;
  • uspace/app/usbinfo/usbinfo.h

    rd7c8e39f rd1e580a  
    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.