Changes in uspace/drv/bus/usb/ohci/hw_struct/hcca.h [1b90e90:6c76e75] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/hw_struct/hcca.h
r1b90e90 r6c76e75 38 38 #include <malloc.h> 39 39 40 #include "mem_access.h"41 42 #define HCCA_INT_EP_COUNT 3243 44 40 /** Host controller communication area. 45 41 * Shared memory used for communication between the controller and the driver. 46 42 */ 47 43 typedef struct hcca { 48 /** Interrupt endpoints */ 49 uint32_t int_ep[HCCA_INT_EP_COUNT]; 50 /** Frame number. */ 44 uint32_t int_ep[32]; 51 45 uint16_t frame_number; 52 46 uint16_t pad1; 53 /** Pointer to the last completed TD. (useless) */54 47 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; 58 50 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) 51 static inline void * hcca_get(void) 66 52 { 67 53 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)); 85 55 } 86 56 #endif
Note:
See TracChangeset
for help on using the changeset viewer.