Changeset 90dd59d in mainline
- Timestamp:
- 2011-08-25T13:04:59Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 23b0fe8
- Parents:
- 4f0e510
- Location:
- uspace/drv/bus/usb/ohci
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/batch.c
r4f0e510 r90dd59d 43 43 #include "hw_struct/endpoint_descriptor.h" 44 44 #include "hw_struct/transfer_descriptor.h" 45 /* 46 static void batch_control_write(usb_transfer_batch_t *instance); 47 static void batch_control_read(usb_transfer_batch_t *instance); 48 49 static void batch_interrupt_in(usb_transfer_batch_t *instance); 50 static void batch_interrupt_out(usb_transfer_batch_t *instance); 51 52 static void batch_bulk_in(usb_transfer_batch_t *instance); 53 static void batch_bulk_out(usb_transfer_batch_t *instance); 54 */ 55 static void batch_setup_control(usb_transfer_batch_t *batch) 56 { 57 // TODO Find a better way to do this 58 if (batch->setup_buffer[0] & (1 << 7)) 59 batch_control_read(batch); 60 else 61 batch_control_write(batch); 62 } 63 64 void (*batch_setup[4][3])(usb_transfer_batch_t*) = 65 { 66 { NULL, NULL, batch_setup_control }, 67 { NULL, NULL, NULL }, 68 { batch_bulk_in, batch_bulk_out, NULL }, 69 { batch_interrupt_in, batch_interrupt_out, NULL }, 70 }; 71 45 72 46 73 /** OHCI specific data required for USB transfer */ … … 140 167 batch->data_buffer = data->device_buffer + batch->setup_size; 141 168 } 169 170 assert(batch_setup[batch->ep->transfer_type][batch->ep->direction]); 171 batch_setup[batch->ep->transfer_type][batch->ep->direction](batch); 142 172 143 173 return EOK; -
uspace/drv/bus/usb/ohci/hc.c
r4f0e510 r90dd59d 163 163 } 164 164 /*----------------------------------------------------------------------------*/ 165 static int schedule(hcd_t *hcd, usb_transfer_batch_t *batch) 166 { 167 assert(hcd); 168 return hc_schedule(hcd->private_data, batch); 169 } 170 /*----------------------------------------------------------------------------*/ 165 171 /** Initialize OHCI hc driver structure 166 172 * … … 195 201 196 202 ret = hcd_init(&instance->generic, BANDWIDTH_AVAILABLE_USB11); 197 instance->generic.schedule = NULL; 203 instance->generic.private_data = instance; 204 instance->generic.schedule = schedule; 198 205 instance->generic.batch_init_hook = batch_init_ohci; 199 206 instance->generic.ep_add_hook = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.