Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a24d6825 in mainline


Ignore:
Timestamp:
2014-01-23T23:15:18Z (8 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
3de7a62
Parents:
f9351b1
Message:

ehci: Implement queue head initialization

Location:
uspace/drv/bus/usb/ehci
Files:
1 added
3 edited

Legend:

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

    rf9351b1 ra24d6825  
    4949        endpoint_list.c \
    5050        hc.c \
     51        hw_struct/queue_head.c \
    5152        main.c \
    5253        res.c
  • uspace/drv/bus/usb/ehci/ehci_endpoint.c

    rf9351b1 ra24d6825  
    8585        }
    8686
    87 //      qh_init(ehci_ep->qh, ep);
     87        qh_init(ehci_ep->qh, ep);
    8888        endpoint_set_hc_data(
    8989            ep, ehci_ep, ehci_ep_toggle_get, ehci_ep_toggle_set);
  • uspace/drv/bus/usb/ehci/hw_struct/queue_head.h

    rf9351b1 ra24d6825  
    3737#include <assert.h>
    3838#include <sys/types.h>
     39#include <usb/host/endpoint.h>
    3940
    4041#include "link_pointer.h"
     
    4849#define QH_EP_CHAR_RL_SHIFT   28
    4950#define QH_EP_CHAR_C_FLAG     (1 << 27)
    50 #define QH_EP_CHAR_LENGTH_MASK   0x7ff
    51 #define QH_EP_CHAR_LENGTH_SHIFT  16
     51#define QH_EP_CHAR_MAX_LENGTH_MASK   0x7ff
     52#define QH_EP_CHAR_MAX_LENGTH_SHIFT  16
     53#define QH_EP_CHAR_MAX_LENGTH_SET(len) \
     54    (((len) & QH_EP_CHAR_MAX_LENGTH_MASK) << QH_EP_CHAR_MAX_LENGTH_SHIFT)
     55#define QH_EP_CHAR_MAX_LENGTH_GET(val) \
     56    (((val) >> QH_EP_CHAR_MAX_LENGTH_SHIFT) & QH_EP_CHAR_MAX_LENGTH_MASK)
    5257#define QH_EP_CHAR_H_FLAG     (1 << 15)
    5358#define QH_EP_CHAR_DTC_FLAG   (1 << 14)
    54 #define QH_EP_CHAR_EPS_MASK   0x3
    55 #define QH_EP_CHAR_EPS_SHIFT  12
    56 #define QH_EP_CHAR_EPS_FS     0x0
    57 #define QH_EP_CHAR_EPS_LS     0x1
    58 #define QH_EP_CHAR_EPS_HS     0x2
     59#define QH_EP_CHAR_EPS_FS     (0x0 << 12)
     60#define QH_EP_CHAR_EPS_LS     (0x1 << 12)
     61#define QH_EP_CHAR_EPS_HS     (0x2 << 12)
     62#define QH_EP_CHAR_EPS_MASK   (0x3 << 12)
    5963#define QH_EP_CHAR_EP_MASK    0xf
    6064#define QH_EP_CHAR_EP_SHIFT   8
     65#define QH_EP_CHAR_EP_SET(num) \
     66    (((num) & QH_EP_CHAR_EP_MASK) << QH_EP_CHAR_EP_SHIFT)
     67#define QH_EP_CHAR_ADDR_GET(val) \
     68    (((val) >> QH_EP_CHAR_ADDR_SHIFT) & QH_EP_CHAR_ADDR_MASK)
    6169#define QH_EP_CHAR_INACT_FLAG (1 << 7)
    6270#define QH_EP_CHAR_ADDR_MASK  0x3f
    6371#define QH_EP_CHAR_ADDR_SHIFT 0
     72#define QH_EP_CHAR_ADDR_SET(addr) \
     73    (((addr) & QH_EP_CHAR_ADDR_MASK) << QH_EP_CHAR_ADDR_SHIFT)
     74#define QH_EP_CHAR_ADDR_GET(val) \
     75    (((val) >> QH_EP_CHAR_ADDR_SHIFT) & QH_EP_CHAR_ADDR_MASK)
    6476
    6577        volatile uint32_t ep_cap;
    6678#define QH_EP_CAP_MULTI_MASK   0x3
    6779#define QH_EP_CAP_MULTI_SHIFT  30
     80#define QH_EP_CAP_MULTI_SET(count) \
     81        (((count) & QH_EP_CAP_MULTI_MASK) << QH_EP_CAP_MULTI_SHIFT)
    6882#define QH_EP_CAP_PORT_MASK    0x7f
    6983#define QH_EP_CAP_PORT_SHIFT   23
     84#define QH_EP_CAP_TT_PORT_SET(addr) \
     85        (((addr) & QH_EP_CAP_HUB_MASK) << QH_EP_CAP_HUB_SHIFT)
    7086#define QH_EP_CAP_HUB_MASK     0x7f
    7187#define QH_EP_CAP_HUB_SHIFT    16
     88#define QH_EP_CAP_TT_ADDR_SET(addr) \
     89        (((addr) & QH_EP_CAP_HUB_MASK) << QH_EP_CAP_HUB_SHIFT)
    7290#define QH_EP_CAP_C_MASK_MASK  0xff
    7391#define QH_EP_CAP_C_MASK_SHIFT 8
     92#define QH_EP_CAP_C_MASK_SET(val) \
     93        (((val) & QH_EP_CAP_C_MASK_MASK) << QH_EP_CAP_C_MASK_SHIFT)
    7494#define QH_EP_CAP_S_MASK_MASK  0xff
    75 #define QH_EP_CAP_S_MASL_SHIFT 0
     95#define QH_EP_CAP_S_MASK_SHIFT 0
     96#define QH_EP_CAP_S_MASK_SET(val) \
     97        (((val) & QH_EP_CAP_S_MASK_MASK) << QH_EP_CAP_S_MASK_SHIFT)
    7698
    7799        link_pointer_t current;
     
    118140} qh_t;
    119141
    120 
     142void qh_init(qh_t *instance, const endpoint_t *ep);
    121143#endif
    122144/**
Note: See TracChangeset for help on using the changeset viewer.