Changeset a61c683 in mainline


Ignore:
Timestamp:
2011-09-23T19:44:28Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
400f363
Parents:
aefa0d5
Message:

usbhub: Fix endian TODOs

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

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbhub/port_status.h

    raefa0d5 ra61c683  
    4747 */
    4848typedef uint32_t usb_port_status_t;
    49 // TODO Mind the endiannes, changes are in the first byte of the second word
    50 // status is in the first byte of the first word
    51 #define USB_HUB_PORT_STATUS_CONNECTION (1 << (USB_HUB_FEATURE_PORT_CONNECTION))
    52 #define USB_HUB_PORT_STATUS_ENABLED (1 << (USB_HUB_FEATURE_PORT_ENABLE))
    53 #define USB_HUB_PORT_STATUS_SUSPEND (1 << (USB_HUB_FEATURE_PORT_SUSPEND))
    54 #define USB_HUB_PORT_STATUS_OC (1 << (USB_HUB_FEATURE_PORT_OVER_CURRENT))
    55 #define USB_HUB_PORT_STATUS_RESET (1 << (USB_HUB_FEATURE_PORT_RESET))
    56 #define USB_HUB_PORT_STATUS_POWER (1 << (USB_HUB_FEATURE_PORT_POWER))
    57 #define USB_HUB_PORT_STATUS_LOW_SPEED (1 << (USB_HUB_FEATURE_PORT_LOW_SPEED))
    58 #define USB_HUB_PORT_STATUS_HIGH_SPEED (1 << 10)
     49#define USB_HUB_PORT_STATUS_CONNECTION \
     50    (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_CONNECTION)))
     51#define USB_HUB_PORT_STATUS_ENABLED \
     52    (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_ENABLE)))
     53#define USB_HUB_PORT_STATUS_SUSPEND \
     54    (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_SUSPEND)))
     55#define USB_HUB_PORT_STATUS_OC \
     56    (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_OVER_CURRENT)))
     57#define USB_HUB_PORT_STATUS_RESET \
     58    (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_RESET)))
     59#define USB_HUB_PORT_STATUS_POWER \
     60    (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_POWER)))
     61#define USB_HUB_PORT_STATUS_LOW_SPEED \
     62    (uint32_usb2host(1 << (USB_HUB_FEATURE_PORT_LOW_SPEED)))
     63#define USB_HUB_PORT_STATUS_HIGH_SPEED \
     64    (uint32_usb2host(1 << 10))
    5965
    6066#define USB_HUB_PORT_C_STATUS_CONNECTION \
    61     (1 << (USB_HUB_FEATURE_C_PORT_CONNECTION))
     67    (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_CONNECTION)))
    6268#define USB_HUB_PORT_C_STATUS_ENABLED \
    63     (1 << (USB_HUB_FEATURE_C_PORT_ENABLE))
     69    (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_ENABLE)))
    6470#define USB_HUB_PORT_C_STATUS_SUSPEND \
    65     (1 << (USB_HUB_FEATURE_C_PORT_SUSPEND))
     71    (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_SUSPEND)))
    6672#define USB_HUB_PORT_C_STATUS_OC \
    67     (1 << (USB_HUB_FEATURE_C_PORT_OVER_CURRENT))
     73    (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_OVER_CURRENT)))
    6874#define USB_HUB_PORT_C_STATUS_RESET \
    69     (1 << (USB_HUB_FEATURE_C_PORT_RESET))
     75    (uint32_usb2host(1 << (USB_HUB_FEATURE_C_PORT_RESET)))
    7076
    7177/**
     
    7783 */
    7884typedef uint32_t usb_hub_status_t;
    79 // TODO Mind the endiannes, changes are in the first byte of the second word
    80 // status is in the first byte of the first word
    8185#define USB_HUB_STATUS_OVER_CURRENT \
    82     (1 << (USB_HUB_FEATURE_HUB_OVER_CURRENT))
     86    (uint32_usb2host(1 << (USB_HUB_FEATURE_HUB_OVER_CURRENT)))
    8387#define USB_HUB_STATUS_LOCAL_POWER \
    84     (1 << (USB_HUB_FEATURE_HUB_LOCAL_POWER))
     88    (uint32_usb2host(1 << (USB_HUB_FEATURE_HUB_LOCAL_POWER)))
    8589
    8690#define USB_HUB_STATUS_C_OVER_CURRENT \
    87     (1 << (16 + USB_HUB_FEATURE_C_HUB_OVER_CURRENT))
     91    (uint32_usb2host(1 << (16 + USB_HUB_FEATURE_C_HUB_OVER_CURRENT)))
    8892#define USB_HUB_STATUS_C_LOCAL_POWER \
    89     (1 << (16 + USB_HUB_FEATURE_C_HUB_LOCAL_POWER))
     93    (uint32_usb2host(1 << (16 + USB_HUB_FEATURE_C_HUB_LOCAL_POWER)))
    9094
    9195
  • uspace/drv/bus/usb/usbhub/usbhub.c

    raefa0d5 ra61c683  
    405405
    406406        /* Handle status changes */
    407         if (status & USB_HUB_STATUS_C_OVER_CURRENT)
     407        if (status & USB_HUB_STATUS_C_OVER_CURRENT) {
    408408                usb_hub_over_current(hub_info, status);
     409        }
    409410
    410411        if (status & USB_HUB_STATUS_C_LOCAL_POWER) {
Note: See TracChangeset for help on using the changeset viewer.