Changeset b991d37 in mainline for uspace/drv/bus/usb/uhci/uhci_batch.h
- Timestamp:
- 2011-08-31T16:41:11Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ff6dd73
- Parents:
- 96e2d01
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/uhci_batch.h
r96e2d01 rb991d37 36 36 37 37 #include <usb/host/batch.h> 38 #include <adt/list.h> 38 39 39 40 #include "hw_struct/queue_head.h" 41 #include "hw_struct/transfer_descriptor.h" 40 42 41 int batch_init_uhci(usb_transfer_batch_t *batch); 42 bool batch_is_complete(usb_transfer_batch_t *batch); 43 qh_t * batch_qh(usb_transfer_batch_t *batch); 43 /** UHCI specific data required for USB transfer */ 44 typedef struct uhci_transfer_batch { 45 /** Queue head 46 * This QH is used to maintain UHCI schedule structure and the element 47 * pointer points to the first TD of this batch. 48 */ 49 qh_t *qh; 50 /** List of TDs needed for the transfer */ 51 td_t *tds; 52 /** Number of TDs used by the transfer */ 53 size_t td_count; 54 /** Data buffer, must be accessible by the UHCI hw */ 55 void *device_buffer; 56 /** Generic transfer data */ 57 usb_transfer_batch_t *usb_batch; 58 /** List element */ 59 link_t link; 60 } uhci_transfer_batch_t; 61 62 uhci_transfer_batch_t * uhci_transfer_batch_get(usb_transfer_batch_t *batch); 63 void uhci_transfer_batch_call_dispose(uhci_transfer_batch_t *uhci_batch); 64 bool uhci_transfer_batch_is_complete(uhci_transfer_batch_t *uhci_batch); 65 66 static inline void * uhci_transfer_batch_data_buffer( 67 uhci_transfer_batch_t *uhci_batch) 68 { 69 assert(uhci_batch); 70 assert(uhci_batch->usb_batch); 71 assert(uhci_batch->device_buffer); 72 return uhci_batch->device_buffer + sizeof(qh_t) + 73 uhci_batch->td_count * sizeof(td_t) + 74 uhci_batch->usb_batch->setup_size; 75 } 76 /*----------------------------------------------------------------------------*/ 77 static inline void * uhci_transfer_batch_setup_buffer( 78 uhci_transfer_batch_t *uhci_batch) 79 { 80 assert(uhci_batch); 81 assert(uhci_batch->usb_batch); 82 assert(uhci_batch->device_buffer); 83 return uhci_batch->device_buffer + sizeof(qh_t) + 84 uhci_batch->td_count * sizeof(td_t); 85 } 86 /*----------------------------------------------------------------------------*/ 87 static inline uhci_transfer_batch_t *uhci_transfer_batch_from_link(link_t *l) 88 { 89 assert(l); 90 return list_get_instance(l, uhci_transfer_batch_t, link); 91 } 92 44 93 #endif 45 94 /**
Note:
See TracChangeset
for help on using the changeset viewer.