Ignore:
Timestamp:
2010-10-25T07:44:02Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ca07cd3
Parents:
7a7bfeb3
Message:

Better debugging support in VHCD

Also, added some missing comments.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/bus/usb/hcd/virtual/hubintern.h

    r7a7bfeb3 r355f7c2  
    3838#include "hub.h"
    3939
     40/** Endpoint number for status change pipe. */
    4041#define HUB_STATUS_CHANGE_PIPE 1
     42/** Configuration value for hub configuration. */
    4143#define HUB_CONFIGURATION_ID 1
    4244
     
    6668} __attribute__ ((packed)) hub_descriptor_t;
    6769
     70/** Hub port internal state.
     71 * Some states (e.g. port over current) are not covered as they are not
     72 * simulated at all.
     73 */
    6874typedef enum {
    6975        HUB_PORT_STATE_NOT_CONFIGURED,
     
    7884} hub_port_state_t;
    7985
     86/** Convert hub port state to a char. */
     87static inline char hub_port_state_as_char(hub_port_state_t state) {
     88        switch (state) {
     89                case HUB_PORT_STATE_NOT_CONFIGURED:
     90                        return '-';
     91                case HUB_PORT_STATE_POWERED_OFF:
     92                        return 'O';
     93                case HUB_PORT_STATE_DISCONNECTED:
     94                        return 'X';
     95                case HUB_PORT_STATE_DISABLED:
     96                        return 'D';
     97                case HUB_PORT_STATE_RESETTING:
     98                        return 'R';
     99                case HUB_PORT_STATE_ENABLED:
     100                        return 'E';
     101                case HUB_PORT_STATE_SUSPENDED:
     102                        return 'S';
     103                case HUB_PORT_STATE_RESUMING:
     104                        return 'F';
     105                default:
     106                        return '?';
     107        }
     108}
     109
     110/** Hub status change mask bits. */
    80111typedef enum {
    81112        HUB_STATUS_C_PORT_CONNECTION = (1 << 0),
     
    87118} hub_status_change_t;
    88119
     120/** Hub port information. */
    89121typedef struct {
    90122        virtdev_connection_t *device;
     
    93125} hub_port_t;
    94126
     127/** Hub device type. */
    95128typedef struct {
    96129        hub_port_t ports[HUB_PORT_COUNT];
Note: See TracChangeset for help on using the changeset viewer.