Changeset c3ae877 in mainline
- Timestamp:
- 2011-02-25T23:46:32Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 86c2ccd
- Parents:
- 1a93bb0
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/batch.c
r1a93bb0 rc3ae877 168 168 memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size); 169 169 170 const bool low_speed = instance->speed == USB_SPEED_LOW; 170 171 int toggle = 0; 171 172 /* setup stage */ 172 173 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT, 173 instance->setup_size, toggle, false, instance->target, 174 USB_PID_SETUP, instance->setup_buffer, &instance->tds[1]); 174 instance->setup_size, toggle, false, low_speed, 175 instance->target, USB_PID_SETUP, instance->setup_buffer, 176 &instance->tds[1]); 175 177 176 178 /* data stage */ … … 182 184 183 185 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 184 instance->max_packet_size, toggle++, false, instance->target,185 USB_PID_OUT, data, &instance->tds[i + 1]);186 instance->max_packet_size, toggle++, false, low_speed, 187 instance->target, USB_PID_OUT, data, &instance->tds[i + 1]); 186 188 } 187 189 … … 189 191 i = instance->packets - 1; 190 192 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 191 0, 1, false, instance->target, USB_PID_IN, NULL, NULL);193 0, 1, false, low_speed, instance->target, USB_PID_IN, NULL, NULL); 192 194 193 195 instance->tds[i].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG; … … 201 203 assert(instance); 202 204 205 const bool low_speed = instance->speed == USB_SPEED_LOW; 203 206 int toggle = 0; 204 207 /* setup stage */ 205 208 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT, 206 instance->setup_size, toggle, false, instance->target,209 instance->setup_size, toggle, false, low_speed, instance->target, 207 210 USB_PID_SETUP, instance->setup_buffer, &instance->tds[1]); 208 211 … … 215 218 216 219 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 217 instance->max_packet_size, toggle, false, instance->target,218 220 instance->max_packet_size, toggle, false, low_speed, 221 instance->target, USB_PID_IN, data, &instance->tds[i + 1]); 219 222 } 220 223 … … 222 225 i = instance->packets - 1; 223 226 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 224 0, 1, false, instance->target, USB_PID_OUT, NULL, NULL);227 0, 1, false, low_speed, instance->target, USB_PID_OUT, NULL, NULL); 225 228 226 229 instance->tds[i].status |= TD_STATUS_COMPLETE_INTERRUPT_FLAG; … … 234 237 assert(instance); 235 238 239 const bool low_speed = instance->speed == USB_SPEED_LOW; 236 240 int toggle = 1; 237 241 size_t i = 0; … … 244 248 245 249 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 246 instance->max_packet_size, toggle, false, instance->target,247 USB_PID_IN, data, next);250 instance->max_packet_size, toggle, false, low_speed, 251 instance->target, USB_PID_IN, data, next); 248 252 } 249 253 … … 260 264 memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size); 261 265 266 const bool low_speed = instance->speed == USB_SPEED_LOW; 262 267 int toggle = 1; 263 268 size_t i = 0; … … 270 275 271 276 transfer_descriptor_init(&instance->tds[i], DEFAULT_ERROR_COUNT, 272 instance->max_packet_size, toggle++, false, instance->target,273 USB_PID_OUT, data, next);277 instance->max_packet_size, toggle++, false, low_speed, 278 instance->target, USB_PID_OUT, data, next); 274 279 } 275 280 … … 338 343 return uhci_schedule(hc, instance); 339 344 } 340 /*----------------------------------------------------------------------------*/341 /* DEPRECATED FUNCTIONS NEEDED BY THE OLD API */342 void batch_control_setup_old(batch_t *instance)343 {344 assert(instance);345 instance->packets = 1;346 347 /* setup stage */348 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT,349 instance->setup_size, 0, false, instance->target,350 USB_PID_SETUP, instance->setup_buffer, NULL);351 352 instance->next_step = batch_call_out_and_dispose;353 batch_schedule(instance);354 }355 /*----------------------------------------------------------------------------*/356 void batch_control_write_data_old(batch_t *instance)357 {358 assert(instance);359 instance->packets -= 2;360 batch_interrupt_out(instance);361 }362 /*----------------------------------------------------------------------------*/363 void batch_control_read_data_old(batch_t *instance)364 {365 assert(instance);366 instance->packets -= 2;367 batch_interrupt_in(instance);368 }369 /*----------------------------------------------------------------------------*/370 void batch_control_write_status_old(batch_t *instance)371 {372 assert(instance);373 instance->packets = 1;374 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT,375 0, 1, false, instance->target, USB_PID_IN, NULL, NULL);376 instance->next_step = batch_call_in_and_dispose;377 batch_schedule(instance);378 }379 /*----------------------------------------------------------------------------*/380 void batch_control_read_status_old(batch_t *instance)381 {382 assert(instance);383 instance->packets = 1;384 transfer_descriptor_init(instance->tds, DEFAULT_ERROR_COUNT,385 0, 1, false, instance->target, USB_PID_OUT, NULL, NULL);386 instance->next_step = batch_call_out_and_dispose;387 batch_schedule(instance);388 }389 345 /** 390 346 * @} -
uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c
r1a93bb0 rc3ae877 39 39 40 40 void transfer_descriptor_init(transfer_descriptor_t *instance, 41 int error_count, size_t size, bool toggle, bool isochronous, 41 int error_count, size_t size, bool toggle, bool isochronous, bool low_speed, 42 42 usb_target_t target, int pid, void *buffer, transfer_descriptor_t *next) 43 43 { … … 50 50 instance->status = 0 51 51 | ((error_count & TD_STATUS_ERROR_COUNT_MASK) << TD_STATUS_ERROR_COUNT_POS) 52 | (low_speed ? TD_STATUS_LOW_SPEED_FLAG : 0) 52 53 | TD_STATUS_ERROR_ACTIVE; 53 54 -
uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.h
r1a93bb0 rc3ae877 92 92 93 93 void transfer_descriptor_init(transfer_descriptor_t *instance, 94 int error_count, size_t size, bool toggle, bool isochronous, 94 int error_count, size_t size, bool toggle, bool isochronous, bool low_speed, 95 95 usb_target_t target, int pid, void *buffer, transfer_descriptor_t * next); 96 96
Note:
See TracChangeset
for help on using the changeset viewer.