Changeset 3e490eb in mainline for uspace/drv/usbhub/usbhub.h


Ignore:
Timestamp:
2011-04-09T08:19:55Z (13 years ago)
Author:
Matus Dekanek <smekideki@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8961c22
Parents:
36cd378
Message:

attempt to merge usb/development hub changes

File:
1 edited

Legend:

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

    r36cd378 r3e490eb  
    4848#include <usb/devdrv.h>
    4949
     50#include <fibril_synch.h>
     51
     52
     53/** Information about single port on a hub. */
     54typedef struct {
     55        /** Mutex needed by CV for checking port reset. */
     56        fibril_mutex_t reset_mutex;
     57        /** CV for waiting to port reset completion. */
     58        fibril_condvar_t reset_cv;
     59        /** Whether port reset is completed.
     60         * Guarded by @c reset_mutex.
     61         */
     62        bool reset_completed;
     63
     64        /** Information about attached device. */
     65        usb_hc_attached_device_t attached_device;
     66} usb_hub_port_t;
     67
     68/** Initialize hub port information.
     69 *
     70 * @param port Port to be initialized.
     71 */
     72static inline void usb_hub_port_init(usb_hub_port_t *port) {
     73        port->attached_device.address = -1;
     74        port->attached_device.handle = 0;
     75        fibril_mutex_initialize(&port->reset_mutex);
     76        fibril_condvar_initialize(&port->reset_cv);
     77}
     78
    5079/** Information about attached hub. */
    5180typedef struct {
    5281        /** Number of ports. */
    53         int port_count;
     82        size_t port_count;
    5483
    5584        /** attached device handles, for each port one */
    56         usb_hc_attached_device_t * attached_devs;
     85        usb_hub_port_t *ports;
    5786
    5887        /** connection to hcd */
     
    86115} usb_hub_info_t;
    87116
    88 /**
    89  * function running the hub-controlling loop.
    90  * @param hub_info_param hub info pointer
    91  */
    92 int usb_hub_control_loop(void * hub_info_param);
     117//int usb_hub_control_loop(void * hub_info_param);
    93118
    94119int usb_hub_add_device(usb_device_t * usb_dev);
    95120
    96 /**
    97  * Check changes on specified hub
    98  * @param hub_info_param pointer to usb_hub_info_t structure
    99  * @return error code if there is problem when initializing communication with
    100  * hub, EOK otherwise
    101  */
    102121int usb_hub_check_hub_changes(usb_hub_info_t * hub_info_param);
    103122
    104 
     123bool hub_port_changes_callback(usb_device_t *dev,
     124    uint8_t *change_bitmap, size_t change_bitmap_size, void *arg);
    105125#endif
    106126/**
Note: See TracChangeset for help on using the changeset viewer.