Changeset b53ca1e in mainline


Ignore:
Timestamp:
2011-02-14T18:06:48Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
567d002
Parents:
54d9058 (diff), bfe0eb5 (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 development/ changes

Location:
uspace
Files:
6 deleted
11 edited

Legend:

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

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

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

    r54d9058 rb53ca1e  
    8484        }*/
    8585
    86         result->usb_device = usb_new(usb_hcd_attached_device_info_t);
    87         result->usb_device->address = addr;
     86        result->address = addr;
    8887
    8988        // get hub descriptor
     
    155154        int opResult;
    156155        usb_target_t target;
    157         target.address = hub_info->usb_device->address;
     156        target.address = hub_info->address;
    158157        target.endpoint = 0;
    159158
     
    216215        dprintf(USB_LOG_LEVEL_INFO, "hub dev added");
    217216        dprintf(USB_LOG_LEVEL_DEBUG, "\taddress %d, has %d ports ",
    218                         hub_info->usb_device->address,
     217                        hub_info->address,
    219218                        hub_info->port_count);
    220219        dprintf(USB_LOG_LEVEL_DEBUG, "\tused configuration %d",config_descriptor.configuration_number);
     
    465464
    466465                usb_target_t target;
    467                 target.address = hub_info->usb_device->address;
     466                target.address = hub_info->address;
    468467                target.endpoint = 1;/// \TODO get from endpoint descriptor
    469468                dprintf(USB_LOG_LEVEL_INFO, "checking changes for hub at addr %d",
     
    507506                        if (interrupt) {
    508507                                usb_hub_process_interrupt(
    509                                         hub_info, hc, port, hub_info->usb_device->address);
     508                                        hub_info, hc, port, hub_info->address);
    510509                        }
    511510                }
  • uspace/drv/usbhub/usbhub.h

    r54d9058 rb53ca1e  
    3636#define DRV_USBHUB_USBHUB_H
    3737
     38#include <ipc/devman.h>
     39#include <usb/usb.h>
     40#include <driver.h>
     41
    3842#define NAME "usbhub"
    39 
    40 #include "usb/hcdhubd.h"
    4143
    4244/** basic information about device attached to hub */
     
    5254        /** attached device handles */
    5355        usb_hub_attached_device_t * attached_devs;
    54         /** General usb device info. */
    55         usb_hcd_attached_device_info_t * usb_device;
     56        /** USB address of the hub. */
     57        usb_address_t address;
    5658        /** General device info*/
    5759        device_t * device;
    58 
    5960} usb_hub_info_t;
    6061
  • uspace/drv/vhc/conn.h

    r54d9058 rb53ca1e  
    3737
    3838#include <usb/usb.h>
    39 #include <usb/hcdhubd.h>
    4039#include <usbhc_iface.h>
    4140#include "vhcd.h"
     
    4443void connection_handler_host(sysarg_t);
    4544
    46 usb_hcd_transfer_ops_t vhc_transfer_ops;
    4745usbhc_iface_t vhc_iface;
    4846
  • uspace/drv/vhc/connhost.c

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

    r54d9058 rb53ca1e  
    3939        src/drvpsync.c \
    4040        src/dump.c \
    41         src/hcdhubd.c \
    42         src/hcdrv.c \
    4341        src/hidparser.c \
    44         src/localdrv.c \
    4542        src/pipes.c \
    4643        src/pipesinit.c \
    4744        src/pipesio.c \
    4845        src/recognise.c \
    49         src/remotedrv.c \
    5046        src/request.c \
    5147        src/usb.c \
  • uspace/lib/usb/include/usb/addrkeep.h

    • Property mode changed from 120000 to 100644
    r54d9058 rb53ca1e  
    1 hcd.h
     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. */
     43typedef 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. */
     53typedef 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
     71void usb_address_keeping_init(usb_address_keeping_t *, usb_address_t);
     72
     73void usb_address_keeping_reserve_default(usb_address_keeping_t *);
     74void usb_address_keeping_release_default(usb_address_keeping_t *);
     75
     76usb_address_t usb_address_keeping_request(usb_address_keeping_t *);
     77int usb_address_keeping_release(usb_address_keeping_t *, usb_address_t);
     78void usb_address_keeping_devman_bind(usb_address_keeping_t *, usb_address_t,
     79    devman_handle_t);
     80usb_address_t usb_address_keeping_find(usb_address_keeping_t *,
     81    devman_handle_t);
     82
     83#endif
     84/**
     85 * @}
     86 */
  • uspace/lib/usb/include/usb/classes/hub.h

    r54d9058 rb53ca1e  
    3737
    3838#include <sys/types.h>
    39 #include <usb/hcdhubd.h>
    40 
    4139
    4240/** Hub class feature selector.
     
    8078    /**
    8179            D1...D0: Logical Power Switching Mode
    82             00: Ganged power switching (all ports power at
     80            00: Ganged power switching (all ports power at
    8381            once)
    8482            01: Individual port power switching
     
    9189            00: Global Over-current Protection. The hub
    9290            reports over-current as a summation of all
    93             ports current draw, without a breakdown of
     91            ports current draw, without a breakdown of
    9492            individual port over-current status.
    9593            01: Individual Port Over-current Protection. The
  • uspace/lib/usb/src/addrkeep.c

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

    r54d9058 rb53ca1e  
    147147        PRINTLINE("bDeviceProtocol = 0x%02x", d->device_protocol);
    148148        PRINTLINE("bMaxPacketSize0 = %d", d->max_packet_size);
    149         PRINTLINE("idVendor = %d", d->vendor_id);
    150         PRINTLINE("idProduct = %d", d->product_id);
     149        PRINTLINE("idVendor = 0x%04x", d->vendor_id);
     150        PRINTLINE("idProduct = 0x%04x", 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.