Changeset 9e9d018e in mainline
- Timestamp:
- 2015-07-05T02:19:57Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bc8bc6e
- Parents:
- 7a1757e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/uhci/uhci_rh.c
r7a1757e r9e9d018e 168 168 } while (0) 169 169 170 #define RH_DEBUG( d, port, msg, ...) \170 #define RH_DEBUG(hub, port, msg, ...) \ 171 171 if ((int)port >= 0) \ 172 usb_log_debug(" %s: rh-%d: " msg, d->name, port, ##__VA_ARGS__); \172 usb_log_debug("RH(%p-%d): " msg, hub, port, ##__VA_ARGS__); \ 173 173 else \ 174 usb_log_debug(" %s: rh: " msg, d->name, ##__VA_ARGS__) \174 usb_log_debug("RH(%p):" msg, hub, ##__VA_ARGS__) \ 175 175 176 176 /** USB HUB port state request handler. … … 198 198 data[0] = ((value & STATUS_LINE_D_MINUS) ? 1 : 0) 199 199 | ((value & STATUS_LINE_D_PLUS) ? 2 : 0); 200 RH_DEBUG( device, port, "Bus state %" PRIx8 "(source %" PRIx16")\n",200 RH_DEBUG(hub, port, "Bus state %" PRIx8 "(source %" PRIx16")\n", 201 201 data[0], value); 202 202 *act_size = 1; … … 243 243 ((hub->reset_changed[port] ? 1 : 0) << USB_HUB_FEATURE_C_PORT_RESET) 244 244 ); 245 RH_DEBUG( device, port, "Port status %" PRIx32 " (source %" PRIx16245 RH_DEBUG(hub, port, "Port status %" PRIx32 " (source %" PRIx16 246 246 "%s)\n", uint32_usb2host(status), val, 247 247 hub->reset_changed[port] ? "-reset" : ""); … … 271 271 switch (feature) { 272 272 case USB_HUB_FEATURE_PORT_ENABLE: 273 RH_DEBUG( device, port, "Clear port enable (status %"273 RH_DEBUG(hub, port, "Clear port enable (status %" 274 274 PRIx16 ")\n", status); 275 275 pio_write_16(hub->ports[port], val & ~STATUS_ENABLED); 276 276 break; 277 277 case USB_HUB_FEATURE_PORT_SUSPEND: 278 RH_DEBUG( device, port, "Clear port suspend (status %"278 RH_DEBUG(hub, port, "Clear port suspend (status %" 279 279 PRIx16 ")\n", status); 280 280 pio_write_16(hub->ports[port], val & ~STATUS_SUSPEND); … … 283 283 break; 284 284 case USB_HUB_FEATURE_PORT_POWER: 285 RH_DEBUG( device, port, "Clear port power (status %" PRIx16 ")\n",285 RH_DEBUG(hub, port, "Clear port power (status %" PRIx16 ")\n", 286 286 status); 287 287 /* We are always powered */ … … 289 289 break; 290 290 case USB_HUB_FEATURE_C_PORT_CONNECTION: 291 RH_DEBUG( device, port, "Clear port conn change (status %"291 RH_DEBUG(hub, port, "Clear port conn change (status %" 292 292 PRIx16 ")\n", status); 293 293 pio_write_16(hub->ports[port], val | STATUS_CONNECTED_CHANGED); 294 294 break; 295 295 case USB_HUB_FEATURE_C_PORT_RESET: 296 RH_DEBUG( device, port, "Clear port reset change (status %"296 RH_DEBUG(hub, port, "Clear port reset change (status %" 297 297 PRIx16 ")\n", status); 298 298 hub->reset_changed[port] = false; 299 299 break; 300 300 case USB_HUB_FEATURE_C_PORT_ENABLE: 301 RH_DEBUG( device, port, "Clear port enable change (status %"301 RH_DEBUG(hub, port, "Clear port enable change (status %" 302 302 PRIx16 ")\n", status); 303 303 pio_write_16(hub->ports[port], status | STATUS_ENABLED_CHANGED); 304 304 break; 305 305 case USB_HUB_FEATURE_C_PORT_SUSPEND: 306 RH_DEBUG( device, port, "Clear port suspend change (status %"306 RH_DEBUG(hub, port, "Clear port suspend change (status %" 307 307 PRIx16 ")\n", status); 308 308 //TODO 309 309 return ENOTSUP; 310 310 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: 311 RH_DEBUG( device, port, "Clear port OC change (status %"311 RH_DEBUG(hub, port, "Clear port OC change (status %" 312 312 PRIx16 ")\n", status); 313 313 /* UHCI Does not report over current */ 314 //TODO: newer chips do, but some have broken wiring 314 //TODO: newer chips do, but some have broken wiring 315 315 break; 316 316 default: 317 RH_DEBUG( device, port, "Clear unknown feature %d (status %"317 RH_DEBUG(hub, port, "Clear unknown feature %d (status %" 318 318 PRIx16 ")\n", feature, status); 319 319 usb_log_warning("Clearing feature %d is unsupported\n", … … 343 343 switch (feature) { 344 344 case USB_HUB_FEATURE_PORT_RESET: 345 RH_DEBUG( device, port, "Set port reset before (status %" PRIx16345 RH_DEBUG(hub, port, "Set port reset before (status %" PRIx16 346 346 ")\n", status); 347 347 uhci_port_reset_enable(hub->ports[port]); 348 348 hub->reset_changed[port] = true; 349 RH_DEBUG( device, port, "Set port reset after (status %" PRIx16349 RH_DEBUG(hub, port, "Set port reset after (status %" PRIx16 350 350 ")\n", pio_read_16(hub->ports[port])); 351 351 break; 352 352 case USB_HUB_FEATURE_PORT_SUSPEND: 353 RH_DEBUG( device, port, "Set port suspend (status %" PRIx16353 RH_DEBUG(hub, port, "Set port suspend (status %" PRIx16 354 354 ")\n", status); 355 355 pio_write_16(hub->ports[port], … … 358 358 break; 359 359 case USB_HUB_FEATURE_PORT_POWER: 360 RH_DEBUG( device, port, "Set port power (status %" PRIx16360 RH_DEBUG(hub, port, "Set port power (status %" PRIx16 361 361 ")\n", status); 362 362 /* We are always powered */ … … 367 367 case USB_HUB_FEATURE_C_PORT_SUSPEND: 368 368 case USB_HUB_FEATURE_C_PORT_OVER_CURRENT: 369 RH_DEBUG( device, port, "Set port change flag (status %" PRIx16369 RH_DEBUG(hub, port, "Set port change flag (status %" PRIx16 370 370 ")\n", status); 371 371 /* These are voluntary and don't have to be set … … 373 373 break; 374 374 default: 375 RH_DEBUG( device, port, "Set unknown feature %d (status %" PRIx16375 RH_DEBUG(hub, port, "Set unknown feature %d (status %" PRIx16 376 376 ")\n", feature, status); 377 377 usb_log_warning("Setting feature %d is unsupported\n", … … 412 412 0x4 : 0); 413 413 414 RH_DEBUG( device, -1, "Event mask %" PRIx8414 RH_DEBUG(hub, -1, "Event mask %" PRIx8 415 415 " (status_a %" PRIx16 "%s)," 416 416 " (status_b %" PRIx16 "%s)\n", status,
Note:
See TracChangeset
for help on using the changeset viewer.