Changeset 72cd53d in mainline for uspace/lib


Ignore:
Timestamp:
2011-05-17T07:18:11Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3375bd4
Parents:
50cd285 (diff), e913cc9 (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:

Small fixes and improvements

Fixed buffer overflow in lsusb.
lsusb scans all adresses, not only first ones.
Played with logging levels, now it is configurable.
VHC prints name of connected device and destroys pending transfers
when device is unplugged.

Location:
uspace/lib
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/devman.c

    r50cd285 r72cd53d  
    415415        }
    416416
     417        /* To be on the safe-side. */
    417418        path[path_size - 1] = 0;
    418419
    419         if (IPC_GET_ARG2(data_request_call) >= path_size) {
     420        size_t transferred_size = IPC_GET_ARG2(data_request_call);
     421
     422        if (transferred_size >= path_size) {
    420423                return ELIMIT;
    421424        }
     425
     426        /* Terminate the string (trailing 0 not send over IPC). */
     427        path[transferred_size] = 0;
    422428
    423429        return EOK;
  • uspace/lib/usb/include/usb/debug.h

    r50cd285 r72cd53d  
    8181
    8282/** Default log level. */
    83 #define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_DEBUG
    84 
     83#ifdef CONFIG_USB_RELEASE_BUILD
     84#  define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_INFO
     85#else
     86#  define USB_LOG_LEVEL_DEFAULT USB_LOG_LEVEL_DEBUG
     87#endif
    8588
    8689void usb_log_enable(usb_log_level_t, const char *);
  • uspace/lib/usb/src/debug.c

    r50cd285 r72cd53d  
    116116        /*
    117117         * Serialize access to log files.
    118          * Always print to log file, to screen print only when the enabled
    119          * log level is high enough.
     118         * Print to screen only messages with higher level than the one
     119         * specified during logging initialization.
     120         * Print also to file, to it print one more (lower) level as well.
    120121         */
    121122        fibril_mutex_lock(&log_serializer);
     
    123124        const char *level_name = log_level_name(level);
    124125
    125         if (log_stream != NULL) {
     126        if ((log_stream != NULL) && (level <= log_level + 1)) {
    126127                va_start(args, format);
    127128
  • uspace/lib/usbvirt/include/usbvirt/ipc.h

    r50cd285 r72cd53d  
    3939#include <usb/usb.h>
    4040#include <bool.h>
     41#include <usbvirt/device.h>
    4142
    4243/** IPC methods communication between host controller and virtual device. */
Note: See TracChangeset for help on using the changeset viewer.