Ignore:
File:
1 edited

Legend:

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

    r34d750c rd15797d  
    3939
    4040#include <ddf/driver.h>
    41 #include <fibril_synch.h>
    4241
    4342#include <usb/classes/hub.h>
     
    4544#include <usb/dev/pipes.h>
    4645#include <usb/dev/driver.h>
    47 #include <usb/dev/poll.h>
     46
     47#include <fibril_synch.h>
    4848
    4949#define NAME "usbhub"
    5050
    5151#include "port.h"
    52 #include "status.h"
    5352
    5453/** Information about attached hub. */
     
    5857        /** Port structures, one for each port */
    5958        usb_hub_port_t *ports;
    60         /** Speed of the hub */
    61         usb_speed_t speed;
    6259        /** Generic usb device data*/
    6360        usb_device_t *usb_device;
    64         /** Data polling handle. */
    65         usb_polling_t polling;
     61
     62        /** Number of pending operations on the mutex to prevent shooting
     63         * ourselves in the foot.
     64         * When the hub is disconnected but we are in the middle of some
     65         * operation, we cannot destroy this structure right away because
     66         * the pending operation might use it.
     67         */
     68        size_t pending_ops_count;
     69        /** Guard for pending_ops_count. */
     70        fibril_mutex_t pending_ops_mutex;
     71        /** Condition variable for pending_ops_count. */
     72        fibril_condvar_t pending_ops_cv;
    6673        /** Pointer to usbhub function. */
    6774        ddf_fun_t *hub_fun;
    68         /** Device communication pipe. */
    69         usb_pipe_t *control_pipe;
     75        /** Status indicator */
     76        bool running;
    7077        /** Hub supports port power switching. */
    7178        bool power_switched;
    7279        /** Each port is switched individually. */
    7380        bool per_port_power;
    74         /** Whether MTT is available */
    75         bool mtt_available;
    7681};
    7782
    78 extern const usb_endpoint_description_t *usb_hub_endpoints [];
     83extern const usb_endpoint_description_t hub_status_change_endpoint_description;
    7984
    80 int usb_hub_device_add(usb_device_t *);
    81 int usb_hub_device_remove(usb_device_t *);
    82 int usb_hub_device_gone(usb_device_t *);
     85extern int usb_hub_device_add(usb_device_t *);
     86extern int usb_hub_device_remove(usb_device_t *);
     87extern int usb_hub_device_gone(usb_device_t *);
    8388
    84 int usb_hub_set_depth(const usb_hub_dev_t *);
    85 int usb_hub_get_port_status(const usb_hub_dev_t *, size_t, usb_port_status_t *);
    86 int usb_hub_set_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t);
    87 int usb_hub_clear_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t);
    88 
    89 bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t, void *);
    90 
    91 int usb_hub_reserve_default_address(usb_hub_dev_t *, async_exch_t *, usb_port_t *);
    92 int usb_hub_release_default_address(usb_hub_dev_t *, async_exch_t *);
     89extern bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t,
     90    void *);
    9391
    9492#endif
Note: See TracChangeset for help on using the changeset viewer.