Changeset 432a269 in mainline for uspace/drv/bus/usb/uhci/hw_struct/transfer_descriptor.h
- Timestamp:
- 2011-09-16T21:13:57Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3a11f17
- Parents:
- c0e53ff (diff), fd07e526 (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/bus/usb/uhci/hw_struct/transfer_descriptor.h
rc0e53ff r432a269 69 69 #define TD_STATUS_ACTLEN_MASK 0x7ff 70 70 71 /* double word with USB device specific info */71 /** Double word with USB device specific info */ 72 72 volatile uint32_t device; 73 73 #define TD_DEVICE_MAXLEN_POS 21 … … 87 87 /* According to UHCI design guide, there is 16 bytes of 88 88 * data available here. 89 * According to linux kernel the hardware does not care,90 * itjust needs to be aligned. We don't use it anyway.89 * According to Linux kernel the hardware does not care, 90 * memory just needs to be aligned. We don't use it anyway. 91 91 */ 92 92 } __attribute__((packed)) td_t; … … 95 95 void td_init(td_t *instance, int error_count, size_t size, bool toggle, 96 96 bool iso, bool low_speed, usb_target_t target, usb_packet_id pid, 97 void *buffer,td_t *next);97 const void *buffer, const td_t *next); 98 98 99 int td_status( td_t *instance);99 int td_status(const td_t *instance); 100 100 101 void td_print_status( td_t *instance);101 void td_print_status(const td_t *instance); 102 102 /*----------------------------------------------------------------------------*/ 103 103 /** Helper function for parsing actual size out of TD. … … 106 106 * @return Parsed actual size. 107 107 */ 108 static inline size_t td_act_size( td_t *instance)108 static inline size_t td_act_size(const td_t *instance) 109 109 { 110 110 assert(instance); 111 111 const uint32_t s = instance->status; 112 /* Actual size is encoded as n-1 (UHCI design guide p. 23) */ 112 113 return ((s >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK; 113 114 } … … 119 120 * false otherwise. 120 121 */ 121 static inline bool td_is_short( td_t *instance)122 static inline bool td_is_short(const td_t *instance) 122 123 { 123 124 const size_t act_size = td_act_size(instance); … … 134 135 * @return Toggle bit value. 135 136 */ 136 static inline int td_toggle( td_t *instance)137 static inline int td_toggle(const td_t *instance) 137 138 { 138 139 assert(instance); … … 145 146 * @return Active bit value. 146 147 */ 147 static inline bool td_is_active( td_t *instance)148 static inline bool td_is_active(const td_t *instance) 148 149 { 149 150 assert(instance);
Note:
See TracChangeset
for help on using the changeset viewer.