Ignore:
File:
1 edited

Legend:

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

    rd15797d r34d750c  
    3939
    4040#include <ddf/driver.h>
     41#include <fibril_synch.h>
    4142
    4243#include <usb/classes/hub.h>
     
    4445#include <usb/dev/pipes.h>
    4546#include <usb/dev/driver.h>
    46 
    47 #include <fibril_synch.h>
     47#include <usb/dev/poll.h>
    4848
    4949#define NAME "usbhub"
    5050
    5151#include "port.h"
     52#include "status.h"
    5253
    5354/** Information about attached hub. */
     
    5758        /** Port structures, one for each port */
    5859        usb_hub_port_t *ports;
     60        /** Speed of the hub */
     61        usb_speed_t speed;
    5962        /** Generic usb device data*/
    6063        usb_device_t *usb_device;
    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;
     64        /** Data polling handle. */
     65        usb_polling_t polling;
    7366        /** Pointer to usbhub function. */
    7467        ddf_fun_t *hub_fun;
    75         /** Status indicator */
    76         bool running;
     68        /** Device communication pipe. */
     69        usb_pipe_t *control_pipe;
    7770        /** Hub supports port power switching. */
    7871        bool power_switched;
    7972        /** Each port is switched individually. */
    8073        bool per_port_power;
     74        /** Whether MTT is available */
     75        bool mtt_available;
    8176};
    8277
    83 extern const usb_endpoint_description_t hub_status_change_endpoint_description;
     78extern const usb_endpoint_description_t *usb_hub_endpoints [];
    8479
    85 extern int usb_hub_device_add(usb_device_t *);
    86 extern int usb_hub_device_remove(usb_device_t *);
    87 extern int usb_hub_device_gone(usb_device_t *);
     80int usb_hub_device_add(usb_device_t *);
     81int usb_hub_device_remove(usb_device_t *);
     82int usb_hub_device_gone(usb_device_t *);
    8883
    89 extern bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t,
    90     void *);
     84int usb_hub_set_depth(const usb_hub_dev_t *);
     85int usb_hub_get_port_status(const usb_hub_dev_t *, size_t, usb_port_status_t *);
     86int usb_hub_set_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t);
     87int usb_hub_clear_port_feature(const usb_hub_dev_t *, size_t, usb_hub_class_feature_t);
     88
     89bool hub_port_changes_callback(usb_device_t *, uint8_t *, size_t, void *);
     90
     91int usb_hub_reserve_default_address(usb_hub_dev_t *, async_exch_t *, usb_port_t *);
     92int usb_hub_release_default_address(usb_hub_dev_t *, async_exch_t *);
    9193
    9294#endif
Note: See TracChangeset for help on using the changeset viewer.