Changeset a1732929 in mainline for uspace/drv/bus/usb/uhci/uhci_rh.c
- Timestamp:
- 2018-01-15T17:04:34Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9ff99e8
- Parents:
- c1a966e
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:32)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-15 17:04:34)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/uhci_rh.c
rc1a966e ra1732929 202 202 data[0] = ((value & STATUS_LINE_D_MINUS) ? 1 : 0) 203 203 | ((value & STATUS_LINE_D_PLUS) ? 2 : 0); 204 RH_DEBUG(hub, port, "Bus state %" PRIx8 "(source %" PRIx16") \n",204 RH_DEBUG(hub, port, "Bus state %" PRIx8 "(source %" PRIx16")", 205 205 data[0], value); 206 206 *act_size = 1; … … 248 248 ); 249 249 RH_DEBUG(hub, port, "Port status %" PRIx32 " (source %" PRIx16 250 "%s) \n", uint32_usb2host(status), val,250 "%s)", uint32_usb2host(status), val, 251 251 hub->reset_changed[port] ? "-reset" : ""); 252 252 memcpy(data, &status, sizeof(status)); … … 276 276 case USB_HUB_FEATURE_PORT_ENABLE: 277 277 RH_DEBUG(hub, port, "Clear port enable (status %" 278 PRIx16 ") \n", status);278 PRIx16 ")", status); 279 279 pio_write_16(hub->ports[port], val & ~STATUS_ENABLED); 280 280 break; 281 281 case USB_HUB_FEATURE_PORT_SUSPEND: 282 282 RH_DEBUG(hub, port, "Clear port suspend (status %" 283 PRIx16 ") \n", status);283 PRIx16 ")", status); 284 284 pio_write_16(hub->ports[port], val & ~STATUS_SUSPEND); 285 285 // TODO we should do resume magic 286 usb_log_warning("Resume is not implemented on port %u \n", port);286 usb_log_warning("Resume is not implemented on port %u", port); 287 287 break; 288 288 case USB_HUB_FEATURE_PORT_POWER: 289 RH_DEBUG(hub, port, "Clear port power (status %" PRIx16 ") \n",289 RH_DEBUG(hub, port, "Clear port power (status %" PRIx16 ")", 290 290 status); 291 291 /* We are always powered */ 292 usb_log_warning("Tried to power off port %u \n", port);292 usb_log_warning("Tried to power off port %u", port); 293 293 break; 294 294 case USB_HUB_FEATURE_C_PORT_CONNECTION: 295 295 RH_DEBUG(hub, port, "Clear port conn change (status %" 296 PRIx16 ") \n", status);296 PRIx16 ")", status); 297 297 pio_write_16(hub->ports[port], val | STATUS_CONNECTED_CHANGED); 298 298 break; 299 299 case USB_HUB_FEATURE_C_PORT_RESET: 300 300 RH_DEBUG(hub, port, "Clear port reset change (status %" 301 PRIx16 ") \n", status);301 PRIx16 ")", status); 302 302 hub->reset_changed[port] = false; 303 303 break; 304 304 case USB_HUB_FEATURE_C_PORT_ENABLE: 305 305 RH_DEBUG(hub, port, "Clear port enable change (status %" 306 PRIx16 ") \n", status);306 PRIx16 ")", status); 307 307 pio_write_16(hub->ports[port], status | STATUS_ENABLED_CHANGED); 308 308 break; 309 309 case USB_HUB_FEATURE_C_PORT_SUSPEND: 310 310 RH_DEBUG(hub, port, "Clear port suspend change (status %" 311 PRIx16 ") \n", status);311 PRIx16 ")", status); 312 312 //TODO 313 313 return ENOTSUP; 314 314 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: 315 315 RH_DEBUG(hub, port, "Clear port OC change (status %" 316 PRIx16 ") \n", status);316 PRIx16 ")", status); 317 317 /* UHCI Does not report over current */ 318 318 //TODO: newer chips do, but some have broken wiring … … 320 320 default: 321 321 RH_DEBUG(hub, port, "Clear unknown feature %d (status %" 322 PRIx16 ") \n", feature, status);323 usb_log_warning("Clearing feature %d is unsupported \n",322 PRIx16 ")", feature, status); 323 usb_log_warning("Clearing feature %d is unsupported", 324 324 feature); 325 325 return ESTALL; … … 348 348 case USB_HUB_FEATURE_PORT_RESET: 349 349 RH_DEBUG(hub, port, "Set port reset before (status %" PRIx16 350 ") \n", status);350 ")", status); 351 351 uhci_port_reset_enable(hub->ports[port]); 352 352 hub->reset_changed[port] = true; 353 353 RH_DEBUG(hub, port, "Set port reset after (status %" PRIx16 354 ") \n", pio_read_16(hub->ports[port]));354 ")", pio_read_16(hub->ports[port])); 355 355 break; 356 356 case USB_HUB_FEATURE_PORT_SUSPEND: 357 357 RH_DEBUG(hub, port, "Set port suspend (status %" PRIx16 358 ") \n", status);358 ")", status); 359 359 pio_write_16(hub->ports[port], 360 360 (status & ~STATUS_WC_BITS) | STATUS_SUSPEND); 361 usb_log_warning("Suspend is not implemented on port %u \n", port);361 usb_log_warning("Suspend is not implemented on port %u", port); 362 362 break; 363 363 case USB_HUB_FEATURE_PORT_POWER: 364 364 RH_DEBUG(hub, port, "Set port power (status %" PRIx16 365 ") \n", status);365 ")", status); 366 366 /* We are always powered */ 367 usb_log_warning("Tried to power port %u \n", port);367 usb_log_warning("Tried to power port %u", port); 368 368 break; 369 369 case USB_HUB_FEATURE_C_PORT_CONNECTION: … … 372 372 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: 373 373 RH_DEBUG(hub, port, "Set port change flag (status %" PRIx16 374 ") \n", status);374 ")", status); 375 375 /* These are voluntary and don't have to be set 376 376 * there is no way we could do it on UHCI anyway */ … … 378 378 default: 379 379 RH_DEBUG(hub, port, "Set unknown feature %d (status %" PRIx16 380 ") \n", feature, status);381 usb_log_warning("Setting feature %d is unsupported \n",380 ")", feature, status); 381 usb_log_warning("Setting feature %d is unsupported", 382 382 feature); 383 383 return ESTALL; … … 418 418 RH_DEBUG(hub, -1, "Event mask %" PRIx8 419 419 " (status_a %" PRIx16 "%s)," 420 " (status_b %" PRIx16 "%s) \n", status,420 " (status_b %" PRIx16 "%s)", status, 421 421 status_a, hub->reset_changed[0] ? "-reset" : "", 422 422 status_b, hub->reset_changed[1] ? "-reset" : "" );
Note:
See TracChangeset
for help on using the changeset viewer.