Changes in / [93fb170c:a523af4] in mainline


Ignore:
Location:
uspace
Files:
1 added
20 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cat/cat.c

    r93fb170c ra523af4  
    144144                        return CMD_SUCCESS;
    145145                case 'H':
    146                         printf("%s", cat_oops);
     146                        printf(cat_oops);
    147147                        return CMD_FAILURE;
    148148                case 't':
    149                         printf("%s", cat_oops);
     149                        printf(cat_oops);
    150150                        return CMD_FAILURE;
    151151                case 'b':
    152                         printf("%s", cat_oops);
     152                        printf(cat_oops);
    153153                        break;
    154154                case 'm':
    155                         printf("%s", cat_oops);
     155                        printf(cat_oops);
    156156                        return CMD_FAILURE;
    157157                }
  • uspace/app/bdsh/cmds/modules/rm/rm.c

    r93fb170c ra523af4  
    227227                }
    228228                memset(buff, 0, sizeof(buff));
    229                 snprintf(buff, len, "%s", argv[i]);
     229                snprintf(buff, len, argv[i]);
    230230
    231231                scope = rm_scope(buff);
  • uspace/drv/rootvirt/devices.def

    r93fb170c ra523af4  
    2323#endif
    2424/* Virtual USB host controller. */
    25 /*
    2625{
    2726        .name = "usbhc",
    2827        .match_id = "usb&hc=vhc"
    2928},
    30 */
  • uspace/drv/uhci/Makefile

    r93fb170c ra523af4  
    2929USPACE_PREFIX = ../..
    3030LIBS = $(LIBDRV_PREFIX)/libdrv.a $(LIBUSB_PREFIX)/libusb.a
    31 EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include -I$(LIBUSB_PREFIX)/include -I.
     31EXTRA_CFLAGS += -I$(LIBDRV_PREFIX)/include -I$(LIBUSB_PREFIX)/include
    3232BINARY = uhci
    3333
    3434SOURCES = \
    35         iface.c \
    3635        main.c \
    37         root_hub/port.c \
    38         root_hub/port_status.c \
    39         root_hub/root_hub.c \
    40         uhci.c \
    41         utils/fibril_semaphore.c \
    42         utils/hc_synchronizer.c
     36        transfers.c
    4337
    4438include $(USPACE_PREFIX)/Makefile.common
  • uspace/drv/uhci/main.c

    r93fb170c ra523af4  
    11/*
    2  * Copyright (c) 2010 Vojtech Horky, Jan Vesely
     2 * Copyright (c) 2010 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2828#include <usb/hcdhubd.h>
    2929#include <usb_iface.h>
     30#include <usb/debug.h>
    3031#include <errno.h>
    31 
    32 #include "debug.h"
    33 #include "iface.h"
    34 #include "name.h"
     32#include <driver.h>
    3533#include "uhci.h"
    3634
     
    5553static int uhci_add_device(device_t *device)
    5654{
    57 //      usb_dprintf(NAME, DEBUG, "uhci_add_device() called\n");
    58         uhci_print_info( "uhci_add_device() called\n" );
     55        usb_dprintf(NAME, 1, "uhci_add_device() called\n");
    5956        device->ops = &uhci_ops;
    6057
    61         uhci_init( device, (void*)0xc020 );
     58        /*
     59         * We need to announce the presence of our root hub.
     60         */
     61        usb_dprintf(NAME, 2, "adding root hub\n");
     62        usb_hcd_add_root_hub(device);
    6263
    6364        return EOK;
     
    7879         * Do some global initializations.
    7980         */
    80         sleep( 5 );
    81         usb_dprintf_enable(NAME, DEBUG_LEVEL_MAX);
     81        sleep(5);
     82        usb_dprintf_enable(NAME, 5);
    8283
    8384        return driver_main(&uhci_driver);
  • uspace/drv/uhci/uhci.h

    r93fb170c ra523af4  
    11/*
    2  * Copyright (c) 2010 Jan Vesely
     2 * Copyright (c) 2010 Vojtech Horky
    33 * All rights reserved.
    44 *
     
    2626 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    2727 */
     28
    2829/** @addtogroup usb
    2930 * @{
     
    3536#define DRV_UHCI_UHCI_H
    3637
    37 #include <fibril.h>
    38 
    39 #include <usb/addrkeep.h>
    40 #include <usb/hcdhubd.h>
    4138#include <usbhc_iface.h>
    4239
    43 #include "root_hub/root_hub.h"
     40#define NAME "uhci"
    4441
    45 typedef struct uhci_regs {
    46         uint16_t usbcmd;
    47         uint16_t usbsts;
    48         uint16_t usbintr;
    49         uint16_t frnum;
    50         uint32_t flbaseadd;
    51         uint8_t sofmod;
    52 } regs_t;
    53 
    54 typedef struct uhci {
    55         usb_address_keeping_t address_manager;
    56         uhci_root_hub_t root_hub;
    57         volatile regs_t* registers;
    58 } uhci_t ;
    59 
    60 /* init uhci specifics in device.driver_data */
    61 int uhci_init( device_t *device, void *regs );
    62 
    63 int uhci_destroy( device_t *device );
    64 
    65 int uhci_in(
    66   device_t *dev,
    67         usb_target_t target,
    68         usb_transfer_type_t transfer_type,
    69         void *buffer, size_t size,
    70         usbhc_iface_transfer_in_callback_t callback, void *arg
    71         );
    72 
    73 int uhci_out(
    74   device_t *dev,
    75         usb_target_t target,
    76   usb_transfer_type_t transfer_type,
    77   void *buffer, size_t size,
    78         usbhc_iface_transfer_out_callback_t callback, void *arg
    79   );
    80 
    81 int uhci_setup(
    82   device_t *dev,
    83   usb_target_t target,
    84   usb_transfer_type_t transfer_type,
    85   void *buffer, size_t size,
    86   usbhc_iface_transfer_out_callback_t callback, void *arg
    87   );
     42usbhc_iface_t uhci_iface;
    8843
    8944#endif
  • uspace/lib/usb/include/usb/devreq.h

    r93fb170c ra523af4  
    7070        /** Main parameter to the request. */
    7171        union {
    72                 uint16_t value;
    7372                /* FIXME: add #ifdefs according to host endianess */
    7473                struct {
     
    7675                        uint8_t value_high;
    7776                };
     77                uint16_t value;
    7878        };
    7979        /** Auxiliary parameter to the request.
  • uspace/lib/usb/include/usb/hcd.h

    • Property mode changed from 120000 to 100644
    r93fb170c ra523af4  
    1 addrkeep.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 usb
     30 * @{
     31 */
     32/** @file
     33 * @brief HC driver.
     34 */
     35#ifndef LIBUSB_HCD_H_
     36#define LIBUSB_HCD_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
     84#endif
  • uspace/lib/usb/src/addrkeep.c

    r93fb170c ra523af4  
    3333 * @brief Address keeping.
    3434 */
    35 #include <usb/addrkeep.h>
     35#include <usb/hcd.h>
    3636#include <errno.h>
    3737#include <assert.h>
Note: See TracChangeset for help on using the changeset viewer.