Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 95d5dca in mainline


Ignore:
Timestamp:
2014-01-22T18:38:53Z (8 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
82a639cd
Parents:
b300d2b
Message:

ehci, rh: Handle status change bits

Location:
uspace/drv/bus/usb/ehci
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/ehci/ehci_rh.c

    rb300d2b r95d5dca  
    114114        }
    115115
     116        for (unsigned i = 0; i < EHCI_MAX_PORTS; ++i) {
     117                instance->reset_flag[i] = false;
     118                instance->resume_flag[i] = false;
     119        }
     120
    116121        ehci_rh_hub_desc_init(instance, EHCI_RD(caps->hcsparams));
    117122        instance->unfinished_interrupt_transfer = NULL;
     
    269274            (reg & USB_PORTSC_PORT_OWNER_FLAG) ? (1 << 10) : 0 |
    270275            (reg & USB_PORTSC_PORT_TEST_MASK) ? (1 << 11) : 0 |
    271             (reg & USB_PORTSC_INDICATOR_MASK) ? (1 << 12) : 0)
    272         ;
     276            (reg & USB_PORTSC_INDICATOR_MASK) ? (1 << 12) : 0 |
     277            (reg & USB_PORTSC_CONNECT_CH_FLAG) ? (1 << 16) : 0 |
     278            (reg & USB_PORTSC_EN_CHANGE_FLAG) ? (1 << 17) : 0 |
     279            hub->resume_flag[port] ? (1 << 18) : 0 |
     280            (reg & USB_PORTSC_OC_CHANGE_FLAG) ? (1 << 19) : 0 |
     281            hub->reset_flag[port] ? (1 << 20): 0
     282        );
    273283        //TODO: use hub status flags here
    274284        memcpy(data, &status, sizeof(status));
     
    317327                EHCI_CLR(hub->registers->portsc[port],
    318328                    USB_PORTSC_RESUME_FLAG);
     329                hub->resume_flag[port] = true;
    319330                return EOK;
    320331
     
    332343                return EOK;
    333344        case USB_HUB_FEATURE_C_PORT_SUSPEND:      /*18*/
     345                hub->resume_flag[port] = false;
     346                return EOK;
    334347        case USB_HUB_FEATURE_C_PORT_RESET:        /*20*/
    335                 //TODO these are not represented in hw, think of something
     348                hub->reset_flag[port] = false;
    336349                return EOK;
    337350
     
    378391                 * after reset it's a full speed device */
    379392                if (!(EHCI_RD(hub->registers->portsc[port]) &
    380                     USB_PORTSC_ENABLED_FLAG))
     393                    USB_PORTSC_ENABLED_FLAG)) {
    381394                        EHCI_CLR(hub->registers->portsc[port],
    382395                            USB_PORTSC_PORT_OWNER_FLAG);
     396                } else {
     397                        hub->reset_flag[port] = true;
     398                }
    383399
    384400                return EOK;
  • uspace/drv/bus/usb/ehci/ehci_rh.h

    rb300d2b r95d5dca  
    6363        /** interrupt transfer waiting for an actual interrupt to occur */
    6464        usb_transfer_batch_t *unfinished_interrupt_transfer;
     65        bool reset_flag[EHCI_MAX_PORTS];
     66        bool resume_flag[EHCI_MAX_PORTS];
    6567} ehci_rh_t;
    6668
Note: See TracChangeset for help on using the changeset viewer.