Changeset f58154c5 in mainline for uspace/drv/uhci-hcd/batch.c


Ignore:
Timestamp:
2011-05-18T10:59:50Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
17fc40c
Parents:
b2995c3 (diff), aeca5a3 (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.
Message:

Minor fixes and comments

UHCI: use provided barrier defines (buffer allocator should be able to use cacheable memory)
libusb: make usb enumeration routine follow USB spec more closely (wait periods)
OHCI: handle hw errors
OHCI: use provided barrier defines (buffer allocator should be able to use cacheable memory)
OHCI: reduce maximum buffer size for one transaction, this relaxes requirements on allocator providing hw accessible buffers.(memory does not have to be continuous) The only requirement that stays is the 32bit pointers limit.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/batch.c

    rb2995c3 rf58154c5  
    4545#define DEFAULT_ERROR_COUNT 3
    4646
     47/** UHCI specific data required for USB transfer */
    4748typedef 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         */
    4853        qh_t *qh;
     54        /** List of TDs needed for the transfer */
    4955        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 */
    5059        void *device_buffer;
    51         size_t td_count;
    5260} uhci_transfer_batch_t;
    5361/*----------------------------------------------------------------------------*/
    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 
    6362static void batch_control(usb_transfer_batch_t *instance,
    6463    usb_packet_id data_stage, usb_packet_id status_stage);
    6564static 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 */
     70static 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/*----------------------------------------------------------------------------*/
    6778/** Allocate memory and initialize internal data structure.
    6879 *
     
    173184                instance->error = td_status(&data->tds[i]);
    174185                if (instance->error != EOK) {
    175                         usb_log_debug("Batch(%p) found error TD(%zu):%" PRIx32 ".\n",
    176                             instance, i, data->tds[i].status);
     186                        usb_log_debug("Batch(%p) found error TD(%zu):%"
     187                            PRIx32 ".\n", instance, i, data->tds[i].status);
    177188                        td_print_status(&data->tds[i]);
    178189
     
    397408/*----------------------------------------------------------------------------*/
    398409/** Provides access to QH data structure.
     410 *
    399411 * @param[in] instance Batch pointer to use.
    400412 * @return Pointer to the QH used by the batch.
Note: See TracChangeset for help on using the changeset viewer.