Changeset 2bf8f8c in mainline
- Timestamp:
- 2011-03-21T13:18:03Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d328172
- Parents:
- be7950e8
- Location:
- uspace/drv/ohci
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/batch.c
rbe7950e8 r2bf8f8c 39 39 40 40 #include "batch.h" 41 #include "utils/malloc32.h" 41 42 42 43 #define DEFAULT_ERROR_COUNT 3 … … 48 49 usb_speed_t speed, 49 50 char *buffer, 50 size_t size,51 size_t buffer_size, 51 52 char *setup_buffer, 52 53 size_t setup_size, … … 57 58 ) 58 59 { 59 return NULL; 60 #define CHECK_NULL_DISPOSE_RETURN(ptr, message...) \ 61 if (ptr == NULL) { \ 62 usb_log_error(message); \ 63 if (instance) { \ 64 batch_dispose(instance); \ 65 } \ 66 return NULL; \ 67 } else (void)0 68 69 batch_t *instance = malloc(sizeof(batch_t)); 70 CHECK_NULL_DISPOSE_RETURN(instance, 71 "Failed to allocate batch instance.\n"); 72 batch_init(instance, target, transfer_type, speed, max_packet_size, 73 buffer, NULL, buffer_size, NULL, setup_size, func_in, 74 func_out, arg, fun, NULL); 75 76 if (buffer_size > 0) { 77 instance->transport_buffer = malloc32(buffer_size); 78 CHECK_NULL_DISPOSE_RETURN(instance->transport_buffer, 79 "Failed to allocate device accessible buffer.\n"); 80 } 81 82 if (setup_size > 0) { 83 instance->setup_buffer = malloc32(setup_size); 84 CHECK_NULL_DISPOSE_RETURN(instance->setup_buffer, 85 "Failed to allocate device accessible setup buffer.\n"); 86 memcpy(instance->setup_buffer, setup_buffer, setup_size); 87 } 88 89 90 return instance; 60 91 } 61 92 /*----------------------------------------------------------------------------*/ 62 93 void batch_dispose(batch_t *instance) 63 94 { 95 assert(instance); 64 96 } 65 97 /*----------------------------------------------------------------------------*/ 66 98 void batch_control_write(batch_t *instance) 67 99 { 100 assert(instance); 68 101 } 69 102 /*----------------------------------------------------------------------------*/ 70 103 void batch_control_read(batch_t *instance) 71 104 { 105 assert(instance); 72 106 } 73 107 /*----------------------------------------------------------------------------*/ 74 108 void batch_interrupt_in(batch_t *instance) 75 109 { 110 assert(instance); 76 111 } 77 112 /*----------------------------------------------------------------------------*/ 78 113 void batch_interrupt_out(batch_t *instance) 79 114 { 115 assert(instance); 80 116 } 81 117 /*----------------------------------------------------------------------------*/ 82 118 void batch_bulk_in(batch_t *instance) 83 119 { 120 assert(instance); 84 121 } 85 122 /*----------------------------------------------------------------------------*/ 86 123 void batch_bulk_out(batch_t *instance) 87 124 { 125 assert(instance); 88 126 } 89 127 /** -
uspace/drv/ohci/hc.c
rbe7950e8 r2bf8f8c 108 108 assert(batch); 109 109 if (batch->target.address == instance->rh.address) { 110 rh_request(&instance->rh, batch); 111 return EOK; 110 return rh_request(&instance->rh, batch); 112 111 } 113 112 /* TODO: implement */ -
uspace/drv/ohci/root_hub.c
rbe7950e8 r2bf8f8c 56 56 } 57 57 /*----------------------------------------------------------------------------*/ 58 voidrh_request(rh_t *instance, batch_t *request)58 int rh_request(rh_t *instance, batch_t *request) 59 59 { 60 usb_log_error("Request processing not implemented.\n");61 60 /* TODO: implement */ 61 usb_log_error("Root hub request processing not implemented.\n"); 62 return ENOTSUP; 62 63 } 63 64 /*----------------------------------------------------------------------------*/ -
uspace/drv/ohci/root_hub.h
rbe7950e8 r2bf8f8c 49 49 int rh_init(rh_t *instance, ddf_dev_t *dev, ohci_regs_t *regs); 50 50 51 voidrh_request(rh_t *instance, batch_t *request);51 int rh_request(rh_t *instance, batch_t *request); 52 52 53 53 void rh_interrupt(rh_t *instance);
Note:
See TracChangeset
for help on using the changeset viewer.