Ignore:
File:
1 edited

Legend:

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

    r3476be8 r60b3bea  
    4141#include "usb/classes/classes.h"
    4242#include "usb/devdrv.h"
    43 #include "ohci_regs.h"
    44 
    4543#include <usb/request.h>
    4644#include <usb/classes/hub.h>
     
    111109 */
    112110static const uint32_t hub_clear_feature_valid_mask =
    113     RHS_OCIC_FLAG |
    114     RHS_CLEAR_PORT_POWER;
     111    (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
     112(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
    115113
    116114/**
     
    118116 */
    119117static const uint32_t hub_clear_feature_by_writing_one_mask =
    120    RHS_CLEAR_PORT_POWER;
    121    // 1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
     118    1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
    122119
    123120/**
     
    125122 */
    126123static const uint32_t hub_set_feature_valid_mask =
    127     RHS_LPSC_FLAG |
    128     RHS_OCIC_FLAG;
    129     //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
    130     //(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
     124    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
     125(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
    131126
    132127/**
     
    134129 */
    135130static const uint32_t hub_set_feature_direct_mask =
    136     RHS_SET_PORT_POWER;
    137     //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
     131    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
    138132
    139133/**
     
    141135 */
    142136static const uint32_t port_set_feature_valid_mask =
    143     RHPS_SET_PORT_ENABLE |
    144     RHPS_SET_PORT_SUSPEND |
    145     RHPS_SET_PORT_RESET |
    146     RHPS_SET_PORT_POWER;
     137    (1 << USB_HUB_FEATURE_PORT_ENABLE) |
     138(1 << USB_HUB_FEATURE_PORT_SUSPEND) |
     139(1 << USB_HUB_FEATURE_PORT_RESET) |
     140(1 << USB_HUB_FEATURE_PORT_POWER);
    147141
    148142/**
     
    150144 */
    151145static const uint32_t port_clear_feature_valid_mask =
    152     RHPS_CCS_FLAG |
    153     RHPS_SET_PORT_SUSPEND |
    154     RHPS_POCI_FLAG |
    155     RHPS_SET_PORT_POWER |
    156     RHPS_CSC_FLAG |
    157     RHPS_PESC_FLAG |
    158     RHPS_PSSC_FLAG |
    159     RHPS_OCIC_FLAG |
    160     RHPS_PRSC_FLAG;
    161 
    162 /*
    163 
    164146    (1 << USB_HUB_FEATURE_PORT_CONNECTION) |
    165     (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
    166     (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
    167     (1 << USB_HUB_FEATURE_PORT_POWER) |
     147(1 << USB_HUB_FEATURE_PORT_SUSPEND) |
     148(1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
     149(1 << USB_HUB_FEATURE_PORT_POWER) |
     150(1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
     151(1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
     152(1 << USB_HUB_FEATURE_C_PORT_SUSPEND) |
     153(1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
     154(1 << USB_HUB_FEATURE_C_PORT_RESET);
     155//note that USB_HUB_FEATURE_PORT_POWER bit is translated into
     156//USB_HUB_FEATURE_PORT_LOW_SPEED
     157
     158/**
     159 * bitmask with port status changes
     160 */
     161static const uint32_t port_status_change_mask =
    168162    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
    169     (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
    170     (1 << USB_HUB_FEATURE_C_PORT_SUSPEND) |
    171     (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
    172     (1 << USB_HUB_FEATURE_C_PORT_RESET);
    173  */
    174 //note that USB_HUB_FEATURE_PORT_POWER bit is translated into
    175 //USB_HUB_FEATURE_PORT_LOW_SPEED for port set feature request
    176 
    177 /**
    178  * bitmask with port status changes
    179  */
    180 static const uint32_t port_status_change_mask = RHPS_CHANGE_WC_MASK;
    181 /*    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
    182     (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
    183     (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
    184     (1 << USB_HUB_FEATURE_C_PORT_RESET) |
    185     (1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
    186 */
     163(1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
     164(1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
     165(1 << USB_HUB_FEATURE_C_PORT_RESET) |
     166(1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
     167
    187168
    188169static int create_serialized_hub_descriptor(rh_t *instance);
Note: See TracChangeset for help on using the changeset viewer.