Changes in / [b53ca1e:54d9058] in mainline


Ignore:
Location:
uspace
Files:
6 added
11 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/adt/usbaddrkeep.c

    rb53ca1e r54d9058  
    2929#include <stdio.h>
    3030#include <stdlib.h>
    31 #include <usb/addrkeep.h>
     31#include <usb/hcd.h>
    3232#include <errno.h>
    3333#include "../tester.h"
  • uspace/app/virtusbkbd/kbdconfig.c

    rb53ca1e r54d9058  
    6161        .endpoint_count = 1,
    6262        .interface_class = USB_CLASS_HID,
    63         .interface_subclass = USB_HID_SUBCLASS_BOOT,
     63        .interface_subclass = 0,
    6464        .interface_protocol = USB_HID_PROTOCOL_KEYBOARD,
    6565        .str_interface = 0
  • uspace/drv/usbhub/usbhub.c

    rb53ca1e r54d9058  
    8484        }*/
    8585
    86         result->address = addr;
     86        result->usb_device = usb_new(usb_hcd_attached_device_info_t);
     87        result->usb_device->address = addr;
    8788
    8889        // get hub descriptor
     
    154155        int opResult;
    155156        usb_target_t target;
    156         target.address = hub_info->address;
     157        target.address = hub_info->usb_device->address;
    157158        target.endpoint = 0;
    158159
     
    215216        dprintf(USB_LOG_LEVEL_INFO, "hub dev added");
    216217        dprintf(USB_LOG_LEVEL_DEBUG, "\taddress %d, has %d ports ",
    217                         hub_info->address,
     218                        hub_info->usb_device->address,
    218219                        hub_info->port_count);
    219220        dprintf(USB_LOG_LEVEL_DEBUG, "\tused configuration %d",config_descriptor.configuration_number);
     
    464465
    465466                usb_target_t target;
    466                 target.address = hub_info->address;
     467                target.address = hub_info->usb_device->address;
    467468                target.endpoint = 1;/// \TODO get from endpoint descriptor
    468469                dprintf(USB_LOG_LEVEL_INFO, "checking changes for hub at addr %d",
     
    506507                        if (interrupt) {
    507508                                usb_hub_process_interrupt(
    508                                         hub_info, hc, port, hub_info->address);
     509                                        hub_info, hc, port, hub_info->usb_device->address);
    509510                        }
    510511                }
  • uspace/drv/usbhub/usbhub.h

    rb53ca1e r54d9058  
    3636#define DRV_USBHUB_USBHUB_H
    3737
    38 #include <ipc/devman.h>
    39 #include <usb/usb.h>
    40 #include <driver.h>
     38#define NAME "usbhub"
    4139
    42 #define NAME "usbhub"
     40#include "usb/hcdhubd.h"
    4341
    4442/** basic information about device attached to hub */
     
    5452        /** attached device handles */
    5553        usb_hub_attached_device_t * attached_devs;
    56         /** USB address of the hub. */
    57         usb_address_t address;
     54        /** General usb device info. */
     55        usb_hcd_attached_device_info_t * usb_device;
    5856        /** General device info*/
    5957        device_t * device;
     58
    6059} usb_hub_info_t;
    6160
  • uspace/drv/vhc/conn.h

    rb53ca1e r54d9058  
    3737
    3838#include <usb/usb.h>
     39#include <usb/hcdhubd.h>
    3940#include <usbhc_iface.h>
    4041#include "vhcd.h"
     
    4344void connection_handler_host(sysarg_t);
    4445
     46usb_hcd_transfer_ops_t vhc_transfer_ops;
    4547usbhc_iface_t vhc_iface;
    4648
  • uspace/drv/vhc/connhost.c

    rb53ca1e r54d9058  
    3636#include <errno.h>
    3737#include <usb/usb.h>
    38 #include <usb/addrkeep.h>
     38#include <usb/hcd.h>
    3939
    4040#include "vhcd.h"
  • uspace/lib/usb/Makefile

    rb53ca1e r54d9058  
    3939        src/drvpsync.c \
    4040        src/dump.c \
     41        src/hcdhubd.c \
     42        src/hcdrv.c \
    4143        src/hidparser.c \
     44        src/localdrv.c \
    4245        src/pipes.c \
    4346        src/pipesinit.c \
    4447        src/pipesio.c \
    4548        src/recognise.c \
     49        src/remotedrv.c \
    4650        src/request.c \
    4751        src/usb.c \
  • uspace/lib/usb/include/usb/addrkeep.h

    • Property mode changed from 100644 to 120000
    rb53ca1e r54d9058  
    1 /*
    2  * Copyright (c) 2010 Vojtech Horky
    3  * All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  *
    9  * - Redistributions of source code must retain the above copyright
    10  *   notice, this list of conditions and the following disclaimer.
    11  * - Redistributions in binary form must reproduce the above copyright
    12  *   notice, this list of conditions and the following disclaimer in the
    13  *   documentation and/or other materials provided with the distribution.
    14  * - The name of the author may not be used to endorse or promote products
    15  *   derived from this software without specific prior written permission.
    16  *
    17  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
    18  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
    19  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
    20  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
    21  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
    22  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
    23  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    24  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    25  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    26  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    27  */
    28 
    29 /** @addtogroup libusb
    30  * @{
    31  */
    32 /** @file
    33  * USB address keeping for host controller drivers.
    34  */
    35 #ifndef LIBUSB_ADDRKEEP_H_
    36 #define LIBUSB_ADDRKEEP_H_
    37 
    38 #include <usb/usb.h>
    39 #include <fibril_synch.h>
    40 #include <devman.h>
    41 
    42 /** Info about used address. */
    43 typedef struct {
    44         /** Linked list member. */
    45         link_t link;
    46         /** Address. */
    47         usb_address_t address;
    48         /** Corresponding devman handle. */
    49         devman_handle_t devman_handle;
    50 } usb_address_keeping_used_t;
    51 
    52 /** Structure for keeping track of free and used USB addresses. */
    53 typedef struct {
    54         /** Head of list of used addresses. */
    55         link_t used_addresses;
    56         /** Upper bound for USB addresses. */
    57         usb_address_t max_address;
    58         /** Mutex protecting used address. */
    59         fibril_mutex_t used_addresses_guard;
    60         /** Condition variable for used addresses. */
    61         fibril_condvar_t used_addresses_condvar;
    62 
    63         /** Condition variable mutex for default address. */
    64         fibril_mutex_t default_condvar_guard;
    65         /** Condition variable for default address. */
    66         fibril_condvar_t default_condvar;
    67         /** Whether is default address available. */
    68         bool default_available;
    69 } usb_address_keeping_t;
    70 
    71 void usb_address_keeping_init(usb_address_keeping_t *, usb_address_t);
    72 
    73 void usb_address_keeping_reserve_default(usb_address_keeping_t *);
    74 void usb_address_keeping_release_default(usb_address_keeping_t *);
    75 
    76 usb_address_t usb_address_keeping_request(usb_address_keeping_t *);
    77 int usb_address_keeping_release(usb_address_keeping_t *, usb_address_t);
    78 void usb_address_keeping_devman_bind(usb_address_keeping_t *, usb_address_t,
    79     devman_handle_t);
    80 usb_address_t usb_address_keeping_find(usb_address_keeping_t *,
    81     devman_handle_t);
    82 
    83 #endif
    84 /**
    85  * @}
    86  */
     1hcd.h
  • uspace/lib/usb/include/usb/classes/hub.h

    rb53ca1e r54d9058  
    3737
    3838#include <sys/types.h>
     39#include <usb/hcdhubd.h>
     40
    3941
    4042/** Hub class feature selector.
     
    7880    /**
    7981            D1...D0: Logical Power Switching Mode
    80             00: Ganged power switching (all ports power at
     82            00: Ganged power switching (all ports power at
    8183            once)
    8284            01: Individual port power switching
     
    8991            00: Global Over-current Protection. The hub
    9092            reports over-current as a summation of all
    91             ports current draw, without a breakdown of
     93            ports current draw, without a breakdown of
    9294            individual port over-current status.
    9395            01: Individual Port Over-current Protection. The
  • uspace/lib/usb/src/addrkeep.c

    rb53ca1e r54d9058  
    3333 * @brief Address keeping.
    3434 */
    35 #include <usb/addrkeep.h>
     35#include <usb/hcd.h>
    3636#include <errno.h>
    3737#include <assert.h>
  • uspace/lib/usb/src/dump.c

    rb53ca1e r54d9058  
    147147        PRINTLINE("bDeviceProtocol = 0x%02x", d->device_protocol);
    148148        PRINTLINE("bMaxPacketSize0 = %d", d->max_packet_size);
    149         PRINTLINE("idVendor = 0x%04x", d->vendor_id);
    150         PRINTLINE("idProduct = 0x%04x", d->product_id);
     149        PRINTLINE("idVendor = %d", d->vendor_id);
     150        PRINTLINE("idProduct = %d", d->product_id);
    151151        PRINTLINE("bcdDevice = %d", d->device_version);
    152152        PRINTLINE("iManufacturer = %d", d->str_manufacturer);
Note: See TracChangeset for help on using the changeset viewer.