Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ohci/hw_struct/hcca.h

    r1b90e90 r6c76e75  
    3838#include <malloc.h>
    3939
    40 #include "mem_access.h"
    41 
    42 #define HCCA_INT_EP_COUNT  32
    43 
    4440/** Host controller communication area.
    4541 * Shared memory used for communication between the controller and the driver.
    4642 */
    4743typedef struct hcca {
    48         /** Interrupt endpoints */
    49         uint32_t int_ep[HCCA_INT_EP_COUNT];
    50         /** Frame number. */
     44        uint32_t int_ep[32];
    5145        uint16_t frame_number;
    5246        uint16_t pad1;
    53         /** Pointer to the last completed TD. (useless) */
    5447        uint32_t done_head;
    55         /** Padding to make the size 256B */
    56         uint32_t reserved[29];
    57 } __attribute__((packed, aligned)) hcca_t;
     48        uint32_t reserved[30];
     49} hcca_t;
    5850
    59 /** Allocate properly aligned structure.
    60  *
    61  * The returned structure is zeroed upon allocation.
    62  *
    63  * @return Usable HCCA memory structure.
    64  */
    65 static inline hcca_t * hcca_get(void)
     51static inline void * hcca_get(void)
    6652{
    6753        assert(sizeof(hcca_t) == 256);
    68         hcca_t *hcca = memalign(256, sizeof(hcca_t));
    69         if (hcca)
    70                 bzero(hcca, sizeof(hcca_t));
    71         return hcca;
    72 }
    73 
    74 /** Set HCCA interrupt endpoint pointer table entry.
    75  * @param hcca HCCA memory structure.
    76  * @param index table index.
    77  * @param pa Physical address.
    78  */
    79 static inline void hcca_set_int_ep(hcca_t *hcca, unsigned index, uintptr_t pa)
    80 {
    81         assert(hcca);
    82         assert(index < HCCA_INT_EP_COUNT);
    83         OHCI_MEM32_WR(hcca->int_ep[index], pa);
    84 
     54        return memalign(256, sizeof(hcca_t));
    8555}
    8656#endif
Note: See TracChangeset for help on using the changeset viewer.