Changeset 32c2c8f in mainline


Ignore:
Timestamp:
2013-01-05T21:52:56Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1da979d
Parents:
b997e7b
Message:

libusbvirt: Add basic hub device implementation.

It takes care of descriptors, address, and state tracking.

Location:
uspace/lib
Files:
3 added
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/classes/hub.h

    rb997e7b r32c2c8f  
    7373        /** Characteristics bitmask. */
    7474        uint8_t characteristics;
    75 #define HUB_CHAR_POWER_PER_PORT_FLAG  (1 << 0)
    76 #define HUB_CHAR_NO_POWER_SWITCH_FLAG (1 << 1)
     75#define HUB_CHAR_POWER_PER_PORT_FLAG    (1 << 0)
     76#define HUB_CHAR_NO_POWER_SWITCH_FLAG   (1 << 1)
     77#define HUB_CHAR_COMPUND_DEVICE         (1 << 2)
     78#define HUB_CHAR_OC_PER_PORT_FLAG       (1 << 3)
     79#define HUB_CHAR_NO_OC_FLAG             (1 << 4)
    7780        /* Unused part of characteristics field */
    7881        uint8_t characteristics_reserved;
     
    8386} __attribute__ ((packed)) usb_hub_descriptor_header_t;
    8487
     88
     89#if 0
    8590/**
    8691 * @brief usb hub descriptor
     
    169174    //uint8_t * port_pwr_ctrl_mask;
    170175} usb_hub_descriptor_t;
    171 
     176#endif
    172177
    173178
  • uspace/lib/usbvirt/Makefile

    rb997e7b r32c2c8f  
    3434        -I$(LIBUSB_PREFIX)/include \
    3535        -I$(LIBUSBDEV_PREFIX)/include \
    36         -Iinclude
     36        -Iinclude \
     37        -Iinclude/usbvirt
    3738
    3839SOURCES = \
     
    4243        src/ipc_hc.c \
    4344        src/stdreq.c \
    44         src/transfer.c
     45        src/transfer.c \
     46        src/virthub_base.c \
     47        src/virthub_descriptors.c
    4548
    4649include $(USPACE_PREFIX)/Makefile.common
  • uspace/lib/usbvirt/include/usbvirt/device.h

    rb997e7b r32c2c8f  
    239239};
    240240
     241
     242int req_nop(usbvirt_device_t *device,
     243    const usb_device_request_setup_packet_t *setup_packet,
     244    uint8_t *data, size_t *act_size);
     245
    241246int usbvirt_device_plug(usbvirt_device_t *, const char *);
    242247void usbvirt_device_unplug(usbvirt_device_t *);
  • uspace/lib/usbvirt/src/stdreq.c

    rb997e7b r32c2c8f  
    6565}
    6666
     67/** NOP handler */
     68int req_nop(usbvirt_device_t *device,
     69    const usb_device_request_setup_packet_t *setup_packet,
     70    uint8_t *data, size_t *act_size)
     71{
     72        return EOK;
     73}
     74
    6775/** GET_DESCRIPTOR handler. */
    6876static int req_get_descriptor(usbvirt_device_t *device,
Note: See TracChangeset for help on using the changeset viewer.