Changeset 36cd378 in mainline
- Timestamp:
- 2011-04-07T17:07:22Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3e490eb
- Parents:
- a4e18e1
- Location:
- uspace/drv/usbhub
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/usbhub/port_status.h
ra4e18e1 r36cd378 282 282 */ 283 283 static inline bool usb_hub_get_bit(usb_hub_status_t * status, int idx) { 284 return ( *status)&(1 << idx);284 return ((*status)&(1 << idx))!=0; 285 285 } 286 286 … … 309 309 } 310 310 311 /** 312 * set device connected bit in port status 313 * 314 * @param status 315 * @param connected value of the bit 316 */ 311 317 static inline void usb_port_set_dev_connected(usb_port_status_t * status, bool connected) { 312 318 usb_port_set_bit(status, 0, connected); … … 325 331 } 326 332 333 /** 334 * set port enabled bit in port status 335 * 336 * @param status 337 * @param enabled value of the bit 338 */ 327 339 static inline void usb_port_set_enabled(usb_port_status_t * status, bool enabled) { 328 340 usb_port_set_bit(status, 1, enabled); … … 340 352 } 341 353 354 /** 355 * set port suspended bit in port status 356 * 357 * @param status 358 * @param suspended value of the bit 359 */ 342 360 static inline void usb_port_set_suspended(usb_port_status_t * status, bool suspended) { 343 361 usb_port_set_bit(status, 2, suspended); … … 355 373 } 356 374 375 /** 376 * set over current indicator bit in port status 377 * 378 * @param status 379 * @param value value of the bit 380 */ 357 381 static inline void usb_port_set_over_current(usb_port_status_t * status, bool value) { 358 382 usb_port_set_bit(status, 3, value); … … 370 394 } 371 395 396 /** 397 * set port reset bit in port status 398 * 399 * @param status 400 * @param value value of the bit 401 */ 372 402 static inline void usb_port_set_reset(usb_port_status_t * status, bool value) { 373 403 usb_port_set_bit(status, 4, value); … … 385 415 } 386 416 417 /** 418 * set port powered bit in port status 419 * 420 * @param status 421 * @param powered value of the bit 422 */ 387 423 static inline void usb_port_set_powered(usb_port_status_t * status, bool powered) { 388 424 usb_port_set_bit(status, 8, powered); … … 400 436 } 401 437 438 /** 439 * set device connected bit in port status 440 * 441 * @param status 442 * @param low_speed value of the bit 443 */ 402 444 static inline void usb_port_set_low_speed(usb_port_status_t * status, bool low_speed) { 403 445 usb_port_set_bit(status, 9, low_speed); … … 415 457 } 416 458 459 /** 460 * set high speed device bit in port status 461 * 462 * @param status 463 * @param high_speed value of the bit 464 */ 417 465 static inline void usb_port_set_high_speed(usb_port_status_t * status, bool high_speed) { 418 466 usb_port_set_bit(status, 10, high_speed); … … 445 493 } 446 494 495 /** 496 * set connection change bit in port status 497 * @param status 498 * @param change value of the bit 499 */ 447 500 static inline void usb_port_set_connect_change(usb_port_status_t * status, bool change) { 448 501 usb_port_set_bit(status, 16, change); … … 460 513 } 461 514 515 /** 516 * set port enable change bit in port status 517 * 518 * @param status 519 * @param change value of the bit 520 */ 462 521 static inline void usb_port_set_enabled_change(usb_port_status_t * status, bool change) { 463 522 usb_port_set_bit(status, 17, change); … … 475 534 } 476 535 536 /** 537 * set port suspend change bit in port status 538 * 539 * @param status 540 * @param change value of the bit 541 */ 477 542 static inline void usb_port_set_suspend_change(usb_port_status_t * status, bool change) { 478 543 usb_port_set_bit(status, 18, change); … … 490 555 } 491 556 557 /** 558 * set port over current change bit in port status 559 * 560 * @param status 561 * @param change value of the bit 562 */ 492 563 static inline void usb_port_set_overcurrent_change(usb_port_status_t * status, bool change) { 493 564 usb_port_set_bit(status, 19, change); … … 504 575 } 505 576 577 /** 578 * set port reset completed bit in port status 579 * 580 * @param status 581 * @param change value of the bit 582 */ 506 583 static inline void usb_port_set_reset_completed(usb_port_status_t * status, bool completed) { 507 584 usb_port_set_bit(status, 20, completed); … … 519 596 } 520 597 598 /** 599 * set hub power lost bit in hub status 600 * 601 * @param status 602 * @param change value of the bit 603 */ 521 604 static inline void usb_hub_set_local_power_lost(usb_port_status_t * status, 522 605 bool power_lost) { … … 535 618 } 536 619 620 /** 621 * set hub over current bit in hub status 622 * 623 * @param status 624 * @param change value of the bit 625 */ 537 626 static inline void usb_hub_set_over_current(usb_port_status_t * status, 538 627 bool over_current) { … … 552 641 } 553 642 643 /** 644 * set hub power change bit in hub status 645 * 646 * @param status 647 * @param change value of the bit 648 */ 554 649 static inline void usb_hub_set_local_power_change(usb_port_status_t * status, 555 650 bool change) { … … 568 663 } 569 664 665 /** 666 * set hub over current change bit in hub status 667 * 668 * @param status 669 * @param change value of the bit 670 */ 570 671 static inline void usb_hub_set_over_current_change(usb_port_status_t * status, 571 672 bool change) { -
uspace/drv/usbhub/usbhub.c
ra4e18e1 r36cd378 399 399 usb_log_debug2("freeing data\n"); 400 400 free(serialized_descriptor); 401 hub_info->descriptor = descriptor;402 hub_info->not_initialized_non_removables =401 //hub_info->descriptor = descriptor; 402 /*hub_info->not_initialized_non_removables = 403 403 (uint8_t*) malloc((hub_info->port_count + 8) / 8); 404 404 memcpy(hub_info->not_initialized_non_removables, … … 406 406 (hub_info->port_count + 8) / 8 407 407 ); 408 409 //free(descriptor->devices_removable);410 //free(descriptor);408 */ 409 free(descriptor->devices_removable); 410 free(descriptor); 411 411 return EOK; 412 412 } -
uspace/drv/usbhub/usbhub.h
ra4e18e1 r36cd378 84 84 /** generic usb device data*/ 85 85 usb_device_t * usb_device; 86 87 /** usb hub specific descriptor */88 usb_hub_descriptor_t * descriptor;89 90 /** not yet initialized non-removable devices */91 uint8_t * not_initialized_non_removables;92 93 86 } usb_hub_info_t; 94 87
Note:
See TracChangeset
for help on using the changeset viewer.