Changeset 1e1b1a9 in mainline for uspace/drv/usbhub/usbhub.h


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

usbhub refactoring

File:
1 edited

Legend:

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

    r8961c22 r1e1b1a9  
    3737
    3838#include <ipc/devman.h>
    39 #include <usb/usb.h>
    4039#include <ddf/driver.h>
    41 
    42 #define NAME "usbhub"
    4340
    4441#include <usb/hub.h>
     
    5047#include <fibril_synch.h>
    5148
     49#define NAME "usbhub"
    5250
    53 /** Information about single port on a hub. */
    54 typedef 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;
     51#include "ports.h"
    6352
    64         /** Information about attached device. */
    65         usb_hc_attached_device_t attached_device;
    66 } usb_hub_port_t;
    6753
    68 /** Initialize hub port information.
    69  *
    70  * @param port Port to be initialized.
    71  */
    72 static 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 }
    7854
    7955/** Information about attached hub. */
    80 typedef struct {
     56typedef struct usb_hub_info_t{
    8157        /** Number of ports. */
    8258        size_t port_count;
     
    11995int usb_hub_add_device(usb_device_t * usb_dev);
    12096
    121 int usb_hub_check_hub_changes(usb_hub_info_t * hub_info_param);
    122 
    12397bool hub_port_changes_callback(usb_device_t *dev,
    12498    uint8_t *change_bitmap, size_t change_bitmap_size, void *arg);
     99
     100int usb_hub_release_default_address(usb_hub_info_t * hub);
     101
    125102#endif
    126103/**
Note: See TracChangeset for help on using the changeset viewer.