Changeset 2ac7af3 in mainline for uspace/drv/bus/usb/ohci/ohci_batch.c
- Timestamp:
- 2011-10-14T19:40:28Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- df3caec5
- Parents:
- 6d4d883 (diff), 3a5506a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ohci/ohci_batch.c
r6d4d883 r2ac7af3 52 52 if (!ohci_batch) 53 53 return; 54 unsigned i = 0;55 54 if (ohci_batch->tds) { 56 for ( ; i< ohci_batch->td_count; ++i) {55 for (unsigned i = 0; i < ohci_batch->td_count; ++i) { 57 56 if (i != ohci_batch->leave_td) 58 57 free32(ohci_batch->tds[i]); … … 107 106 ohci_batch->tds[0] = ohci_endpoint_get(usb_batch->ep)->td; 108 107 ohci_batch->leave_td = 0; 109 unsigned i = 1; 110 for ( ; i <= ohci_batch->td_count; ++i) {108 109 for (unsigned i = 1; i <= ohci_batch->td_count; ++i) { 111 110 ohci_batch->tds[i] = malloc32(sizeof(td_t)); 112 111 CHECK_NULL_DISPOSE_RET(ohci_batch->tds[i], … … 160 159 usb_log_debug("Batch %p checking %zu td(s) for completion.\n", 161 160 ohci_batch->usb_batch, ohci_batch->td_count); 162 usb_log_debug2("ED: % x:%x:%x:%x.\n",161 usb_log_debug2("ED: %08x:%08x:%08x:%08x.\n", 163 162 ohci_batch->ed->status, ohci_batch->ed->td_head, 164 163 ohci_batch->ed->td_tail, ohci_batch->ed->next); … … 167 166 for (; i < ohci_batch->td_count; ++i) { 168 167 assert(ohci_batch->tds[i] != NULL); 169 usb_log_debug("TD %zu: % x:%x:%x:%x.\n", i,168 usb_log_debug("TD %zu: %08x:%08x:%08x:%08x.\n", i, 170 169 ohci_batch->tds[i]->status, ohci_batch->tds[i]->cbp, 171 170 ohci_batch->tds[i]->next, ohci_batch->tds[i]->be); … … 175 174 ohci_batch->usb_batch->error = td_error(ohci_batch->tds[i]); 176 175 if (ohci_batch->usb_batch->error != EOK) { 177 usb_log_debug("Batch %p found error TD(%zu):% x.\n",176 usb_log_debug("Batch %p found error TD(%zu):%08x.\n", 178 177 ohci_batch->usb_batch, i, 179 178 ohci_batch->tds[i]->status); … … 196 195 ohci_batch->usb_batch->transfered_size = 197 196 ohci_batch->usb_batch->buffer_size; 198 for (--i;i < ohci_batch->td_count; ++i) 197 for (--i;i < ohci_batch->td_count; ++i) { 199 198 ohci_batch->usb_batch->transfered_size 200 199 -= td_remain_size(ohci_batch->tds[i]); 200 } 201 201 202 202 /* Clear possible ED HALT */ … … 234 234 assert(ohci_batch->usb_batch); 235 235 assert(dir == USB_DIRECTION_IN || dir == USB_DIRECTION_OUT); 236 usb_log_debug("Using ED(%p): % x:%x:%x:%x.\n", ohci_batch->ed,236 usb_log_debug("Using ED(%p): %08x:%08x:%08x:%08x.\n", ohci_batch->ed, 237 237 ohci_batch->ed->status, ohci_batch->ed->td_tail, 238 238 ohci_batch->ed->td_head, ohci_batch->ed->next); … … 251 251 ohci_batch->usb_batch->setup_size, toggle); 252 252 td_set_next(ohci_batch->tds[0], ohci_batch->tds[1]); 253 usb_log_debug("Created CONTROL SETUP TD: % x:%x:%x:%x.\n",253 usb_log_debug("Created CONTROL SETUP TD: %08x:%08x:%08x:%08x.\n", 254 254 ohci_batch->tds[0]->status, ohci_batch->tds[0]->cbp, 255 255 ohci_batch->tds[0]->next, ohci_batch->tds[0]->be); … … 269 269 td_set_next(ohci_batch->tds[td_current], 270 270 ohci_batch->tds[td_current + 1]); 271 usb_log_debug("Created CONTROL DATA TD: % x:%x:%x:%x.\n",271 usb_log_debug("Created CONTROL DATA TD: %08x:%08x:%08x:%08x.\n", 272 272 ohci_batch->tds[td_current]->status, 273 273 ohci_batch->tds[td_current]->cbp, … … 286 286 td_set_next(ohci_batch->tds[td_current], 287 287 ohci_batch->tds[td_current + 1]); 288 usb_log_debug("Created CONTROL STATUS TD: % x:%x:%x:%x.\n",288 usb_log_debug("Created CONTROL STATUS TD: %08x:%08x:%08x:%08x.\n", 289 289 ohci_batch->tds[td_current]->status, 290 290 ohci_batch->tds[td_current]->cbp, … … 312 312 assert(ohci_batch->usb_batch); 313 313 assert(dir == USB_DIRECTION_IN || dir == USB_DIRECTION_OUT); 314 usb_log_debug("Using ED(%p): % x:%x:%x:%x.\n", ohci_batch->ed,314 usb_log_debug("Using ED(%p): %08x:%08x:%08x:%08x.\n", ohci_batch->ed, 315 315 ohci_batch->ed->status, ohci_batch->ed->td_tail, 316 316 ohci_batch->ed->td_head, ohci_batch->ed->next); … … 328 328 ohci_batch->tds[td_current + 1]); 329 329 330 usb_log_debug("Created DATA TD: % x:%x:%x:%x.\n",330 usb_log_debug("Created DATA TD: %08x:%08x:%08x:%08x.\n", 331 331 ohci_batch->tds[td_current]->status, 332 332 ohci_batch->tds[td_current]->cbp,
Note:
See TracChangeset
for help on using the changeset viewer.