Changeset 7786cea in mainline
- Timestamp:
- 2011-04-08T21:54:12Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- b854e56
- Parents:
- 96b8f322
- Location:
- uspace/drv/ohci
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/Makefile
r96b8f322 r7786cea 40 40 pci.c \ 41 41 root_hub.c \ 42 transfer_list.c 42 transfer_list.c \ 43 hw_struct/endpoint_descriptor.c 43 44 44 45 -
uspace/drv/ohci/batch.c
r96b8f322 r7786cea 51 51 } ohci_batch_t; 52 52 53 static void batch_control(usb_transfer_batch_t *instance); 53 54 static void batch_call_in_and_dispose(usb_transfer_batch_t *instance); 54 55 static void batch_call_out_and_dispose(usb_transfer_batch_t *instance); … … 83 84 instance->private_data = data; 84 85 86 /* we needs + 1 transfer descriptor as the last one won't be executed */ 85 87 data->td_count = 86 (buffer_size + OHCI_MAX_TRANSFER - 1) / OHCI_MAX_TRANSFER;88 1 + ((buffer_size + OHCI_MAX_TRANSFER - 1) / OHCI_MAX_TRANSFER); 87 89 if (ep->transfer_type == USB_TRANSFER_CONTROL) { 88 90 data->td_count += 2; … … 135 137 instance->buffer_size); 136 138 instance->next_step = batch_call_out_and_dispose; 137 /* TODO: implement */139 batch_control(instance); 138 140 usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance); 139 141 } … … 143 145 assert(instance); 144 146 instance->next_step = batch_call_in_and_dispose; 145 /* TODO: implement */147 batch_control(instance); 146 148 usb_log_debug("Batch(%p) CONTROL READ initialized.\n", instance); 147 149 } … … 150 152 { 151 153 assert(instance); 152 instance->direction = USB_DIRECTION_IN;154 assert(instance->direction == USB_DIRECTION_IN); 153 155 instance->next_step = batch_call_in_and_dispose; 154 156 /* TODO: implement */ … … 159 161 { 160 162 assert(instance); 161 instance->direction = USB_DIRECTION_OUT;163 assert(instance->direction == USB_DIRECTION_OUT); 162 164 /* We are data out, we are supposed to provide data */ 163 165 memcpy(instance->transport_buffer, instance->buffer, … … 188 190 ed_t * batch_ed(usb_transfer_batch_t *instance) 189 191 { 190 return NULL; 192 assert(instance); 193 ohci_batch_t *data = instance->private_data; 194 assert(data); 195 return data->ed; 196 } 197 /*----------------------------------------------------------------------------*/ 198 static void batch_control(usb_transfer_batch_t *instance) 199 { 200 assert(instance); 201 ohci_batch_t *data = instance->private_data; 202 assert(data); 203 ed_init(data->ed, instance->ep); 191 204 } 192 205 /*----------------------------------------------------------------------------*/ -
uspace/drv/ohci/hw_struct/endpoint_descriptor.h
r96b8f322 r7786cea 38 38 #include <stdint.h> 39 39 40 #include <usb/host/endpoint.h> 41 40 42 #include "utils/malloc32.h" 41 43 … … 52 54 #define ED_STATUS_D_IN (0x1) 53 55 #define ED_STATUS_D_OUT (0x2) 56 #define ED_STATUS_D_TRANSFER (0x3) 54 57 55 #define ED_STATUS_S_FLAG (1 << 13) /* speed flag */58 #define ED_STATUS_S_FLAG (1 << 13) /* speed flag: 1 = low */ 56 59 #define ED_STATUS_K_FLAG (1 << 14) /* skip flag (no not execute this ED) */ 57 60 #define ED_STATUS_F_FLAG (1 << 15) /* format: 1 = isochronous*/ … … 75 78 } __attribute__((packed)) ed_t; 76 79 77 static inline void ed_init_dummy(ed_t *instance) 80 void ed_init(ed_t *instance, endpoint_t *ep); 81 82 static inline void ed_add_tds(ed_t *instance, uint32_t head, uint32_t tail) 78 83 { 79 84 assert(instance); 80 bzero(instance, sizeof(ed_t));81 instance-> status |= ED_STATUS_K_FLAG;85 instance->td_head = head & ED_TDHEAD_PTR_MASK; 86 instance->td_tail = tail & ED_TDTAIL_PTR_MASK; 82 87 } 83 88 -
uspace/drv/ohci/transfer_list.c
r96b8f322 r7786cea 61 61 name, instance->list_head, instance->list_head_pa); 62 62 63 ed_init _dummy(instance->list_head);63 ed_init(instance->list_head, NULL); 64 64 list_initialize(&instance->batch_list); 65 65 fibril_mutex_initialize(&instance->guard); -
uspace/drv/ohci/utils/malloc32.h
r96b8f322 r7786cea 37 37 #include <assert.h> 38 38 #include <malloc.h> 39 #include <errno.h> 39 40 #include <mem.h> 40 41 #include <as.h>
Note:
See TracChangeset
for help on using the changeset viewer.