Changeset 5d4193c in mainline for uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c
- Timestamp:
- 2011-02-11T12:06:05Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03197ffc, fe1776c2
- Parents:
- 960ff451 (diff), f96aefc (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.c
r960ff451 r5d4193c 32 32 * @brief UHCI driver 33 33 */ 34 #include <errno.h> 34 35 #include <usb/debug.h> 35 36 36 37 #include "transfer_descriptor.h" 38 #include "utils/malloc32.h" 37 39 38 40 void transfer_descriptor_init(transfer_descriptor_t *instance, 39 int error_count, size_t size, bool isochronous, usb_target_t target,40 41 int error_count, size_t size, bool toggle, bool isochronous, 42 usb_target_t target, int pid, void *buffer) 41 43 { 42 44 assert(instance); 43 45 44 instance->next = 45 0 | LINK_POINTER_TERMINATE_FLAG; 46 instance->next = 0 | LINK_POINTER_TERMINATE_FLAG; 46 47 47 48 assert(size < 1024);49 48 instance->status = 0 50 49 | ((error_count & TD_STATUS_ERROR_COUNT_MASK) << TD_STATUS_ERROR_COUNT_POS) 51 50 | TD_STATUS_ERROR_ACTIVE; 52 51 52 assert(size < 1024); 53 53 instance->device = 0 54 54 | (((size - 1) & TD_DEVICE_MAXLEN_MASK) << TD_DEVICE_MAXLEN_POS) 55 | (toggle ? TD_DEVICE_DATA_TOGGLE_ONE_FLAG : 0) 55 56 | ((target.address & TD_DEVICE_ADDRESS_MASK) << TD_DEVICE_ADDRESS_POS) 56 57 | ((target.endpoint & TD_DEVICE_ENDPOINT_MASK) << TD_DEVICE_ENDPOINT_POS) … … 58 59 59 60 instance->buffer_ptr = 0; 60 61 instance->next_va = NULL;62 instance->callback = NULL;63 61 64 62 if (size) { … … 106 104 return USB_OUTCOME_CRCERROR; 107 105 108 assert((((status >> TD_STATUS_ERROR_POS) & TD_STATUS_ERROR_MASK)109 | TD_STATUS_ERROR_RESERVED) == TD_STATUS_ERROR_RESERVED);106 // assert((((status >> TD_STATUS_ERROR_POS) & TD_STATUS_ERROR_MASK) 107 // | TD_STATUS_ERROR_RESERVED) == TD_STATUS_ERROR_RESERVED); 110 108 return USB_OUTCOME_OK; 111 109 } 112 113 void transfer_descriptor_fini(transfer_descriptor_t *instance)110 /*----------------------------------------------------------------------------*/ 111 int transfer_descriptor_status(transfer_descriptor_t *instance) 114 112 { 115 113 assert(instance); 116 callback_run(instance->callback, 117 convert_outcome(instance->status), 118 ((instance->status >> TD_STATUS_ACTLEN_POS) + 1) & TD_STATUS_ACTLEN_MASK 119 ); 114 if (convert_outcome(instance->status)) 115 return EINVAL; //TODO: use sane error value here 116 return EOK; 120 117 } 121 118 /**
Note:
See TracChangeset
for help on using the changeset viewer.