Changeset aab02fb in mainline for uspace/lib/usbvirt/device.h


Ignore:
Timestamp:
2010-10-26T22:21:45Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
efedee77
Parents:
fa2a361
Message:

Debugging support for libusbvirt

Added methods debug and lib_debug to device structure to simplify
debugging. Each method gets as a parameter debug level describing
verbosity of the message and also message tag that allows filtering
based on message type (e.g. messages related to transactions, to
device requests etc.).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbvirt/device.h

    rfa2a361 raab02fb  
    145145} usbvirt_control_transfer_t;
    146146
     147typedef enum {
     148        USBVIRT_DEBUGTAG_BASE = 1,
     149        USBVIRT_DEBUGTAG_TRANSACTION = 2,
     150        USBVIRT_DEBUGTAG_CONTROL_PIPE_ZERO = 4,
     151        USBVIRT_DEBUGTAG_ALL = 255
     152} usbvirt_debug_tags_t;
     153
    147154/** Virtual USB device. */
    148155struct usbvirt_device {
     
    186193        /** State information on control-transfer endpoints. */
    187194        usbvirt_control_transfer_t current_control_transfers[USB11_ENDPOINT_MAX];
     195       
     196        /* User debugging. */
     197       
     198        /** Debug print. */
     199        void (*debug)(usbvirt_device_t *dev, int level, uint8_t tag,
     200            const char *format, ...);
     201       
     202        /** Current debug level. */
     203        int debug_level;
     204       
     205        /** Bitmap of currently enabled tags. */
     206        uint8_t debug_enabled_tags;
     207       
     208        /* Library debugging. */
     209       
     210        /** Debug print. */
     211        void (*lib_debug)(usbvirt_device_t *dev, int level, uint8_t tag,
     212            const char *format, ...);
     213       
     214        /** Current debug level. */
     215        int lib_debug_level;
     216       
     217        /** Bitmap of currently enabled tags. */
     218        uint8_t lib_debug_enabled_tags;
    188219};
    189220
Note: See TracChangeset for help on using the changeset viewer.