Changeset cd3fa47 in mainline for uspace/drv/bus/usb/uhci/uhci_rh.c
- Timestamp:
- 2018-01-21T18:35:09Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3f02935
- Parents:
- 32b2a6f2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/uhci_rh.c
r32b2a6f2 rcd3fa47 210 210 #define BIT_VAL(val, bit) \ 211 211 ((val & bit) ? 1 : 0) 212 #define UHCI2USB(val, bit, feat) \213 (BIT_VAL(val, bit) << feat)212 #define UHCI2USB(val, bit, mask) \ 213 (BIT_VAL(val, bit) ? (mask) : 0) 214 214 215 215 /** Port status request handler. … … 236 236 const uint16_t val = pio_read_16(hub->ports[port]); 237 237 const uint32_t status = uint32_host2usb( 238 UHCI2USB(val, STATUS_CONNECTED, USB_HUB_ FEATURE_PORT_CONNECTION) |239 UHCI2USB(val, STATUS_ENABLED, USB_HUB_ FEATURE_PORT_ENABLE) |240 UHCI2USB(val, STATUS_SUSPEND, USB _HUB_FEATURE_PORT_SUSPEND) |241 UHCI2USB(val, STATUS_IN_RESET, USB_HUB_ FEATURE_PORT_RESET) |242 UHCI2USB(val, STATUS_ALWAYS_ONE, USB _HUB_FEATURE_PORT_POWER) |243 UHCI2USB(val, STATUS_LOW_SPEED, USB _HUB_FEATURE_PORT_LOW_SPEED) |244 UHCI2USB(val, STATUS_CONNECTED_CHANGED, USB_HUB_ FEATURE_C_PORT_CONNECTION) |245 UHCI2USB(val, STATUS_ENABLED_CHANGED, USB _HUB_FEATURE_C_PORT_ENABLE) |246 // UHCI2USB(val, STATUS_SUSPEND, USB _HUB_FEATURE_C_PORT_SUSPEND) |247 ( (hub->reset_changed[port] ? 1 : 0) << USB_HUB_FEATURE_C_PORT_RESET)238 UHCI2USB(val, STATUS_CONNECTED, USB_HUB_PORT_STATUS_CONNECTION) | 239 UHCI2USB(val, STATUS_ENABLED, USB_HUB_PORT_STATUS_ENABLE) | 240 UHCI2USB(val, STATUS_SUSPEND, USB2_HUB_PORT_STATUS_SUSPEND) | 241 UHCI2USB(val, STATUS_IN_RESET, USB_HUB_PORT_STATUS_RESET) | 242 UHCI2USB(val, STATUS_ALWAYS_ONE, USB2_HUB_PORT_STATUS_POWER) | 243 UHCI2USB(val, STATUS_LOW_SPEED, USB2_HUB_PORT_STATUS_LOW_SPEED) | 244 UHCI2USB(val, STATUS_CONNECTED_CHANGED, USB_HUB_PORT_STATUS_C_CONNECTION) | 245 UHCI2USB(val, STATUS_ENABLED_CHANGED, USB2_HUB_PORT_STATUS_C_ENABLE) | 246 // UHCI2USB(val, STATUS_SUSPEND, USB2_HUB_PORT_STATUS_C_SUSPEND) | 247 (hub->reset_changed[port] ? USB_HUB_PORT_STATUS_C_RESET : 0) 248 248 ); 249 249 RH_DEBUG(hub, port, "Port status %" PRIx32 " (source %" PRIx16 … … 274 274 const uint16_t val = status & (~STATUS_WC_BITS); 275 275 switch (feature) { 276 case USB _HUB_FEATURE_PORT_ENABLE:276 case USB2_HUB_FEATURE_PORT_ENABLE: 277 277 RH_DEBUG(hub, port, "Clear port enable (status %" 278 278 PRIx16 ")", status); 279 279 pio_write_16(hub->ports[port], val & ~STATUS_ENABLED); 280 280 break; 281 case USB _HUB_FEATURE_PORT_SUSPEND:281 case USB2_HUB_FEATURE_PORT_SUSPEND: 282 282 RH_DEBUG(hub, port, "Clear port suspend (status %" 283 283 PRIx16 ")", status); … … 302 302 hub->reset_changed[port] = false; 303 303 break; 304 case USB _HUB_FEATURE_C_PORT_ENABLE:304 case USB2_HUB_FEATURE_C_PORT_ENABLE: 305 305 RH_DEBUG(hub, port, "Clear port enable change (status %" 306 306 PRIx16 ")", status); 307 307 pio_write_16(hub->ports[port], status | STATUS_ENABLED_CHANGED); 308 308 break; 309 case USB _HUB_FEATURE_C_PORT_SUSPEND:309 case USB2_HUB_FEATURE_C_PORT_SUSPEND: 310 310 RH_DEBUG(hub, port, "Clear port suspend change (status %" 311 311 PRIx16 ")", status); … … 354 354 ")", pio_read_16(hub->ports[port])); 355 355 break; 356 case USB _HUB_FEATURE_PORT_SUSPEND:356 case USB2_HUB_FEATURE_PORT_SUSPEND: 357 357 RH_DEBUG(hub, port, "Set port suspend (status %" PRIx16 358 358 ")", status); … … 368 368 break; 369 369 case USB_HUB_FEATURE_C_PORT_CONNECTION: 370 case USB _HUB_FEATURE_C_PORT_ENABLE:371 case USB _HUB_FEATURE_C_PORT_SUSPEND:370 case USB2_HUB_FEATURE_C_PORT_ENABLE: 371 case USB2_HUB_FEATURE_C_PORT_SUSPEND: 372 372 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: 373 373 RH_DEBUG(hub, port, "Set port change flag (status %" PRIx16
Note:
See TracChangeset
for help on using the changeset viewer.