Changeset 90d0522 in mainline


Ignore:
Timestamp:
2011-04-05T19:46:24Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3dba1ca
Parents:
040ab02
Message:

major minor fixes in ohci root hub

File:
1 edited

Legend:

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

    r040ab02 r90d0522  
    139139//note that USB_HUB_FEATURE_PORT_POWER bit is translated into
    140140//USB_HUB_FEATURE_PORT_LOW_SPEED
     141
     142static const uint32_t port_status_change_mask =
     143(1<< USB_HUB_FEATURE_C_PORT_CONNECTION) |
     144(1<< USB_HUB_FEATURE_C_PORT_ENABLE) |
     145(1<< USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
     146(1<< USB_HUB_FEATURE_C_PORT_RESET) |
     147(1<< USB_HUB_FEATURE_C_PORT_SUSPEND);
     148
    141149
    142150static void usb_create_serialized_hub_descriptor(rh_t *instance,
     
    391399        usb_transfer_batch_t * request) {
    392400        uint32_t * uint32_buffer = (uint32_t*) request->transport_buffer;
     401        request->transfered_size = 4;
    393402        //bits, 0,1,16,17
    394         request->transfered_size = 4;
    395         uint32_t mask = 1 & (1 << 1) & (1 << 16) & (1 << 17);
     403        uint32_t mask = 1 | (1 << 1) | (1 << 16) | (1 << 17);
    396404        uint32_buffer[0] = mask & instance->registers->rh_status;
    397405        return EOK;
     
    456464        }
    457465        int port;
    458         mask = 0;
    459         int i;
    460         for (i = 16; i <= 20; ++i) {
    461                 mask += 1 << i;
    462         }
     466        mask = port_status_change_mask;
    463467        for (port = 1; port <= instance->port_count; ++port) {
    464468                if (mask & instance->registers->rh_port_status[port - 1]) {
Note: See TracChangeset for help on using the changeset viewer.