Changeset 36cd378 in mainline


Ignore:
Timestamp:
2011-04-07T17:07:22Z (14 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3e490eb
Parents:
a4e18e1
Message:

some more comments

Location:
uspace/drv/usbhub
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/port_status.h

    ra4e18e1 r36cd378  
    282282 */
    283283static inline bool usb_hub_get_bit(usb_hub_status_t * status, int idx) {
    284         return (*status)&(1 << idx);
     284        return ((*status)&(1 << idx))!=0;
    285285}
    286286
     
    309309}
    310310
     311/**
     312 * set device connected bit in port status
     313 *
     314 * @param status
     315 * @param connected value of the bit
     316 */
    311317static inline void usb_port_set_dev_connected(usb_port_status_t * status, bool connected) {
    312318        usb_port_set_bit(status, 0, connected);
     
    325331}
    326332
     333/**
     334 * set port enabled bit in port status
     335 *
     336 * @param status
     337 * @param enabled value of the bit
     338 */
    327339static inline void usb_port_set_enabled(usb_port_status_t * status, bool enabled) {
    328340        usb_port_set_bit(status, 1, enabled);
     
    340352}
    341353
     354/**
     355 * set port suspended bit in port status
     356 *
     357 * @param status
     358 * @param suspended value of the bit
     359 */
    342360static inline void usb_port_set_suspended(usb_port_status_t * status, bool suspended) {
    343361        usb_port_set_bit(status, 2, suspended);
     
    355373}
    356374
     375/**
     376 * set over current indicator bit in port status
     377 *
     378 * @param status
     379 * @param value value of the bit
     380 */
    357381static inline void usb_port_set_over_current(usb_port_status_t * status, bool value) {
    358382        usb_port_set_bit(status, 3, value);
     
    370394}
    371395
     396/**
     397 * set port reset bit in port status
     398 *
     399 * @param status
     400 * @param value value of the bit
     401 */
    372402static inline void usb_port_set_reset(usb_port_status_t * status, bool value) {
    373403        usb_port_set_bit(status, 4, value);
     
    385415}
    386416
     417/**
     418 * set port powered bit in port status
     419 *
     420 * @param status
     421 * @param powered value of the bit
     422 */
    387423static inline void usb_port_set_powered(usb_port_status_t * status, bool powered) {
    388424        usb_port_set_bit(status, 8, powered);
     
    400436}
    401437
     438/**
     439 * set device connected bit in port status
     440 *
     441 * @param status
     442 * @param low_speed value of the bit
     443 */
    402444static inline void usb_port_set_low_speed(usb_port_status_t * status, bool low_speed) {
    403445        usb_port_set_bit(status, 9, low_speed);
     
    415457}
    416458
     459/**
     460 * set high speed device bit in port status
     461 *
     462 * @param status
     463 * @param high_speed value of the bit
     464 */
    417465static inline void usb_port_set_high_speed(usb_port_status_t * status, bool high_speed) {
    418466        usb_port_set_bit(status, 10, high_speed);
     
    445493}
    446494
     495/**
     496 * set connection change bit in port status
     497 * @param status
     498 * @param change value of the bit
     499 */
    447500static inline void usb_port_set_connect_change(usb_port_status_t * status, bool change) {
    448501        usb_port_set_bit(status, 16, change);
     
    460513}
    461514
     515/**
     516 * set port enable change bit in port status
     517 *
     518 * @param status
     519 * @param change value of the bit
     520 */
    462521static inline void usb_port_set_enabled_change(usb_port_status_t * status, bool change) {
    463522        usb_port_set_bit(status, 17, change);
     
    475534}
    476535
     536/**
     537 * set port suspend change bit in port status
     538 *
     539 * @param status
     540 * @param change value of the bit
     541 */
    477542static inline void usb_port_set_suspend_change(usb_port_status_t * status, bool change) {
    478543        usb_port_set_bit(status, 18, change);
     
    490555}
    491556
     557/**
     558 * set port over current change bit in port status
     559 *
     560 * @param status
     561 * @param change value of the bit
     562 */
    492563static inline void usb_port_set_overcurrent_change(usb_port_status_t * status, bool change) {
    493564        usb_port_set_bit(status, 19, change);
     
    504575}
    505576
     577/**
     578 * set port reset completed bit in port status
     579 *
     580 * @param status
     581 * @param change value of the bit
     582 */
    506583static inline void usb_port_set_reset_completed(usb_port_status_t * status, bool completed) {
    507584        usb_port_set_bit(status, 20, completed);
     
    519596}
    520597
     598/**
     599 * set hub power lost bit in hub status
     600 *
     601 * @param status
     602 * @param change value of the bit
     603 */
    521604static inline void usb_hub_set_local_power_lost(usb_port_status_t * status,
    522605        bool power_lost) {
     
    535618}
    536619
     620/**
     621 * set hub over current bit in hub status
     622 *
     623 * @param status
     624 * @param change value of the bit
     625 */
    537626static inline void usb_hub_set_over_current(usb_port_status_t * status,
    538627        bool over_current) {
     
    552641}
    553642
     643/**
     644 * set hub power change bit in hub status
     645 *
     646 * @param status
     647 * @param change value of the bit
     648 */
    554649static inline void usb_hub_set_local_power_change(usb_port_status_t * status,
    555650        bool change) {
     
    568663}
    569664
     665/**
     666 * set hub over current change bit in hub status
     667 *
     668 * @param status
     669 * @param change value of the bit
     670 */
    570671static inline void usb_hub_set_over_current_change(usb_port_status_t * status,
    571672        bool change) {
  • uspace/drv/usbhub/usbhub.c

    ra4e18e1 r36cd378  
    399399        usb_log_debug2("freeing data\n");
    400400        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 =
    403403                (uint8_t*) malloc((hub_info->port_count + 8) / 8);
    404404        memcpy(hub_info->not_initialized_non_removables,
     
    406406                (hub_info->port_count + 8) / 8
    407407                );
    408 
    409         //free(descriptor->devices_removable);
    410         //free(descriptor);
     408                */
     409        free(descriptor->devices_removable);
     410        free(descriptor);
    411411        return EOK;
    412412}
  • uspace/drv/usbhub/usbhub.h

    ra4e18e1 r36cd378  
    8484        /** generic usb device data*/
    8585        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        
    9386} usb_hub_info_t;
    9487
Note: See TracChangeset for help on using the changeset viewer.