Changeset 9014dcd in mainline for uspace/drv/ohci


Ignore:
Timestamp:
2011-04-22T12:47:39Z (15 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
32aef25b, 54d71e1
Parents:
44b1674
Message:

fix for usb hub
loc in ohci root hub

Location:
uspace/drv/ohci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/root_hub.c

    r44b1674 r9014dcd  
    217217        instance->registers->rh_desc_a |= RHDA_NPS_FLAG;
    218218        instance->unfinished_interrupt_transfer = NULL;
     219        instance->interrupt_buffer = malloc((instance->port_count + 8)/8);
    219220        usb_log_info("OHCI root hub with %d ports.\n", instance->port_count);
    220221        return EOK;
     
    471472        size_t * buffer_size) {
    472473        int bit_count = instance->port_count + 1;
    473         (*buffer_size) = (bit_count / 8) + ((bit_count % 8 == 0) ? 0 : 1);
    474 
    475         (*buffer) = malloc(*buffer_size);
     474        (*buffer_size) = (bit_count+7 / 8);
     475
     476        (*buffer) = instance->interrupt_buffer;//malloc(*buffer_size);
    476477        uint8_t * bitmap = (uint8_t*) (*buffer);
    477478        uint32_t mask = (1 << (USB_HUB_FEATURE_C_HUB_LOCAL_POWER + 16))
  • uspace/drv/ohci/root_hub.h

    r44b1674 r9014dcd  
    5656        /** interrupt transfer waiting for an actual interrupt to occur */
    5757        usb_transfer_batch_t * unfinished_interrupt_transfer;
     58        /** pre-allocated interrupt mask
     59         *
     60         * This is allocated when initializing instance, so that memory
     61         * allocation is not needed when processing request.
     62         */
     63        uint8_t * interrupt_buffer;
    5864} rh_t;
    5965
Note: See TracChangeset for help on using the changeset viewer.