Changeset 4fe3b6d in mainline for uspace/drv/uhci-hcd/batch.c
- Timestamp:
- 2011-05-20T11:07:00Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 8bb61e6
- Parents:
- 3476be8 (diff), 7941bd6 (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/uhci-hcd/batch.c
r3476be8 r4fe3b6d 45 45 #define DEFAULT_ERROR_COUNT 3 46 46 47 /** UHCI specific data required for USB transfer */ 47 48 typedef struct uhci_transfer_batch { 49 /** Queue head 50 * This QH is used to maintain UHCI schedule structure and the element 51 * pointer points to the first TD of this batch. 52 */ 48 53 qh_t *qh; 54 /** List of TDs needed for the transfer */ 49 55 td_t *tds; 56 /** Number of TDs used by the transfer */ 57 size_t td_count; 58 /** Data buffer, must be accessible by the UHCI hw */ 50 59 void *device_buffer; 51 size_t td_count;52 60 } uhci_transfer_batch_t; 53 61 /*----------------------------------------------------------------------------*/ 54 static void uhci_transfer_batch_dispose(void *uhci_batch)55 {56 uhci_transfer_batch_t *instance = uhci_batch;57 assert(instance);58 free32(instance->device_buffer);59 free(instance);60 }61 /*----------------------------------------------------------------------------*/62 63 62 static void batch_control(usb_transfer_batch_t *instance, 64 63 usb_packet_id data_stage, usb_packet_id status_stage); 65 64 static void batch_data(usb_transfer_batch_t *instance, usb_packet_id pid); 66 65 /*----------------------------------------------------------------------------*/ 66 /** Safely destructs uhci_transfer_batch_t structure 67 * 68 * @param[in] uhci_batch Instance to destroy. 69 */ 70 static void uhci_transfer_batch_dispose(void *uhci_batch) 71 { 72 uhci_transfer_batch_t *instance = uhci_batch; 73 assert(instance); 74 free32(instance->device_buffer); 75 free(instance); 76 } 77 /*----------------------------------------------------------------------------*/ 67 78 /** Allocate memory and initialize internal data structure. 68 79 * … … 70 81 * @param[in] ep Communication target 71 82 * @param[in] buffer Data source/destination. 72 * @param[in] size Size of the buffer.83 * @param[in] buffer_size Size of the buffer. 73 84 * @param[in] setup_buffer Setup data source (if not NULL) 74 85 * @param[in] setup_size Size of setup_buffer (should be always 8) … … 84 95 */ 85 96 usb_transfer_batch_t * batch_get(ddf_fun_t *fun, endpoint_t *ep, 86 char *buffer, size_t buffer_size, char* setup_buffer, size_t setup_size, 97 char *buffer, size_t buffer_size, 98 const char* setup_buffer, size_t setup_size, 87 99 usbhc_iface_transfer_in_callback_t func_in, 88 100 usbhc_iface_transfer_out_callback_t func_out, void *arg) … … 173 185 instance->error = td_status(&data->tds[i]); 174 186 if (instance->error != EOK) { 175 usb_log_debug("Batch(%p) found error TD(%zu):%" PRIx32 ".\n",176 instance, i, data->tds[i].status);187 usb_log_debug("Batch(%p) found error TD(%zu):%" 188 PRIx32 ".\n", instance, i, data->tds[i].status); 177 189 td_print_status(&data->tds[i]); 178 190 … … 397 409 /*----------------------------------------------------------------------------*/ 398 410 /** Provides access to QH data structure. 411 * 399 412 * @param[in] instance Batch pointer to use. 400 413 * @return Pointer to the QH used by the batch.
Note:
See TracChangeset
for help on using the changeset viewer.