Changeset d7ff048 in mainline for uspace/drv/bus/usb/usbhub/port.h


Ignore:
Timestamp:
2011-10-08T13:08:53Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bf08ff0
Parents:
8367d1d (diff), 80099c19 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 moved

Legend:

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

    r8367d1d rd7ff048  
    11/*
    22 * Copyright (c) 2011 Vojtech Horky
     3 * Copyright (c) 2011 Jan Vesely
    34 * All rights reserved.
    45 *
     
    2627 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2728 */
    28 
    2929/** @addtogroup drvusbhub
    3030 * @{
     
    3333 * Hub ports related functions.
    3434 */
    35 #ifndef DRV_USBHUB_PORTS_H
    36 #define DRV_USBHUB_PORTS_H
     35#ifndef DRV_USBHUB_PORT_H
     36#define DRV_USBHUB_PORT_H
    3737
    3838#include <usb/dev/driver.h>
    3939#include <usb/dev/hub.h>
     40#include <usb/classes/hub.h>
    4041
    4142typedef struct usb_hub_info_t usb_hub_info_t;
     
    4344/** Information about single port on a hub. */
    4445typedef struct {
    45         /** Mutex needed by CV for checking port reset. */
    46         fibril_mutex_t reset_mutex;
     46        size_t port_number;
     47        usb_pipe_t *control_pipe;
     48        /** Mutex needed not only by CV for checking port reset. */
     49        fibril_mutex_t mutex;
    4750        /** CV for waiting to port reset completion. */
    4851        fibril_condvar_t reset_cv;
     
    6265 * @param port Port to be initialized.
    6366 */
    64 static inline void usb_hub_port_init(usb_hub_port_t *port) {
     67static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number,
     68    usb_pipe_t *control_pipe)
     69{
     70        assert(port);
    6571        port->attached_device.address = -1;
    6672        port->attached_device.handle = 0;
    67         fibril_mutex_initialize(&port->reset_mutex);
     73        port->port_number = port_number;
     74        port->control_pipe = control_pipe;
     75        fibril_mutex_initialize(&port->mutex);
    6876        fibril_condvar_initialize(&port->reset_cv);
    6977}
    7078
    71 
    72 void usb_hub_process_port_interrupt(usb_hub_info_t *hub,
    73         uint16_t port);
    74 
    75 
     79void usb_hub_port_reset_fail(usb_hub_port_t *port);
     80void usb_hub_port_process_interrupt(usb_hub_port_t *port, usb_hub_info_t *hub);
     81int usb_hub_port_clear_feature(
     82    usb_hub_port_t *port, usb_hub_class_feature_t feature);
     83int usb_hub_port_set_feature(
     84    usb_hub_port_t *port, usb_hub_class_feature_t feature);
    7685
    7786#endif
Note: See TracChangeset for help on using the changeset viewer.