Changeset d328172 in mainline for uspace/drv/ohci/batch.c
- Timestamp:
- 2011-03-21T13:34:18Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5156580
- Parents:
- 2bf8f8c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/batch.c
r2bf8f8c rd328172 40 40 #include "batch.h" 41 41 #include "utils/malloc32.h" 42 43 static void batch_call_in_and_dispose(batch_t *instance); 44 static void batch_call_out_and_dispose(batch_t *instance); 42 45 43 46 #define DEFAULT_ERROR_COUNT 3 … … 94 97 { 95 98 assert(instance); 99 free32(instance->transport_buffer); 100 free32(instance->setup_buffer); 101 free(instance); 96 102 } 97 103 /*----------------------------------------------------------------------------*/ … … 99 105 { 100 106 assert(instance); 107 /* We are data out, we are supposed to provide data */ 108 memcpy(instance->transport_buffer, instance->buffer, 109 instance->buffer_size); 110 instance->next_step = batch_call_out_and_dispose; 111 /* TODO: implement */ 112 usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance); 101 113 } 102 114 /*----------------------------------------------------------------------------*/ … … 104 116 { 105 117 assert(instance); 118 instance->next_step = batch_call_in_and_dispose; 119 /* TODO: implement */ 120 usb_log_debug("Batch(%p) CONTROL WRITE initialized.\n", instance); 106 121 } 107 122 /*----------------------------------------------------------------------------*/ … … 109 124 { 110 125 assert(instance); 126 instance->direction = USB_DIRECTION_IN; 127 instance->next_step = batch_call_in_and_dispose; 128 /* TODO: implement */ 129 usb_log_debug("Batch(%p) INTERRUPT IN initialized.\n", instance); 111 130 } 112 131 /*----------------------------------------------------------------------------*/ … … 114 133 { 115 134 assert(instance); 135 instance->direction = USB_DIRECTION_OUT; 136 /* We are data out, we are supposed to provide data */ 137 memcpy(instance->transport_buffer, instance->buffer, 138 instance->buffer_size); 139 instance->next_step = batch_call_out_and_dispose; 140 /* TODO: implement */ 141 usb_log_debug("Batch(%p) INTERRUPT OUT initialized.\n", instance); 116 142 } 117 143 /*----------------------------------------------------------------------------*/ … … 119 145 { 120 146 assert(instance); 147 instance->direction = USB_DIRECTION_IN; 148 instance->next_step = batch_call_in_and_dispose; 149 /* TODO: implement */ 150 usb_log_debug("Batch(%p) BULK IN initialized.\n", instance); 121 151 } 122 152 /*----------------------------------------------------------------------------*/ … … 124 154 { 125 155 assert(instance); 156 instance->direction = USB_DIRECTION_IN; 157 instance->next_step = batch_call_in_and_dispose; 158 /* TODO: implement */ 159 usb_log_debug("Batch(%p) BULK IN initialized.\n", instance); 160 } 161 /*----------------------------------------------------------------------------*/ 162 /** Helper function calls callback and correctly disposes of batch structure. 163 * 164 * @param[in] instance Batch structure to use. 165 */ 166 void batch_call_in_and_dispose(batch_t *instance) 167 { 168 assert(instance); 169 batch_call_in(instance); 170 batch_dispose(instance); 171 } 172 /*----------------------------------------------------------------------------*/ 173 /** Helper function calls callback and correctly disposes of batch structure. 174 * 175 * @param[in] instance Batch structure to use. 176 */ 177 void batch_call_out_and_dispose(batch_t *instance) 178 { 179 assert(instance); 180 batch_call_out(instance); 181 batch_dispose(instance); 126 182 } 127 183 /**
Note:
See TracChangeset
for help on using the changeset viewer.