Changeset 8f748215 in mainline for uspace/drv/uhci/root_hub/port.c


Ignore:
Timestamp:
2011-01-07T16:42:00Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
93fb170c
Parents:
15701921
Message:

port_status refactoring, use flags instead of structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci/root_hub/port.c

    r15701921 r8f748215  
    3333
    3434                /* read register value */
    35                 port_status_t port_status;
    36                 port_status.raw_value = pio_read_16(port_instance->address);
     35                port_status_t port_status =
     36                        port_status_read(port_instance->address);
     37//              port_status.raw_value = pio_read_16(port_instance->address);
    3738
    3839                /* debug print */
    3940                uhci_print_info("Port(%d) status %#.4x:\n",
    40                   port_instance->number, port_status.raw_value);
    41                 print_port_status( &port_status );
    42 
    43                 if (port_status.status.connect_change) {
    44                         if (port_status.status.connected) {
     41                  port_instance->number, port_status);
     42                print_port_status( port_status );
     43
     44                if (port_status & STATUS_CONNECTED_CHANGED) {
     45                        if (port_status & STATUS_CONNECTED) {
    4546                                /* assign address and report new device */
    4647                                uhci_port_new_device(port_instance);
     
    103104
    104105        /* read register value */
    105         port_status_t port_status;
    106         port_status.raw_value = pio_read_16( port->address );
     106        port_status_t port_status
     107                = port_status_read(port->address);
    107108
    108109        /* enable port: register write */
     110        if (enabled) {
     111                port_status |= STATUS_ENABLED;
     112        } else {
     113                port_status &= ~STATUS_ENABLED;
     114        }
     115        port_status_write( port->address, port_status );
     116
     117/*
    109118        port_status.status.enabled = enabled;
    110119        pio_write_16( port->address, port_status.raw_value );
     120*/
    111121
    112122        uhci_print_info( "%s port %d.\n",
Note: See TracChangeset for help on using the changeset viewer.