Changeset 5cbccd4 in mainline


Ignore:
Timestamp:
2017-06-15T17:26:44Z (7 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
48197c1
Parents:
f4eb6c93
Message:

xhci: register structures

Location:
uspace
Files:
5 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/Makefile

    rf4eb6c93 r5cbccd4  
    3030
    3131LIBS = \
     32        $(LIBUSBHOST_PREFIX)/libusbhost.a \
    3233        $(LIBUSB_PREFIX)/libusb.a \
    3334        $(LIBDRV_PREFIX)/libdrv.a
     
    3536EXTRA_CFLAGS += \
    3637        -I$(LIBUSB_PREFIX)/include \
     38        -I$(LIBUSBHOST_PREFIX)/include \
    3739        -I$(LIBDRV_PREFIX)/include
    3840
     
    4042
    4143SOURCES = \
     44        hc.c \
     45        debug.c \
    4246        trb_ring.c \
    4347        main.c
  • uspace/drv/bus/usb/xhci/hw_struct/context.h

    rf4eb6c93 r5cbccd4  
    6767#define XHCI_EP_TR_DPTR(ctx)            XHCI_DWORD_EXTRACT((ctx).data[2], 63,  4)
    6868
    69 } ep_ctx_t;
     69} ep_ctx_t __attribute__((packed));
    7070
    7171/**
     
    9393#define XHCI_SLOT_SLOT_STATE(ctx)       XHCI_DWORD_EXTRACT((ctx).data[3], 31, 27)
    9494
    95 } xhci_slot_ctx_t;
     95} xhci_slot_ctx_t __attribute__((packed));
    9696
    9797/**
     
    108108typedef struct xhci_stream_ctx {
    109109        uint64_t data [2];
    110 } xhci_stream_ctx_t;
     110} xhci_stream_ctx_t __attribute__((packed));
    111111
    112112#endif
  • uspace/drv/bus/usb/xhci/main.c

    rf4eb6c93 r5cbccd4  
    3939#include <io/logctl.h>
    4040#include <usb/debug.h>
     41#include <usb/host/ddf_helpers.h>
     42
     43#include "hc.h"
    4144
    4245#define NAME "xhci"
    4346
     47static int xhci_driver_init(hcd_t *, const hw_res_list_parsed_t *, bool);
     48static void xhci_driver_fini(hcd_t *);
     49
     50static const ddf_hc_driver_t xhci_ddf_hc_driver = {
     51        .hc_speed = USB_SPEED_SUPER,
     52        .irq_code_gen = xhci_hc_gen_irq_code,
     53        .init = xhci_driver_init,
     54        .fini = xhci_driver_fini,
     55        .name = "XHCI-PCI",
     56        .ops = {
     57                .schedule       = xhci_hc_schedule,
     58                .irq_hook       = xhci_hc_interrupt,
     59                .status_hook    = xhci_hc_status,
     60        }
     61};
     62
     63static int xhci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, bool irq)
     64{
     65        usb_log_info("Initializing");
     66        return ENOTSUP;
     67}
     68
     69static void xhci_driver_fini(hcd_t *hcd)
     70{
     71        usb_log_info("Finishing");
     72        assert(hcd);
     73}
    4474
    4575/** Initializes a new ddf driver instance of XHCI hcd.
     
    5080static int xhci_dev_add(ddf_dev_t *device)
    5181{
    52         usb_log_info("Requested to add device %s", ddf_dev_get_name(device));
    53         return ENOTSUP;
     82        usb_log_info("Adding device %s", ddf_dev_get_name(device));
     83        return hcd_ddf_add_hc(device, &xhci_ddf_hc_driver);
    5484}
    5585
     
    76106{
    77107        log_init(NAME);
    78         logctl_set_log_level(NAME, LVL_DEBUG);
     108        logctl_set_log_level(NAME, LVL_DEBUG2);
    79109        return ddf_driver_main(&xhci_driver);
    80110}
  • uspace/lib/c/include/byteorder.h

    rf4eb6c93 r5cbccd4  
    8585#define ntohl(n)  uint32_t_be2host((n))
    8686
     87#define uint8_t_be2host(n)  (n)
     88#define uint8_t_le2host(n)  (n)
     89#define host2uint8_t_be(n)  (n)
     90#define host2uint8_t_le(n)  (n)
     91
    8792static inline uint64_t uint64_t_byteorder_swap(uint64_t n)
    8893{
  • uspace/lib/pcm/src/format.c

    rf4eb6c93 r5cbccd4  
    4141
    4242#include "format.h"
    43 
    44 #define uint8_t_le2host(x) (x)
    45 #define host2uint8_t_le(x) (x)
    46 #define uint8_t_be2host(x) (x)
    47 #define host2uint8_t_be(x) (x)
    4843
    4944#define int8_t_le2host(x) (x)
  • uspace/lib/usbhost/src/ddf_helpers.c

    rf4eb6c93 r5cbccd4  
    854854            [USB_SPEED_HIGH] = { .bw = BANDWIDTH_AVAILABLE_USB11,
    855855                                 .bw_count = bandwidth_count_usb11 },
     856            [USB_SPEED_SUPER] = { .bw = BANDWIDTH_AVAILABLE_USB11,
     857                                 .bw_count = bandwidth_count_usb11 },
    856858        };
    857859
Note: See TracChangeset for help on using the changeset viewer.