Changes in uspace/drv/uhci-hcd/batch.c [02cacce:23f40280] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/batch.c
r02cacce r23f40280 45 45 #define DEFAULT_ERROR_COUNT 3 46 46 47 /** UHCI specific data required for USB transfer */48 47 typedef struct uhci_transfer_batch { 49 /** Queue head50 * This QH is used to maintain UHCI schedule structure and the element51 * pointer points to the first TD of this batch.52 */53 48 qh_t *qh; 54 /** List of TDs needed for the transfer */55 49 td_t *tds; 56 /** Number of TDs used by the transfer */50 void *device_buffer; 57 51 size_t td_count; 58 /** Data buffer, must be accessible by the UHCI hw */59 void *device_buffer;60 52 } uhci_transfer_batch_t; 61 53 /*----------------------------------------------------------------------------*/ 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 62 63 static void batch_control(usb_transfer_batch_t *instance, 63 64 usb_packet_id data_stage, usb_packet_id status_stage); 64 65 static void batch_data(usb_transfer_batch_t *instance, usb_packet_id pid); 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 /*----------------------------------------------------------------------------*/ 66 78 67 /** Allocate memory and initialize internal data structure. 79 68 * … … 95 84 */ 96 85 usb_transfer_batch_t * batch_get(ddf_fun_t *fun, endpoint_t *ep, 97 char *buffer, size_t buffer_size, 98 const char* setup_buffer, size_t setup_size, 86 char *buffer, size_t buffer_size, char* setup_buffer, size_t setup_size, 99 87 usbhc_iface_transfer_in_callback_t func_in, 100 88 usbhc_iface_transfer_out_callback_t func_out, void *arg) … … 185 173 instance->error = td_status(&data->tds[i]); 186 174 if (instance->error != EOK) { 187 usb_log_debug("Batch(%p) found error TD(%zu):%" 188 PRIx32 ".\n",instance, i, data->tds[i].status);175 usb_log_debug("Batch(%p) found error TD(%zu):%" PRIx32 ".\n", 176 instance, i, data->tds[i].status); 189 177 td_print_status(&data->tds[i]); 190 178 … … 409 397 /*----------------------------------------------------------------------------*/ 410 398 /** Provides access to QH data structure. 411 *412 399 * @param[in] instance Batch pointer to use. 413 400 * @return Pointer to the QH used by the batch.
Note:
See TracChangeset
for help on using the changeset viewer.