Changeset 79d2987 in mainline for uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.h
- Timestamp:
- 2011-02-11T17:16:36Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4e8e1f5
- Parents:
- 25971d2 (diff), 608afb9 (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.h
r25971d2 r79d2987 38 38 #include <usb/usb.h> 39 39 40 #include "utils/malloc32.h"41 #include "callback.h"42 40 #include "link_pointer.h" 43 41 … … 86 84 volatile uint32_t buffer_ptr; 87 85 88 /* there is 16 bytes of data available here 89 * those are used to store callback pointer 90 * and next pointer. Thus, there is some free space 91 * on 32bits systems. 86 /* there is 16 bytes of data available here, according to UHCI 87 * Design guide, according to linux kernel the hardware does not care 88 * we don't use it anyway 92 89 */ 93 struct transfer_descriptor *next_va;94 callback_t *callback;95 90 } __attribute__((packed)) transfer_descriptor_t; 96 91 97 92 98 93 void transfer_descriptor_init(transfer_descriptor_t *instance, 99 int error_count, size_t size, bool isochronous, usb_target_t target,100 94 int error_count, size_t size, bool toggle, bool isochronous, 95 usb_target_t target, int pid, void *buffer); 101 96 102 static inline transfer_descriptor_t * transfer_descriptor_get( 103 int error_count, size_t size, bool isochronous, usb_target_t target, 104 int pid, void *buffer) 105 { 106 transfer_descriptor_t * instance = 107 malloc32(sizeof(transfer_descriptor_t)); 97 int transfer_descriptor_status(transfer_descriptor_t *instance); 108 98 109 if (instance) 110 transfer_descriptor_init( 111 instance, error_count, size, isochronous, target, pid, buffer); 112 return instance; 113 } 114 115 void transfer_descriptor_fini(transfer_descriptor_t *instance); 116 117 static inline void transfer_descriptor_dispose(transfer_descriptor_t *instance) 99 static inline bool transfer_descriptor_is_active( 100 transfer_descriptor_t *instance) 118 101 { 119 102 assert(instance); 120 transfer_descriptor_fini(instance); 121 free32(instance); 122 } 123 124 static inline void transfer_descriptor_append( 125 transfer_descriptor_t *instance, transfer_descriptor_t *item) 126 { 127 assert(instance); 128 instance->next_va = item; 129 instance->next = (uintptr_t)addr_to_phys( item ) & LINK_POINTER_ADDRESS_MASK; 103 return (instance->status & TD_STATUS_ERROR_ACTIVE) != 0; 130 104 } 131 105 #endif
Note:
See TracChangeset
for help on using the changeset viewer.