Changeset 92574f4 in mainline for uspace/lib/usb/include/usb/request.h


Ignore:
Timestamp:
2011-02-24T12:03:27Z (13 years ago)
Author:
Lubos Slovak <lubos.slovak@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e7b7ebd5
Parents:
4837092 (diff), a80849c (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:

Merged development (changes in DDF, etc.).

Conflicts in uspace/drv/usbkbd/main.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/include/usb/request.h

    r4837092 r92574f4  
    3737
    3838#include <sys/types.h>
     39#include <l18n/langs.h>
    3940#include <usb/usb.h>
    4041#include <usb/pipes.h>
    4142#include <usb/descriptor.h>
     43
     44/** Standard device request. */
     45typedef enum {
     46        USB_DEVREQ_GET_STATUS = 0,
     47        USB_DEVREQ_CLEAR_FEATURE = 1,
     48        USB_DEVREQ_SET_FEATURE = 3,
     49        USB_DEVREQ_SET_ADDRESS = 5,
     50        USB_DEVREQ_GET_DESCRIPTOR = 6,
     51        USB_DEVREQ_SET_DESCRIPTOR = 7,
     52        USB_DEVREQ_GET_CONFIGURATION = 8,
     53        USB_DEVREQ_SET_CONFIGURATION = 9,
     54        USB_DEVREQ_GET_INTERFACE = 10,
     55        USB_DEVREQ_SET_INTERFACE = 11,
     56        USB_DEVREQ_SYNCH_FRAME = 12,
     57        USB_DEVREQ_LAST_STD
     58} usb_stddevreq_t;
     59
     60/** Device request setup packet.
     61 * The setup packet describes the request.
     62 */
     63typedef struct {
     64        /** Request type.
     65         * The type combines transfer direction, request type and
     66         * intended recipient.
     67         */
     68        uint8_t request_type;
     69        /** Request identification. */
     70        uint8_t request;
     71        /** Main parameter to the request. */
     72        union {
     73                uint16_t value;
     74                /* FIXME: add #ifdefs according to host endianess */
     75                struct {
     76                        uint8_t value_low;
     77                        uint8_t value_high;
     78                };
     79        };
     80        /** Auxiliary parameter to the request.
     81         * Typically, it is offset to something.
     82         */
     83        uint16_t index;
     84        /** Length of extra data. */
     85        uint16_t length;
     86} __attribute__ ((packed)) usb_device_request_setup_packet_t;
    4287
    4388int usb_control_request_set(usb_endpoint_pipe_t *,
     
    5297int usb_request_get_descriptor(usb_endpoint_pipe_t *, usb_request_type_t,
    5398    uint8_t, uint8_t, uint16_t, void *, size_t, size_t *);
     99int usb_request_get_descriptor_alloc(usb_endpoint_pipe_t *, usb_request_type_t,
     100    uint8_t, uint8_t, uint16_t, void **, size_t *);
    54101int usb_request_get_device_descriptor(usb_endpoint_pipe_t *,
    55102    usb_standard_device_descriptor_t *);
     
    60107int usb_request_set_configuration(usb_endpoint_pipe_t *, uint8_t);
    61108
     109int usb_request_get_supported_languages(usb_endpoint_pipe_t *,
     110    l18_win_locales_t **, size_t *);
     111int usb_request_get_string(usb_endpoint_pipe_t *, size_t, l18_win_locales_t,
     112    char **);
     113
    62114#endif
    63115/**
Note: See TracChangeset for help on using the changeset viewer.